king
2024-06-07 8040a18c4b2a848d252bf01838f06c7aec1be9f3
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
/**
 * @description Wrap表单配置信息
 */
export default function (wrap) {
  let menu = window.GLOB.customMenu
  let books = []
  let bookids = []
  menu.components.forEach(item => {
    if (item.subtype === 'account') {
      books.push({
        value: item.uuid,
        label: item.name
      })
      bookids.push(item.uuid)
    }
  })
 
  const wrapForm = [
    {
      type: 'radio',
      field: 'datatype',
      label: '类型',
      initval: wrap.datatype || 'static',
      required: true,
      options: [
        {value: 'static', label: '新增发票'},
        {value: 'dynamic', label: '查看单据'},
      ]
    },
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'select',
      field: 'supBook',
      label: '账套',
      initval: wrap.supBook || '',
      required: true,
      options: books,
      allowClear: true
    },
    {
      type: 'text',
      field: 'business_type',
      label: '开票类型',
      initval: wrap.business_type || 'sell_01',
      required: true
    },
    {
      type: 'color',
      field: 'invColor',
      label: '样式',
      initval: wrap.invColor || '',
      tooltip: '发票组件中边框以及文字的颜色。',
      allowClear: true,
      required: false
    },
    {
      type: 'radio',
      field: 'backBtn',
      label: '返回按钮',
      initval: wrap.backBtn || 'hide',
      required: true,
      options: [
        {value: 'hide', label: '隐藏'},
        {value: 'show', label: '显示'},
      ]
    },
  ]
 
  return wrapForm