shish 11 месяцев назад
Родитель
Сommit
f64dfcc088

+ 7 - 2
hdPad/src/pages/home/cash.vue

@@ -24,7 +24,7 @@
 			<!-- 按钮操作 -->
 			<view class="open-box">
 				<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @showCustomPop="showCustomPop" @fastCreate="fastCreate" 
-				:customId.sync="customId" :customName.sync="customName" @changeProperty="changeProperty" @updateRightItem="updateRightItem"></consoleButton>
+				:customId.sync="customId" :orderId.sync="orderId" :reduceStock.sync="reduceStock" :customName.sync="customName" @changeProperty="changeProperty" @updateRightItem="updateRightItem"></consoleButton>
 			</view>
 		</view>
 
@@ -80,7 +80,9 @@ export default {
 			T:null,
 			customerInfo:{hasSelect:0,customId:0,customName:''},
 			myCustomList:[],
-			mustUpdate:false
+			mustUpdate:false,
+			orderId:0,
+			reduceStock:0
 		}
 	},
 	computed: {
@@ -94,6 +96,9 @@ export default {
 		//这个页面有二个这方法,不能去掉,不然会造成:全部缓存清了,点选客没有客户可选
 		this.getCustomData()
 
+		this.orderId = this.option.orderId ? this.option.orderId:0
+		this.reduceStock = this.option.reduceStock ? this.option.reduceStock:0
+
 	},
 	onUnload(){
 		clearInterval(this.T)

+ 13 - 1
hdPad/src/pages/home/components/console.vue

@@ -107,7 +107,15 @@ export default {
         changeCurrentJobId:{
             type:Number,
             default:0
-        }
+        },
+		orderId: {
+			type: Number,
+			default: 0
+		},
+		reduceStock: {
+			type: Number,
+			default: 0
+		},
     },
     data(){
         return {
@@ -280,6 +288,10 @@ export default {
 				this.$msg('请选择商品')
 				return false
 			}
+
+			//扣库存
+			params = {...params,reduceStock:this.reduceStock,orderId:this.orderId}
+
 			uni.showLoading({mask:false})
 			let product = this.selectList.map(i=>({ productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice }))
 			//isCashier=1时收银台播放 总金额139元,请扫码付款

+ 6 - 19
hdPad/src/pages/home/components/orderInfo.vue

@@ -74,7 +74,7 @@
 
     <view class="button-area">
       <view :class="[orderInfo.status==1 || orderInfo.status==5 ? '' : 'active']" @click="printFn(orderInfo)">打印</view>
-      <view :class="[orderInfo.status==1 ? 'active' : '']" @click="selectFn(orderInfo,0)">查微信</view>
+      <view :class="[orderInfo.repeat==1 && orderInfo.payStatus == 1 ? 'active' : '']" @click="reduceStock(orderInfo)">扣库存</view>
       <view :class="[orderInfo.status==1 ? 'active' : '']" @click="cancelShow()">取消</view>
       <view class="active" @click="openPf()">批发</view>
     </view>
@@ -179,9 +179,9 @@ export default {
 						title: '提示',
 						content: '没有安装,请先下载安装',
 						success: function (res){
-						if (res.confirm){ 
-							plus.runtime.openURL('http://www.wixhb.com/main/app')
-						}
+              if (res.confirm){
+                plus.runtime.openURL('http://www.wixhb.com/main/app')
+              }
 						}
 					})
 				}
@@ -258,21 +258,8 @@ export default {
         }
       })
     },
-    selectFn(order,payWay){
-      let that = this
-      uni.showLoading({mask:true})
-      codePayCheck({id:order.id,payWay:payWay,recheck:1}).then(res=>{
-          if(res.code == 1){
-              if(res.data.returnStatus == 'SUCCESS'){
-                  that.$msg('订单已付款')
-                  setTimeout(function(){
-                      that.getOrderDetail(order.id)
-                  },1500)
-              }else{
-                that.$msg('订单未付款!!')
-              }
-          }
-      })
+    reduceStock(order){
+      this.$util.pageTo({ url: "/pages/home/cash?customId="+order.customId+'&customName='+order.customName+'&orderId='+order.id+'&reduceStock=1',type:2})
     }
   }
 }

+ 1 - 1
hdPad/src/pages/home/components/orderList.vue

@@ -11,7 +11,7 @@
                 <view :class="[selectOrderId==item.id ? 'active' : 'not-active', 'item-body_box']">
                     <view class="flower-name_box">
                         <view class="current-item-title">
-                            <text>{{item.actPrice}}</text>                           
+                            <text>{{item.actPrice}}</text> <text v-if="item.repeat == 1" style="margin-left:10upx;">扫码收款</text>                      
                         </view>
                         <image class="flower-image" :src="item.cover"></image>
                         <text v-if="item.fromType!=4" style="position:absolute;top:2upx;left:90upx;font-size:11upx;">{{item.sn}}</text>