Browse Source

新增开票类型

gcz 1 year ago
parent
commit
003e2daed4
2 changed files with 44 additions and 5 deletions
  1. 36 4
      center/invoice.vue
  2. 8 1
      center/invoicedetails.vue

+ 36 - 4
center/invoice.vue

@@ -14,6 +14,16 @@
 			itemStyle="width:50%;box-sizing:border-box;padding:24rpx;"
 			@click="tabsClick"></u-tabs>
 			<view class="block-wrap" style="margin-top: 32rpx;">
+				<view class="form-item" v-if="tabsCurrent===0" @click="showInvoiceLine=true">
+					<view class="til">
+						<text>*</text>申请类型 
+					</view>
+					<u--input placeholder="请选择申请类型" readonly border="surround" v-model="invoiceLineName" ></u--input>
+					<!-- <view class="item-value">
+						<text>{{formData.invoiceLine}}</text>
+					</view> -->
+				</view>
+				 <u-picker :show="showInvoiceLine" :columns="invoiceLineList" keyName="label" @cancel="cancelInvoiceLine" @confirm="confirmInvoiceLine" ></u-picker>
 				<view class="form-item">
 					<view class="til">
 						<text>*</text>抬头名称 
@@ -67,14 +77,20 @@
 				formData:{
 					name:'',
 					creditCode :'',
-					email:''
-				}
+					email:'',
+					invoiceLine:'',
+				},
+				invoiceLine:'',
+				showInvoiceLine:false,
+				invoiceLineName:'',
+				invoiceLineList:[[{label:'数电专票',id:'bs'},{label:'数电普票',id:'pc'}]]
 			}
 		},
 		onShow() {
 		},
 		onLoad(page) {
 			this.orderId = page.id;
+			this.invoiceLine = page.invoiceLine;
 			this.getSystemInfo();
 			this.getInvoiceInfo();
 
@@ -83,7 +99,7 @@
 		    // 是否全选
 		    cansubmit() {
 				if(this.tabsCurrent===0){
-					return this.formData.name && this.formData.creditCode && uni.$u.test.email(this.formData.email);
+					return this.formData.name && this.formData.creditCode && uni.$u.test.email(this.formData.email)&& this.invoiceLineName;
 				}else{
 					return this.formData.name && uni.$u.test.email(this.formData.email);
 				}
@@ -121,6 +137,12 @@
 						this.formData.name = handlerType2.name||null;
 						this.formData.creditCode = handlerType2.creditCode||null;
 						this.formData.email = handlerType2.email||null;
+						this.formData.invoiceLine = this.invoiceLine||null;
+						if(this.formData.invoiceLine=='bs'){
+							this.invoiceLineName = '数电专票'
+						}else if(this.formData.invoiceLine=='pc'){
+							this.invoiceLineName = '数电普票'
+						}
 					}else{
 						this.formData.name = handlerType1.name||null;
 						this.formData.email = handlerType1.email||null;
@@ -139,7 +161,8 @@
 					}
 				};
 				if(this.tabsCurrent===0){//企业
-					params.invoiceHandler.creditCode = this.formData.creditCode
+					params.invoiceHandler.creditCode = this.formData.creditCode;
+					params.invoiceLine = this.formData.invoiceLine;
 				}
 				this.$u.api.submitInvoice(params).then(res=>{
 					uni.$u.toast(res.msg)
@@ -152,6 +175,15 @@
 				}).catch(err=>{
 					console.log('submitorder',err);
 				})
+			},
+			cancelInvoiceLine(){
+				this.showInvoiceLine = false;
+			},
+			confirmInvoiceLine(e){
+				this.showInvoiceLine = false;
+				// console.log('confirmInvoiceLine',e.value[0]);
+				this.formData.invoiceLine = e.value[0].id;
+				this.invoiceLineName = e.value[0].label;
 			}
 
 		}

+ 8 - 1
center/invoicedetails.vue

@@ -20,6 +20,13 @@
 						<text v-else>{{details[item.key]}}</text>
 					</view>
 				</view>
+				<view class="item u-flex" v-if="details.handlerType==2">
+					<view class="left">申请类型</view>
+					<view class="con">
+						<text v-if="details.invoiceLine=='pc'">数电普票</text>
+						<text v-if="details.invoiceLine=='bs'">数电专票</text>
+					</view>
+				</view>
 				<view class="item u-flex" v-if="details.errReason&&details.status==3">
 					<view class="left">开票失败原因</view>
 					<view class="con">
@@ -111,7 +118,7 @@
 			},
 			submitorder(){
 				uni.redirectTo({
-					url: `/center/invoice?id=${this.orderId}`
+					url: `/center/invoice?id=${this.orderId}&invoiceLine=${this.details.invoiceLine}`
 				})
 				return
 				// this.formData.orderId =this.details.orderId;