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.
307 lines
10 KiB
307 lines
10 KiB
<template>
|
|
<el-dialog
|
|
class="patientDialog"
|
|
:visible.sync="visible"
|
|
width="40%"
|
|
:title="dataForm.title"
|
|
@close="closeDialog"
|
|
>
|
|
<el-form ref="dataForm" :model="dataForm" :rules="dataRule">
|
|
<el-form-item label="登记号:" label-width="120px" prop="patientId" class="formItemOne">
|
|
<el-input v-model="dataForm.patientId" placeholder="请输入登记号" />
|
|
</el-form-item>
|
|
<el-form-item label="患者姓名:" label-width="120px" prop="patientName">
|
|
<el-input v-model="dataForm.patientName" placeholder="请输入姓名" />
|
|
</el-form-item>
|
|
<el-form-item label="身份证号:" label-width="120px" prop="patientIdNumber">
|
|
<el-input v-model="dataForm.patientIdNumber" placeholder="请输入身份证号 " @change="handleBirth" />
|
|
</el-form-item>
|
|
<el-form-item label="出生日期:" label-width="120px" prop="patientBirthday">
|
|
<el-date-picker
|
|
v-model="dataForm.patientBirthday"
|
|
align="right"
|
|
type="date"
|
|
placeholder="选择日期"
|
|
value-format="yyyy-MM-dd"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="性别:" label-width="120px" prop="gender">
|
|
<el-radio-group v-model="dataForm.patientSex" size="medium">
|
|
<el-radio-button label="男">男</el-radio-button>
|
|
<el-radio-button label="女">女</el-radio-button>
|
|
<el-radio-button label="保密">保密</el-radio-button>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="联系电话:" label-width="120px" prop="patientPhone">
|
|
<el-input v-model="dataForm.patientPhone" placeholder="请输入手机号" />
|
|
</el-form-item>
|
|
<el-form-item label="家庭地址:" label-width="120px" prop="patientAddress">
|
|
<el-input v-model="dataForm.patientAddress" placeholder="请输入地址" />
|
|
</el-form-item>
|
|
<div style="border-bottom: 1px solid #ccc;margin-bottom: 20px" />
|
|
<el-form-item required label="患者来源:" prop="patientSource" label-width="120px">
|
|
<el-select v-model="dataForm.patientSource" placeholder="请选择患者来源">
|
|
<el-option
|
|
v-for="item in sourceList"
|
|
:key="item.value"
|
|
:label="item.name"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="门诊医师:" prop="mzDoctorId" label-width="120px">
|
|
<el-select v-model="dataForm.mzDoctorId" placeholder="请选择门诊医师">
|
|
<el-option
|
|
v-for="item in mzDoctorList"
|
|
:key="item.id"
|
|
:label="item.realName"
|
|
:value="item.employeeId
|
|
"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="视光医师:" prop="sgDoctorId" label-width="120px">
|
|
<el-select v-model="dataForm.sgDoctorId" placeholder="请选择视光医师">
|
|
<el-option
|
|
v-for="item in sgDoctorList"
|
|
:key="item.id"
|
|
:label="item.realName"
|
|
:value="item.employeeId
|
|
"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="眼别:" prop="zlEye" label-width="120px">
|
|
<el-select v-model="dataForm.zlEye" placeholder="请选择眼别">
|
|
<el-option v-for="item in zlEyeList" :key="item.value" :label="item.name" :value="item.value" />
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="医疗项目:" label-width="120px" prop="zlProjectCode">
|
|
<el-select v-model="dataForm.zlProjectCode" multiple placeholder="请选择医疗项目">
|
|
<el-option
|
|
v-for="item in projectList"
|
|
:key="item.itemId"
|
|
:label="item.itemName"
|
|
:value="item.itemId"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="备注:" label-width="120px" prop="remarks">
|
|
<el-input v-model="dataForm.remark" type="textarea" />
|
|
</el-form-item>
|
|
</el-form>
|
|
<template slot="footer">
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
|
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
|
</template>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
import debounce from 'lodash/debounce'
|
|
import { isMobile, isIDNumber } from '@/utils/validate'
|
|
import eventBus from '@/page-subspecialty/utils/eventBus'
|
|
export default {
|
|
props: {
|
|
patientTypeList: {
|
|
type: Array,
|
|
default: () => []
|
|
},
|
|
platform: {
|
|
type: Number
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
disabled: false,
|
|
visible: false,
|
|
dataForm: {
|
|
registerType: 1,
|
|
platform: 1,
|
|
patientId: '',
|
|
patientName: '',
|
|
patientIdNumber: '',
|
|
patientSex: '男',
|
|
patientPhone: '',
|
|
patientAddress: '',
|
|
patientBirthday: '',
|
|
mzDoctorId: '', // 门诊医师
|
|
sgDoctorId: '', // 视光医师
|
|
patientSource: '',
|
|
zlProjectCode: [],
|
|
zlEye: 'ou',
|
|
remark: ''
|
|
},
|
|
zlEyeList: [
|
|
{ name: '左眼', value: 'os' },
|
|
{ name: '右眼', value: 'od' },
|
|
{ name: '双眼', value: 'ou' }
|
|
],
|
|
params: {},
|
|
sourceList: [{
|
|
name: '门诊',
|
|
value: '门诊'
|
|
}, {
|
|
name: '住院',
|
|
value: '住院'
|
|
}
|
|
],
|
|
mzDoctorList: [],
|
|
sgDoctorList: [],
|
|
projectList: []
|
|
}
|
|
},
|
|
computed: {
|
|
dataRule() {
|
|
var validataMobile = (rule, value, callback) => {
|
|
if (value && !isMobile(value)) {
|
|
return callback(new Error('您输入的手机号格式不正确'))
|
|
}
|
|
callback()
|
|
}
|
|
var validataIDNumber = (rule, value, callback) => {
|
|
if (value && !isIDNumber(value)) {
|
|
return callback(new Error('您输入的身份证格式不正确'))
|
|
} else if (!value) {
|
|
return callback(new Error('请输入身份证号'))
|
|
}
|
|
callback()
|
|
}
|
|
return {
|
|
patientId: [
|
|
{ required: true, message: '请输入登记号', trigger: 'blur' }
|
|
],
|
|
patientName: [
|
|
{ required: true, message: '请输入患者姓名', trigger: 'blur' }
|
|
],
|
|
patientIdNumber: [
|
|
{ validator: validataIDNumber, trigger: 'blur' }
|
|
],
|
|
sgDoctorId: [
|
|
{ required: true, message: '请选择视光医师', trigger: 'blur' }
|
|
],
|
|
patientSource: [
|
|
{ required: true, message: '请选择患者来源', trigger: 'blur' }
|
|
]
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
init() {
|
|
this.visible = true
|
|
this.dataForm.registerType = 1
|
|
this.getDoctorList('视光医师')
|
|
this.getDoctorList('门诊医师')
|
|
this.getProject()
|
|
this.$nextTick(() => {
|
|
this.$refs.dataForm.resetFields() // 重置表单
|
|
if (this.params.patientId && this.dataForm.title !== 'HIS引入') {
|
|
this.dataForm = {
|
|
title: this.dataForm.title,
|
|
...this.params
|
|
}
|
|
} else if (this.dataForm.title === 'HIS引入') {
|
|
this.getHisInfo()
|
|
}
|
|
})
|
|
},
|
|
handleBirth(value) {
|
|
if (value) {
|
|
const year = value.substr(6, 4)
|
|
const month = value.substr(10, 2)
|
|
const day = value.substr(12, 2)
|
|
this.dataForm.patientBirthday = `${year}-${month}-${day}`
|
|
}
|
|
},
|
|
// 获取医师列表
|
|
getDoctorList(val) {
|
|
this.$http.get('/sys/user', { params: { position: val }}).then(data => {
|
|
if (val === '视光医师') {
|
|
this.sgDoctorList = data.data.data
|
|
} else {
|
|
this.mzDoctorList = data.data.data
|
|
}
|
|
this.dataForm.sgDoctorId = JSON.parse(window.localStorage.getItem('qg-userData')).employeeId
|
|
})
|
|
},
|
|
// 获取项目列表
|
|
getProject() {
|
|
this.$http.get('/patient/getZlItemDict', { params: { type: this.platform }}).then(data => {
|
|
this.projectList = data.data.data
|
|
})
|
|
},
|
|
// 获取His信息
|
|
getHisInfo() {
|
|
this.dataForm = { ...this.dataForm, ...this.params }
|
|
this.dataForm.revisitCycles = this.dataForm.revisitCycles ? this.dataForm.revisitCycles : '1'
|
|
this.dataForm.revisitCyclesUnit = this.dataForm.revisitCyclesUnit ? this.dataForm.revisitCyclesUnit : '3'
|
|
this.dataForm.registerType = 0
|
|
},
|
|
// 表单提交
|
|
dataFormSubmitHandle: debounce(function() {
|
|
this.disabled = true
|
|
this.$refs.dataForm.validate((valid) => {
|
|
if (!valid) {
|
|
this.disabled = false
|
|
return false
|
|
}
|
|
this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',')
|
|
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm)
|
|
.then(({ data: res }) => {
|
|
if (res.code !== 0) {
|
|
return this.$message.error(res.msg)
|
|
}
|
|
this.$message({
|
|
message: this.$t('prompt.success'),
|
|
type: 'success',
|
|
duration: 500,
|
|
onClose: () => {
|
|
this.visible = false
|
|
this.$emit('refreshDataList')
|
|
}
|
|
})
|
|
})
|
|
.catch(() => {})
|
|
.finally(() => { this.disabled = false })
|
|
})
|
|
}, 1000, { leading: true, trailing: false }),
|
|
// 关闭弹框
|
|
closeDialog() {
|
|
this.$emit('closeDialog')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.patientDialog {
|
|
.cycle-display {
|
|
.el-form-item__content {
|
|
display: flex;
|
|
}
|
|
.el-input-number {
|
|
width: 100px;
|
|
margin-right: 16px;
|
|
}
|
|
}
|
|
}
|
|
|
|
</style>
|
|
<style lang="scss">
|
|
.patientDialog {
|
|
.el-dialog__header {
|
|
margin-bottom:12px
|
|
}
|
|
.el-dialog__body {
|
|
padding-right: 30px;
|
|
}
|
|
.el-select{
|
|
width: 100%;
|
|
}
|
|
.formItemOne .el-form-item__content {
|
|
display: flex;
|
|
}
|
|
.el-date-editor.el-input, .el-date-editor.el-input__inner {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|