Ver código fonte

开票失败添加重新开票功能

gcz 1 ano atrás
pai
commit
c022c66dfd
1 arquivos alterados com 68 adições e 0 exclusões
  1. 68 0
      center/invoicedetails.vue

+ 68 - 0
center/invoicedetails.vue

@@ -22,6 +22,11 @@
 				</view>
 			</view>
 		</view>
+		<view class="page-bottom" v-if="details.status===3">
+			<view class="inner">
+				<view class="btn active" v-if="cansubmit" @click="submitorder">重新开票</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -52,6 +57,17 @@
 						{name:'开具状态 ',key:'status'},
 						// {name:'失败原因 ',key:'errReason'}
 					],
+				},
+				cansubmit:true,
+				formData:{
+					orderId:'',
+					invoiceAmount:'',
+					invoiceHandler:{
+						handlerType:'',
+						name:'',
+						email:''
+					}
+					
 				}
 			}
 		},
@@ -84,6 +100,27 @@
 				}).catch(err=>{
 					console.log('getInvoiceInfo',err);
 				})
+			},
+			submitorder(){
+				this.formData.orderId =this.details.orderId;
+				this.formData.invoiceAmount = this.details.invoiceAmount;
+				this.formData.invoiceHandler.handlerType = this.details.handlerType;
+				this.formData.invoiceHandler.name = this.details.name;
+				this.formData.invoiceHandler.email = this.details.email;
+				if(this.details.handlerType===2){//企业
+					this.formData.invoiceHandler.creditCode = this.details.creditCode;
+				}
+				this.$u.api.submitInvoice(this.formData).then(res=>{
+					uni.$u.toast(res.msg)
+					// uni.navigateBack()
+					setTimeout(()=>{
+						uni.redirectTo({
+							url: `/center/orderdetails?id=${this.orderId}`
+						})
+					},1500)
+				}).catch(err=>{
+					console.log('submitorder',err);
+				})
 			}
 
 		}
@@ -116,4 +153,35 @@
 		}
 	}
 }
+.page-bottom{
+	$height:98rpx;
+	position: relative;
+	z-index: 1001;
+	height: $height;
+	padding: 24rpx 20rpx;
+	.inner{
+		position: fixed;
+		background-color: transparent;
+		height: $height;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		padding: 24rpx 20rpx;
+		// box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215,215,215,0.5);
+		.btn{
+			font-size: 28rpx;
+			height: 100%;
+			line-height: $height;
+			border-radius: 50rpx;
+			padding: 0 50rpx;
+			background-color: #eee;
+			color: #333;
+			text-align: center;
+			&.active{
+				background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
+				color: #fff;
+			}
+		}
+	}
+}
 </style>