王震
2023-11-20 6098f630d190c3ba51a3749716ccc8ada2b450c8
src/views/product/workbench/operation-task-pane.vue
@@ -18,9 +18,17 @@
      <img class="selectedImg" src="/img/workbench/icon_selected.png" />
      <div class="header">
        <div>工单号:{{ item.taskNo }}</div>
        <div class="tag" :style="{ backgroundColor: getTagColor(item.planFinishDay) }">
        <!-- <div class="tag" :style="{ backgroundColor: getTagColor(item.planFinishDay) }">
    {{ getTagText(item.planFinishDay) }}
        </div>
        </div> -->
        <el-alert
          center
          style="width: 80px;height:30px;line-height: 30px;"
          :title="getTagText(item.planFinishDay)"
          :type="getTagColor(item.planFinishDay)"
          effect="dark"
          :closable="false">
        </el-alert>
        <!-- <div>计划号:{{ item.mpsNo }}</div> -->
        <div
          :class="[
@@ -99,12 +107,12 @@
.tag{
width: 80px;
height: 30px;
line-height: 30px;
border-radius:15% ;
text-align: center;
text-size:8px;
font-size:8px;
color:white;
align-content: 30px;
}
@@ -341,7 +349,7 @@
    }
  },
  computed: {
    ...mapGetters(['permissions'])
    ...mapGetters(['permissions']),
  },
  created() {
    if (!this.defaultOperationId) {
@@ -382,14 +390,17 @@
  const today = new Date();
  const planDate = new Date(planFinishDay);
  if (planDate < today) {
    return 'rgba( 255,0,0,1)'; // 超期为红色
    //return 'rgba( 255,0,0,1)'; // 超期为红色
    return 'error'; // 超期为红色
  } else {
    const timeDiff = planDate.getTime() - today.getTime();
    const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
    if (daysDiff <= 3) {
      return 'rgba(255,204,62, 1)';  // 临期为黄色
      //return 'rgba(255,204,62, 1)';  // 临期为黄色
      return 'warning';  // 临期为黄色
    } else {
      return 'rgba(86,219, 25,1)';  // 正常为绿色
      //return 'rgba(86,219, 25,1)';  // 正常为绿色
      return 'success';  // 正常为绿色
    }
  }
},