|
|
|
@ -1,11 +1,43 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<!-- :editor-toolbar="customToolbar" overflow-y: scroll;--> |
|
|
|
<div style="height: 500px;overflow:auto;" v-html="contentShow" ref="refPreviewCusGrant"></div> |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div></div> |
|
|
|
<div style="display: flex;"> |
|
|
|
<el-button type="primary" @click="btnPrint" class="commonbutton" size="small">打印</el-button> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div style="overflow-y: auto;height: 530px;width:200px;"> |
|
|
|
<el-collapse style="width:180px;"> |
|
|
|
<el-collapse-item v-if="signData?.informedConsentDetail.length > 0" title="知情同意书签名" name="0"> |
|
|
|
<el-table ref="registerCheckList0" :data="signData?.informedConsentDetail" style="width: 100%;" border |
|
|
|
highlight-current-row @row-click="rowClick" :show-header="false" :row-style="{ height: '28px' }"> |
|
|
|
<el-table-column prop="asbitemName" label="组合项目" width="174"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div :style="`padding: 0 5px;`"> |
|
|
|
{{ scope.row.asbitemName }} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-collapse-item> |
|
|
|
<el-collapse-item v-if="signData?.giveUpCheckDetail.length > 0" title="放弃检查签名" name="1"> |
|
|
|
<el-table ref="registerCheckList1" :data="signData?.giveUpCheckDetail" style="width: 100%;" border |
|
|
|
highlight-current-row @row-click="rowClick1" :show-header="false" :row-style="{ height: '28px' }"> |
|
|
|
<el-table-column prop="asbitemName" label="组合项目" width="174"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div :style="`padding: 0 5px;`"> |
|
|
|
{{ scope.row.asbitemName }} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-collapse-item> |
|
|
|
</el-collapse> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<!-- --> |
|
|
|
<div style="height: 500px;width: 680px;overflow:auto;" v-show="isShow == 1 ? true : false" v-html="contentShow" |
|
|
|
ref="refPreviewCusGrant"></div> |
|
|
|
<iframe :src="curRow.src" style="height: 500px;width: 680px;" v-show="isShow == 0 ? true : false" /> |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div></div> |
|
|
|
<div style="display: flex;"> |
|
|
|
<el-button type="primary" @click="btnPrint" class="commonbutton" size="small">打印</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -18,91 +50,186 @@ import { mapState } from "vuex"; |
|
|
|
import moment from "moment"; |
|
|
|
import html2canvas from "html2canvas"; |
|
|
|
import printJs from "print-js"; |
|
|
|
import { postapi } from "@/api/api"; |
|
|
|
|
|
|
|
export default { |
|
|
|
props: ['refParams'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
contentShow:'<h2 style="font-size:32px;text-align:center;"><strong>CT检查知情同意书</strong></h2><p>尊敬的客户:</p><p style="font-size:18px;"> 欢迎您来到长城体检中心进行CT检查,在检查之前,您需要知晓以下事宜:辐射有害健康,请远离电离辐射</p><p> 1、人体受到放射线照射后,可能产生潜在的危害,产生有害的躯体效应和遗传效应,其中最敏感的器官或组织为:甲状腺、性腺、及胚胎组织。</p><p> 2、孕妇原则上禁止CT检查,如果您是孕妇,在CT检查前,请告知工作人员。</p><p> 3、如果您正处在备孕阶段,原则上我们不建议进行CT检查,请您提前告知工作人员。</p><p> 4、CT检查时只允许一名受检者进入机房,无关人员不得在机房内停留。</p><p> 5、建议受检者佩戴门诊部提供的防护用品,遮盖敏感部位。 家屋到扫描室外等候。</p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p style="font-size:24px;text-align:right;"><strong>受检人签名:</strong>${signMan}</p><p><br></p><p style="font-size:20px;text-align:right;padding-right:40px;">${signDate}</p>', |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
contentShow: '<h2 style="font-size:32px;text-align:center;"><strong>CT检查知情同意书</strong></h2><p>尊敬的客户:</p><p style="font-size:18px;"> 欢迎您来到长城体检中心进行CT检查,在检查之前,您需要知晓以下事宜:辐射有害健康,请远离电离辐射</p><p> 1、人体受到放射线照射后,可能产生潜在的危害,产生有害的躯体效应和遗传效应,其中最敏感的器官或组织为:甲状腺、性腺、及胚胎组织。</p><p> 2、孕妇原则上禁止CT检查,如果您是孕妇,在CT检查前,请告知工作人员。</p><p> 3、如果您正处在备孕阶段,原则上我们不建议进行CT检查,请您提前告知工作人员。</p><p> 4、CT检查时只允许一名受检者进入机房,无关人员不得在机房内停留。</p><p> 5、建议受检者佩戴门诊部提供的防护用品,遮盖敏感部位。 家屋到扫描室外等候。</p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p style="font-size:24px;text-align:right;"><strong>受检人签名:</strong>${signMan}</p><p><br></p><p style="font-size:20px;text-align:right;padding-right:40px;">${signDate}</p>', |
|
|
|
signData: { // 签名相关数据 |
|
|
|
giveUpCheckDetail: [ |
|
|
|
{ |
|
|
|
registerCheckId: "", |
|
|
|
asbitemName: "", |
|
|
|
informedConsentFile: "", |
|
|
|
informedConsentSignFile: "", |
|
|
|
giveUpCheckSignFile: "" |
|
|
|
} |
|
|
|
], |
|
|
|
informedConsentDetail: [ |
|
|
|
{ |
|
|
|
registerCheckId: "", |
|
|
|
asbitemName: "", |
|
|
|
informedConsentFile: "", |
|
|
|
informedConsentSignFile: "", |
|
|
|
giveUpCheckSignFile: "" |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
isShow: 0, // 0 -- 同意书,1 --弃检 |
|
|
|
curRow: { |
|
|
|
registerCheckId: '', |
|
|
|
src: '', |
|
|
|
apiurl: 'http://192.168.1.138:9527' |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
//创建组件后 |
|
|
|
created() { |
|
|
|
|
|
|
|
try { |
|
|
|
let sysConfig = JSON.parse(window.sessionStorage.getItem('sysConfig')) |
|
|
|
this.curRow.apiurl = sysConfig.apiurl |
|
|
|
} catch (error) { |
|
|
|
confirm.error("window.sessionStorage.getItem('sysConfig')", error) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//挂载组件完成 |
|
|
|
mounted() { |
|
|
|
|
|
|
|
this.getSignData() |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState(["window", "dict", "dialogWin"]), |
|
|
|
divHeight(){ |
|
|
|
return this.window.pageHeight - 120 |
|
|
|
divHeight() { |
|
|
|
return this.window.pageHeight - 120 |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
// 方法 |
|
|
|
methods: { |
|
|
|
btnOk() { |
|
|
|
console.log('content', this.content) |
|
|
|
//this.dialogWin.acceptTemplate = false |
|
|
|
|
|
|
|
getSignData() { |
|
|
|
let body = {} |
|
|
|
if (this.refParams.registerCheckId) { |
|
|
|
body.registerCheckId = this.refParams.registerCheckId |
|
|
|
} else if (this.refParams.patientRegisterId) { |
|
|
|
body.patientRegisterId = this.refParams.patientRegisterId |
|
|
|
} else { |
|
|
|
this.signData = {} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
postapi('/api/app/Paperless/GetRegisterCheckSignPictureList', body) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.signData = res.data |
|
|
|
if (this.signData?.informedConsentDetail?.length > 0) { |
|
|
|
this.rowClick(this.signData.informedConsentDetail[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
rowClick(row) { |
|
|
|
this.curRow = Object.assign(this.curRow, row, { src: this.curRow.apiurl + row.informedConsentFile }) |
|
|
|
this.isShow = 0 |
|
|
|
console.log('this.curRow', this.curRow) |
|
|
|
}, |
|
|
|
|
|
|
|
btnInit(){ |
|
|
|
rowClick1(row) { |
|
|
|
this.curRow = Object.assign(this.curRow, row, { src: this.curRow.apiurl + '/' + row.giveUpCheckSignFile }) |
|
|
|
this.contentShow = '<h2 style="font-size:32px;text-align:center;"><strong>项目放弃检查申明</strong></h2><p><br></p><p style="font-size:18px;"> 本人因个人原因,自愿放弃【${asbitemName}】项目的检查。</p><p><br></p><p><br></p><p><br></p><p style="font-size:18px;"><strong>特此申明!</strong></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p style="font-size:24px;text-align:right;"><strong>弃检人签名:</strong>${signMan}</p><p><br></p><p style="font-size:20px;text-align:right;padding-right:40px;"></p>' |
|
|
|
this.contentShow = this.contentShow.replace('${signMan}', `<img width="100" height="50" src="${this.curRow.src}">`).replace('${asbitemName}', this.curRow.asbitemName) |
|
|
|
this.isShow = 1 |
|
|
|
console.log('this.curRow', this.curRow) |
|
|
|
}, |
|
|
|
|
|
|
|
btnInit() { |
|
|
|
this.content = this.contentInit |
|
|
|
this.contentDesign = this.contentInit |
|
|
|
this.designAble = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 查看效果 |
|
|
|
btnPreview(){ |
|
|
|
btnPreview() { |
|
|
|
this.acceptTemplateShow = true |
|
|
|
let signMan = '' |
|
|
|
let signDate = moment(new Date()).format('yyyy 年 MM 月 DD 日') |
|
|
|
let signDate = moment(new Date()).format('yyyy 年 MM 月 DD 日') |
|
|
|
this.contentShow = this.content.replace('${signMan}', signMan).replace('${signDate}', signDate) |
|
|
|
}, |
|
|
|
|
|
|
|
btnDesign(){ |
|
|
|
if(this.designAble){ |
|
|
|
this.contentDesign = this.content.replace(/' '/g,' ') |
|
|
|
}else{ |
|
|
|
btnDesign() { |
|
|
|
if (this.designAble) { |
|
|
|
this.contentDesign = this.content.replace(/' '/g, ' ') |
|
|
|
} else { |
|
|
|
this.content = this.contentDesign |
|
|
|
} |
|
|
|
this.designAble = !this.designAble |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取知情书内容 |
|
|
|
getSignFileContent() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (!this.curRow.registerCheckId) { |
|
|
|
reject('没有选中组合项目') |
|
|
|
} else { |
|
|
|
if (this.isShow == 1) { |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
postapi('/api/app/Paperless/GetRegisterCheckSignPictureByRegisterCheckId', { registerCheckId: this.curRow.registerCheckId }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.isShow = 1 |
|
|
|
this.contentShow = res.data.informedConsentContent |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
reject(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
reject(err.message) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
btnPrint() { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
let width = 794; // A4纸的宽度 |
|
|
|
let cloneDom = this.$refs['refPreviewCusGrant'].cloneNode(true); |
|
|
|
let imageDom = this.$refs['refPreviewCusGrant']; |
|
|
|
cloneDom.style.position = "absolute"; |
|
|
|
cloneDom.style.top = "0px"; |
|
|
|
cloneDom.style.zIndex = "-1"; |
|
|
|
cloneDom.style.width = width; |
|
|
|
cloneDom.style.padding = "80px 50px"; |
|
|
|
console.log(cloneDom); |
|
|
|
imageDom.appendChild(cloneDom); |
|
|
|
html2canvas(cloneDom).then((canvas) => { |
|
|
|
// 转成图片,生成图片地址 |
|
|
|
const url = canvas.toDataURL("image/png"); |
|
|
|
printJs({ |
|
|
|
printable: url, |
|
|
|
type: "image", |
|
|
|
documentTitle: "知情同意书", // 标题 |
|
|
|
style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid; |
|
|
|
this.$nextTick(async () => { |
|
|
|
|
|
|
|
this.getSignFileContent() |
|
|
|
.then(res => { |
|
|
|
let width = 794; // A4纸的宽度 |
|
|
|
let cloneDom = this.$refs['refPreviewCusGrant'].cloneNode(true); |
|
|
|
let imageDom = this.$refs['refPreviewCusGrant']; |
|
|
|
cloneDom.style.position = "absolute"; |
|
|
|
cloneDom.style.top = "0px"; |
|
|
|
cloneDom.style.zIndex = "-1"; |
|
|
|
cloneDom.style.width = width; |
|
|
|
cloneDom.style.padding = "80px 50px"; |
|
|
|
console.log(cloneDom); |
|
|
|
imageDom.appendChild(cloneDom); |
|
|
|
html2canvas(cloneDom).then((canvas) => { |
|
|
|
// 转成图片,生成图片地址 |
|
|
|
const url = canvas.toDataURL("image/png"); |
|
|
|
printJs({ |
|
|
|
printable: url, |
|
|
|
type: "image", |
|
|
|
documentTitle: "知情同意书", // 标题 |
|
|
|
style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid; |
|
|
|
page-break-after: avoid; |
|
|
|
page-break-before: avoid;}}`, // 去除页眉页脚 |
|
|
|
}); |
|
|
|
}); |
|
|
|
cloneDom.style.display = "none"; |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.error('getSignFileContent', err) |
|
|
|
}); |
|
|
|
}); |
|
|
|
cloneDom.style.display = "none"; |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
@ -112,9 +239,7 @@ page-break-before: avoid;}}`, // 去除页眉页脚 |
|
|
|
// immediate:true, |
|
|
|
handler(newVal, oldVal) { |
|
|
|
console.log(`watch 模板 newVal: ${newVal}, oldVal: ${oldVal} `, this.refParams); |
|
|
|
if (newVal != oldVal) { |
|
|
|
|
|
|
|
} |
|
|
|
if (newVal != oldVal) this.getSignData() |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|