lilei 2 years ago
parent
commit
d3388e2d19
2 changed files with 11 additions and 8 deletions
  1. 7 5
      pages/batchShelves/scanProduct.vue
  2. 4 3
      pages/shelfSetting/editShelfHw.vue

+ 7 - 5
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&&productInfo.shelfProductApi.enableFlag==1">
+								<view class="pcode" v-if="productInfo.shelfProductApi">
 									可用库存:
 									<text>{{productInfo.shelfProductApi.qty}}</text>
 									{{productInfo.unit}}
@@ -28,7 +28,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="product-nums" v-if="productInfo.shelfProductApi&&productInfo.shelfProductApi.enableFlag==1">
+				<view class="product-nums" v-if="!isDisable">
 					<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,8 +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&&productInfo.shelfProductApi&&productInfo.shelfProductApi.enableFlag==1">产品已录入,请确认数量</view>
-				<view class="infoTits" v-else>此产品已被禁用,不可添加!</view>
+				<view class="infoTits" v-if="!isDisable&&productInfo.shelfCartApi">产品已录入,请确认数量</view>
+				<view class="infoTits" v-if="isDisable">此产品已被禁用,不可添加!</view>
 			</view>
 			<view class="noData" v-else>
 				暂无扫描结果
@@ -82,7 +82,8 @@
 				scleft: 0,
 				fromPage: null,
 				qrCode: '',
-				numsWidth: 52
+				numsWidth: 52,
+				isDisable: false
 			}
 		},
 		onReady() {
@@ -147,6 +148,7 @@
 					if(res.status == 200&&res.data&&res.data.productList&&res.data.productList.length){
 						const ret = res.data.productList[0]
 						 this.productInfo = ret
+						 this.isDisable = ret.shelfProductApi&&ret.shelfProductApi.enableFlag==0
 						 this.shelfPlaceCode = res.data.shelfPlaceCode
 						 // 数量区域宽度
 						 const query = uni.createSelectorQuery().in(_this);

+ 4 - 3
pages/shelfSetting/editShelfHw.vue

@@ -25,7 +25,7 @@
 							<view class="pinfo flex_1">
 								<view class="ptxt flex align_center justify_between">
 									<text>{{productEntity.code}}</text>
-									<text class="pcode" @click="toBindProduct" v-if="nowData&&nowData.shelfProductApiEntity.enableFlag==1">
+									<text class="pcode" @click="toBindProduct" v-if="nowData&&nowData.shelfProductApiEntity&&nowData.shelfProductApiEntity.enableFlag==1">
 										<u-icon name='reload'></u-icon>
 										更换产品
 									</text>
@@ -62,7 +62,7 @@
 		</view>
 		<view class="flex footer-btn">
 			<u-button v-if="type=='bind'" class="delbtn" :loading='loading' @click="handleDel" type='primary' shape="circle" size="medium">删除货位</u-button>
-			<u-button :disabled="nowData&&nowData.shelfProductApiEntity.enableFlag==0" :style="{width:type=='bind'?'45%':'100%'}" class="newbtn" :loading='loading' @click="formSubmit" type='primary' shape="circle" size="medium">保存</u-button>
+			<u-button :disabled="nowData&&nowData.shelfProductApiEntity&&nowData.shelfProductApiEntity.enableFlag==0" :style="{width:type=='bind'?'45%':'100%'}" class="newbtn" :loading='loading' @click="formSubmit" type='primary' shape="circle" size="medium">保存</u-button>
 		</view>
 	</view>
 </template>
@@ -103,6 +103,7 @@
 		onLoad(opts) {
 			const _this = this
 			this.nowData = this.$store.state.vuex_tempData;
+			console.log(this.nowData)
 			this.customerSn = this.nowData.customerSn
 			this.shelfSn = this.nowData.shelfSn
 			this.type = opts.type
@@ -206,7 +207,7 @@
 			// 禁用货位产品
 			enableShelfProduct(){
 				const _this = this
-				const isEnable = this.nowData&&this.nowData.shelfProductApiEntity.enableFlag==1
+				const isEnable = this.nowData&&this.nowData.shelfProductApiEntity&&this.nowData.shelfProductApiEntity.enableFlag==1
 				if(isEnable){
 					clzConfirm({
 					  title: '提示',