From 68a02f2a439663a6933b27e86c2696384181d991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BA=A2=E5=85=B5?= <374362909@qq.com> Date: Sat, 7 Mar 2026 13:17:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(purchase):=20=E4=BF=AE=E5=A4=8D=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E5=8C=B9=E9=85=8D=E5=AD=97=E6=AE=B5=E5=90=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 t.type 改为 t.templateType,与后端返回字段保持一致 - 影响 downloadTemplate 和 getTemplateName 两个函数 --- src/views/purchase/purchasingrequisition/add.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/purchase/purchasingrequisition/add.vue b/src/views/purchase/purchasingrequisition/add.vue index 5cb63da..c1d2a60 100644 --- a/src/views/purchase/purchasingrequisition/add.vue +++ b/src/views/purchase/purchasingrequisition/add.vue @@ -1603,7 +1603,7 @@ watch( // 下载模版:统一走后端接口,按原始文件下载(避免前端静态资源被当成 HTML 返回) const downloadTemplate = async (type: string) => { // 优先从后台模版列表获取模版名称 - const backendTemplate = templateList.value.find((t: any) => t.type === type); + const backendTemplate = templateList.value.find((t: any) => t.templateType === type); let displayName = ''; if (backendTemplate?.templateTitle) { @@ -1641,7 +1641,7 @@ const downloadTemplate = async (type: string) => { // 获取模版名称(用于按钮显示,优先从后台获取) const getTemplateName = (type: string): string => { - const backendTemplate = templateList.value.find((t: any) => t.type === type); + const backendTemplate = templateList.value.find((t: any) => t.templateType === type); if (backendTemplate?.templateTitle) { return backendTemplate.templateTitle.replace(/\.(doc|docx)$/i, ''); } @@ -1659,6 +1659,7 @@ const getTemplateName = (type: string): string => { feasibility_report: '项目可行性论证报告模板', gov_pur_int: '政府采购意向申请表', }; + return fallbackNames[type] || '模版'; };