From f671ea7d418a19a3acd5723e0644cf2bd91eb5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Tue, 14 Jul 2026 08:24:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=BC=80=E6=96=B9=E7=9A=84=E9=94=99=E8=AF=AF=202.=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8D=AF=E5=93=81=E7=9A=84ERP=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E9=87=8F=E5=80=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/components/PrescriptionModal.vue | 25 +++- .../product/western-medicine/api/index.ts | 8 ++ .../components/ErpQtyFactorModal.vue | 123 ++++++++++++++++++ .../product/western-medicine/config/form.ts | 16 +++ .../product/western-medicine/config/table.ts | 1 + .../product/western-medicine/index.vue | 24 ++++ .../components/WesternModal.vue | 42 ++++-- .../views/doctor/doctor-reception/index.vue | 9 +- 8 files changed, 231 insertions(+), 17 deletions(-) create mode 100644 apps/web-antd/src/views/business/product/western-medicine/components/ErpQtyFactorModal.vue diff --git a/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue b/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue index 4bc29baa..8ecc11bf 100644 --- a/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue +++ b/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue @@ -53,6 +53,7 @@ import CommonPrescriptionModal from '#/views/doctor/doctor-reception/components/ // 信息提示模态框 import InfoModal from '#/components/modal/InfoModal.vue'; // 药品搜索选择组件 +import { DrugSearchSelect } from '#/components/drug-search-select'; import { formatPriceDisplay } from '#/utils/formatPrice'; import ChineseMedicineConfig from '#/views/doctor/doctor-reception/components/ChineseMedicineConfig.vue'; @@ -90,6 +91,11 @@ const allowInsuranceCategory = computed( () => Number(prescriptionStore.registerStoreInfo?.allow_insurance_category ?? 0) === 1, ); +/** 仅中药/西药支持常用方模板(保健食品等不提供常用方) */ +const canUseCommonPrescription = computed(() => + [1, 2].includes(prescriptionStore.activeCategory), +); + watch(allowInsuranceCategory, (allow) => { if (!allow) { prescriptionStore.category = 1; @@ -422,6 +428,10 @@ const filterOption = (input: string, option: any) => { * @description 打开常用方弹窗,选择后自动填充药品到处方中 */ function openCommonPrescriptionModal() { + if (!canUseCommonPrescription.value) { + message.warning('当前分类不支持选择常用方'); + return; + } CommonPrescriptionModalApi.setData({ type: prescriptionStore.activeCategory, onSelect: handleSelectCommonPrescription, @@ -522,7 +532,7 @@ async function handleSelectCommonPrescription(data: any, type: number) { } // 保存到本地存储 - prescriptionStore.saveToLocalStorage(); + prescriptionStore.syncToLocalStorage(); message.success('已选择常用方,药品已填充到处方中'); } @@ -533,6 +543,10 @@ async function handleSelectCommonPrescription(data: any, type: number) { * @description 检查是否有药品可保存,然后打开弹窗 */ const openSaveCommonPrescriptionModal = () => { + if (!canUseCommonPrescription.value) { + message.warning('当前分类不支持保存为常用方'); + return; + } // 检查是否有药品 if (prescriptionStore.currentDrugs.length === 0) { message.warning('请先添加药品后再保存为常用方'); @@ -576,7 +590,7 @@ function handleSimpleProductSelect(drug: any) { prescriptionStore.currentDrugs.push(newProduct); // 更新本地存储 - prescriptionStore.saveToLocalStorage(); + prescriptionStore.syncToLocalStorage(); // 提示成功 message.success(`已将${newProduct.drug_name}添加到清单中!`); @@ -600,6 +614,11 @@ const saveAsCommonPrescription = async () => { return; } + if (!canUseCommonPrescription.value) { + message.warning('当前分类不支持保存为常用方'); + return; + } + isSavingCommonPrescription.value = true; try { @@ -875,6 +894,7 @@ const cancelSaveCommonPrescription = () => {