xiaoyi
3 天以前 5c243d9d05da668a32b1bc9a4f543ea081488d11
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
 
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
 
/** 新增/修改合同指令 */
export function useFormSchema(
  formApi?: VbenFormApi,
): VbenFormSchema[] {
  return [
    {
      fieldName: 'id',
      component: 'Input',
      dependencies: {
        triggerFields: [''],
        show: () => false,
      },
    },
    {
      fieldName: 'contractId',
      label: '合同ID',
      component: 'InputNumber',
      componentProps: {
        class: 'w-full',
        precision: 0,
        placeholder: '合同ID',
      },
      dependencies: {
        triggerFields: [''],
        show: () => false,
      },
    },
    {
      fieldName: 'contractNo',
      label: '合同编号',
      component: 'Input',
      componentProps: {
        placeholder: '合同编号',
        readonly: true,
      },
    },
    {
      fieldName: 'commandType',
      label: '指令类型',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_COMMAND_TYPE),
        placeholder: '请选择指令类型',
        allowClear: true,
      },
      rules: 'required',
    },
    {
      fieldName: 'targetModule',
      label: '目标模块',
      component: 'Select',
      componentProps: {
        allowClear: true,
        options: [
          { label: 'MES 工单', value: 'mes-work-order' },
          { label: 'MES 抄表', value: 'mes-metering' },
          { label: 'SRM 服务单', value: 'srm-service' },
        ],
        placeholder: '请选择目标模块',
      },
    },
    {
      fieldName: 'bizNo',
      label: '业务单号',
      component: 'Input',
      componentProps: {
        placeholder: '请输入业务单号',
      },
    },
    {
      fieldName: 'operatorName',
      label: '操作人',
      component: 'Input',
      componentProps: {
        placeholder: '请输入操作人姓名',
      },
    },
    {
      fieldName: 'operateTime',
      label: '操作时间',
      component: 'DatePicker',
      componentProps: {
        class: '!w-full',
        format: 'YYYY-MM-DD HH:mm:ss',
        showTime: true,
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
      },
    },
    {
      fieldName: 'remark',
      label: '备注',
      component: 'Textarea',
      formItemClass: 'col-span-2',
      componentProps: {
        placeholder: '请输入备注',
        rows: 2,
      },
    },
  ];
}