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] || '模版'; };