From 2f9d27b03fc6c7392e7de261958ae2635e1df5b5 Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Tue, 10 Mar 2026 17:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/oa/crm/crmQuoteInfo/quoteView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/oa/crm/crmQuoteInfo/quoteView.vue b/src/views/oa/crm/crmQuoteInfo/quoteView.vue index ea14251..6b054f3 100644 --- a/src/views/oa/crm/crmQuoteInfo/quoteView.vue +++ b/src/views/oa/crm/crmQuoteInfo/quoteView.vue @@ -96,14 +96,14 @@ const renderTemplate = (str: string, data: Record) => { const rowRenderTemplate = (str: string, index: number) => { let res = str; res = res.replace(/\^\{(.*?)\}/g, (_, path) => { - return templateData[`^{${path}}`]?.[index] ?? ' '; + return templateData[`^{${path}}`]?.[index] || ' '; }); res = res.replace(/#\{(.*?)\}/g, (_, path) => { const arr = path.split('.'); if (arr.length > 0) { arr[0] = `#{${arr[0]}}`; } - return arr.reduce((o: any, k: string) => o?.[k], templateData) ?? ' '; + return arr.reduce((o: any, k: string) => o?.[k] || ' ', templateData) ?? ' '; }); return res; }; @@ -209,7 +209,7 @@ onMounted(async () => { const { data: assignData } = await templateAssign({ templateType: 4, quoteId }); templateData = {}; (assignData || []).forEach((item: any) => { - templateData[item.varName] = item.varValue ?? ' '; + templateData[item.varName] = item.varValue || ' '; }); const tplResp = await getPrintTemplate(templateId);