| | |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState; |
| | | } |
| | | }, |
| | | { |
| | | name: "附件", |
| | |
| | | proxy.$modal.msgError("检验员已存在"); |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState; |
| | | } |
| | | }, |
| | | { |
| | | name: "下载", |
| | |
| | | } |
| | | |
| | | const downLoadFile = (row) => { |
| | | downloadQualityInspect({id: row.id}).then(res => { |
| | | // 创建 blob 对象 |
| | | const blob = new Blob([res.data], {type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'}) |
| | | downloadQualityInspect({ id: row.id }).then((blobData) => { |
| | | const blob = new Blob([blobData], { |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | | const downloadUrl = window.URL.createObjectURL(blob) |
| | | |
| | | // 创建临时 <a> 标签进行下载 |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = '检验报告.docx' // 这里和后端一致 |
| | | link.download = '检验报告.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |
| | | // 清理 |
| | | document.body.removeChild(link) |
| | | window.URL.revokeObjectURL(downloadUrl) |
| | | }) |