2023-02-11 00:44:00 +08:00
|
|
|
<template>
|
2023-04-11 20:41:20 +08:00
|
|
|
<Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="200">
|
2023-04-09 12:27:22 +08:00
|
|
|
<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>
|
2023-02-11 00:44:00 +08:00
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
2023-04-09 12:27:22 +08:00
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
2023-02-11 00:44:00 +08:00
|
|
|
import * as LeaveApi from '@/api/bpm/leave'
|
|
|
|
|
2023-04-11 20:41:20 +08:00
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
2023-04-09 12:27:22 +08:00
|
|
|
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) => {
|
2023-04-11 20:41:20 +08:00
|
|
|
dialogVisible.value = true
|
2023-04-09 12:27:22 +08:00
|
|
|
// 设置数据
|
|
|
|
detailLoading.value = true
|
|
|
|
try {
|
|
|
|
detailData.value = data
|
|
|
|
} finally {
|
|
|
|
detailLoading.value = false
|
2023-02-11 00:44:00 +08:00
|
|
|
}
|
2023-04-09 12:27:22 +08:00
|
|
|
}
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
2023-02-11 00:44:00 +08:00
|
|
|
</script>
|