From 63edbcb5f7e9b413f38e2e4e7f3ce43aa80013b7 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 27 四月 2026 14:27:00 +0800
Subject: [PATCH] 新增工作订单管理界面行样式和报告时长字段,优化表格显示
---
src/views/productionManagement/workOrderManagement/index.vue | 42 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 6ae3e53..2adaa22 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -24,6 +24,7 @@
:tableData="tableData"
:page="page"
:tableLoading="tableLoading"
+ :row-class-name="tableRowClassName"
@pagination="pagination">
<template #completionStatus="{ row }">
<el-progress :percentage="toProgressPercentage(row?.completionStatus)"
@@ -32,6 +33,9 @@
</template>
<template #todayReportState="{ row }">
{{ formatTodayReportState(row?.todayReportState) }}
+ </template>
+ <template #totalReportDurationMinutes="{ row }">
+ {{ formatDurationHours(row?.totalReportDurationMinutes) }}
</template>
</PIMTable>
</div>
@@ -253,6 +257,13 @@
width: "140",
},
{
+ label: "绯荤粺鏍哥畻鏃堕棿(灏忔椂)",
+ prop: "totalReportDurationMinutes",
+ dataType: "slot",
+ slot: "totalReportDurationMinutes",
+ width: "160",
+ },
+ {
label: "璁″垝寮�濮嬫椂闂�",
prop: "planStartTime",
width: "140",
@@ -449,6 +460,18 @@
if (state === 2) return "宸插紑濮�";
if (state === 3) return "宸茬粨鏉�";
return "-";
+ };
+ const formatDurationHours = val => {
+ const minutes = Number(val);
+ if (!Number.isFinite(minutes) || minutes < 0) return "-";
+ return (minutes / 60).toFixed(2);
+ };
+ const tableRowClassName = ({ row }) => {
+ const state = Number(row?.todayReportState);
+ if (state === 1) return "today-report-not-started";
+ if (state === 2) return "today-report-started";
+ if (state === 3) return "today-report-ended";
+ return "";
};
// 鏌ヨ鍒楄〃
@@ -666,14 +689,13 @@
addProductMain(params)
.then(res => {
- proxy.$modal.msgSuccess("鎶ュ伐鎴愬姛");
+ proxy.$modal.msgSuccess(
+ currentReportState.value === 1 ? "寮�濮嬫姤宸ユ垚鍔�" : "缁撴潫鎶ュ伐鎴愬姛"
+ );
reportDialogVisible.value = false;
getList();
})
.catch(() => {
- ElMessageBox.alert("鎶ュ伐澶辫触", "鎻愮ず", {
- confirmButtonText: "纭畾",
- });
});
});
};
@@ -753,6 +775,18 @@
text-align: center;
margin-top: 20px;
}
+
+ :deep(.el-table .today-report-not-started > td) {
+ background-color: #fff7e6 !important;
+ }
+
+ :deep(.el-table .today-report-started > td) {
+ background-color: #ecf5ff !important;
+ }
+
+ :deep(.el-table .today-report-ended > td) {
+ background-color: #f0f9eb !important;
+ }
</style>
<style lang="scss">
--
Gitblit v1.9.3