bpm:增加 OA 请假的详情

pull/2/head
YunaiV 2023-01-21 20:54:33 +08:00
parent b4e86430a3
commit fb06bc8357
4 changed files with 58 additions and 59 deletions

View File

@ -135,7 +135,15 @@ VXETable.setup({
})
// 自定义全局的格式化处理函数
VXETable.formats.mixin({
// 格式日期,默认 yyyy-MM-dd HH:mm:ss
// 格式精简日期,默认 yyyy-MM-dd HH:mm:ss
formatDay({ cellValue }, format) {
if (cellValue != null) {
return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd')
} else {
return ''
}
},
// 格式完整日期,默认 yyyy-MM-dd HH:mm:ss
formatDate({ cellValue }, format) {
if (cellValue != null) {
return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd HH:mm:ss')

View File

@ -1,54 +1,37 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="开始时间:" prop="startTime">
{{ formatDate(form.startTime, '{y}-{m}-{d}') }}
</el-form-item>
<el-form-item label="结束时间:" prop="endTime">
{{ formatDate(form.endTime, '{y}-{m}-{d}') }}
</el-form-item>
<el-form-item label="请假类型:" prop="type">
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="form.type" />
</el-form-item>
<el-form-item label="原因:" prop="reason"> {{ form.reason }}</el-form-item>
</el-form>
</div>
<ContentWrap>
<!-- 详情 -->
<Descriptions :schema="allSchemas.detailSchema" :data="formData" />
</ContentWrap>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
// import
import * as LeaveApi from '@/api/bpm/leave'
import { allSchemas } from '@/views/bpm/oa/leave/leave.data'
import { getLeaveApi } from '@/api/bpm/leave'
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import { useRouter } from 'vue-router'
const router = useRouter()
//
const id = ref()
const { query } = useRoute() //
const message = useMessage() //
const id = ref() //
//
const form = ref({
const formData = ref({
startTime: undefined,
endTime: undefined,
type: undefined,
reason: undefined
})
/** 获得请假信息 */
const getDetail = () => {
getLeaveApi(id.value).then((response) => {
form.value = response.data
})
}
onMounted(() => {
id.value = router.currentRoute.value.query.id
id.value = query.id
if (!id.value) {
ElMessage({
type: 'error',
message: '未传递 id 参数,无法查看 OA 请假信息'
})
message.error('未传递 id 参数,无法查看 OA 请假信息')
return
}
getDetail()
//
LeaveApi.getLeaveApi(id.value).then((data) => {
formData.value = data
})
})
</script>

View File

@ -1,4 +1,5 @@
<template>
<ContentWrap>
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作发起请假 -->
@ -19,6 +20,7 @@
<XTextButton preIcon="ep:edit-pen" title="审批进度" @click="handleProcessDetail(row)" />
</template>
</XTable>
</ContentWrap>
</template>
<script setup lang="ts">

View File

@ -29,17 +29,23 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: t('common.startTimeText'),
field: 'startTime',
formatter: 'formatDate',
formatter: 'formatDay',
table: {
width: 180
},
detail: {
dateFormat: 'YYYY-MM-DD'
}
},
{
title: t('common.endTimeText'),
field: 'endTime',
formatter: 'formatDate',
formatter: 'formatDay',
table: {
width: 180
},
detail: {
dateFormat: 'YYYY-MM-DD'
}
},
{