|
@@ -170,6 +170,15 @@
|
|
|
<el-input size="small" v-model="scope.row.remark"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="报销凭证" width="135px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div @click="abl(scope.$index)">
|
|
|
+ <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :before-remove="beforeRemove" :http-request="fileonLoad" limit="1" name="multipartFile">
|
|
|
+ <el-button size="small" type="primary" v-if="!scope.row.pic">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column fixed="right"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
@@ -311,7 +320,12 @@
|
|
|
<el-select size="small" v-if="!flg" v-model="scope.row.projectId" placeholder="项目" style="width: 130px">
|
|
|
<el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName" :value="item.id" @click="ok(item)"></el-option>
|
|
|
</el-select>
|
|
|
- <span v-else>{{projectIdName[scope.$index].projectName}}</span>
|
|
|
+ <!-- <span v-else>{{projectIdName[scope.$index].projectName}}</span> -->
|
|
|
+ <div v-else>
|
|
|
+ <div v-for="(item, index) in projectIdName" :key="index">
|
|
|
+ <span v-if="item.id == scope.row.projectId">{{item.projectName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="happenDate" label="费用日期" width="172">
|
|
@@ -363,11 +377,32 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" width="300">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-input size="small" v-if="!flg" v-model="scope.row.remark"></el-input>
|
|
|
<span v-else>{{scope.row.remark}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="pic" label="报销单据" width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="!flg">
|
|
|
+ <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
|
|
|
+ <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic" :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
|
|
|
+ <el-button size="small" type="primary" v-if="!scope.row.pic">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span v-if="scope.row.pic">
|
|
|
+ <div class="tups">
|
|
|
+ <viewer :images="scope.row.pic">
|
|
|
+ <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
|
|
|
+ </viewer>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>暂无单据</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<!-- 删除 -->
|
|
|
<el-table-column fixed="right"
|
|
|
label="操作" v-if="!flg">
|
|
@@ -375,9 +410,11 @@
|
|
|
<el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px" @click="delec(scope.$index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+ <!-- <viewer :images="imgs">
|
|
|
+ <img ref="imgsa" v-for="src in imgs" :src="src.url" :key="src.title">
|
|
|
+ </viewer> -->
|
|
|
<!-- 取消和确定 -->
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialog = false">取 消</el-button>
|
|
@@ -395,8 +432,8 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- addFormRules:{ownerId: [{ required: true, message: "请选择报销人", trigger: "blur" }],},
|
|
|
- isAuditList: false,
|
|
|
+imgs: [],
|
|
|
+addFormRules:{ownerId: [{ required: true, message: "请选择报销人", trigger: "blur" }],}, isAuditList: false,
|
|
|
statusTxt:["审核通过","待审核", "已驳回", "已撤销"],
|
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
allExpList:[],
|
|
@@ -435,7 +472,9 @@ export default {
|
|
|
projectIdName: [], // 点击查看的项目名
|
|
|
flg: false, // 是否禁用
|
|
|
shuz: ['一般费用填报', '差旅费用填报', '外包费用填报'],
|
|
|
- ins: 0
|
|
|
+ ins: 0,
|
|
|
+ apl: '',
|
|
|
+ diz: 'http://worktime.ttkuaiban.com'
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -459,7 +498,7 @@ export default {
|
|
|
filters: {
|
|
|
numberToCurrency(value) {
|
|
|
if (!value) return '0.00'
|
|
|
- console.log('v=='+value);
|
|
|
+ // console.log('v=='+value);
|
|
|
value = value.toFixed(2)
|
|
|
const intPart = Math.trunc(value)
|
|
|
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
|
|
@@ -586,6 +625,17 @@ export default {
|
|
|
},
|
|
|
adds() {
|
|
|
// happenDate
|
|
|
+ // console.log(this.ParticularsList.invoiceList, '123')
|
|
|
+ var spl = this.ParticularsList.invoiceList
|
|
|
+ for(var i in spl) {
|
|
|
+ if(spl[i].pic) {
|
|
|
+ if(spl[i].pic[0].name) {
|
|
|
+ spl[i].pic = spl[i].pic[0].name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log(spl)
|
|
|
+ // return
|
|
|
this.ParticularsList.items = JSON.stringify(this.ParticularsList.invoiceList)//这里要传发票列表的json转string
|
|
|
|
|
|
delete this.ParticularsList.invoiceList
|
|
@@ -662,8 +712,7 @@ export default {
|
|
|
},
|
|
|
// 点击新增
|
|
|
addxz() {
|
|
|
-
|
|
|
- this.form = {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null},
|
|
|
+ this.form = {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null,pic: null},
|
|
|
this.invoiceList.push(this.form)
|
|
|
},
|
|
|
//获取项目列表
|
|
@@ -797,14 +846,30 @@ export default {
|
|
|
this.http.post('/expense-sheet/getDetail', {id: id},
|
|
|
res => {
|
|
|
if (res.code == "ok") {this
|
|
|
- this.ParticularsList = res.data
|
|
|
+ // this.ParticularsList = res.data
|
|
|
var s = []
|
|
|
+ // var b = []
|
|
|
+ for(var i in res.data.invoiceList) {
|
|
|
+ if(res.data.invoiceList[i].pic) {
|
|
|
+ var b = []
|
|
|
+ var j = {}
|
|
|
+ var img = this.diz + '/upload/' + res.data.invoiceList[i].pic
|
|
|
+ j.url = img
|
|
|
+ j.title = '报销凭证',
|
|
|
+ j.name = res.data.invoiceList[i].pic
|
|
|
+ b.push(j)
|
|
|
+ res.data.invoiceList[i].pic = b
|
|
|
+ // console.log(res.data.invoiceList[i].pic)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.ParticularsList = res.data
|
|
|
for(var i = 0; i <= this.ParticularsList.invoiceList.length - 1; i++) {
|
|
|
s.push(this.ParticularsList.invoiceList[i].projectId)
|
|
|
}
|
|
|
this.projectIdName = this.projectList.filter( item => {return s.indexOf(item.id) !== -1})
|
|
|
// this.projectIdName = this.projectList.filter(p => p.id == this.ParticularsList.invoiceList[0].projectId)[0].projectName
|
|
|
- console.log(res.data, '查看当前状态');
|
|
|
+ // console.log(res.data, '查看当前状态');
|
|
|
+ // console.log(this.ParticularsList)
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -921,11 +986,140 @@ export default {
|
|
|
zhis(e) {
|
|
|
var i = e
|
|
|
this.invoiceList[i].taxValue = this.invoiceList[i].taxValue.toFixed(2)
|
|
|
- }
|
|
|
+ },
|
|
|
+ fileonLoad(item) {
|
|
|
+ //首先判断文件类型
|
|
|
+ let str = item.file.name.split(".");
|
|
|
+ let format = str[str.length - 1];
|
|
|
+ if (format != "jpg" && format != "png") {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择图片",
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.listLoading = true;
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("multipartFile", item.file);
|
|
|
+ this.http.uploadFile('/common/uploadFile', formData,
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "上传成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ // this.getList();
|
|
|
+ this.invoiceList[this.apl].pic = res.data
|
|
|
+ // console.log(this.invoiceList)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ abl(e) {
|
|
|
+ this.apl = e
|
|
|
+ },
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ var that = this
|
|
|
+ setTimeout(function () {
|
|
|
+ that.invoiceList[that.apl].pic = null
|
|
|
+ }, 200)
|
|
|
+ },
|
|
|
+ fileonLoads(item) {
|
|
|
+ //首先判断文件类型
|
|
|
+ let str = item.file.name.split(".");
|
|
|
+ let format = str[str.length - 1];
|
|
|
+ if (format != "jpg" && format != "png") {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择图片",
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.listLoading = true;
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("multipartFile", item.file);
|
|
|
+ this.http.uploadFile('/common/uploadFile', formData,
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "上传成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ // this.getList();
|
|
|
+ this.ParticularsList.invoiceList[this.apl].pic = res.data
|
|
|
+ // console.log(this.invoiceList)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRemoves(file, fileList) {
|
|
|
+ var that = this
|
|
|
+ setTimeout(function () {
|
|
|
+ // this.ParticularsList.invoiceList
|
|
|
+ that.ParticularsList.invoiceList[that.apl].pic = null
|
|
|
+ }, 200)
|
|
|
+ },
|
|
|
+ imgUrl(img) {
|
|
|
+ // var imgss = this.diz + '/upload/' + img
|
|
|
+ // var sp = []
|
|
|
+ // var is = {}
|
|
|
+ // is.url = imgss
|
|
|
+ // is.title = 1
|
|
|
+ // sp.push(is)
|
|
|
+ // this.imgs = sp
|
|
|
+ // console.log(imgss)
|
|
|
+ // console.log(this.$refs.imgsa)
|
|
|
+ // this.$refs.imgsa.click()
|
|
|
+ // console.log(location.protocol, location.host)
|
|
|
+ // console.log(location.protocol + '//' + location.host + imgs)
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
+.tups {
|
|
|
+ width: 100%;
|
|
|
+ height: 25px;
|
|
|
+ position: relative;
|
|
|
+ z-index: 99;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.tups img {
|
|
|
+ height: 25px !important;
|
|
|
+ position: relative;
|
|
|
+ z-index: 99;
|
|
|
+}
|
|
|
+.viewer-canvas {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 9 !important;
|
|
|
+}
|
|
|
+.icl {
|
|
|
+ margin-top: -25px !important;
|
|
|
+}
|
|
|
/* 费用报销标题 */
|
|
|
.headine {
|
|
|
width: 100%;
|