|
|
|
@ -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(() => {
|
|
|
|
|