fix(doctorstation): 中医tab页费用性质改为复用患者信息,与门诊挂号当日已挂号数据源统一

This commit is contained in:
wangjian963
2026-06-23 17:22:53 +08:00
parent 92708b386a
commit a69951900a
3 changed files with 27 additions and 34 deletions

View File

@@ -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)
<if test="categoryCode != null and categoryCode != ''">
<!-- 🔧 BugFix: 支持两种匹配方式 -->
<!-- 1. 直接匹配distribution_category_code = category_code都是数字代码 -->

View File

@@ -103,18 +103,7 @@
/>
</el-select>
<span class="doctor-station"> 费用性质 </span>
<el-select
v-model="prescription.accountId"
placeholder="费用性质"
style="width: 120px"
>
<el-option
v-for="item in contractList"
:key="item.accountId"
:label="item.contractName"
:value="item.accountId"
/>
</el-select>
<span style="color: #303133; font-weight: 600;">{{ props.patientInfo?.contractName || '-' }}</span>
<span class="doctor-station"> 用法 </span>
<el-select
v-model="prescription.methodCode"
@@ -521,7 +510,6 @@
<script setup>
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);
}

View File

@@ -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;
});
}