ysy il y a 2 ans
Parent
commit
264f5a57fa

+ 2 - 2
pages/pda/feeding/components/deviceBom.vue

@@ -16,13 +16,13 @@
 				<view class="item">
 					<view class="lable rx-cc">设备编码</view>
 					<view class="content">
-						{{ workOrderId ?  item.code: item.categoryCode }}
+						{{  item.code  }}
 					</view>
 				</view>
 
 				<view class="item">
 					<view class="lable rx-cc">设备名称</view>
-					<view class="content">{{ workOrderId ?  item.name : item.categoryName }}</view>
+					<view class="content">{{  item.name  }}</view>
 				</view>
 
 				<view class="item">

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

@@ -90,7 +90,7 @@
 		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
 			:localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
 
-		<matterPop v-if='matterShow' :matterId='matterId' :DTOList='DTOList' @close='close' @mattSave='mattSave'>
+		<matterPop v-if='matterShow' :matterId='matterId' :DTOList='DTOList' :mattList='mattList' @close='close' @mattSave='mattSave'>
 		</matterPop>
 
 	</view>
@@ -132,7 +132,8 @@
 
 				matterShow: false, //物料 左弹框
 				matterId: null,
-				DTOList: []
+				DTOList: [],
+				mattList: []
 			}
 		},
 
@@ -302,8 +303,7 @@
 					}
 				} else if (this.isType == 'feed') {
 					this.$set(this.list[index], 'checked', false)
-
-
+                    this.mattList = val.mattList
 					this.DTOList = val.inventoryDetailsDTOList
 					this.matterId = val.id
 					this.matterShow = true

+ 31 - 13
pages/pda/workOrder/search/matterPop.vue

@@ -10,7 +10,7 @@
 						<checkbox-group v-for="(item, index) in ListData" :key="index"
 							@change="e => selectVal(e, item, index)">
 							<label class="listBox rx-bs">
-                                  
+
 								<view class="listBox-sel">
 									<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
 										:checked="item.checked" />
@@ -67,6 +67,11 @@
 			DTOList: {
 				type: Array,
 				default: () => {}
+			},
+
+			mattList: {
+				type: Array,
+				default: () => {}
 			}
 		},
 		data() {
@@ -80,23 +85,36 @@
 		},
 		computed: {
 			ListData() {
-				const data = this.DTOList.map(m => {
-					 	m.checked = false
-						return {
-							...m
-						}
-				})
-				
-				this.list = data
-				
-				return data
+				console.log(this.mattList)
+				let list = []
+
+				list.push(
+
+					...this.DTOList.map(i => {
+						const checked =
+							this.mattList.findIndex(itm => itm.id == i.id) > -1
+							console.log(checked)
+							return {
+								checked,
+								...i
+							}
+					})
+				)
+
+
+
+
+
+				this.list = list
+
+				return list
 			}
 		},
 		methods: {
 			scrolltolower() {},
 
 			save() {
-			  this.$emit('mattSave', this.memoList, this.matterId)
+				this.$emit('mattSave', this.memoList, this.matterId)
 			},
 
 			//勾选
@@ -112,7 +130,7 @@
 				if (this.list[index].checked) {
 					if (idx === -1) {
 						this.memoList.push(this.list[index])
-						
+
 					}
 				} else {
 					if (idx > -1) {