diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index c3d1b540c..52762a086 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -91,13 +91,13 @@ T1.dosage_instruction AS dosage_instruction, T1.chrgitm_lv as chrgitm_lv FROM med_medication_definition AS t1 - INNER JOIN med_medication AS T2 ON T2.medication_def_id = t1.ID + LEFT JOIN med_medication AS T2 ON T2.medication_def_id = t1.ID AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum} LEFT JOIN adm_supplier AS T3 ON T3.ID = t1.supply_id AND T3.delete_flag = '0' LEFT JOIN adm_charge_item_definition AS T5 ON T5.instance_id = t1.ID AND T5.delete_flag = '0' AND T5.status_enum = #{statusEnum} - INNER JOIN adm_organization_location AS T6 ON T6.distribution_category_code = t1.category_code AND T6.delete_flag = '0' AND T6.item_code = '1' AND T6.organization_id = #{organizationId} AND (CURRENT_TIME :: time (6) BETWEEN T6.start_time AND T6.end_time) + LEFT JOIN adm_organization_location AS T6 ON T6.distribution_category_code = t1.category_code AND T6.delete_flag = '0' AND T6.item_code = '1' AND T6.organization_id = #{organizationId} AND (CURRENT_TIME :: time (6) BETWEEN T6.start_time AND T6.end_time) WHERE t1.delete_flag = '0' - AND T2.status_enum = #{statusEnum} + AND (T2.status_enum = #{statusEnum} OR T2.status_enum IS NULL) diff --git a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue index 1debfa34b..62ff30454 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue @@ -103,18 +103,7 @@ /> 费用性质: - - - + {{ props.patientInfo?.contractName || '-' }} 用法: import { - getContract, getDiagnosisDefinitionList, getOrgTree, getTcmAdviceList, @@ -605,12 +593,11 @@ const props = defineProps({ }); const tableRefs = ref({}); const stockList = ref([]); -const contractList = ref([]); const tcmDiagnosisList = ref([]); const conditionId = ref(''); const checkAll = ref(false); const { proxy } = getCurrentInstance(); -const inputRefs = ref({}); // 存储输入框实例 +const inputRefs = ref({}); const requiredProps = ref([]); // 存储必填项 prop 顺序 const totalAmount = ref(0); const tcmDianosis = ref(); @@ -679,9 +666,6 @@ async function getListInfo(addNewRow) { }); }); - await getContract({ encounterId: props.patientInfo.encounterId }).then((res) => { - contractList.value = res.data; - }); // 更新处方列表 const groupIds = Object.keys(groupedData); tcmPrescriptionList.value = groupIds.map((groupId, index) => { @@ -689,7 +673,7 @@ async function getListInfo(addNewRow) { id: generatePrescriptionId(), prescriptionList: [], conditionDefinitionId: '', - accountId: contractList.value?.[0]?.accountId || '', + accountId: props.patientInfo.accountId || '', methodCode: '', rateCode: '', dispensePerDuration: '', @@ -745,7 +729,7 @@ async function getListInfo(addNewRow) { id: generatePrescriptionId(), prescriptionList: [], conditionDefinitionId: '', - accountId: contractList.value?.[0]?.accountId || '', + accountId: props.patientInfo.accountId || '', methodCode: '', rateCode: '', dispensePerDuration: '', @@ -760,7 +744,7 @@ async function getListInfo(addNewRow) { isAdding: false, }); } - tcmPrescriptionList.value.accountId = contractList.value?.[0]?.accountId || ''; + tcmPrescriptionList.value.accountId = props.patientInfo.accountId || ''; if (props.activeTab == 'prescription' && addNewRow) { handleAddMedicine(0); } diff --git a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmMedicineList.vue b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmMedicineList.vue index 57a5af2f4..393d91b6f 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmMedicineList.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmMedicineList.vue @@ -8,7 +8,7 @@ ref="adviceBaseRef" height="400" :data="filteredAdviceBaseList" - :row-config="{ keyField: 'patientId' }" + :row-config="{ keyField: 'adviceDefinitionId' }" @current-change="handleCurrentChange" @cell-click="clickRow" > @@ -78,7 +78,7 @@ const currentIndex = ref(0); // 当前选中行索引 const currentSelectRow = ref({}); const queryParams = ref({ pageSize: 100, - pageNum: 1, + pageNo: 1, }); const adviceBaseList = ref([]); @@ -126,14 +126,23 @@ getList(); function getList() { queryParams.value.organizationId = props.patientInfo.orgId; getTcmMedicine(queryParams.value).then((res) => { - adviceBaseList.value = res.data.records; - total.value = res.data.total; - nextTick(() => { - currentIndex.value = 0; - if (filteredAdviceBaseList.value.length > 0) { - adviceBaseRef.value.setCurrentRow(filteredAdviceBaseList.value[0]); - } - }); + if (res.data && res.data.records) { + adviceBaseList.value = res.data.records; + total.value = res.data.total || 0; + nextTick(() => { + currentIndex.value = 0; + if (filteredAdviceBaseList.value.length > 0) { + adviceBaseRef.value?.setCurrentRow(filteredAdviceBaseList.value[0]); + } + }); + } else { + adviceBaseList.value = []; + total.value = 0; + } + }).catch((error) => { + console.error('获取中药列表失败:', error); + adviceBaseList.value = []; + total.value = 0; }); }