From 5b1500969cdf102a6db9e3f56faec5aa67f68496 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 12 五月 2026 04:32:03 +0800
Subject: [PATCH] fix: 设备移除工序必选
---
src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue b/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
index 3c5df33..c735cf6 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
@@ -47,6 +47,15 @@
import { customerRevenueAnalysis } from '@/api/viewIndex.js'
import { listCustomer } from '@/api/basicData/customerFile.js'
+/** 瀹㈡埛钀ユ敹鍒嗘瀽涓嬫媺榛樿閫変腑璇ュ鎴凤紙涓嶅瓨鍦ㄥ垯閫�鍥炲垪琛ㄧ涓�椤癸級 */
+const DEFAULT_REVENUE_CUSTOMER_NAME = '閼工闂ㄧ獥'
+
+const pickDefaultCustomerValue = (options) => {
+ if (!options?.length) return null
+ const matched = options.find((o) => o.label === DEFAULT_REVENUE_CUSTOMER_NAME)
+ return matched ? matched.value : options[0].value
+}
+
const dateType = ref(1) // 1=鍛� 2=鏈� 3=瀛e害
const customerValue = ref(null)
const customerOptions = ref([])
@@ -133,8 +142,7 @@
// 鑾峰彇瀹㈡埛钀ユ敹鍒嗘瀽鏁版嵁
const getCustomerRevenueAnalysis = () => {
if (customerOptions.value.length > 0 && !customerValue.value) {
- // 榛樿閫変腑绗竴涓鎴�
- customerValue.value = customerOptions.value[0].value
+ customerValue.value = pickDefaultCustomerValue(customerOptions.value)
}
if (!customerValue.value) return
@@ -171,9 +179,9 @@
value: r.id ?? r.customerId ?? r.customerCode ?? r.customerName,
}))
- // 鑾峰彇鍒伴�夐」鍚庯紝濡傛灉杩樻病閫変腑锛岄粯璁ら�変腑绗竴涓�
+ // 鑾峰彇鍒伴�夐」鍚庯紝濡傛灉杩樻病閫変腑锛岄粯璁ゃ�岄懌楣ら棬绐椼�嶏紙鏃犲垯绗竴椤癸級
if (customerOptions.value.length > 0 && !customerValue.value) {
- customerValue.value = customerOptions.value[0].value
+ customerValue.value = pickDefaultCustomerValue(customerOptions.value)
getCustomerRevenueAnalysis()
}
} catch (e) {
--
Gitblit v1.9.3