FlowBL/src/views/bpm/oa/leave/detail.vue

41 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2023-04-09 12:27:22 +08:00
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="200">
<el-descriptions border :column="1">
<el-descriptions-item label="请假类型">
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" />
</el-descriptions-item>
<el-descriptions-item label="开始时间">
{{ formatDate(detailData.startTime) }}
</el-descriptions-item>
<el-descriptions-item label="结束时间">
{{ formatDate(detailData.endTime) }}
</el-descriptions-item>
<el-descriptions-item label="原因">
{{ detailData.reason }}
</el-descriptions-item>
</el-descriptions>
</Dialog>
</template>
<script setup lang="ts">
2023-04-09 12:27:22 +08:00
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as LeaveApi from '@/api/bpm/leave'
2023-04-09 12:27:22 +08:00
const modelVisible = ref(false) // 弹窗的是否展示
const detailLoading = ref(false) // 表单的加载中
const detailData = ref() // 详情数据
2023-03-03 15:27:52 +08:00
2023-04-09 12:27:22 +08:00
/** 打开弹窗 */
const open = async (data: LeaveApi.LeaveVO) => {
modelVisible.value = true
// 设置数据
detailLoading.value = true
try {
detailData.value = data
} finally {
detailLoading.value = false
}
2023-04-09 12:27:22 +08:00
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
</script>