From cd3cc85c0a9b0d7ad990c0174e9a1fbb8d4ffd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Sat, 6 Jun 2026 17:15:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=88=E5=90=8C=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=87=BA=E8=A1=8C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=88=E5=90=88=E8=AE=A1=E8=A1=8C/?= =?UTF-8?q?=E5=A4=A7=E5=86=99=E9=87=91=E9=A2=9D=E8=A1=8C/=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E8=A1=8C=E5=8F=AF=E9=80=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 rowConfigs 配置,支持控制合计行、大写金额行、备注行显隐 - 新增全选/半选逻辑,与列配置交互风格一致 - 导出 HTML 模板根据行配置动态渲染 --- .../components/ContractExportDialog.vue | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue b/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue index adec1916..a73eb244 100644 --- a/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue +++ b/klp-ui/src/views/crm/contract/components/ContractExportDialog.vue @@ -10,7 +10,12 @@ {{ col.label }} -
勾选的列将显示在导出的产品表中
+
附加行配置
+ 全选 +
+ {{ rowCfg.label }} +
@@ -63,6 +68,13 @@ export default { { key: 'taxAmount', label: '税额(元)', checked: true }, { key: 'remark', label: '备注', checked: true }, ], + selectAllRows: true, + rowIndeterminate: false, + rowConfigs: [ + { key: 'totalRow', label: '合计行', checked: true }, + { key: 'amountWordsRow', label: '大写金额行', checked: true }, + { key: 'remarkRow', label: '备注行', checked: true }, + ], }; }, computed: { @@ -90,9 +102,22 @@ export default { this.columnIndeterminate = checkedCount > 0 && checkedCount < this.columnConfigs.length; this.generatePreviewHtml(); }, + handleSelectAllRows(val) { + this.rowConfigs.forEach(row => { row.checked = val; }); + this.rowIndeterminate = false; + this.generatePreviewHtml(); + }, + onRowChange() { + const checkedCount = this.rowConfigs.filter(r => r.checked).length; + this.selectAllRows = checkedCount === this.rowConfigs.length; + this.rowIndeterminate = checkedCount > 0 && checkedCount < this.rowConfigs.length; + this.generatePreviewHtml(); + }, buildProductTableHtml(productData, products) { const activeCols = this.columnConfigs.filter(c => c.checked); + const activeRows = this.rowConfigs.filter(r => r.checked); const hasCol = (key) => activeCols.some(c => c.key === key); + const hasRow = (key) => activeRows.some(r => r.key === key); let headerCells = '序号'; if (hasCol('spec')) headerCells += '规格(mm)'; @@ -155,11 +180,9 @@ export default { ${headerCells} ${bodyRows} - ${totalCells} - - 合计人民币(大写):${totalAmountInWords} - - ${productData.remark ? `备注:${productData.remark}` : ''} + ${hasRow('totalRow') ? `${totalCells}` : ''} + ${hasRow('amountWordsRow') ? `合计人民币(大写):${totalAmountInWords}` : ''} + ${hasRow('remarkRow') && productData.remark ? `备注:${productData.remark}` : ''} `; return html; },