zhangwencui
6 天以前 7619c19a67c2ac824f803090bab753fc5ea14408
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
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesMdClientApi } from '#/api/mes/md/client';
 
import { DICT_TYPE } from '#/packages/constants/src';
 
/** 客户选择弹窗搜索表单 */
export function useClientSelectGridFormSchema(): VbenFormSchema[] {
  return [
    {
      fieldName: 'code',
      label: '客户编码',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入客户编码',
      },
    },
    {
      fieldName: 'name',
      label: '客户名称',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入客户名称',
      },
    },
    {
      fieldName: 'nickname',
      label: '客户简称',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入客户简称',
      },
    },
    {
      fieldName: 'englishName',
      label: '英文名称',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入客户英文名称',
      },
    },
  ];
}
 
/** 客户选择弹窗列表字段 */
export function useClientSelectGridColumns(
  multiple = true,
): VxeTableGridOptions<MesMdClientApi.Client>['columns'] {
  return [
    { type: multiple ? 'checkbox' : 'radio', width: 50 },
    {
      field: 'code',
      title: '客户编码',
      minWidth: 160,
    },
    {
      field: 'name',
      title: '客户名称',
      minWidth: 160,
    },
    {
      field: 'nickname',
      title: '客户简称',
      width: 120,
    },
    {
      field: 'type',
      title: '客户类型',
      width: 110,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.MES_CLIENT_TYPE },
      },
    },
    {
      field: 'contact1Name',
      title: '联系人',
      width: 120,
    },
    {
      field: 'telephone',
      title: '联系电话',
      width: 140,
    },
    {
      field: 'contact1Telephone',
      title: '联系人电话',
      width: 140,
    },
    {
      field: 'status',
      title: '状态',
      width: 100,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.COMMON_STATUS },
      },
    },
  ];
}