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