shish před 1 rokem
rodič
revize
e36e2573fb

+ 42 - 1
ghsPad/src/mixins/product.js

@@ -7,6 +7,8 @@ export default {
 		return {
 			currentJobType: "bill",//业务类型,开单、采购、报损、盘点
 			currentJobId:0,//业务类型对应的主体ID等
+			currentBackJobId:1,
+			globalHasHand:0,
 			isCut:false,
 			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
@@ -86,7 +88,46 @@ export default {
 			this.setSelectInfo({ currentJobType: this.currentJobType, info: selectData,currentJobId:this.currentJobId })
 			uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentJobId, selectData)
 		},
-		//询问是否删除缓存
+		handOrder(){
+			let that = this
+			let has = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId)
+			if(!this.$util.isEmpty(has)){
+				this.$msg('已挂了一单')
+				return false
+			}
+
+			let currentInfo = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentJobId)
+			if(this.$util.isEmpty(currentInfo)){
+				this.$msg('没有花材要挂单')
+				return false
+			}
+			uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId, currentInfo)
+
+			uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentJobId)
+			that.reSetSelectInfo({currentJobType:that.currentJobType,currentJobId:that.currentJobId})
+
+			this.globalHasHand = 1
+		},
+		getHandOrder(){
+			let that = this
+			let currentInfo = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId)
+			if(this.$util.isEmpty(currentInfo)){
+				this.$msg('没有挂单')
+				return false
+			}
+			uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentJobId)
+			that.reSetSelectInfo({currentJobType:that.currentJobType,currentJobId:that.currentJobId})
+
+			uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentJobId, currentInfo)
+			if(!this.$util.isEmpty(currentInfo)){
+				this.setSelectInfo({ currentJobType: this.currentJobType, info: currentInfo,currentJobId:this.currentJobId })
+			}
+
+			//清除挂单
+			uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentBackJobId)
+
+			this.globalHasHand = 0
+		},
 		removeFromSave(){
 			let that = this
 			that.$util.confirmModal({content:'确认清除花材?'},() => {

+ 10 - 3
ghsPad/src/pages/home/components/cashConsole.vue

@@ -1,9 +1,9 @@
 <template>
 <view class="button-area">
 	<view class="active" @click="openBox">开箱</view>
-	 <view class="active" 
- style="background-color:orange;color:white;border-color:orange;position:fixed;left:85upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" 
- @click="beginSettle">批发结算</view>
+	<view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="beginSettle">批发结算</view>
+	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
+	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #3385FF;" @click="getHandOrder()" v-else>取单</view>
     <view class="active" @click="clearItemFn">清空</view>
 	<view class="active" @click="cancelKdFn">返回</view>
 
@@ -102,6 +102,13 @@ export default {
     },
 	created(){
 		this.listenScanItem()
+
+		//判断是否有单可取
+		let has = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId)
+		if(!this.$util.isEmpty(has)){
+			this.globalHasHand = 1
+		}
+
 	},
 	destroyed(){
 		// #ifdef APP-PLUS

+ 1 - 1
hdPad/src/mixins/product.js

@@ -118,7 +118,7 @@ export default {
 			uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentJobId)
 			that.reSetSelectInfo({currentJobType:that.currentJobType,currentJobId:that.currentJobId})
 
-			uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId, currentInfo)
+			uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentJobId, currentInfo)
 			if(!this.$util.isEmpty(currentInfo)){
 				this.setSelectInfo({ currentJobType: this.currentJobType, info: currentInfo,currentJobId:this.currentJobId })
 			}

+ 2 - 8
hdPad/src/pages/home/components/console.vue

@@ -4,8 +4,8 @@
 	<view class="active" @click="changeProperty(0)">花束</view>
 	<view class="active" @click="openBox">开箱</view>
 	<view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="goSettleCommit">结算</view>
-	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="toHand()" v-if="globalHasHand == 0">挂单</view>
-	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #3385FF;" @click="getHand()" v-else>取单</view>
+	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
+	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #3385FF;" @click="getHandOrder()" v-else>取单</view>
     <view class="active" @click="toWastage">报损</view>
 	<view class="active" @click="selectCustom()">选客</view>
     <view class="active" @click="clearItemFn">清空</view>
@@ -195,12 +195,6 @@ export default {
 				}
 			})
 		},
-		toHand(){
-			this.handOrder()
-		},
-		getHand(){
-			this.getHandOrder()
-		},
 		gatheringFn(){
 			this.$util.hitVoice()
 			this.$refs.gatheringRef.open('center')