|
|
|
@ -82,7 +82,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</van-field>
|
|
|
|
|
<van-field v-model="nitem.remark" :disabled="disabled" name="reason" autosize rows="2" label="备注" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
|
|
|
|
|
<div @click="handleShowIe(index,nIndex)">
|
|
|
|
|
<div @click="handleShowIe('1',index,nIndex)">
|
|
|
|
|
<van-field disabled :class="nitem.invoiceName ? 'actived-disabled tag-blue':'tag-blue'" v-model="nitem.invoiceName" name="reason" autosize rows="2" label="关联发票" clear-trigger="always" input-align="right" placeholder="请关联" />
|
|
|
|
|
</div>
|
|
|
|
|
<!--关联发票 -->
|
|
|
|
@ -207,6 +207,9 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
indexOne:1,
|
|
|
|
|
indexTwo:1,
|
|
|
|
|
claimType:'',
|
|
|
|
|
expenseApplyList: [],
|
|
|
|
|
isShow: false,
|
|
|
|
|
dialogObj: {},
|
|
|
|
@ -253,7 +256,7 @@ export default {
|
|
|
|
|
show: false,
|
|
|
|
|
invoiceName: '',
|
|
|
|
|
ieList: this.ieList,
|
|
|
|
|
invoiceIds: [],
|
|
|
|
|
invoiceIds: {},
|
|
|
|
|
feeType: null,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
invoiceCount: undefined,
|
|
|
|
@ -268,7 +271,7 @@ export default {
|
|
|
|
|
show: false,
|
|
|
|
|
invoiceName: '',
|
|
|
|
|
ieList: this.ieList,
|
|
|
|
|
invoiceIds: [],
|
|
|
|
|
invoiceIds: {},
|
|
|
|
|
feeType: null,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
invoiceCount: undefined,
|
|
|
|
@ -415,6 +418,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.billType === 'RCBX') {
|
|
|
|
|
delete newForm.expenseClaimTrips
|
|
|
|
|
}else {
|
|
|
|
|
delete newForm.expenseClaimDetails
|
|
|
|
|
}
|
|
|
|
|
if (ignoreFeeTip) {
|
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
@ -515,62 +520,79 @@ export default {
|
|
|
|
|
handleFilterList(ids, type) {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
let arr = []
|
|
|
|
|
if (!type) {
|
|
|
|
|
this.form.expenseClaimTrips.forEach(item => {
|
|
|
|
|
item.expenseClaimDetails.forEach(n => {
|
|
|
|
|
n.invoiceIds.forEach(z => {
|
|
|
|
|
arr.push(z)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.form.expenseClaimDetails.forEach(n => {
|
|
|
|
|
n.invoiceIds.forEach(z => {
|
|
|
|
|
arr.push(z)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// if (!type) {
|
|
|
|
|
// this.form.expenseClaimTrips.forEach(item => {
|
|
|
|
|
// item.expenseClaimDetails.forEach(n => {
|
|
|
|
|
// n.invoiceIds.forEach(z => {
|
|
|
|
|
// arr.push(z)
|
|
|
|
|
// })
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// } else {
|
|
|
|
|
// this.form.expenseClaimDetails.forEach(n => {
|
|
|
|
|
// n.invoiceIds.forEach(z => {
|
|
|
|
|
// arr.push(z)
|
|
|
|
|
// })
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
let beforeIds = this.ieList.filter(item => !arr.includes(item.id)) || []
|
|
|
|
|
let noewIds = this.ieList.filter(item => ids.includes(item.id)) || []
|
|
|
|
|
resolve(beforeIds.concat(noewIds))
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleShowIe(index, nIndex) {
|
|
|
|
|
handleShowIe(type,index, nIndex) {
|
|
|
|
|
if (this.disabled) return
|
|
|
|
|
let obj = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex]
|
|
|
|
|
this.handleFilterList(obj.invoiceIds || []).then((arr) => {
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'ieList', arr)
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', true)
|
|
|
|
|
})
|
|
|
|
|
// 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)
|
|
|
|
|
// this.handleFilterList(obj.invoiceIds || {}).then((arr) => {
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
handleShowIe1(nIndex) {
|
|
|
|
|
if (this.disabled) return
|
|
|
|
|
let obj = this.form.expenseClaimDetails[nIndex]
|
|
|
|
|
this.handleFilterList(obj.invoiceIds || [], 1).then((arr) => {
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'ieList', arr)
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'show', true)
|
|
|
|
|
})
|
|
|
|
|
// let obj = this.form.expenseClaimDetails[nIndex]
|
|
|
|
|
|
|
|
|
|
// this.$set(this.form.expenseClaimDetails[nIndex], 'ieList', arr)
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'show', true)
|
|
|
|
|
// this.handleFilterList(obj.invoiceIds || {}, 1).then((arr) => {
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
handleConfirmIe(arr, index, nIndex) {
|
|
|
|
|
let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
// 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)
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', nameArr)
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceCount', arr.length)
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', '以关联发票,请点击查看')
|
|
|
|
|
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr))
|
|
|
|
|
},
|
|
|
|
|
handleConfirmIe1(arr, nIndex) {
|
|
|
|
|
let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
// 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)
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceName', nameArr)
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceCount', arr.length)
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceName', '以关联发票,请点击查看')
|
|
|
|
|
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr))
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
totalCount(obj) {
|
|
|
|
|
let count = 0;
|
|
|
|
|
|
|
|
|
|
for (let key in obj) {
|
|
|
|
|
if (Array.isArray(obj[key])) {
|
|
|
|
|
count += obj[key].length;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return count;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleAddAccount(pIndex, index) {
|
|
|
|
|
this.form.expenseClaimTrips[pIndex].expenseClaimDetails.push({
|
|
|
|
|
invoiceIds: [],
|
|
|
|
|
invoiceIds: {},
|
|
|
|
|
feeType: null,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
invoiceCount: undefined,
|
|
|
|
@ -580,7 +602,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
handleAddAccount1() {
|
|
|
|
|
this.form.expenseClaimDetails.push({
|
|
|
|
|
invoiceIds: [],
|
|
|
|
|
invoiceIds: {},
|
|
|
|
|
feeType: null,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
invoiceCount: undefined,
|
|
|
|
@ -616,18 +638,18 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.form.expenseClaimTrips.forEach(n => {
|
|
|
|
|
n.expenseClaimDetails.forEach(z => {
|
|
|
|
|
let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
this.$set(z, 'show', false)
|
|
|
|
|
this.$set(z, 'invoiceName', nameArr)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.form.expenseClaimDetails.forEach(z => {
|
|
|
|
|
let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
this.$set(z, 'show', false)
|
|
|
|
|
this.$set(z, 'invoiceName', nameArr)
|
|
|
|
|
})
|
|
|
|
|
// this.form.expenseClaimTrips.forEach(n => {
|
|
|
|
|
// n.expenseClaimDetails.forEach(z => {
|
|
|
|
|
// let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
// this.$set(z, 'show', false)
|
|
|
|
|
// this.$set(z, 'invoiceName', nameArr)
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// this.form.expenseClaimDetails.forEach(z => {
|
|
|
|
|
// let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、')
|
|
|
|
|
// this.$set(z, 'show', false)
|
|
|
|
|
// this.$set(z, 'invoiceName', nameArr)
|
|
|
|
|
// })
|
|
|
|
|
console.log('我看了一下累了..', this.form);
|
|
|
|
|
this.fileList = res.data.files || []
|
|
|
|
|
this.isAuthorised = res.data.isAuthorised
|
|
|
|
@ -705,7 +727,7 @@ export default {
|
|
|
|
|
type: 0,
|
|
|
|
|
expenseClaimDetails: [
|
|
|
|
|
{
|
|
|
|
|
invoiceIds: [],
|
|
|
|
|
invoiceIds: {},
|
|
|
|
|
feeType: null,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
invoiceCount: undefined,
|
|
|
|
|