695593266@qq.com 1 månad sedan
förälder
incheckning
00b2bf6bbd
1 ändrade filer med 36 tillägg och 0 borttagningar
  1. 36 0
      src/views/productionPlan/index.vue

+ 36 - 0
src/views/productionPlan/index.vue

@@ -204,6 +204,7 @@
         @sort-change="onSortChange"
         autoAmendPage
         :parse-data="parseData"
+        :row-class-name="rowClassName"
         @update:selection="handleSelectionChange"
         @columns-change="handleColumnChange"
         height="calc(100vh - 390px)"
@@ -1385,6 +1386,27 @@
         }
       },
 
+      rowClassName({ row }) {
+        if (this.activeName !== 'second' || !row || !row.endTime) {
+          return '';
+        }
+        if (row.taskName === '完结') {
+          return '';
+        }
+        const endTime = new Date(String(row.endTime).replace(/-/g, '/')).getTime();
+        if (isNaN(endTime)) {
+          return '';
+        }
+        const now = Date.now();
+        if (now > endTime) {
+          return 'row-overdue';
+        }
+        if (now > endTime - 3 * 24 * 60 * 60 * 1000) {
+          return 'row-near-due';
+        }
+        return '';
+      },
+
       planDotLine(row) {
         if (!row.bomCategoryId) {
           return this.$message.warning('该计划没有定义BOM,请先添加BOM!');
@@ -1624,4 +1646,18 @@
   ::v-deep .el-card__body {
     padding: 17px 12px !important;
   }
+  ::v-deep .el-table .row-near-due td.el-table__cell {
+    background-color: #fdebd0 !important;
+    color: #e67e22 !important;
+  }
+  ::v-deep .el-table .row-near-due:hover > td.el-table__cell {
+    background-color: #fcdcb0 !important;
+  }
+  ::v-deep .el-table .row-overdue td.el-table__cell {
+    background-color: #fde2e2 !important;
+    color: #f56c6c !important;
+  }
+  ::v-deep .el-table .row-overdue:hover > td.el-table__cell {
+    background-color: #fbcccc !important;
+  }
 </style>