From 59a9dd3d81052f469548559687b334f531692076 Mon Sep 17 00:00:00 2001 From: lq Date: Mon, 12 Jan 2026 12:39:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=E7=BA=BF=E5=A4=8D=E8=AF=8A?= =?UTF-8?q?=E7=9A=84UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/components/PrescriptionModal.vue | 138 ++++- .../business/order/prescription/index.vue | 8 +- .../order/product-order/components/detail.vue | 14 + .../business/order/product-order/index.vue | 10 +- .../components/PrescriptionDetail.vue | 2 +- .../components/SimpleProductModal.vue | 470 ++++++++++++++++++ .../views/doctor/doctor-reception/index.vue | 259 +++++++++- 7 files changed, 883 insertions(+), 18 deletions(-) create mode 100644 apps/web-antd/src/views/doctor/doctor-reception/components/SimpleProductModal.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 7958ff5c..8fae79f2 100644 --- a/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue +++ b/apps/web-antd/src/views/business/chat/components/PrescriptionModal.vue @@ -17,6 +17,7 @@ import { Card, Col, Descriptions, + Empty, Image, ImagePreviewGroup, Input, @@ -44,9 +45,12 @@ import DiagnosisModal from '#/views/doctor/doctor-reception/components/Diagnosis import DoctorOrderModal from '#/views/doctor/doctor-reception/components/DoctorOrderModal.vue'; import PrescriptionDetail from '#/views/doctor/doctor-reception/components/PrescriptionDetail.vue'; import WesternModal from '#/views/doctor/doctor-reception/components/WesternModal.vue'; +import SimpleProductModal from '#/views/doctor/doctor-reception/components/SimpleProductModal.vue'; // 常用方选择弹窗组件 import CommonPrescriptionModal from '#/views/doctor/doctor-reception/components/CommonPrescriptionModal.vue'; import StoreConfirmModal from './StoreConfirmModal.vue'; +// 药品搜索选择组件 +import { DrugSearchSelect } from '#/components/drug-search-select'; const splitString = (input: string) => input.split(','); @@ -68,6 +72,10 @@ const isSavingCommonPrescription = ref(false); const categories = [ { label: '中药', value: 1 }, { label: '中成(西)药', value: 2 }, + { label: '保健食品', value: 3 }, + { label: '产品服务包', value: 5 }, + { label: '非药品', value: 6 }, + { label: '医疗器械', value: 7 }, ]; const packageMethod = [ @@ -123,6 +131,10 @@ const [WesternDrugModal, WesternDrugModalApi] = useVbenModal({ connectedComponent: WesternModal, }); +const [SimpleProductModalComponent, SimpleProductModalApi] = useVbenModal({ + connectedComponent: SimpleProductModal, +}); + const [DiagnosisModals, DiagnosisModalApi] = useVbenModal({ connectedComponent: DiagnosisModal, }); @@ -259,6 +271,22 @@ const togglePatientInfo = () => { // 打开西药模态框 const openWesternModal = () => { + // 判断是否为简单产品类型(3,5,6,7) + const simpleProductTypes = [3, 5, 6, 7]; + if (simpleProductTypes.includes(prescriptionStore.activeCategory)) { + // 使用简单产品模态框 + SimpleProductModalApi.setData({ + values: prescriptionStore.activeCategory, + isChat: 'chat', + activePatient_id: prescriptionStore.currentRegisterId, + getCurrentDrugs: () => { + // 这里可以添加获取当前药品的逻辑 + }, + storagePrefix: 'onlineConsultation-', // 在线复诊加前缀 + }); + SimpleProductModalApi.open(); + } else { + // 使用原有的西药/中药模态框 WesternDrugModalApi.setData({ values: prescriptionStore.activeCategory, isChat: 'chat', @@ -266,9 +294,10 @@ const openWesternModal = () => { getCurrentDrugs: () => { // 这里可以添加获取当前药品的逻辑 }, - storagePrefix: 'onlineConsultation', // 在线复诊加前缀 + storagePrefix: 'onlineConsultation-', // 在线复诊加前缀 }); WesternDrugModalApi.open(); + } }; // 打开诊断模态框 @@ -443,6 +472,44 @@ const openSaveCommonPrescriptionModal = () => { showSaveCommonPrescriptionModal.value = true; }; +/** + * 处理DrugSearchSelect组件的select事件(用于新类型:3,5,6,7) + * @param drug 选中的药品数据 + */ +function handleSimpleProductSelect(drug: any) { + // 检查是否已存在 + const existItem = prescriptionStore.currentDrugs.find( + (item: any) => item.id === (drug._drugId || drug.drug_id || drug.drug?.id), + ); + + if (existItem) { + message.warning('该商品已在列表中'); + return; + } + + // 创建新的商品对象(简化版,不需要用法用量字段) + const newProduct = { + index_id: drug._id || drug.id, + id: drug._drugId || drug.drug_id || drug.drug?.id, + drug_name: drug._drugName || drug.drug?.drug_name || drug.drug_name, + number: 1, + price: drug._price || drug.price, + image: drug._image || drug.drug?.image || drug.image, + instruction: drug.drug?.instruction || drug.instruction || '', + type: drug.drug?.type || drug.type || prescriptionStore.activeCategory, + select_number: 1, + }; + + // 添加到选中列表 + prescriptionStore.currentDrugs.push(newProduct); + + // 更新本地存储 + prescriptionStore.saveToLocalStorage(); + + // 提示成功 + message.success(`已将${newProduct.drug_name}添加到清单中!`); +} + /** * 保存当前处方为常用方 * @description 根据当前药品类型(中药/西药)调用不同的保存接口 @@ -784,8 +851,14 @@ const cancelSaveCommonPrescription = () => { {{ item.prescription_type === 1 ? '中药处方' + : item.prescription_type === 3 + ? '保健食品' : item.prescription_type === 5 ? '产品服务包' + : item.prescription_type === 6 + ? '非药品' + : item.prescription_type === 7 + ? '医疗器械' : '西药处方' }} / @@ -854,7 +927,7 @@ const cancelSaveCommonPrescription = () => { 保存为常用方 + {{ drug.select_number }} + + + + {{ drug.price }} +
+ + +
+ + + +
@@ -1666,6 +1795,7 @@ const cancelSaveCommonPrescription = () => { + diff --git a/apps/web-antd/src/views/business/order/prescription/index.vue b/apps/web-antd/src/views/business/order/prescription/index.vue index 5182f6ac..ea82104c 100644 --- a/apps/web-antd/src/views/business/order/prescription/index.vue +++ b/apps/web-antd/src/views/business/order/prescription/index.vue @@ -87,7 +87,7 @@ const openPrescriptionSourceModal = (id) => { 商品【西药】 - 商品【非处方药】 + 商品【保健食品】 已退款 @@ -95,6 +95,12 @@ const openPrescriptionSourceModal = (id) => { 产品服务包 + + 非药品 + + + 医疗器械 +
待审核 diff --git a/apps/web-antd/src/views/business/order/product-order/components/detail.vue b/apps/web-antd/src/views/business/order/product-order/components/detail.vue index 15f57ae3..e2715885 100644 --- a/apps/web-antd/src/views/business/order/product-order/components/detail.vue +++ b/apps/web-antd/src/views/business/order/product-order/components/detail.vue @@ -136,6 +136,20 @@ const orderTypeMap = { {{ data.store.name }} + + 在线问诊 + 在线复诊 + 线下就诊 + + + 中药 + 西药 + 保健食品 + 产品服务包 + 非药品 + 医疗器械 + 其他 +
diff --git a/apps/web-antd/src/views/business/order/product-order/index.vue b/apps/web-antd/src/views/business/order/product-order/index.vue index 8ce6178c..79f5d94d 100644 --- a/apps/web-antd/src/views/business/order/product-order/index.vue +++ b/apps/web-antd/src/views/business/order/product-order/index.vue @@ -276,13 +276,19 @@ const toggleFreeShipping = async (row: any, checked: boolean) => { 处方订单【西药】 - 处方订单【非处方药】 + 处方订单【保健食品】 处方订单【西药】 - 产品服务包 + 处方订单【产品服务包】 + + + 处方订单【非药品】 + + + 处方订单【医疗器械】
diff --git a/apps/web-antd/src/views/doctor/doctor-reception/components/PrescriptionDetail.vue b/apps/web-antd/src/views/doctor/doctor-reception/components/PrescriptionDetail.vue index e566b769..7043a336 100644 --- a/apps/web-antd/src/views/doctor/doctor-reception/components/PrescriptionDetail.vue +++ b/apps/web-antd/src/views/doctor/doctor-reception/components/PrescriptionDetail.vue @@ -175,7 +175,7 @@ const getImageSource = (imageString) => {

-
+
{{ JSON.parse(recipe.content).name || diff --git a/apps/web-antd/src/views/doctor/doctor-reception/components/SimpleProductModal.vue b/apps/web-antd/src/views/doctor/doctor-reception/components/SimpleProductModal.vue new file mode 100644 index 00000000..fe3043f1 --- /dev/null +++ b/apps/web-antd/src/views/doctor/doctor-reception/components/SimpleProductModal.vue @@ -0,0 +1,470 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/doctor-reception/index.vue b/apps/web-antd/src/views/doctor/doctor-reception/index.vue index b4ad6d4d..06fc60f1 100644 --- a/apps/web-antd/src/views/doctor/doctor-reception/index.vue +++ b/apps/web-antd/src/views/doctor/doctor-reception/index.vue @@ -52,12 +52,15 @@ import DiagnosisModal from './components/DiagnosisModal.vue'; import DoctorOrderModal from './components/DoctorOrderModal.vue'; import PrescriptionDetail from './components/PrescriptionDetail.vue'; import WesternModal from './components/WesternModal.vue'; +import SimpleProductModal from './components/SimpleProductModal.vue'; import RefusalOfTreatmentModal from "#/views/doctor/doctor-reception/components/RefusalOfTreatmentModal.vue"; // 常用方选择弹窗组件 import CommonPrescriptionModal from './components/CommonPrescriptionModal.vue'; // 确认模态框组件 import ConfirmModal from './components/ConfirmModal.vue'; +// 药品搜索选择组件 +import { DrugSearchSelect } from '#/components/drug-search-select'; // 保存常用方API import { saveChineseCommonPrescriptionApi, @@ -161,10 +164,10 @@ setInterval(getPatientListByReception, 600_000); const categories = [ {label: '中药', value: 1}, {label: '中成(西)药', value: 2}, - // { label: '西药', value: 2 }, - // { label: '保健商品', value: 3 }, - // { label: '中成药商品', value: 4 }, - // { label: '服务包', value: 5 }, + {label: '保健食品', value: 3}, + {label: '产品服务包', value: 5}, + {label: '非药品', value: 6}, + {label: '医疗器械', value: 7}, ]; // 当前状态 @@ -608,6 +611,10 @@ const [WesternDrugModal, WesternDrugModalApi] = useVbenModal({ connectedComponent: WesternModal, }); +const [SimpleProductModalComponent, SimpleProductModalApi] = useVbenModal({ + connectedComponent: SimpleProductModal, +}); + const [DiagnosisModals, DiagnosisModalApi] = useVbenModal({ connectedComponent: DiagnosisModal, }); @@ -886,7 +893,19 @@ const cancelSaveCommonPrescription = () => { }; const openWesternModal = () => { - // 打开西药处方模态框逻辑 + // 判断是否为简单产品类型(3,5,6,7) + const simpleProductTypes = [3, 5, 6, 7]; + if (simpleProductTypes.includes(activeCategory.value)) { + // 使用简单产品模态框 + SimpleProductModalApi.setData({ + values: activeCategory.value, + activePatient_id: activePatient.value?.id, + getCurrentDrugs, + storagePrefix: '', // 接诊页面不加前缀 + }); + SimpleProductModalApi.open(); + } else { + // 使用原有的西药/中药模态框 WesternDrugModalApi.setData({ values: activeCategory.value, activePatient_id: activePatient.value?.id, @@ -894,6 +913,7 @@ const openWesternModal = () => { storagePrefix: '', // 接诊页面不加前缀 }); WesternDrugModalApi.open(); + } }; const openPrescriptionDetail = (values) => { // 打开西药处方模态框逻辑 @@ -1376,6 +1396,44 @@ function addProducts(data) { message.success(`已将${newProduct.drug_name}添加到清单中!`); } +/** + * 处理DrugSearchSelect组件的select事件(用于新类型:3,5,6,7) + * @param drug 选中的药品数据 + */ +function handleSimpleProductSelect(drug: any) { + // 检查是否已存在 + const existItem = currentDrugs.value.find( + (item) => item.id === (drug._drugId || drug.drug_id || drug.drug?.id), + ); + + if (existItem) { + message.warning('该商品已在列表中'); + return; + } + + // 创建新的商品对象(简化版,不需要用法用量字段) + const newProduct = { + index_id: drug._id || drug.id, + id: drug._drugId || drug.drug_id || drug.drug?.id, + drug_name: drug._drugName || drug.drug?.drug_name || drug.drug_name, + number: 1, + price: drug._price || drug.price, + image: drug._image || drug.drug?.image || drug.image, + instruction: drug.drug?.instruction || drug.instruction || '', + type: drug.drug?.type || drug.type || activeCategory.value, + select_number: 1, + }; + + // 添加到选中列表 + currentDrugs.value.push(newProduct); + + // 更新本地存储 + updateLocalStorage(); + + // 提示成功 + message.success(`已将${newProduct.drug_name}添加到清单中!`); +} + const newDrugInfo = ref({}); function switchStore(id) { @@ -1627,7 +1685,15 @@ watch( item.created_at }} - {{ item.prescription_type === 1 ? '中药处方' : item.prescription_type === 5 ? '产品服务包' : '西药处方' }} / + {{ + item.prescription_type === 1 ? '中药处方' : + item.prescription_type === 2 ? '西药处方' : + item.prescription_type === 3 ? '保健食品' : + item.prescription_type === 5 ? '产品服务包' : + item.prescription_type === 6 ? '非药品' : + item.prescription_type === 7 ? '医疗器械' : + '未知类型' + }} / {{ item.category === 1 ? '自费' : '医保' }} @@ -1670,7 +1736,7 @@ watch(
- -
+ +
商品图片 @@ -2149,6 +2215,62 @@ watch(
+ +
+ +
+ +
+ +
+
+ 商品图片 + 商品名称 + 数量 + 单价 + 操作 +
+
+
+
+ +
+
+

+ 药品名称:{{ drug.drug_name }} +

+
+
+
+ + {{ drug.select_number }} + +
+
+ {{ drug.price }} +
+ + +
+
+
+
+
@@ -2279,7 +2401,22 @@ watch(
总计:¥{{ totalCost.toFixed(2) }}
- +
@@ -2290,6 +2427,7 @@ watch( + @@ -2588,4 +2726,105 @@ watch( color: #909399; font-size: 0.8em; } + +/* 简单产品列表样式 */ +.simple-product-list { + margin: 1rem 0; +} + +.selected-products-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 16px; + margin-top: 16px; +} + +.product-card { + border: 1px solid #e4e7ed; + border-radius: 8px; +} + +.dark .product-card { + border-color: #333; +} + +.product-card-content { + display: flex; + flex-direction: column; + gap: 12px; +} + +.product-image { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 8px; +} + +.product-image-placeholder { + width: 120px; + height: 120px; + display: flex; + align-items: center; + justify-content: center; + background: #f5f5f5; + border-radius: 6px; + color: #999; + font-size: 12px; +} + +.dark .product-image-placeholder { + background: #374151; + color: #6b7280; +} + +.product-info { + flex: 1; +} + +.product-name { + font-size: 16px; + font-weight: 500; + margin-bottom: 8px; + color: #333; +} + +.dark .product-name { + color: #f3f4f6; +} + +.product-price { + font-size: 14px; + color: #666; + margin-bottom: 12px; +} + +.dark .product-price { + color: #9ca3af; +} + +.product-quantity { + display: flex; + align-items: center; + margin-bottom: 12px; +} + +.product-total { + font-size: 16px; + font-weight: 600; + color: #ff4d4f; +} + +.product-actions { + display: flex; + justify-content: flex-end; + gap: 8px; + padding-top: 8px; + border-top: 1px solid #e4e7ed; +} + +.dark .product-actions { + border-top-color: #333; +}