From ab89c48fc0ebdbf12e2269431d9701edd10209b1 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 09 五月 2026 17:08:47 +0800
Subject: [PATCH] fix: 优化入库审批状态展示
---
src/views/inventoryManagement/dispatchLog/Record.vue | 11 ++++++++++-
src/views/inventoryManagement/receiptManagement/Record.vue | 11 ++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 88fc8d2..f41eaaa 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -96,7 +96,9 @@
</el-table-column>
<el-table-column label="瀹℃壒鐘舵��" prop="approvalStatus" show-overflow-tooltip>
<template #default="scope">
- {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+ <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" size="small">
+ {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+ </el-tag>
</template>
</el-table-column>
</el-table>
@@ -216,6 +218,13 @@
return approvalStatusLabelMap[status] || "寰呭鎵�";
};
+// 閫氳繃/椹冲洖鍥哄畾鑹诧紱鍏朵綑锛堝惈寰呭鎵广�佺┖鍊笺�佹湭鏄犲皠浣嗘枃妗堜负寰呭鎵癸級缁熶竴鐢� warning 棰勮鑹�
+const getApprovalStatusTagType = (status) => {
+ if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success";
+ if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger";
+ return "warning";
+};
+
// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
const fetchStockRecordTypeOptions = () => {
if (props.type === '0') {
diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index 75d884a..c9cb6ee 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -91,7 +91,9 @@
prop="approvalStatus"
show-overflow-tooltip>
<template #default="scope">
- {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+ <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" size="small">
+ {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+ </el-tag>
</template>
</el-table-column>
</el-table>
@@ -187,6 +189,13 @@
return approvalStatusLabelMap[status] || "寰呭鎵�";
};
+// 閫氳繃/椹冲洖鍥哄畾鑹诧紱鍏朵綑锛堝惈寰呭鎵广�佺┖鍊笺�佹湭鏄犲皠浣嗘枃妗堜负寰呭鎵癸級缁熶竴鐢� warning 棰勮鑹�
+const getApprovalStatusTagType = (status) => {
+ if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success";
+ if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger";
+ return "warning";
+};
+
const pageProductChange = obj => {
page.current = obj.page;
page.size = obj.limit;
--
Gitblit v1.9.3