| | |
| | | <el-button type="primary" @click="openQuickCheck">快速检验</el-button> |
| | | <el-button type="primary" @click="openForm('add')">新增</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | <el-button type="danger" plain @click="handleDelete" v-hasPermi="['qualityManagement:processInspection:remove']">删除</el-button> |
| | | </div> |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | |
| | | <div class="template-icon weilong-icon">伟</div> |
| | | <div class="template-name">伟龙模板</div> |
| | | </div> |
| | | <!-- <div class="template-item" @click="handleTemplateExport('baishi')"> |
| | | <div class="template-item" @click="handleTemplateExport('baishi')"> |
| | | <div class="template-icon baishi-icon">百</div> |
| | | <div class="template-name">百事模板</div> |
| | | </div> --> |
| | | </div> |
| | | <div class="template-item" @click="handleTemplateExport('dali')"> |
| | | <div class="template-icon dali-icon">达</div> |
| | | <div class="template-name">达利模板</div> |
| | |
| | | exportWeilongTemplate, |
| | | exportBaishiTemplate, |
| | | exportDaliTemplate, |
| | | exportCommonTemplate, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | return "未提交"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "检验规则", |
| | | prop: "inspectRule", |
| | | width: 100, |
| | | formatData: (val) => val === 0 ? "全检" : val === 1 ? "抽检" : "" |
| | | }, |
| | | { |
| | | label: "抽检比例(%)", |
| | | prop: "sampleRatio", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "抽检数量", |
| | | prop: "sampleQuantity", |
| | | width: 100, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | 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); |