|
|
@@ -1295,6 +1295,12 @@ const generateQuoteTemplate = (quote: QuoteVO): string => {
|
|
|
return dict?.label || dictValue;
|
|
|
};
|
|
|
|
|
|
+ // 辅助函数:在每个汉字之间添加空格
|
|
|
+ const addSpaceBetweenChars = (str: string): string => {
|
|
|
+ if (!str) return '';
|
|
|
+ return str.split('').join(' ');
|
|
|
+ };
|
|
|
+
|
|
|
// 计算产品总金额
|
|
|
const productTotal =
|
|
|
quote.productList?.reduce((sum, item) => {
|
|
|
@@ -1355,14 +1361,14 @@ const generateQuoteTemplate = (quote: QuoteVO): string => {
|
|
|
<div style="flex: 1; text-align: left;">供 方: 安庆市山峡化工有限公司</div>
|
|
|
</div>
|
|
|
<div style="display: flex; justify-content: space-between;">
|
|
|
- <div style="flex: 1; text-align: left;">联系人: ${quote.contactName || ''}</div>
|
|
|
- <div style="flex: 1; text-align: left;">联系人: ${quote.ownerUserName || ''} / ${(quote as any).ownerUserMobile || ''}</div>
|
|
|
+ <div style="flex: 1; text-align: left;">联系人: ${addSpaceBetweenChars(quote.contactName || '')}</div>
|
|
|
+ <div style="flex: 1; text-align: left;">联系人: ${addSpaceBetweenChars(quote.ownerUserName || '')} / ${(quote as any).ownerUserMobile || ''}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 产品列表、备注、合计(整合为一个表格) -->
|
|
|
- <table style="width: 100%; border-collapse: collapse; margin-bottom: 20px; border: 2px solid #000;">
|
|
|
+ <table style="width: 100%; border-collapse: collapse; margin-bottom: 20px; border: 1px solid #000;">
|
|
|
<thead>
|
|
|
<tr style="background-color: #fff;">
|
|
|
<th style="padding: 8px; border: 1px solid #000; text-align: center; width: 5%; font-weight: normal;">序号</th>
|
|
|
@@ -1388,7 +1394,7 @@ const generateQuoteTemplate = (quote: QuoteVO): string => {
|
|
|
<!-- 合计行 -->
|
|
|
<tr>
|
|
|
<td colspan="2" style="padding: 8px; border: 1px solid #000; background-color: #fff; text-align: center;"><strong>合计(元):</strong></td>
|
|
|
- <td colspan="8" style="padding: 8px; border: 1px solid #000; text-align: right; font-size: 16px;">${formatNumber(productTotal)}</td>
|
|
|
+ <td colspan="8" style="padding: 8px; border: 1px solid #000; text-align: center; font-size: 16px;">${formatNumber(productTotal)}</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|