Selaa lähdekoodia

添加长隆收银系统退款原因

soobin 2 vuotta sitten
vanhempi
commit
18933b8bf0
1 muutettua tiedostoa jossa 25 lisäystä ja 6 poistoa
  1. 25 6
      packageA/pages/user/orderEit.vue

+ 25 - 6
packageA/pages/user/orderEit.vue

@@ -41,16 +41,23 @@
 				<input class="input" style="display:none;" />
 				<text>订单状态:</text><input class="input" name="status" disabled :value="status==1?('已支付'):(status==2?'退款中':'已退款')" />	
 			</view>
-			<view class="select-input">
+			<view v-if="order.status!=3" class="select-input">
 				<input class="input" style="display:none;" />
-				<text>退款金额:</text><input class="input2" @focus="setStyle()" @blur="setStyle2()" v-model="refundAmount"  />
+				<text>退款金额:</text>
+				<input class="input2" @focus="setStyle()" @blur="setStyle2()" v-model="refundAmount"  />
 			</view>
 			<p id="p2" class="p2" :style="{display:showOrNo}">请慎重对待!</p>
-			<view class="select-input">
+			<view v-if="order.status!=3" class="select-input">
 				<input class="input" style="display:none;" />
 				<text>PS:退款金额可修改</text>
 			</view>
-			<view class="btn-area">
+			<view v-if="order.payPlatform == 3" class="select-input">
+				<input class="input" style="display:none;" />
+				<text>退款原因:</text>
+				<input v-if="order.status!=3" class="input2" v-model="refundReason" />
+				<input v-if="order.status==3" class="input" name="refundReason" disabled :value="refundReason"/>	
+			</view>
+			<view v-if="order.status!=3" class="btn-area">
 				<button type="primary" formType="submit" >退款</button>
 			</view>
 		</form>
@@ -75,7 +82,8 @@
 				refundPrice:0,
 				showOrNo: null,
 				note:null,
-				production:0
+				production:0,
+				refundReason:null,
 			}
 		},
 		onLoad: function(option) {
@@ -103,6 +111,7 @@
 			this.note = order.note;
 			this.refundPrice = order.refundAmount;
 			this.refundAmount = order.price;
+			this.refundReason = order.refundReason;
 		},
 		onShow() {
 			this.mch();
@@ -129,14 +138,24 @@
 						if (res.confirm) {
 							var order = this.order;
 							var refundAmount = this.refundAmount;
+							var refundReason = this.refundReason;
 							var token = uni.getStorageSync("token");
+							if(refundReason == null || refundAmount == "") {
+								uni.showToast({
+								    title: '请输入退款原因',
+								    duration: 3000,
+									icon: 'error'
+								});
+								return;
+							}
 							if(order.payPlatform != null && order.payPlatform == '3') {
 								//如果为直接对接微信支付
 								uni.request({
 									url: this.serverurl + '/tWeixinPay/refund',
 									data: {
 										"sn": order.sn,
-										"refusePrice":refundAmount
+										"refusePrice":refundAmount,
+										"refundReason": refundReason
 									},
 									header: {
 										'token': token