Browse Source

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/aiot-app

wsx 10 months ago
parent
commit
ec8de4af29

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

@@ -235,6 +235,23 @@ export default {
       immediate: true,
       immediate: true,
       deep: true,
       deep: true,
       handler(newVal) {
       handler(newVal) {
+        console.log(newVal, "newVal");
+        if (newVal.product && newVal.product.length != 0) {
+          let formedNum = 0;
+          let notFormedNum = 0;
+
+          newVal.product.forEach((item) => {
+            if (!item.extInfo.isQualified || item.extInfo.isQualified == 1) {
+              formedNum = formedNum + Number(item.feedQuantity);
+            } else {
+              notFormedNum = notFormedNum + Number(item.feedQuantity);
+            }
+          });
+
+          this.$set(this.item.workReportInfo, "formedNum", formedNum);
+          this.$set(this.item.workReportInfo, "notFormedNum", notFormedNum);
+        }
+        this.$forceUpdate();
         // if (!this.currentTaskDiagram.isFirstTask) {
         // if (!this.currentTaskDiagram.isFirstTask) {
         //   this.getSemiProductList(newVal);
         //   this.getSemiProductList(newVal);
         // }
         // }

+ 42 - 6
pages/pda/jobBooking/components/batchProductJobBom.vue

@@ -266,7 +266,6 @@
                 filterable
                 filterable
                 :disabled="isDetails"
                 :disabled="isDetails"
                 :clear="false"
                 :clear="false"
-                @change="handleInput"
               ></zxz-uni-data-select>
               ></zxz-uni-data-select>
             </view>
             </view>
           </view>
           </view>
@@ -335,6 +334,7 @@
                 class="uni-input"
                 class="uni-input"
                 v-else
                 v-else
                 v-model="it.extInfo.reportWeight"
                 v-model="it.extInfo.reportWeight"
+                @input="handleInput"
               />
               />
             </view>
             </view>
           </view>
           </view>
@@ -596,6 +596,18 @@ export default {
         this.changeHeatNumber();
         this.changeHeatNumber();
       },
       },
     },
     },
+    list: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        if (newVal.length) {
+          console.log(newVal);
+          this.newList = newVal;
+          this.sumweight(newVal);
+          this.sunTj();
+        }
+      },
+    },
   },
   },
 
 
   mounted() {
   mounted() {
@@ -806,7 +818,6 @@ export default {
 
 
       this.show = true;
       this.show = true;
     },
     },
-
     handleInput() {
     handleInput() {
       let arr = JSON.parse(JSON.stringify(this.list));
       let arr = JSON.parse(JSON.stringify(this.list));
       this.sumweight(arr);
       this.sumweight(arr);
@@ -816,20 +827,39 @@ export default {
     },
     },
     sumweight(arr) {
     sumweight(arr) {
       let formedWeight = 0;
       let formedWeight = 0;
-      let notFormedWeight = 0;
+      let noFormedWeight = 0;
       arr.map((s, i) => {
       arr.map((s, i) => {
         if (s.extInfo.reportWeight) {
         if (s.extInfo.reportWeight) {
           if (s.extInfo.isQualified == 1) {
           if (s.extInfo.isQualified == 1) {
             formedWeight += s.extInfo.reportWeight * 1;
             formedWeight += s.extInfo.reportWeight * 1;
           } else {
           } else {
-            notFormedWeight += s.extInfo.reportWeight * 1;
+            noFormedWeight += s.extInfo.reportWeight * 1;
           }
           }
         } else {
         } else {
           s.extInfo.reportWeight = null;
           s.extInfo.reportWeight = null;
         }
         }
+        this.$set(this.list[i].extInfo, "reportWeight", s.extInfo.reportWeight);
       });
       });
-      console.log("chulaiuwanlo", formedWeight, notFormedWeight);
-      this.$emit("weightEmit", formedWeight, notFormedWeight);
+
+      if (this.item.workReportInfo) {
+        this.item.workReportInfo.formedWeight = parseFloat(
+          formedWeight.toFixed(2)
+        );
+        this.item.workReportInfo.notFormedWeight = parseFloat(
+          noFormedWeight.toFixed(2)
+        );
+      }
+    },
+
+    sunTj() {
+      if (this.item.workReportInfo && this.item.singleReport == 1) {
+        this.item.workReportInfo.formedNum = this.newList.filter(
+          (v) => v.extInfo.isQualified == 1
+        ).length;
+        this.item.workReportInfo.notFormedNum = this.newList.filter(
+          (v) => v.extInfo.isQualified !== 1
+        ).length;
+      }
     },
     },
 
 
     cancel() {
     cancel() {
@@ -851,6 +881,12 @@ export default {
           if (rr.confirm) {
           if (rr.confirm) {
             this.list.splice(idx, 1);
             this.list.splice(idx, 1);
           }
           }
+
+          if (this.list.length != 0) {
+            this.$set(this.item.workReportInfo, "formedNum", 0);
+            this.$set(this.item.workReportInfo, "notFormedNum", 0);
+          }
+          this.$forceUpdate();
         },
         },
       });
       });
     },
     },

