ソースを参照

修复pda的bug

695593266@qq.com 10 ヶ月 前
コミット
fc269da57a

+ 29 - 0
pages/pda/jobBooking/components/batchJobBom.vue

@@ -328,6 +328,35 @@ export default {
           this.item.workReportInfo = this.deepCopy(this.item.workReportInfo);
           this.$forceUpdate();
         }
+
+        // if (
+        //   this.clientEnvironmentId == 3 &&
+        //   newVal.semiProductList &&
+        //   newVal.semiProductList.length != 0
+        // ) {
+        //   let formedNum = 0;
+        //   let notFormedNum = 0;
+
+        //   newVal.semiProductList.forEach((item) => {
+        //     if (
+        //       !item.extInfo.isQualified ||
+        //       item.extInfo.isQualified == 1 ||
+        //       item.extInfo.isQualified == 3
+        //     ) {
+        //       formedNum = formedNum + Number(item.feedQuantity);
+        //     } else {
+        //       notFormedNum = notFormedNum + Number(item.feedQuantity);
+        //     }
+        //   });
+
+        //   console.log("合格数量:" + formedNum, "不合格数量:" + notFormedNum);
+
+        //   this.$set(this.item.workReportInfo, "formedNum", formedNum);
+        //   this.$set(this.item.workReportInfo, "notFormedNum", notFormedNum);
+
+        //   this.item.workReportInfo = this.deepCopy(this.item.workReportInfo);
+        //   this.$forceUpdate();
+        // }
         // if (!this.currentTaskDiagram.isFirstTask) {
         //   this.getSemiProductList(newVal);
         // }

+ 13 - 11
pages/pda/jobBooking/components/jobBom.vue

@@ -41,7 +41,7 @@
             <view class="content content_num">
               <input
                 class="uni-input"
-                v-model="formedNum"
+                v-model="item.workReportInfo.formedNum"
                 :disabled="isDetails"
                 @input="blurNum(item.workReportInfo)"
                 type="digit"
@@ -55,7 +55,7 @@
             <view class="content content_num">
               <input
                 class="uni-input"
-                v-model="formedWeight"
+                v-model="item.workReportInfo.formedWeight"
                 type="digit"
                 :disabled="isDetails"
                 @input="blurWeight()"
@@ -154,7 +154,9 @@
             @click="singleQuery"
             v-if="
               item.currentTaskDiagram &&
-              item.currentTaskDiagram.isFirstTask == 1
+              item.currentTaskDiagram.isFirstTask == 1 &&
+              item.semiProductList &&
+              item.semiProductList.length == 0
             "
             >创建在制品</view
           >
@@ -190,14 +192,14 @@ export default {
         this.notFormedList = newVal;
       },
     },
