diff --git a/src/api/basic/pharmacy.js b/src/api/basic/pharmacy.js new file mode 100644 index 0000000..df2283a --- /dev/null +++ b/src/api/basic/pharmacy.js @@ -0,0 +1,160 @@ +import request from '@/utils/request'; + +/** + * 获取药房分页列表 + * @param {Object} data - 查询参数及分页参数 + * @returns {Promise} + */ +export function getPharmacyPage(data) { + return request({ + url: '/admin/basic/pharmacy/page', + method: 'post', + data, + }); +} + +/** + * 获取药房列表(下拉选择框) + * @param {Object} params - 过滤条件 + * @returns {Promise} + */ +export function getPharmacyList(params) { + return request({ + url: '/admin/basic/pharmacy/list', + method: 'get', + params, + }); +} + +/** + * 获取药房详情 + * @param {String} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function getPharmacyDetail(pharmacy_id) { + return request({ + url: `/admin/basic/pharmacy/${pharmacy_id}`, + method: 'get', + }); +} + +/** + * 新增药房 + * @param {Object} data - 药房实体参数 + * @returns {Promise} + */ +export function addPharmacy(data) { + return request({ + url: '/admin/basic/pharmacy', + method: 'post', + data, + }); +} + +/** + * 修改药房 + * @param {String} pharmacy_id - 药房 ID + * @param {Object} data - 药房实体参数 + * @returns {Promise} + */ +export function updatePharmacy(pharmacy_id, data) { + return request({ + url: `/admin/basic/pharmacy/${pharmacy_id}`, + method: 'put', + data, + }); +} + +/** + * 切换药房状态(快捷开关) + * @param {String} pharmacy_id - 药房 ID + * @param {Number} status - 0: 禁用, 1: 正常 + * @returns {Promise} + */ +export function updatePharmacyStatus(pharmacy_id, status) { + return request({ + url: `/admin/basic/pharmacy/status/${pharmacy_id}`, + method: 'put', + data: { status }, + }); +} + +/** + * 删除药房(软删除) + * @param {String} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function deletePharmacy(pharmacy_id) { + return request({ + url: `/admin/basic/pharmacy/${pharmacy_id}`, + method: 'delete', + }); +} + +/** + * 获取药房绑定的医生列表-分页 + * @param {Object} data - { pharmacy_id: string, page?: number, page_size?: number, doctor_name?: string, mobile?: string } + * @returns {Promise} + */ +export function getPharmacyDoctorPage(data) { + return request({ + url: '/admin/basic/pharmacy/doctor/page', + method: 'post', + data, + }); +} + +/** + * 获取药房绑定的医生列表(全部/不分页) + * @param {String} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function getPharmacyDoctorList(pharmacy_id) { + return request({ + url: `/admin/basic/pharmacy/doctor/${pharmacy_id}`, + method: 'get', + }); +} + +/** + * 导出药房关联医生列表 + * @param {Object} data - 请求参数 + * @param {1|2|3} data.type - 1:当前筛选导出, 2:选中的数据导出, 3:全部导出 + * @param {string} [data.pharmacy_id] - 药房 ID + * @param {string} [data.doctor_name] - 医生姓名 + * @param {string} [data.mobile] - 医生手机号 + * @param {string} [data.id] - 选中的数据 ID,多条用英文逗号分隔 + * @returns {Promise} + */ +export function exportPharmacyDoctor(data) { + return request({ + url: '/admin/export/pharmacy/doctor', + method: 'post', + data, + }); +} + +/** + * 获取药房下线受影响医生列表(预检接口) + * @param {String|Number} pharmacy_id - 药房 ID + * @returns {Promise} + */ +export function getAffectedDoctors(pharmacy_id) { + return request({ + url: `/admin/pharmacy/affected-doctors/${pharmacy_id}`, + method: 'get', + }); +} + +/** + * 批量迁移默认药房并执行下线操作 + * @param {Object} data - { source_pharmacy_id, action: 'disable'|'delete', unbind_source: 1|0, transfers: Array<{ doctor_id, target_pharmacy_id }> } + * @returns {Promise} + */ +export function batchTransferAndAction(data) { + return request({ + url: '/admin/pharmacy/batch-transfer-and-action', + method: 'post', + data, + }); +} diff --git a/src/api/doctor/pharmacy.js b/src/api/doctor/pharmacy.js new file mode 100644 index 0000000..7e14d14 --- /dev/null +++ b/src/api/doctor/pharmacy.js @@ -0,0 +1,90 @@ +import request from '@/utils/request'; + +/** + * 1. 获取医生绑定的药房列表 + * @param {String} doctor_id - 医生 ID + * @returns {Promise} + */ +export function getDoctorPharmacyList(doctor_id) { + return request({ + url: `/admin/doctor/pharmacy/${doctor_id}`, + 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/pharmacy/${doctor_id}`, + method: 'put', + data, + }); +} + +/** + * 3. 为医生新增单个药房绑定 + * @param {Object} data - { doctor_id: string, pharmacy_id: string, is_default?: number } + * @returns {Promise} + */ +export function addDoctorPharmacy(data) { + return request({ + url: '/admin/doctor/pharmacy', + method: 'post', + data, + }); +} + +/** + * 4. 解除单个药房绑定 (DELETE 方式,传入绑定记录 ID) + * @param {String} doctor_pharmacy_id - 绑定记录 ID + * @returns {Promise} + */ +export function removeDoctorPharmacy(doctor_pharmacy_id) { + return request({ + url: `/admin/doctor/pharmacy/${doctor_pharmacy_id}`, + method: 'delete', + }); +} + +/** + * 4.1 快捷解除绑定 (POST 方式,Body 传参) + * @param {Object} data - { doctor_pharmacy_id?: string, doctor_id?: string, pharmacy_id?: string } + * @returns {Promise} + */ +export function unbindDoctorPharmacy(data) { + return request({ + url: '/admin/doctor/pharmacy/unbind', + method: 'post', + data, + }); +} + +/** + * 5. 设为医生的默认药房 (PUT 方式,传入绑定记录 ID) + * @param {String} doctor_pharmacy_id - 绑定记录 ID + * @returns {Promise} + */ +export function setDefaultDoctorPharmacy(doctor_pharmacy_id) { + return request({ + url: `/admin/doctor/pharmacy/default/${doctor_pharmacy_id}`, + method: 'put', + }); +} + +/** + * 5.1 快捷设为默认药房 (PUT 方式,Body 传参) + * @param {Object} data - { doctor_pharmacy_id?: string, doctor_id?: string, pharmacy_id?: string } + * @returns {Promise} + */ +export function setDefaultDoctorPharmacyByBody(data) { + return request({ + url: '/admin/doctor/pharmacy/default', + method: 'put', + data, + }); +} 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/components/medinceDetailModal.vue b/src/components/medinceDetailModal.vue index d40ed62..95e1096 100644 --- a/src/components/medinceDetailModal.vue +++ b/src/components/medinceDetailModal.vue @@ -51,24 +51,35 @@ - - {{modalForm.product_pharmacy_code -}} + + {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} + + ({{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code }}) + + + {{ modalForm.product_pharmacy_code || modalForm.pharmacy?.product_pharmacy_code || '-' }} + + + + + + + {{ modalForm.pharmacy_code || '-' }} + + + -
{{modalForm.product_platform_code -}}
+
{{ modalForm.product_platform_code || '-' }}
- - {{modalForm.created_at -}} + {{ modalForm.created_at || '-' }} diff --git a/src/components/medinceModal.vue b/src/components/medinceModal.vue index 96cf513..c0c1371 100644 --- a/src/components/medinceModal.vue +++ b/src/components/medinceModal.vue @@ -80,6 +80,37 @@ +
+
+
发货药房信息
+
+ + + +
+ {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} +
+
+
+ + +
{{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code || '-' }}
+
+
+
+ + + +
{{ modalForm.pharmacy?.telephone || '-' }}
+
+
+ + +
{{ modalForm.pharmacy?.full_address || modalForm.pharmacy?.address || '-' }}
+
+
+
+
退款信息
diff --git a/src/components/medinceOrderModal.vue b/src/components/medinceOrderModal.vue index 05e9b5f..469aa5f 100644 --- a/src/components/medinceOrderModal.vue +++ b/src/components/medinceOrderModal.vue @@ -91,6 +91,37 @@ +
+
+
发货药房信息
+
+ + + +
+ {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} +
+
+
+ + +
{{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code || '-' }}
+
+
+
+ + + +
{{ modalForm.pharmacy?.telephone || '-' }}
+
+
+ + +
{{ modalForm.pharmacy?.full_address || modalForm.pharmacy?.address || '-' }}
+
+
+
+
退款信息
diff --git a/src/components/prescriptionModal.vue b/src/components/prescriptionModal.vue index 65903ed..51b98a9 100644 --- a/src/components/prescriptionModal.vue +++ b/src/components/prescriptionModal.vue @@ -67,14 +67,45 @@ - - - -
{{ modalForm.doctor_advice }}
-
-
-
- + + + +
{{ modalForm.doctor_advice }}
+
+
+
+ +
+
+
药房信息
+
+ + + +
+ {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} +
+
+
+ + +
{{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code || '-' }}
+
+
+
+ + + +
{{ modalForm.pharmacy?.telephone || '-' }}
+
+
+ + +
{{ modalForm.pharmacy?.full_address || modalForm.pharmacy?.address || '-' }}
+
+
+
+
医生信息
diff --git a/src/components/prescriptionModalTransfer.vue b/src/components/prescriptionModalTransfer.vue index 22bf809..01e523f 100644 --- a/src/components/prescriptionModalTransfer.vue +++ b/src/components/prescriptionModalTransfer.vue @@ -67,14 +67,45 @@ - - - -
{{ modalForm.doctor_advice }}
-
-
-
- + + + +
{{ modalForm.doctor_advice }}
+
+
+
+ +
+
+
药房信息
+
+ + + +
+ {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} +
+
+
+ + +
{{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code || '-' }}
+
+
+
+ + + +
{{ modalForm.pharmacy?.telephone || '-' }}
+
+
+ + +
{{ modalForm.pharmacy?.full_address || modalForm.pharmacy?.address || '-' }}
+
+
+
+
医生信息
diff --git a/src/components/sysmedinceDetailModal.vue b/src/components/sysmedinceDetailModal.vue index ce77417..63911a8 100644 --- a/src/components/sysmedinceDetailModal.vue +++ b/src/components/sysmedinceDetailModal.vue @@ -13,20 +13,55 @@ - {{item.product_name+'('+item.product_platform_code+')' }} + :value="item.product_platform_id" :label="item.product_name + (item.pharmacy_name || item.pharmacy?.pharmacy_name ? ' [' + (item.pharmacy_name || item.pharmacy?.pharmacy_name) + ']' : '') + '(' + item.product_platform_code + ')'"> + {{ item.product_name }} + [{{ item.pharmacy_name || item.pharmacy?.pharmacy_name }}] + ({{ item.product_platform_code }}) + + + + + {{ item.pharmacy_name }} ({{ item.pharmacy_code }}) + + +
+ {{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }} + + ({{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code }}) + +
+
+
+ + {{modalForm.product_spec}} 选择药品后展示 - + + + {{modalForm.manufacturer}} + 选择药品后展示 + + @@ -44,33 +79,6 @@
- - - - - - - {{modalForm.manufacturer}} - 选择药品后展示 - - + +
+
+ +
+
+
+ {{ currentPharmacy?.pharmacy_name || '-' }} + + {{ currentPharmacy?.pharmacy_code || '-' }} + + + 运营中 + + + 已停用 + +
+
+ 基础邮费:¥{{ Number(currentPharmacy?.postage || 0).toFixed(2) }} + + 包邮门槛: + {{ Number(currentPharmacy?.free_shipping_threshold) > 0 ? `¥${Number(currentPharmacy.free_shipping_threshold).toFixed(2)}` : '不设门槛' }} + + + 支持自提:{{ currentPharmacy?.is_pickup === 1 ? '是' : '否' }} + + + 联系电话:{{ currentPharmacy?.telephone || '-' }} + +
+
+ 详细地址:{{ currentPharmacy?.full_address || currentPharmacy?.address || '-' }} +
+
+
+
+ + + + + + + + + + + + + + + + + + 搜索 + + + + 重置 + + + + + + +
+
+ 共找到 {{ pager.total }} 位关联医生 +
+
+ + + + 导出医生数据 + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/basic/pharmacy/components/pharmacyModal.vue b/src/views/basic/pharmacy/components/pharmacyModal.vue new file mode 100644 index 0000000..a884581 --- /dev/null +++ b/src/views/basic/pharmacy/components/pharmacyModal.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/src/views/basic/pharmacy/components/pharmacyTransferDrawer.vue b/src/views/basic/pharmacy/components/pharmacyTransferDrawer.vue new file mode 100644 index 0000000..e685aeb --- /dev/null +++ b/src/views/basic/pharmacy/components/pharmacyTransferDrawer.vue @@ -0,0 +1,407 @@ + + + + + diff --git a/src/views/basic/pharmacy/index.vue b/src/views/basic/pharmacy/index.vue new file mode 100644 index 0000000..c835988 --- /dev/null +++ b/src/views/basic/pharmacy/index.vue @@ -0,0 +1,620 @@ + + + + + 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..6377525 --- /dev/null +++ b/src/views/doctor/doctor-list/components/doctorPharmacyDrawer.vue @@ -0,0 +1,456 @@ + + + + + diff --git a/src/views/doctor/doctor-list/index.vue b/src/views/doctor/doctor-list/index.vue index 2ae055c..6a32b5f 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,25 @@ 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 () => { + if (pharmacyOptions.value.length > 0) return; + 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 +1167,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: 280 }, ]; // Table Data @@ -1115,6 +1184,7 @@ const changeSelect = (value) => { // 新增Satus const handleAdd = () => { + loadPharmacyOptions(); modalVisible.value = true; modalTitle.value = '新增医生'; modalSatus.value = 'add'; @@ -1135,6 +1205,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,10 +1270,18 @@ 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 = []; + } } }; // 修改 const handleUpdate = async (record) => { + loadPharmacyOptions(); modalVisible.value = true; modalTitle.value = '修改医生'; modalSatus.value = 'edit'; @@ -1266,6 +1346,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 +1473,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; @@ -1784,7 +1872,6 @@ onMounted(() => { handelAreaList("", "", 2); handleBankList(); - }); diff --git a/src/views/medince/platform-medince/index.vue b/src/views/medince/platform-medince/index.vue index 0693cba..bc25c60 100644 --- a/src/views/medince/platform-medince/index.vue +++ b/src/views/medince/platform-medince/index.vue @@ -5,8 +5,18 @@ - - + + + + {{ item.pharmacy_name }} + + + + + + + + @@ -47,6 +57,7 @@
{{(rowIndex+1)+(pager.page-1)*pager.page_size}}
+ + + @@ -146,9 +167,12 @@ diff --git a/src/views/prescription/transferPrescription-list/index.vue b/src/views/prescription/transferPrescription-list/index.vue index a6570d9..22c1dc7 100644 --- a/src/views/prescription/transferPrescription-list/index.vue +++ b/src/views/prescription/transferPrescription-list/index.vue @@ -44,6 +44,24 @@ 审核驳回
+ + + + {{ item.pharmacy_name }} + + + + @@ -146,10 +167,12 @@