|
@@ -605,7 +605,8 @@ function renderReportDocsByTextbook(textbook){
|
|
|
})
|
|
|
// console.log(bookData)
|
|
|
// console.log(json)
|
|
|
- let tempFileName = path.join(`${bookid}_${json.title}_申报书及附件.docx`)
|
|
|
+ let title = bookData.title?.replaceAll("/","")
|
|
|
+ let tempFileName = path.join(`${bookid}_${title}_申报书及附件.docx`)
|
|
|
|
|
|
|
|
|
// mergeFiles 处理七八九是否签名或后置问题
|
|
@@ -616,7 +617,7 @@ function renderReportDocsByTextbook(textbook){
|
|
|
lastPageList.push(json?.authorSignPDF?.url||docx7);
|
|
|
lastPageList.push(json?.unitMaterial?.url||docx8);
|
|
|
lastPageList.push(docx9);
|
|
|
- let lastPageFileName = path.join(bookTempDir,`${bookid}_${bookData.title}_申报书及附件_789.pdf`)
|
|
|
+ let lastPageFileName = path.join(bookTempDir,`${bookid}_${title}_申报书及附件_789.pdf`)
|
|
|
console.log(lastPageList)
|
|
|
let lastPagePdf = await docxToPdf(null,lastPageFileName,{mergeFiles:lastPageList,tempDir:bookTempDir,mergeAll:true}) // 成功用pdf,失败继续用docx
|
|
|
docx7&&fs.rmSync(docx7)
|
|
@@ -668,7 +669,8 @@ function renderReportDocsByTextbook(textbook){
|
|
|
|
|
|
async function getPageDocx(bookid,pageName,bookData){
|
|
|
let tplPath = path.join(TemplateDocxDir,`模板-本科教材申报书-${pageName}.docx`);
|
|
|
- let tempFileName = path.join(`${bookid}_${bookData.title}_申报书及附件_${pageName}.docx`);
|
|
|
+ let title = bookData?.title?.replaceAll("/","")
|
|
|
+ let tempFileName = path.join(`${bookid}_${title}_申报书及附件_${pageName}.docx`);
|
|
|
let filePath = renderDocx(tplPath,tempFileName,bookData);
|
|
|
return filePath;
|
|
|
// 转pdf
|