diff --git a/apps/web-antd/src/store/prescription.ts b/apps/web-antd/src/store/prescription.ts index 891682e3..d1f82a02 100644 --- a/apps/web-antd/src/store/prescription.ts +++ b/apps/web-antd/src/store/prescription.ts @@ -16,7 +16,8 @@ import { getProcessRuleList, getProductListDoctorReception, } from '#/views/doctor/doctor-reception/api'; -import { getRegisterStoreInfo } from '#/views/doctor/online-consultation/api'; +import { getRegisterStoreInfo as getRegisterStoreInfoPharmacy } from '#/views/doctor/online-consultation/api'; +import { getRegisterStoreInfo as getRegisterStoreInfoClinic } from '#/views/doctor/online-consultation-clinic/api'; import traditionalJson from '#/views/business/chat/config/traditional.json'; export const usePrescriptionStore = defineStore('prescription', () => { @@ -85,10 +86,13 @@ export const usePrescriptionStore = defineStore('prescription', () => { const selectedStoreId = ref(null); // 用户选择的诊所ID const sendMode = ref(0); // 0=默认(使用医生当前诊所),1=自定义(使用挂号诊所) + // 存储前缀(用于区分在线复诊-药店和在线复诊-诊所) + const storagePrefix = ref('onlineConsultation-'); // 默认前缀 + // 获取localStorage key(按类型分开存储) const getStorageKey = (category?: number) => { const cat = category ?? activeCategory.value; - return `onlineConsultation-prescriptionData_${cat}_${currentRegisterId.value}`; + return `${storagePrefix.value}prescriptionData_${cat}_${currentRegisterId.value}`; }; // 计算属性 @@ -198,24 +202,28 @@ export const usePrescriptionStore = defineStore('prescription', () => { // 完整初始化(包含患者信息,仅用于 PrescriptionModal) const initializePrescription = async ( registerId: number | string, - shouldFetchPatientInfo: boolean = false + shouldFetchPatientInfo: boolean = false, + prefix: string = 'onlineConsultation-' ) => { + // 设置存储前缀 + storagePrefix.value = prefix; + // 设置当前注册ID currentRegisterId.value = registerId; // 恢复之前保存的 activeCategory const savedCategory = localStorage.getItem( - `onlineConsultation-activeCategory${registerId}` + `${storagePrefix.value}activeCategory${registerId}` ); if (savedCategory) { activeCategory.value = Number.parseInt(savedCategory); } else { // 检查哪个存储键有数据 const chineseData = localStorage.getItem( - `onlineConsultation-prescriptionData_1_${registerId}` + `${storagePrefix.value}prescriptionData_1_${registerId}` ); const westData = localStorage.getItem( - `onlineConsultation-prescriptionData_2_${registerId}` + `${storagePrefix.value}prescriptionData_2_${registerId}` ); if (chineseData && JSON.parse(chineseData).length > 0) { activeCategory.value = 1; @@ -245,25 +253,28 @@ export const usePrescriptionStore = defineStore('prescription', () => { }; // 轻量级初始化(仅用于 WesternModal 等子组件) - const initializeForModal = async (registerId: number | string) => { + const initializeForModal = async (registerId: number | string, prefix: string = 'onlineConsultation-') => { console.log('轻量级初始化,registerId:', registerId); + // 设置存储前缀 + storagePrefix.value = prefix; + // 设置当前注册ID currentRegisterId.value = registerId; // 恢复之前保存的 activeCategory const savedCategory = localStorage.getItem( - `onlineConsultation-activeCategory${registerId}` + `${storagePrefix.value}activeCategory${registerId}` ); if (savedCategory) { activeCategory.value = Number.parseInt(savedCategory); } else { // 检查哪个存储键有数据 const chineseData = localStorage.getItem( - `onlineConsultation-prescriptionData_1_${registerId}` + `${storagePrefix.value}prescriptionData_1_${registerId}` ); const westData = localStorage.getItem( - `onlineConsultation-prescriptionData_2_${registerId}` + `${storagePrefix.value}prescriptionData_2_${registerId}` ); if (chineseData && JSON.parse(chineseData).length > 0) { activeCategory.value = 1; @@ -348,7 +359,12 @@ export const usePrescriptionStore = defineStore('prescription', () => { return; } try { - const res = await getRegisterStoreInfo(Number(currentRegisterId.value)); + // 根据storagePrefix判断使用哪个API + const getRegisterStoreInfoFn = storagePrefix.value === 'onlineConsultationClinic-' + ? getRegisterStoreInfoClinic + : getRegisterStoreInfoPharmacy; + + const res = await getRegisterStoreInfoFn(Number(currentRegisterId.value)); registerStoreInfo.value = res; // 默认选择挂号诊所 @@ -863,7 +879,7 @@ export const usePrescriptionStore = defineStore('prescription', () => { // 保存 Tab 类型 localStorage.setItem( - `onlineConsultation-activeCategory${currentRegisterId.value}`, + `${storagePrefix.value}activeCategory${currentRegisterId.value}`, categoryValue.toString(), ); activeCategory.value = categoryValue; diff --git a/apps/web-antd/src/views/business/chat/components/MessageInput.vue b/apps/web-antd/src/views/business/chat/components/MessageInput.vue index 56ca330c..0622418d 100644 --- a/apps/web-antd/src/views/business/chat/components/MessageInput.vue +++ b/apps/web-antd/src/views/business/chat/components/MessageInput.vue @@ -1,5 +1,6 @@ + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientExperienceCard.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientExperienceCard.vue new file mode 100644 index 00000000..3800d1e9 --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientExperienceCard.vue @@ -0,0 +1,372 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientInfoPanel.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientInfoPanel.vue new file mode 100644 index 00000000..1737896e --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientInfoPanel.vue @@ -0,0 +1,336 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientList.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientList.vue new file mode 100644 index 00000000..6bee07c8 --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/PatientList.vue @@ -0,0 +1,319 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/components/ProductCard.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/ProductCard.vue new file mode 100644 index 00000000..85b5598b --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/ProductCard.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/components/QuickReplyBubbles.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/QuickReplyBubbles.vue new file mode 100644 index 00000000..c7cb04c0 --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/components/QuickReplyBubbles.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/online-consultation-clinic/index.vue b/apps/web-antd/src/views/doctor/online-consultation-clinic/index.vue new file mode 100644 index 00000000..684cbf97 --- /dev/null +++ b/apps/web-antd/src/views/doctor/online-consultation-clinic/index.vue @@ -0,0 +1,576 @@ + + + + + diff --git a/apps/web-antd/src/views/doctor/settings/components/AddCommonPrescriptionModal.vue b/apps/web-antd/src/views/doctor/settings/components/AddCommonPrescriptionModal.vue index e9487e97..6753f81e 100644 --- a/apps/web-antd/src/views/doctor/settings/components/AddCommonPrescriptionModal.vue +++ b/apps/web-antd/src/views/doctor/settings/components/AddCommonPrescriptionModal.vue @@ -635,7 +635,7 @@ async function handleSave() { switch (prescriptionType.value) { case 'west': { const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, select_number: drug.select_number || 1, @@ -664,7 +664,7 @@ async function handleSave() { } case 'chinese': { const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, price: drug.price || 0, @@ -690,7 +690,7 @@ async function handleSave() { } case 'granular': { const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, price: drug.price || 0, diff --git a/apps/web-antd/src/views/doctor/settings/components/EditCommonPrescriptionModal.vue b/apps/web-antd/src/views/doctor/settings/components/EditCommonPrescriptionModal.vue index b80a84d8..b5a4a76f 100644 --- a/apps/web-antd/src/views/doctor/settings/components/EditCommonPrescriptionModal.vue +++ b/apps/web-antd/src/views/doctor/settings/components/EditCommonPrescriptionModal.vue @@ -663,7 +663,7 @@ async function handleSave() { case 'west': { // 构建西药药品数据 const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, select_number: drug.select_number || 1, @@ -692,7 +692,7 @@ async function handleSave() { case 'chinese': { // 构建中药药品数据 const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, price: drug.price || 0, @@ -718,7 +718,7 @@ async function handleSave() { case 'granular': { // 构建颗粒药药品数据 const drugs = drugList.value.map((drug) => ({ - drug_id: drug.drug_id || drug.id, + drug_id: drug.id, drug_name: drug.drug_name, number: drug.number || 1, price: drug.price || 0,