From ddea16dd62aec74f58d71ecd18c14124c36f19f4 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 15:18:34 +0800
Subject: [PATCH] 补交
---
north-glass-erp/northglass-erp/src/components/BasicTable.vue | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/BasicTable.vue b/north-glass-erp/northglass-erp/src/components/BasicTable.vue
index 6c1bb45..0a6ac2a 100644
--- a/north-glass-erp/northglass-erp/src/components/BasicTable.vue
+++ b/north-glass-erp/northglass-erp/src/components/BasicTable.vue
@@ -133,9 +133,9 @@
}
//鍚堝苟鏄剧ず鍏朵粬鍒�
-const handleDynamicColumns = (data,title) => {
+const handleDynamicColumns = (data,title,orderOtherMoney) => {
// 1. 鏀堕泦鎵�鏈夎鐨刼therColumns瀛楁锛堝幓閲嶏級
- const allOtherFields = new Set();
+ /*const allOtherFields = new Set();
data.forEach(row => {
if (!row || !row.otherColumns) return;
@@ -160,10 +160,10 @@
allOtherFields.add(key);
});
}
- });
+ });*/
// 2. 鐢熸垚鍔ㄦ�佸瓙鍒楋紙浣滀负processList鐨刢hildren锛�
- const otherColumns = Array.from(allOtherFields).map(field => {
+ /*const otherColumns = Array.from(allOtherFields).map(field => {
// 灏濊瘯鑾峰彇瀛楁瀵瑰簲鐨刲abel锛堜紭鍏堝彇绗竴涓嚭鐜扮殑label锛�
let label=field;
title.forEach(item=>{
@@ -182,7 +182,26 @@
}
};
- });
+ });*/
+
+ const otherColumns = [];
+ // 瀹归敊锛氱‘淇漮rderOtherMoney鏄湁鏁堟暟缁�
+ if (Array.isArray(orderOtherMoney) && orderOtherMoney.length > 0) {
+ orderOtherMoney.forEach(item => {
+ // 璺宠繃绌烘暟鎹紝閬垮厤鏃犳晥鍒�
+ if (!item || !item.column) return;
+ otherColumns.push({
+ title: item.alias || item.column, // 浼樺厛鐢ㄥ埆鍚嶏紝鏃犲垯鐢ㄥ瓧娈靛悕
+ field: `otherColumnsJson.${item.column}`,
+ width: 120,
+ align: 'center',
+ // 鏍煎紡鍖栧彇鍊硷細鍏煎瑙f瀽鍚庣殑JSON缁撴瀯
+ formatter: ({ row }) => {
+ return row.otherColumnsJson?.[item.column] || '';
+ }
+ });
+ });
+ }
// 3. 瀹氫箟鐖剁骇鍒梡rocessList锛屽寘鍚姩鎬佸瓙鍒�
const processList = {
@@ -251,7 +270,8 @@
//璁㈠崟鏄庣粏鎶ヨ〃
if (isFirstLoad.value && props.childrenData.url === '/order/getOrderReport') {
const dataList = res.data.data || [];
- handleDynamicColumns(dataList,res.data.title)
+ const orderOtherMoney = res.data.orderOtherMoney[0] || [];
+ handleDynamicColumns(dataList,res.data.title,orderOtherMoney)
isFirstLoad.value = false; // 棣栨鍔犺浇鍚庣疆涓篺alse
}
}
--
Gitblit v1.8.0