695593266@qq.com 3 месяцев назад
Родитель
Сommit
287315194b

+ 14 - 3
src/views/produce/components/jobBooking/index.vue

@@ -912,9 +912,7 @@
           this.isReportTime = res.value == '1' ? true : false;
 
           if (this.isReportTime && this.idsList.length == 1) {
-            this.List.forEach((item) => {
-              item.workReportInfo.executorStartTime = item.feedLastTime;
-            });
+            this.applyDefaultReportTimeWhenSingle();
           }
         });
 
@@ -977,6 +975,16 @@
         });
       },
 
+      applyDefaultReportTimeWhenSingle() {
+        if (!this.isReportTime || this.idsList.length !== 1 || !this.List || this.List.length === 0) return;
+        const dateTime = this.getNowTime();
+        this.List.forEach((item, index) => {
+          item.workReportInfo.executorStartTime = item.feedLastTime;
+          this.$set(item.workReportInfo, 'executorTime', dateTime);
+          this.calculateWorkTimeByStartEnd(index);
+        });
+      },
+
       setDefaultIdList() {
         if (this.teamList.length != 0) {
           this.teamId = this.teamList[0].id;
@@ -1462,6 +1470,9 @@
                   }
                 });
               }
+              if (this.isReportTime && this.idsList.length == 1 && this.List.length > 0) {
+                this.applyDefaultReportTimeWhenSingle();
+              }
             })
             .finally(() => {
               this.isLoad = true;

+ 4 - 0
src/views/produce/components/workPlan/components/addSample.vue

@@ -821,6 +821,10 @@
         });
         this.packingSpecificationOption = listArr;
         this.tableList = res.list;
+        this.selection = res.list;
+        this.$nextTick(() => {
+          this.$refs.sourceTable.toggleAllSelection();
+        });
         return res;
       },
 

+ 5 - 0
src/views/produce/components/workPlan/edit.vue

@@ -1480,6 +1480,7 @@
         });
         let addStatus = res.list.map((item) => {
           item.isValid = true;
+          item.status = item.status || 1;
           // item.disposeTime = item.disposeTime
           //   ? item.disposeTime.split(' ')[0]
           //   : null;
@@ -1497,6 +1498,10 @@
         } else {
           this.getProSamList(this.packingList);
         }
+
+        if (this.form.recordingMethod != 1) {
+          this.countQualityResults();
+        }
       },
       async queryQualityTempleContent() {
         const res = await queryQualityTempleContent({