|
@@ -37,6 +37,7 @@
|
|
|
type="date"
|
|
|
title="选择填报日期"
|
|
|
@confirm="createDateChange"
|
|
|
+ v-model="currentDate1"
|
|
|
@cancel="createDateShow = false;$forceUpdate();"
|
|
|
:min-date="minDate"
|
|
|
:max-date="maxDate"/>
|
|
@@ -44,7 +45,7 @@
|
|
|
<!-- 发票张数 -->
|
|
|
<van-field label="发票张数">
|
|
|
<template #input>
|
|
|
- <van-stepper v-model="editForm.ticketNum"/>
|
|
|
+ <van-stepper v-model="editForm.ticketNum" disable-input @plus="ticNumChange(1)" @minus="ticNumChange(0)"/>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<!-- 费用类型 -->
|
|
@@ -67,16 +68,16 @@
|
|
|
<div class="invoice" v-if="invoiceList.length != 0">
|
|
|
<div v-for="item,index in invoiceList" :key="item.id" style="position:relative" :class="index == 0 ? '' : 'invoice_item'">
|
|
|
<!-- <van-button class="deletebtn" size="mini" type="default" @click="deleteInvoice(index)">删除</van-button> -->
|
|
|
- <van-icon name="delete-o" class="deletebtn" @click="deleteInvoice(index)" />
|
|
|
- <van-field label="所属项目:" v-model="item.projectId" @click="in_projectShow = true,invoiceIndex = index" readonly clickable>
|
|
|
+ <van-icon name="delete-o" class="deletebtn" v-if="index != 0" @click="deleteInvoice(index)" />
|
|
|
+ <van-field label="所属项目:" v-model="item.projectId" @click="in_projectShow = true,invoiceIndex = index" readonly clickable required>
|
|
|
<template #input>{{formshowText.inProjectName[index]}}</template>
|
|
|
</van-field>
|
|
|
- <van-field label="费用日期:" v-model="item.happenDate" @click="in_dateShow = true,invoiceIndex = index" readonly clickable></van-field>
|
|
|
- <van-field label="发票种类:" v-model="item.invoiceType" @click="in_typeShow = true,invoiceIndex = index" readonly clickable>
|
|
|
+ <van-field label="费用日期:" v-model="item.happenDate" @click="in_dateShow = true,invoiceIndex = index" readonly clickable required></van-field>
|
|
|
+ <van-field label="发票种类:" v-model="item.invoiceType" @click="in_typeShow = true,invoiceIndex = index" readonly clickable required>
|
|
|
<template #input>{{inTypeList[item.invoiceType]}}</template>
|
|
|
</van-field>
|
|
|
- <van-field label="费用类型:" v-model="item.expenseType" @click="in_exTypeShow = true,invoiceIndex = index" readonly clickable></van-field>
|
|
|
- <van-field label="费用金额(含税):" v-model="item.amount" type="number" @input="costCount"></van-field>
|
|
|
+ <van-field label="费用类型:" v-model="item.expenseType" @click="in_exTypeShow = true,invoiceIndex = index" readonly clickable required></van-field>
|
|
|
+ <van-field label="费用金额(含税):" v-model="item.amount" type="number" @input="costCount" required></van-field>
|
|
|
<van-field label="发票号:" v-model="item.invoiceNo"></van-field>
|
|
|
<van-field label="税率%:" v-model="item.taxPercent"></van-field>
|
|
|
<van-field label="税额:" readonly>
|
|
@@ -108,6 +109,7 @@
|
|
|
type="date"
|
|
|
title="选择费用日期"
|
|
|
@confirm="inDateChange"
|
|
|
+ v-model="currentDate2"
|
|
|
@cancel="in_dateShow = false;$forceUpdate();"
|
|
|
:min-date="minDate"
|
|
|
:max-date="maxDate"/>
|
|
@@ -234,6 +236,8 @@ export default {
|
|
|
user: JSON.parse(localStorage.userInfo),
|
|
|
userList: [],
|
|
|
canExamine: false,
|
|
|
+ currentDate1: new Date(),
|
|
|
+ currentDate2: new Date(),
|
|
|
minDate: new Date(2020,0,1),
|
|
|
maxDate: new Date(2025,11,31),
|
|
|
|
|
@@ -258,18 +262,18 @@ export default {
|
|
|
invoiceIndex: 0,
|
|
|
totalCost: 0,
|
|
|
invoiceList: [
|
|
|
- // {
|
|
|
- // projectId: '',
|
|
|
- // happenDate: '',
|
|
|
- // invoiceType: '',
|
|
|
- // expenseType: '',
|
|
|
- // amount: '',
|
|
|
- // invoiceNo: '',
|
|
|
- // taxPercent: '',
|
|
|
- // taxValue: '',
|
|
|
- // remark: '',
|
|
|
- // pic: ''
|
|
|
- // }
|
|
|
+ {
|
|
|
+ projectId: '',
|
|
|
+ happenDate: '',
|
|
|
+ invoiceType: '',
|
|
|
+ expenseType: '',
|
|
|
+ amount: '',
|
|
|
+ invoiceNo: '',
|
|
|
+ taxPercent: '',
|
|
|
+ taxValue: '',
|
|
|
+ remark: '',
|
|
|
+ pic: '',
|
|
|
+ }
|
|
|
],
|
|
|
in_projectShow: false,
|
|
|
in_dateShow: false,
|
|
@@ -380,6 +384,26 @@ export default {
|
|
|
this.typeShow = false
|
|
|
this.inexTypeList = this.allexTypeList.filter(a=>a.mainType == this.editForm.type)
|
|
|
},
|
|
|
+ ticNumChange(value){
|
|
|
+
|
|
|
+ if(value){
|
|
|
+ this.invoiceList.push({
|
|
|
+ projectId: '',
|
|
|
+ happenDate: '',
|
|
|
+ invoiceType: '',
|
|
|
+ expenseType: '',
|
|
|
+ amount: '',
|
|
|
+ invoiceNo: '',
|
|
|
+ taxPercent: '',
|
|
|
+ taxValue: '',
|
|
|
+ remark: '',
|
|
|
+ pic: '',
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.invoiceList.pop()
|
|
|
+ }
|
|
|
+ console.log(value,this.invoiceList);
|
|
|
+ },
|
|
|
|
|
|
// 发票
|
|
|
inProjectChange(value,key){
|
|
@@ -414,10 +438,12 @@ export default {
|
|
|
pic: '',
|
|
|
})
|
|
|
this.uploader.push([])
|
|
|
+ this.editForm.ticketNum = this.invoiceList.length
|
|
|
},
|
|
|
deleteInvoice(index){
|
|
|
this.invoiceList.splice(index,1)
|
|
|
this.uploader.splice(index,1)
|
|
|
+ this.editForm.ticketNum = this.invoiceList.length
|
|
|
},
|
|
|
|
|
|
// 上传报销凭证
|
|
@@ -453,6 +479,38 @@ export default {
|
|
|
this.$toast.fail('请选择填报日期')
|
|
|
return
|
|
|
}
|
|
|
+ let required1 = false
|
|
|
+ let required2 = false
|
|
|
+ let required3 = false
|
|
|
+ let required4 = false
|
|
|
+ let required5 = false
|
|
|
+ for(let i in this.invoiceList){
|
|
|
+ if(!this.invoiceList[i].projectId){
|
|
|
+ required1 = '所属项目'
|
|
|
+ }
|
|
|
+ if(!this.invoiceList[i].happenDate){
|
|
|
+ required2 = '费用日期'
|
|
|
+ }
|
|
|
+ if(!this.invoiceList[i].invoiceType){
|
|
|
+ required3 = '发票种类'
|
|
|
+ }
|
|
|
+ if(!this.invoiceList[i].expenseType){
|
|
|
+ required4 = '费用类型'
|
|
|
+ }
|
|
|
+ if(!this.invoiceList[i].amount){
|
|
|
+ required5 = '费用金额(含税)'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(required1 || required2 || required3 || required4 || required5){
|
|
|
+ let requiredStr = (required1 ? required1 + '、' : '')
|
|
|
+ + (required2 ? required2 + '、' : '')
|
|
|
+ + (required3 ? required3 + '、' : '')
|
|
|
+ + (required4 ? required4 + '、' : '')
|
|
|
+ + (required5 ? required5 + '、' : '')
|
|
|
+ requiredStr = requiredStr.substring(0,requiredStr.length - 1)
|
|
|
+ this.$toast.fail('请添加发票的[' + requiredStr + ']')
|
|
|
+ return
|
|
|
+ }
|
|
|
if(this.invoiceList.length == 0){
|
|
|
this.$toast.fail('请添加发票')
|
|
|
return
|