houzhongjian
2024-07-11 759b1c71011abd6b58c37d2566f3f3c208c2f1b2
提交 | 用户 | 时间
759b1c 1 <template>
H 2   <div class="app-container">
3     <!-- 对话框(添加 / 修改) -->
4       <el-form ref="form" :model="form" label-width="100px">
5         <el-form-item label="开始时间:" prop="startTime"> {{parseTime(form.startTime, '{y}-{m}-{d}')}} </el-form-item>
6         <el-form-item label="结束时间:" prop="endTime"> {{parseTime(form.endTime, '{y}-{m}-{d}')}} </el-form-item>
7         <el-form-item label="请假类型:" prop="type">
8           <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="form.type"/>
9         </el-form-item>
10         <el-form-item label="原因:" prop="reason"> {{ form.reason }}</el-form-item>
11       </el-form>
12   </div>
13 </template>
14
15 <script>
16 import { getLeave}  from "@/api/bpm/leave"
17 import {getDictDatas, DICT_TYPE} from '@/utils/dict'
18 export default {
19   name: "BpmOALeaveDetail",
20   components: {
21   },
22   props: {
23     id: {
24       type: [String, Number],
25       default: undefined
26     },
27   },
28   data() {
29     return {
30       leaveId: undefined, // 请假编号
31       // 表单参数
32       form: {
33         startTime: undefined,
34         endTime: undefined,
35         type: undefined,
36         reason: undefined,
37       },
38
39       typeDictData: getDictDatas(DICT_TYPE.BPM_OA_LEAVE_TYPE),
40     };
41   },
42   created() {
43     this.leaveId = this.id || this.$route.query.id;
44     if (!this.leaveId) {
45       this.$message.error('未传递 id 参数,无法查看 OA 请假信息');
46       return;
47     }
48     this.getDetail();
49   },
50   methods: {
51     /** 获得请假信息 */
52     getDetail() {
53       getLeave(this.leaveId).then(response => {
54         this.form = response.data;
55       });
56     },
57   }
58 };
59 </script>