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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
| <!--
| * @Date: 2019-09-02 09:01:22
| * @LastEditors: 小明丶
| * @LastEditTime: 2019-09-02 09:20:18
| * @Description:
| -->
| <template>
| <div class="open-heyd-index">
| <x-header :title="'开通智享花'" :left-options="{backText: '', preventGoBack: true}" @on-click-back="goBackPage">
| </x-header>
| <!-- v-show="step === 1" -->
| <base-info
| v-show="step === 1"
| :cardTypeList="cardTypeList"
| :merRefList="merRefList"
| :bankList="bankList"
| :address="address"
| :addressList="addressList"
| :storeInfo="storeInfo"
| @addr-change="setCitycode"
| >
| </base-info>
| <!-- 海尔云贷的文件上传type + 6 -->
| <mer-pictures v-show="step === 2" :storeInfo="storeInfo" :filetype="9" ></mer-pictures>
| <!-- <store-pictures :storeInfo="storeInfo" :filetype="6" ></store-pictures> -->
| <f-space type="large"></f-space>
| <f-button @on-click="handleNextStep" fixed>{{ step === 1 ? '下一步' : '提交开通' }}</f-button>
| </div>
| </template>
|
| <script>
| import BaseInfo from './merBaseInfo.vue';
| import MerPictures from './merPictures.vue';
| import formCheckAndComt from '@/utils/formCheckAndComb';
| import {calcArea} from '@/utils/index';
| import {
| dateFormat
| } from 'vux'
|
| export default {
| name: 'heydMerOpen',
| components: {
| BaseInfo,
| MerPictures
| },
| data() {
| return {
| orgType: 0,
| step: 1,
| stepText: '下一步',
| bankList: [],
| cardTypeList: [],
| merRefList:[],
| addressList:[],
| address:[],
| storeInfo: {
| merName: '',
| legalPhone:'',
| merAddrText:'',
| contactPhone:'',
| contactName:'',
| acctBankname:'',
| orgName:'',
| legalIdCardAddress:'',
| issueDate:'',
| regDetailAddr:'',
| addr:{},
| isShowArea:false,
| regCityCode:'',
| regCityName:'',
| regDistrictCode:'',
| regDistrictName:'',
| regProvinceCode:'',
| regProvinceName:'',
| contactEmail:'',
| addrText:'',
| bizProvinceCode:'',
| bizProvinceName:'',
| bizCityCode:'',
| bizCityName:'',
| bizDistrictCode:'',
| bizDistrictName:'',
| acctOpenBankname:'',
| provCode:'',//省code
| cityCode:'',//市code
| bankNo:'',//开户行行号
| legalIdCardNo:'',
| bizDetailAddr:'',
| licenseNo: '',
| acctCnaps: '',
| merAddr: '',
| merDtlAddr: '',
| merArea: '',
| foundDate: '',
| legalName: '',
| legalIdNo: '',
| legalMblNo: '',
| legalHomeAddr: '',
| outMerchantNo: '',
| merchantName: '',
| acctName: '', // 户名
| acctNo: '', // 银行卡号
| acctType: '', // 账号类型code
| acctEnpRel:'',//账户企业关系
| acctEnpRelName:'',//账户企业关系
| acctTypeName: '', // 账号类型name
| objContactReal: '',//联系人与企业关系
| licencePhotos: [], // 营业执照
| legalCardPhotos: [], // 法人身份证
| legalCardPhotosF: [], //法人身份证反面
| legalCardPhotosZ: [], //法人身份证正面
| },
| // 验证开户信息字段
| storeCheckInfo: [
| {
| key: 'orgName',
| tipType: 1,
| message: '营业执照名称'
| },
| {
| key: 'legalPhone',
| tipType: 1,
| message: '法人手机号'
| },
| {
| key: 'acctBankname',
| tipType: 2,
| message: '银行名称'
| },
| {
| key: 'acctName',
| tipType: 1,
| message: '账户名称'
| },
| {
| key: 'acctType',
| tipType: 2,
| message: '账号类型'
| },
| {
| key: 'contactEmail',
| tipType: 1,
| type:"isEmail",
| message: '联系人邮箱'
| },
| {
| key: 'contactName',
| tipType: 1,
| message: '联系人手机号'
| },
| {
| key: 'contactPhone',
| tipType: 1,
| message: '联系人姓名'
| },
| {
| key: 'addrText',
| tipType: 2,
| message: '省市区'
| },
| {
| key: 'legalIdCardAddress',
| tipType: 1,
| message: '法人身份证地址'
| },
| {
| key: 'regDetailAddr',
| tipType: 1,
| message: '注册详细地址'
| },
| {
| key: 'issueDate',
| tipType: 2,
| message: '注册日期'
| },
| {
| key: 'merchantName',
| tipType: 1,
| message: '渠道名称'
| },
| {
| key: 'outMerchantNo',
| tipType: 1,
| message: '渠道编码'
| },
| ],
| bankNo:''
| };
| },
| computed:{
| // 通过icon字段判断是智享云还是购机直降
| },
| created(){
| this.$api.getArea().then(res => {
| this.addressList = res.body.provList;
| });
| this.init();
| this.orgType = Number(this.$route.query.orgType);
| },
| methods: {
| // 获取地区列表
| getArea({commit}) {
| Vue.prototype.$api.getArea().then((res) => {
| let { provList } = res.body;
| let obj = calcArea(provList)
| commit(SET_AREA_LIST,{
| province_list:obj.province_list,
| city_list:obj.city_list,
| county_list:obj.county_list
| })
| }).catch((err) => {
|
| });
| },
| // 设置地区code
| setCitycode(val){
| this.storeInfo.provCode = val[0];
| this.storeInfo.cityCode = val[1];
| this.address = val;
| },
| goBackPage() {
| if (this.step === 2) {
| this.step -= 1;
| } else {
| this.$router.push({
| path: '/main/productManagement'
| });
| }
| },
| // 初始化页面
| init() {
| let fn = this.$api.heydInitOpen;
| fn().then(res => {
| let body = res.body;
| this.bankList = body.bankList;
| this.cardTypeList = body.acctTypeList;
| this.merRefList = body.acctEnpRelList;
| for (let i in this.storeInfo) {
| if(Array.isArray(this.storeInfo[i])){
| this.storeInfo[i] = body[i] ? body[i] : [];
| console.log(i+":"+this.storeInfo[i]);
| }else{
| this.storeInfo[i] = body[i] ? body[i] : '';
| }
| }
| if(body.cityCode){
| this.address.push(body.provCode+'')
| this.address.push(body.cityCode+'')
| }
| this.storeInfo.merAddrText = this.storeInfo.bizProvinceName +'-'+ this.storeInfo.bizCityName +'-'+ this.storeInfo.bizDistrictName;
| if(this.storeInfo.regProvinceName) {
| this.storeInfo.addrText = this.storeInfo.regProvinceName + '-' + this.storeInfo.regCityName + '-' + this.storeInfo.regDistrictName;
| }
| if (this.storeInfo.licencePhotos && this.storeInfo.licencePhotos.length) {
| let fileId = this.storeInfo.licencePhotos[0];
| this.storeInfo.licencePhotos = [];
| this.storeInfo.licencePhotos.push({
| fileId: fileId,
| fileUrl: '/'+fileId
| });
| }
| if (this.storeInfo.legalCardPhotosZ && this.storeInfo.legalCardPhotosZ.length) {
| let fileIdZ = this.storeInfo.legalCardPhotosZ[0];
| let fileIdF = this.storeInfo.legalCardPhotosF[0];
| this.storeInfo.legalCardPhotos = [];
| this.storeInfo.legalCardPhotos.push({
| fileId: fileIdZ,
| fileUrl: '/'+fileIdZ
| });
| this.storeInfo.legalCardPhotos.push({
| fileId: fileIdF,
| fileUrl: '/'+fileIdF
| });
| }
| });
| },
| // 处理点击下一步跳转处理
| handleNextStep() {
| // 判断表单字段必填性
| if (this.step === 1) {
| // 智享花增加这两个字段验证
| let rules = [
| ]
| // 对公时验证开户行行号
| if(this.storeInfo.acctType ===1){
| rules.push({
| key: 'acctOpenBankname',
| tipType: 1,
| message: '开户支行名称'
| });
| rules.push({
| key: 'acctCnaps',
| tipType: 1,
| message: '开户行行号'
| });
| rules.push({
| key: 'acctNo',
| tipType: 1,
| message: '银行账号'
| });
| }
| // 对私时验证账户企业关系
| if(this.storeInfo.acctType ===2){
| rules.push({
| key: 'acctEnpRel',
| tipType: 2,
| message: '账户企业关系'
| });
| rules.push({
| key: 'acctNo',
| tipType: 1,
| type:"bankCardNo",
| message: '银行账号'
| });
| }
| this.storeCheckInfo.push(...rules)
| // 判断表单是否必填
| if (!formCheckAndComt.checkRequiredField(this.storeCheckInfo,this.storeInfo,this)) {
| return false;
| }
| this.step += 1;
| } else {
| this.handleSubmitOpen();
| }
| },
| // 处理提交
| handleSubmitOpen() {
|
| // 需要判断图片的字段
| let checkPicList = [{
| checkField: 'licencePhotos',
| msg: '营业执照照片'
| },
| {
| checkField: 'legalCardPhotos',
| msg: '法人身份证正反面照片'
| },
| ];
| // 判断图片是否上传
| for (let item of checkPicList) {
| if (!(this.storeInfo[item.checkField] instanceof Array &&
| this.storeInfo[item.checkField].length)) {
| this.$notify('请上传' + item.msg);
| return false;
| }
| if (item.checkField == 'legalCardPhotos' && this.storeInfo[item.checkField].length < 2){
| this.$notify('请上传' + item.msg);
| return false;
| }
| }
|
| // 由于后端初始化返回的图片字段{url: xx, id: 121}, 而此时在提交的时候,我们
| // 提交图片字段为[id1, id2], 为id的列表
| this.storeInfo.legalCardPhotosF = [];
| this.storeInfo.legalCardPhotosZ = [];
| let picIdList = {
| licencePhotos: [],
| legalCardPhotosF: [],
| legalCardPhotosZ: [],
| };
| picIdList.legalCardPhotosF.push(this.storeInfo.legalCardPhotos[0].fileId);
| picIdList.legalCardPhotosZ.push(this.storeInfo.legalCardPhotos[1].fileId);
| for (let i in picIdList) {
| if (this.storeInfo[i] instanceof Array &&
| this.storeInfo[i].length) {
| // 后端图片初始文件id为id.而控件上传id为fieldId,这里需要兼容处理一下
| this.storeInfo[i].forEach((item) => {
| item.fileId ? picIdList[i].push(item.fileId) :
| picIdList[i].push(item.id)
| });
| }
| }
|
| let submitInfo = {
| ...this.storeInfo,
| ...picIdList
| };
|
| let fn;
| // 对私时开户行行号不传值
| if(this.storeInfo.acctType === 2){
| submitInfo.acctOpenBankname = '';
| submitInfo.acctCnaps = '';
| }
| if(this.storeInfo.acctType === 1){
| submitInfo.acctEnpRel = '';
| }
| fn = this.$api.heydOpen; //海尔云贷接口
| fn(submitInfo).then((res) => {
| this.$router.push({
| path: '/heyd/open-result',
| // 提交后,默认跳转审核结果页面,状态为开通中
| query: {
| orgType: this.orgType,
| openStatus: 1,
| icon:this.$route.query.icon
| }
| })
| });
| }
| }
| };
|
| </script>
|
| <style lang="less" scoped>
| .open-heyd-index{
| padding-top: 54px;
| height:100%;
| background-color: #f1f1f1;
| }
| </style>
|
|