+ 17 - 0
pages/pda/jobBooking/components/singleJobBom.vue

@@ -260,6 +260,23 @@ export default {
       immediate: true,
       immediate: true,
       deep: true,
       deep: true,
       handler(newVal) {
       handler(newVal) {
+        console.log(newVal, "newVal--------------");
+        if (newVal.semiProductList && newVal.semiProductList.length != 0) {
+          let formedNum = 0;
+          let notFormedNum = 0;
+
+          newVal.semiProductList.forEach((item) => {
+            if (!item.extInfo.isQualified || item.extInfo.isQualified == 1) {
+              formedNum = formedNum + Number(item.feedQuantity);
+            } else {
+              notFormedNum = notFormedNum + Number(item.feedQuantity);
+            }
+          });
+
+          this.$set(this.item.workReportInfo, "formedNum", formedNum);
+          this.$set(this.item.workReportInfo, "notFormedNum", notFormedNum);
+        }
+        this.$forceUpdate();
         if (!newVal.currentTaskDiagram.isFirstTask) {
         if (!newVal.currentTaskDiagram.isFirstTask) {
           this.getSemiProductList(newVal);
           this.getSemiProductList(newVal);
         }
         }

+ 46 - 6
pages/pda/jobBooking/components/singleProductJobBom.vue

@@ -216,7 +216,7 @@
         </view>
         </view>
 
 
         <view class="item rx-sc">
         <view class="item rx-sc">
-          <view class="rx ww120">
+          <view class="rx ww50">
             <view class="lable lable150 rx-cc">原因/处置</view>
             <view class="lable lable150 rx-cc">原因/处置</view>
             <view
             <view
               class="content content_num"
               class="content content_num"
@@ -248,7 +248,21 @@
               >
               >
               </zxz-uni-data-select>
               </zxz-uni-data-select>
             </view>
             </view>
-            <view class="content content_num"> {{ "" }}</view>
+            <!-- <view class="content content_num"> {{ "" }}</view> -->
+          </view>
+
+          <view class="rx ww50">
+            <view class="lable lable150 rx-cc">报工重量</view>
+
+            <view class="content content_num">
+              <view v-if="isDetails">{{ it.extInfo.reportWeight }}</view>
+              <input
+                class="uni-input"
+                v-else
+                v-model="it.extInfo.reportWeight"
+                @input="handleInput"
+              />
+            </view>
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
@@ -508,6 +522,18 @@ export default {
         this.changeHeatNumber();
         this.changeHeatNumber();
       },
       },
     },
     },
+    list: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        if (newVal.length) {
+          console.log(newVal);
+          this.newList = newVal;
+          this.sumweight(newVal);
+          //  this.sunTj();
+        }
+      },
+    },
   },
   },
 
 
   data() {
   data() {
@@ -533,6 +559,7 @@ export default {
       resultIdx: 0,
       resultIdx: 0,
 
 
       deviceList: [],
       deviceList: [],
+      newList: [],
 
 
       isQualifiedList: [
       isQualifiedList: [
         {
         {
@@ -717,20 +744,28 @@ export default {
     },
     },
     sumweight(arr) {
     sumweight(arr) {
       let formedWeight = 0;
       let formedWeight = 0;
-      let notFormedWeight = 0;
+      let noFormedWeight = 0;
       arr.map((s, i) => {
       arr.map((s, i) => {
         if (s.extInfo.reportWeight) {
         if (s.extInfo.reportWeight) {
           if (s.extInfo.isQualified == 1) {
           if (s.extInfo.isQualified == 1) {
             formedWeight += s.extInfo.reportWeight * 1;
             formedWeight += s.extInfo.reportWeight * 1;
           } else {
           } else {
-            notFormedWeight += s.extInfo.reportWeight * 1;
+            noFormedWeight += s.extInfo.reportWeight * 1;
           }
           }
         } else {
         } else {
           s.extInfo.reportWeight = null;
           s.extInfo.reportWeight = null;
         }
         }
+        this.$set(this.list[i].extInfo, "reportWeight", s.extInfo.reportWeight);
       });
       });
-      console.log("chulaiuwanlo", formedWeight, notFormedWeight);
-      this.$emit("weightEmit", formedWeight, notFormedWeight);
+
+      if (this.item.workReportInfo) {
+        this.item.workReportInfo.formedWeight = parseFloat(
+          formedWeight.toFixed(2)
+        );
+        this.item.workReportInfo.notFormedWeight = parseFloat(
+          noFormedWeight.toFixed(2)
+        );
+      }
     },
     },
 
 
     cancel() {
     cancel() {
@@ -752,6 +787,11 @@ export default {
           if (rr.confirm) {
           if (rr.confirm) {
             this.list.splice(idx, 1);
             this.list.splice(idx, 1);
           }
           }
+          if (this.list.length != 0) {
+            this.$set(this.item.workReportInfo, "formedNum", 0);
+            this.$set(this.item.workReportInfo, "notFormedNum", 0);
+          }
+          this.$forceUpdate();
         },
         },
       });
       });
     },
     },