发票选择bug

main-20240105
zfl 7 months ago
parent 230d53030d
commit 00aa1e3fae

@ -16,7 +16,7 @@
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList"> <RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
<div class="new-item-box" v-for="(item,index) in tableList" :key="index"> <div class="new-item-box" v-for="(item,index) in tableList" :key="index">
<div class="new-lf"> <div class="new-lf">
<van-checkbox v-model="item.checked" shape="square"></van-checkbox> <van-checkbox v-model="item.checked" shape="square" @change="handleSetCheck(index,item,true)"></van-checkbox>
<!-- <van-image @click="handleShowImg(item)" width="2.5rem" height="2.5rem" src="https://img01.yzcdn.cn/vant/cat.jpeg" /> --> <!-- <van-image @click="handleShowImg(item)" width="2.5rem" height="2.5rem" src="https://img01.yzcdn.cn/vant/cat.jpeg" /> -->
</div> </div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '01'"> <div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '01'">
@ -156,10 +156,12 @@ export default {
// } // }
}, },
methods: { methods: {
handleSetCheck(index) { handleSetCheck(index,item,type) {
// this.tableList // this.tableList
let _this = this let _this = this
if(!type){
this.$set(this.tableList[index], 'checked', !this.tableList[index].checked) this.$set(this.tableList[index], 'checked', !this.tableList[index].checked)
}
if (this.tableList[index].checked) { if (this.tableList[index].checked) {
if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) { if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) {
_this.invoiceIdsCopy[_this.invoiceType] = []; _this.invoiceIdsCopy[_this.invoiceType] = [];

@ -569,15 +569,15 @@ export default {
// 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], 'invoiceIds', arr)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', false) this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', false)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr)) this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr)==0?'':this.totalCount(arr))
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', '已关联发票') this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', this.totalCount(arr)==0?'请关联':'已关联发票')
}, },
handleConfirmIe1(arr, nIndex) { 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], 'invoiceIds', arr)
this.$set(this.form.expenseClaimDetails[nIndex], 'show', false) this.$set(this.form.expenseClaimDetails[nIndex], 'show', false)
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr)) this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr)==0?'':this.totalCount(arr))
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceName', '已关联发票') this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceName', this.totalCount(arr)==0?'请关联':'已关联发票')
}, },
totalCount(obj) { totalCount(obj) {

Loading…
Cancel
Save