发票判断是否展示修改/删除按钮,claimNo 值为null,表示未关联报销单的发票。

报销单选择关联发票弹框增加传参temClaimNo: 新增时传0,编辑的时候传当前报销单号
main-20240105
123456 8 months ago
parent b046f46587
commit bafab64758

@ -72,6 +72,7 @@ import {
} from "@/api/bs/invoice";
export default {
props: {
temClaimNo: [Number, String], //
invoiceIds: Object, // id
isOpen: Boolean,
isExist: Boolean, //
@ -115,6 +116,7 @@ export default {
listQuery: {
pageNo: 1,
pageSize: 10,
temClaimNo: 0,
}
}
},
@ -127,6 +129,7 @@ export default {
watch: {
isOpen: {
handler(val) {
console.log('6....1111..', val);
this.isShow = val
if (val) {
this.handleInitList()
@ -208,6 +211,11 @@ export default {
this.moreLoading = true
this.$loading(true, 'tableLoading')
const getInvoicePage = this.invoiceType == '01' ? getInvoicePage01 : this.invoiceType == '02' ? getInvoicePage02 : this.invoiceType == '03' ? getInvoicePage03 : this.invoiceType == '04' ? getInvoicePage04 : getInvoicePage05;
if (_this.temClaimNo) {
_this.listQuery.temClaimNo = _this.temClaimNo
} else {
_this.listQuery.temClaimNo = 0
}
getInvoicePage(_this.listQuery).then(res => {
let resList = res.data && res.data.list || []
if (['init', 'refresh'].includes(val)) {

@ -89,8 +89,8 @@
</div>
<div class="box-rt-sb">
<van-icon class="icon-box" v-hasPermi="['bs:invoice:show']" @click="handleShow(itemData.id)" name="eye-o" color="#05A9FF" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:invoice:update']" @click="handleEdit(itemData.id)" name="edit" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:invoice:delete']" @click="handleDel(itemData.id)" name="delete-o" :color="'#EC3359'" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:invoice:update']" v-if="!!!itemData.claimNo" @click="handleEdit(itemData.id)" name="edit" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:invoice:delete']" v-if="!!!itemData.claimNo" @click="handleDel(itemData.id)" name="delete-o" :color="'#EC3359'" size="25" />
</div>
</div>
</div>

@ -5,7 +5,7 @@
<div class="section"> <span class="line"> </span> 基本信息</div>
<div class="trips-box">
<div class="item-box">
<!-- <van-field v-model="form.applyNo" disabled label="单号" clear-trigger="always" input-align="right" /> -->
<van-field v-model="form.claimNo" disabled label="单号" clear-trigger="always" input-align="right" />
<van-field v-model="cn" disabled label="公司名称" clear-trigger="always" input-align="right" />
<van-field v-model="userInfo.nickname" disabled label="申请人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<van-field v-model="userInfo.dept.name" disabled label="申请部门" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
@ -86,7 +86,7 @@
<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>
<!--关联发票 -->
<ConnectInvoice :list="nitem.ieList" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe(arr,index,nIndex)}" />
<ConnectInvoice :list="nitem.ieList" :temClaimNo="form.claimNo" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe(arr,index,nIndex)}" />
</div>
</div>
<div class="add-box" style="margin-bottom:0.3rem" v-if="['edit','add'].includes(typeStr)">
@ -550,6 +550,7 @@ export default {
// 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) => {
//
// })
@ -638,19 +639,22 @@ export default {
}
})
}
// this.form.expenseClaimTrips.forEach(n => {
// n.expenseClaimDetails.forEach(z => {
if (Array.isArray(this.form.expenseClaimTrips)) {
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, 'show', false)
// this.$set(z, 'invoiceName', nameArr)
// })
// })
// this.form.expenseClaimDetails.forEach(z => {
})
})
}
if (Array.isArray(this.form.expenseClaimDetails)) {
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, 'show', false)
// this.$set(z, 'invoiceName', nameArr)
// })
console.log('我看了一下累了..', this.form);
})
}
this.fileList = res.data.files || []
this.isAuthorised = res.data.isAuthorised
this.$nextTick(() => {

Loading…
Cancel
Save