From 4abdd48526e098acbb351addfaf5c86022e4009a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期五, 09 十月 2026 21:34:57 +0800
Subject: [PATCH] fix: 优化发货状态和类型的判断逻辑
---
src/views/salesManagement/salesLedger/index.vue | 57 +++++++++++++++++++++++++++------------------------------
1 files changed, 27 insertions(+), 30 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 30b7ef3..4dc6b3d 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -2568,30 +2568,30 @@
* @param row 琛屾暟鎹�
*/
const getShippingStatusText = row => {
- // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屾樉绀�"宸插彂璐�"
- if (row.shippingDate || row.shippingCarNumber) {
- return "宸插彂璐�";
- }
-
- // 鑾峰彇鍙戣揣鐘舵�佸瓧娈�
+ // 浠ユ帴鍙h繑鍥炵殑 shippingStatus 涓哄噯锛堝悗绔寜銆岀鍗曞噣閲嶅悎璁� vs 璁㈠崟鏁伴噺銆嶇畻鍑�
+ // 鏈彂璐� / 閮ㄥ垎鍙戣揣 / 宸插彂璐э級锛屼笉瑕佸啀鐩存帴鐢ㄣ�屾湁娌℃湁鍙戣揣鏃ユ湡銆嶈鐩栧畠锛�
+ // 鍚﹀垯閮ㄥ垎鍙戣揣浼氳璇樉绀烘垚宸插彂璐с��
const status = row.shippingStatus;
-
- // 濡傛灉鐘舵�佷负绌烘垨鏈畾涔夛紝榛樿涓�"寰呭彂璐�"
- if (status === null || status === undefined || status === "") {
- return "寰呭彂璐�";
- }
-
- // 鐘舵�佹槸瀛楃涓�
- const statusStr = String(status).trim();
+ const statusStr = status === null || status === undefined ? "" : String(status).trim();
const statusTextMap = {
+ 鏈彂璐�: "寰呭彂璐�",
寰呭彂璐�: "寰呭彂璐�",
+ 閮ㄥ垎鍙戣揣: "閮ㄥ垎鍙戣揣",
寰呭鏍�: "寰呭鏍�",
瀹℃牳涓�: "瀹℃牳涓�",
瀹℃牳鎷掔粷: "瀹℃牳鎷掔粷",
瀹℃牳閫氳繃: "瀹℃牳閫氳繃",
宸插彂璐�: "宸插彂璐�",
};
- return statusTextMap[statusStr] || "寰呭彂璐�";
+ if (statusTextMap[statusStr]) {
+ return statusTextMap[statusStr];
+ }
+
+ // 鍚庣娌$粰鍑虹姸鎬佹椂锛岄��鍥炴寜銆屾湁娌℃湁鍙戣揣淇℃伅銆嶅垽鏂�
+ if (row.shippingDate || row.shippingCarNumber) {
+ return "宸插彂璐�";
+ }
+ return "寰呭彂璐�";
};
/**
@@ -2599,30 +2599,27 @@
* @param row 琛屾暟鎹�
*/
const getShippingStatusType = row => {
- // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屾樉绀虹豢鑹�
- if (row.shippingDate || row.shippingCarNumber) {
- return "success";
- }
-
- // 鑾峰彇鍙戣揣鐘舵�佸瓧娈�
+ // 涓� getShippingStatusText 淇濇寔鍚屼竴鍙e緞锛屼互 shippingStatus 涓哄噯
const status = row.shippingStatus;
-
- // 濡傛灉鐘舵�佷负绌烘垨鏈畾涔夛紝榛樿涓虹伆鑹诧紙寰呭彂璐э級
- if (status === null || status === undefined || status === "") {
- return "info";
- }
-
- // 鐘舵�佹槸瀛楃涓�
- const statusStr = String(status).trim();
+ const statusStr = status === null || status === undefined ? "" : String(status).trim();
const typeTextMap = {
+ 鏈彂璐�: "info",
寰呭彂璐�: "info",
+ 閮ㄥ垎鍙戣揣: "warning",
寰呭鏍�: "info",
瀹℃牳涓�: "warning",
瀹℃牳鎷掔粷: "danger",
瀹℃牳閫氳繃: "success",
宸插彂璐�: "success",
};
- return typeTextMap[statusStr] || "info";
+ if (typeTextMap[statusStr]) {
+ return typeTextMap[statusStr];
+ }
+
+ if (row.shippingDate || row.shippingCarNumber) {
+ return "success";
+ }
+ return "info";
};
/**
--
Gitblit v1.9.3