main-20240105 #1

Merged
hym merged 17 commits from main-20240105 into main 9 months ago

@ -0,0 +1,16 @@
# 开发环境
# 页面 title 前缀
VUE_APP_TITLE='链友融财务数字一体化信息系统'
VUE_APP_ENVIRONMENT_TITLE='开发服'
# 页面根路径
BASE_URL='/'
# 网络请求公用地址
VUE_APP_API= '/'
# 请求环境
# 方楠
VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'

@ -0,0 +1,16 @@
# 开发环境
# 页面 title 前缀
VUE_APP_TITLE='链友融财务数字一体化信息系统'
VUE_APP_ENVIRONMENT_TITLE='正式服'
# 页面根路径
BASE_URL='/'
# 网络请求公用地址
VUE_APP_API= '/'
# 请求环境
# 方楠
VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'

@ -5,7 +5,10 @@ ENV = 'development'
VUE_APP_TITLE = 链友融财务数字一体化信息系统
# 链友融财务数字一体化信息系统/开发环境
VUE_APP_BASE_API = 'http://60.204.223.58:8080'
# 测试
#VUE_APP_BASE_API = 'http://60.204.223.58:8080'
# 方楠
VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 链友融财务数字一体化信息系统
# 链友融财务数字一体化信息系统/开发环境
VUE_APP_BASE_API = 'http://60.204.223.58:8080'
VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

4
.gitignore vendored

@ -7,8 +7,8 @@ package-lock.json
# local env files
.env.local
.env.*.local
.env.production
.env.development
# .env.production
# .env.development
# Log files
npm-debug.log*

