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({