添加发票

pull/1/head
gongzeliang 9 months ago
parent 344194f617
commit ec2ab6dcd4

@ -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
})
}

@ -7,23 +7,50 @@
</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: {
@ -42,6 +69,7 @@ export default {
imgTypeArr: ['image/jpeg', 'image/jpg', 'image/png', 'application/pdf'],
localFileList: [], //
uploadList: [], //
isChecked:false
}
},
@ -74,25 +102,30 @@ export default {
beginCheck() {
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)
})
},
@ -105,12 +138,14 @@ export default {
}
},
handleScan() {
if (!this.uploadList.length) {
if (this.uploadList.length) {
this.$fm('请先上传发票!')
} else {
const { url } = this.uploadList[0]
// 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)

@ -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,7 +94,37 @@
</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>
@ -39,7 +132,39 @@
<script>
import dayjs from 'dayjs';
import { deleteInvoice, createInvoice, getInvoice, updateInvoice } from "@/api/bs/invoice";
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
},
@ -159,7 +318,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,10 +332,13 @@ 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 = {
@ -243,6 +410,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 +434,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 +444,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 ? '修改成功!' : '新增成功!'}`)
@ -326,23 +496,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>

@ -1,6 +1,15 @@
<template>
<!-- 出差列表 -->
<div>
<div style="position: sticky;top: 0;background-color: white;z-index: 999">
<van-tabs v-model="type" :swipe-threshold="4">
<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" @onListQuery="handleListQuery" :paramProp="listQuery" />
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
<div>
@ -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>
@ -53,6 +65,9 @@ export default {
refreshing: false,
finished: false,
tableList: [],
type:'01',
columns: ['增值税发票', '火车票', '飞机行程票', '网约车行程单', '出租车发票'],
showPicker:false,
listQuery: {
pageNo: 1,
pageSize: 10,
@ -142,12 +157,7 @@ export default {
this.height = 0
},
handleToAdd() {
this.$router.push({
path: '/invoice',
query: {
type: 'add'
}
})
this.showPicker = true
},
handleAllRefresh() {
// this.getTableList('refresh')
@ -200,6 +210,18 @@ 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}`
}
})
}
}
}
</script>

Loading…
Cancel
Save