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.

486 lines
13 KiB

3 years ago
<template>
<!-- 视光档案-->
<div class="opticalFile">
<div class="opticalFile-content">
<div class="content-left">
<div class="content-left-top">
2 years ago
<div v-for="(item, index) in formList" :key="index" class="formBox" :class="[index === curIndex ? 'active' : '']" @click="handleForm(index, item)">
3 years ago
<p :class="[index === curIndex ? 'activeFont' : 'curFont']">{{ item.createTime }}</p>
<p>{{ item.name }}</p>
</div>
<img v-if="!formList.length" src="@/assets/img/nodata.png" alt="" class="nodata">
<!-- <div class="button"><i class="el-icon-plus" /> 新建表单</div> -->
</div>
<div class="content-left-bottom">
2 years ago
<div class="commonForm-text">
3 years ago
<span>常用表单</span>
<span class="line" />
<el-checkbox v-model="defaultChecked">默认新建今日</el-checkbox>
</div>
<div class="record">
2 years ago
<p>验光报告单</p>
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(1,'验光报告单')">
3 years ago
</div>
<div class="comonForm-tab">
<el-radio-group v-model="formType" size="small">
<el-radio-button label="报告单" name="1" style="" />
<el-radio-button label="其他" name="2" style="" />
</el-radio-group>
<div v-if="formType === '报告单'">
<div class="record">
<p>双眼视功能检查报告单</p>
2 years ago
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(2,'双眼视功能检查报告单')">
3 years ago
</div>
<div class="record">
2 years ago
<p>屈光发育档案</p>
2 years ago
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(1,'屈光发育档案')">
3 years ago
</div>
2 years ago
<div class="record">
3 years ago
<p>三级视功能检查报告单</p>
2 years ago
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(4,'三级视功能检查报告单')">
3 years ago
</div>
</div>
</div>
</div>
</div>
<div class="content-right">
2 years ago
<div v-if="!formList.length" style="height: 100%;background: #fff;display: flex;align-items: center;justify-content: center">
<img src="@/assets/img/nodata.png" alt="">
</div>
<eyesVision
v-if="name === '双眼视功能检查报告单'"
ref="eyesVis"
:case-id="id"
:only-read="onlyRead"
2 years ago
:is-platform="isPlatform"
:patient-id="patientId"
@del="deleteForm"
/>
2 years ago
<optometryForm v-if="name === '验光报告单'" ref="optome" :case-id="id" :is-platform="isPlatform" :only-read="onlyRead" :patient-id="patientId" :is-search="isSearch" @del="deleteForm" />
<threeVision
v-if="name === '三级视功能检查报告单'"
ref="threeVis"
:only-read="onlyRead"
2 years ago
:is-platform="isPlatform"
:case-id="id"
:patient-id="patientId"
@del="deleteForm"
/>
2 years ago
<deveopmentFile v-if="name === '屈光发育档案'" ref="deveope" :is-platform="isPlatform" :case-id="id" :only-read="onlyRead" :patient-id="patientId" :is-search="isSearch" :form-content="deveopData" @del="deleteForm" />
3 years ago
</div>
</div>
</div>
</template>
<script>
import ourPatientRecord from './outPatientRecord'
import eyesVision from '@/components/360View/commonForm/eyesVision' //
import threeVision from '@/components/360View/commonForm/threeVision' //
2 years ago
import optometryForm from '@/components/360View/commonForm/optometryForm-copy' //
import deveopmentFile from '@/components/360View/commonForm/deveopmentFIle-copy' //
3 years ago
export default {
components: {
ourPatientRecord,
eyesVision,
optometryForm,
deveopmentFile,
threeVision
},
mixins: [],
props: {
2 years ago
isSearch: {
type: String,
default: ''
},
3 years ago
patientIdNumber: {
type: String,
default: ''
},
patientId: {
type: String,
default: ''
2 years ago
},
onlyRead: {
type: Boolean,
default: false
3 years ago
}
},
inject: ['refresh'],
data() {
return {
id: '',
name: '',
2 years ago
isPlatform: true,
3 years ago
defaultChecked: [],
curIndex: 0,
formList: [],
deveopData: {},
threeData: {},
optomeData: {},
eyesData: {},
formType: '报告单'
3 years ago
}
},
mounted() {
2 years ago
this.getFormList()
3 years ago
},
methods: {
handleForm(index, item) {
// 点击自身不保存
if (this.curIndex === index) {
return
3 years ago
}
2 years ago
// 360视图和非本平台表单不用保存
if (this.onlyRead || !this.isPlatform) {
this.curIndex = index
this.id = item.id
this.name = item.name
2 years ago
this.isPlatform = this.isSearch === item.platform
return
}
this.confirmChange().finally(() => {
this.curIndex = index
this.id = item.id
this.name = item.name
2 years ago
this.isPlatform = this.isSearch === item.platform
})
},
confirmChange() {
return this.$confirmFun('是否保存数据,否则当前数据会丢弃!', '保存', '', '已取消保存数据!')
.then(() => {
this.$nextTick(() => {
switch (this.name) {
case '验光报告单' :
this.$refs.optome.handleSaveTable()
break
case '屈光发育档案':
this.$refs.deveope.handleSaveTable()
break
case '三级视功能检查报告单':
this.$refs.threeVis.handleSaveTable()
break
case '双眼视功能检查报告单':
this.$refs.eyesVis.handleSaveTable()
break
default:
break
}
})
})
3 years ago
},
// 添加表单
addRecord(index, name) {
this.saveTableData(name)
},
2 years ago
// 添加左侧表单列表
3 years ago
async saveTableData(name) {
2 years ago
const date = this.$moment().format('YYYY-MM-DD HH:mm:ss')
3 years ago
const params = {
flag: 6,
name: name,
2 years ago
createTime: date,
3 years ago
patientId: this.patientId,
2 years ago
platform: this.isSearch
3 years ago
}
const { data: res } = await this.$http.post('/case/save', params)
if (res.code === 0) {
this.$message.success('保存成功')
2 years ago
await this.getFormList()
3 years ago
} else {
this.$message.error(res.msg)
}
},
2 years ago
async deleteForm() {
3 years ago
const params = {
id: this.id
}
this.$confirmFun('你确定要删除吗?').then(async() => {
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
2 years ago
await this.getFormList()
} else {
this.$message.error(res.msg)
}
})
3 years ago
},
2 years ago
async getFormList() {
3 years ago
const { data: res } = await this.$http.get('/patient/view/getCases', {
params: {
patientId: this.patientId,
flag: 6
}
})
if (res.code === 0) {
this.formList = res.data || []
2 years ago
if (this.formList.length) {
2 years ago
this.curIndex = 0
2 years ago
this.id = this.formList[0].id
this.name = this.formList[0].name
this.isPlatform = this.isSearch === this.formList[0].platform
2 years ago
this.handleForm(this.curIndex, { name: this.name, id: this.id })
2 years ago
} else {
this.id = ''
this.name = ''
2 years ago
}
3 years ago
} else {
this.$message.error(res.msg)
}
}
}
}
</script>
<style lang="scss" scoped>
.opticalFile {
height: 100%;
.active {
color: white;
background-color: #1C76FD;
}
.curFont {
color: #A6A4A4;
}
.activeFont {
color: #D9D9D9;
}
.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;
}
.formBox{
cursor: pointer;
padding: 2px 8px;
border-radius: 2px;
2 years ago
margin-top: 12px;
3 years ago
}
.opticalFile-content {
display: flex;
height: 100%;
overflow: hidden;
.content-left {
width: 185px;
height: 100%;
margin-right: 14px;
.nodata {
width: 185px;
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">
.opticalFile {
.el-button .el-button--text .el-button--mini {
padding: 0;
}
}
.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>
2 years ago