setStatus.vue
7.79 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
<template>
<div>
<a-modal
title="设置"
:width="500"
:centered="true"
:visible="visible"
cancelText="取消"
@ok="queren"
@cancel="cancle"
:maskClosable="false"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<!-- <a-form-item label="客户主体类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入参数编号" v-decorator="[ 'username', validatorRules.username]" />
</a-form-item>-->
<!-- <a-form-item label="用户额度状态:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-decorator="[ 'creditStatus', {}]" placeholder="请选择状态">
<a-select-option :value="1">正常</a-select-option>
<a-select-option :value="3">锁定</a-select-option>
</a-select>
</a-form-item> -->
<a-form-item label="客户名称" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入客户名称"
v-decorator="[
'customerName',
{
initialValue: records ? records.customerName : '',
rules: [{ required: true, message: '请输入客户名称' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="额度编号" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入额度编号"
v-decorator="[
'creditNo',
{
initialValue: records ? records.creditNo : '',
rules: [{ required: true, message: '请输入额度编号' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="主体类型:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }">
<a-select
v-decorator="[
'customerType',
{
initialValue: records ? records.customerType : '',
rules: [{ required: true, message: '请输入综合可用' }],
},
]"
placeholder="请选主体类型"
:disabled="true"
>
<a-select-option :value="1">个人</a-select-option>
<a-select-option :value="2">企业</a-select-option>
<a-select-option :value="3">未知</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="综合额度(元)" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入综合额度"
v-decorator="[
'originalComprehensiveAmount',
{
initialValue: records ? records.originalComprehensiveAmount : '',
rules: [{ required: true, message: '请输入综合额度' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="综合已用" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入综合已用"
v-decorator="[
'creditAmountUsed',
{
initialValue: records ? records.creditAmountUsed : '',
rules: [{ required: true, message: '请输入综合已用' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="在途金额(元)" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入在途金额"
v-decorator="[
'creditAmountFloat',
{
initialValue: records ? records.creditAmountFloat : '',
rules: [{ required: true, message: '请输入在途金额' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="综合可用" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入综合可用"
v-decorator="[
'creditAmountUseable',
{
initialValue: records ? records.creditAmountUseable : '',
rules: [{ required: true, message: '请输入综合可用' }],
},
]"
:readOnly="true"
/>
</a-form-item>
<a-form-item label="调整额度(元)" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入调整额度"
v-decorator="[
'adjustComprehensiveAmount',
{
initialValue: records ? records.adjustComprehensiveAmount : '',
rules: [{ required: true, message: '请输入调整额度' }],
},
]"
/>
</a-form-item>
<a-form-item label="备注" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" hasFeedback>
<a-input
placeholder="请输入备注"
type="textarea"
v-decorator="[
'remark',
{
initialValue: records ? records.remark : '',
},
]"
/>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</div>
</template>
<script>
import { changPassword } from '@/api/api'
import { creditAmountModify,updateCreditAdjustAmount } from '@/api/configApi'
export default {
name: 'setModal',
props: {},
data() {
return {
visible: false,
detailFlag: false,
title: '',
records: {},
confirmLoading: false,
confirmDirty: false,
validatorRules: {
creditStatus: {
rules: [
{
required: true,
message: '请选择状态',
},
],
},
},
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
form: this.$form.createForm(this),
}
},
created() {},
methods: {
onChange() {},
cancle() {
this.visible = false
},
edit(res) {
console.log(res)
this.records = res
if(res.enterpriseName){
this.records.customerName = res.enterpriseName
this.records.originalComprehensiveAmount = res.creditAmount
}else{
this.records.customerName = res.idCardName
this.records.originalComprehensiveAmount = res.creditAmount
}
this.form.resetFields()
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(res)
})
},
queren() {
this.form.validateFields((err, values) => {
if (!err) {
let formData = Object.assign({ id: this.records.id, customerType: this.records.customerType }, values)
updateCreditAdjustAmount(formData)
.then((res) => {
this.confirmLoading = false
if (res.status.statusCode == 0) {
this.$message.success(res.status.statusReason)
this.$emit('queren')
} else {
this.$message.warning(res.status.statusReason)
}
})
.finally(() => {
this.confirmLoading = false
this.cancle()
})
} else {
this.cancle()
}
})
},
handleCancel() {
this.close()
},
},
}
</script>