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

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

@ -14,46 +14,46 @@
</van-tabs>
<div class="box-1">
<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-lf">
<van-checkbox v-model="item.checked" shape="square"></van-checkbox>
<!-- <van-image @click="handleShowImg(item)" width="2.5rem" height="2.5rem" src="https://img01.yzcdn.cn/vant/cat.jpeg" /> -->
<div class="new-item-box" v-for="(item,index) in tableList" :key="index">
<div class="new-lf">
<van-checkbox v-model="item.checked" shape="square"></van-checkbox>
<!-- <van-image @click="handleShowImg(item)" width="2.5rem" height="2.5rem" src="https://img01.yzcdn.cn/vant/cat.jpeg" /> -->
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '01'">
<div class="mt5">发票消费类型 {{item.serviceType || '-'}}</div>
<div class="mt5">发票代码 {{item.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{item.invoiceNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">开票日期 {{item.invoiceDate && dayjs(item.invoiceDate).format('YY/MM/DD HH:ss')}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '02'">
<div class="mt5">车票号 {{item.ticketNum || '-'}}</div>
<div class="mt5">始发站 {{item.startingStation || '-'}}</div>
<div class="mt5">到达站 {{item.destinationStation || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">出发日期 {{item.startingDate && dayjs(item.startingDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">车次号 {{item.trainNum || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '03'">
<div class="mt5">姓名 {{item.name || '-'}}</div>
<div class="mt5">始发站 {{item.startingStation || '-'}}</div>
<div class="mt5">目的站 {{item.destinationStation || '-'}}</div>
<div class="mt5">航班号 {{item.flight || '-'}}</div>
<div class="mt5">承运人 {{item.carrier || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '04'">
<div class="mt5">服务商 {{item.serviceProvider || '-'}}</div>
<div class="mt5">行程人手机号 {{item.phone || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 " v-if="item.items && item.items.length > 0"> {{item.items[0].pickupDate && dayjs(item.items[0].pickupDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].startPlace || '-'}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].destinationPlace || '-'}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].city || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '05'">
<div class="mt5">发票代码 {{item.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{item.invoiceNum || '-'}}</div>
<div class="mt5">车牌号 {{item.taxiNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">日期 {{item.startingDate && dayjs(item.startingDate).format('YY/MM/DD HH:ss')}}</div>
</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '01'">
<div class="mt5">发票消费类型 {{item.serviceType || '-'}}</div>
<div class="mt5">发票代码 {{item.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{item.invoiceNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">开票日期 {{item.invoiceDate && dayjs(item.invoiceDate).format('YY/MM/DD HH:ss')}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '02'">
<div class="mt5">车票号 {{item.ticketNum || '-'}}</div>
<div class="mt5">始发站 {{item.startingStation || '-'}}</div>
<div class="mt5">到达站 {{item.destinationStation || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">出发日期 {{item.startingDate && dayjs(item.startingDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">车次号 {{item.trainNum || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '03'">
<div class="mt5">姓名 {{item.name || '-'}}</div>
<div class="mt5">始发站 {{item.startingStation || '-'}}</div>
<div class="mt5">目的站 {{item.destinationStation || '-'}}</div>
<div class="mt5">航班号 {{item.flight || '-'}}</div>
<div class="mt5">承运人 {{item.carrier || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '04'">
<div class="mt5">服务商 {{item.serviceProvider || '-'}}</div>
<div class="mt5">行程人手机号 {{item.phone || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 " v-if="item.items && item.items.length > 0"> {{item.items[0].pickupDate && dayjs(item.items[0].pickupDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].startPlace || '-'}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].destinationPlace || '-'}}</div>
<div class="mt5" v-if="item.items && item.items.length > 0"> {{item.items[0].city || '-'}}</div>
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '05'">
<div class="mt5">发票代码 {{item.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{item.invoiceNum || '-'}}</div>
<div class="mt5">车牌号 {{item.taxiNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">日期 {{item.startingDate && dayjs(item.startingDate).format('YY/MM/DD HH:ss')}}</div>
</div>
</div>
</RMList>
</div>
@ -72,6 +72,7 @@ import {
} from "@/api/bs/invoice";
export default {
props: {
temClaimNo: [Number, String], //
invoiceIds: Object, // id
isOpen: Boolean,
isExist: Boolean, //
@ -107,19 +108,20 @@ export default {
tableList: [],
demo: false,
isShow: false,
invoiceType:'01',
invoiceIdsCopy:{},
invoiceType: '01',
invoiceIdsCopy: {},
moreLoading: false,
refreshing: false,
finished: false,
listQuery:{
listQuery: {
pageNo: 1,
pageSize: 10,
temClaimNo: 0,
}
}
},
created() {
this.$nextTick(()=>{
this.$nextTick(() => {
this.invoiceIdsCopy = this.invoiceIds
this.getList('init')
})
@ -127,6 +129,7 @@ export default {
watch: {
isOpen: {
handler(val) {
console.log('6....1111..', val);
this.isShow = val
if (val) {
this.handleInitList()
@ -157,13 +160,13 @@ export default {
// this.tableList
let _this = this
this.$set(this.tableList[index], 'checked', !this.tableList[index].checked)
if(this.tableList[index].checked){
if(!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)){
if (this.tableList[index].checked) {
if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) {
_this.invoiceIdsCopy[_this.invoiceType] = [];
}
_this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id)
}else {
_this.invoiceIdsCopy[_this.invoiceType].splice(index,1)
} else {
_this.invoiceIdsCopy[_this.invoiceType].splice(index, 1)
}
this.$forceUpdate()
console.log(_this.invoiceIdsCopy)
@ -199,15 +202,20 @@ export default {
this.finished = false
this.getList('refresh')
},
vanTabsChange(){
vanTabsChange() {
this.listQuery.pageNo = 1
this.getList('init')
},
getList(val){
getList(val) {
let _this = this
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)) {
@ -218,9 +226,9 @@ export default {
if (resList.length < this.pageSize) {
this.finished = true
}
if(_this.invoiceIdsCopy && _this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)){
_this.tableList.map(item =>{
item.checked=(_this.invoiceIdsCopy[_this.invoiceType] || []).includes(item.id)
if (_this.invoiceIdsCopy && _this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) {
_this.tableList.map(item => {
item.checked = (_this.invoiceIdsCopy[_this.invoiceType] || []).includes(item.id)
})
}
}).finally(() => {

@ -7,9 +7,9 @@
<div class="bt">发票</div>
</div> -->
<div class="box-cr-row">
<!-- <div class="cr-bt">-->
<!-- <div class="tags" :style="`border: 1px solid ;color:#05A9FF; min-width: 10rem !important;`"> {{getDictDataLabel(DICT_TYPE.BS_INVOICE_KIND,itemData.type) || '未知'}} </div>-->
<!-- </div>-->
<!-- <div class="cr-bt">-->
<!-- <div class="tags" :style="`border: 1px solid ;color:#05A9FF; min-width: 10rem !important;`"> {{getDictDataLabel(DICT_TYPE.BS_INVOICE_KIND,itemData.type) || '未知'}} </div>-->
<!-- </div>-->
<!-- <div class="cr-tt" style="margin-top: 0.3rem;">
{{itemData.invoiceNum}}
</div> -->
@ -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>
@ -99,7 +99,7 @@
<script>
import { mapState, mapGetters, mapMutations } from 'vuex'
import { getDictDataLabel } from "@/utils/dict";
import { deleteInvoice01,deleteInvoice02,deleteInvoice03,deleteInvoice04,deleteInvoice05 } from "@/api/bs/invoice";
import { deleteInvoice01, deleteInvoice02, deleteInvoice03, deleteInvoice04, deleteInvoice05 } from "@/api/bs/invoice";
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -108,8 +108,8 @@ export default {
required: true,
default: () => { }
},
invoiceType:{
default:String
invoiceType: {
default: String
}
},
components: {
@ -138,14 +138,14 @@ export default {
handleShow(id) {
this.$router.push({
path: '/invoice',
query: { id, type: 'show',invoiceType:this.invoiceType }
query: { id, type: 'show', invoiceType: this.invoiceType }
})
},
handleEdit(id) {
this.jumoStudentId = id
this.$router.push({
path: '/invoice',
query: { id, type: 'edit',invoiceType:this.invoiceType }
query: { id, type: 'edit', invoiceType: this.invoiceType }
})
},
handleDel(id) {

@ -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)">
@ -207,9 +207,9 @@ export default {
},
data() {
return {
indexOne:1,
indexTwo:1,
claimType:'',
indexOne: 1,
indexTwo: 1,
claimType: '',
expenseApplyList: [],
isShow: false,
dialogObj: {},
@ -418,7 +418,7 @@ export default {
}
if (this.$route.query.billType === 'RCBX') {
delete newForm.expenseClaimTrips
}else {
} else {
delete newForm.expenseClaimDetails
}
if (ignoreFeeTip) {
@ -542,7 +542,7 @@ export default {
resolve(beforeIds.concat(noewIds))
})
},
handleShowIe(type,index, nIndex) {
handleShowIe(type, index, nIndex) {
if (this.disabled) return
// this.indexOne = index
// this.indexTwo = nIndex
@ -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 => {
// 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);
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, 'invoiceName', nameArr)
})
})
}
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, 'invoiceName', nameArr)
})
}
this.fileList = res.data.files || []
this.isAuthorised = res.data.isAuthorised
this.$nextTick(() => {

Loading…
Cancel
Save