1
2
3
4
5
6
7
8
9
10
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
54
55
56
57
58
59
60
61
62
63
64
65
| import type { VbenFormSchema } from '#/adapter/form';
| import type { VxeTableGridOptions } from '#/adapter/vxe-table';
| import type { HrmRegularizeApi } from '#/api/hrm/regularize';
|
| import { getSimpleUserList } from '#/api/system/user';
|
| export const statusOptions = [
| { label: '草稿', value: 0 },
| { label: '审批中', value: 10 },
| { label: '已通过', value: 20 },
| { label: '已驳回', value: 30 },
| { label: '已取消', value: 40 },
| ];
|
| export function useFormSchema(): VbenFormSchema[] {
| return [
| { fieldName: 'id', component: 'Input', dependencies: { triggerFields: [''], show: () => false } },
| {
| fieldName: 'userId', label: '申请人', component: 'ApiSelect',
| componentProps: {
| api: getSimpleUserList, labelField: 'nickname', valueField: 'id',
| allowClear: true, showSearch: true, optionFilterProp: 'label',
| placeholder: '不选则为当前用户',
| },
| },
| {
| fieldName: 'expectedDate', label: '拟转正日期', component: 'DatePicker',
| componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' } },
| rules: 'required',
| },
| {
| fieldName: 'reason', label: '转正原因', component: 'Textarea',
| componentProps: { rows: 4, maxlength: 1000, showCount: true },
| rules: 'required', formItemClass: 'col-span-2',
| },
| {
| fieldName: 'remark', label: '备注', component: 'Textarea',
| componentProps: { rows: 2, maxlength: 500 }, formItemClass: 'col-span-2',
| },
| ];
| }
|
| export function useGridFormSchema(): VbenFormSchema[] {
| return [
| { fieldName: 'no', label: '申请单号', component: 'Input', componentProps: { allowClear: true } },
| {
| fieldName: 'status', label: '审批状态', component: 'Select',
| componentProps: { options: statusOptions, allowClear: true },
| },
| ];
| }
|
| export function useGridColumns(): VxeTableGridOptions<HrmRegularizeApi.Regularize>['columns'] {
| return [
| { field: 'no', title: '申请单号', minWidth: 175 },
| { field: 'userName', title: '申请人', minWidth: 110 },
| { field: 'deptName', title: '部门', minWidth: 120 },
| { field: 'expectedDate', title: '拟转正日期', width: 125 },
| { field: 'reason', title: '转正原因', minWidth: 200, showOverflow: true },
| { field: 'status', title: '状态', width: 105, slots: { default: 'status' } },
| { field: 'reviewerName', title: '审核人', width: 110 },
| { field: 'createTime', title: '创建时间', width: 180, formatter: 'formatDateTime' },
| { field: 'actions', title: '操作', fixed: 'right', width: 300, slots: { default: 'actions' } },
| ];
| }
|
|