|
@@ -181,35 +181,6 @@ const queryParams = ref<SiteQuery & { startTimeRange?: string[]; endTimeRange?:
|
|
|
params: {}
|
|
params: {}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-/** 通过客户接口回显列表中的客户编号和名称 */
|
|
|
|
|
-const enrichListWithCustomerInfo = async () => {
|
|
|
|
|
- const uniqueClientIds = [...new Set(siteList.value.map((item) => item.clientId).filter(Boolean))];
|
|
|
|
|
- if (uniqueClientIds.length === 0) return;
|
|
|
|
|
- const customerMap = new Map<string, any>();
|
|
|
|
|
- await Promise.all(
|
|
|
|
|
- uniqueClientIds.map(async (clientId) => {
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await getCustomerInfo(clientId as string | number);
|
|
|
|
|
- if (res.data) {
|
|
|
|
|
- customerMap.set(String(clientId), res.data);
|
|
|
|
|
- }
|
|
|
|
|
- } catch {}
|
|
|
|
|
- })
|
|
|
|
|
- );
|
|
|
|
|
- siteList.value = siteList.value.map((item) => {
|
|
|
|
|
- const customer = customerMap.get(String(item.clientId));
|
|
|
|
|
- if (customer) {
|
|
|
|
|
- return {
|
|
|
|
|
- ...item,
|
|
|
|
|
- clientNo: customer.customerNo || item.clientNo,
|
|
|
|
|
- clientName: customer.customerName || item.clientName,
|
|
|
|
|
- platformCode: 4
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- return item;
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
/** 查询客户站点配置列表 */
|
|
/** 查询客户站点配置列表 */
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -236,7 +207,6 @@ const getList = async () => {
|
|
|
const res = await listSite(params);
|
|
const res = await listSite(params);
|
|
|
siteList.value = res.rows;
|
|
siteList.value = res.rows;
|
|
|
total.value = res.total;
|
|
total.value = res.total;
|
|
|
- await enrichListWithCustomerInfo();
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取站点列表失败:', error);
|
|
console.error('获取站点列表失败:', error);
|
|
|
} finally {
|
|
} finally {
|
|
@@ -307,7 +277,7 @@ const handleCategoryManage = (row: any) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
path: '/customerOperation/customer-category',
|
|
path: '/customerOperation/customer-category',
|
|
|
query: {
|
|
query: {
|
|
|
- platform: row.platformCode,
|
|
|
|
|
|
|
+ platform: 4,
|
|
|
customerId: String(row.clientId)
|
|
customerId: String(row.clientId)
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|