王震
2023-12-13 67da82f0b0c24df5f19bbfcfec63801d9ae902d8
src/views/product/workbench/operation-task-pane.vue
@@ -18,9 +18,14 @@
      <img class="selectedImg" src="/img/workbench/icon_selected.png" />
      <div class="header">
        <div>工单号:{{ item.taskNo }}</div>
        <div class="tag" :style="{ backgroundColor: getTagColor(item.planFinishDay) }">
    {{ getTagText(item.planFinishDay) }}
        </div>
        <el-alert
          center
          style="width: 80px;height:28px;line-height: 100%;font-size:10px"
          :title="getTagText(item.planFinishDay)"
          :type="getTagColor(item.planFinishDay)"
          effect="dark"
          :closable="false">
        </el-alert>
        <!-- <div>计划号:{{ item.mpsNo }}</div> -->
        <div
          :class="[
@@ -99,12 +104,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;
}
@@ -231,7 +236,7 @@
}
.status-change-div {
  width: 20%;
  max-width: 100px;
  max-width: 160px;
}
.status-change-div >>> .el-select {
  width: 100%;
@@ -341,7 +346,7 @@
    }
  },
  computed: {
    ...mapGetters(['permissions'])
    ...mapGetters(['permissions']),
  },
  created() {
    if (!this.defaultOperationId) {
@@ -382,14 +387,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';  // 正常为绿色
    }
  }
},
@@ -542,16 +550,13 @@
          .then((res) => {
            if (!res.data.data) {
              changeSubmitState(taskId, true).then((res) => {
                console.log(res)
              })
              getDraftProductOut(taskId).then((response) => {
                console.log(response)
                const list = response.data.data || []
                if (list.length > 0) {
                  this.batchChangeSubmit(list, 0, currItem)
                } else {
                  changeSubmitState(taskId, false).then((res) => {
                    console.log(res)
                  })
                  currItem.statusAction = null
                  this.$message.warning('没有可提交的数据')
@@ -581,7 +586,6 @@
          .catch((error) => {
            console.log(error)
            changeSubmitState(taskId, false).then((res) => {
              console.log(res)
            })
          })
      }
@@ -604,7 +608,6 @@
            this.batchChangeSubmit(list, i, currItem)
          } else {
            changeSubmitState(this.taskID, false).then((res) => {
              console.log(res)
            })
            // 批量提交完成,刷新报工页面数据
            this.$emit('refreshReport')
@@ -614,7 +617,6 @@
          console.log(error)
          loading.close()
          changeSubmitState(this.taskID, false).then((res) => {
            console.log(res)
          })
          const errorMsg = '报工单号' + list[i].productNo + ':'
          this.$message.error(errorMsg + '处理失败')
@@ -717,7 +719,7 @@
                      break
                    }
                  }
                  console.log(this.operationTasks)
                  // console.log(this.operationTasks)
                  // 若当前工单在工单列表未被找到且当前工单状态为已完成或已取消时,则将当前工单重置为空并抛出事件,否则不管
                  if (isResetCurrOpertionTaskFlag) {
                    getOperationTaskById(taskId).then((res) => {