You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

655 lines
21 KiB

3 years ago
<template>
<div class="archives">
<div class="archives-content">
<div class="content-left">
<div class="content-left-top">
<el-tree
ref="my-tree"
:data="archiveFList"
:props="defaultProps"
default-expand-all
:current-node-key="currentNodeKey"
node-key="id"
@node-click="handleMoveCopyNodeClick"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="node.level === 1">{{ data.crfType ? data.crfType : 'H5问卷调查' }}</span>
<div
v-if="node.level !== 1"
class="tree-children"
:class="data.id === currentNodeKey ? 'CRFList-list-active' : ''"
@click="CRFListClick(data)"
>
<span
class="tree-date"
:class="data.id === currentNodeKey ? 'tree-date-active' : ''"
>{{ data.formDate }}</span>
<p class="tree-forname">{{ data.formName }}</p>
<el-button
type="text"
size="mini"
class="tree-button"
:class="data.id === currentNodeKey ? 'tree-button-active':''"
@click.stop="deleteCRFList(data)"
>
<i class="el-icon-delete" />
</el-button>
</div>
</span>
</el-tree>
<img v-if="noDataShow" src="@/assets/img/nodata.png" alt="" class="nodata">
<!-- <div class="button"><i class="el-icon-plus" /> 新建表单</div> -->
</div>
<div class="content-left-bottom">
<div class="commonForm-text ">
<span>常用表单</span>
<span class="line" />
<el-checkbox v-model="defaultChecked">默认新建今日</el-checkbox>
</div>
<div class="comonForm-tab">
<el-radio-group v-model="radio" size="small">
<el-radio-button label="电子病历" name="1" style="width: 85px"></el-radio-button>
<el-radio-button label="其他" name="2" style="width: 85px"></el-radio-button>
</el-radio-group>
<div v-if="radio === '电子病历'" class="record" @click="addRecord">
<p>门诊病历</p>
<img :src="require('@/assets/img/add.png')" alt="">
</div>
</div>
</div>
</div>
<div class="content-right">
<ourPatientRecord :patientId="patientId"></ourPatientRecord>
</div>
</div>
<!-- 批量打印 -->
<!-- <add-print v-if="addPrintVisible" ref="addPrintRef" @closedDialog="addPrintVisible=false" />-->
</div>
</template>
<script>
import { dateFilterTwo } from '@/filters/index.js'
import ourPatientRecord from './outPatientRecord'
const Base64 = require('js-base64').Base64
export default {
components: {
ourPatientRecord
},
mixins: [],
props: {
editorIDName: {
type: String,
default: ''
},
patientIdNumber: {
type: String,
default: ''
},
patientId: {
type: String,
default: ''
},
currentArchiveList: {
type: Object,
default: () => { }
}
},
inject: ['refresh'],
data() {
return {
noDataShow: false,
defaultChecked: [],
archiveFList: [],
commeFormTabs: [],
commeFormList: [],
radio: '电子病历',
comonFormActive: '',
defaultProps: {
children: 'list'
},
currentNodeKey: '',
}
},
watch: {
currentNodeKey(id) {
this.currentNodeKey = id
console.log(id)
// Tree 内部使用了 Node 类型的对象来包装用户传入的数据,用来保存目前节点的状态。可以用 $refs 获取 Tree 实例
if (id && id.toString()) {
this.$refs['my-tree'].setCurrentKey(id)
} else {
this.$refs['my-tree'].setCurrentKey(null)
}
}
},
created() {
// this.queryList = JSON.parse(this.$Base64.decode(this.$route.query.info))
// console.log(this.queryList)
// this.userData = JSON.parse(window.localStorage.getItem('qg-userData'))
// const doctorTabList = [{ name: '门诊' }, { name: '其他' }]
// const HSTabList = [{ name: '手术' }]
// const positionName = this.userData.positionList.length > 0 ? this.userData.positionList[0].positionName : ''
// this.commeFormTabs = positionName.includes('医生') ? doctorTabList : HSTabList
// this.comonFormActive = positionName.includes('医生') ? '门诊' : '手术'
// this.getCRFList(this.comonFormActive)
// 被随访记录兄弟组件调用
// eventBus.$on('getArchiveCaseList', () => {
// this.getArchiveCaseList(this.archiveCaseCRFItem.archiveId)
// })
},
methods: {
// 添加门诊电子病历
addRecord() {
},
// 共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身
handleMoveCopyNodeClick(data) {
this.currentNodeKey = data.id
},
// 获取档案下的病例列表
async getArchiveCaseList(archiveId, dataList) {
console.log(archiveId)
// this.crfIframeVisible = false
this.noDataShow = false
const { data: res } = await this.$http.get(`/medical/record/getList/${archiveId}`)
if (res.code === 0) {
this.archiveCaseCRFList = JSON.parse(JSON.stringify(res.data))
if (res.data.length > 0) {
dataList ? this.init(dataList) : this.init(res.data[0].list[0])
// this.archiveCaseCRFItem = res.data[0].list[0]
this.currentNodeKey = dataList ? dataList.id : res.data[0].list[0].id
this.noDataShow = false
} else {
this.crfIframeVisible = false
this.noDataShow = true
this.archiveCaseCRFItem = []
this.CRFLoading = false
return
}
} else {
this.$message.error(res.msg)
}
},
// 点击crf列表
CRFListClick(item) {
// console.log(item)
// console.log(this.oldCRFListItem)
this.isClick = item.id !== this.oldCRFListItem.id
if (this.isClick) {
this.oldCRFListItem = item
console.log('点击crf列表', item)
this.isClick = false
item.isH5 === 1 ? this.$store.commit('initPlugin') : ''
this.init(item)
}
},
// 显示当前随访表单
init(item) {
// console.log(item)questionList
item ? this.dataForm = { ...this.dataForm, ...item } : ''
this.crfIframeVisible = false
this.$nextTick(() => {
this.$http.get(`/visit/record/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data) {
this.archiveCaseCRFItem = JSON.parse(JSON.stringify(res.data))
res.data.isH5 ? this.archiveCaseCRFItem.formContent = JSON.parse(this.archiveCaseCRFItem.formContent) : this.archiveCaseCRFItem = res.data
this.isEyeQuestionShow = true
this.dataForm = { ...this.dataForm, ...res.data }
this.dataForm.content = res.data.isH5 ? '' : Base64.decode(res.data.formContent)
this.crfIframeVisible = true
// console.log(this.dataForm)
this.dataForm.isWrite === 0 && (this.dataForm.crfDescription === '智能填充' || this.dataForm.crfDescription === '病历模板') ? this.getFirstFeedbackData('智能填充', this.dataForm.id) : this.CRFLoading = false
this.dataForm.crfDescription === '智能填充' ? this.getsaveOperaList(this.dataForm.id) : ''
}
}).catch(() => { })
})
},
// 删除CRF列表数据
deleteCRFList(item) {
// console.log(item)
this.$confirmFun('你确定要删除此病例吗?').then(async() => {
const { data: res } = await this.$http.delete(`/medical/record/${item.id}`)
if (res.code === 0) {
this.getArchiveCaseList(this.currentArchiveList.id)
this.$message({
showClose: true,
message: '您已删除成功',
type: 'success'
})
} else {
this.$$message.error(res.msg)
}
})
},
// 填写修改CRF表单
addOrUpdateHandle() {
this.$store.commit('destroyPlugin')
if (this.archiveCaseCRFItem.crfDescription === '病历模板') {
this.editFullCaseTemplateVisible = true
this.$nextTick(() => {
this.$refs.editFullCaseTemplateRef.dataForm.description = this.archiveCaseCRFItem.crfDescription
this.$refs.editFullCaseTemplateRef.dataForm.patientIdNumber = this.archiveCaseCRFItem.patientIdNumber
this.$refs.editFullCaseTemplateRef.dataForm.patientCentreId = this.archiveCaseCRFItem.patientCentreId
this.$refs.editFullCaseTemplateRef.dataForm.id = this.archiveCaseCRFItem.id
this.$refs.editFullCaseTemplateRef.dataForm.formDate = this.archiveCaseCRFItem.formDate
this.$refs.editFullCaseTemplateRef.init()
})
} else if (this.archiveCaseCRFItem.crfDescription === '智能填充') {
this.intelligentFullVisible = true
this.isJudgeSign = this.archiveCaseCRFItem.formName === '告知书'
console.log(this.archiveCaseCRFItem)
this.$nextTick(() => {
this.$refs.intelligentFullRef.dataForm.crfId = this.archiveCaseCRFItem.crfId
this.$refs.intelligentFullRef.dataForm.formId = this.archiveCaseCRFItem.id
this.$refs.intelligentFullRef.dataForm.formName = this.archiveCaseCRFItem.formName
this.$refs.intelligentFullRef.dataForm.isWrite = this.archiveCaseCRFItem.isWrite
this.$refs.intelligentFullRef.dataForm.patientIdNumber = this.archiveCaseCRFItem.patientIdNumber
this.$refs.intelligentFullRef.dataForm.formDate = this.archiveCaseCRFItem.formDate
this.$refs.intelligentFullRef.init()
})
} else {
this.followUpVisible = true
this.$nextTick(() => {
this.$refs.followUp.dataForm.crfId = this.archiveCaseCRFItem.crfId
this.$refs.followUp.dataForm.formId = this.archiveCaseCRFItem.id
this.$refs.followUp.dataForm.isWrite = this.archiveCaseCRFItem.isWrite
this.$refs.followUp.init()
})
}
},
// 点击常用表单列表
comonFormListClick(index, item) {
this.comonFormCurrentIndex = index
this.addComonFormHandle(item)
},
// 添加常用表单
async addComonFormHandle(item) {
const date = dateFilterTwo(this.$moment().format('L')) // 2022/04/29
if (this.defaultChecked) {
const { data: res } = await this.$http.post('/medical/record', {
archiveId: this.currentArchiveList.id,
crfId: item.id,
formDate: date,
patientCentreId: this.currentArchiveList.patientCentreId,
patientIdNumber: this.currentArchiveList.patientIdNumber
})
if (res.code === 0) {
this.getArchiveCaseList(res.data.archiveId, res.data)
} else {
this.$message.error(res.msg)
}
} else {
this.addCaseFormVisible = true
this.$nextTick(() => {
this.$refs.addCaseFormRef.dataForm.archiveId = this.currentArchiveList.id
this.$refs.addCaseFormRef.dataForm.crfId = item.id
this.$refs.addCaseFormRef.dataForm.patientCentreId = this.currentArchiveList.patientCentreId
this.$refs.addCaseFormRef.dataForm.patientIdNumber = this.currentArchiveList.patientIdNumber
this.$refs.addCaseFormRef.init()
})
}
},
// tab切换
handleClick(el) {
this.comonFormCurrentIndex = 0
this.getCRFList(el.label)
},
// 根据类型获取模板列表
async getCRFList(type) {
const { data: res } = await this.$http.get(`/crf/template/getListByType/${type}`)
if (res.code === 0) {
this.commeFormList = res.data
} else {
this.$message.error(res.msg)
}
},
// 抽屉切换
drawerhandle(flag) {
// 智能填充
this.drawerVisible = true
this.IntelligentDrawer = true
},
// CRF打印
printerHandle() {
this.$refs.crfComponent.$el.contentWindow.print()
},
// 批量打印
allPrintPreview() {
this.addPrintVisible = true
this.$nextTick(() => {
this.$refs.addPrintRef.archiveId = this.currentArchiveList.id
this.$refs.addPrintRef.init()
})
},
// 问卷调查打印
handlePrint() {
this.archiveCaseCRFItem.formName === '眼科病史问卷调查' ? this.printPage('eyeQuestionPrint') : this.printPage('beforeOperationPrint')
},
// 新增模板跳转
addTemplateHandle() {
this.$router.push({
path: '/templateManagement',
query: {
info: this.$Base64.encode(JSON.stringify(this.queryList))
}
})
},
// 引入
introduceClick(itemList) {
console.log(itemList)
this.$refs.crfEditorComponent.fullContent('右眼<input id="youyan" class="hminput border-1 " style="width: 120px; height: 18px; text-align: center;" title="" autocomplete="off" name="youyan" type="text" placeholder="" data-hm_id="youyan" data-hm_type="text" data-hm_required="false" data-hm_bd_id="DAT1_VA.OD_VAN" data-hm_bd_eye_type="" />左眼<input id="zuoyan" class="hminput border-1 " style="width: 120px; height: 18px; text-align: center;" title="" autocomplete="off" name="zuoyan" type="text" placeholder="" data-hm_id="zuoyan" data-hm_type="text" data-hm_required="false" data-hm_bd_id="DAT1_VA.OS_VAN" data-hm_bd_eye_type="" />')
},
async saveH5() {
const { data: res } = await this.$http.post('/visit/record/saveWriteVisit', {
formContent: JSON.stringify(this.archiveCaseCRFItem.formContent),
// inputDate: this.inputDate,
id: this.archiveCaseCRFItem.id
})
if (res.code === 0) {
this.$message({
message: '您已保存成功',
type: 'success'
})
} else {
this.$message.error(res.msg)
}
}
}
}
</script>
<style lang="scss" scoped>
.archives {
height: 100%;
.text-ellipsis {
white-space: nowrap; // 段落不换行
text-overflow: ellipsis;
overflow: hidden;
}
.printer {
border: 1px solid #ccc;
width: 56px;
height: 32px;
border-radius: 3px;
margin: 0;
margin-left: 10px;
cursor: pointer;
}
.archives-content {
display: flex;
height: 100%;
overflow: hidden;
.content-left {
width: 185px;
height: 100%;
margin-right: 14px;
.nodata {
width: 230px;
margin-top: 30px;
}
.content-left-top,
.content-left-bottom {
height: 50%;
}
.tree-botton-arr {
margin-left: 10px;
}
.tree-date {
padding-right: 10px;
}
.content-left-top {
overflow-y: auto;
margin-bottom: 16px;
.CRFList-list {
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 24px;
padding-right: 16px;
color: #000;
}
.CRFList-list {
height: 40px;
line-height: 40px;
font-size: 14px;
cursor: pointer;
.el-icon-more {
transform: rotate(90deg);
}
}
.CRFList-icon:hover {
color: #ff2929;
}
.CRFList-list-active {
background-color: #1890ff;
color: #fff;
.el-icon-more {
color: #fff;
}
}
.button {
margin-top: 16px;
background: #f2f3f5;
border-radius: 4px;
height: 40px;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.button:hover,
.el-icon-plus:hover {
color: #1890ff;
}
}
.content-left-bottom {
.commonForm-text {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 700;
}
.line {
border-bottom: 1px solid #e5e6eb;
flex: 1;
display: inline-block;
margin: 0 10px;
}
.comonForm-tab {
margin-top: 10px;
}
.comonForm-tab-Pane {
margin-top: 10px;
}
.comonForm-list {
height: 40px;
line-height: 40px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 10px;
cursor: pointer;
}
.comonForm-list:hover {
background-color: #f4f8fb;
color: #1d2129;
}
.comonForm-icon:hover {
color: #1890ff;
font-weight: 700;
}
}
}
.record{
display: flex;
justify-content: space-between;
padding-top: 12px;
cursor: pointer;
p {
display: inline-block;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
letter-spacing: 1px;
}
img {
width: 16px;
height: 16px;
margin-top: 3px;
}
}
}
.content-right {
padding: 12px;
position: relative;
flex: 1;
text-align: center;
background-color: #F0F2F5;
overflow-y: hidden;
.content-right-buttonClick {
display: flex;
justify-content: flex-end;
background: #2e2e2e;
padding: 10px;
}
.editor-CRF {
height: 93%;
}
.content-right-CRF {
background: #5c5c5c;
overflow-x: auto;
padding: 16px 16px 16px 16px;
position: relative;
height: 100%;
}
.content-right-CRF-class {
padding-right: 178px;
}
.suspension-button {
position: absolute;
right: 10px;
top: 10px;
z-index: 1;
}
.case-template,
.intelligent-filling {
cursor: pointer;
height: 140px;
width: 32px;
background: #fff;
border-radius: 4px;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
span {
writing-mode: vertical-rl;
letter-spacing: 6px;
}
}
.case-template:hover,
.intelligent-filling:hover {
background: linear-gradient(270deg, #f4f8fb 0%, #deebff 66.15%);
}
.case-template {
margin-bottom: 6px;
}
}
}
</style>
<style lang="scss">
.archives {
.el-button .el-button--text .el-button--mini {
padding: 0;
}
.tree-date {
font-size: 14px;
color: #ccc;
}
.tree-date-active {
color: #e4e4e4;
}
.el-tree-node {
margin-bottom: 6px;
}
.el-tree-node__content {
margin-bottom: 4px;
height: 35px;
//padding-left: 0 !important;
}
//.tree-children {
// padding: 2px 0 2px 20px;
// position: relative;
//}
//.el-tree-node__expand-icon.is-leaf {
// display: none;
//}
.tree-children:hover {
.tree-button {
display: inline-block;
}
}
.tree-button {
position: absolute;
bottom: 6px;
right: 4px;
display: none;
}
.tree-button-active {
color: #fff;
}
.custom-tree-node {
flex: 1;
padding-top: 6px;
overflow: hidden;
}
.tree-forname {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 90%;
}
.el-tree-node__content:hover,
.el-upload-list__item:hover {
background: none;
}
.el-icon-caret-right:before {
color: #262626;
}
}
.comonForm-tab {
#tab-mz {
padding-left: 14px !important;
}
.el-tabs__nav-wrap::after {
height: 0;
}
.el-tabs__header {
padding-right: 0 !important;
}
.el-tabs__item.is-active {
color: #fff;
background: #1890ff;
}
.el-tabs__item {
background: #f2f3f5;
padding: 0 14px;
margin-left: 1px;
height: 35px;
line-height: 35px;
}
.el-tabs__content {
padding: 0 !important;
}
}
.see-doctor .comonForm-tab .el-tabs__item:last-child {
padding-right: 14px !important;
}
.see-doctor .comonForm-tab .el-tabs__item:nth-child(2) {
padding-left: 14px !important;
}
</style>