-    // item:{
-    // 	immediate: true,
-    // 	deep: true,
-    // 	handler(newVal) {
-    // 		console.log('ccccc吃饭了',newVal)
-    // 		this.$forceUpdate()
-    // 	}
-    // }
+    item: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        console.log("ccccc吃饭了", newVal);
+        this.$forceUpdate();
+      },
+    },
   },
 
   data() {

+ 3 - 1
pages/pda/jobBooking/components/semiProductJobBomPL.vue

@@ -148,7 +148,7 @@
 
       <view class="content_table2">
         <view class="head row rx-sc">
-          <view class="item ww15" style="font-size: 20rpx"> 合格品数 </view>
+          <view class="item ww15" style="font-size: 20rpx"> 合格品数 </view>
           <view class="item ww25">报工总重量/{{ it.extInfo.weightUnit }} </view>
           <view class="item ww20" style="font-size: 20rpx"> 设备 </view>
           <view class="item ww20" style="font-size: 20rpx"> 炉次号 </view>
@@ -584,6 +584,7 @@ export default {
 
     handDel3(idx, yyIdx) {
       this.list[idx].extInfo.batchReportInfo.splice(yyIdx, 1);
+      this.$emit("countNumPl", this.list, idx);
     },
 
     blurNum(event, idx, yyIdx) {
@@ -758,6 +759,7 @@ export default {
 
     handDel4(idx, yyIdx) {
       this.list[idx].extInfo.notBatchReportInfo.splice(yyIdx, 1);
+      this.$emit("countNumPl", this.list, idx);
       this.$forceUpdate();
     },
 

+ 5 - 2
pages/pda/jobBooking/components/singleJobBom.vue

@@ -126,9 +126,12 @@
             class="unit-btn"
             @click="singleQuery"
             v-if="
-              item.currentTaskDiagram.isFirstTask && clientEnvironmentId != 3
+              item.currentTaskDiagram.isFirstTask == 1 &&
+              clientEnvironmentId != 3 &&
+              item.semiProductList &&
+              item.semiProductList.length == 0
             "
-            >确认</view
+            >创建在制品</view
           >
 
           <!-- <view

+ 26 - 7
pages/pda/jobBooking/index/index.vue

@@ -144,6 +144,7 @@
             "
             :item="objData"
             :list="objData.semiProductList"
+            ref="jobReftg"
             :equipmentList="objData.equipmentList"
             @countNumPl="countNumPl"
           >
@@ -1360,7 +1361,6 @@ export default {
     },
     //批量报工合格不合格重量统计
     countNumPl(list, index) {
-      console.log("11111122222333", list);
       //合格总数
       let formedNumCount = 0;
       //合格总重量
@@ -1390,6 +1390,7 @@ export default {
             notFormedWeightCount + Number(nw.allReportWeight || 0);
         });
       });
+
       this.$set(this.objData.workReportInfo, "formedNum", formedNumCount); //合格总数
       this.$set(this.objData.workReportInfo, "formedWeight", formedWeightCount); //合格总重量
       this.$set(this.objData.workReportInfo, "notFormedNum", notFormedNumCount); //不合格总数
@@ -1398,14 +1399,32 @@ export default {
         "notFormedWeight",
         notFormedWeightCount
       ); //不合格总重量
-      this.$refs.jobReftg.formedTotal(
-        formedNumCount,
-        formedWeightCount,
-        notFormedNumCount,
-        notFormedWeightCount
-      );
+      // this.$refs.jobReftg.formedTotal(
+      //   formedNumCount,
+      //   formedWeightCount,
+      //   notFormedNumCount,
+      //   notFormedWeightCount
+      // );
+      // console.log("777777777777777", this.objData);
+      this.objData = this.deepCopy(this.objData);
       this.$forceUpdate();
     },
+
+    deepCopy(obj, hash = new WeakMap()) {
+      if (obj === null) return null;
+      if (obj instanceof Date) return new Date(obj);
+      if (obj instanceof RegExp) return new RegExp(obj);
+      if (typeof obj !== "object" && typeof obj !== "function") return obj;
+      if (hash.has(obj)) return hash.get(obj);
+
+      const result = Array.isArray(obj) ? [] : {};
+      hash.set(obj, result);
+
+      return Object.keys(obj).reduce((acc, key) => {
+        acc[key] = this.deepCopy(obj[key], hash);
+        return acc;
+      }, result);
+    },
   },
 
   beforeDestroy() {

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

@@ -129,7 +129,8 @@
               objData.product &&
               objData.product.length != 0 &&
               taskType == 6 &&
-              objData.singleReport == 0
+              objData.singleReport == 0 &&
+              clientEnvironmentId != 3
             "
             :item="objData"
             :list="objData.product"
@@ -143,7 +144,8 @@
               objData.semiProductList.length != 0 &&
               taskType != 6 &&
               taskType != 3 &&
-              objData.singleReport == 0
+              objData.singleReport == 0 &&
+              clientEnvironmentId == 3
             "
             :list="objData.semiProductList"
             :item="objData"