ysy пре 2 година
родитељ
комит
197ad263cf

+ 67 - 25
pages/pda/sample/components/reuseTurnoverBom.vue

@@ -8,7 +8,7 @@
 		</view>
 
 		<view v-for="(item, index) in newList">
-		<!-- 	<view class="title_box rx-bc">
+			<!-- 	<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>
 				</view>
@@ -59,8 +59,8 @@
 							</view>
 
 							<view class="item ww20">
-								<input class="uni-input content_num" v-model="it.reuseNum" type="digit" @input="handleCompute"
-									></input>
+								<input class="uni-input content_num" v-model="it.reuseNum" type="digit"
+									@input="handleCompute"></input>
 							</view>
 						</view>
 					</u-list>
@@ -89,7 +89,11 @@
 				type: Object,
 				default: () => {}
 			},
-			
+			sampleList: {
+				type: Array,
+				default: () => []
+			},
+
 			reuseNum: {
 				type: [String, Number],
 				default: ''
@@ -108,17 +112,34 @@
 
 				}
 			},
-			
+
 			reuseNum: {
 				immediate: true,
 				deep: true,
 				handler(val) {
-					
 					this.newReuseNum = val
 					this.$forceUpdate()
-				
+
+				}
+			},
+
+			wordItem: {
+				immediate: true,
+				deep: true,
+				handler(val) {
+
+				}
+			},
+			sampleList: {
+				immediate: true,
+				deep: true,
+				handler(newList, oldList) {
+					this.reuseTurn(newList)
+
 				}
 			}
+
+
 		},
 
 
@@ -133,32 +154,53 @@
 		},
 		methods: {
 			scrolltolower() {},
-			
+
 			handleCompute() {
 				let _count = 0
 				this.newList.forEach(f => {
-					if(f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
-						 f.extInfo.positionList.forEach(o => {
-							if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) { 
-									_count = _count + Number(o.reuseNum)
-								
+					if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
+						f.extInfo.positionList.forEach(o => {
+							if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) {
+								_count = _count + Number(o.reuseNum)
+
 							}
-						 })
-						
+						})
+
 					}
 				})
-				
-				if(this.newReuseNum != _count) {
-					   uni.showToast({
-					   	 title: `还余 (${this.newReuseNum - _count})未回用`,
-						 icon: 'none'
-					   })
-					
+
+				if (this.newReuseNum != _count) {
+					uni.showToast({
+						title: `还余 (${this.newReuseNum - _count})未回用`,
+						icon: 'none'
+					})
+
 				}
 			},
-			
-			
-		
+
+			reuseTurn(list) {
+
+				list.forEach(a => {
+					if (Object.prototype.hasOwnProperty.call(a, 'selectType') && a.selectType == 1 && !a.isSel) {
+						console.log(this.newList)
+						this.newList.forEach(f => {
+							if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
+								f.extInfo.positionList.forEach(o => {
+									if (a.selectType == 1 && a.code == o.code) {
+										a.isSel = 1
+										o.reuseNum = Number(o.reuseNum) + 1
+									}
+								})
+
+							}
+						})
+
+					}
+				})
+			},
+
+
+
 		}
 	}
 </script>

+ 0 - 1
pages/pda/sample/components/turnoverBom.vue

@@ -113,7 +113,6 @@
 
 
 
-
 			getDelete(index) {
 				this.list.splice(index, 1)
 

+ 5 - 7
pages/pda/sample/index/index.vue

@@ -10,8 +10,7 @@
 					<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
 
 
-					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='job'
-						@handleScan='handleScan'>
+					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='job'>
 					</turnoverBom>
 
 					<view class="operate_box rx-sc">
@@ -23,8 +22,8 @@
 					<sampleBom :item='item.quality' v-if='item.quality' :isDetails='false' :turnoverList='item.turnover'
 						:paramList='paramList' @showReuseTurnover='showReuseTurnover = true'></sampleBom>
 
-
-					<reuseTurnoverBom v-if='showReuseTurnover' :list='item.turnover' :wordItem='item'
+              
+					<reuseTurnoverBom v-if='showReuseTurnover' :list='item.turnover' :wordItem='item' :sampleList='item.quality && item.quality.sampleList'
 						:reuseNum='item.quality.reuseNum'>
 					</reuseTurnoverBom>
 
@@ -83,7 +82,6 @@ export default {
 	},
 
 	onLoad(options) {
-		console.log(22, options)
 
 		this.title = options.taskName ? options.taskName : '质检'
 		this.id = options.workOrderId
@@ -122,13 +120,14 @@ export default {
 				ids: [this.id],
 				taskId: this.taskId
 			}).then(res => {
+				
 
 				this.List = res.map(m => {
 					m.workOrderId = m.id
 					if (m.quality) {
 						m.quality['sampleList'] = []
 						m['reuseTurnover'] = [],
-							m.quality['reuseNum'] = 0
+						m.quality['reuseNum'] = 0
 					} else {
 						this.isLastJob = false
 					}
@@ -149,7 +148,6 @@ export default {
 				})
 			})
 
-
 		},
 
 

+ 1 - 0
pages/pda/turnover/index/index.vue

@@ -74,6 +74,7 @@
 					workOrderId: this.workOrderId,
 					taskId: this.taskId
 				}).then(res => {
+					console.log(33,res)
 					this.List = []
 
 					if (res.turnover && res.turnover.length) {