From 2e79a5beb09143c3001144f3a88e5d9ac16a07f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com>
Date: Mon, 22 Jun 2026 13:06:46 +0800
Subject: [PATCH] =?UTF-8?q?feat(crm/contract):=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E8=A1=A8=E6=A0=BC=E8=A1=A8=E5=A4=B4=E5=B1=95?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8E=E5=AF=BC=E5=87=BA=E9=85=8D=E7=BD=AE=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. 将产品表格表头文本拆分为多行显示,优化视觉排版
2. 调整表格列的grid布局宽度适配新的表头样式
3. 新增产品导出列的自定义编辑与重置功能,支持自定义表头文本
4. 重构导出预览的表头生成逻辑,支持动态渲染自定义列名与适配宽度
---
.../components/ContractExportDialog.vue | 57 ++++++++++++-------
.../contract/components/ProductContent.vue | 17 +++---
2 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue b/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue
index 7e7c0371..9fa316b1 100644
--- a/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue
+++ b/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue
@@ -6,9 +6,11 @@
产品表列配置
全选
-
-
{{ col.label }}
+
+
+
+
重置表头
附加行配置
{ col.label = col.defaultLabel; });
+ this.generatePreviewHtml();
+ },
onColumnChange() {
const checkedCount = this.columnConfigs.filter(c => c.checked).length;
this.selectAllColumns = checkedCount === this.columnConfigs.length;
@@ -143,17 +149,24 @@ export default {
const hasCol = (key) => activeCols.some(c => c.key === key);
const hasRow = (key) => activeRows.some(r => r.key === key);
+ const colWidthMap = {
+ spec: 80,
+ material: 60,
+ quantity: 55,
+ taxPrice: 70,
+ taxDivisor: 45,
+ noTaxPrice: 70,
+ taxTotal: 70,
+ noTaxTotal: 70,
+ taxAmount: 55,
+ remark: 80,
+ };
+
let headerCells = '序号 | ';
- if (hasCol('spec')) headerCells += '规格(mm) | ';
- if (hasCol('material')) headerCells += '材质 | ';
- if (hasCol('quantity')) headerCells += '数量(吨) | ';
- if (hasCol('taxPrice')) headerCells += '含税单价(元/吨) | ';
- if (hasCol('taxDivisor')) headerCells += '税率除数 | ';
- if (hasCol('noTaxPrice')) headerCells += '无税单价(元/吨) | ';
- if (hasCol('taxTotal')) headerCells += '含税总额(元) | ';
- if (hasCol('noTaxTotal')) headerCells += '无税总额(元) | ';
- if (hasCol('taxAmount')) headerCells += '税额(元) | ';
- if (hasCol('remark')) headerCells += '备注 | ';
+ activeCols.forEach(col => {
+ const width = colWidthMap[col.key] || 60;
+ headerCells += `${col.label} | `;
+ });
const colCount = activeCols.length + 1;
let bodyRows = '';
diff --git a/klp-ui/src/views/crm/contract/components/ProductContent.vue b/klp-ui/src/views/crm/contract/components/ProductContent.vue
index c35fde3c..e62428e0 100644
--- a/klp-ui/src/views/crm/contract/components/ProductContent.vue
+++ b/klp-ui/src/views/crm/contract/components/ProductContent.vue
@@ -19,15 +19,15 @@
序号
-
规格(mm)
+
规格
(mm)
材质
-
数量(吨)
-
含税单价(元/吨)
+
数量
(吨)
+
含税单价
(元/吨)
税率除数
-
无税单价(元/吨)
-
含税总额(元)
-
无税总额(元)
-
税额(元)
+
无税单价
(元/吨)
+
含税总额
(元)
+
无税总额
(元)
+
税额
(元)
备注