门诊号码管理修改关闭给予保存提示
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- Windows XP风格窗口布局,600px固定宽度 -->
|
||||
<div class="outpatient-no-management-wrapper">
|
||||
<div class="outpatient-no-management">
|
||||
@@ -143,6 +144,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="outpatientNoManagement">
|
||||
@@ -238,7 +240,40 @@ function onStartNoChange(row) {
|
||||
}
|
||||
|
||||
function onClose() {
|
||||
// 检查是否有未保存的数据变动
|
||||
const hasUnsavedChanges = tableData.value.some(row => row._dirty || row._editing)
|
||||
|
||||
if (hasUnsavedChanges) {
|
||||
// 有未保存的数据,提示用户
|
||||
const message = '窗口数据有变动是否进行保存操作?'
|
||||
|
||||
if (proxy.$modal?.confirm) {
|
||||
proxy.$modal.confirm(message).then(() => {
|
||||
// 用户选择保存
|
||||
onSave()
|
||||
// 等待保存完成后关闭页面
|
||||
setTimeout(() => {
|
||||
proxy.$tab.closePage()
|
||||
}, 800)
|
||||
}).catch(() => {
|
||||
// 用户选择不保存,直接关闭
|
||||
proxy.$tab.closePage()
|
||||
})
|
||||
} else {
|
||||
// 降级方案:使用原生 confirm
|
||||
if (confirm(message)) {
|
||||
onSave()
|
||||
setTimeout(() => {
|
||||
proxy.$tab.closePage()
|
||||
}, 800)
|
||||
} else {
|
||||
proxy.$tab.closePage()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有未保存的数据,直接关闭
|
||||
proxy.$tab.closePage()
|
||||
}
|
||||
}
|
||||
|
||||
function tableRowClassName({ row }) {
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Index">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, onActivated } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import Chart from 'chart.js/auto';
|
||||
import {
|
||||
@@ -214,6 +214,10 @@ function getExpirationWarningCount() {
|
||||
|
||||
let chartInstance = null;
|
||||
|
||||
onActivated(() => {
|
||||
getExpirationWarningCount();
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getExpirationWarningCount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user