refactor(crm/contract): 简化产品内容组件并优化合同打印样式

This commit is contained in:
2026-06-02 15:40:47 +08:00
parent ef04d73e0c
commit fe24426f59
2 changed files with 14 additions and 34 deletions

View File

@@ -367,12 +367,13 @@ export default {
<td colspan="4" style="border:1px solid #000;padding:3px 6px;font-weight:bold;text-align:left;">产品名称:${productData.productName || ''}</td>
<td colspan="${colCount - 4 > 0 ? colCount - 4 : 1}" style="border:1px solid #000;padding:3px 6px;font-weight:bold;text-align:left;">生产厂家:嘉祥科伦普重工有限公司</td>
</tr>
<tr style="background-color:#f5f5f5;">${headerCells}</tr>
<tr>${headerCells}</tr>
${bodyRows}
<tr>${totalCells}</tr>
<tr>
<td colspan="${colCount}" style="border:1px solid #000;padding:4px 6px;font-weight:bold;text-align:left;">合计人民币(大写):${totalAmountInWords}</td>
</tr>
${productData.remark ? `<tr><td colspan="${colCount}" style="border:1px solid #000;padding:4px 6px;text-align:left;">备注:${productData.remark}</td></tr>` : ''}
</table>`;
return html;
},
@@ -429,7 +430,7 @@ export default {
.section-title { font-size: 13px; font-weight: bold; margin-bottom: 4px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #000; padding: 3px 4px; text-align: center; font-size: 11px; }
th { background-color: #f5f5f5; font-weight: bold; }
th { font-weight: bold; }
.sign-section { margin-top: 24px; font-size: 12px; line-height: 2.2; }
.sign-section .col { width: 48%; }
.sign-row { display: flex; justify-content: space-between; }
@@ -437,13 +438,13 @@ export default {
</head>
<body>
<div class="a4-page" style="position:relative;">
<img src="${contractLogo}" style="position:absolute;left:20px;top:20px;height:80px;" crossorigin="anonymous" />
<img src="${contractLogo}" style="position:absolute;left:40px;top:40px;height:80px;" crossorigin="anonymous" />
<div style="text-align:center;padding-top:10px;">
<div style="font-size:20px;font-weight:bold;letter-spacing:2px;">嘉祥科伦普重工有限公司</div>
</div>
<div style="display:flex;justify-content:center;align-items:baseline;margin:12px 0 8px 0;">
<div style="position:relative;margin:12px 0 8px 0;text-align:center;">
<div style="font-size:22px;font-weight:bold;letter-spacing:6px;">产 品 销 售 合 同</div>
<div style="font-size:11px;margin-left:40px;">合同编号:${row.contractCode || ''}</div>
<div style="position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:11px;">合同编号:${row.contractCode || ''}</div>
</div>
<div class="info-row">
<div style="width:55%;">
@@ -543,9 +544,9 @@ export default {
<div style="text-align:center;padding-top:10px;">
<div style="font-size:20px;font-weight:bold;letter-spacing:2px;">嘉祥科伦普重工有限公司</div>
</div>
<div style="display:flex;justify-content:center;align-items:baseline;margin:12px 0 8px 0;">
<div style="position:relative;margin:12px 0 8px 0;text-align:center;">
<div style="font-size:22px;font-weight:bold;letter-spacing:6px;">产 品 销 售 合 同</div>
<div style="font-size:11px;margin-left:40px;">合同编号:${row.contractCode || ''}</div>
<div style="position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:11px;">合同编号:${row.contractCode || ''}</div>
</div>
<div style="display:flex;justify-content:space-between;margin-bottom:8px;font-size:13px;line-height:2;">
<div style="width:55%;">

View File

@@ -63,23 +63,21 @@
</div>
<div class="table-cell">
<el-input v-model.number="item.taxDivisor" placeholder="税率除数" type="number" :readonly="readonly"
size="small" @change="onTaxDivisorChange(item)" />
size="small" />
</div>
<div class="table-cell">
<el-input v-model.number="item.noTaxPrice" placeholder="无税单价" type="number" :readonly="readonly"
size="small" @change="onNoTaxPriceChange(item)" />
size="small" />
</div>
<div class="table-cell">
<el-input v-model.number="item.taxTotal" placeholder="含税总额" type="number" :readonly="readonly" size="small"
@change="onTaxTotalChange(item)" />
<el-input v-model.number="item.taxTotal" placeholder="含税总额" type="number" :readonly="readonly" size="small" />
</div>
<div class="table-cell">
<el-input v-model.number="item.noTaxTotal" placeholder="无税总额" type="number" :readonly="readonly"
size="small" @change="onNoTaxTotalChange(item)" />
size="small" />
</div>
<div class="table-cell">
<el-input v-model.number="item.taxAmount" placeholder="税额" type="number" :readonly="readonly" size="small"
@change="onTaxAmountChange(item)" />
<el-input v-model.number="item.taxAmount" placeholder="税额" type="number" :readonly="readonly" size="small" />
</div>
<div class="table-cell">
<el-input v-model="item.remark" placeholder="请输入备注" :readonly="readonly" size="small" />
@@ -260,26 +258,7 @@ export default {
onTaxPriceChange(item) {
Object.assign(item, calculateProductFields(item, 'taxPrice'));
},
// 税率除数变更
onTaxDivisorChange(item) {
Object.assign(item, calculateProductFields(item, 'taxDivisor'));
},
// 无税单价变更
onNoTaxPriceChange(item) {
Object.assign(item, calculateProductFields(item, 'noTaxPrice'));
},
// 含税总额变更
onTaxTotalChange(item) {
Object.assign(item, calculateProductFields(item, 'taxTotal'));
},
// 无税总额变更
onNoTaxTotalChange(item) {
Object.assign(item, calculateProductFields(item, 'noTaxTotal'));
},
// 税额变更
onTaxAmountChange(item) {
Object.assign(item, calculateProductFields(item, 'taxAmount'));
},
// 计算金额
calculateTotals() {
this.products.forEach(item => {