longfenglin 1 год назад
Родитель
Сommit
aaafd81c26

+ 15 - 4
pages/pda/jobBooking/components/jobBom.vue

@@ -59,7 +59,7 @@
 					<view class="rx ww45">
 						<view class="lable rx-cc ww80">重量</view>
 						<view class="content content_num">
-							<input class="uni-input" v-model="item.workReportInfo.formedWeight" type="digit"
+							<input class="uni-input" v-model="formedWeight" type="digit"
 								:disabled="isDetails"></input>
 							<view class="unit">{{ item.weightUnit }}</view>
 						</view>
@@ -155,14 +155,21 @@ export default {
 	},
 
 	watch: {
-
 		notFormed: {
 			immediate: true,
 			deep: true,
 			handler(newVal) {
 				this.notFormedList = newVal
 			}
-		}
+		},
+		// item:{
+		// 	immediate: true,
+		// 	deep: true,
+		// 	handler(newVal) {
+		// 		console.log('ccccc吃饭了',newVal)
+		// 		this.$forceUpdate()
+		// 	}
+		// }
 	},
 
 
@@ -172,7 +179,7 @@ export default {
 			notFormedList: [],
 			clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
 				.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
-
+			formedWeight:'',
 		}
 	},
 	created() {
@@ -193,6 +200,10 @@ export default {
 
 	},
 	methods: {
+		fWeightInput(formedWeight,notFormedWeight){
+				this.formedWeight=formedWeight
+				this.$forceUpdate()
+		},
 		batchNoNew(e){
 
 			this.item.workReportInfo.batchNo = this.item.batchNo+e.target.value;

+ 27 - 2
pages/pda/jobBooking/components/semiProductJobBom.vue

@@ -200,7 +200,7 @@
 
 						<view class="item ww25 content_num">
 							<view v-if='isDetails'>{{it.extInfo.reportWeight }}</view>
-							<input class="uni-input" v-else v-model="it.extInfo.reportWeight" type='digit'></input>
+							<input class="uni-input" v-else v-model="it.extInfo.reportWeight" type='digit' @input="handleInput"></input>
 						</view>
 						<view class="item ww25" @click="openNumerate(it, idx)" v-if="isFirstTask == 1">
 							<view class="numerate">点击计算</view>
@@ -595,7 +595,32 @@
 
 				this.show = true
 			},
-
+			
+			 handleInput() {
+				let arr = JSON.parse(JSON.stringify(this.list));
+				this.sumweight(arr);
+				// this.sunTj();
+				// console.log('arr11111112222',arr)
+				// console.log('this.list33333',this.list)
+			},
+			sumweight(arr) {
+			      let formedWeight = 0;
+			      let notFormedWeight = 0;
+			      arr.map((s,i) => {
+			        if (s.extInfo.reportWeight) {
+			          if (s.extInfo.isQualified == 1) {
+			            formedWeight += s.extInfo.reportWeight * 1;
+			          } else {
+			            notFormedWeight += s.extInfo.reportWeight * 1;
+			          }
+			        } else {
+			          s.extInfo.reportWeight = null;
+			        }
+			      })
+			      console.log('chulaiuwanlo',formedWeight,notFormedWeight)
+				  this.$emit('weightEmit',formedWeight,notFormedWeight)
+				  
+			},
 
 
 			cancel() {

+ 11 - 4
pages/pda/jobBooking/index/index.vue

@@ -29,7 +29,7 @@
 					
 					<view v-if="clientEnvironmentId == 3 || objData.singleReport !== 1">
 						
-						<jobBom v-if='isLoad' :item='objData' ref='jobRef' :notFormed='objData.notFormedList'
+						<jobBom v-if='isLoad' :item='objData' ref='jobReftg' :notFormed='objData.notFormedList'
 							@penalize='penalize' @modeNum='modeNum'></jobBom>
 					</view>
 
@@ -56,7 +56,7 @@
 					<view v-if="clientEnvironmentId == 3 || this.objData.singleReport !== 1">
 						<semiProductJobBom
 							v-if='objData.semiProductList && objData.semiProductList.length != 0 && taskType != 4 && taskType != 6 && objData.singleReport == 1'
-							:item='objData' :list='objData.semiProductList' :equipmentList="objData.equipmentList">
+							:item='objData' :list='objData.semiProductList' :equipmentList="objData.equipmentList" @weightEmit='weightEmit'>
 						</semiProductJobBom>
 					</view>
 
@@ -375,7 +375,14 @@ export default {
 	},
 
 	methods: {
-
+        weightEmit(formedWeight,notFormedWeight){
+			this.$refs.jobReftg.fWeightInput(formedWeight,notFormedWeight)
+			this.$nextTick(() => {
+				this.$set(this.objData.workReportInfo,'formedWeight',formedWeight)
+				this.$set(this.objData.workReportInfo,'notFormedWeight',notFormedWeight)
+			})
+			this.$forceUpdate()
+		},
 
 		// 相机扫码
 		HandlScanCode() {
@@ -955,7 +962,6 @@ export default {
 
 		},
 
-
 		checkPack() {
 			uni.hideLoading();
 			return new Promise((resolve) => {
@@ -1094,6 +1100,7 @@ export default {
 
 			})
 		},
+		
 
 
 	},

+ 3 - 0
pages/pda/picking/details.vue

@@ -521,6 +521,9 @@ export default {
 		          ids.push(pitem.categoryCode)
 		        })
 		      })
+			  if(ids.length==0){
+				  return;
+			  }
 			  getInventoryTotal(ids).then(res => {
 				  res.map(ritem=>{
 				    this.List.map(item=>{