From 943e43fac9e2fefabaeffb20445361d5d02cea25 Mon Sep 17 00:00:00 2001 From: 86134 <aa> Date: 星期一, 20 十一月 2023 10:24:45 +0800 Subject: [PATCH] 11 --- src/views/product/workbench/operation-task-pane.vue | 87 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 76 insertions(+), 11 deletions(-) diff --git a/src/views/product/workbench/operation-task-pane.vue b/src/views/product/workbench/operation-task-pane.vue index 2a3ffae..d559810 100644 --- a/src/views/product/workbench/operation-task-pane.vue +++ b/src/views/product/workbench/operation-task-pane.vue @@ -8,16 +8,20 @@ > </el-alert> <el-card - v-for="(item, index) in operationTasks" - @click.native="setCheckFlag(item)" - shadow="hover" - :key="index" - :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']" - > + v-for="(item, index) in operationTasks" + @click.native="setCheckFlag(item)" + shadow="hover" + :key="index" + :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']" + +> <img class="selectedImg" src="/img/workbench/icon_selected.png" /> <div class="header"> <div>宸ュ崟鍙凤細{{ item.taskNo }}</div> - <div>璁″垝鍙凤細{{ item.mpsNo }}</div> + <div class="tag" :style="{ backgroundColor: getTagColor(item.planFinishDay) }"> + {{ getTagText(item.planFinishDay) }} + </div> + <!-- <div>璁″垝鍙凤細{{ item.mpsNo }}</div> --> <div :class="[ 'status-change-div', @@ -52,10 +56,10 @@ <div class="l">闆朵欢鍙凤細</div> <div class="r">{{ item.partNo }}</div> </div> - <div class="row"> + <!-- <div class="row"> <div class="l">鎴愬搧锛�</div> <div class="r">{{ item.productName }}</div> - </div> + </div> --> <div class="row"> <div class="l">璁″垝瀹屾垚鏃堕棿锛�</div> <div class="r">{{ item.planFinishDay }}</div> @@ -91,6 +95,19 @@ flex-direction: column; align-items: center; } + +.tag{ +width: 80px; +height: 30px; +border-radius:15% ; +text-align: center; +text-size:8px; +color:white; +align-content: 30px; + +} + + .task-item { width: 100%; border-radius: 12px; @@ -250,7 +267,7 @@ </style> <script> import { - getOperationTask, + getOperationTaskCopy, changeBackState, changeOperationTaskState, getDraftProductOut, @@ -344,6 +361,54 @@ } }, methods: { + +// getBackgroundColor(planFinishDay) { +// const today = new Date(); +// const planDate = new Date(planFinishDay); +// if (planDate < today) { +// return 'rgba( 255,0,0,1)'; // 瓒呮湡涓虹孩鑹� +// } else { +// const timeDiff = planDate.getTime() - today.getTime(); +// const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); +// if (daysDiff <= 3) { +// return 'rgba(255,204,62, 1)'; // 涓存湡涓洪粍鑹� +// } else { +// return 'rgba(86,219, 25,1)'; // 姝e父涓虹豢鑹� +// } +// } +// }, + +getTagColor(planFinishDay) { + const today = new Date(); + const planDate = new Date(planFinishDay); + if (planDate < today) { + return 'rgba( 255,0,0,1)'; // 瓒呮湡涓虹孩鑹� + } else { + const timeDiff = planDate.getTime() - today.getTime(); + const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); + if (daysDiff <= 3) { + return 'rgba(255,204,62, 1)'; // 涓存湡涓洪粍鑹� + } else { + return 'rgba(86,219, 25,1)'; // 姝e父涓虹豢鑹� + } + } +}, + +getTagText(planFinishDay) { + const today = new Date(); + const planDate = new Date(planFinishDay); + if (planDate < today) { + return '瓒呮湡'; + } else { + const timeDiff = planDate.getTime() - today.getTime(); + const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); + if (daysDiff <= 3) { + return '涓存湡'; + } else { + return '姝e父'; + } + } +}, // 鐐瑰嚮宸ュ崟锛岄�変腑宸ュ崟 setCheckFlag(item) { if (item.checkFlag) { @@ -579,7 +644,7 @@ if (this.mpsNo && this.mpsNo != null) { query.mpsNo = this.mpsNo } - getOperationTask(query) + getOperationTaskCopy(query) .then((response) => { var data = response.data if (data.code === 0) { -- Gitblit v1.9.3