|
|
@@ -128,6 +128,7 @@
|
|
|
@import-card="importCardFun"
|
|
|
:title="'床头卡预览'"
|
|
|
:width="'1080px'"
|
|
|
+ @edit="handleEdit"
|
|
|
@close="handleDialogClose"
|
|
|
/>
|
|
|
<!-- 分享卡弹窗组件 -->
|
|
|
@@ -150,6 +151,8 @@
|
|
|
:width="'600px'"
|
|
|
@close="handleDialogClose"
|
|
|
/>
|
|
|
+
|
|
|
+ <Form ref="formRefE" @success="getElderInfoById(idE)" />
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
|
|
@@ -179,8 +182,10 @@ import { formatTime } from '@/utils'
|
|
|
|
|
|
import { getElderHealthRecordById } from '@/api/elderly/elder/health-record'
|
|
|
import { getDictLabel, DICT_TYPE } from '@/utils/dict'
|
|
|
+import Form from '@/views/elderly/elder/health-record/Form.vue'
|
|
|
defineOptions({ name: 'ElderFileDetail' })
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
+const formRefE = ref() // 表单 Ref
|
|
|
const bed = ref() // 表单 Ref
|
|
|
const dataForm = ref<{
|
|
|
elderName?: string
|
|
|
@@ -281,8 +286,10 @@ const routeArr = [
|
|
|
|
|
|
const route = useRoute()
|
|
|
const healthRecord = ref({})
|
|
|
+let idE = undefined
|
|
|
onMounted(async () => {
|
|
|
const { id } = route.params
|
|
|
+ idE = id
|
|
|
activeName.value = 1
|
|
|
// 获取长者详情
|
|
|
try {
|
|
|
@@ -342,6 +349,17 @@ const showCardDoor = () => {
|
|
|
const handleDialogClose = () => {
|
|
|
console.log('床头卡弹窗已关闭')
|
|
|
}
|
|
|
+const handleEdit = () => {
|
|
|
+ // 先显式关闭床头卡弹窗,再等关闭动画结束(约 300ms)后再跳转。
|
|
|
+ // 否则 el-dialog 的关闭动画会被 <keep-alive> 的路由切换打断,
|
|
|
+ // 弹窗内部动画状态会卡住,导致返回后再点关闭预览关不掉(log 仍会打)。
|
|
|
+ dialogVisible.value = false
|
|
|
+ setTimeout(() => {
|
|
|
+ router.push({
|
|
|
+ path: '/trend-charts/health-record'
|
|
|
+ })
|
|
|
+ }, 350)
|
|
|
+}
|
|
|
|
|
|
const importCardFun = () => {
|
|
|
importCard(healthRecord.value, dataForm.value)
|