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
| <!--
| * @Date: 2019-09-02 09:01:22
| * @LastEditors: 小明丶
| * @LastEditTime: 2019-09-02 09:20:18
| * @Description:
| -->
| <template>
| <div class="open-gjzj-index">
| <x-header :title="isHeyd ? '开通智享花':'开通购机直降'" :left-options="{backText: '', preventGoBack: true}" @on-click-back="goBackPage">
| </x-header>
| <!-- v-show="step === 1" -->
| <base-info
| v-show="step === 1"
| :cardTypeList="cardTypeList"
| :bankList="bankList"
| :isHeyd="isHeyd"
| :address="address"
| :addressList="addressList"
| :storeInfo="storeInfo"
| @addr-change="setCitycode"
| >
| </base-info>
| <store-pictures v-show="step === 2 && !isHeyd" :storeInfo="storeInfo"></store-pictures>
| <!-- 海尔云贷的文件上传type + 6 -->
| <store-pictures v-show="step === 2 && isHeyd" :storeInfo="storeInfo" :filetype="6" ></store-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 './baseInfo.vue';
| import StorePictures from './storePictures.vue';
| import formCheckAndComt from '@/utils/formCheckAndComb';
|
| import {
| dateFormat
| } from 'vux'
|
| export default {
| name: 'gjzjOpen_2',
| components: {
| BaseInfo,
| StorePictures
| },
| data() {
| return {
| step: 1,
| stepText: '下一步',
| bankList: [],
| cardTypeList: [],
| addressList:[],
| address:[],
| storeInfo: {
| //协议开始时间,结束时间(智享花才有)
| agreeStartTime:'',
| agreeEndTime:'',
| provCode:'',//省code
| cityCode:'',//市code
| bankNo:'',//开户行行号
|
| merName: '',
| licenseNo: '',
| merAddr: '',
| merDtlAddr: '',
| merArea: '',
| foundDate: '',
| legalName: '',
| legalIdNo: '',
| legalMblNo: '',
| legalHomeAddr: '',
| contactName: '',
| contactMblNo: '',
| contactDuty: '',
| bankCode: '', // 银行code
| bankName: '', // 银行名称
| bankDtlName: '', // 开户行
| cardName: '', // 户名
| cardNo: '', // 银行卡号
| cardType: '', // 账号类型code
| cardTypeName: '', // 账号类型name
| licencePhotos: [], // 营业执照
| legalCardPhotos: [], // 法人身份证
| houseContractPhotos: [], // 房产证和租赁合同
| storePhotos: [], // 门店照
| mealBillPhotos: [], // 终端商品的定价单
| accreditFilePhotos: [], // 授权文件
| },
| // 验证开户信息字段
| storeCheckInfo: [{
| key: 'merArea',
| tipType: 1,
| message: '营业面积'
| },
| {
| key: 'foundDate',
| tipType: 2,
| message: '成立日期'
| },
|
| {
| key: 'legalMblNo',
| tipType: 1,
| type: 'tel',
| message: '法人电话'
| },
| {
| key: 'legalHomeAddr',
| tipType: 1,
| message: '法人家庭住址'
| },
| {
| key: 'contactName',
| tipType: 1,
| type: 'name',
| message: '联系人姓名'
| },
| {
| key: 'contactMblNo',
| tipType: 1,
| type: 'tel',
| message: '联系人电话'
| },
| {
| key: 'contactDuty',
| tipType: 1,
| message: '联系人职务'
| },
| {
| key: 'bankCode',
| tipType: 2,
| message: '银行名称'
| },
| {
| key: 'bankDtlName',
| tipType: 1,
| message: '开户行'
| },
| {
| key: 'cardName',
| tipType: 1,
| message: '户名'
| },
| {
| key: 'cardNo',
| tipType: 1,
| type:"bankCardNo",
| message: '银行账号'
| },
| ],
| bankNo:''
| };
| },
| computed:{
| // 通过icon字段判断是智享云还是购机直降
| isHeyd(){
| return this.$route.query.icon=='scene_Staging-zxh';
| }
| },
| created(){
| if(this.isHeyd){
| this.$api.getArea().then(res => {
| this.addressList = res.body.provList;
| });
| }
| this.init();
| },
| methods: {
| // 设置地区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;
| if(this.isHeyd){
| fn = this.$api.heydInitOpen;
| }else{
| fn = this.$api.gjzjOpenInit;
| }
| fn().then(res => {
| let body = res.body;
| this.bankList = body.bankList;
| this.cardTypeList = body.cardTypeList;
| for (let i in this.storeInfo) {
| if(Array.isArray(this.storeInfo[i])){
| this.storeInfo[i] = body[i] ? body[i] : [];
| }else{
| this.storeInfo[i] = body[i] ? body[i] : '';
| }
| }
| if(this.isHeyd && body.cityCode){
| this.address.push(body.provCode+'')
| this.address.push(body.cityCode+'')
| }
| this.storeInfo.foundDate = dateFormat(this.storeInfo.foundDate, 'YYYY-MM-DD');
| });
| },
| // 处理点击下一步跳转处理
| handleNextStep() {
| // 判断表单字段必填性
| if (this.step === 1) {
| // 智享花增加这两个字段验证
| if(this.isHeyd){
| let rules = [
| {
| key: 'agreeStartTime',
| tipType: 1,
| message: '协议开始时间'
| },
| {
| key: 'agreeEndTime',
| tipType: 1,
| message: '协议结束时间'
| },
| {
| key: 'cityCode',
| tipType: 2,
| message: '地区'
| }
| ]
| // 对公时验证开户行行号
| if(this.storeInfo.cardType ==='pu'){
| rules.push({
| key: 'bankNo',
| tipType: 1,
| 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: '法人身份证正反面照片'
| },
| {
| checkField: 'houseContractPhotos',
| msg: '房产证或租赁合同'
| },
| {
| checkField: 'storePhotos',
| msg: '外景照、门头照片、前台照、内景照'
| },
| {
| checkField: 'mealBillPhotos',
| msg: '套餐活动清单、终端商品定价清单'
| },
| {
| checkField: 'accreditFilePhotos',
| msg: '运营商授权文件'
| },
| ];
| // 判断图片是否上传
| for (let item of checkPicList) {
| if (!(this.storeInfo[item.checkField] instanceof Array &&
| this.storeInfo[item.checkField].length)) {
| this.$notify('请上传' + item.msg);
|
| return false;
| }
| }
|
| // 由于后端初始化返回的图片字段{url: xx, id: 121}, 而此时在提交的时候,我们
| // 提交图片字段为[id1, id2], 为id的列表
| let picIdList = {
| licencePhotos: [],
| legalCardPhotos: [],
| houseContractPhotos: [],
| storePhotos: [],
| mealBillPhotos: [],
| accreditFilePhotos: []
| };
| 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)
| });
| }
| }
|
|
| // 覆盖submitInfo中的 (agreeStartTime 、agreeEndTime)
| let time = {
| agreeStartTime:this.storeInfo.agreeStartTime.split('-').join(''),
| agreeEndTime:this.storeInfo.agreeEndTime.split('-').join('')
| }
| let submitInfo = {
| ...this.storeInfo,
| ...time,
| ...picIdList
| };
|
|
| let fn;
| if(this.isHeyd){
| // 对私时开户行行号不传值
| if(this.storeInfo.cardType ==='pr'){
| submitInfo.bankNo = '';
| }
| fn = this.$api.heydOpen; //海尔云贷接口
| }else{
| fn = this.$api.gjzjOpenOpen;
| }
|
| fn(submitInfo).then((res) => {
| this.$router.push({
| path: '/gjzj/open-result',
| // 提交后,默认跳转审核结果页面,状态为开通中
| query: {
| openStatus: 1,
| icon:this.$route.query.icon
| }
| })
| });
| }
| }
| };
|
| </script>
|
| <style lang="less" scoped>
| .open-gjzj-index{
| padding-top: 54px;
| background-color: #f1f1f1;
| }
| </style>
|
|