fix(#783): zhaoyun (文件合入)
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="hasUnsavedDiagnosis"
|
||||
@click="handleAddDiagnosis()"
|
||||
>
|
||||
新增诊断
|
||||
@@ -98,12 +99,19 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="hasUnsavedDiagnosis"
|
||||
@click="handleImport()"
|
||||
>
|
||||
导入慢性病诊断
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="hasUnsavedDiagnosis"
|
||||
class="unsaved-diagnosis-tip"
|
||||
>
|
||||
<el-icon><WarningFilled /></el-icon> 当前有未保存的诊断,请先保存后再新增
|
||||
</div>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
@@ -377,7 +385,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance, ref, watch} from 'vue'; // 添加 nextTick 导入
|
||||
import {getCurrentInstance, ref, computed, watch} from 'vue'; // 添加 nextTick 导入
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import {
|
||||
delEncounterDiagnosis,
|
||||
@@ -414,6 +422,13 @@ const syndromeOptions = ref([]);
|
||||
const form = ref({
|
||||
diagnosisList: [],
|
||||
});
|
||||
|
||||
// 计算属性:是否有未保存的新诊断
|
||||
const hasUnsavedDiagnosis = computed(() => {
|
||||
return (form.value.diagnosisList || []).some(
|
||||
(item) => !item.conditionId && !item.encounterDiagnosisId
|
||||
);
|
||||
});
|
||||
const props = defineProps({
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
@@ -1162,5 +1177,14 @@ defineExpose({ getList, getDetail, handleSaveDiagnosis });
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.unsaved-diagnosis-tip {
|
||||
margin-bottom: 10px;
|
||||
color: #E6A23C;
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user