695593266@qq.com 3 месяцев назад
Родитель
Сommit
cf1128a19b
1 измененных файлов с 15 добавлено и 8 удалено
  1. 15 8
      src/views/produce/components/feeding/index.vue

+ 15 - 8
src/views/produce/components/feeding/index.vue

@@ -364,6 +364,7 @@
         teamName: '',
         isDefaultExecutor: false,
         checked: false,
+        useDefaultFeedDate: false,
         pickerOptions: {
           disabledDate(time) {
             // 禁止选择大于当前时间的日期
@@ -536,6 +537,7 @@
               // }
             });
             this.List = deepClone(arr);
+            this.applyDefaultExecutorTime();
           })
           .finally(() => {
             this.isLoad = true;
@@ -559,6 +561,16 @@
         return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
       },
 
+      applyDefaultExecutorTime() {
+        if (!this.useDefaultFeedDate || !this.List || this.List.length === 0) {
+          return;
+        }
+        const dateTime = this.getNowTime();
+        this.List.forEach((item) => {
+          this.$set(item, 'executorTime', dateTime);
+        });
+      },
+
       async getChooseEngrave() {
         await parameterGetByCode({
           code: 'choose_engrave'
@@ -569,14 +581,9 @@
         await parameterGetByCode({
           code: 'mes_order_feed_by_default_date'
         }).then((res) => {
-          if (res.value == '1') {
-            const dateTime = this.getNowTime();
-
-            this.$nextTick(() => {
-              this.List.forEach((item) => {
-                this.$set(item, 'executorTime', dateTime);
-              });
-            });
+          this.useDefaultFeedDate = res.value == '1';
+          if (this.useDefaultFeedDate) {
+            this.applyDefaultExecutorTime();
           }
         });