695593266@qq.com hace 3 meses
padre
commit
4b2ef959e5
Se han modificado 1 ficheros con 16 adiciones y 1 borrados
  1. 16 1
      pages/pda/feeding/components/workOrderBom.vue

+ 16 - 1
pages/pda/feeding/components/workOrderBom.vue

@@ -217,7 +217,10 @@ export default {
           this.item?.executorTime ||
           this.item?.executorTime ||
           "";
           "";
         if (start && end) {
         if (start && end) {
-          const range = [this.normalizeDateTime(start), this.normalizeDateTime(end)];
+          const range = [
+            this.normalizeDateTime(start),
+            this.normalizeDateTime(end),
+          ];
           // 避免反复触发 watch 造成抖动
           // 避免反复触发 watch 造成抖动
           if (
           if (
             !Array.isArray(this.datetimerange) ||
             !Array.isArray(this.datetimerange) ||
@@ -418,6 +421,18 @@ export default {
         code: "work_hour",
         code: "work_hour",
       }).then((res) => {
       }).then((res) => {
         this.isReportTime = res.value == "1" ? true : false;
         this.isReportTime = res.value == "1" ? true : false;
+
+        if (this.isReportTime) {
+          // 第二个时间不能为空,否则组件会显示 NAN-NAN-NAN,先用开始时间占位
+          const start = this.item.feedLastTime || "";
+          if (start) {
+            this.datetimerange = [start, start];
+            // 赋值后计算两个时间段的时间差并写入工时
+            this.applyDateTimeRange(this.datetimerange);
+          } else {
+            this.datetimerange = [];
+          }
+        }
       });
       });
     },
     },
     handleScan(id) {
     handleScan(id) {