shish 1 рік тому
батько
коміт
b414490e9d
1 змінених файлів з 71 додано та 42 видалено
  1. 71 42
      hdApp/src/admin/billing/affirm.vue

+ 71 - 42
hdApp/src/admin/billing/affirm.vue

@@ -198,14 +198,8 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">订单类型</view>
-            <button @tap="form.forward = 0;form.hasPay = 4" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 0? 'blue' : 'default'">收入订单</button>
-            <button @click="form.forward = 1;form.hasPay = 1" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 1 ? 'blue' : 'default'">售后付款</button>
-          </tui-list-cell>
-
-          <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.forward == 1">
-            <view class="tui-title">退货方式</view>
-            <button @tap="form.forwardStock = 0" class="admin-button-com middle" style="width:190upx;" :class="form.forwardStock == 0? 'blue' : 'default'">货退回来</button>
-            <button @click="form.forwardStock = 1" class="admin-button-com middle" style="width:160upx;" :class="form.forwardStock == 1 ? 'blue' : 'default'">货不退回</button>
+            <button @tap="form.forward = 0;" class="admin-button-com mini-btn" style="width:170upx;" :class="form.forward == 0? 'blue' : 'default'">收入订单</button>
+            <button @click="form.forward = 1;" class="admin-button-com mini-btn" style="width:170upx;" :class="form.forward == 1 ? 'blue' : 'default'">售后付款</button>
           </tui-list-cell>
 
           </view>
@@ -243,11 +237,11 @@
         </view>
         <view style="text-align:center;margin-top:30upx;width:100%;">
           <button class="admin-button-com big default" @click="returnCheck()">返回修改</button>
-          <button style="margin-left:20upx;" @click="diffPriceConfirm()" class="admin-button-com big blue">确认提交</button>
+          <button style="margin-left:20upx;" @click="forceCommit()" class="admin-button-com big blue">确认提交</button>
         </view>
 			</view>
-
 		</uni-popup>
+
 		<uni-popup ref="discountRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
       <view style="display:flex;padding:20upx;min-height:25vh;justify-content: space-between;align-items:center;flex-wrap:wrap;">
         <text v-for="(item, index) in discountList" :key="index" @click="setDiscount(item.value)" 
@@ -257,6 +251,32 @@
        </view>
 		</uni-popup>
 
+		<uni-popup ref="remindForwardRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+      <view>
+        <view>
+          请选择退货方式和付款给客户的方式
+        </view>
+        <view>
+          <text>退货方式</text>
+          <button @tap="form.forwardStock = 0" class="admin-button-com middle" style="width:190upx;" :class="form.forwardStock == 0? 'blue' : 'default'">货退回来</button>
+          <button @click="form.forwardStock = 1" class="admin-button-com middle" style="width:160upx;" :class="form.forwardStock == 1 ? 'blue' : 'default'">货不退回</button>
+        </view>
+        <view>
+          <text>付款</text>
+          <view>
+          <button @tap="forwardPayWay = 0" class="admin-button-com middle" style="width:160upx;" :class="forwardPayWay == 0? 'blue' : 'default'">微信</button>
+          <button @click="forwardPayWay = 1" class="admin-button-com middle" style="width:160upx;" :class="forwardPayWay == 1 ? 'blue' : 'default'">支付宝</button>
+          <button @tap="forwardPayWay = 4" class="admin-button-com middle" style="width:160upx;" :class="forwardPayWay == 4? 'blue' : 'default'">现金</button>
+          <button @click="forwardPayWay = 5" class="admin-button-com middle" style="width:160upx;" :class="forwardPayWay == 5 ? 'blue' : 'default'">银行卡</button>
+          </view>
+        </view>
+        <view style="text-align:center;margin-top:30upx;width:100%;">
+          <button class="admin-button-com big default" @click="cancelForward()">取消</button>
+          <button style="margin-left:20upx;" @click="confirmForward()" class="admin-button-com big blue">确认</button>
+        </view>
+      </view>
+		</uni-popup>
+
     <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
 
     </view>
@@ -343,7 +363,8 @@ export default {
       isScanEnv:false,
       calc:'add',
       diffPriceList:[],
-      currentShop:{default:0}
+      currentShop:{default:0},
+      forwardPayWay:0//不影响原有的form.payWay方式,重新定义一个
     };
   },
   onLoad (option) {
@@ -387,6 +408,7 @@ export default {
 
   },
 	onShow(){
+
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
 			this.showCustomer = true;
 		}
@@ -517,42 +539,49 @@ export default {
       this.form.payWay = payWay
       this.updatePayWayIndex()
     },
-    diffPriceConfirm(){
+    forceCommit(){
       this.form.dealPrice = 1
       this.formSubmit()
     },
-    confirmSubmit () {
+    showForward(){
+      this.$refs.remindForwardRef.open('center')
+    },
+    cancelForward(){
+      this.$refs.remindForwardRef.close()
+    },
+    confirmForward(){
+      //售后付款单,只能走线下模式
+      this.form.hasPay = 1
+      this.form.payWay = this.forwardPayWay
+      this.confirmSubmit2()
+    },
+    confirmSubmit(){
+      if(this.form.forward == 1){
+        this.showForward()  
+      }else{
+        this.confirmSubmit2()
+      }
+    },
+    confirmSubmit2() {
       let self = this;
-        let rules = [
-          {
-            name: "customId",
-            rule: ["required"],
-            msg: ["请选择客户"],
-          },
-        ];
-        let hasError = formUtil.validation(this.form, rules);
-        if (hasError) {
-          this.$msg(hasError);
-          return false;
-        }
-        let name = '确认提交'
-        if(this.form.hasPay == 0){
-          name = '确认扫码付?'
-        }else if(this.form.hasPay == 1){
-          name = '确认线下付款?'
-          if(this.form.forward == 1){
-            name = '确认开售后付款单?'
-          }
-        }else if(this.form.hasPay == 2){
-          name = '确认赊账?'
-        }else if(this.form.hasPay == 4){
-          name = '确认余额支付?'
-        }else{
-          name = '确认提交'
+      let name = '确认提交'
+      if(this.form.hasPay == 0){
+        name = '确认扫码付?'
+      }else if(this.form.hasPay == 1){
+        name = '确认线下付款?'
+        if(this.form.forward == 1){
+          name = '确认开售后付款单?'
         }
-        self.$util.confirmModal({content:name},() => {
-          self.formSubmit()
-        })
+      }else if(this.form.hasPay == 2){
+        name = '确认赊账?'
+      }else if(this.form.hasPay == 4){
+        name = '确认余额支付?'
+      }else{
+        name = '确认提交'
+      }
+      self.$util.confirmModal({content:name},() => {
+        self.formSubmit()
+      })
     },
     async formSubmit () {
       let that = this