| | |
| | | exportWeilongTemplate, |
| | | exportBaishiTemplate, |
| | | exportDaliTemplate, |
| | | exportCommonTemplate, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | return; |
| | | } |
| | | const id = currentExportRow.value.id; |
| | | |
| | | if (templateType === 'common') { |
| | | downloadQualityInspect({ id }).then(blobData => { |
| | | const blob = new Blob([blobData], { |
| | | type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", |
| | | }); |
| | | const link = document.createElement("a"); |
| | | link.href = URL.createObjectURL(blob); |
| | | link.download = "过程检验报告.docx"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | URL.revokeObjectURL(link.href); |
| | | proxy.$modal.msgSuccess("导出成功"); |
| | | closeTemplateDialog(); |
| | | }).catch(() => { |
| | | proxy.$modal.msgError("导出失败"); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | const fileNameMap = { |
| | | weilong: "伟龙模版检验结果.doc", |
| | | baishi: "百事模版检验结果.doc", |
| | | dali: "达利模版检验结果.doc", |
| | | common: "通用模版检验结果.doc", |
| | | }; |
| | | const exportFuncMap = { |
| | | weilong: exportWeilongTemplate, |
| | | baishi: exportBaishiTemplate, |
| | | dali: exportDaliTemplate, |
| | | common: exportCommonTemplate, |
| | | }; |
| | | try { |
| | | const response = await exportFuncMap[templateType](id); |