shish 11 mesi fa
parent
commit
6331569700

+ 15 - 9
hdApp/src/admin/billing/affirm.vue

@@ -54,7 +54,7 @@
               </view>
             </view>
             <view class="summary-bar">
-              <view class="operate-view" v-if="isScanEnv" @click="pageToItemList()"><text class="iconfont iconzeng"></text>手动添加花材</view>
+              <view class="operate-view" v-if="isScanEnv"><text class="iconfont iconzeng"></text>手动添加花材</view>
               <view class="operate-view" v-if="isScanEnv == false"><text> </text></view>
               <view class="describe-view">
                 <text>{{ selectList.length }}种</text>
@@ -584,7 +584,7 @@ export default {
       //售后付款单,只能走线下模式
       this.form.hasPay = 1
       this.form.payWay = this.forwardPayWay
-      this.toCommit()
+      this.submitOrder()
     },
     confirmSubmit(){
       if(this.form.forward == 1){
@@ -594,14 +594,14 @@ export default {
           //客户余额充值,只能使用余额支付
           this.$util.confirmModal({content:'客户余额充足,请使用余额支付'},() => {
             this.form.hasPay = 4
-            this.toCommit()
+            this.submitOrder()
           })
         }else{
-          this.toCommit()
+          this.submitOrder()
         }
       }
     },
-    toCommit() {
+    submitOrder() {
       let self = this;
       let name = '确认提交'
       if(this.form.hasPay == 0){
@@ -649,6 +649,12 @@ export default {
       //orderType 开单类型,1商品开单 2花材开单
       params = {...params,xj:JSON.stringify(xj),orderType:2}
 
+      //扣减库存
+      let orderId = this.option.orderId  ? this.option.orderId : 0
+			let book = this.option.book ? this.option.book : 0
+			let reduceStock = this.option.reduceStock?this.option.reduceStock:0
+      params = {...params,orderId:orderId,book:book,reduceStock:reduceStock}
+
       uni.showLoading({mask:true})
       createOrder(params).then((res) => {
         uni.hideLoading()
@@ -685,10 +691,10 @@ export default {
     gobackEvent () {
       let customId = this.option.customId ? this.option.customId : 0
       let customName = this.option.customName ? this.option.customName : ''
-      this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName,type:2})
-    },
-    pageToItemList() {
-      this.$util.pageTo({url: '/admin/billing/index2?customId='+this.option.customId,type:2})
+      let reduceStock = this.option.reduceStock?this.option.reduceStock:0
+      let orderId = this.option.orderId  ? this.option.orderId : 0
+      let book = this.option.book ? this.option.book : 0
+      this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
     }
   }
 };

+ 3 - 1
hdApp/src/admin/billing/index2.vue

@@ -232,7 +232,9 @@ export default {
 			let customName = this.option.customName ? this.option.customName : '';
 			let orderId = this.option.orderId  ? this.option.orderId : 0
 			let book = this.option.book ? this.option.book : 0
-			this.$util.pageTo({ url: '/admin/billing/affirm',type:2,query: {customId:this.option.customId,customName:customName,orderId:orderId,book:book}})
+			let customId = this.option.customId?this.option.customId:0
+			let reduceStock = this.option.reduceStock?this.option.reduceStock:0
+			this.$util.pageTo({ url: '/admin/billing/affirm?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
 		}
 	}
 };

+ 8 - 9
hdApp/src/admin/home/order.vue

@@ -42,11 +42,11 @@
             <view class="list-button">
 
               <block v-if="item.payStatus == 1 && item.repeat == 1">
-                <view class="admin-button-com middle" @click.stop="reduceStock(item)">扣库存</view>
+                <view class="admin-button-com middle" @click.stop="reduceStock(item)">扣库存</view>
               </block>
               <block v-else>
-                <view class="admin-button-com middle default" v-if="item.payStatus == 1 && item.repeat == 0" @click.stop="setRepeat(item)">转重复</view>
-                <view class="admin-button-com middle default" @click.stop="" v-else>扣库存</view>                
+                <view class="admin-button-com middle default" v-if="item.payStatus == 1 && item.repeat == 0" @click.stop="setRepeat(item)">不扣库存</view>
+                <view class="admin-button-com middle default" @click.stop="" v-else>扣库存</view>                
               </block>
 
               <view class="admin-button-com middle" v-if="item.status == 2" @click.stop="sendOrderFn(item)">发货</view>
@@ -121,7 +121,7 @@ export default {
       searchTypeName:'价格',
       searchType:0,
       searchOption:['价格', '单号','手机','名称'],
-      refreshPage:1
+      refreshPage:0
     };
   },
   onPullDownRefresh () {
@@ -156,10 +156,8 @@ export default {
     if(this.refreshPage == 1){
       this.resetList();
       this.getOrderList()
-    }else{
-      this.refreshPage = 1
+      this.refreshPage = 0
     }
-
   },
   methods: {
     setSearchType(){
@@ -180,10 +178,11 @@ export default {
       this.getOrderList()
     },
     reduceStock(item){
-
+      this.$util.pageTo({url:'/admin/billing/index2?customId='+item.customId+'&orderId='+item.id+'&reduceStock=1'})
     },
     setRepeat(item){
-
+      this.$util.confirmModal({content:'确认要转为扫码收款?'},() => {
+      })
     },
     sendOrderFn(item){
       let that = this