Compare commits
2 Commits
1fbed5c595
...
150ecc057f
| Author | SHA1 | Date | |
|---|---|---|---|
| 150ecc057f | |||
| d54ad5ef88 |
@@ -548,6 +548,8 @@ const dialogReadOnly = ref(false);
|
|||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
// 保存按钮加载状态,防止重复提交
|
// 保存按钮加载状态,防止重复提交
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
|
// 数据加载中标志,防止 showReport 加载已有数据时 watch 清空分型字段
|
||||||
|
const loadingData = ref(false);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
@@ -940,7 +942,8 @@ const showSubtypeSelect = computed(() => {
|
|||||||
// 监听疾病选择变化,自动清空分型选择
|
// 监听疾病选择变化,自动清空分型选择
|
||||||
watch(() => [form.value.selectedClassA, form.value.selectedClassB, form.value.selectedClassC], (newVal, oldVal) => {
|
watch(() => [form.value.selectedClassA, form.value.selectedClassB, form.value.selectedClassC], (newVal, oldVal) => {
|
||||||
// 如果疾病选择发生变化,清空分型选择
|
// 如果疾病选择发生变化,清空分型选择
|
||||||
if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
|
// 数据加载中时不清空,避免 showReport 加载已有数据时被错误清空
|
||||||
|
if (JSON.stringify(newVal) !== JSON.stringify(oldVal) && !loadingData.value) {
|
||||||
form.value.diseaseType = '';
|
form.value.diseaseType = '';
|
||||||
}
|
}
|
||||||
}, { deep: true });
|
}, { deep: true });
|
||||||
@@ -1092,6 +1095,9 @@ function showReport(reportData = {}, readOnly = true) {
|
|||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
dialogReadOnly.value = readOnly;
|
dialogReadOnly.value = readOnly;
|
||||||
|
|
||||||
|
// 标记数据加载中,防止 watch 清空 diseaseType 分型字段
|
||||||
|
loadingData.value = true;
|
||||||
|
|
||||||
resetAddressSelector();
|
resetAddressSelector();
|
||||||
initProvinceOptions();
|
initProvinceOptions();
|
||||||
|
|
||||||
@@ -1149,6 +1155,9 @@ function showReport(reportData = {}, readOnly = true) {
|
|||||||
form.value.addressCounty,
|
form.value.addressCounty,
|
||||||
form.value.addressTown
|
form.value.addressTown
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 数据加载完成,恢复 watch 监听
|
||||||
|
loadingData.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1058,7 +1058,7 @@ function confirmCharge() {
|
|||||||
|
|
||||||
addVitalSigns(params).then(res => {
|
addVitalSigns(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.msgSuccess('保存成功');
|
proxy.$modal.msgSuccess('保存成功');
|
||||||
// 保存成功后刷新列表
|
// 保存成功后刷新列表
|
||||||
getPatientList();
|
getPatientList();
|
||||||
// 清空表单
|
// 清空表单
|
||||||
@@ -1088,6 +1088,9 @@ function confirmCharge() {
|
|||||||
stoolVolume: '',
|
stoolVolume: '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('保存体征数据失败:', err);
|
||||||
|
proxy.$modal.msgError('保存失败,请重试');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 重置操作表单 */
|
/** 重置操作表单 */
|
||||||
|
|||||||
Reference in New Issue
Block a user