|
|
|
|
<template>
|
|
|
|
|
<div v-if="flag===1" style="flex:1">
|
|
|
|
|
<div
|
|
|
|
|
id="printButtonA5"
|
|
|
|
|
:style="savePdf ? 'position: relative;width: 210mm;font-family:msyh;transform: scale(0.95);transform-origin: left top;' : ''"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
ref="htmlContent"
|
|
|
|
|
:style="savePdf ? 'max-width: 100%;margin: 0 auto;' : ''"
|
|
|
|
|
>
|
|
|
|
|
<!-- v-if="currentUrl.includes('192')" -->
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-family:MicrosoftYaHeiBold;
|
|
|
|
|
"
|
|
|
|
|
>温州医科大学附属眼视光医院</div>
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
font-family:MicrosoftYaHeiBold;
|
|
|
|
|
"
|
|
|
|
|
>门诊病历</div>
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border-bottom: 2px solid #6f6f6f;
|
|
|
|
|
padding-bottom: 12px;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<span style="padding-right: 30px">姓名:{{ formListValue.patientName }}</span>
|
|
|
|
|
<span style="padding-right: 30px">性别:{{ formListValue.patientSex }}</span>
|
|
|
|
|
<span style="padding-right: 30px">年龄:{{ formListValue.patientAge }}岁</span>
|
|
|
|
|
<span style="padding-right: 30px">PID:{{ formListValue.patientId }}</span>
|
|
|
|
|
<span>日期:{{ formListValue.createDate }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
id="printA5"
|
|
|
|
|
style="
|
|
|
|
|
flex: 1;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
"
|
|
|
|
|
:style="savePdf ? 'max-width: 100%;margin: 0 auto;' : ''"
|
|
|
|
|
>
|
|
|
|
|
<div style="margin-bottom: 2px; break-inside: avoid">
|
|
|
|
|
<span style="display: flex; align-items: center">
|
|
|
|
|
<span style="font-weight: 700;font-family:MicrosoftYaHeiBold;">主诉及病史:</span>
|
|
|
|
|
<span>{{ formListValue.zsAndBs ? formListValue.zsAndBs : '无' }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 2px; break-inside: avoid">
|
|
|
|
|
<span style="font-weight: 700;font-family:MicrosoftYaHeiBold;">专科检查:</span>
|
|
|
|
|
<span>{{ formListValue.zkjc ? formListValue.zkjc : '无' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 2px; break-inside: avoid">
|
|
|
|
|
<span style="font-weight: 700;font-family:MicrosoftYaHeiBold;">辅助检查:</span>
|
|
|
|
|
<span>{{ formListValue.fzjc ? formListValue.fzjc : '无' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 2px; break-inside: avoid">
|
|
|
|
|
<span style="font-weight: 700;font-family:MicrosoftYaHeiBold;">初步诊断:</span>
|
|
|
|
|
<span>{{ formListValue.cbzd ? formListValue.cbzd : '无' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 2px; break-inside: avoid">
|
|
|
|
|
<span style="font-weight: 700;font-family:MicrosoftYaHeiBold;">处理意见:</span>
|
|
|
|
|
<span>{{ formListValue.clyj ? formListValue.clyj : '无' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- v-if="base64Flag" -->
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
break-inside: avoid;
|
|
|
|
|
margin-right: 35px;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
医生签名:
|
|
|
|
|
<span>
|
|
|
|
|
<span v-if="!formListValue.createSign" style="padding-left:12px;">{{ formListValue.createName ? formListValue.createName : '-' }}</span>
|
|
|
|
|
<img
|
|
|
|
|
v-else
|
|
|
|
|
:src="formListValue.createSign"
|
|
|
|
|
alt=""
|
|
|
|
|
width="120px"
|
|
|
|
|
style="display: block;break-inside: avoid"
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
<!-- <img :src="formListValue.createSign" alt="" width="120px"> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="formListValue.isConfirm===1" style="color:green;font-size:40px;text-align: center;margin-top: 60px;font-weight: 700;">已CA签字</div>
|
|
|
|
|
<div v-if="formListValue.isConfirm!==1" style="color:red;font-size:40px;text-align: center;margin-top: 60px;font-weight: 700;">未CA签字</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import htmlToPdfToBlob from '@/mixins/htmlToPdfToBlob'
|
|
|
|
|
const Base64 = require('js-base64').Base64
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [htmlToPdfToBlob],
|
|
|
|
|
props: {
|
|
|
|
|
archiveCaseCRFItem: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: () => { }
|
|
|
|
|
},
|
|
|
|
|
currentUrl: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ''
|
|
|
|
|
},
|
|
|
|
|
savePdf: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
formListValue: {
|
|
|
|
|
},
|
|
|
|
|
flag: 0,
|
|
|
|
|
recordId: '',
|
|
|
|
|
formFlag: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// CA启动逻辑判断
|
|
|
|
|
init(id, formFlag) {
|
|
|
|
|
this.recordId = id
|
|
|
|
|
this.formFlag = formFlag
|
|
|
|
|
// console.log('this.$parent', this.$parent.$parent.formListValue)
|
|
|
|
|
const parentFormlistValue = this.$parent.$parent.formListValue
|
|
|
|
|
if (parentFormlistValue.zsAndBs && parentFormlistValue.cbzd && parentFormlistValue.clyj) {
|
|
|
|
|
this.getSendCaStatus(id)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 是否开启了CA认证表单状态
|
|
|
|
|
async getSendCaStatus(id) {
|
|
|
|
|
const { data: res } = await this.$http.get('/quguang/caSign/getSendCaStatus', {
|
|
|
|
|
params: {
|
|
|
|
|
name: this.archiveCaseCRFItem.formName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
res.data === 1 ? this.getQgEmrRecordInfo(id, 'savePdf') : ''
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取屈光电子病历信息
|
|
|
|
|
async getQgEmrRecordInfo(id, savePdf) {
|
|
|
|
|
// savePdf ? this.loading = this.$loading({
|
|
|
|
|
// lock: true,
|
|
|
|
|
// text: '转存PDF中请稍等...',
|
|
|
|
|
// spinner: 'el-icon-loading',
|
|
|
|
|
// background: 'rgba(255, 255, 255, 0.7)'
|
|
|
|
|
// }) : ''
|
|
|
|
|
// this.base64Flag = false
|
|
|
|
|
this.flag = 0
|
|
|
|
|
const { data: res } = await this.$http.get('/quguang/fuzhen/emr/getFuZhenRecordInfo', {
|
|
|
|
|
params: {
|
|
|
|
|
id: id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
Object.keys(res.data).forEach((item, index) => {
|
|
|
|
|
// 如果不为空就赋值上去
|
|
|
|
|
if ((res.data[item] && res.data[item] !== 'false' && res.data[item] !== 'true') || typeof res.data[item] === 'number') {
|
|
|
|
|
// 目前转为使用jsPDF不需要转换图片为base64了,如果使用html2pdf需要转,如果不转图片生成不出来
|
|
|
|
|
// if (item === 'createSign') {
|
|
|
|
|
// // console.log(item);
|
|
|
|
|
// this.convertImageToBase64(res.data.createSign, 'createSign')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.formListValue[item] = res.data[item]
|
|
|
|
|
// }
|
|
|
|
|
this.formListValue[item] = res.data[item]
|
|
|
|
|
}
|
|
|
|
|
if (res.data[item] && typeof res.data[item] !== 'number') {
|
|
|
|
|
res.data[item].includes('[') || res.data[item] === 'false' || res.data[item] === 'true' ? this.formListValue[item] = JSON.parse(res.data[item]) : ''
|
|
|
|
|
}
|
|
|
|
|
if (Object.keys(res.data).length - 1 === index) {
|
|
|
|
|
this.flag = 1
|
|
|
|
|
if (savePdf) {
|
|
|
|
|
this.formListValue.createSign = ''
|
|
|
|
|
window.localStorage.getItem('qg-userData') ? this.userData = JSON.parse(window.localStorage.getItem('qg-userData')) : ''
|
|
|
|
|
const caParams = {
|
|
|
|
|
// 文件名称
|
|
|
|
|
fileName: this.archiveCaseCRFItem.formName,
|
|
|
|
|
// 表单标志位,1:屈光电子病历/屈光电子病历(复诊) 2:术后检查记录表,3:角膜交联病历/角膜交联病历(复诊),4:角膜交联术后检查记录单,5:复诊病历,6:手术计划
|
|
|
|
|
formFlag: 5,
|
|
|
|
|
patientIdNumber: this.archiveCaseCRFItem.patientIdNumber,
|
|
|
|
|
patientCentreId: this.userData.centreId,
|
|
|
|
|
patientName: this.archiveCaseCRFItem.patientName,
|
|
|
|
|
patientId: this.archiveCaseCRFItem.patientId,
|
|
|
|
|
// 表单id
|
|
|
|
|
formId: this.archiveCaseCRFItem.id,
|
|
|
|
|
// 表单记录id
|
|
|
|
|
recordId: this.recordId,
|
|
|
|
|
signUser: {
|
|
|
|
|
// 签署位置集合
|
|
|
|
|
position: [
|
|
|
|
|
{
|
|
|
|
|
// 坐标签署X轴(数值为0-1之间的小数,以左下角为原点0,右角顶点为1) * 签署位置类型为:2必填
|
|
|
|
|
coX: '',
|
|
|
|
|
// 坐标签署Y轴(数值为0-1之间的小数,以左下角为原点0,右角顶点为1) * 签署位置类型为:2必填
|
|
|
|
|
coY: '',
|
|
|
|
|
// 关键字 签署位置类型为:1必填
|
|
|
|
|
keyword: '医生签名:',
|
|
|
|
|
// 关键字偏移(左右),单位像素 签署位置类型为:1必填
|
|
|
|
|
offsetX: '0.1',
|
|
|
|
|
// 关键字偏移(上下),单位像素 签署位置类型为:1必填
|
|
|
|
|
offsetY: '0',
|
|
|
|
|
// 签署位置类型为:2必填 * 坐标签署页码,格式“A-B",A为起始页,B为结束页,如“1-5"表示从第1到第5页。“0-0"表示签所有页
|
|
|
|
|
pageNo: '',
|
|
|
|
|
// 签名图片和时间戳分开时必填 * 1:签字位置(默认); * 6: 签署时间
|
|
|
|
|
signatureType: '',
|
|
|
|
|
// 是否附加签名时间,签名时间显示于签字/印章图片的下方,内层外层需要同时填入才可生效 * 1:附加;0:不附加 (默认)
|
|
|
|
|
timestamp: '1',
|
|
|
|
|
// 签署位置类型(1:关键字;2:坐标;3:签名域)
|
|
|
|
|
type: '1',
|
|
|
|
|
// 签字/盖章宽度
|
|
|
|
|
width: '75',
|
|
|
|
|
// 签字/盖章高度
|
|
|
|
|
height: '30'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
// 是否必填:是 医护人员编号,用户需要在系统中已导入、实名认证和采集了签字
|
|
|
|
|
userId: this.userData.employeeId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.exportPDF({
|
|
|
|
|
customMargin: [15, 15],
|
|
|
|
|
customElementId: 'printButtonA5',
|
|
|
|
|
caParams: caParams,
|
|
|
|
|
isJavaTransformPdf: true,
|
|
|
|
|
marginStyle: Base64.encode('<style>@page{margin: 8mm 5mm 5mm 5mm;}</style>'),
|
|
|
|
|
htmlBase: Base64.encode(document.getElementById('printButtonA5').innerHTML)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}, 5)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.loading.close()
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 刷新页面
|
|
|
|
|
caRefresh() {
|
|
|
|
|
this.$parent.$parent.getInfo()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
</style>
|