@ -69,3 +69,357 @@ export function invoiceCheckApi(data) {
data: data
})
}
export function createInvoice01(data) {
return request({
url: '/bs/invoice01/create',
method: 'post',
data: data
})
}
// 更新我的发票
export function updateInvoice01(data) {
return request({
url: '/bs/invoice01/update',
method: 'put',
data: data
})
}
// 删除我的发票
export function deleteInvoice01(id) {
return request({
url: '/bs/invoice01/delete?id=' + id,
method: 'delete'
})
}
// 获得我的发票
export function getInvoice01(id) {
return request({
url: '/bs/invoice01/myget?id=' + id,
method: 'get'
})
}
// 获得我的发票分页
export function getInvoicePage01(query) {
return request({
url: '/bs/invoice01/mypage',
method: 'get',
params: query
})
}
// 导出我的发票 Excel
export function exportInvoiceExcel01(query) {
return request({
url: '/bs/invoice01/myexport-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 发票识别
export function invoiceScanApi01(data) {
return request({
url: '/bs/invoice01/identify',
method: 'post',
data: data
})
}
// 发票验真
export function invoiceCheckApi01(data) {
return request({
url: '/bs/invoice01/isreal ',
method: 'post',
data: data
})
}
//02
// 创建我的发票
export function createInvoice02(data) {
return request({
url: '/bs/invoice02/create',
method: 'post',
data: data
})
}
// 更新我的发票
export function updateInvoice02(data) {
return request({
url: '/bs/invoice02/update',
method: 'put',
data: data
})
}
// 删除我的发票
export function deleteInvoice02(id) {
return request({
url: '/bs/invoice02/delete?id=' + id,
method: 'delete'
})
}
// 获得我的发票
export function getInvoice02(id) {
return request({
url: '/bs/invoice02/myget?id=' + id,
method: 'get'
})
}
// 获得我的发票分页
export function getInvoicePage02(query) {
return request({
url: '/bs/invoice02/mypage',
method: 'get',
params: query
})
}
// 导出我的发票 Excel
export function exportInvoiceExcel02(query) {
return request({
url: '/bs/invoice02/myexport-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 发票识别
export function invoiceScanApi02(data) {
return request({
url: '/bs/invoice02/identify',
method: 'post',
data: data
})
}
// 发票验真
export function invoiceCheckApi02(data) {
return request({
url: '/bs/invoice02/isreal ',
method: 'post',
data: data
})
}
//03
// 创建我的发票
export function createInvoice03(data) {
return request({
url: '/bs/invoice03/create',
method: 'post',
data: data
})
}
// 更新我的发票
export function updateInvoice03(data) {
return request({
url: '/bs/invoice03/update',
method: 'put',
data: data
})
}
// 删除我的发票
export function deleteInvoice03(id) {
return request({
url: '/bs/invoice03/delete?id=' + id,
method: 'delete'
})
}
// 获得我的发票
export function getInvoice03(id) {
return request({
url: '/bs/invoice03/myget?id=' + id,
method: 'get'
})
}
// 获得我的发票分页
export function getInvoicePage03(query) {
return request({
url: '/bs/invoice03/mypage',
method: 'get',
params: query
})
}
// 导出我的发票 Excel
export function exportInvoiceExcel03(query) {
return request({
url: '/bs/invoice03/myexport-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 发票识别
export function invoiceScanApi03(data) {
return request({
url: '/bs/invoice03/identify',
method: 'post',
data: data
})
}
// 发票验真
export function invoiceCheckApi03(data) {
return request({
url: '/bs/invoice03/isreal ',
method: 'post',
data: data
})
}
//04
// 创建我的发票
export function createInvoice04(data) {
return request({
url: '/bs/invoice04/create',
method: 'post',
data: data
})
}
// 更新我的发票
export function updateInvoice04(data) {
return request({
url: '/bs/invoice04/update',
method: 'put',
data: data
})
}
// 删除我的发票
export function deleteInvoice04(id) {
return request({
url: '/bs/invoice04/delete?id=' + id,
method: 'delete'
})
}
// 获得我的发票
export function getInvoice04(id) {
return request({
url: '/bs/invoice04/myget?id=' + id,
method: 'get'
})
}
// 获得我的发票分页
export function getInvoicePage04(query) {
return request({
url: '/bs/invoice04/mypage',
method: 'get',
params: query
})
}
// 导出我的发票 Excel
export function exportInvoiceExcel04(query) {
return request({
url: '/bs/invoice04/myexport-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 发票识别
export function invoiceScanApi04(data) {
return request({
url: '/bs/invoice04/identify',
method: 'post',
data: data
})
}
// 发票验真
export function invoiceCheckApi04(data) {
return request({
url: '/bs/invoice04/isreal ',
method: 'post',
data: data
})
}
//05
// 创建我的发票
export function createInvoice05(data) {
return request({
url: '/bs/invoice05/create',
method: 'post',
data: data
})
}
// 更新我的发票
export function updateInvoice05(data) {
return request({
url: '/bs/invoice05/update',
method: 'put',
data: data
})
}
// 删除我的发票
export function deleteInvoice05(id) {
return request({
url: '/bs/invoice05/delete?id=' + id,
method: 'delete'
})
}
// 获得我的发票
export function getInvoice05(id) {
return request({
url: '/bs/invoice05/myget?id=' + id,
method: 'get'
})
}
// 获得我的发票分页
export function getInvoicePage05(query) {
return request({
url: '/bs/invoice05/mypage',
method: 'get',
params: query
})
}
// 导出我的发票 Excel
export function exportInvoiceExcel05(query) {
return request({
url: '/bs/invoice05/myexport-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 发票识别
export function invoiceScanApi05(data) {
return request({
url: '/bs/invoice05/identify',
method: 'post',
data: data
})
}
// 发票验真
export function invoiceCheckApi05(data) {
return request({
url: '/bs/invoice05isreal ',
method: 'post',
data: data
})
}

@ -1,4 +1,5 @@
import request from '@/plugin/axios'
import { getRefreshToken } from '@/utils/auth'
// 登录
export function loginIn(data) {
return request({
@ -45,4 +46,13 @@ export function reqCheck(data) {
})
}
// 刷新访问令牌
export function refreshToken() {
return request({
url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken(),
method: 'post'
})
}

@ -73,7 +73,7 @@
color: #05a9ff;
margin-left: 0.5rem;
display: flex;
align-items: end;
align-items: flex-end;
font-size: 0.8rem;
::v-deep .van-icon {

@ -58,6 +58,30 @@
}
}
.box-cr-row {
// max-width: 50%;
//width: 10rem;
text-align: left;
.cr-tt {
font-size: 1rem;
}
.mt5 {
margin-top: 0.3rem;
}
.tags {
border-radius: 0.2rem;
width: 4rem;
text-align: center;
}
.ct-md {
// color: #ccc;
}
}
.box-rt {
display: flex;
@ -67,6 +91,19 @@
// flex-direction: column;
}
}
.box-rt-sb {
display: flex;
justify-content: space-between;
padding-left: 4rem;
padding-right: 4rem;
.icon-box {
margin-left: 0.3rem;
}
// flex-direction: column;
}
}

@ -5,21 +5,56 @@
<div class="Re-select-header-title">发票关联</div>
<div class="Re-select-header-confirm" @click="handleConfirm"></div>
</div>
<van-tabs v-model="invoiceType" :swipe-threshold="4" @change="vanTabsChange">
<van-tab name="01" title="增值税发票" />
<van-tab name="02" title="火车票" />
<van-tab name="03" title="飞机行程票" />
<van-tab name="04" title="网约车行程单" />
<van-tab name="05" title="出租车发票" />
</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-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)">
<div>发票代码 {{item.invoiceCode}}</div>
<div>发票号码 {{item.invoiceNum}}</div>
<div>开票日期 {{ item.invoiceDate ? dayjs(item.invoiceDate).format('YYYY/MM/DD') : ''}}</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 class="new-rt" @click="handleNewDel(index)">
<van-icon name="delete-o" size="20" />
</div> -->
</div>
</RMList>
</div>
</van-popup>
@ -28,9 +63,16 @@
<script>
import dayjs from 'dayjs';
import { ImagePreview } from 'vant';
import {
getInvoicePage01,
getInvoicePage02,
getInvoicePage03,
getInvoicePage04,
getInvoicePage05
} from "@/api/bs/invoice";
export default {
props: {
invoiceIds: Array, // id
invoiceIds: Object, // id
isOpen: Boolean,
isExist: Boolean, //
tripPartners: Array, //
@ -39,8 +81,8 @@ export default {
},
components: {
RePick: () => import('@/components/ReComponents/RePick'),
RMList: () => import('@/components/ReComponents/RMList'),
},
//
computed: {
// tableList() {
@ -65,8 +107,23 @@ export default {
tableList: [],
demo: false,
isShow: false,
invoiceType:'01',
invoiceIdsCopy:{},
moreLoading: false,
refreshing: false,
finished: false,
listQuery:{
pageNo: 1,
pageSize: 10,
}
}
},
created() {
this.$nextTick(()=>{
this.invoiceIdsCopy = this.invoiceIds
this.getList('init')
})
},
watch: {
isOpen: {
handler(val) {
@ -79,26 +136,37 @@ export default {
deep: true,
immediate: true
},
list: {
handler(val) {
if (val && val.length) {
let arr = (this.list || []).map(item => {
return {
...item,
checked: (this.invoiceIds || []).includes(item.id)
}
})
this.tableList = JSON.parse(JSON.stringify(arr))
}
},
deep: true,
immediate: true
}
// list: {
// handler(val) {
// if (val && val.length) {
// let arr = (this.list || []).map(item => {
// return {
// ...item,
// checked: (this.invoiceIds || []).includes(item.id)
// }
// })
// this.tableList = JSON.parse(JSON.stringify(arr))
// }
// },
// deep: true,
// immediate: true
// }
},
methods: {
handleSetCheck(index) {
// 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)){
_this.invoiceIdsCopy[_this.invoiceType] = [];
}
_this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id)
}else {
_this.invoiceIdsCopy[_this.invoiceType].splice(index,1)
}
this.$forceUpdate()
console.log(_this.invoiceIdsCopy)
},
handleShowImg() {
ImagePreview(['https://img01.yzcdn.cn/vant/apple-1.jpg']);
@ -112,8 +180,8 @@ export default {
},
handleConfirm() {
let arr = (this.tableList.filter(item => item.checked)).map(item => item.id) || []
this.$emit('onConfirm', arr)
// let arr = (this.tableList.filter(item => item.checked)).map(item => item.id) || []
this.$emit('onConfirm', this.invoiceIdsCopy)
},
hanleCancel() {
@ -122,8 +190,47 @@ export default {
handleDel(index) {
this.form.tripPartners.splice(index, 1)
},
handleLoad() {
this.listQuery.pageNo += 1
this.getList('more')
},
handleRefresh() {
this.listQuery.pageNo = 1
this.finished = false
this.getList('refresh')
},
vanTabsChange(){
this.listQuery.pageNo = 1
this.getList('init')
},
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;
getInvoicePage(_this.listQuery).then(res => {
let resList = res.data && res.data.list || []
if (['init', 'refresh'].includes(val)) {
this.tableList = resList
} else {
this.tableList = this.tableList.concat(resList)
}
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)
})
}
}).finally(() => {
this.$nextTick(() => {
this.moreLoading = false
this.refreshing = false
this.$loading(false, 'tableLoading')
})
})
}
},
}
</script>
@ -160,7 +267,7 @@ export default {
.box-2 {
margin-top: 1rem;
box-sizing: border-box;
padding: 0.5rem 1rem;
//padding: 0.5rem 1rem;
padding-top: 0;
max-height: 50vh;
overflow: auto;
@ -184,13 +291,14 @@ export default {
.box-1 {
@extend .box-2;
.new-item-box {
width: 100%;
width: calc(100% - 2rem);
display: flex;
justify-content: flex-start;
box-sizing: border-box;
// padding: 0.5rem;
margin: 0.5rem 0;
margin: 1rem;
border-radius: 0.5rem;
//border: 1px solid #ccc;
box-shadow: 0 0 0.5rem 0.2rem #ccc;
align-items: center;
padding: 0.5rem;

@ -6,33 +6,91 @@
<van-image width="3rem" height="3rem" fit="cover" :src="require('@/assets/images/invoice.png')" />
<div class="bt">发票</div>
</div> -->
<div class="box-cr">
<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="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-tt" style="margin-top: 0.3rem;">
{{itemData.invoiceNum}}
</div> -->
<div class="ct-md">
<div class="mt5">
不含税金额 {{itemData.excludingTaxAmount || '-'}}
</div>
<div class="mt5">
发票代码 {{itemData.invoiceCode || '-'}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
开票日期 {{itemData.invoiceDate && dayjs(itemData.invoiceDate).format('YY/MM/DD HH:ss')}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
验真状态 {{ itemData.status == 1 ? '已验真' : '未验真' }}
</div>
<div class="ct-md" v-if="invoiceType == '01'">
<div class="mt5">发票消费类型 {{itemData.serviceType || '-'}}</div>
<div class="mt5">发票代码 {{itemData.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{itemData.invoiceNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">开票日期 {{itemData.invoiceDate && dayjs(itemData.invoiceDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">不含税金额 {{itemData.totalAmount || '-'}}</div>
<div class="mt5">价税合计 {{itemData.amountInFiguers || '-'}}</div>
<div class="mt5">税额 {{itemData.totalTax || '-'}}</div>
<div class="mt5">发票种类 {{itemData.invoiceType || '-'}}</div>
<div class="mt5">购方名称 {{itemData.purchaserName || '-'}}</div>
<div class="mt5">购方纳税人识别号 {{itemData.purchaserRegisterNum || '-'}}</div>
<div class="mt5">税率 {{itemData.commodityTaxRate || '-'}}</div>
<div class="mt5">是否代开 {{itemData.agent || '-'}}</div>
<div class="mt5">销售方名称 {{itemData.sellerName || '-'}}</div>
<div class="mt5">销售方纳税人识别号 {{itemData.sellerRegisterNum || '-'}}</div>
</div>
<div class="ct-md" v-if="invoiceType == '02'">
<div class="mt5">车票号 {{itemData.ticketNum || '-'}}</div>
<div class="mt5">始发站 {{itemData.startingStation || '-'}}</div>
<div class="mt5">到达站 {{itemData.destinationStation || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">出发日期 {{itemData.startingDate && dayjs(itemData.startingDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">车次号 {{itemData.trainNum || '-'}}</div>
<div class="mt5">车票金额 {{itemData.ticketRates || '-'}}</div>
<div class="mt5">乘客姓名 {{itemData.name || '-'}}</div>
<div class="mt5">时间 {{itemData.startingTime || '-'}}</div>
<div class="mt5">座位号 {{itemData.seatNum || '-'}}</div>
</div>
<div class="ct-md" v-if="invoiceType == '03'">
<div class="mt5">姓名 {{itemData.name || '-'}}</div>
<div class="mt5">始发站 {{itemData.startingStation || '-'}}</div>
<div class="mt5">目的站 {{itemData.destinationStation || '-'}}</div>
<div class="mt5">航班号 {{itemData.flight || '-'}}</div>
<div class="mt5">承运人 {{itemData.carrier || '-'}}</div>
<div class="mt5">座位等级 {{itemData.seatClass || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">日期 {{itemData.startingDate && dayjs(itemData.startingDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">时间 {{itemData.startingTime || '-'}}</div>
<div class="mt5">电子客票号码 {{itemData.ticketNumber || '-'}}</div>
<div class="mt5">票价 {{itemData.fare || '-'}}</div>
<div class="mt5">燃油附加费 {{itemData.fuelSurcharge || '-'}}</div>
<div class="mt5">民航发展基金/基建费 {{itemData.devFund || '-'}}</div>
<div class="mt5">合计金额 {{itemData.ticketRates || '-'}}</div>
<div class="mt5">签注 {{itemData.endorsement || '-'}}</div>
</div>
<div class="ct-md" v-if="invoiceType == '04'">
<div class="mt5">服务商 {{itemData.serviceProvider || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">行程开始时间 {{itemData.startTime && dayjs(itemData.startTime).format('YY/MM/DD HH:ss')}}</div>
<div style="margin-top: 0.3rem;color:#333 ">行程结束时间 {{itemData.endTime && dayjs(itemData.endTime).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">行程人手机号 {{itemData.phone || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">申请日期 {{itemData.applicationDate && dayjs(itemData.applicationDate).format('YY/MM/DD HH:ss')}}</div>
<div style="margin-top: 0.3rem;color:#333 " v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].pickupDate && dayjs(itemData.items[0].pickupDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].carType || '-'}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].distance || '-'}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].startPlace || '-'}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].destinationPlace || '-'}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].city || '-'}}</div>
<div class="mt5" v-if="itemData.items && itemData.items.length > 0"> {{itemData.items[0].fare || '-'}}</div>
<div class="mt5">总金额 {{itemData.totalFare || '-'}}</div>
</div>
<div class="ct-md" v-if="invoiceType == '05'">
<div class="mt5">发票代码 {{itemData.invoiceCode || '-'}}</div>
<div class="mt5">发票号码 {{itemData.invoiceNum || '-'}}</div>
<div class="mt5">车牌号 {{itemData.taxiNum || '-'}}</div>
<div style="margin-top: 0.3rem;color:#333 ">日期 {{itemData.startingDate && dayjs(itemData.startingDate).format('YY/MM/DD HH:ss')}}</div>
<div class="mt5">上车时间 {{itemData.pickupTime || '-'}}</div>
<div class="mt5">下车时间 {{itemData.dropoffTime || '-'}}</div>
<div class="mt5">总金额 {{itemData.totalFare || '-'}}</div>
<div class="mt5">开票城市 {{itemData.location || '-'}}</div>
<div class="mt5">单价 {{itemData.pricePerkm || '-'}}</div>
<div class="mt5">里程 {{itemData.distance || '-'}}</div>
</div>
</div>
<div class="box-rt">
<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" />
</div>
</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" />
</div>
</div>
</div>
@ -41,7 +99,7 @@
<script>
import { mapState, mapGetters, mapMutations } from 'vuex'
import { getDictDataLabel } from "@/utils/dict";
import { deleteInvoice, } from "@/api/bs/invoice";
import { deleteInvoice01,deleteInvoice02,deleteInvoice03,deleteInvoice04,deleteInvoice05 } from "@/api/bs/invoice";
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -50,7 +108,9 @@ export default {
required: true,
default: () => { }
},
invoiceType:{
default:String
}
},
components: {
@ -78,14 +138,14 @@ export default {
handleShow(id) {
this.$router.push({
path: '/invoice',
query: { id, type: 'show' }
query: { id, type: 'show',invoiceType:this.invoiceType }
})
},
handleEdit(id) {
this.jumoStudentId = id
this.$router.push({
path: '/invoice',
query: { id, type: 'edit' }
query: { id, type: 'edit',invoiceType:this.invoiceType }
})
},
handleDel(id) {
@ -94,6 +154,7 @@ export default {
message: '你确定要删除吗?',
})
.then(() => {
const deleteInvoice = this.invoiceType == '01' ? deleteInvoice01 : this.invoiceType == '02' ? deleteInvoice02 : this.invoiceType == '03' ? deleteInvoice03 : this.invoiceType == '04' ? deleteInvoice04 : deleteInvoice05;
deleteInvoice(id).then(() => {
this.$emit('onAllRefresh')
})

@ -2,34 +2,70 @@
<template>
<div class="upload-box">
<div class="box-lf">
<van-uploader accept="*" :disabled="isChecked" v-model="localFileList" @click-preview="handleClickUpload" :before-read="handleFileBeforeRead" :before-delete="handleBeforeDel" :max-count="1" :after-read="handleAfterRead" />
<van-uploader accept="*" :disabled="isChecked" v-model="localFileList" @click-preview="handleClickUpload" :before-read="handleFileBeforeRead" :before-delete="handleBeforeDel" :max-count="1" :after-read="handleAfterRead">
<template #preview-cover="{ file }" v-if="checkFileType(localFileList)">
<div class="preview-cover">{{handleFilter(localFileList)}}</div>
</template>
</van-uploader>
<div class="up-tt">支持pngpdfjpg格式上传</div>
</div>
<div class="box-rt">
<van-button type="info" icon="scan" :disabled="isChecked || disabled" @click="handleScan" native-type="button" class="btn-box" round size="small">发票识别</van-button>
<van-button type="info" icon="label-o" :disabled="isChecked || disabled" @click="handleCheck" native-type="button" class="btn-box" round size="small"> {{isChecked ? '已验真' : '验真'}}</van-button>
<van-button v-if="type == '01'" type="info" icon="label-o" :disabled="isChecked || disabled" @click="handleCheck" native-type="button" class="btn-box" round size="small"> {{isChecked ? '' : ''}}</van-button>
</div>
</div>
</template>
<script>
import { uploadFileApi } from '@/api/common'
import { invoiceScanApi, invoiceCheckApi } from "@/api/bs/invoice";
import {
createInvoice01,
updateInvoice01,
getInvoice01,
invoiceScanApi01,
invoiceCheckApi01,
createInvoice02,
updateInvoice02,
getInvoice02,
invoiceScanApi02,
invoiceCheckApi02,
createInvoice03,
updateInvoice03,
getInvoice03,
invoiceScanApi03,
invoiceCheckApi03,
createInvoice04,
updateInvoice04,
getInvoice04,
invoiceScanApi04,
invoiceCheckApi04,
createInvoice05,
updateInvoice05,
getInvoice05,
invoiceScanApi05,
invoiceCheckApi05,
} from "@/api/bs/invoice";
export default {
name: '',
props: {
typeStr: String,
fileList: Array,
isOpen: Boolean,
isChecked: Boolean,
// isChecked: Boolean,
disabled: Boolean,
scanRes: Object,
type: String
},
watch: {
fileList: {
handler(list) {
// this.localFileList = list
this.localFileList = list
// if (Array.isArray(this.localFileList) && this.localFileList.length) {
// let url = localFileList[0].url
// if ()
// console.log('localFileList...', this.localFileList);
// }
this.uploadList = list
},
deep: true,
@ -42,6 +78,7 @@ export default {
imgTypeArr: ['image/jpeg', 'image/jpg', 'image/png', 'application/pdf'],
localFileList: [], //
uploadList: [], //
isChecked: false
}
},
@ -51,6 +88,24 @@ export default {
methods: {
handleFilter(file) {
let str = ''
if (file.length) {
let url = file[0].url
str = url.split('/baoxiao/')[1]
}
return str
},
checkFileType(file) {
let flag = false
if (file.length) {
let url = file[0].url
if (url.indexOf('pdf') > -1) {
flag = true
}
}
return flag
},
handleClickUpload(file) {
const { url } = file
if (url) {
@ -72,27 +127,33 @@ export default {
return true
},
beginCheck() {
console.log('我进来验证了')
this.$loading(true)
let form = {}
const invoiceCheckApi = this.type == '01' ? invoiceCheckApi01 : this.type == '02' ? invoiceCheckApi02 : this.type == '03' ? invoiceCheckApi03 : this.type == '04' ? invoiceCheckApi04 : invoiceCheckApi05;
invoiceCheckApi(this.scanRes).then((res) => {
if (res.data) {
form.checkCode = 2
form.isChecked = true
this.$sm(`${res.msg}`)
form.status = 1
} else {
form.status = 0
form.checkCode = 1
form.isChecked = false
this.$fm(`${res.msg}`)
// if (res.data) {
// form.checkCode = 2
// form.isChecked = true
// this.$sm(`${res.msg}`)
// form.status = 1
// } else {
// form.status = 0
// form.checkCode = 1
// form.isChecked = false
// this.$fm(`${res.msg}`)
// }
if (res.data == 2 || res.data == 3) {
this.isChecked = true
}
this.$emit('endCheck', form)
this.$emit('endCheck', res.data)
this.$loading(false)
}).catch(() => {
form.isChecked = false
form.status = 0
form.checkCode = 0
this.$emit('endCheck', form)
this.isChecked = false
// this.form.status = 0
// form.status = 0
// form.checkCode = 0
this.$emit('endCheck', 0)
this.$loading(false)
})
},
@ -109,8 +170,10 @@ export default {
this.$fm('请先上传发票!')
} else {
const { url } = this.uploadList[0]
// let url = 'https://p8.itc.cn/q_70/images03/20210420/b5e2b7a15457406bb48135828b8fea03.jpeg'
this.$loading(true)
invoiceScanApi({ url }).then((res) => {
const invoiceScanApi = this.type == '01' ? invoiceScanApi01 : this.type == '02' ? invoiceScanApi02 : this.type == '03' ? invoiceScanApi03 : this.type == '04' ? invoiceScanApi04 : invoiceScanApi05;
invoiceScanApi({ url, type: this.type }).then((res) => {
// this.scanRes = res.data
this.$emit('scanRes', res)
this.$loading(false)
@ -167,6 +230,15 @@ export default {
</script>
<style lang='scss' scoped>
::v-deep .preview-cover {
height: 100%;
background: #fafafa;
display: flex;
justify-items: center;
align-items: center;
text-align: center;
width: 100%;
}
.upload-box {
width: 100%;
display: flex;

@ -34,9 +34,9 @@ Vue.use(directive)
Vue.prototype.$forceCloseLoading = handleForceCloseLoading
Vue.use(pluginPermission)
Vue.use(VueClipboard)
// if (window.location.href.indexOf('localhost') === -1 && window.location.href.indexOf('www.joineast.com') === -1) {
// new VConsole()
// }
if (window.location.href.indexOf('localhost') === -1 && window.location.href.indexOf('www.joineast.com') === -1) {
new VConsole()
}
Vue.prototype.$EventBus = new Vue() // 注册全局EventBus
Vue.prototype.$compressFile = compressFile

@ -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,
@ -781,7 +803,8 @@ export default {
this.expenseApplyList = (list || []).map((item, index) => {
return {
id: item.id,
title: `序号:${index + 1} 编号:${item.applyNo}申请人:${item.nickname}行程路线:${item.rode}出差天数:${item.tripDay || 0}`
title: `序号:${index + 1} 编号:${item.applyNo}申请人:${item.nickname}行程路线:${item.rode}出差天数:${item.tripDay || 0}`,
disabled: item.status != 2 ? true : false
}
})
resolve()

@ -5,20 +5,83 @@
<div class="section mt5"> <span class="line"> </span>发票</div>
<div class="trips-box">
<div class="item-box">
<UploadImagePdf ref="UploadImagePdf" @endCheck="handelEndCheck" :disabled="disabled || form.status == 1" :fileList="fileList" :isChecked="isChecked" @onCheck="handleCheck" :scanRes="scanRes" @scanRes="hanadleScanRes" @onConfirm="handleImgConfirm" />
<UploadImagePdf ref="UploadImagePdf" @endCheck="handelEndCheck" :type="invoiceType" :disabled="disabled || form.status == 1" :fileList="fileList" :isChecked="isChecked" @onCheck="handleCheck" :scanRes="scanRes" @scanRes="hanadleScanRes" @onConfirm="handleImgConfirm" />
</div>
<div class=""></div>
</div>
<div class="section"> <span class="line"> </span> 基本信息</div>
<div class="trips-box">
<div class="item-box">
<RePick v-model="form.type" label="发票类型" :disabled="isChecked || disabled" :name="`type`" :list="stateList" isRequrie title="发票类型" titleKey="label" idKey="value" isCell clearable />
<div class="item-box" v-if="invoiceType == '01'">
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.serviceType ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.serviceType" @click="handleServiceTypeShow" label="发票消费类型" required clear-trigger="always" input-align="right" />
<van-field v-model="form.invoiceCode" label="发票代码" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.invoiceNum" label="发票号码" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.invoiceDate ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.invoiceDate1" @click="handleDateShow('invoiceDate')" label="开票日期" required clear-trigger="always" input-align="right" />
<van-field v-model="form.totalTax" label="税额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.totalAmount" label="不含税金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.amountInFiguers" label="价税合计" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.sellerName" label="销售方名称" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.invoiceType ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.invoiceType" @click="handleInvoiceTypeShow" label="发票种类" required clear-trigger="always" input-align="right" />
<van-field v-model="form.purchaserName" label="购方名称" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.purchaserRegisterNum" label="购方纳税人识别号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.commodityTaxRate" label="税率" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.agent ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.agent1" @click="handleAgentTypeShow" label="是否代开" required clear-trigger="always" input-align="right" />
<van-field v-model="form.sellerRegisterNum" label="销售方纳税人识别号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
</div>
<div class="item-box" v-if="invoiceType == '02'">
<van-field v-model="form.ticketNum" label="车票号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.startingStation" label="始发站" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.destinationStation" label="到达站" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startingDate ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startingDate1" @click="handleDateShow('startingDate')" label="出发日期" required clear-trigger="always" input-align="right" />
<van-field v-model="form.trainNum" label="车次号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.ticketRates" label="车票金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.name" label="乘客姓名" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startingTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startingTime" @click="handleTimeShow('startingTime',form.startingTime)" label="时间" required clear-trigger="always" input-align="right" />
<van-field v-model="form.seatNum" label="座位号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
</div>
<div class="item-box" v-if="invoiceType == '03'">
<van-field v-model="form.name" label="姓名" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.startingStation" label="始发站" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.destinationStation" label="目的站" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.flight" label="航班号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.carrier" label="承运人" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.seatClass" label="座位等级" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startingDate ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startingDate1" @click="handleDateShow('startingDate')" label="日期" required clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startingTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startingTime" @click="handleTimeShow('startingTime',form.startingTime)" label="时间" required clear-trigger="always" input-align="right" />
<van-field v-model="form.ticketNumber" label="电子客票号码" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.fare" label="票价" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.fuelSurcharge" label="燃油附加费" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.devFund" label="民航发展基金/基建费" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.endorsement" label="签注" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.ticketRates" label="合计金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
</div>
<div class="item-box" v-if="invoiceType == '04'">
<van-field v-model="form.serviceProvider" label="服务商" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="行程开始时间" required clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="行程结束时间" required clear-trigger="always" input-align="right" />
<van-field v-model="form.phone" label="行程人手机号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.applicationDate ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.applicationDate1" @click="handleDateShow('applicationDate')" label="申请日期" required clear-trigger="always" input-align="right" />
<van-field v-model="form.totalFare" label="总金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<div v-for="(items,index) in form.items">
<span style="padding: 10px 0;font-size: 12px;font-weight: bold">行程 {{index+1}}</span>
<van-field v-model="items.carType" label="车型" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="items.distance" label="里程" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="items.startPlace" label="起点" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="items.destinationPlace" label="终点" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="items.city" label="城市" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="items.fare" label="金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
</div>
</div>
<div class="item-box" v-if="invoiceType == '05'">
<van-field v-model="form.invoiceCode" label="发票代码" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.invoiceNum" label="发票号码" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.time ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.time" @click="handleDateShow" label="开票日期" required clear-trigger="always" input-align="right" />
<van-field v-model="form.taxAmount" @blur="handleBlur1" type="number" placeholder="请输入" :disabled="isChecked || disabled" input-align="right" :rules="[{ required: false, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="税额" />
<van-field v-model="form.excludingTaxAmount" @blur="handleBlur2" type="number" placeholder="请输入" :disabled="isChecked || disabled" input-align="right" :rules="[{ required: false, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="不含税金额" />
<van-field v-model="form.totalAmount" type="number" placeholder="请输入" :disabled="isChecked || disabled" input-align="right" :rules="[{ required: false, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="价税合计" />
<van-field v-model="form.taxiNum" label="车牌号" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.startingDate ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startingDate1" @click="handleDateShow('startingDate')" label="日期" required clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.pickupTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.pickupTime" @click="handleTimeShow('pickupTime',form.pickupTime)" label="上车时间" required clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="isChecked || disabled" :class="form.dropoffTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dropoffTime" @click="handleTimeShow('dropoffTime',form.dropoffTime)" label="下车时间" required clear-trigger="always" input-align="right" />
<van-field v-model="form.totalFare" label="总金额" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.location" label="开票城市" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.pricePerkm" label="单价" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.distance" label="里程" required :disabled="isChecked || disabled" :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
</div>
</div>
</van-form>
@ -31,15 +94,77 @@
</div>
</div>
</div>
<!-- 时间选择框-->
<van-popup v-model="timeShow" position="bottom">
<van-datetime-picker @confirm="timeConfirm" @cancel="timeCancel" v-model="currentTime" type="time" :min-hour="1" :max-hour="23" />
</van-popup>
<!-- 消费类型 -->
<van-popup v-model="serviceTypeShow" position="bottom">
<van-picker
show-toolbar
:columns="ServiceTypeList"
@cancel="serviceTypeShow = false"
@confirm="serviceTypeOnConfirm"
/>
</van-popup>
<!-- 发票种类 -->
<van-popup v-model="invoiceTypeShow" position="bottom">
<van-picker
show-toolbar
:columns="InvoiceTypeList"
@cancel="invoiceTypeShow = false"
@confirm="invoiceTypeOnConfirm"
/>
</van-popup>
<!-- 是否代开 -->
<van-popup v-model="agentTypeShow" position="bottom">
<van-picker
show-toolbar
:columns="agentList"
@cancel="agentTypeShow = false"
@confirm="agentTypeOnConfirm"
/>
</van-popup>
<!--行程时间范围选择 -->
<van-calendar ref="vanCalendar" allow-same-day :maxDate="maxDate" v-model="dateShow" :min-date="minDate" :default-date="defaultDate" color="#0088FE" @confirm="handleDateSelect" />
</div>
</template>
<script>
import dayjs from 'dayjs';
import { deleteInvoice, createInvoice, getInvoice, updateInvoice } from "@/api/bs/invoice";
import dayjs from 'dayjs'
import {
deleteInvoice01,
deleteInvoice02,
deleteInvoice03,
deleteInvoice04,
deleteInvoice05,
createInvoice01,
updateInvoice01,
getInvoice01,
invoiceScanApi01,
invoiceCheckApi01,
createInvoice02,
updateInvoice02,
getInvoice02,
invoiceScanApi02,
invoiceCheckApi02,
createInvoice03,
updateInvoice03,
getInvoice03,
invoiceScanApi03,
invoiceCheckApi03,
createInvoice04,
updateInvoice04,
getInvoice04,
invoiceScanApi04,
invoiceCheckApi04,
createInvoice05,
updateInvoice05,
getInvoice05,
invoiceScanApi05,
invoiceCheckApi05,
exportInvoiceExcel01, exportInvoiceExcel02, exportInvoiceExcel03, exportInvoiceExcel04, exportInvoiceExcel05
} from "@/api/bs/invoice";
import { listData } from "@/api/system/dict/data";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import VerifyFunc from '@/utils/verify'
@ -84,6 +209,39 @@ export default {
defaultDate: new Date(),
dateShow: false,
form: {},
invoiceType:'01',
dateType:'',
timeShow:false,
currentTime:'',
timeType:'',
ServiceTypeList: [
{ text: '餐饮', value: '餐饮' },
{ text: '电器设备', value: '电器设备' },
{ text: '通讯', value: '通讯' },
{ text: '服务', value: '服务' },
{ text: '日用品食品', value: '日用品食品' },
{ text: '医疗', value: '医疗' },
{ text: '交通', value: '交通' },
{ text: '其他', value: '其他' },
],
InvoiceTypeList: [
{ text: '普通发票', value: '普通发票' },
{ text: '专用发票', value: '专用发票' },
{ text: '电子普通发票', value: '电子普通发票' },
{ text: '电子专用发票', value: '电子专用发票' },
{ text: '通行费电子普票', value: '通行费电子普票' },
{ text: '区块链发票', value: '区块链发票' },
{ text: '通用机打电子发票', value: '通用机打电子发票' },
{ text: '电子发票(专用发票)', value: '电子发票(专用发票)' },
{ text: '电子发票(普通发票)', value: '电子发票(普通发票)' },
],
agentList:[
{ text: '否', value: false },
{ text: '是', value: true },
],
serviceTypeShow:false,
invoiceTypeShow:false,
agentTypeShow:false
};
},
//
@ -129,12 +287,13 @@ export default {
}
},
handelEndCheck(obj) {
const { isChecked } = obj
this.isChecked = isChecked
this.form = {
...this.form,
...obj
}
this.form.status = obj
// const { isChecked } = obj
// this.isChecked = isChecked
// this.form = {
// ...this.form,
// ...obj
// }
// if (isChecked) {
// } else
},
@ -147,6 +306,9 @@ export default {
}
this.$refs.UploadImagePdf.beginCheck()
}).catch((err) => {
if (err && err.length > 0){
this.$fm('您还有数据未填写')
}
if (err && err.length > 0 && err[0].name) {
const fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
const fieldHeight = fieldElement.offsetHeight;
@ -159,7 +321,12 @@ export default {
hanadleScanRes(res) {
this.form = {
...(res.data || {}),
time: `${res.data.invoiceDate ? dayjs(res.data.invoiceDate).format('YYYY/MM/DD') : ''}`,
invoiceDate1: `${res.data.invoiceDate ? dayjs(res.data.invoiceDate).format('YYYY/MM/DD') : ''}`,
startingDate1:`${res.data.startingDate ? dayjs(res.data.startingDate).format('YYYY/MM/DD') : ''}`,
startTime1:`${res.data.startTime ? dayjs(res.data.startTime).format('YYYY/MM/DD') : ''}`,
endTime1:`${res.data.endTime ? dayjs(res.data.endTime).format('YYYY/MM/DD') : ''}`,
applicationDate1:`${res.data.applicationDate ? dayjs(res.data.applicationDate).format('YYYY/MM/DD') : ''}`,
agent1:res.data.agent,
type: res.data.type
}
this.scanRes = res.data || {}
@ -168,15 +335,23 @@ export default {
this.fileList = list
},
handleInitForm() {
const { id, type } = this.$route.query || {}
let _this = this
const { id, type,invoiceType } = this.$route.query || {}
this.typeStr = type
this.invoiceType = invoiceType
if (id) {
this.$loading(true, 'loadingSb')
const getInvoice = _this.invoiceType == '01' ? getInvoice01 : _this.invoiceType == '02' ? getInvoice02 : _this.invoiceType == '03' ? getInvoice03 : _this.invoiceType == '04' ? getInvoice04 : getInvoice05;
getInvoice(id).then((res) => {
let backRes = res.data || {}
this.form = {
...backRes,
time: `${backRes.invoiceDate ? dayjs(backRes.invoiceDate).format('YYYY/MM/DD') : ''}`,
invoiceDate1: `${res.data.invoiceDate ? dayjs(res.data.invoiceDate).format('YYYY/MM/DD') : ''}`,
startingDate1:`${res.data.startingDate ? dayjs(res.data.startingDate).format('YYYY/MM/DD') : ''}`,
startTime1:`${res.data.startTime ? dayjs(res.data.startTime).format('YYYY/MM/DD') : ''}`,
endTime1:`${res.data.endTime ? dayjs(res.data.endTime).format('YYYY/MM/DD') : ''}`,
applicationDate1:`${res.data.applicationDate ? dayjs(res.data.applicationDate).format('YYYY/MM/DD') : ''}`,
agent1:res.data.agent,
type: backRes.type
}
this.fileList = res.data.files || []
@ -243,6 +418,7 @@ export default {
})
.then(() => {
this.$loading(true, 'form')
const deleteInvoice = this.invoiceType == '01' ? deleteInvoice01 : this.invoiceType == '02' ? deleteInvoice02 : this.invoiceType == '03' ? deleteInvoice03 : this.invoiceType == '04' ? deleteInvoice04 : deleteInvoice05;
deleteInvoice(this.form.id).then(() => {
//
this.$EventBus.$emit('handleResetLive', 'company-myInvoice')
@ -266,6 +442,7 @@ export default {
}
this.$loading(true, 'form')
if (newForm.id != null) {
const updateInvoice = this.invoiceType == '01' ? updateInvoice01 : this.invoiceType == '02' ? updateInvoice02 : this.invoiceType == '03' ? updateInvoice03 : this.invoiceType == '04' ? updateInvoice04 : updateInvoice05;
updateInvoice(newForm).then(() => {
history.back()
this.$modal.msgSuccess("修改成功!");
@ -275,6 +452,7 @@ export default {
})
return;
}
const createInvoice = this.invoiceType == '01' ? createInvoice01 : this.invoiceType == '02' ? createInvoice02 : this.invoiceType == '03' ? createInvoice03 : this.invoiceType == '04' ? createInvoice04 : createInvoice05;
createInvoice(newForm).then(() => {
this.$loading(false, 'form')
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
@ -284,6 +462,9 @@ export default {
});
}).catch((err) => {
this.$loading(false, 'form')
if (err && err.length > 0){
this.$fm('您还有数据未填写')
}
if (err && err.length > 0 && err[0].name) {
const fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
const fieldHeight = fieldElement.offsetHeight;
@ -326,23 +507,79 @@ export default {
this.tripTypeList = res.data.list || []
})
},
handleDateShow() {
console.log('handleDateShow...');
const { invoiceDate } = this.form
handleDateShow(dateType) {
this.dateType = dateType
let date = dateType == 'invoiceDate'?this.form.invoiceDate:dateType=='startingDate'?this.form.startingDate:dateType=='startTime'?this.form.startTime:dateType=='endTime'?this.form.endTime:dateType=='applicationDate'?this.form.applicationDate:''
// const { date } = this.form
this.$nextTick(() => {
this.$refs.vanCalendar && this.$refs.vanCalendar.reset()
this.dateShow = true
if (invoiceDate) {
let time = dayjs(Number(invoiceDate)).format('YYYY/MM/DD');
if (date) {
let time = dayjs(Number(date)).format('YYYY/MM/DD');
this.defaultDate = new Date(time)
}
})
},
handleDateSelect(val) {
this.$set(this.form, 'time', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'invoiceDate', `${dayjs(val).valueOf()}`)
if(this.dateType == 'invoiceDate'){
this.$set(this.form, 'invoiceDate1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'invoiceDate', `${dayjs(val).valueOf()}`)
}else if(this.dateType == 'startingDate'){
this.$set(this.form, 'startingDate1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'startingDate', `${dayjs(val).valueOf()}`)
}else if(this.dateType == 'startTime'){
this.$set(this.form, 'startTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'startTime', `${dayjs(val).valueOf()}`)
}else if(this.dateType == 'endTime'){
this.$set(this.form, 'endTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'endTime', `${dayjs(val).valueOf()}`)
}else if(this.dateType == 'applicationDate'){
this.$set(this.form, 'applicationDate1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'applicationDate', `${dayjs(val).valueOf()}`)
}
this.dateShow = false
},
handleTimeShow(timeType,date){
this.timeShow = true
this.currentTime = date
this.timeType = timeType
},
timeConfirm(val){
if(this.timeType=='pickupTime'){
this.form.pickupTime = val
}else if(this.timeType=='dropoffTime'){
this.form.dropoffTime = val
}else if(this.timeType=='startingTime'){
this.form.startingTime = val
}
this.timeShow = false
},
timeCancel(){
this.timeShow = false
},
serviceTypeOnConfirm(value){
this.form.serviceType = value.text
this.serviceTypeShow = false
},
invoiceTypeOnConfirm(value){
this.form.invoiceType = value.text
this.invoiceTypeShow = false
},
agentTypeOnConfirm(value){
this.form.agent1 = value.text
this.form.agent = value.value
this.agentTypeShow = false
},
handleServiceTypeShow(){
this.serviceTypeShow = true
},
handleInvoiceTypeShow(){
this.invoiceTypeShow = true
},
handleAgentTypeShow(){
this.agentTypeShow = true
}
},
}
</script>

@ -5,37 +5,190 @@
<div class="hf-l-list" v-show="!isActSearch">
<van-dropdown-menu class="hf-l-list-menu">
<!-- 课程包列表状态 -->
<van-dropdown-item title="发票类型" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<div class="hr-drop-filter-item" @click.stop="handleClass(item.value)" v-for="item in stateList" :key="item.value">
<van-icon v-if="listQuery.type && listQuery.type == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.type && listQuery.type == item.value }">{{item.label}}</span>
<!-- <van-dropdown-item title="发票类型" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">-->
<!-- <div class="hf-drop-view">-->
<!-- <div class="hf-drop-contain">-->
<!-- <div class="hr-drop-filter-item" @click.stop="handleClass(item.value)" v-for="item in stateList" :key="item.value">-->
<!-- <van-icon v-if="listQuery.type && listQuery.type == item.value" name="success" color="#0088FE" />-->
<!-- <span :class="{'hr-drop-filter-item-act': listQuery.type && listQuery.type == item.value }">{{item.label}}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="common-double-button">-->
<!-- <van-button class="common-double-button-l" @click="handleReset()"></van-button>-->
<!-- <van-button class="common-double-button-r" @click="handleConfirm"></van-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </van-dropdown-item>-->
<!-- &lt;!&ndash; 讲座日期 &ndash;&gt;-->
<!-- <van-dropdown-item title="开票日期" :title-class="isHtab4 ? 'common-act-color' : ''" @open="handleDropOpen(5)" ref="vanDropItem4">-->
<!-- <div class="hf-drop-view">-->
<!-- <div class="hf-drop-quick" style="margin-top: 0;">-->
<!-- <div class="hf-drop-quick-item" style="margin-bottom: 0;">-->
<!-- <ReQuickDateBtns @change="handleQuickDate" :startData="listQuery.startDate" :endData="listQuery.endDate" style="margin-top: 1rem;" />-->
<!-- <div class="hf-drop-quick-calendar">-->
<!-- <van-calendar ref="vanCalendar" :formatter="dayTextFormatter" @select="handleDateSelect" :default-date="defaultDate" :poppable="false" type="range" :show-title="false" color="#0088FE" :show-confirm="false" allow-same-day :min-date="new Date('2000/01/01')" :style="{ height: '400px' }" />-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="common-double-button">-->
<!-- <van-button class="common-double-button-l" @click="handleDateReset(4)"></van-button>-->
<!-- <van-button class="common-double-button-r" @click="handleConfirm"></van-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </van-dropdown-item>-->
<div v-if="type == '01'">
<van-dropdown-item title="发票代码" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.invoiceCode" shape="round" placeholder="请输入发票代码" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</van-dropdown-item>
<van-dropdown-item title="发票号码" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.invoiceNum" shape="round" placeholder="请输入发票代码" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</div>
</van-dropdown-item>
<!-- 讲座日期 -->
<van-dropdown-item title="开票日期" :title-class="isHtab4 ? 'common-act-color' : ''" @open="handleDropOpen(5)" ref="vanDropItem4">
<div class="hf-drop-view">
<div class="hf-drop-quick" style="margin-top: 0;">
<div class="hf-drop-quick-item" style="margin-bottom: 0;">
<ReQuickDateBtns @change="handleQuickDate" :startData="listQuery.startDate" :endData="listQuery.endDate" style="margin-top: 1rem;" />
<div class="hf-drop-quick-calendar">
<van-calendar ref="vanCalendar" :formatter="dayTextFormatter" @select="handleDateSelect" :default-date="defaultDate" :poppable="false" type="range" :show-title="false" color="#0088FE" :show-confirm="false" allow-same-day :min-date="new Date('2000/01/01')" :style="{ height: '400px' }" />
</div>
</van-dropdown-item>
</div>
<div v-if="type == '02'">
<van-dropdown-item title="始发站" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.startingStation" shape="round" placeholder="请输入始发站" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleDateReset(4)"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</van-dropdown-item>
<van-dropdown-item title="到达站" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.destinationStation" shape="round" placeholder="请输入到达站" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
</div>
<div v-if="type == '03'">
<van-dropdown-item title="姓名" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.name" shape="round" placeholder="请输入姓名" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item title="始发站" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.startingStation" shape="round" placeholder="请输入始发站" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item title="目的站" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.destinationStation" shape="round" placeholder="请输入目的站" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
</div>
<div v-if="type == '04'">
<van-dropdown-item title="行程人手机号" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.phone" shape="round" placeholder="请输入行程人手机号" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</div>
</van-dropdown-item>
</van-dropdown-item>
<van-dropdown-item title="起点" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.startPlace" shape="round" placeholder="请输入起点" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item title="终点" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.destinationPlace" shape="round" placeholder="请输入终点" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
</div>
<div v-if="type == '05'">
<van-dropdown-item title="发票号码" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.invoiceNum" shape="round" placeholder="请输入发票代码" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item title="车牌号" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.taxiNum" shape="round" placeholder="请输入车牌号" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item title="里程" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<van-search style="width: 100%" v-model="listQuery.distance" shape="round" placeholder="请输入里程" :clearable="false" />
</div>
<div class="common-double-button">
<van-button class="common-double-button-l" @click="handleReset()"></van-button>
<van-button class="common-double-button-r" @click="handleConfirm"></van-button>
</div>
</div>
</van-dropdown-item>
</div>
</van-dropdown-menu>
</div>
<div class="hf-r-list">
@ -84,6 +237,7 @@ export default {
props: {
listType: String, // 'detail'
paramProp: Object,
type:String,
},
components: {
ReQuickDateBtns: () => import('@/components/ReComponents/ReQuickDateBtns'),
@ -156,7 +310,7 @@ export default {
this.listQuery.endDate = `${e.time[1]} 23:59:59`
},
handleConfirm() {
this.$refs.vanDropItem4 && this.$refs.vanDropItem4.toggle(false)
// this.$refs.vanDropItem4 && this.$refs.vanDropItem4.toggle(false)
this.$refs.vanDropItem1 && this.$refs.vanDropItem1.toggle(false)
this.$emit('onListQuery', this.listQuery)
},
@ -237,10 +391,12 @@ export default {
},
handleMoreConfirm() {
this.$emit('onListQuery', this.listQuery)
this.moreFilterShow = false
},
handleReset() {
this.listQuery.type = null
this.listQuery = {}
this.$emit('onListQuery', this.listQuery)
},

@ -1,10 +1,19 @@
<template>
<!-- 出差列表 -->
<div>
<HeaderFilter :listType="listType" @onListQuery="handleListQuery" :paramProp="listQuery" />
<div style="position: sticky;top: 0;background-color: white;z-index: 999">
<van-tabs v-model="type" :swipe-threshold="4" @change="vanTabsChange">
<van-tab name="01" title="增值税发票" />
<van-tab name="02" title="火车票" />
<van-tab name="03" title="飞机行程票" />
<van-tab name="04" title="网约车行程单" />
<van-tab name="05" title="出租车发票" />
</van-tabs>
</div>
<HeaderFilter :listType="listType" :type="type" @onListQuery="handleListQuery" :paramProp="listQuery" />
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
<div>
<MyInvoiceListCard v-for="(item,index) in tableList" :key="item.id" :itemData="item" :listType="listType" @onUpdataInfo="handleUpdataInfo($event, index)" @onAllRefresh="handleAllRefresh" />
<MyInvoiceListCard v-for="(item,index) in tableList" :key="item.id" :itemData="item" :invoiceType="type" :listType="listType" @onUpdataInfo="handleUpdataInfo($event, index)" @onAllRefresh="handleAllRefresh" />
</div>
</RMList>
<div class="common-bottom-btns" style="bottom:8rem">
@ -25,6 +34,9 @@
<span>返回首页</span>
</div>
</div>
<van-popup v-model="showPicker" position="bottom">
<van-picker :columns="columns" show-toolbar title="选择开票类型" @cancel="onCancel" @confirm="onConfirm" />
</van-popup>
</div>
</template>
@ -33,7 +45,8 @@
import { getScrollTop, findAreaIdName } from '@/utils'
// import { getOrderListApi, getDataStatisticsApi, updateOrderSingleListApi } from '@/api/potentialGuest/order'
// import { getInvoicePage, } from "@/api/bs/expenseApply";
import { deleteInvoice, getInvoice, getInvoicePage, exportInvoiceExcel } from "@/api/bs/invoice";
// import { deleteInvoice, getInvoice, getInvoicePage, exportInvoiceExcel } from "@/api/bs/invoice";
import { deleteInvoice01, getInvoicePage01, exportInvoiceExcel01, deleteInvoice02, getInvoicePage02, exportInvoiceExcel02, deleteInvoice03, getInvoicePage03, exportInvoiceExcel03, deleteInvoice04, getInvoicePage04, exportInvoiceExcel04, deleteInvoice05, getInvoicePage05, exportInvoiceExcel05 } from "@/api/bs/invoice";
import { mapState, mapMutations } from 'vuex'
import dayjs from 'dayjs'
export default {
@ -53,6 +66,9 @@ export default {
refreshing: false,
finished: false,
tableList: [],
type:'01',
columns: ['增值税发票', '火车票', '飞机行程票', '网约车行程单', '出租车发票'],
showPicker:false,
listQuery: {
pageNo: 1,
pageSize: 10,
@ -99,6 +115,7 @@ export default {
pageNo: 1,
pageSize: this.singlePageSize,
}
const getInvoicePage = this.type == '01' ? getInvoicePage01 : this.type == '02' ? getInvoicePage02 : this.type == '03' ? getInvoicePage03 : this.type == '04' ? getInvoicePage04 : getInvoicePage05;
getInvoicePage(listQuery).then((res) => {
let arr = (res.data && res.data.list || []).filter(item => item.id == id)
resolve(arr)
@ -121,6 +138,7 @@ export default {
handleListQuery(paramProp) {
this.listQuery = {
...paramProp,
pageSize: 10,
invoiceDate: paramProp.startDate && [dayjs(paramProp.startDate).format('YYYY-MM-DD HH:ss:mm'), dayjs(paramProp.endDate).format('YYYY-MM-DD HH:ss:mm')]
}
this.finished = false
@ -142,12 +160,7 @@ export default {
this.height = 0
},
handleToAdd() {
this.$router.push({
path: '/invoice',
query: {
type: 'add'
}
})
this.showPicker = true
},
handleAllRefresh() {
// this.getTableList('refresh')
@ -176,10 +189,12 @@ export default {
getTableList(val) {
// const { shellIdsLocal, collegeInfoIdLocal, startDate, endDate, keyword, type, method, targets, usePersonId, teacherIds, chargePersonIds } = this.listQuery
const query = {
...this.listQuery
...this.listQuery,
type:this.type
}
this.moreLoading = true
this.$loading(true, 'tableLoading')
const getInvoicePage = this.type == '01' ? getInvoicePage01 : this.type == '02' ? getInvoicePage02 : this.type == '03' ? getInvoicePage03 : this.type == '04' ? getInvoicePage04 : getInvoicePage05;
getInvoicePage(query).then(res => {
let resList = res.data && res.data.list || []
if (['init', 'refresh'].includes(val)) {
@ -200,6 +215,23 @@ export default {
// this.$loading(false, `cTableLoading_${this.listType}`)
})
},
onCancel(){
this.showPicker = false
},
onConfirm(value,index){
this.$router.push({
path: '/invoice',
query: {
type: 'add',
invoiceType:`0${index+1}`
}
})
},
vanTabsChange(){
this.listQuery.pageNo = 1
this.finished = false
this.getTableList('init')
}
}
}
</script>

@ -10,7 +10,7 @@
</template>
<script>
import { getSafing } from '@/api/login'
// import { getSafing } from '@/api/login'
import dayjs from 'dayjs'
import { mapGetters } from 'vuex'
@ -39,14 +39,14 @@ export default {
},
methods: {
handleInit() {
getSafing().then(res => {
this.form = res.data || {}
}).catch(err => {
if (err.status === 201) {
let redirectUrl = this.$router.currentRoute.query.redirect
if (redirectUrl) this.$router.replace('/' + decodeURIComponent(redirectUrl))
}
})
// getSafing().then(res => {
// this.form = res.data || {}
// }).catch(err => {
// if (err.status === 201) {
// let redirectUrl = this.$router.currentRoute.query.redirect
// if (redirectUrl) this.$router.replace('/' + decodeURIComponent(redirectUrl))
// }
// })
}
}
}

@ -118,7 +118,6 @@ export default {
})
},
handleFilterList() {
console.log('首页加载...');
this.roterList = []
let arr = [
{
@ -204,7 +203,6 @@ export default {
row: item.row.filter(n => n.show)
}
})
console.log('roterList..', this.roterList);
},
checkPermission,
handelTo(route) {

Loading…
Cancel
Save