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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
| /**
| * 贴息开票申请-提交
| */
|
| import ApiModel from '@/utils/core/apiModel'
|
| // 表单信息
| const formList = [
| {
| type: 'input',
| label: '发票申请编号',
| value: '',
| name: 'invoiceSerialno',
| attrs: ['readonly']
| },
| // {
| // type: 'input',
| // label: '开票申请主题',
| // value: '',
| // name: 'invoiceTheMes',
| // rules: [{ required: true }]
| // },
| {
| type: 'input',
| label: '开票申请说明',
| value: '',
| name: 'invoiceApplyState'
| },
| {
| type: 'customer',
| label: '合作商名称',
| value: '',
| name: 'enterpriseName',
| rules: ['required']
| },
| // {
| // type: 'customer',
| // label: '选择合作商',
| // value: '',
| // name: 'enterprise',
| // attrs: ['readonly']
| // },
| {
| type: 'select',
| label: '开票类型',
| value: '',
| name: 'invoiceType',
| rules: ['required'],
| descName: 'invoiceTypeDesc'
| },
| {
| type: 'input',
| label: '发票销售方',
| value: '',
| name: 'invoiceSeller',
| rules: ['required']
| },
| {
| type: 'input',
| label: '发票购买方',
| value: '',
| name: 'invoiceBuyer',
| rules: ['required']
| },
| {
| type: 'input',
| label: '发票购买方地址',
| value: '',
| name: 'taxpayerAddress'
| },
| {
| type: 'input',
| label: '发票购买方电话',
| value: '',
| name: 'taxpayerPhone'
| },
| // {
| // type: 'input',
| // label: '发票邮寄地址',
| // value: '',
| // name: 'mailingAddress'
| // },
| // {
| // type: 'select',
| // label: '发票邮寄方式',
| // value: '',
| // name: 'orderWay',
| // rules: ['required'],
| // descName: 'orderWayDesc'
| // },
| // {
| // type: 'input',
| // label: '发票联系人',
| // value: '',
| // name: 'contactsName'
| // },
|
| {
| type: 'select',
| label: '发票购买方开户银行',
| value: '',
| name: 'taxpayerBankCode',
| descName: 'taxpayerBankName'
| },
| {
| type: 'input',
| label: '发票购买方银行账户',
| value: '',
| name: 'taxpayerAccount'
| },
| {
| type: 'input',
| label: '发票购买方纳税识别号',
| value: '',
| name: 'taxpayerIdentifier',
| rules: ['required']
| },
| {
| type: 'input',
| label: '发票购买方联系电话',
| value: '',
| name: 'contactsPhone'
| },
| {
| type: 'input',
| label: '发票接受邮箱',
| value: '',
| name: 'email'
| },
| // {
| // type: 'input',
| // label: '纳税人地址',
| // value: '',
| // name: 'taxpayerAddress'
| // },
| {
| type: 'input',
| label: '开票申请金额',
| value: '',
| name: 'applyMoney',
| attrs: ['readonly'],
| isMoney: true
| }
| ]
|
| // 详情表单信息
| const detailList = [
| {
| type: 'input',
| label: '发票代码',
| value: '',
| name: 'orderCode',
| rules: ['required']
| },
| {
| type: 'input',
| label: '发票金额',
| value: '',
| name: 'orderMoney',
| rules: ['required'],
| isMoney: true
| },
| {
| type: 'date',
| label: '开票日期',
| value: '',
| name: 'createDate',
| rules: ['required']
| },
| {
| type: 'input',
| label: '已关联贴息金额',
| value: '',
| name: 'relativeAmount',
| attrs: ['readonly'],
| isMoney: true
| },
| {
| type: 'input',
| label: '未关联贴息金额',
| value: '',
| name: 'unRelativeAmount',
| attrs: ['readonly'],
| isMoney: true
| }
| ]
|
| // 100 申请贴息开票,101 贴息开票受理,102 财务贴息开票,103 贴息开票明细查询,
|
| export default (options = {}) => {
| // 接口地址: required
| const api = 'server/submitDiscountInvoice'
| const { pageId, transCode } = options
|
| let temp = [...formList]
| let readonlyKeys = []
| let noRequiredKeys = []
| if (pageId === '101') {
| readonlyKeys = ['enterpriseName']
| noRequiredKeys = ['invoiceType']
| }
| if (pageId === '102') {
| // 贴息开票调整
| const arr =
| transCode === 'DI0003' ? ['orderCode', 'orderMoney', 'createDate'] : []
| readonlyKeys = [...arr, ...formList.map(({ name }) => name)]
| temp = [...formList, ...detailList]
| }
|
| temp = temp.map(item => {
| const { name, type } = item
| if (readonlyKeys.includes(name)) {
| return {
| ...item,
| type: type === 'customer' ? 'input' : type,
| attrs: ['readonly'],
| rules: []
| }
| }
| if (noRequiredKeys.includes(item.name)) {
| return {
| ...item,
| attrs: [],
| rules: []
| }
| }
| return {
| ...item
| }
| })
|
| return new ApiModel({
| api,
| formList: temp,
| request(body) {
| return this.post(body)
| }
| })
| }
|
|