提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<ContentWrap> |
|
3 |
<el-descriptions :column="1" border> |
|
4 |
<el-descriptions-item label="请假类型"> |
|
5 |
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" /> |
|
6 |
</el-descriptions-item> |
|
7 |
<el-descriptions-item label="开始时间"> |
|
8 |
{{ formatDate(detailData.startTime, 'YYYY-MM-DD') }} |
|
9 |
</el-descriptions-item> |
|
10 |
<el-descriptions-item label="结束时间"> |
|
11 |
{{ formatDate(detailData.endTime, 'YYYY-MM-DD') }} |
|
12 |
</el-descriptions-item> |
|
13 |
<el-descriptions-item label="原因"> |
|
14 |
{{ detailData.reason }} |
|
15 |
</el-descriptions-item> |
|
16 |
</el-descriptions> |
|
17 |
</ContentWrap> |
|
18 |
</template> |
|
19 |
<script lang="ts" setup> |
|
20 |
import { DICT_TYPE } from '@/utils/dict' |
|
21 |
import { formatDate } from '@/utils/formatTime' |
|
22 |
import { propTypes } from '@/utils/propTypes' |
|
23 |
import * as LeaveApi from '@/api/bpm/leave' |
|
24 |
|
|
25 |
defineOptions({ name: 'BpmOALeaveDetail' }) |
|
26 |
|
|
27 |
const { query } = useRoute() // 查询参数 |
|
28 |
|
|
29 |
const props = defineProps({ |
|
30 |
id: propTypes.number.def(undefined) |
|
31 |
}) |
|
32 |
const detailLoading = ref(false) // 表单的加载中 |
|
33 |
const detailData = ref<any>({}) // 详情数据 |
|
34 |
const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编号 |
|
35 |
|
|
36 |
/** 获得数据 */ |
|
37 |
const getInfo = async () => { |
|
38 |
detailLoading.value = true |
|
39 |
try { |
|
40 |
detailData.value = await LeaveApi.getLeave(props.id || queryId) |
|
41 |
} finally { |
|
42 |
detailLoading.value = false |
|
43 |
} |
|
44 |
} |
|
45 |
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗 |
|
46 |
|
|
47 |
/** 初始化 **/ |
|
48 |
onMounted(() => { |
|
49 |
getInfo() |
|
50 |
}) |
|
51 |
</script> |