ysy 2 jaren geleden
bovenliggende
commit
9870b4e7d4

+ 26 - 11
pages/pda/jobBooking/components/turnoverBom.vue

@@ -1,10 +1,10 @@
 <template>
 	<view>
-		<view class="title_box rx-bc" >
+		<view class="title_box rx-bc">
 			<view class="name">周转车</view>
 		</view>
 
-		<view v-for="(item, index) in list" :key='index'>
+		<view v-for="(item, index) in newList" :key='index'>
 			<view class="title_box rx-bc">
 				<view class="left rx-ss" @click="getDelete(index)">
 					<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
@@ -85,9 +85,24 @@
 				default: () => {}
 			}
 		},
+
+
+		watch: {
+
+			list: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					this.newList = newVal
+				
+				}
+			}
+		},
+
 		data() {
 			return {
-				recycleQuantity: ''
+				recycleQuantity: '',
+				newList: []
 			}
 		},
 
@@ -95,13 +110,13 @@
 
 			quantInt(index, idx, it) {
 				if (it.quantity >= 1) {
-					this.$set(this.list[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
-					this.$set(this.list[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
+					this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
+					this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
 
 				} else {
-					this.$set(this.list[index].extInfo.positionList[idx], 'workOrderCode', '')
-					this.$set(this.list[index].extInfo.positionList[idx], 'categoryCode', '')
-					this.$set(this.list[index].extInfo.positionList[idx], 'quantity', 0)
+					this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', '')
+					this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', '')
+					this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
 				}
 
 
@@ -112,9 +127,9 @@
 			},
 
 			getDelete(index) {
-				 this.$emit('handleDel', index, 'turnover')
-			
-			
+				this.$emit('handleDel', index, 'turnover')
+
+
 			},
 		}
 	}

+ 10 - 12
pages/pda/jobBooking/index/index.vue

@@ -27,7 +27,6 @@
 
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
-
 					</view>
 
 				</view>
@@ -103,22 +102,21 @@
 			uni.$off("setSelectList");
 
 			uni.$on("setSelectList", (selectList, id) => {
-
+			
+			    let turnover = []
 
 				selectList.forEach(f => {
 					if (f.rootCategoryLevelId == 7) { // 周转车
-						this.objData.turnover.forEach(e => {
-							if (e.code != f.code) {
-								this.objData.turnover.push(f)
-								this.$forceUpdate()
-							}
-						})
-						console.log(this.objData.turnover)
-						
-
+				  	turnover = turnover.concat(f)
 					}
-
 				})
+				
+			
+				this.$set(this.objData, 'turnover', turnover)
+				console.log(this.objData)
+				this.$forceUpdate()
+				
+				
 
 			});
 

+ 4 - 2
pages/pda/workOrder/search/index.vue

@@ -149,7 +149,8 @@
 			this.isType = option.isType
 			if (option.storageKey) {
 				this.storageKey = option.storageKey
-
+                  
+				  this.memoList = []
 
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
@@ -161,7 +162,8 @@
 					this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 				} else if (this.isType == 'job') {
 					let _obj = (this.storageKey && uni.getStorageSync(this.storageKey)) || {}
-					this.memoList  = [ ..._obj.turnover ]
+					this.memoList = [..._obj.turnover]
+					
 				}