| | |
| | | :visible.sync="addDialogVisible" |
| | | width="400px"> |
| | | <el-row> |
| | | <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <!-- <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">判定规则:</div> |
| | | <div class="search_input" style="display: flex;align-items: center;"> |
| | | <!-- <el-input size="small" placeholder="请输入" clearable v-model="addInfo.rule"></el-input> --> |
| | | <el-radio-group v-model="addInfo.rule" size="small" style="width: 60%;"> |
| | | <el-radio label="不考虑不确定度">不考虑不确定度</el-radio> |
| | | <el-radio label="考虑不确定度">考虑不确定度</el-radio> |
| | |
| | | <span v-if="addInfo.rule=='考虑不确定度'"> %</span> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">综合室签名人:</div> |
| | |
| | | // }).catch(err => { |
| | | // }) |
| | | this.$axios.post(this.$api.processOrder.exportInspectionOrder,{id:row.id},{responseType: 'blob'}).then(res => { |
| | | this.$message.success('导出成功') |
| | | const blob = new Blob([res], { |
| | | type: 'application/force-download' |
| | | }) |
| | | const filename = decodeURI(row.sample+'-'+row.sampleType+'-'+'检验委托单.docx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click(); |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const filename = decodeURI(row.sample+'-'+row.sampleType+'-'+'检验委托单.docx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click(); |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const filename = decodeURI(row.sample+'-'+row.sampleType+'-'+'检验委托单.docx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click(); |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | }, |