@ -91,7 +91,7 @@
< template # action = "{ record }" >
< a-space >
< a-button v-has = "'admin:sysDoctor:detail'" type = "text"
@ click = "handleDetail(record)" > < icon- edit / > 详情 < / a-button >
@ click = "handleDetail(record)" > < icon- book / > 详情 < / a-button >
< a-button v-has = "'admin:sysDoctor:edit'" type="text" @click="handleUpdate(record)" > < icon -edit / > 修改 < / a-button >
< a-button v-has = "'admin:sysDoctor:remove'" type = "text"
@ click = "() => { deleteVisible = true; deleteData = [record.doctor_id]; }" > < icon-delete / > 删除 < / a-button >
@ -108,38 +108,50 @@
< / div >
< a-form :model = "modalForm" :disabled = "modalSatus=='detail'" :rules = "rules" ref = "modalFormRef"
: auto - label - width = "true" >
< a-form-item field = "avatar" label = "医生头像:" >
< a-space size = "large" >
< a-avatar :size = "80" :imageUrl = "modalForm.avatar" >
< / a-avatar >
< / a-space >
< a-upload action = "/" : fileList = "file ? [file] : []" class = "upload" :auto-upload = "false" @change ="onChangeFile"
accept = "image/png, image/jpeg" @ before - upload = "beforeUpload" : show - file - list = "false"
v - if = "modalSatus!='detail'" / >
< / a-form-item >
< a-row :gutter = "24" >
< a-col :span = "12" >
< a-form-item field = "avatar" label = "医生头像:" >
< a-space size = "large" >
< a-avatar :size = "80" :imageUrl = "modalForm.avatar" >
< / a-avatar >
< / a-space >
< a-upload action = "/" : fileList = "file ? [file] : []" class = "upload" :auto-upload = "false"
@ change = "onChangeFile" accept = "image/*" @ before - upload = "beforeUpload" : show - file - list = "false"
v - if = "modalSatus!='detail'" / >
< / a-form-item >
< / a-col >
< a-col :span = "12" v-if = "modalSatus=='add'" >
< a-form-item field = "user.mobile" label = "联系电话:" >
< a-input v-model = "modalForm.user.mobile" placeholder="请输入联系电话" / >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "12" >
< a-form-item field = "user_name" label = "医生名字:" >
{ { modalForm . user _name } }
<a-input v-model = "modalForm.user_name" placeholder="请输入医生名字" :disabled = "modalSatus=='edit'" / >
< / a-form-item >
< / a-col >
< a-col :span = "12" >
< a-form-item field = "idCard" label = "身份证号:" >
< div class = "box" v-show = "!showEye" >
< a-form-item field = "card_num" label = "身份证号:" v-if = "modalSatus=='add'" >
< a-input v-model = "modalForm.card_num" placeholder="请输入身份证号" / >
< / a-form-item >
< a-form-item field = "idCard" label = "身份证号:" v-else >
< div class = "box" v-show = "!showEye && modalSatus!='add'" >
< div > { { modalForm . user _doctor _info . card _num _mask } } < / div >
< icon-eye-invisible class = "eye" @click ="()=>{showEye=true}" / >
< / div >
< div class = "box" v-show = "showEye ">
< div class = "box" v-show = "showEye && modalSatus!='add' ">
< div > { { id _card _num } } < / div >
< icon-eye class = "eye" @click ="()=>{showEye=false}" / >
< / div >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-row :gutter = "24" v-if = "modalSatus!='add'" >
< a-col :span = "12" >
< a-form-item field = " mobile" label = "联系电话:" >
{{ modalForm . user . mobile } }
< a-form-item field = " user. mobile" label = "联系电话:" >
<a-input v-model = "modalForm.user.mobile" placeholder="请输入联系电话" / >
< / a-form-item >
< / a-col >
< a-col :span = "12" >
@ -151,23 +163,28 @@
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "12" >
< a-form-item field = " address" label = "医院地址:" >
< a-form-item field = " hospital. address" label = "医院地址:" >
< a-input v-model = "modalForm.hospital.address" placeholder="请输入医院地址" / >
< / a-form-item >
< / a-col >
< a-col :span = "12" >
< a-form-item field = "hospital_name" label = "医院名称:" >
< a-input v-model = "modalForm.hospital.hospital_name" placeholder="请输入医院名称" / >
< a-form-item field = "hospital.hospital_name" label = "医院名称:" >
< a-select placeholder = "请选择所在医院" v-model = "modalForm.hospital.hospital_name" >
< a-option v-for = "item in hospitalData" :key="item.hospital_id" :value = "item.hospital_id"
: label = "item.hospital_name" > { { item . hospital _name } } < / a-option >
< / a-select >
<!-- < a-input v-model = "modalForm.hospital.hospital_name" placeholder="请输入医院名称" / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "12" >
< a-form-item field = "department_custom_id" label = "所在科室:" >
< a-select placeholder = "请选择所在科室" v-model = "modalForm.department_custom_id" >
< a-select placeholder = "请选择所在科室" v-model = "modalForm.department_custom_id" @change="changeSelect" >
< a-option v-for = "item in departmentData" :key = "item.department_custom_id"
: value = "item.department_custom_id"
: label = "item.department_custom_name" > { { item . department _custom _name } } < / a-option >
: value = "item.department_custom_id" : label = "item.department_custom_name" >
{ { item . department _custom _name } }
< / a-option >
< / a-select >
< / a-form-item >
@ -181,7 +198,11 @@
< a-row :gutter = "24" >
< a-col :span = "12" >
< a-form-item field = "doctor_title" label = "职 称 : " >
< a-input v-model = "doctor_title_name" placeholder="请输入职称" / >
< a-select placeholder = "请选择所在医院" v-model = "modalForm.doctor_title" >
< a-option v-for = "item in doctor_title_data" :key="item.doctor_title" :value = "item.doctor_title"
: label = "item.doctor_title_name" > { { item . doctor _title _name } } < / a-option >
< / a-select >
<!-- < a-input v-model = "doctor_title_name" placeholder="请输入职称" / > -- >
< / a-form-item >
< / a-col >
< a-col :span = "12" >
@ -200,30 +221,33 @@
< / a-row > -- >
< a-row :gutter = "24" >
< a-col :span = "24" >
< a-form-item field = " qualification_cert_num" label = "资格证编码:" >
< a-input v-model = "modalForm.user_doctor_info.qualification_cert_num" placeholder="请输入 部门名称 " / >
< a-form-item field = " user_doctor_info. qualification_cert_num" label = "资格证编码:" >
< a-input v-model = "modalForm.user_doctor_info.qualification_cert_num" placeholder="请输入 资格证编码 " / >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "24" >
< a-form-item field = "user_name" label = "专长:" >
< a-textarea v-model = "modalForm.remark" placeholder="请输入备注内容" / >
< a-form-item field = "cur_doctor_expertise" label = "专长:" >
< a-select multiple placeholder = "请选择专长" v-model = "modalForm.cur_doctor_expertise" >
< a-option v-for = "item in expertiseData" :key="item.expertise_id" :value = "item.expertise_id"
: label = "item.expertise_name" > { { item . expertise _name } } < / a-option >
< / a-select >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "24" >
< a-form-item field = "be_good_at" label = "擅长信息:" >
< a-textarea v-model = "modalForm.be_good_at" placeholder="请 输入备注内容 " / >
< a-textarea v-model = "modalForm.be_good_at" placeholder="请 填写医生擅长信息。内容为医生专业领域、擅长疾病、研究方法等信息( 字数在10-1000字) " / >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" >
< a-col :span = "24" >
< a-form-item field = "brief_introduction" label = "个人简介:" >
< a-textarea v-model = "modalForm.brief_introduction" placeholder="请 输入备注内容 " / >
< a-textarea v-model = "modalForm.brief_introduction" placeholder="请 填写医生从业经历, 职称和所获荣誉等信息( 字数在10-1000字) " / >
< / a-form-item >
< / a-col >
< / a-row >
@ -233,135 +257,193 @@
< div class = "name" > 是否推荐 < / div >
< / div >
< a-row :gutter = "24" style = "margin-top: 35px;" >
< a-col :span = " 4 ">
< a-form-item field = " " label = "状态:" >
< a-col :span = " 12 ">
< a-form-item field = " is_recommend " label = "状态:" >
< a-space size = "large" >
< a-switch checked -color = " # 14C9C9 " :checked-value = "1" :unchecked-value = "0"
v - model = "modalForm.is_recommend" style = "cursor: not-allowed!important;" / >
v - model = "modalForm.is_recommend" / >
< / a-space >
< / a-form-item >
< / a-col >
< a-col :span = " 20 " v-if = "modalForm.is_recommend==1" >
< a-col :span = " 1 2" v-if = "modalForm.is_recommend==1" >
< div > 理由 : 平台合作 < / div >
< / a-col >
< / a-row >
< a-divider / >
< div class = "titlebox" >
< div class = "bar" > < / div >
< div class = "name" > 平台合作 < / div >
< / div >
< a-row :gutter = "24" style = "margin-top: 35px;" >
< a-col :span = "4" >
< a-form-item field = "is_platform_deep_cooperation" label = "平台深度合作医生:" >
< a-space size = "large" >
< a-switch checked -color = " # 14C9C9 " :checked-value = "1" :unchecked-value = "0"
v - model = "modalForm.is_platform_deep_cooperation" / >
< / a-space >
< / a-form-item >
< / a-col >
< a-col :span = "20" >
< a-form-item field = "is_sys_diagno_cooperation" label = "先思达合作医生:" >
< a-space size = "large" >
< a-switch checked -color = " # 14C9C9 " :checked-value = "1" :unchecked-value = "0"
v - model = "modalForm.is_sys_diagno_cooperation" / >
< / a-space >
< / a-form-item >
< / a-col >
< / a-row >
< a-divider / >
< div class = "titlebox" >
< div class = "bar" > < / div >
< div class = "name" > 医师证件 < / div >
< / div >
< a-row :gutter = "24" style = "margin-top: 35px;"
v - if = "modalForm.user_doctor_info.license_cert && modalForm.user_doctor_info.license_cert.length>0" >
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< div class = "titletip" > 医师执业证 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-image-preview-group infinite >
< a-space >
< a-image v-for = "item in modalForm.user_doctor_info.license_cert" show-loader :src="item" / >
v - if = "(modalForm.user_doctor_info.license_cert && modalForm.user_doctor_info.license_cert.length>0) || modalSatus!='detail'" >
< a-col :span = "24" >
< div class = "titletip" > < span class = "arco-form-item-label-required-symbol" > * < / span > 医师执业证 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-form-item field = "license_cert" :hide-label = "true" :validate-trigger = "['change']" >
< a-image-preview-group infinite >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover" v -for = " item in modalForm.user_doctor_info.license_cert "
show - loader : src = "item" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="true" :fileList = "license_cert_list"
: dataType = "'license_cert_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" list-type="picture-card" @change="onChangeFile" accept = "image/*"
: file - list = "license_cert_list" @ before - upload = "beforeUpload" action = "/" : auto - upload = "false"
image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" style = "margin-top: 35px;"
v - if = "modalForm.user_doctor_info.qualification_cert && modalForm.user_doctor_info.qualification_cert.length>0" >
v - if = " ( modalForm.user_doctor_info.qualification_cert && modalForm.user_doctor_info.qualification_cert.length>0) || modalSatus!='detail' ">
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< div class = "titletip" > 医师资格证 < span > ( 点击图片查看大图 ) < / span > < / div >
< div class = "titletip" > < span class = "arco-form-item-label-required-symbol" > * < / span > 医师资格证 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-form-item field = "qualification_cert" label = "" :hide-label = "true" >
< a-image-preview-group infinite >
< a-space >
< a-image v-for = "item in modalForm.user_doctor_info.license_cert" show-loader :src="item" / >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover"
v - for = "item in modalForm.user_doctor_info.qualification_cert" show - loader : src = "item" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="true" :fileList = "qualification_cert_list"
: dataType = "'qualification_cert_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" list-type="picture-card" :auto-upload = "false"
@ change = "onChangeFile" accept = "image/*" : file - list = "qualification_cert_list"
@ before - upload = "beforeUpload" action = "/" image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" style = "margin-top: 35px;" v-if = "(modalForm.user_doctor_info.work_cert && modalForm.user_doctor_info.work_cert.length>0) || modalSatus!='detail'" >
< a-col :span = "24" >
< div class = "titletip" > < span class = "arco-form-item-label-required-symbol" > * < / span > 医师职称证 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-form-item field = "work_cert" label = "" :hide-label = "true" >
< a-image-preview-group infinite >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover" v -for = " item in modalForm.user_doctor_info.work_cert "
show - loader : src = "item" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="true" :fileList = "work_cert_list"
: dataType = "'work_cert_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" list-type="picture-card" :auto-upload = "false"
@ change = "onChangeFile" accept = "image/*" : file - list = "work_cert_list"
@ before - upload = "beforeUpload('avatar')" action = "/" image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" style = "margin-top: 35px;"
v - if = "modalForm.user_doctor_info.work_cert && modalForm.user_doctor_info.work_cert.length>0" >
v - if = "modalForm.user_doctor_info. id_card_front || modalSatus!='detail' ">
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< div class = "titletip" > 医师职称证 < span > ( 点击图片查看大图 ) < / span > < / div >
< div class = "titletip" > 医师身份证正面 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-form-item field = "id_card_front" label = "" no -style >
< a-image-preview-group infinite >
< a-space >
< a-image v-for = "item in modalForm.user_doctor_info.work_cert" show-loader :src="item" / >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover" show -loader
: src = "modalForm.user_doctor_info.id_card_front" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="false" :fileList = "id_card_front_list"
: dataType = "'id_card_front_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" :file-list="id_card_front_list" list -type = " picture -card "
action = "/" : auto - upload = "false" image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" style = "margin-top: 35px;"
v - if = "modalForm.user_doctor_info.id_card_front || modalForm.user_doctor_info.id_card_back " >
v - if = "modalForm.user_doctor_info.id_card_ back || modalSatus!='detail' ">
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< div class = "titletip" > 医师身份证 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-form-item field = " id_card_back " label = "" no -style >
< div class = "titletip" > 医师身份证 反面 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-image-preview-group infinite >
< a-space >
< a-image
v - for = "item in [modalForm.user_doctor_info.id_card_front,modalForm.user_doctor_info.id_card_back]"
show - loader : src = "item" v - show = "item" / >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover" show -loader
: src = "modalForm.user_doctor_info.id_card_back" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="false" :fileList = "id_card_back_list"
: dataType = "'id_card_back_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" :file-list="id_card_back_list" list-type="picture-card" action = "/"
: auto - upload = "false" image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
< a-row :gutter = "24" style = "margin-top: 35px;" v-if = "modalForm.user_doctor_info.sign_image" >
< a-row :gutter = "24" style = "margin-top: 35px;"
v - if = "modalForm.user_doctor_info.sign_image || modalSatus!='detail'" >
< a-col :span = "24" >
< a-form-item field = " " label = "" no -style >
< a-form-item field = " sign_image " label = "" no -style >
< div class = "titletip" > 医师手写签名 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-image-preview-group infinite >
< a-space >
< a-image v-for = "item in [modalForm.user_doctor_info.sign_image]" show -loader :src = "item"
v - show = "item" / >
< a-image-preview-group infinite >
< a-space v-show = "modalSatus=='detail'" >
< a-image width = "120" height = "120" fit = "cover" show -loader
: src = "modalForm.user_doctor_info.sign_image" / >
< / a-space >
< / a-image-preview-group >
< upload v-show = "modalSatus!='detail'" :isMultiple="false" :fileList = "sign_image_list"
: dataType = "'sign_image_list'" @ changeData = "changeData" > < / upload >
<!-- < a-upload v-show = "modalSatus!='detail'" :file-list="sign_image_list" list-type="picture-card" action = "/"
: auto - upload = "false" image - preview / > -- >
< / a-form-item >
< / a-col >
< / a-row >
<!-- < a-row :gutter = "24" style = "margin-top: 35px;" >
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< div class = "titletip" > 医师云证书 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-image-preview-group infinite >
< a-space >
< a-image show -loader src = "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width = "200" / >
< a-image show -loader src = "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width = "200" / >
< a-image show -loader src = "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width = "200" / >
< a-image show -loader src = "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width = "200" / >
< / a-space >
< / a-image-preview-group >
< / a-form-item >
< / a-col >
< / a-row > -- >
< a-row :gutter = "24" style = "margin-top: 35px;" v-if = "modalForm.qr_code" >
< a-row :gutter = "24" style = "margin-top: 35px;" v-if = "modalForm.qr_code && modalSatus!='add'" >
< a-col :span = "24" >
< a-form-item field = " " label = "" no -style >
< a-form-item field = "qr_code" label = "" no -style >
< div class = "titletip" > 医师二维码 < span > ( 点击图片查看大图 ) < / span > < / div >
< a-image-preview-group infinite >
< a-space >
< a-image v-for = "item in [modalForm.qr_code]" show-loader :src="item" v-show="item" width="200" / >
< a-image width = "120" height = "120" fit = "cover" show -loader :src = "modalForm.qr_code" / >
< / a-space >
< / a-image-preview-group >
< / a-form-item >
< / a-col >
< / a-row >
< a-divider / >
< a-divider v-show = "modalSatus!='detail'" / >
< / a-form >
< div class = "titlebox" >
< div class = "titlebox" v-if = "modalSatus!='detail'" >
< div class = "bar" > < / div >
< div class = "name" > 操作 < / div >
< / div >
< a-row :gutter = "24" style = "margin-top: 35px;" >
< a-row :gutter = "24" style = "margin-top: 35px;" v-if = "modalSatus!='detail'" >
< a-col :span = "24" >
< a-form-item field = "" label = "" no -style >
< a-space >
< a-button type = "primary" status = "success" v-if = "modalSatus=='detail'" > 启用 < / a -button >
< a-button type = "primary" status = "danger" v-if = "modalSatus=='detail'" > 禁用 < / a -button >
< a-button type = "primary" v-if = "modalSatus=='edit'" > 保存 < / a -button >
< a-space v-if = "modalSatus!='detail'" style="margin-right: 8px;" >
< a-button type = "primary" @click ="handleSubmit" > 保存 < / a -button >
< / a-space >
<!-- < a-space v-if = "modalSatus=='detail'" >
< a-button type = "primary" status = "success" > 启用 < / a-button >
< a-button type = "primary" status = "danger" > 禁用 < / a-button >
< / a-space > -- >
< a-space v-if = "modalSatus=='edit'" >
< a-button type = "primary" @click ="handleSubmit" > 保存 < / a -button >
< a-button type = "primary" status = "warning" > 拉黑 < / a-button >
< a-button type = "primary" status = "danger" v-if = "modalSatus=='edit'" > 删除 < / a -button >
< a-button type = "primary" status = "danger" > 删除 < / a-button >
< / a-space >
< / a-form-item >
< / a-col >
@ -377,8 +459,9 @@
< script setup >
import { reactive , ref , getCurrentInstance , onMounted , nextTick , watch , computed } from 'vue' ;
import { getDoctorList , addDoctor , removeDoctor , updateDoctor , getDoctorDetail , departmentList , decryptCard , hospitalList } from '@/api/doctor/list' ;
import { getDoctorList , addDoctor , removeDoctor , updateDoctor , getDoctorDetail , departmentList , decryptCard , hospitalList , expertiseList } from '@/api/doctor/list' ;
import { ossSign , ossUpload } from '@/api/oss' ;
import dayjs from 'dayjs'
/ / A k i r a k a 2 0 2 3 0 2 1 0 删 除 数 据
const deleteData = ref ( [ ] )
/ / A k i r a k a 2 0 2 3 0 2 1 0 删 除 对 话 框
@ -389,7 +472,7 @@
getDoctorInfo ( pager ) ;
}
} ) ;
const file = ref ( ) ;
const { proxy } = getCurrentInstance ( ) ;
@ -406,30 +489,243 @@
} ) ;
const modalForm = reactive ( {
hospital : { } ,
user _doctor _info : { } ,
user _doctor _info : {
} ,
user : { } ,
doctor _id : '' ,
license _cert : [ ] ,
qualification _cert : [ ] ,
work _cert : [ ] ,
department _custom _name : '' ,
user _id : '' ,
status : 1 ,
id _card _front : '' ,
id _card _back : '' ,
sign _image : '' ,
card _num : null ,
cur _doctor _expertise : [ ] ,
avatar : 'https://img.applets.igandanyiyuan.com/basic/file/doctor_avatar.png'
} ) ;
/ / c o n s t d o c t o r _ e x p e r t i s e = r e f ( [ ] ) ;
/ / 证 书 计 算
const transArr = ( arr ) => {
let newArr = [ ] ;
if ( arr instanceof Array ) {
arr . forEach ( ( item ) => {
newArr . push ( { url : item } )
} ) ;
} else if ( typeof arr == "string" ) {
newArr . push ( { url : arr } )
}
return newArr
} ;
const changeData = ( value ) => {
switch ( value . type ) {
case 'license_cert_list' :
if ( value . dealType == "add" ) {
license _cert _list . value . push ( {
url : value . url
} )
} else {
license _cert _list . value . splice ( license _cert _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
break ;
case 'qualification_cert_list' :
if ( value . dealType == "add" ) {
qualification _cert _list . value . push ( {
url : value . url
} )
} else {
qualification _cert _list . value . splice ( qualification _cert _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
break ;
case 'work_cert_list' :
if ( value . dealType == "add" ) {
work _cert _list . value . push ( {
url : value . url
} )
} else {
work _cert _list . value . splice ( work _cert _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
break ;
case 'id_card_front_list' :
if ( value . dealType == "add" ) {
id _card _front _list . value . push ( {
url : value . url
} )
} else {
id _card _front _list . value . splice ( id _card _front _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
break ;
case 'id_card_back_list' :
if ( value . dealType == "add" ) {
id _card _back _list . value . push ( {
url : value . url
} )
} else {
id _card _back _list . value . splice ( id _card _back _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
break ;
case 'sign_image_list' :
if ( value . dealType == "add" ) {
sign _image _list . value . push ( {
url : value . url
} )
} else {
sign _image _list . value . splice ( sign _image _list . value . findIndex ( item => item . url === value . url ) , 1 )
}
}
/ / c o n s o l e . l o g ( v a l u e ) ;
/ / c o n s o l e . l o g ( [ ` $ { v a l u e . t y p e } . v a l u e ` ] ) ;
/ / [ v a l u e . t y p e ] . v a l u e = [ v a l u e . t y p e ] . v a l u e . c o n c a t ( [ { u r l : v a l u e . u r l } ] ) ;
}
/ /
const license _cert _list = ref ( [ ] ) ;
const qualification _cert _list = ref ( [ ] ) ;
const work _cert _list = ref ( [ ] ) ;
const id _card _front _list = ref ( [ ] ) ;
const id _card _back _list = ref ( [ ] ) ;
const sign _image _list = ref ( [ ] ) ;
watch ( ( ) => modalForm . user _id , ( value ) => {
if ( value ) {
handelDecryptCard ( value ) ;
}
} ) ;
const doctor _title _name = computed ( ( ) => {
let obj = { 1 : '主任医师' , 2 : '主任中医师' , 3 : '副主任医师' , 4 : '副主任中医师' , 5 : '主治医师' , 6 : '住院医师' } ;
return obj [ modalForm . doctor _title ]
watch ( ( ) => license _cert _list . value , ( value ) => {
let arr = [ ]
value . forEach ( ( item ) => {
arr . push ( item . url )
} ) ;
modalForm . license _cert = arr ;
} , { deep : true } ) ;
watch ( ( ) => qualification _cert _list . value , ( value ) => {
let arr = [ ]
value . forEach ( ( item ) => {
arr . push ( item . url )
} ) ;
modalForm . qualification _cert = arr ;
} , { deep : true } ) ;
} )
watch ( ( ) => work _cert _list . value , ( value ) => {
let arr = [ ]
value . forEach ( ( item ) => {
arr . push ( item . url )
} ) ;
modalForm . work _cert = arr ;
} , { deep : true } ) ;
watch ( ( ) => id _card _front _list . value , ( value ) => {
if ( value . length > 0 ) {
modalForm . id _card _front = value [ 0 ] . url ;
} else {
modalForm . id _card _front = ''
}
} , { deep : true } ) ;
watch ( ( ) => id _card _back _list . value , ( value ) => {
value . length > 0 ? modalForm . id _card _back = value [ 0 ] . url : modalForm . id _card _back = ''
} , { deep : true } ) ;
watch ( ( ) => sign _image _list . value , ( value ) => {
if ( value . length > 0 ) {
modalForm . sign _image = value [ 0 ] . url ;
} else {
modalForm . sign _image = ''
}
} , { deep : true } ) ;
/ / R u l e s
const rules = {
user _name : [ { required : true , message : '请输入医生名字' } ]
avatar : [ { required : true , message : '请上传医生头像' } ] ,
user _name : [
{ required : true , message : '请输入医生名字' } ,
{
validator : ( value , cb ) => {
let reg = /^([\u4e00-\u9fa5\·]{2,10})$/ ;
if ( ! reg . test ( value ) ) {
cb ( '姓名要求在2-10个汉字' ) ;
}
}
} ] ,
card _num : [
{ required : true , message : '请输入身份证号' } ,
{
validator : ( value , cb ) => {
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ ;
if ( ! reg . test ( value ) ) {
cb ( '身份证号码格式不正确' ) ;
}
}
}
] ,
'user.mobile' : [
{ required : true , message : '请输入手机号' } ,
{
validator : ( value , cb ) => {
let reg = /^1[3456789]\d{9}$/ ;
if ( ! reg . test ( value ) ) {
cb ( '手机号码格式不正确' ) ;
}
}
} ] ,
'hospital.address' : [ { required : true , message : '请输入医院地址' } ] ,
'hospital.hospital_name' : [ { required : true , message : '请选择医院名称' } ] ,
department _custom _id : [ { required : true , message : '请选择所在科室' } ] ,
department _custom _name : [ { required : true , message : '请输入科室名称' } ] ,
doctor _title : [ { required : true , message : '请选择职称' } ] ,
'user_doctor_info.qualification_cert_num' : [ { required : true , message : '请输入资格证编码' } ] ,
cur _doctor _expertise : [ { type : 'array' , minLength : 1 , required : true , message : '请选择专长' } ] ,
be _good _at : [ { required : true , message : '请输入擅长内容' , maxLength : 1000 , minLength : 2 } ] ,
brief _introduction : [ { required : true , message : '请输入简介' , maxLength : 1000 , minLength : 2 } ] ,
/ / l i c e n s e _ c e r t : [
/ / {
/ / v a l i d a t o r : ( v a l u e , c b ) = > {
/ / i f ( l i c e n s e _ c e r t _ l i s t . v a l u e . l e n g t h = = 0 ) {
/ / c b ( " 请 上 传 医 师 执 业 证 " )
/ / }
/ / }
/ / } ] ,
/ / q u a l i f i c a t i o n _ c e r t : [ { t y p e : ' a r r a y ' , r e q u i r e d : t r u e , m e s s a g e : ' 请 上 传 医 师 资 格 证 ' } ] ,
/ / w o r k _ c e r t : [ { t y p e : ' a r r a y ' , r e q u i r e d : t r u e , m e s s a g e : ' 请 上 传 医 师 职 称 证 ' } ] ,
/ / i s _ p l a t f o r m _ d e e p _ c o o p e r a t i o n : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 是 否 是 平 台 深 度 合 作 ' } ] ,
/ / i s _ p l a t f o r m _ d e e p _ c o o p e r a t i o n : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 是 否 是 平 台 深 度 合 作 ' } ] ,
/ / i s _ r e c o m m e n d
} ;
/ / M o d a l
const modalVisible = ref ( false ) ;
const modalTitle = ref ( '默认标题' ) ;
/ / l e t o b j = { 1 : ' 主 任 医 师 ' , 2 : ' 主 任 中 医 师 ' , 3 : ' 副 主 任 医 师 ' , 4 : ' 副 主 任 中 医 师 ' , 5 : ' 主 治 医 师 ' , 6 : ' 住 院 医 师 ' } ;
const doctor _title _data = [
{
doctor _title : 1 ,
doctor _title _name : '主任医师'
} ,
{
doctor _title : 2 ,
doctor _title _name : '主任中医师'
} ,
{
doctor _title : 3 ,
doctor _title _name : '副主任医师'
} ,
{
doctor _title : 4 ,
doctor _title _name : '副主任中医师'
} ,
{
doctor _title : 5 ,
doctor _title _name : '主任医师'
} ,
{
doctor _title : 6 ,
doctor _title _name : '住院医师'
}
]
/ / B a t c h D e l L i s t
let batchList = [ ] ;
@ -454,21 +750,41 @@
const tableData = ref ( [ ] ) ;
/ / 弹 框 状 态
const modalSatus = ref ( 'add' ) ;
/ / 改 变 科 室
const changeSelect = ( value ) => {
let arr = departmentData . value . filter ( ( item ) => {
return item . department _custom _id == value
} )
modalForm . department _custom _name = arr [ 0 ] . department _custom _name
}
/ / 新 增 S a t u s
const handleAdd = ( ) => {
modalVisible . value = true ;
modalTitle . value = '新增医生' ;
modalSatus . value = 'add' ;
modalForm . doctor _id = null ;
modalForm . hospital = { } ;
modalForm . user = { } ;
/ / $ r e f s . m o d a l F o r m R e f . r e s e t F i e l d s ( ) ;
} ;
/ / 详 情
const handleDetail = async ( record ) => {
modalVisible . value = true ;
modalTitle . value = '医生详情' ;
modalSatus . value = 'detail' ;
const { code , data , message } = await getDoctorDetail ( record . doctor _id ) ;
if ( code == 200 ) {
Object . assign ( modalForm , data ) ;
if ( data . doctor _expertise && data . doctor _expertise . length > 0 ) {
let arr = [ ] ;
data . doctor _expertise . forEach ( ( item ) => {
arr . push ( item . expertise _id )
} )
modalForm . cur _doctor _expertise = arr ;
}
} else {
proxy . $notification . error ( message ) ;
}
@ -481,6 +797,21 @@
const { code , data , message } = await getDoctorDetail ( record . doctor _id ) ;
if ( code == 200 ) {
Object . assign ( modalForm , data ) ;
let { license _cert , qualification _cert , work _cert , id _card _front , id _card _back , sign _image } = data . user _doctor _info ;
license _cert _list . value = transArr ( license _cert ) ;
qualification _cert _list . value = transArr ( qualification _cert ) ;
work _cert _list . value = transArr ( work _cert ) ;
id _card _front _list . value = transArr ( id _card _front ) ;
id _card _back _list . value = transArr ( id _card _back ) ;
sign _image _list . value = transArr ( sign _image ) ;
if ( data . doctor _expertise && data . doctor _expertise . length > 0 ) {
let arr = [ ] ;
data . doctor _expertise . forEach ( ( item ) => {
arr . push ( item . expertise _id )
} )
modalForm . cur _doctor _expertise = arr ;
}
} else {
proxy . $notification . error ( message ) ;
}
@ -518,26 +849,53 @@
proxy . $refs . modalFormRef . validate ( async ( valid ) => {
if ( ! valid ) {
let res ;
/ / a l e r t ( m o d a l F o r m . i d _ c a r d _ f r o n t ) ;
let modalData = {
card _name : modalForm . user _name ,
mobile : modalForm . user . mobile ,
mobile : modalForm . user . mobile ,
is _recommend : modalForm . is _recommend ,
avatar : modalForm . avatar ,
doctor _title : modalForm . doctor _title ,
department _custom _id : modalForm . department _custom _id ,
department _custom _name : modalForm . department _custom _name ,
department _custom _mobile : modalForm . department _custom _mobile ,
hospital _id : modalForm . hospital _id ,
be _good _at : modalForm . be _good _at ,
brief _introduction : modalForm . brief _introduction ,
license _cert : modalForm . license _cert ,
qualification _cert : modalForm . qualification _cert ,
work _cert : modalForm . work _cert ,
qualification _cert _num : modalForm . user _doctor _info . qualification _cert _num ,
id _card _front : modalForm . id _card _front ,
id _card _back : modalForm . id _card _back ,
sign _image : modalForm . sign _image ,
card _num : modalForm . card _num ,
doctor _expertise : modalForm . cur _doctor _expertise ,
is _platform _deep _cooperation : modalForm . is _platform _deep _cooperation ,
is _sys _diagno _cooperation : modalForm . is _sys _diagno _cooperation
}
if ( ! modalForm . doctor _id ) {
const { code , message } = await addDoctor ( modalForm ) ;
const { code , message } = await addDoctor ( modal Data ) ;
if ( code == 200 ) {
proxy . $notification . success ( '新增成功' ) ;
} else {
proxy . $notification . error ( message ) ;
}
} else {
const { code , message } = await updateDoctor ( modalForm , modalForm . doctor _id ) ;
const { code , message } = await updateDoctor ( modal Data , modalForm . doctor _id ) ;
if ( code == 200 ) {
proxy . $notification . success ( '更新成功' ) ;
} else {
proxy . $notification . error ( message ) ;
}
}
done ( ) ;
/ / d o n e ( ) ;
getDoctorInfo ( pager ) ;
} else {
console . log ( valid )
proxy . $message . error ( '表单校验失败' ) ;
done ( false ) ;
/ / d o n e ( f a l s e ) ;
}
} ) ;
} ;
@ -606,34 +964,54 @@
const departmentData = ref ( [ ] ) ;
/ / 获 取 科 室 列 表
const getDepartmentList = ( ) => {
const { data , code , message } = departmentList ( ) ;
if ( code == 200 ) {
departmentData . value = data ;
} else {
proxy . $notification . error ( message ) ;
}
} ;
departmentList ( ) . then ( ( res ) => {
const { data , code , message } = res ;
if ( code == 200 ) {
departmentData . value = data ;
} else {
proxy . $notification . error ( message ) ;
} ;
} ) ;
}
/ / 切 换 小 眼 睛
const showEye = ref ( false ) ;
const id _card _num = ref ( '' ) ;
/ / 解 密 身 份 证 号 码
const handelDecryptCard = ( ) => {
const { data , code , message } = decryptCard ( ) ;
const handelDecryptCard = async ( user _id ) => {
const { data , code , message } = await decryptCard ( {
user _id
} ) ;
if ( code == 200 ) {
id _card _num . value = data ;
} else {
proxy . $notification . error ( message ) ;
}
} ;
const hospitalData = ref ( [ ] ) ;
/ / 获 取 医 院 列 表
const handleHospitalList = ( ) => {
const { data , code , message } = hospitalList ( ) ;
if ( code == 200 ) {
/ / i d _ c a r d _ n u m . v a l u e = d a t a ;
} else {
proxy . $notification . error ( message ) ;
}
hospitalList ( ) . then ( ( res ) => {
const { data , code , message } = res ;
if ( code == 200 ) {
hospitalData . value = data ;
} else {
proxy . $notification . error ( message ) ;
}
} ) ;
}
const expertiseData = ref ( [ ] ) ;
/ / 获 取 专 长 列 表
const handlExpertiseList = ( ) => {
expertiseList ( ) . then ( ( res ) => {
const { data , code , message } = res ;
if ( code == 200 ) {
expertiseData . value = data ;
} else {
proxy . $notification . error ( message ) ;
}
} )
}
/ / 重 置 搜 索
const handleResetQuery = ( ) => {
proxy . $refs . queryFormRef . resetFields ( ) ;
@ -649,22 +1027,28 @@
let { access _id , dir , policy , signature , host } = data ;
/ / l e t i n d e x = F i l e . l a s t I n d e x O f ( " / " ) ;
let filename = File . name ;
let time = dayjs ( ) . format ( "YYYYMMDDHHmmss" )
let formData = new FormData ( ) ;
formData . append ( 'OSSAccessKeyId' , access _id ) ;
formData . append ( 'OSSAccessKeyId' , access _id ) ;
formData . append ( 'policy' , policy ) ;
formData . append ( 'signature' , signature ) ;
formData . append ( 'key' , dir + filename ) ;
formData . append ( 'file' , File , filename ) ;
ossUpload ( host , formData ) . then ( ( res ) => {
console . log ( res ) ;
formData . append ( 'key' , dir + time + filename ) ;
formData . append ( 'file' , File , filename ) ;
ossUpload ( host , formData ) . then ( ( res ) => {
modalForm . avatar = host + "/" + dir + time + filename ;
/ / i f ( r e s . c o d e = = 2 0 4 ) {
/ / a l e r t ( ' 2 2 ' )
/ / m o d a l F o r m . a v a t a r = h o s t + d i r + t i m e + f i l e n a m e
/ / }
} ) ;
} else {
proxy . $notification . error ( message ) ;
}
}
/ / 上 传 前 验 证
const beforeUpload = ( file ) => {
const beforeUpload = ( file , type ) => {
return new Promise ( ( resolve , reject ) => {
if ( file . size >= 10 * 1024 * 1024 ) {
proxy . $notification . error ( "图片大小不能超过10M" ) ;
@ -676,14 +1060,14 @@
} ;
/ / 上 传 文 件
const onChangeFile = ( fileList ) => {
console . log ( fileList )
getOssSign ( 1 , fileList [ 0 ] . file ) ;
}
onMounted ( ( ) => {
getDoctorInfo ( pager ) ;
handleHospitalList ( ) ;
getDepartmentList ( ) ;
handlExpertiseList ( ) ;
} ) ;
< / script >
@ -704,7 +1088,8 @@
border - radius : 50 % ;
}
. arco - form - item - layout - horizontal : first - child {
. arco - form - item - layout - horizontal : first - child ,
. arco - form - item - layout - horizontal : nth - child ( 2 ) {
align - items : center ;
}
@ -722,4 +1107,7 @@
display : flex ;
align - items : center ;
}
. cert . arco - form - item - label - col {
flex : 0 0 8 px ! important ;
}
< / style >