From 92b059cbc0310336dc0b24fad7018eaf3c1bada0 Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Mon, 7 Sep 2026 14:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E7=BB=91=E5=AE=9A=E8=8D=AF?= =?UTF-8?q?=E6=88=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/doctor/pharmacy.js | 67 +++ src/components/doctorModal.vue | 42 +- .../components/doctorPharmacyDrawer.vue | 455 ++++++++++++++++++ src/views/doctor/doctor-list/index.vue | 91 +++- 4 files changed, 647 insertions(+), 8 deletions(-) create mode 100644 src/api/doctor/pharmacy.js create mode 100644 src/views/doctor/doctor-list/components/doctorPharmacyDrawer.vue diff --git a/src/api/doctor/pharmacy.js b/src/api/doctor/pharmacy.js new file mode 100644 index 0000000..0372cb6 --- /dev/null +++ b/src/api/doctor/pharmacy.js @@ -0,0 +1,67 @@ +import request from '@/utils/request'; + +/** + * 1. 获取医生绑定的药房列表 + * @param {String} doctor_id - 医生 ID + * @returns {Promise} + */ +export function getDoctorPharmacyList(doctor_id) { + return request({ + url: `/admin/doctor/${doctor_id}/pharmacy`, + method: 'get', + }); +} + +/** + * 2. 批量设置医生绑定的药房列表(全量覆盖) + * @param {String} doctor_id - 医生 ID + * @param {Object} data - { pharmacy_ids: string[], default_pharmacy_id?: string } + * @returns {Promise} + */ +export function setDoctorPharmacies(doctor_id, data) { + return request({ + url: `/admin/doctor/${doctor_id}/pharmacy`, + method: 'put', + data, + }); +} + +/** + * 3. 为医生新增单个药房绑定 + * @param {String} doctor_id - 医生 ID + * @param {Object} data - { pharmacy_id: string, is_default?: number } + * @returns {Promise} + */ +export function addDoctorPharmacy(doctor_id, data) { + return request({ + url: `/admin/doctor/${doctor_id}/pharmacy`, + method: 'post', + data, + }); +} + +/** + * 4. 解除单个药房绑定 + * @param {String} doctor_id - 医生 ID + * @param {String} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function removeDoctorPharmacy(doctor_id, pharmacy_id) { + return request({ + url: `/admin/doctor/${doctor_id}/pharmacy/${pharmacy_id}`, + method: 'delete', + }); +} + +/** + * 5. 设为医生的默认药房 + * @param {String} doctor_id - 医生 ID + * @param {String} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function setDefaultDoctorPharmacy(doctor_id, pharmacy_id) { + return request({ + url: `/admin/doctor/${doctor_id}/pharmacy/default/${pharmacy_id}`, + method: 'put', + }); +} diff --git a/src/components/doctorModal.vue b/src/components/doctorModal.vue index dea9b33..6ddc549 100644 --- a/src/components/doctorModal.vue +++ b/src/components/doctorModal.vue @@ -151,11 +151,37 @@ - -
-
-
是否推荐
-
+ +
+
+
绑定药房
+
+ + + +
+ + + + {{ item.pharmacy_name }} + (默认) + + + 暂未绑定任何药房 +
+
+
+
+ +
+
+
是否推荐
+
@@ -495,6 +521,7 @@ const modalForm = reactive({ cur_doctor_expertise: [], avatar: 'https://img.applets.igandanyiyuan.com/basic/file/doctor_avatar.png', bank_card_code: '', + doctor_pharmacy_list: [], }); const hospital_name = ref(''); watch(() => modalForm.hospital, () => { @@ -807,6 +834,11 @@ const modalForm = reactive({ } modalForm.cur_doctor_expertise = arr; } + if (data.doctor_pharmacy && Array.isArray(data.doctor_pharmacy)) { + modalForm.doctor_pharmacy_list = data.doctor_pharmacy; + } else { + modalForm.doctor_pharmacy_list = []; + } } }; const departmentData = ref([]); diff --git a/src/views/doctor/doctor-list/components/doctorPharmacyDrawer.vue b/src/views/doctor/doctor-list/components/doctorPharmacyDrawer.vue new file mode 100644 index 0000000..0b4b1d7 --- /dev/null +++ b/src/views/doctor/doctor-list/components/doctorPharmacyDrawer.vue @@ -0,0 +1,455 @@ + + + + + diff --git a/src/views/doctor/doctor-list/index.vue b/src/views/doctor/doctor-list/index.vue index 2ae055c..c7ee967 100644 --- a/src/views/doctor/doctor-list/index.vue +++ b/src/views/doctor/doctor-list/index.vue @@ -176,6 +176,8 @@ @click="handleDetail(record)">详情 修改 + 药房配置 @@ -345,6 +347,50 @@ +
+
+
绑定药房
+
+ + + + + + {{ item.pharmacy_name }} ({{ item.pharmacy_code }}) + + +
+ + + + {{ item.pharmacy_name }} + (默认) + + + 暂未绑定任何药房 +
+
+
+
+
是否推荐
@@ -694,6 +740,9 @@
确定申请CA证书?
修改职称或者执业证/资格证,需要先在【四川省互联网医疗服务监管平台】修改备案信息成功后,才可保存 (谨慎操作) 。
+ + +
@@ -701,6 +750,8 @@ import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'; import { getDoctorList, addDoctor, removeDoctor, updateDoctor, getDoctorDetail, departmentList, decryptCard, hospitalList, expertiseList, areaList, bankList, decryptBank, exportDoctor } from '@/api/doctor/list'; import { applyCA, updateCA, removeCA, updateSign, applySign } from '@/api/doctor/ca'; +import { getPharmacyList } from '@/api/basic/pharmacy'; +import DoctorPharmacyDrawer from './components/doctorPharmacyDrawer.vue'; import { ossSign, ossUpload } from '@/api/oss'; import { parseTime } from '@/utils/parseTime'; import { Message } from '@arco-design/web-vue'; @@ -772,7 +823,24 @@ const modalForm = reactive({ cur_doctor_expertise: [], avatar: 'https://img.applets.igandanyiyuan.com/basic/file/doctor_avatar.png', bank_card_code: '', + doctor_pharmacy: [], + doctor_pharmacy_list: [], }); +const pharmacyDrawerRef = ref(null); +const pharmacyOptions = ref([]); +const handleOpenPharmacyDrawer = (record) => { + pharmacyDrawerRef.value?.open(record); +}; +const loadPharmacyOptions = async () => { + try { + const res = await getPharmacyList({ status: 1 }); + if (res.code === 200 && res.data) { + pharmacyOptions.value = res.data; + } + } catch (e) { + console.error('加载药房选项失败:', e); + } +}; const hospital_name = ref(''); watch(() => modalForm.hospital, () => { if (modalForm.hospital && modalForm.hospital.hospital_name) { @@ -1098,7 +1166,7 @@ const columns = [ { title: '状态', dataIndex: 'status', slotName: 'status' }, // { title: '创建时间', dataIndex: 'created_at', slotName: 'created_at' }, - { title: '操作', slotName: 'action', fixed: "right", width: 180 }, + { title: '操作', slotName: 'action', fixed: "right", width: 260 }, ]; // Table Data @@ -1135,6 +1203,8 @@ const handleAdd = () => { modalForm.sign_image = ''; modalForm.doctor_bank_card = { } + modalForm.doctor_pharmacy = []; + modalForm.doctor_pharmacy_list = []; license_cert_list.value = []; qualification_cert_list.value = []; @@ -1198,6 +1268,13 @@ const handleDetail = async (record) => { } modalForm.cur_doctor_expertise = arr; } + if (data.doctor_pharmacy && Array.isArray(data.doctor_pharmacy)) { + modalForm.doctor_pharmacy_list = data.doctor_pharmacy; + modalForm.doctor_pharmacy = data.doctor_pharmacy.map((item) => String(item.pharmacy_id)); + } else { + modalForm.doctor_pharmacy_list = []; + modalForm.doctor_pharmacy = []; + } } }; // 修改 @@ -1266,6 +1343,13 @@ const handleUpdate = async (record) => { }) modalForm.cur_doctor_expertise = arr; } + if (data.doctor_pharmacy && Array.isArray(data.doctor_pharmacy)) { + modalForm.doctor_pharmacy_list = data.doctor_pharmacy; + modalForm.doctor_pharmacy = data.doctor_pharmacy.map((item) => String(item.pharmacy_id)); + } else { + modalForm.doctor_pharmacy_list = []; + modalForm.doctor_pharmacy = []; + } } //await nextTick(); @@ -1386,7 +1470,8 @@ const handleSubmit = (done) => { bank_card_province_id: modalForm.doctor_bank_card.province_id ? modalForm.doctor_bank_card.province_id : 0, bank_card_city_id: modalForm.doctor_bank_card.city_id ? modalForm.doctor_bank_card.city_id : 0, bank_card_county_id: modalForm.doctor_bank_card.county_id ? modalForm.doctor_bank_card.county_id : 0, - bank_id: modalForm.doctor_bank_card.bank_id + bank_id: modalForm.doctor_bank_card.bank_id, + doctor_pharmacy: modalForm.doctor_pharmacy || [] } if(modalForm.is_transfer_prescription == 1 || modalForm.is_transfer_prescription ==0) { modalData.is_transfer_prescription = modalForm.is_transfer_prescription; @@ -1783,7 +1868,7 @@ onMounted(() => { handlExpertiseList(); handelAreaList("", "", 2); handleBankList(); - + loadPharmacyOptions(); });