diff --git a/src/components/ConnectInvoice/index.vue b/src/components/ConnectInvoice/index.vue index dd35533..841ff67 100644 --- a/src/components/ConnectInvoice/index.vue +++ b/src/components/ConnectInvoice/index.vue @@ -16,7 +16,7 @@
- +
@@ -78,7 +78,8 @@ export default { isExist: Boolean, // 是否存在 tripPartners: Array, // 选中同行人 list: Array, // 列表 - type: [Number, String] + type: [Number, String], + disabled:Boolean }, components: { RePick: () => import('@/components/ReComponents/RePick'), @@ -121,10 +122,12 @@ export default { } }, created() { - this.$nextTick(() => { - this.invoiceIdsCopy = this.invoiceIds - this.getList('init') - }) + // this.$nextTick(() => { + // this.invoiceIdsCopy = this.invoiceIds + // console.log(this.invoiceIds) + // console.log('212121') + // this.getList('init') + // }) }, watch: { isOpen: { @@ -154,21 +157,40 @@ export default { // deep: true, // immediate: true // } + invoiceIds:{ + handler(newData){ + this.invoiceIdsCopy =newData + this.getList('init') + }, + deep:true, + immediate:true + }, }, methods: { handleSetCheck(index,item,type) { + if(this.disabled){ + return; + } // this.tableList let _this = this if(!type){ this.$set(this.tableList[index], 'checked', !this.tableList[index].checked) } + console.log(this.tableList[index].checked) if (this.tableList[index].checked) { if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) { _this.invoiceIdsCopy[_this.invoiceType] = []; } - _this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id) + if (!_this.invoiceIdsCopy[_this.invoiceType].includes(_this.tableList[index].id)) { + _this.invoiceIdsCopy[_this.invoiceType].push(_this.tableList[index].id); + } + // _this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id) } else { - _this.invoiceIdsCopy[_this.invoiceType].splice(index, 1) + _this.invoiceIdsCopy[_this.invoiceType].forEach(function (item,indexs){ + if(item == _this.tableList[index].id){ + _this.invoiceIdsCopy[_this.invoiceType].splice(indexs, 1) + } + }) } this.$forceUpdate() console.log(_this.invoiceIdsCopy) diff --git a/src/views/company/claim/index.vue b/src/views/company/claim/index.vue index 1815eb5..fc086ee 100644 --- a/src/views/company/claim/index.vue +++ b/src/views/company/claim/index.vue @@ -9,7 +9,7 @@ - + @@ -83,10 +83,10 @@
- +
- +
@@ -140,10 +140,10 @@
- +
- +
费用明细超出费控设置金额,费控设置金额为:{{handleCountAmount(form.expenseClaimDetails)}}
@@ -153,10 +153,8 @@ 添加费用
- -
审批流程
- +
申请单关联
@@ -164,6 +162,9 @@
{{form.budgetAmountInfo}}
+ +
审批流程
+ @@ -279,6 +280,7 @@ export default { } ] }, + times:null }; }, // 计算属性 @@ -543,12 +545,13 @@ export default { }) }, handleShowIe(type, index, nIndex) { - if (this.disabled) return + // if (this.disabled) return // this.indexOne = index // this.indexTwo = nIndex // this.claimType = type // let obj = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex] // this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'ieList', arr) + this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', true) console.log('form......', this.form); // this.handleFilterList(obj.invoiceIds || {}).then((arr) => { @@ -556,7 +559,7 @@ export default { // }) }, handleShowIe1(nIndex) { - if (this.disabled) return + // if (this.disabled) return // let obj = this.form.expenseClaimDetails[nIndex] // this.$set(this.form.expenseClaimDetails[nIndex], 'ieList', arr) @@ -566,6 +569,7 @@ export default { // }) }, handleConfirmIe(arr, index, nIndex) { + console.log(arr) // let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('、') this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceIds', arr) this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', false) @@ -573,6 +577,7 @@ export default { this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', this.totalCount(arr) == 0 ? '请关联' : '已关联发票') }, handleConfirmIe1(arr, nIndex) { + console.log(arr) // let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('、') this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceIds', arr) this.$set(this.form.expenseClaimDetails[nIndex], 'show', false) @@ -819,7 +824,8 @@ export default { disabled: item.status != 2 ? true : false } }) - console.log('...', this.expenseApplyList); + console.log(this.expenseApplyList) + console.log('dkldsjlkdsjl') resolve() this.$loading(false) })