168 入科分配床位填写的住院医生、主治医生、责任护士字段的内容双击查看未显示。
This commit is contained in:
@@ -389,43 +389,58 @@ const interventionForm = ref({
|
||||
startTime: '', //入院时间
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.pendingInfo,
|
||||
(newVal, oldVal) => {
|
||||
console.log(newVal);
|
||||
if (newVal) {
|
||||
getPatientInfo({ encounterId: newVal.encounterId }).then((res) => {
|
||||
console.log('res============>', JSON.stringify(res.data));
|
||||
/**
|
||||
* 获取患者详细信息并填充表单
|
||||
*/
|
||||
const loadPatientInfo = () => {
|
||||
if (!props.pendingInfo?.encounterId) {
|
||||
return;
|
||||
}
|
||||
getPatientInfo({ encounterId: props.pendingInfo.encounterId }).then((res) => {
|
||||
pendingInfo.value = res.data;
|
||||
// 从后端获取数据后设置医生和护士 ID
|
||||
if (res.data.admittingDoctorId) {
|
||||
interventionForm.value.admittingDoctorId = res.data.admittingDoctorId;
|
||||
}
|
||||
if (res.data.attendingDoctorId) {
|
||||
interventionForm.value.attendingDoctorId = res.data.attendingDoctorId;
|
||||
}
|
||||
if (res.data.chiefDoctorId) {
|
||||
interventionForm.value.chiefDoctorId = res.data.chiefDoctorId;
|
||||
}
|
||||
if (res.data.primaryNurseId) {
|
||||
interventionForm.value.primaryNurseId = res.data.primaryNurseId;
|
||||
}
|
||||
if (res.data.startTime) {
|
||||
interventionForm.value.startTime = dayjs(res.data.startTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss'
|
||||
);
|
||||
} else {
|
||||
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
interventionForm.value.height = res.data.height;
|
||||
interventionForm.value.weight = res.data.weight;
|
||||
interventionForm.value.temperature = res.data.temperature;
|
||||
interventionForm.value.hertRate = res.data.hertRate;
|
||||
interventionForm.value.pulse = res.data.pulse;
|
||||
interventionForm.value.endBloodPressure = res.data.endBloodPressure;
|
||||
interventionForm.value.highBloodPressure = res.data.highBloodPressure;
|
||||
});
|
||||
interventionForm.value.priorityEnum = props.pendingInfo.priorityEnum || '';
|
||||
interventionForm.value.organizationName = props.pendingInfo.organizationName || '';
|
||||
interventionForm.value.wardName = props.pendingInfo.wardName || '';
|
||||
interventionForm.value.bedName = props.pendingInfo.bedName || '';
|
||||
};
|
||||
|
||||
pendingInfo.value = res.data;
|
||||
interventionForm.value.admittingDoctorId = res.data.admittingDoctorId;
|
||||
interventionForm.value.attendingDoctorId = res.data.attendingDoctorId;
|
||||
if (res.data.chiefDoctorId) {
|
||||
interventionForm.value.chiefDoctorId = res.data.chiefDoctorId;
|
||||
}
|
||||
interventionForm.value.primaryNurseId = res.data.primaryNurseId;
|
||||
if (res.data.startTime) {
|
||||
interventionForm.value.startTime = dayjs(res.data.startTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss'
|
||||
);
|
||||
} else {
|
||||
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
interventionForm.value.height = res.data.height;
|
||||
interventionForm.value.weight = res.data.weight;
|
||||
interventionForm.value.temperature = res.data.temperature;
|
||||
interventionForm.value.hertRate = res.data.hertRate;
|
||||
interventionForm.value.pulse = res.data.pulse;
|
||||
interventionForm.value.endBloodPressure = res.data.endBloodPressure;
|
||||
interventionForm.value.highBloodPressure = res.data.highBloodPressure;
|
||||
});
|
||||
interventionForm.value.priorityEnum = newVal.priorityEnum;
|
||||
interventionForm.value.organizationName = newVal.organizationName;
|
||||
interventionForm.value.wardName = newVal.wardName;
|
||||
interventionForm.value.bedName = newVal.bedName;
|
||||
watch(
|
||||
() => props.pendingInfo?.encounterId,
|
||||
(newVal, oldVal) => {
|
||||
// 只在 encounterId 存在且发生变化时才获取数据
|
||||
if (newVal && newVal !== oldVal) {
|
||||
loadPatientInfo();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
/* 初始化数据 */
|
||||
@@ -458,8 +473,6 @@ const init = () => {
|
||||
// 主任医生
|
||||
getDoctorInfo({ organizationId: props.pendingInfo.organizationId })
|
||||
.then((res) => {
|
||||
console.log('doctorInfoOptions======>', JSON.stringify(res.data));
|
||||
|
||||
doctorInfoOptions.value = res.data.records || [];
|
||||
nextTick(() => {
|
||||
// 如果存在主任医师显示主任,如果没有选择第一个展示
|
||||
@@ -498,6 +511,7 @@ const rules = reactive<FormRules>({
|
||||
admittingDoctorId: [{ required: true, message: '请选择住院医生', trigger: ['blur', 'change'] }],
|
||||
primaryNurseId: [{ required: true, message: '请选择责任护士', trigger: ['blur', 'change'] }],
|
||||
bedLocationId: [{ required: true, message: '请选择入住床位', trigger: ['blur', 'change'] }],
|
||||
// 主治医生和主任医生为可选字段,不添加 required 验证
|
||||
});
|
||||
|
||||
const printWristband = ref(false);
|
||||
@@ -512,29 +526,10 @@ const cancelAct = () => {
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
// interventionForm.value = {
|
||||
// height: undefined,
|
||||
// weight: undefined,
|
||||
// temperature: undefined,
|
||||
// hertRate: undefined,
|
||||
// pulse: undefined,
|
||||
// endBloodPressure: undefined,
|
||||
// highBloodPressure: undefined,
|
||||
// bedLocationId: '', // 床号
|
||||
// admittingDoctorId: '', // 住院医师
|
||||
// attendingDoctorId: '', // 主治医师
|
||||
// chiefDoctorId: '', // 主任医师
|
||||
// primaryNurseId: '', // 责任护士
|
||||
// priorityEnum: '', //患者病情
|
||||
// organizationName: '',
|
||||
// wardName: '',
|
||||
// attendingDocUpdateId: '',
|
||||
// startTime: '', //入院时间
|
||||
// }
|
||||
|
||||
// 可选:清空校验状态
|
||||
// 只重置表单验证状态,不清空数据
|
||||
// 数据会在下次打开对话框时通过 loadPatientInfo 重新加载
|
||||
if (interventionFormRef.value) {
|
||||
interventionFormRef.value.resetFields();
|
||||
interventionFormRef.value.clearValidate();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -583,19 +578,14 @@ const handleSubmit = async () => {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('表单验证失败:', error);
|
||||
console.error('表单验证失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const openAct = () => {
|
||||
init();
|
||||
if (props.pendingInfo) {
|
||||
interventionForm.value.priorityEnum = props.pendingInfo.priorityEnum || '';
|
||||
interventionForm.value.admittingDoctorId = props.pendingInfo.practitionerId || '';
|
||||
interventionForm.value.organizationName = props.pendingInfo.organizationName || '';
|
||||
interventionForm.value.wardName = props.pendingInfo.wardName || '';
|
||||
interventionForm.value.attendingDocUpdateId = props.pendingInfo.admittingDoctorId || '';
|
||||
}
|
||||
// 重新加载患者详细信息(包括医生、护士等)
|
||||
loadPatientInfo();
|
||||
};
|
||||
|
||||
const closedAct = () => {
|
||||
|
||||
Reference in New Issue
Block a user