修改用户管理关联医生
This commit is contained in:
parent
04f7b9d561
commit
2b36705827
@ -15,14 +15,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="医生编码" prop="doctorID">
|
||||
<el-select v-model="formData.doctorID" placeholder="医生" clearable>
|
||||
<el-option
|
||||
v-for="item in doctorList"
|
||||
:key="item.doctorID"
|
||||
:label="item.doctorName"
|
||||
:value="item.doctorID"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input disabled v-model="formData.doctorID" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
@ -44,7 +37,20 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="医生名称" prop="doctorname">
|
||||
<el-input disabled v-model="formData.doctorname" />
|
||||
<el-select
|
||||
v-model="formData.doctorname"
|
||||
placeholder="医生"
|
||||
clearable
|
||||
@change="handleDoctorChange"
|
||||
@clear="handleClear"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in doctorList"
|
||||
:key="item.doctorName"
|
||||
:label="item.doctorName"
|
||||
:value="item.doctorName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -246,6 +252,21 @@ async function loadRelatedOptions(orgId) {
|
||||
// 加载医生
|
||||
doctorList.value = await UserApi.getDoctorList(orgId)
|
||||
}
|
||||
|
||||
|
||||
function handleDoctorChange(selectedDoctorName) {
|
||||
const selectedDoctor = doctorList.value.find((doctor) => doctor.doctorName === selectedDoctorName)
|
||||
if(selectedDoctor)
|
||||
{
|
||||
formData.value.doctorID = selectedDoctor.doctorID
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function handleClear() {
|
||||
|
||||
formData.value.doctorID=''
|
||||
}
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
@ -253,7 +274,7 @@ const submitForm = async () => {
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
formData.value.doctorname=selectedDoctorName.value
|
||||
// formData.value.doctorname=selectedDoctorName.value
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user