From 96d60dcd18b3d8c304afb8131fcbe547c0e74554 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 24 十二月 2025 16:25:10 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/northglass-erp/src/components/BasicTable.vue | 37 ++++++++++++++++++++++++++++++-------
1 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/BasicTable.vue b/north-glass-erp/northglass-erp/src/components/BasicTable.vue
index 9bd61fa..0a6ac2a 100644
--- a/north-glass-erp/northglass-erp/src/components/BasicTable.vue
+++ b/north-glass-erp/northglass-erp/src/components/BasicTable.vue
@@ -122,6 +122,8 @@
pageTotal : 0,//鎬婚〉鏁�
dataTotal : 0,//鏁版嵁鎬绘潯鏁�
})
+
+const isFirstLoad = ref(true);
const sumNum = (list, field) => {
let count = 0
list.forEach(item => {
@@ -131,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;
@@ -158,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=>{
@@ -180,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 = {
@@ -247,9 +268,11 @@
orderInfo.reportFormDate = res.data.selectDate
//璁㈠崟鏄庣粏鎶ヨ〃
- if (props.childrenData.url === '/order/getOrderReport') {
+ 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