From 67da82f0b0c24df5f19bbfcfec63801d9ae902d8 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期三, 13 十二月 2023 16:22:05 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/product/workbench/operation-task-pane.vue | 107 +++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 87 insertions(+), 20 deletions(-) diff --git a/src/views/product/workbench/operation-task-pane.vue b/src/views/product/workbench/operation-task-pane.vue index 2a3ffae..4c9c558 100644 --- a/src/views/product/workbench/operation-task-pane.vue +++ b/src/views/product/workbench/operation-task-pane.vue @@ -8,16 +8,25 @@ > </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> + <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="[ 'status-change-div', @@ -52,10 +61,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 +100,19 @@ flex-direction: column; align-items: center; } + +.tag{ +width: 80px; +height: 30px; +line-height: 30px; +border-radius:15% ; +text-align: center; +font-size:8px; +color:white; +align-content: 30px; +} + + .task-item { width: 100%; border-radius: 12px; @@ -214,7 +236,7 @@ } .status-change-div { width: 20%; - max-width: 100px; + max-width: 160px; } .status-change-div >>> .el-select { width: 100%; @@ -250,7 +272,7 @@ </style> <script> import { - getOperationTask, + getOperationTaskCopy, changeBackState, changeOperationTaskState, getDraftProductOut, @@ -324,7 +346,7 @@ } }, computed: { - ...mapGetters(['permissions']) + ...mapGetters(['permissions']), }, created() { if (!this.defaultOperationId) { @@ -344,6 +366,57 @@ } }, 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)'; // 瓒呮湡涓虹孩鑹� + 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 'warning'; // 涓存湡涓洪粍鑹� + } else { + //return 'rgba(86,219, 25,1)'; // 姝e父涓虹豢鑹� + return 'success'; // 姝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) { @@ -477,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('娌℃湁鍙彁浜ょ殑鏁版嵁') @@ -516,7 +586,6 @@ .catch((error) => { console.log(error) changeSubmitState(taskId, false).then((res) => { - console.log(res) }) }) } @@ -539,7 +608,6 @@ this.batchChangeSubmit(list, i, currItem) } else { changeSubmitState(this.taskID, false).then((res) => { - console.log(res) }) // 鎵归噺鎻愪氦瀹屾垚锛屽埛鏂版姤宸ラ〉闈㈡暟鎹� this.$emit('refreshReport') @@ -549,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 + '澶勭悊澶辫触') @@ -579,7 +646,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) { @@ -652,7 +719,7 @@ break } } - console.log(this.operationTasks) + // console.log(this.operationTasks) // 鑻ュ綋鍓嶅伐鍗曞湪宸ュ崟鍒楄〃鏈鎵惧埌涓斿綋鍓嶅伐鍗曠姸鎬佷负宸插畬鎴愭垨宸插彇娑堟椂锛屽垯灏嗗綋鍓嶅伐鍗曢噸缃负绌哄苟鎶涘嚭浜嬩欢锛屽惁鍒欎笉绠� if (isResetCurrOpertionTaskFlag) { getOperationTaskById(taskId).then((res) => { -- Gitblit v1.9.3