approval.vue
11.4 KB
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<template>
<div class="maincontent">
<a-modal title="创建方式" destroyOnClose :width="450" v-model="visible" :confirmLoading="confirmLoading"
@cancel="handleCancel" :zIndex="10000" :footer="null">
<div>
<div class="labelClass">是否将当前项加入到项目中??</div>
<div class="buttonClass">
<a-button @click="subcommitCreate" type="primary" class="yesButton">是</a-button>
<a-button @click="subcommitNullCreate" class="noButton">否</a-button>
</div>
</div>
</a-modal>
</div>
</template>
<script>
import { preProductGetData, postAction, saveProduct, updateProduct, getFundProductSelect } from '@/api/configApi'
export default {
name: 'approval',
data() {
return {
visible: false,
confirmLoading: false,
confirmDirty: false,
title: '',
shoping: [],
isLimitType: 1,
validatorRules: {
productNo: {
rules: [
{
required: true,
message: '请输入产品编号'
}
]
},
businessChannelNos: {
rules: [
{
required: true,
message: '请选择业务渠道'
}
]
},
productName: {
rules: [
{
required: true,
message: '请输入产品名称'
}
]
},
billOut: {
rules: [
{
required: true,
message: '请选择是否出账单'
}
]
},
minInterestDay: {
rules: [
{
required: true,
message: '请填写最小计息天数'
}
]
},
interestRate: {
rules: [
{
required: true,
message: '请填写产品正常利率'
}
]
},
contractAuthorizationNos: {
rules: [
{
required: true,
message: '请选择授信协议类合同'
}
]
},
contractCreditNos: {
rules: [
{
required: true,
message: '请选择用信协议类合同'
}
]
},
fundInterestRate: {
rules: [
{
required: true,
message: '请填写资金方利率'
}
]
},
fundPenaltyRate: {
rules: [
{
required: true,
message: '请填写资金方罚息利率'
}
]
},
fundCompoundRate: {
rules: [
{
required: true,
message: '请填写资金方复利率'
}
]
},
fundNo: {
rules: [
{
required: true,
message: '请选择资金方'
}
]
},
charges: {
rules: [
{
required: true,
message: '请选择产品费用'
}
]
},
penaltyRate: {
rules: [
{
required: true,
message: '请填写产品罚息利率'
}
]
},
buybackFlag: {
rules: [
{
required: true,
message: '请选择回购标示'
}
]
},
repaymentTemplateNo: {
rules: [
{
required: true,
message: '请选择还款模板'
}
]
},
type: {
rules: [
{
required: true,
message: '请选择产品分类'
}
]
},
userType: {
rules: [
{
required: true,
message: '请选择客户类型'
}
]
},
limitMoneyFlag: {
rules: [
{
required: true,
message: '请选择是否有放款限额'
}
]
},
term: {
rules: [
{
required: true,
message: '请输入账单期限'
}
]
},
repaymentType: {
rules: [
{
required: true,
message: '请选择还款方式'
}
]
},
confirmpassword: {
rules: [
{
required: true,
message: '请重新输入登陆密码!'
},
{
validator: this.compareToFirstPassword
}
]
}
},
model: {},
labelCol: {
xs: { span: 8 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 8 },
sm: { span: 12 }
},
chargeList: [],
fundList: [],
contractTemplateList: [],
businessChannelList: [],
repaymentTemplateList: [],
isLimitClassity: 1,
isLimitBuyBack: 1,
form: this.$form.createForm(this)
}
},
created() {
this.initData();
this.businessChannelData();
},
methods: {
handleChangeBuyback(value) {
this.isLimitBuyBack = value.target.value
},
handleChangeClassity(value) {
this.isLimitClassity = value.target.value
},
handleChange(value) {
this.isLimitType = value.target.value
},
initData() {
console.log("ssssss")
preProductGetData().then(res => {
this.chargeList = res.result.chargeList;
this.fundList = res.result.fundList;
this.contractTemplateList = res.result.contractTemplateList;
this.repaymentTemplateList = res.result.repaymentTemplateList
})
},
businessChannelData() { //业务渠道
let _p = {
pageNo: 1,
pageSize: 10000,
params: {}
}
postAction('/config/admin/queryBusinessChannelList', _p).then(res => {
this.businessChannelList = res.result.records.filter(item => item.status == 1)
})
},
edit(record) {
this.model = record;
this.isLimitClassity = record.termType
this.isLimitType = record.limitMoneyFlag
console.log(this.isLimitType)
this.form.resetFields();
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(record);
});
},
add(e) {
e.stopPropagation()
this.visible = true
// this.model = {};
// this.form.resetFields();
// this.visible = true;
// this.$nextTick(() => {
// this.form.setFieldsValue();
// });
},
shop(value) {
// console.log(value)
getFundProductSelect({ fundNo: value }).then(res => {
if (res.status.statusCode == 0) {
this.shoping = res.result
} else {
}
})
},
close() {
this.$emit('close');
this.visible = false;
this.disableSubmit = false;
this.selectedRole = [];
},
handleSubmit() {
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true;
let formData = values, promiseFn, arr = [];
for (let i = 0; i < this.chargeList.length; i++) {
for (let j = 0; j < formData.charges.length; j++) {
if (formData.charges[j] == this.chargeList[i].chargeNo) {
let obj = {
chargeNo: this.chargeList[i].chargeNo,
chargeVersion: this.chargeList[i].chargeVersion
}
arr.push(obj)
}
}
}
formData.charges = arr
formData.productVersion = this.model.productVersion
if (!!this.model.id) { //编辑
promiseFn = updateProduct(formData);
} else {
promiseFn = saveProduct(formData)
}
promiseFn.then((res) => {
if (res.status.statusCode == 0) {
this.$message.success(res.status.statusReason);
this.$emit('ok');
} else {
this.$message.warning(res.status.statusReason);
}
}).finally(() => {
this.confirmLoading = false;
this.close();
});
}
})
},
handleCancel() {
this.close()
}
}
}
</script>