需求17 门诊医生站-》患者列表;从adm_encounter表中查询到first_enum字段用以判断初复诊
This commit is contained in:
@@ -99,6 +99,10 @@
|
||||
{{ userStore.nickName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="" width="300">
|
||||
<el-radio-group v-model="firstEnum">
|
||||
<el-radio :label="1">初诊</el-radio>
|
||||
<el-radio :label="2">复诊</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" plain @click.stop="handleFinish(patientInfo.encounterId)">
|
||||
完诊
|
||||
</el-button>
|
||||
@@ -276,6 +280,7 @@ const loading = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const visitType = ref('');
|
||||
const firstVisitDate = ref('');
|
||||
const firstEnum = ref(1); // 初复诊标识:1=初诊,2=复诊
|
||||
const disabled = computed(() => {
|
||||
// 只有在有患者信息但某些条件不满足时才启用覆盖层
|
||||
// 当前逻辑保持不变,但我们将在按钮级别处理禁用状态
|
||||
@@ -506,6 +511,15 @@ function handleCardClickOriginal(item, index) {
|
||||
console.log('patientInfo.value 设置为:', patientInfo.value);
|
||||
console.log('patientInfo.value.encounterId:', patientInfo.value?.encounterId);
|
||||
|
||||
// 根据患者信息设置初复诊标识
|
||||
const backendValue = item.firstEnum ?? item.first_enum;
|
||||
|
||||
if (backendValue !== undefined && backendValue !== null) {
|
||||
firstEnum.value = Number(backendValue); // 确保是数字类型
|
||||
} else {
|
||||
firstEnum.value = 1;
|
||||
}
|
||||
|
||||
// 确保患者信息包含必要的字段
|
||||
if (!patientInfo.value.encounterId) {
|
||||
console.error('患者信息缺少encounterId字段:', patientInfo.value);
|
||||
@@ -566,11 +580,18 @@ function handleFinish(encounterId) {
|
||||
patientInfo.value = {};
|
||||
visitType.value = ''; // 重置初复诊标识
|
||||
visitTypeDisabled.value = false; // 重置禁用状态
|
||||
firstEnum.value = 1; // 重置为初诊
|
||||
getPatientList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 监听初复诊标识变化
|
||||
watch(firstEnum, (newValue) => {
|
||||
// 这里可以添加更新后端的逻辑,如果需要实时同步到后端
|
||||
// 例如:updateEncounterFirstEnum(patientInfo.value.encounterId, newValue)
|
||||
});
|
||||
|
||||
function handleTimeChange(value) {
|
||||
queryParams.value.registerTimeSTime = value + ' 00:00:00';
|
||||
queryParams.value.registerTimeETime = value + ' 23:59:59';
|
||||
|
||||
Reference in New Issue
Block a user