From 0b1b08c7d7042772b9134743d3b589385208380f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Mon, 18 May 2026 09:40:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=AF=B9=E8=B4=A6=E5=8D=95=E3=80=81?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E6=94=B9=E8=89=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse-admin-drug-search.vue | 44 +-- .../components/warehouse-drug-search/index.ts | 2 + .../warehouse-available-drug-search.vue | 343 ++++++++++++++++++ .../admin/api/index.ts | 10 + .../admin/components/modal.vue | 91 ++--- .../admin/config/form.ts | 20 - 6 files changed, 416 insertions(+), 94 deletions(-) create mode 100644 apps/web-antd/src/components/warehouse-drug-search/index.ts create mode 100644 apps/web-antd/src/components/warehouse-drug-search/warehouse-available-drug-search.vue diff --git a/apps/web-antd/src/components/form/components/warehouse-admin-drug-search.vue b/apps/web-antd/src/components/form/components/warehouse-admin-drug-search.vue index fe96fde4..134b2813 100644 --- a/apps/web-antd/src/components/form/components/warehouse-admin-drug-search.vue +++ b/apps/web-antd/src/components/form/components/warehouse-admin-drug-search.vue @@ -1,20 +1,31 @@ + + + + \ No newline at end of file diff --git a/apps/web-antd/src/views/business/warehouse-drug-management/admin/api/index.ts b/apps/web-antd/src/views/business/warehouse-drug-management/admin/api/index.ts index 0538b119..686e45b1 100644 --- a/apps/web-antd/src/views/business/warehouse-drug-management/admin/api/index.ts +++ b/apps/web-antd/src/views/business/warehouse-drug-management/admin/api/index.ts @@ -18,6 +18,16 @@ export async function getWarehouseDrugManagementOption(data: any) { return requestClient.get(`${prefix}option`, { params: data }); } +/** 搜索可加入总仓的药品(yii_drugstore_drug 中尚不存在) */ +export async function searchAvailableWarehouseDrugs(params: { + name: string; + type: number; +}) { + return requestClient.get(`${prefix}search-available-drugs`, { + params, + }); +} + /** 仓库筛选:商品类型(与后端 ProductTypeEnum 一致) */ export async function getWarehouseProductTypeOptions() { return requestClient.get<{ label: string; value: number }[]>( diff --git a/apps/web-antd/src/views/business/warehouse-drug-management/admin/components/modal.vue b/apps/web-antd/src/views/business/warehouse-drug-management/admin/components/modal.vue index 484f82b0..0b4bb395 100644 --- a/apps/web-antd/src/views/business/warehouse-drug-management/admin/components/modal.vue +++ b/apps/web-antd/src/views/business/warehouse-drug-management/admin/components/modal.vue @@ -11,43 +11,40 @@ import { createWarehouseDrugManagement, updateWarehouseDrugManagement, } from '../api'; -import { - modalFormProps, - warehouseAdminDrugIdApiSelectProps, -} from '../config/form'; +import { modalFormProps } from '../config/form'; import { getDrugUseList } from '#/views/doctor/doctor-reception/api'; const drugTime = ref([]); const drugType = ref([]); const drugUnit = ref([]); const drugFrequency = ref([]); -getDrugUseList().then((res) => { - drugTime.value = res.drug_time.map((item) => { - return { - label: item.name, - value: item.id, - }; - }); - drugType.value = res.drug_use_type.map((item) => { - return { - label: item.name, - value: item.id, - }; - }); - drugUnit.value = res.drug_unit.map((item) => { - return { - label: item.name, - value: item.id, - }; - }); - drugFrequency.value = res.drug_use_frequency.map((item) => { - return { - label: item.name, - value: item.id, - }; - }); - return res; -}); +// getDrugUseList().then((res) => { +// drugTime.value = res.drug_time.map((item) => { +// return { +// label: item.name, +// value: item.id, +// }; +// }); +// drugType.value = res.drug_use_type.map((item) => { +// return { +// label: item.name, +// value: item.id, +// }; +// }); +// drugUnit.value = res.drug_unit.map((item) => { +// return { +// label: item.name, +// value: item.id, +// }; +// }); +// drugFrequency.value = res.drug_use_frequency.map((item) => { +// return { +// label: item.name, +// value: item.id, +// }; +// }); +// return res; +// }); const isUpdate = ref(false); const gridApi = ref(); @@ -93,27 +90,15 @@ const [Modal, modalApi] = useVbenModal({ }>(); const listDrugType = modalData?.listDrugType ?? 1; - const drugIdSchemaPatch = - listDrugType === 5 - ? { - fieldName: 'drug_id', - component: 'ApiSelect' as const, - componentProps: { - class: 'w-full', - ...warehouseAdminDrugIdApiSelectProps, - }, - } - : { - fieldName: 'drug_id', - component: 'WarehouseAdminDrugSearch' as const, - componentProps: { - class: 'w-full', - productType: listDrugType, - }, - }; - formApi.updateSchema([ - drugIdSchemaPatch, + { + fieldName: 'drug_id', + component: 'WarehouseAdminDrugSearch' as const, + componentProps: { + class: 'w-full', + productType: listDrugType, + }, + }, { componentProps: { options: drugTime.value, @@ -150,8 +135,8 @@ const [Modal, modalApi] = useVbenModal({