ysy 1 жил өмнө
parent
commit
71b9aa2120

+ 93 - 19
pages/pda/feeding/components/deviceBom.vue

@@ -59,7 +59,8 @@
 						<input class="uni-input" v-model="item.extInfo.heatNumber"></input>
 					</view>
 
-					<view v-if="clientEnvironmentId == 2" class="lable rx-cc" style="color: #157A2C"
+					<view v-if="clientEnvironmentId == 2" class="lable rx-cc"
+						:style="Object.prototype.hasOwnProperty.call(item.extInfo, 'positionList') && item.extInfo.positionList.length > 0 ? 'color:S #E6A23C' : 'color: #157A2C'"
 						@click="handleStorage(index)">货位</view>
 
 				</view>
@@ -90,7 +91,7 @@
 							</u-button>
 
 
-							<u-button size="small" style="width: 260rpx" type="success">
+							<u-button size="small" style="width: 260rpx" type="success" @click="addHjCode()">
 								添加货位
 							</u-button>
 						</view>
@@ -106,8 +107,19 @@
 					</view>
 					<view class="table">
 						<u-list @scrolltolower="scrolltolower" class="z_list">
-							<view class="tr row rx-sc" v-for="(it, idx) in list[listIndex].extInfo.positionList" :key='idx'>
-									<view class="item ww70">{{it.code}}</view>
+							<view class="tr row rx-sc" v-for="(it, idx) in list[listIndex].extInfo.positionList"
+								:key='idx'>
+								<view class="item ww70 content content_num">
+
+									<input class="uni-input" v-model="it.code"></input>
+
+								</view>
+
+
+								<view class="ww30 rx-cc" @click="removeGoods(idx)">
+									<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+										color="#fa3534"></uni-icons>
+								</view>
 							</view>
 
 						</u-list>
@@ -118,6 +130,21 @@
 				</view>
 
 			</template>
+
+			<template v-slot:operate>
+				<view class="operate_box rx-bc">
+					<u-button size="small" class="u-reset-button" @click="handleClose">
+						清空/取消
+					</u-button>
+
+
+					<u-button type="success" size="small" class="u-reset-button" @click="handleOk">
+						确定
+					</u-button>
+
+				</view>
+			</template>
+
 		</SearchPopup>
 
 
@@ -166,6 +193,9 @@
 
 			handleStorage(idx) {
 				this.listIndex = idx || 0
+				this.formData.lineNum = this.list[this.listIndex].extInfo.lineNum || null
+				this.formData.levelNum = this.list[this.listIndex].extInfo.levelNum || null
+
 				this.popupShow = true
 
 			},
@@ -245,7 +275,8 @@
 						}
 						console.log(positionList)
 						this.$set(this.list[this.listIndex].extInfo, 'positionList', positionList)
-
+						this.$set(this.list[this.listIndex].extInfo, 'lineNum', this.formData.lineNum)
+						this.$set(this.list[this.listIndex].extInfo, 'levelNum', this.formData.levelNum)
 
 						currentLetterIndex++; // 自增索引
 
@@ -295,7 +326,49 @@
 
 
 			},
-			
+
+			removeGoods(idx) {
+				if (this.list[this.listIndex].extInfo.positionList == 1) {
+					uni.showToast({
+						title: `至少保留一个货架!`,
+						icon: 'none'
+					})
+					return false
+				}
+
+
+				this.list[this.listIndex].extInfo && this.list[this.listIndex].extInfo.positionList.splice(idx, 1)
+
+
+			},
+
+			handleClose() {
+
+				this.list[this.listIndex].extInfo.positionList = []
+				this.list[this.listIndex].extInfo.lineNum = null
+				this.list[this.listIndex].extInfo.levelNum = null
+
+				this.popupShow = false
+				this.formData.levelNum = null
+				this.formData.lineNum = null
+				this.listIndex = 0
+
+
+
+			},
+
+			handleOk() {
+				this.listIndex = 0
+				this.popupShow = false
+			},
+
+			addHjCode() {
+				this.list[this.listIndex].extInfo.positionList.unshift({
+					code: ''
+				})
+				this.$forceUpdate()
+			},
+
 			scrolltolower() {},
 		}
 	}
@@ -406,19 +479,6 @@
 
 				}
 
-				.content_num {
-					display: flex;
-					align-items: center;
-					padding: 0 4rpx;
-
-					/deep/ .uni-input-input {
-						border: 2rpx solid #F0F8F2;
-						background: #F0F8F2;
-						color: $theme-color;
-					}
-
-
-				}
 
 				.pd4 {
 					padding: 4rpx 8rpx;
@@ -542,4 +602,18 @@
 	.z_list {
 		max-height: 500rpx;
 	}
+
+	.content_num {
+		display: flex;
+		align-items: center;
+		padding: 0 4rpx;
+
+		/deep/ .uni-input-input {
+			border: 2rpx solid #F0F8F2;
+			background: #F0F8F2;
+			color: $theme-color;
+		}
+
+
+	}
 </style>