lilei 2 anos atrás
pai
commit
05b934e606

+ 11 - 3
pages/batchShelves/scanProduct.vue

@@ -16,7 +16,7 @@
 						<view class="pinfo flex_1">
 							<view class="ptxt flex align_center justify_between">
 								<view>{{productInfo.code}}</view>
-								<view class="pcode" v-if="productInfo.shelfProductApi">
+								<view class="pcode" v-if="productInfo.shelfProductApi&&productInfo.shelfProductApi.enableFlag==1">
 									可用库存:
 									<text>{{productInfo.shelfProductApi.qty}}</text>
 									{{productInfo.unit}}
@@ -28,7 +28,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="product-nums">
+				<view class="product-nums" v-if="productInfo.shelfProductApi&&productInfo.shelfProductApi.enableFlag==1">
 					<view>本次上架数量<text>(左右滑动选择)</text></view>
 					<view class="numsBox flex align_center justify_between">
 						<view class="a-left" @click="numsBoxScroll(0)"><u-icon name="arrow-left"></u-icon></view>
@@ -42,7 +42,8 @@
 						<view class="a-right" @click="numsBoxScroll(1)"><u-icon name="arrow-right"></u-icon></view>
 					</view>
 				</view>
-				<view class="infoTits" v-if="productInfo.shelfCartApi">产品已录入,请确认数量</view>
+				<view class="infoTits" v-if="productInfo.shelfCartApi&&productInfo.shelfProductApi&&productInfo.shelfProductApi.enableFlag==1">产品已录入,请确认数量</view>
+				<view class="infoTits" v-else>此产品已被禁用,不可添加!</view>
 			</view>
 			<view class="noData" v-else>
 				暂无扫描结果
@@ -190,6 +191,13 @@
 					shelfCartSn: item?item.shelfCartSn:undefined
 				}
 				console.log(params)
+				if(item.shelfProductApi&&item.shelfProductApi.enableFlag==0){
+					uni.showToast({
+						icon:'none',
+						title: '此产品已被禁用,不可添加!'
+					})
+					return false
+				}
 				shelfCartSave(params).then(res => {
 					console.log(res)
 					if(res.status == 200){

+ 9 - 3
pages/batchShelves/searchProduct.vue

@@ -32,7 +32,7 @@
 						</view>
 						<view class="ptxt flex justify_between">
 							<text style="word-break: break-all;">{{item.code}}</text>
-							<view v-if="item.shelfProductApi">
+							<view v-if="item.shelfProductApi&&item.shelfProductApi.enableFlag==1">
 								可用库存:<text>{{item.shelfProductApi.qty}}</text>{{item.unit}}
 							</view>
 						</view>
@@ -132,8 +132,7 @@
 					pageSize:20,
 					code: this.$u.trim(this.queryWord),
 					shelfSn: this.shelfSn,
-					shelfTierCode: this.layer,
-					enableFlag: 1
+					shelfTierCode: this.layer
 				}
 				console.log(params)
 				this.status = 'loading'
@@ -156,6 +155,13 @@
 			},
 			// 新增
 			addItem(item){
+				if(item.shelfProductApi&&item.shelfProductApi.enableFlag==0){
+					uni.showToast({
+						icon:'none',
+						title: '此产品已被禁用,不可添加!'
+					})
+					return false
+				}
 				this.saveData(item,1)
 			},
 			// 修改数量