detail.vue 1.51 KB
Newer Older
sunhongwei's avatar
sunhongwei committed
1 2 3 4
<template>
  <div class="app-container">
    <!-- 对话框(添加 / 修改) -->
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
Marcus's avatar
Marcus committed
5 6 7
        <el-form-item :label="$t('开始时间:')" prop="startTime"> {{parseTime(form.startTime, '{y}-{m}-{d}')}} </el-form-item>
        <el-form-item :label="$t('结束时间:')" prop="endTime"> {{parseTime(form.endTime, '{y}-{m}-{d}')}} </el-form-item>
        <el-form-item :label="$t('请假类型:')" prop="type">
sunhongwei's avatar
sunhongwei committed
8 9
          <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="form.type"/>
        </el-form-item>
Marcus's avatar
Marcus committed
10
        <el-form-item :label="$t('原因:')" prop="reason"> {{ form.reason }}</el-form-item>
sunhongwei's avatar
sunhongwei committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
      </el-form>
  </div>
</template>

<script>
import { getLeave}  from "@/api/bpm/leave"
import {getDictDatas, DICT_TYPE} from '@/utils/dict'
export default {
  name: "LeaveDetail",
  components: {
  },
  data() {
    return {
      id: undefined, // 请假编号
      // 表单参数
      form: {
        startTime: undefined,
        endTime: undefined,
        type: undefined,
        reason: undefined,
      },

      typeDictData: getDictDatas(DICT_TYPE.BPM_OA_LEAVE_TYPE),
    };
  },
  created() {
    this.id = this.$route.query.id;
    if (!this.id) {
      this.$message.error('未传递 id 参数,无法查看 OA 请假信息');
      return;
    }
    this.getDetail();
  },
  methods: {
    /** 获得请假信息 */
    getDetail() {
      getLeave(this.id).then(response => {
        this.form = response.data;
      });
    },
  }
};
</script>