| | |
| | | import InspectionFormDia from "@/views/qualityManagement/rawMaterial/components/inspectionFormDia.vue"; |
| | | import FormDia from "@/views/qualityManagement/rawMaterial/components/formDia.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { |
| | | downloadQualityInspect, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/rawMaterial/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | |
| | | import { |
| | | deleteRawMaterial, |
| | | findRawMaterialListPage, |
| | | submitRawMaterial, updateCheckUserName, |
| | | submitRawMaterial, updateCheckUserName,downloadRawMaterial |
| | | } from "@/api/qualityManagement/rawMaterial.js"; |
| | | |
| | | const data = reactive({ |
| | |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "数量(吨)", |
| | | prop: "quantity", |
| | | }, |
| | | { |
| | | label: "批次号", |
| | | prop: "batchNo", |
| | | width: 120 |
| | |
| | | prop: "checkResult", |
| | | dataType: "tag", |
| | | formatType: (params) => { |
| | | if (params === 1) { |
| | | if (params === 0) { |
| | | return "danger"; |
| | | } else if (params === 0) { |
| | | } else if (params === 1) { |
| | | return "success"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatData: (params) => { |
| | | if (params === 1) { |
| | | if (params === 0) { |
| | | return "不合格"; |
| | | } else if (params === 0) { |
| | | } else if (params === 1) { |
| | | return "合格"; |
| | | } |
| | | }, |
| | |
| | | disabled: (row) => { |
| | | // 已提交则禁用 |
| | | if (row.inspectState == 1) return true; |
| | | // 如果检验员有值,只有当前登录用户能提交 |
| | | if (row.checkUserName) { |
| | | return row.checkUserName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/quality/qualityInspect/export", {inspectType: 0}, "原材料检验.xlsx"); |
| | | proxy.download("/quality/rawMaterial/export", {}, "原料检.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | } |
| | | |
| | | const downLoadFile = (row) => { |
| | | downloadQualityInspect({id: row.id}).then((blobData) => { |
| | | downloadRawMaterial({id: row.id}).then((blobData) => { |
| | | const blob = new Blob([blobData], { |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | |
| | | |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = '原材料检验报告.docx' |
| | | link.download = '原料检验报告.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |