zss
2023-12-11 c880739ec4cd5ede33b31eb98ad5f7628ea288e5
src/views/product/workbench/index.vue
@@ -528,10 +528,11 @@
              </el-form-item>
            </el-form>
          </div>
          <!--  :style="{ backgroundColor: taskStatusColor() }" -->
          <div class="task-div-content" >
    <div v-if="!isShowNormalTracking" class="task-list-div" >
      <operationTaskPane
        ref="operateTaskDiv" :style="{ backgroundColor: taskStatusColor() }"
      <operationTaskPane
        ref="operateTaskDiv"
        :workstationId="dutyForm.workstationId"
        :productSn="operateTaskForm.SN"
        :orderNumber="operateTaskForm.orderNumber"
@@ -544,7 +545,7 @@
    </div>
    <div v-if="isShowNormalTracking" class="task-list-div" >
      <operationTaskTable
        ref="operateTaskTableDiv" :style="{ backgroundColor: taskStatusColor() }"
        ref="operateTaskTableDiv"
        :workstationId="dutyForm.workstationId"
        :productSn="operateTaskForm.SN"
        :orderNumber="operateTaskForm.orderNumber"
@@ -1438,7 +1439,6 @@
  box-sizing: border-box;
  overflow-y: auto;
  margin-bottom: 10px;
}
.task-list-div {
@@ -1487,7 +1487,8 @@
.warning-info {
  margin-left: 20px;
  font-size: 16px;
  font-size: 13px;
  font-weight: bold;
  color: red;
  letter-spacing: 3px;
}
@@ -1673,8 +1674,8 @@
    }
  },
  methods: {
    changeCurrOperateTask() {},
    refreshWorkReportPageData() {},
    // changeCurrOperateTask() {},
    // refreshWorkReportPageData() {},
    refreshOperateTasksByConditions() {
      this.$nextTick(() => {
        this.refreshOperateTasks()
@@ -1710,7 +1711,6 @@
            customerOrderNo: this.operateTaskForm.orderNumber
          }).then((res) => {
            const result = res.data.data
            console.log(result)
            result.forEach(function(item) {
              const obj = {
                key: item,
@@ -1718,7 +1718,6 @@
              }
              that.partNames.push(obj)
            })
            console.log(that.partNames)
          })
        }, 500)
      } else {
@@ -2216,7 +2215,6 @@
          (e) => e.id === this.dutyForm.workstationId
        ).workCenter
      }
      console.log(this.paramObj_StationSave)
      this.visible_StationSave = true
    },
    Select_StationSave() {
@@ -2519,23 +2517,25 @@
  },
  computed: {
    ...mapGetters(['userInfo', 'tagWel', 'permissions']),
// 半个月之前是黄色 当天和三天之内就是红色 三天之后就是蓝色
// taskStatusColor() {
//     return function(date) {
//         const now = new Date();
//         const halfMonthAgo = new Date(now - 15 * 24 * 60 * 60 * 1000);
//         const threeDaysAgo = new Date(now - 3 * 24 * 60 * 60 * 1000);
//         const oneDayAgo = new Date(now - 24 * 60 * 60 * 1000);
//         const today = new Date(now);
    taskStatusColor() {
    return function() {
      const now = new Date();
      const threeDaysAgo = new Date(now - 3 * 24 * 60 * 60 * 1000);
      const oneDayAgo = new Date(now - 24 * 60 * 60 * 1000);
      const today = new Date(now);
//         if (halfMonthAgo <= date && date <= threeDaysAgo) {
//             return 'yellow';
//         } else if (today <= date && date <= threeDaysAgo) {
//             return 'red';
//         } else  {
//             return 'blue';
//         }
//     };
// }
      if (threeDaysAgo <= today && today <= oneDayAgo) {
        return 'yellow';
      } else if (today <= threeDaysAgo) {
        return 'blue';
      } else {
        return 'red';
      }
    };
  }
  },
  created() {
    document.title = '工作台——MES'