king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import MenuUtils from '@/utils/utils-custom.js'
 
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, id) {
  let menu = window.GLOB.customMenu
  let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces)
  let books = []
  let bookids = []
  menu.components.forEach(item => {
    if (item.subtype === 'account') {
      books.push({
        value: item.uuid,
        label: item.name
      })
      bookids.push(item.uuid)
    }
  })
 
  let menulist = sessionStorage.getItem('fstMenuList')
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
 
  modules = modules.filter(item => !bookids.includes(item.value))
 
  const wrapForm = [
    // {
    //   type: 'text',
    //   field: 'title',
    //   label: '标题',
    //   initval: wrap.title || '',
    //   required: false
    // },
    {
      type: 'select',
      field: 'type',
      label: '类型',
      initval: wrap.type || 'createVoucher',
      required: true,
      options: [
        {value: 'createVoucher', label: '新增凭证'},
        {value: 'checkVoucher', label: '查看凭证'},
        {value: 'createTemp', label: '新增模板'},
        {value: 'checkTemp', label: '编辑模板'},
      ],
      controlFields: [
        {field: 'businessType', values: ['createVoucher', 'checkVoucher']},
        {field: 'voucherType', values: ['createVoucher', 'checkVoucher']},
        {field: 'voucherTypeText', values: ['createVoucher', 'checkVoucher']},
        {field: 'voucherSign', values: ['createVoucher', 'checkVoucher']},
        {field: 'supModule', values: ['checkTemp', 'checkVoucher']},
        {field: 'attachStatus', values: ['createVoucher', 'checkVoucher']},
      ]
    },
    {
      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: 'businessType',
      label: '业务类型',
      initval: wrap.businessType || 'fcc01',
      required: true
    },
    {
      type: 'text',
      field: 'voucherType',
      label: '凭证类型',
      initval: wrap.voucherType || 'fcc_keeping',
      required: true
    },
    {
      type: 'text',
      field: 'voucherTypeText',
      label: '凭证类型文本',
      initval: wrap.voucherTypeText || '记账凭证',
      required: true
    },
    {
      type: 'text',
      field: 'voucherSign',
      label: '凭证类型标识',
      initval: wrap.voucherSign || 'fcc_keeping',
      required: true
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      options: modules,
      allowClear: true,
    },
    {
      type: 'radio',
      field: 'attachStatus',
      label: '附件状态',
      initval: wrap.attachStatus || 0,
      tooltip: '添加或修改凭证时,上传附件的状态。',
      required: true,
      options: [
        {value: 0, label: '待审核'},
        {value: 10, label: '已审核'},
      ]
    },
    {
      type: 'number',
      field: 'space',
      label: '留白',
      initval: wrap.space || 0,
      tooltip: '表格主体部分两端的空白距离,表格在编辑时两端会有添加和删除图标。',
      required: false
    },
    {
      type: 'cascader',
      field: 'linkmenu',
      label: '刷新菜单',
      initval: wrap.linkmenu || [],
      tooltip: '点击保存时需要刷新的菜单。',
      required: false,
      allowClear: true,
      options: menulist
    }
  ]
 
  return wrapForm