|
|
|
@ -22,11 +22,25 @@ |
|
|
|
<div |
|
|
|
class="div-derive cardRig-but" |
|
|
|
style="width: 130px; margin-right: 10px" |
|
|
|
@click="handleExport('医生版', true)" |
|
|
|
@click="handleExport1('医生版', true)" |
|
|
|
> |
|
|
|
<i class="el-icon-upload2"></i>导出(医生版) |
|
|
|
<i class="el-icon-upload2"></i>导出方式1 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
class="div-derive cardRig-but" |
|
|
|
style="width: 130px; margin-right: 10px" |
|
|
|
@click="handleExport2('医生版', true)" |
|
|
|
> |
|
|
|
<i class="el-icon-upload2"></i>导出方式2 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
class="div-derive cardRig-but" |
|
|
|
style="width: 130px; margin-right: 10px" |
|
|
|
@click="handleExport3('医生版', true)" |
|
|
|
> |
|
|
|
<i class="el-icon-upload2"></i>导出方式3 |
|
|
|
</div> |
|
|
|
<!-- <div |
|
|
|
style="width: 130px; margin-right: 10px" |
|
|
|
class="div-print cardRig-but" |
|
|
|
@click="handlePrinting('医生版', true)" |
|
|
|
@ -50,7 +64,7 @@ |
|
|
|
<div |
|
|
|
class="div-derive cardRig-but" |
|
|
|
style="width: 130px; margin-right: 10px" |
|
|
|
@click="handleExport('个人版')" |
|
|
|
@click="handleExport('个人版', true)" |
|
|
|
> |
|
|
|
<i class="el-icon-upload2"></i>导出(个人版) |
|
|
|
</div> |
|
|
|
@ -60,7 +74,7 @@ |
|
|
|
style="width: 130px" |
|
|
|
> |
|
|
|
<i class="el-icon-printer"></i>打印(个人版) |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -308,6 +322,7 @@ |
|
|
|
</switchingSlip> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { saveAs } from 'file-saver'; |
|
|
|
import switchingSlip from "components/switchingSlip"; |
|
|
|
import signatureVue from "./signature.vue"; |
|
|
|
import scaleTable from "./scaleTable.vue"; |
|
|
|
@ -405,7 +420,7 @@ export default { |
|
|
|
this.$router.go(-1); |
|
|
|
}, |
|
|
|
// 报告单报出 |
|
|
|
async handleExport(_type, _printFlat) { |
|
|
|
async handleExport1(_type, _printFlat) { |
|
|
|
this.type = _type; |
|
|
|
let params = { |
|
|
|
evaluationId: this.reportDetail1.patient.evaluationId, |
|
|
|
@ -413,20 +428,95 @@ export default { |
|
|
|
signId: this.signData.signId, |
|
|
|
}; |
|
|
|
let res = ""; |
|
|
|
if (_type === "医生版") { |
|
|
|
res = await doctorExport(params); |
|
|
|
} else if (_type === "个人版") { |
|
|
|
res = await personalExport(params); |
|
|
|
} else if (_type === "阳性版") { |
|
|
|
res = await positiveExport(params); |
|
|
|
} |
|
|
|
res = await doctorExport(params); |
|
|
|
|
|
|
|
const { code, msg, data } = res; |
|
|
|
if (code === 200) { |
|
|
|
// 是否是打印 true为导出不打印 |
|
|
|
if (_printFlat) { |
|
|
|
// 导出下载 |
|
|
|
window.open(this.apiUrl + data.path); |
|
|
|
this.$download( this.apiUrl + data.path); |
|
|
|
} else { |
|
|
|
this.open = false; |
|
|
|
this.handleInvoke( |
|
|
|
`${this.apiUrl}${data.path}?time${new Date().getTime()}`, |
|
|
|
); |
|
|
|
} |
|
|
|
this.$forceUpdate(); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
downloadFileH5WithFS(url, fileName) { |
|
|
|
fetch(url) |
|
|
|
.then(response => response.blob()) |
|
|
|
.then(blob => { |
|
|
|
alert('成功1') |
|
|
|
saveAs(blob, fileName || 'default_filename'); |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
alert('下载失败',error) |
|
|
|
console.error('下载失败:', error) |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 报告单报出 |
|
|
|
async handleExport2(_type, _printFlat) { |
|
|
|
this.type = _type; |
|
|
|
let params = { |
|
|
|
evaluationId: this.reportDetail1.patient.evaluationId, |
|
|
|
reportId: this.reportDetail1.patient.id, |
|
|
|
signId: this.signData.signId, |
|
|
|
}; |
|
|
|
let res = ""; |
|
|
|
res = await doctorExport(params); |
|
|
|
|
|
|
|
const { code, msg, data } = res; |
|
|
|
if (code === 200) { |
|
|
|
// 是否是打印 true为导出不打印 |
|
|
|
let url = this.apiUrl + data.path; |
|
|
|
if (_printFlat) { |
|
|
|
// 导出下载 |
|
|
|
// window.open(this.apiUrl + data.path); |
|
|
|
let url = this.apiUrl + data.path; |
|
|
|
const response = await fetch(url); |
|
|
|
const blob = await response.blob(); |
|
|
|
|
|
|
|
} else { |
|
|
|
this.open = false; |
|
|
|
this.handleInvoke( |
|
|
|
`${this.apiUrl}${data.path}?time${new Date().getTime()}`, |
|
|
|
); |
|
|
|
} |
|
|
|
this.$forceUpdate(); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 报告单报出 |
|
|
|
async handleExport3(_type, _printFlat) { |
|
|
|
this.type = _type; |
|
|
|
let params = { |
|
|
|
evaluationId: this.reportDetail1.patient.evaluationId, |
|
|
|
reportId: this.reportDetail1.patient.id, |
|
|
|
signId: this.signData.signId, |
|
|
|
}; |
|
|
|
let res = ""; |
|
|
|
res = await doctorExport(params); |
|
|
|
|
|
|
|
const { code, msg, data } = res; |
|
|
|
if (code === 200) { |
|
|
|
// 是否是打印 true为导出不打印 |
|
|
|
if (_printFlat) { |
|
|
|
let url = this.apiUrl + data.path; |
|
|
|
const link = document.createElement("a"); |
|
|
|
link.href = url; |
|
|
|
link.download = "11"; |
|
|
|
link.target = "_blank"; // 某些内网环境需要 |
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
setTimeout(() => document.body.removeChild(link), 100); |
|
|
|
plus.runtime.openURL(url); // 调用系统浏览器下载 |
|
|
|
console.log("方式去3"); |
|
|
|
} else { |
|
|
|
this.open = false; |
|
|
|
this.handleInvoke( |
|
|
|
|