门诊号码管理修改关闭给予保存提示

This commit is contained in:
2025-11-24 10:45:27 +08:00
parent 97a29a31c5
commit 61749aee4d
2 changed files with 48 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
<template> <template>
<!-- Windows XP风格窗口布局600px固定宽度 --> <div>
<div class="outpatient-no-management-wrapper"> <!-- Windows XP风格窗口布局600px固定宽度 -->
<div class="outpatient-no-management-wrapper">
<div class="outpatient-no-management"> <div class="outpatient-no-management">
<!--标题栏32px高 --> <!--标题栏32px高 -->
<div class="title-bar"> <div class="title-bar">
@@ -112,10 +113,10 @@
/> />
</div> </div>
</div> </div>
</div> </div>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="600px" append-to-body> <el-dialog v-model="dialogVisible" :title="dialogTitle" width="600px" append-to-body>
<el-form label-width="100px"> <el-form label-width="100px">
<el-form-item label="操作员"> <el-form-item label="操作员">
<el-input v-model="editForm.operatorName" disabled /> <el-input v-model="editForm.operatorName" disabled />
@@ -142,7 +143,8 @@
<el-button type="primary" @click="confirmEdit"> </el-button> <el-button type="primary" @click="confirmEdit"> </el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
</div>
</template> </template>
<script setup name="outpatientNoManagement"> <script setup name="outpatientNoManagement">
@@ -238,7 +240,40 @@ function onStartNoChange(row) {
} }
function onClose() { function onClose() {
proxy.$tab.closePage() // 检查是否有未保存的数据变动
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 }) { function tableRowClassName({ row }) {

View File

@@ -189,7 +189,7 @@
</template> </template>
<script setup name="Index"> <script setup name="Index">
import { ref, onMounted } from 'vue'; import { ref, onMounted, onActivated } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import Chart from 'chart.js/auto'; import Chart from 'chart.js/auto';
import { import {
@@ -214,6 +214,10 @@ function getExpirationWarningCount() {
let chartInstance = null; let chartInstance = null;
onActivated(() => {
getExpirationWarningCount();
})
onMounted(() => { onMounted(() => {
getExpirationWarningCount(); getExpirationWarningCount();