Files
his/openhis-ui-vue3/src/views/doctorstation/components/patientList.vue
赵云 1459bae9d0 Fix Bug #400: 门诊医生站点击【完诊】后,triage_queue_item 表 status 字段未按规范更新为 30
完诊API后端要求同时传递 encounterId 和 firstEnum 两个参数:
1. DoctorCallDialog.vue:已有修复只传了 encounterId,缺少 firstEnum,导致后端校验失败
2. patientList.vue:仍传递原始值而非对象,且同样缺少 firstEnum

修复:两处调用均改为传递 { encounterId, firstEnum } 对象,firstEnum 默认值为1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 17:27:05 +08:00

224 lines
6.1 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px">
<el-input
v-model="queryParams.patientName"
placeholder="请输入患者姓名"
clearable
style="flex: 1.4"
@keyup.enter="handleQuery"
>
<template #append>
<el-button icon="Search" @click="handleQuery" />
</template>
</el-input>
<el-date-picker
v-model="date"
placeholder="请选择挂号日期"
type="date"
size="default"
placement="bottom"
style="flex: 1.1"
@change="handleDateQuery"
:clearable="false"
value-format="YYYY-MM-DD"
/>
<el-radio-group
v-model="queryParams.statusEnum"
@change="getPatientList"
style="flex-shrink: 0"
>
<el-radio-button :label="1">待诊</el-radio-button>
<el-radio-button :label="3">暂离</el-radio-button>
<el-radio-button :label="4">完诊</el-radio-button>
</el-radio-group>
</div>
<div style="justify-content: space-between; display: flex; margin-bottom: 10px">
<div></div>
</div>
<el-table
max-height="750"
ref="patientTableRef"
:data="patient"
row-key="id"
@cell-click="clickRow"
v-loading="loading"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" type="index" width="50" />
<el-table-column label="患者" align="center" prop="name">
<template #default="scope">
<div style="display: flex; justify-content: flex-start; align-items: center">
<div style="padding-top: 5px">
<el-avatar
:size="40"
src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
/>
</div>
<div style="font-size: 12px; text-align: left; padding-left: 20px">
<div>
<span style="margin-right: 10px">{{ scope.row.patientName }}</span>
<span style="margin-right: 10px">年龄{{ scope.row.age }}</span>
<span>性别{{ scope.row.genderEnum_enumText }}</span>
</div>
<div>
<span>挂号时间{{ formatDate(scope.row.registerTime) }}</span>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" prop="name" width="100">
<template #default="scope">
<el-button type="primary" link @click="handleReceive(scope.row)"> 接诊 </el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getPatientList"
/>
</template>
<script setup>
import {completeEncounter, getList, leaveEncounter, receiveEncounter} from './api';
import {formatDate, formatDateStr} from '@/utils/index';
const date = ref(formatDate(new Date()));
const queryParams = ref({
pageNo: 1,
pageSize: 50,
statusEnum: 1,
registerTimeSTime: formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00',
registerTimeETime: formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59',
});
const patient = ref([]);
const loading = ref(false);
const patientTableRef = ref();
const total = ref(0);
const emits = defineEmits(['cellClick', 'toCurrent']);
const props = defineProps({
status: {
type: Number,
required: true,
},
});
const { proxy } = getCurrentInstance();
const encounterId = ref();
const firstEnum = ref(1); // 初复诊标识1=初诊2=复诊
onMounted(() => {
getPatientList();
});
function getPatientList() {
// queryParams.value.statusEnum = props.status;
loading.value = true;
// queryParams.value.registerTimeSTime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00';
// queryParams.value.registerTimeETime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59';
getList(queryParams.value).then((res) => {
patient.value = res.data.records;
total.value = res.data.total;
loading.value = false;
});
}
function clickRow(row) {
encounterId.value = row.encounterId;
firstEnum.value = row.firstEnum ?? row.first_enum ?? 1;
emits('cellClick', row);
}
/**
* 接诊并跳到现诊tab页
*/
function handleReceive(row) {
// if (encounterId.value == undefined) {
// proxy.$modal.msgError('请选择患者');
// return;
// }
receiveEncounter(row.encounterId).then(() => {
emits('toCurrent', row);
}).catch(error => {
// 如果接诊失败,检查是否是"已接诊"的错误
if (error && error.message && error.message.includes('已接诊')) {
// 自动刷新列表,移除已接诊的患者
getPatientList();
}
});
}
/**
* 暂离
*/
function handleDisabled() {
if (encounterId.value == undefined) {
proxy.$modal.msgError('请选择患者');
return;
}
proxy.$modal
.confirm('是否暂离该患者?')
.then(() => {
proxy.$modal.loading();
leaveEncounter(encounterId.value).then(() => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess('暂离成功');
getPatientList();
});
})
.catch(() => {
proxy.$modal.closeLoading();
});
}
/**
* 完诊
*/
function handleComplete() {
if (encounterId.value == undefined) {
proxy.$modal.msgError('请选择患者');
return;
}
proxy.$modal.confirm('是否完成该患者问诊?').then(() => {
proxy.$modal.loading();
completeEncounter({ encounterId: encounterId.value, firstEnum: firstEnum.value }).then(() => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess('完成问诊成功');
getPatientList();
});
});
}
function handleQuery() {
// 清空表格选中状态
patientTableRef.value.setCurrentRow(null);
getPatientList();
}
function handleDateQuery(value) {
queryParams.value.registerTimeSTime = value + ' 00:00:00';
queryParams.value.registerTimeETime = value + ' 23:59:59';
handleQuery();
}
function handleSelectionChange() {}
// 添加刷新方法
function refreshList() {
getPatientList();
}
// 暴露 refreshList 方法
defineExpose({
refreshList,
});
</script>
<style scoped>
.custom-date-picker.el-picker__popper {
width: 285px !important;
}
</style>