1
|
1
|
// pages/main/addinfo/addinfo.js
|
|
2
|
+var app = getApp();
|
|
3
|
+var baseUrl = app.globalData.baseUrl;
|
2
|
4
|
Page({
|
3
|
5
|
|
4
|
6
|
/**
|
5
|
7
|
* 页面的初始数据
|
6
|
8
|
*/
|
7
|
9
|
data: {
|
8
|
|
-
|
|
10
|
+ isshow01: false,
|
|
11
|
+ isshow02: false,
|
|
12
|
+ isshow03: false,
|
|
13
|
+ taxInfo: {},
|
|
14
|
+ proffessionlist: {},
|
|
15
|
+ banklist: {},
|
|
16
|
+ isself: false,
|
|
17
|
+ isIdCard: true,
|
|
18
|
+ name: '',
|
|
19
|
+ card_number: '',
|
|
20
|
+ birthday:'',
|
|
21
|
+ formData:{},
|
|
22
|
+ requestBody:{},
|
|
23
|
+
|
|
24
|
+ relativeData: {
|
|
25
|
+ isrequre: true,
|
|
26
|
+ label: '关系',
|
|
27
|
+ bindtype: 'relative',
|
|
28
|
+ selected:'',
|
|
29
|
+ placeholder: '请选择关系',
|
|
30
|
+ values: ["子女", "配偶"],
|
|
31
|
+ onChange: 'onPickerSelect'
|
|
32
|
+ },
|
|
33
|
+ personstatusData: {
|
|
34
|
+ isrequre: true,
|
|
35
|
+ label: '纳税人状态',
|
|
36
|
+ bindtype: 'personstatus',
|
|
37
|
+ selected: '',
|
|
38
|
+ placeholder: '请选择纳税人状态',
|
|
39
|
+ values: ["正常(在职)", "非正常"],
|
|
40
|
+ onChange: 'onPickerSelect'
|
|
41
|
+ },
|
|
42
|
+ cardtypeData: {
|
|
43
|
+ isrequre: true,
|
|
44
|
+ label: '证照类型',
|
|
45
|
+ bindtype: 'cardtype',
|
|
46
|
+ selected: '',
|
|
47
|
+ placeholder: '请选择证照类型',
|
|
48
|
+ values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往大陆通行证', '外交官证', '中国护照',
|
|
49
|
+ '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '外国人永久居留证'
|
|
50
|
+ ],
|
|
51
|
+ onChange: 'onPickerSelect'
|
|
52
|
+ },
|
|
53
|
+ forignerInfo: {
|
|
54
|
+ isrequre: true,
|
|
55
|
+ label: '是否境外人员',
|
|
56
|
+ bindtype: 'forigner',
|
|
57
|
+ selected: '否',
|
|
58
|
+ disabled:true,
|
|
59
|
+ values: ["否", "是"],
|
|
60
|
+ onChange: 'onPickerSelect'
|
|
61
|
+ },
|
|
62
|
+ bankInfo: {
|
|
63
|
+ label: '开户银行',
|
|
64
|
+ bindtype: 'bank',
|
|
65
|
+ selected: '',
|
|
66
|
+ placeholder: '请选择开户银行',
|
|
67
|
+ onChange: 'onPickerSelect'
|
|
68
|
+ },
|
|
69
|
+ genderData: {
|
|
70
|
+ label: '性别',
|
|
71
|
+ bindtype: 'gender',
|
|
72
|
+ selected: '',
|
|
73
|
+ placeholder: '请选择性别',
|
|
74
|
+ values: ["男", "女"],
|
|
75
|
+ onChange: 'onPickerSelect'
|
|
76
|
+ },
|
|
77
|
+ professionData: {
|
|
78
|
+ mode: 'multiSelector',
|
|
79
|
+ label: '职业',
|
|
80
|
+ bindtype: 'profession',
|
|
81
|
+ multiIndex: [0, 0, 0],
|
|
82
|
+ selected: '',
|
|
83
|
+ placeholder: '请选择职业',
|
|
84
|
+ onChange: 'onPickerSelect'
|
|
85
|
+ },
|
|
86
|
+ degreeData: {
|
|
87
|
+ label: '学历',
|
|
88
|
+ bindtype: 'degree',
|
|
89
|
+ selected: '',
|
|
90
|
+ placeholder: '请选择学历',
|
|
91
|
+ values: ["研究生", "大学本科", '大学本科以下'],
|
|
92
|
+ onChange: 'onPickerSelect'
|
|
93
|
+ },
|
|
94
|
+ disabilityInfo: {
|
|
95
|
+ label: '是否残疾',
|
|
96
|
+ bindtype: 'disable',
|
|
97
|
+ selected: '',
|
|
98
|
+ placeholder: '请选择是否残疾',
|
|
99
|
+ values: ["否", "是"],
|
|
100
|
+ onChange: 'onPickerSelect'
|
|
101
|
+ },
|
|
102
|
+ lieshuInfo: {
|
|
103
|
+ label: '是否烈属',
|
|
104
|
+ bindtype: 'lieshu',
|
|
105
|
+ selected: '',
|
|
106
|
+ placeholder: '请选择是否烈属',
|
|
107
|
+ values: ["否", "是"],
|
|
108
|
+ onChange: 'onPickerSelect'
|
|
109
|
+ },
|
|
110
|
+ lonelyolderInfo: {
|
|
111
|
+ label: '是否孤老',
|
|
112
|
+ bindtype: 'lonelyolder',
|
|
113
|
+ selected: '',
|
|
114
|
+ placeholder: '请选择是否孤老',
|
|
115
|
+ values: ["否", "是"],
|
|
116
|
+ onChange: 'onPickerSelect'
|
|
117
|
+ },
|
|
118
|
+ investInfo: {
|
|
119
|
+ isrequre: true,
|
|
120
|
+ label: '是否股东、投资者',
|
|
121
|
+ bindtype: 'invest',
|
|
122
|
+ selected: '',
|
|
123
|
+ placeholder: '请选择是否股东、投资者',
|
|
124
|
+ values: ["否", "是"],
|
|
125
|
+ onChange: 'onPickerSelect'
|
|
126
|
+ },
|
|
127
|
+ specificIndustryInfo: {
|
|
128
|
+ isrequre: true,
|
|
129
|
+ label: '是否特定行业',
|
|
130
|
+ bindtype: 'specificIndustry',
|
|
131
|
+ selected: '',
|
|
132
|
+ placeholder: '请选择是否特定行业',
|
|
133
|
+ values: ["否", "是"],
|
|
134
|
+ onChange: 'onPickerSelect'
|
|
135
|
+ },
|
|
136
|
+ employeeInfo: {
|
|
137
|
+ label: '是否雇员',
|
|
138
|
+ bindtype: 'employee',
|
|
139
|
+ selected: '',
|
|
140
|
+ placeholder: '请选择是否雇员',
|
|
141
|
+ values: ["否", "是"],
|
|
142
|
+ onChange: 'onPickerSelect'
|
|
143
|
+ },
|
|
144
|
+ investpersonalInfo: {
|
|
145
|
+ label: '是否天使投资个人',
|
|
146
|
+ bindtype: 'investpersonal',
|
|
147
|
+ selected: '',
|
|
148
|
+ placeholder: '请选择是否天使投资个人',
|
|
149
|
+ values: ["否", "是"],
|
|
150
|
+ onChange: 'onPickerSelect'
|
|
151
|
+ },
|
|
152
|
+ // 时间picker
|
|
153
|
+ birthDate: {
|
|
154
|
+ label: '出生年月',
|
|
155
|
+ bindtype: 'birthday',
|
|
156
|
+ selected: '',
|
|
157
|
+ placeholder: '请选择出生日期',
|
|
158
|
+ mode: "date",
|
|
159
|
+ fields: "day",
|
|
160
|
+ onChange: 'birthdayChange',
|
|
161
|
+ },
|
|
162
|
+ startDate: {
|
|
163
|
+ label: '在职受雇日期',
|
|
164
|
+ bindtype: 'startday',
|
|
165
|
+ selected: '',
|
|
166
|
+ placeholder: '请选择受雇日期',
|
|
167
|
+ mode: "date",
|
|
168
|
+ fields: "day",
|
|
169
|
+ onChange: 'startChange',
|
|
170
|
+ },
|
|
171
|
+ endDate: {
|
|
172
|
+ label: '离职日期',
|
|
173
|
+ bindtype: 'endday',
|
|
174
|
+ selected: '',
|
|
175
|
+ placeholder: '请选择离职日期',
|
|
176
|
+ mode: "date",
|
|
177
|
+ fields: "day",
|
|
178
|
+ onChange: 'endChange',
|
|
179
|
+ },
|
|
180
|
+ // 地址选择器
|
|
181
|
+ contactaddressInfo: {
|
|
182
|
+ label: '联系地址',
|
|
183
|
+ mode: 'region',
|
|
184
|
+ selected: '',
|
|
185
|
+ placeholder: '请选择联系地址',
|
|
186
|
+ onChange: 'contactAddressSelect'
|
|
187
|
+ },
|
|
188
|
+ currentaddressInfo: {
|
|
189
|
+ label: '居住地',
|
|
190
|
+ mode: 'region',
|
|
191
|
+ selected: '',
|
|
192
|
+ placeholder: '请选择居住地',
|
|
193
|
+ onChange: 'currentAddressSelect'
|
|
194
|
+ },
|
|
195
|
+ birthaddressInfo: {
|
|
196
|
+ label: '户籍所在地',
|
|
197
|
+ mode: 'region',
|
|
198
|
+ selected: '',
|
|
199
|
+ placeholder: '请选择户籍所在地',
|
|
200
|
+ onChange: 'birthAddressSelect'
|
|
201
|
+ },
|
|
202
|
+ title: '',
|
|
203
|
+ condition: false
|
9
|
204
|
},
|
10
|
205
|
|
11
|
206
|
/**
|
12
|
207
|
* 生命周期函数--监听页面加载
|
13
|
208
|
*/
|
14
|
209
|
onLoad: function (options) {
|
15
|
|
-
|
|
210
|
+ // console.log('options.id', options.id)
|
|
211
|
+ // if (!options.id || options.id.length < 0) {
|
|
212
|
+ // this.setData({
|
|
213
|
+ // isself: false,
|
|
214
|
+ // })
|
|
215
|
+ // } else {
|
|
216
|
+ // this.getpersonalTax(options.id)
|
|
217
|
+ // }
|
|
218
|
+ this.getproffessiondata()
|
|
219
|
+ this.getbanklist()
|
|
220
|
+ },
|
|
221
|
+
|
|
222
|
+ getpersonalTax: function (id) {
|
|
223
|
+ var that = this
|
|
224
|
+ var Authorization = app.globalData.Authorization;
|
|
225
|
+ wx.request({
|
|
226
|
+ url: baseUrl + 'persontax/v1/personal-taxes/' + id,
|
|
227
|
+ method: "GET",
|
|
228
|
+ header: {
|
|
229
|
+ 'content-type': 'application/json', // 默认值
|
|
230
|
+ "Authorization": Authorization
|
|
231
|
+ },
|
|
232
|
+ success: function (res) {
|
|
233
|
+ console.log(res)
|
|
234
|
+ that.setData({
|
|
235
|
+ taxInfo: res.data,
|
|
236
|
+ isself: res.data.family_ties ? false : true
|
|
237
|
+ })
|
|
238
|
+ },
|
|
239
|
+ fail(res) {
|
|
240
|
+ console.log(res)
|
|
241
|
+ }
|
|
242
|
+ })
|
|
243
|
+ },
|
|
244
|
+
|
|
245
|
+ getproffessiondata: function () {
|
|
246
|
+ var that = this
|
|
247
|
+ var Authorization = app.globalData.Authorization;
|
|
248
|
+ var proffession_info = that.data.professionData
|
|
249
|
+ wx.request({
|
|
250
|
+ url: baseUrl + 'common/v1/professions',
|
|
251
|
+ method: "GET",
|
|
252
|
+ header: {
|
|
253
|
+ 'content-type': 'application/json', // 默认值
|
|
254
|
+ "Authorization": Authorization
|
|
255
|
+ },
|
|
256
|
+ success: function (res) {
|
|
257
|
+ console.log('proffessiondata', res.data)
|
|
258
|
+ proffession_info.values = that.handleProfession(res.data.items)
|
|
259
|
+ that.setData({
|
|
260
|
+ proffessionlist: res.data.items,
|
|
261
|
+ professionData: proffession_info
|
|
262
|
+ })
|
|
263
|
+ },
|
|
264
|
+ fail(res) {
|
|
265
|
+ console.log(res)
|
|
266
|
+ }
|
|
267
|
+ })
|
|
268
|
+ console.log('proffessionData--', that.data.professionData)
|
|
269
|
+ },
|
|
270
|
+
|
|
271
|
+ handleProfession: function (data) {
|
|
272
|
+ var newdata = []
|
|
273
|
+ var one = []
|
|
274
|
+ var two = []
|
|
275
|
+ var three = []
|
|
276
|
+ var oneObj = {}, twoObj = {}, threeObj = {}
|
|
277
|
+ if (data && data.length > 0) {
|
|
278
|
+ console.log('one', one)
|
|
279
|
+ data.map((d, i) => {
|
|
280
|
+ one.push(d.one_level_code) //三级联动中 第一级所有的code
|
|
281
|
+ two.push(d.two_level_code) //三级联动中 第二级所有的code
|
|
282
|
+ three.push(d.three_level_code) //三级联动中 第三级所有的code
|
|
283
|
+ oneObj[d.one_level_code] = {
|
|
284
|
+ "value": d.one_level_code,
|
|
285
|
+ "label": d.one_level_name,
|
|
286
|
+ "children": []
|
|
287
|
+ } //三级联动中 第一级所有的code + name
|
|
288
|
+ twoObj[d.two_level_code] = {
|
|
289
|
+ "value": d.two_level_code,
|
|
290
|
+ "label": d.two_level_name,
|
|
291
|
+ "children": []
|
|
292
|
+ } //三级联动中 第一级所有的code + name
|
|
293
|
+ threeObj[d.three_level_code] = {
|
|
294
|
+ "value": d.three_level_code,
|
|
295
|
+ "label": d.three_level_name
|
|
296
|
+ } //三级联动中 第一级所有的code + name
|
|
297
|
+ for (let b in twoObj) { //把第三级的数据的Code和第二级数据的code做判断 相等的 放到第二级的children数组中
|
|
298
|
+ for (let c in threeObj) {
|
|
299
|
+ if (b == c.slice(0, c.length - 1)) {
|
|
300
|
+ twoObj[b].children.push(threeObj[c])
|
|
301
|
+ }
|
|
302
|
+ }
|
|
303
|
+ }
|
|
304
|
+ for (let a in oneObj) { //把第二级的数据的Code和第二级数据的code做判断 相等的 放到第一级的children数组中
|
|
305
|
+ for (let b in twoObj) {
|
|
306
|
+ if (a == b.slice(0, b.length - 1)) {
|
|
307
|
+ oneObj[a].children.push(twoObj[b])
|
|
308
|
+ }
|
|
309
|
+ }
|
|
310
|
+ }
|
|
311
|
+ one = [...new Set(one)] //一级code去重
|
|
312
|
+ one.map((da, ind) => { //遍历 得到最终的三级联动数据
|
|
313
|
+ // console.log('oneObj', newdata)
|
|
314
|
+ newdata.push(oneObj[da])
|
|
315
|
+ })
|
|
316
|
+ })
|
|
317
|
+ }
|
|
318
|
+ console.log('newdata', newdata)
|
|
319
|
+
|
|
320
|
+ return newdata
|
|
321
|
+ },
|
|
322
|
+
|
|
323
|
+ getbanklist: function () {
|
|
324
|
+ var that = this
|
|
325
|
+ var Authorization = app.globalData.Authorization;
|
|
326
|
+ var bank_info = that.data.bankInfo
|
|
327
|
+ wx.request({
|
|
328
|
+ url: baseUrl + 'walletmgm/v1/bankinfos',
|
|
329
|
+ method: "GET",
|
|
330
|
+ header: {
|
|
331
|
+ 'content-type': 'application/json', // 默认值
|
|
332
|
+ "Authorization": Authorization
|
|
333
|
+ },
|
|
334
|
+ success: function (res) {
|
|
335
|
+ console.log(res)
|
|
336
|
+ bank_info.values = that.handleBankinfo(res.data.items)
|
|
337
|
+
|
|
338
|
+ that.setData({
|
|
339
|
+ banklist: res.data.items,
|
|
340
|
+ bankInfo: bank_info
|
|
341
|
+ })
|
|
342
|
+ console.log("bankInfo", that.data.bankInfo)
|
|
343
|
+ },
|
|
344
|
+ fail(res) {
|
|
345
|
+ console.log(res)
|
|
346
|
+ }
|
|
347
|
+ })
|
|
348
|
+ },
|
|
349
|
+
|
|
350
|
+ handleBankinfo: function (data) {
|
|
351
|
+ var bank_name = []
|
|
352
|
+ for (var i = 0; i < data.length; i++) {
|
|
353
|
+ bank_name.push(data[i].bank_name)
|
|
354
|
+ }
|
|
355
|
+ return bank_name
|
16
|
356
|
},
|
17
|
357
|
|
18
|
358
|
/**
|
19
|
359
|
* 生命周期函数--监听页面初次渲染完成
|
20
|
360
|
*/
|
21
|
361
|
onReady: function () {
|
22
|
|
-
|
|
362
|
+
|
23
|
363
|
},
|
24
|
364
|
|
25
|
365
|
/**
|
26
|
366
|
* 生命周期函数--监听页面显示
|
27
|
367
|
*/
|
28
|
368
|
onShow: function () {
|
29
|
|
-
|
|
369
|
+ var that = this
|
|
370
|
+ wx.getStorage({
|
|
371
|
+ key: 'id_info',
|
|
372
|
+ success: function (res) {
|
|
373
|
+ console.log(res.data)
|
|
374
|
+ var birth_day = res.data.birthday.year + '-' + res.data.birthday.month + '-' + res.data.birthday.day,
|
|
375
|
+ var cardtype_Data = that.data.cardtypeData
|
|
376
|
+ cardtype_Data.selected = res.data.id_card_number
|
|
377
|
+ that.setData({
|
|
378
|
+ name: res.data.name,
|
|
379
|
+ birthday: birth_day,
|
|
380
|
+ cardtypeData: cardtype_Data,
|
|
381
|
+ card_number: res.data.id_card_number
|
|
382
|
+ })
|
|
383
|
+ },
|
|
384
|
+ })
|
|
385
|
+ },
|
|
386
|
+
|
|
387
|
+ span: function (e) {
|
|
388
|
+ console.log(e)
|
|
389
|
+ if ("1" == e.target.id) {
|
|
390
|
+ this.setData({
|
|
391
|
+ isshow01: !this.data.isshow01
|
|
392
|
+ })
|
|
393
|
+ } else if ("2" == e.target.id) {
|
|
394
|
+ this.setData({
|
|
395
|
+ isshow02: !this.data.isshow02
|
|
396
|
+ })
|
|
397
|
+ } else if ("3" == e.target.id) {
|
|
398
|
+ this.setData({
|
|
399
|
+ isshow03: !this.data.isshow03
|
|
400
|
+ })
|
|
401
|
+ }
|
|
402
|
+
|
|
403
|
+ },
|
|
404
|
+ // =============普通单列picker选中处理==============
|
|
405
|
+ onPickerSelect: function (e) {
|
|
406
|
+ console.log('picker发送选择改变,携带值为', e)
|
|
407
|
+ switch (e.currentTarget.id) {
|
|
408
|
+ case 'relative':
|
|
409
|
+ var relative_data = this.data.relativeData
|
|
410
|
+ relative_data.selected = relative_data.values[e.detail.value]
|
|
411
|
+ this.setData({
|
|
412
|
+ relativeData: relative_data
|
|
413
|
+ })
|
|
414
|
+ break;
|
|
415
|
+ case 'personstatus':
|
|
416
|
+ var personstatus_data = this.data.personstatusData
|
|
417
|
+ personstatus_data.selected = personstatus_data.values[e.detail.value]
|
|
418
|
+ this.setData({
|
|
419
|
+ personstatusData: personstatus_data
|
|
420
|
+ })
|
|
421
|
+ break;
|
|
422
|
+ case 'cardtype':
|
|
423
|
+ var is_idcard = this.data.isIdCard
|
|
424
|
+ var cardtype_data = this.data.cardtypeData
|
|
425
|
+ cardtype_data.selected = cardtype_data.values[e.detail.value]
|
|
426
|
+ if (0 == e.detail.value) {
|
|
427
|
+ is_idcard = true
|
|
428
|
+ } else {
|
|
429
|
+ is_idcard = false
|
|
430
|
+ }
|
|
431
|
+ this.setData({
|
|
432
|
+ isIdCard: is_idcard,
|
|
433
|
+ cardtypeData: cardtype_data
|
|
434
|
+ })
|
|
435
|
+ break;
|
|
436
|
+ case 'forigner':
|
|
437
|
+ var forigner_data = this.data.forignerInfo
|
|
438
|
+ forigner_data.selected = forigner_data.values[e.detail.value]
|
|
439
|
+ this.setData({
|
|
440
|
+ forignerInfo: forigner_data
|
|
441
|
+ })
|
|
442
|
+ break;
|
|
443
|
+ case 'bank':
|
|
444
|
+ var bank_data = this.data.bankInfo
|
|
445
|
+ bank_data.selected = bank_data.values[e.detail.value]
|
|
446
|
+ this.setData({
|
|
447
|
+ bankInfo: bank_data
|
|
448
|
+ })
|
|
449
|
+ break;
|
|
450
|
+ case 'gender':
|
|
451
|
+ var gender_data = this.data.genderData
|
|
452
|
+ gender_data.selected = gender_data.values[e.detail.value]
|
|
453
|
+ this.setData({
|
|
454
|
+ genderData: gender_data
|
|
455
|
+ })
|
|
456
|
+ break;
|
|
457
|
+ case 'profession':
|
|
458
|
+ // var profession_data = this.data.professionData
|
|
459
|
+ // profession_data.selected = profession_data.values[e.detail.value]
|
|
460
|
+ // this.setData({
|
|
461
|
+ // professionData: profession_data
|
|
462
|
+ // })
|
|
463
|
+ break;
|
|
464
|
+ case 'degree':
|
|
465
|
+ var degree_data = this.data.degreeData
|
|
466
|
+ degree_data.selected = degree_data.values[e.detail.value]
|
|
467
|
+ this.setData({
|
|
468
|
+ degreeData: degree_data
|
|
469
|
+ })
|
|
470
|
+ break;
|
|
471
|
+ case 'disable':
|
|
472
|
+ var disable_data = this.data.disabilityInfo
|
|
473
|
+ disable_data.selected = disable_data.values[e.detail.value]
|
|
474
|
+ this.setData({
|
|
475
|
+ disabilityInfo: disable_data
|
|
476
|
+ })
|
|
477
|
+ break;
|
|
478
|
+ case 'lieshu':
|
|
479
|
+ var lieshu_data = this.data.lieshuInfo
|
|
480
|
+ lieshu_data.selected = lieshu_data.values[e.detail.value]
|
|
481
|
+ this.setData({
|
|
482
|
+ lieshuInfo: lieshu_data
|
|
483
|
+ })
|
|
484
|
+ break;
|
|
485
|
+ case 'lonelyolder':
|
|
486
|
+ var lonelyolder_data = this.data.lonelyolderInfo
|
|
487
|
+ lonelyolder_data.selected = lonelyolder_data.values[e.detail.value]
|
|
488
|
+ this.setData({
|
|
489
|
+ lonelyolderInfo: lonelyolder_data
|
|
490
|
+ })
|
|
491
|
+ break;
|
|
492
|
+ case 'invest':
|
|
493
|
+ var invest_data = this.data.investInfo
|
|
494
|
+ invest_data.selected = invest_data.values[e.detail.value]
|
|
495
|
+ this.setData({
|
|
496
|
+ investInfo: invest_data
|
|
497
|
+ })
|
|
498
|
+ break;
|
|
499
|
+ case 'specificIndustry':
|
|
500
|
+ var specificIndustry_data = this.data.specificIndustryInfo
|
|
501
|
+ specificIndustry_data.selected = specificIndustry_data.values[e.detail.value]
|
|
502
|
+ this.setData({
|
|
503
|
+ specificIndustryInfo: specificIndustry_data
|
|
504
|
+ })
|
|
505
|
+ break;
|
|
506
|
+ case 'employee':
|
|
507
|
+ var employee_data = this.data.employeeInfo
|
|
508
|
+ employee_data.selected = employee_data.values[e.detail.value]
|
|
509
|
+ this.setData({
|
|
510
|
+ employeeInfo: employee_data
|
|
511
|
+ })
|
|
512
|
+ break;
|
|
513
|
+ }
|
|
514
|
+
|
|
515
|
+ },
|
|
516
|
+
|
|
517
|
+ // =============日期picker选中处理==============
|
|
518
|
+ birthdayChange:function(e){
|
|
519
|
+ var birth_date = this.data.birthDate;
|
|
520
|
+ birth_date.selected = e.detail.value
|
|
521
|
+ this.setData({
|
|
522
|
+ birthday: e.detail.value,
|
|
523
|
+ birthDate: birth_date
|
|
524
|
+ })
|
|
525
|
+ },
|
|
526
|
+
|
|
527
|
+ startChange:function(e){
|
|
528
|
+ var start_date = this.data.startDate;
|
|
529
|
+ start_date.selected = e.detail.value
|
|
530
|
+ this.setData({
|
|
531
|
+ startDate: start_date
|
|
532
|
+ })
|
|
533
|
+ },
|
|
534
|
+
|
|
535
|
+ endChange: function (e) {
|
|
536
|
+ var end_date = this.data.endDate;
|
|
537
|
+ end_date.selected = e.detail.value
|
|
538
|
+ this.setData({
|
|
539
|
+ endDate: end_date
|
|
540
|
+ })
|
|
541
|
+ },
|
|
542
|
+
|
|
543
|
+ // =============地区picker选中处理==============
|
|
544
|
+
|
|
545
|
+ contactAddressSelect:function(e){
|
|
546
|
+ console.log('contactAddressSelect',e)
|
|
547
|
+ var contact_address = this.data.contactaddressInfo;
|
|
548
|
+ contact_address.address_value = e.detail.value
|
|
549
|
+ contact_address.address_code = e.detail.code
|
|
550
|
+ this.setData({
|
|
551
|
+ contactaddressInfo: contact_address
|
|
552
|
+ })
|
|
553
|
+ },
|
|
554
|
+
|
|
555
|
+ currentAddressSelect: function (e) {
|
|
556
|
+ console.log('currentAddressSelect', e)
|
|
557
|
+ var current_address = this.data.currentaddressInfo;
|
|
558
|
+ current_address.address_value = e.detail.value
|
|
559
|
+ current_address.address_code = e.detail.code
|
|
560
|
+ this.setData({
|
|
561
|
+ currentaddressInfo: current_address
|
|
562
|
+ })
|
|
563
|
+ },
|
|
564
|
+
|
|
565
|
+ birthAddressSelect: function (e) {
|
|
566
|
+ console.log('birthAddressSelect', e)
|
|
567
|
+ var birth_address = this.data.birthaddressInfo;
|
|
568
|
+ birth_address.address_value = e.detail.value
|
|
569
|
+ birth_address.address_code = e.detail.code
|
|
570
|
+ this.setData({
|
|
571
|
+ birthaddressInfo: birth_address
|
|
572
|
+ })
|
|
573
|
+ },
|
|
574
|
+
|
|
575
|
+ // =============其他数据选中处理==============
|
|
576
|
+
|
|
577
|
+ getIdInfo: function (e) {
|
|
578
|
+ if (this.data.isIdCard){
|
|
579
|
+ wx.navigateTo({
|
|
580
|
+ url: '../idinfo/idinfo',
|
|
581
|
+ success: function (res) { },
|
|
582
|
+ })
|
|
583
|
+ }
|
|
584
|
+ },
|
|
585
|
+
|
|
586
|
+ formSubmit: function (e) {
|
|
587
|
+ console.log("date", Date.parse(new Date(this.data.birthday))/1000)
|
|
588
|
+
|
|
589
|
+ var formdata = e.detail.value;
|
|
590
|
+ var toast_title = ''
|
|
591
|
+ console.log("formdata", formdata);
|
|
592
|
+ if (formdata.name.length < 1) {
|
|
593
|
+ this.showtoast('请输入姓名');
|
|
594
|
+ return
|
|
595
|
+ } else if (this.data.relativeData.selected.length < 1) {
|
|
596
|
+ this.showtoast('请选择成员关系');
|
|
597
|
+ return
|
|
598
|
+ } else if (this.data.personstatusData.selected.length < 1) {
|
|
599
|
+ this.showtoast('请选择纳税人状态');
|
|
600
|
+ return
|
|
601
|
+ } else if (this.data.cardtypeData.selected.length < 1) {
|
|
602
|
+ this.showtoast('请选择证照类型');
|
|
603
|
+ return
|
|
604
|
+ } else if (this.data.card_number.length<1||formdata.id_card_no.length < 1) {
|
|
605
|
+ this.showtoast('请输入证件号码');
|
|
606
|
+ return
|
|
607
|
+ // } else if (formdata.taxpayer_no.length < 1) {
|
|
608
|
+ // this.showtoast('请输入纳税人识别号');
|
|
609
|
+ // return
|
|
610
|
+ // } else if (formdata.disability_no.length < 1) {
|
|
611
|
+ // this.showtoast('请输入残疾证号');
|
|
612
|
+ // return
|
|
613
|
+ // } else if (formdata.martyr_family_no.length < 1) {
|
|
614
|
+ // this.showtoast('请输入烈属证号');
|
|
615
|
+ // return
|
|
616
|
+ } else if (formdata.mobile.length < 1) {
|
|
617
|
+ this.showtoast('请输入联系电话');
|
|
618
|
+ return
|
|
619
|
+ } else if (formdata.investInfo.selected.length < 1) {
|
|
620
|
+ this.showtoast('请输入是否股东投资者');
|
|
621
|
+ return
|
|
622
|
+ } else if (formdata.specificIndustryInfo.selected.length < 1) {
|
|
623
|
+ this.showtoast('请输入是否特定行业');
|
|
624
|
+ return
|
|
625
|
+ }
|
|
626
|
+ this.setData({
|
|
627
|
+ card_number: this.data.card_number.length > 0 ? this.data.card_number : formdata.id_card_no,
|
|
628
|
+ formData:formdata
|
|
629
|
+ })
|
|
630
|
+ // else if (formdata.contact_address_detail
|
|
631
|
+ // .length < 1) {
|
|
632
|
+ // this.showtoast('请输入联系详细地址');
|
|
633
|
+ // return
|
|
634
|
+ // } else if (formdata.bank_account.length < 1) {
|
|
635
|
+ // this.showtoast('请输入银行卡号');
|
|
636
|
+ // return
|
|
637
|
+ // } else if (formdata.email.length < 1) {
|
|
638
|
+ // this.showtoast('请输入邮箱');
|
|
639
|
+ // return
|
|
640
|
+ // } else if (formdata.current_address_detail.length < 1) {
|
|
641
|
+ // this.showtoast('请输入居住详细地址');
|
|
642
|
+ // return
|
|
643
|
+ // } else if (formdata.huji_address_detail.length < 1) {
|
|
644
|
+ // this.showtoast('请输入户籍详细地址');
|
|
645
|
+ // return
|
|
646
|
+ // }
|
|
647
|
+ this.goCommit();
|
|
648
|
+ },
|
|
649
|
+
|
|
650
|
+ goCommit: function () {
|
|
651
|
+ var that = this
|
|
652
|
+ var Authorization = app.globalData.Authorization;
|
|
653
|
+ wx.request({
|
|
654
|
+ url: baseUrl + 'persontax/v1/personal-taxes',
|
|
655
|
+ method: "GET",
|
|
656
|
+ data: {
|
|
657
|
+ "name": that.data.formdata.name,
|
|
658
|
+ "family_ties": that.data.relativeData.selected,
|
|
659
|
+ "native": "中国",
|
|
660
|
+ "id_card_type": that.data.relativeData.selected,
|
|
661
|
+ "id_card_no": that.data.card_number,
|
|
662
|
+ "gender": that.data.genderData.selected,
|
|
663
|
+ "birth_date": Date.parse(new Date(this.data.birthday)) / 1000,
|
|
664
|
+ "profession": {
|
|
665
|
+ "one_level_code": "1",
|
|
666
|
+ "one_level_name": "专业技术人员",
|
|
667
|
+ "two_level_code": "11",
|
|
668
|
+ "two_level_name": "科学研究人员",
|
|
669
|
+ "three_level_code": "111",
|
|
670
|
+ "three_level_name": "哲学研究人员"
|
|
671
|
+ },
|
|
672
|
+ "education": that.data.degreeData.selected,
|
|
673
|
+ "taxpayer_no": formdata.taxpayer_no,
|
|
674
|
+ "taxpayer_status": that.data.personstatusData.selected,
|
|
675
|
+ "is_martyr_family": that.data.lieshuInfo.selected,
|
|
676
|
+ "martyr_family_no": formdata.martyr_family_no,
|
|
677
|
+ "is_disability": that.data.disabilityInfo.selected,
|
|
678
|
+ "disability_no": formdata.disability_no,
|
|
679
|
+ "is_lonely_man": that.data.lonelyolderInfo.selected,
|
|
680
|
+ "is_overseas_personnel": "否",
|
|
681
|
+ "comment": formdata.comment,
|
|
682
|
+ "current_address": {
|
|
683
|
+ "province_code": that.data.currentaddressInfo.address_code[0],
|
|
684
|
+ "province": that.data.currentaddressInfo.address_value[0],
|
|
685
|
+ "city_code": that.data.currentaddressInfo.address_code[1],
|
|
686
|
+ "city": that.data.currentaddressInfo.address_value[1],
|
|
687
|
+ "district_code": that.data.currentaddressInfo.address_code[2],
|
|
688
|
+ "district": that.data.currentaddressInfo.address_value[2]
|
|
689
|
+ },
|
|
690
|
+ "current_address_detail": formdata.current_address_detail,
|
|
691
|
+ "huji_address": {
|
|
692
|
+ "province_code": that.data.birthaddressInfo.address_code[0],
|
|
693
|
+ "province": that.data.birthaddressInfo.address_value[0],
|
|
694
|
+ "city_code": that.data.birthaddressInfo.address_code[1],
|
|
695
|
+ "city": that.data.birthaddressInfo.address_value[1],
|
|
696
|
+ "district_code": that.data.birthaddressInfo.address_code[2],
|
|
697
|
+ "district": that.data.birthaddressInfo.address_value[2]
|
|
698
|
+ },
|
|
699
|
+ "huji_address_detail": formdata.huji_address_detail,
|
|
700
|
+ "mobile": formdata.mobile,
|
|
701
|
+ "contact_address": {
|
|
702
|
+ "province_code": that.data.contactaddressInfo.address_code[0],
|
|
703
|
+ "province": that.data.contactaddressInfo.address_value[0],
|
|
704
|
+ "city_code": that.data.contactaddressInfo.address_code[1],
|
|
705
|
+ "city": that.data.contactaddressInfo.address_value[1],
|
|
706
|
+ "district_code": that.data.contactaddressInfo.address_code[2],
|
|
707
|
+ "district": that.data.contactaddressInfo.address_value[2]
|
|
708
|
+ },
|
|
709
|
+ "contact_address_detail": formdata.contact_address_detail,
|
|
710
|
+ "email": formdata.email,
|
|
711
|
+ "bank": that.data.bankInfo.selected,
|
|
712
|
+ "bank_account": formdata.bank_account,
|
|
713
|
+ "join_date": Date.parse(new Date(that.data.startDate.selected)) / 1000,
|
|
714
|
+ "separate_date": Date.parse(new Date(that.data.endDate.selected)) / 1000,
|
|
715
|
+ "is_employee": that.data.employeeInfo.selected,
|
|
716
|
+ "is_specific_profession": that.data.specificIndustryInfo.selected,
|
|
717
|
+ "is_investor": that.data.investInfo.selected,
|
|
718
|
+ "is_business_angel": that.data.investpersonalInfo.selected,
|
|
719
|
+ "company_equity_total": formdata.company_equity_total,
|
|
720
|
+ "personal_equity_total": formdata.personal_equity_total,
|
|
721
|
+ "employee_no": formdata.employee_no
|
|
722
|
+ },
|
|
723
|
+ header: {
|
|
724
|
+ 'content-type': 'application/json', // 默认值
|
|
725
|
+ "Authorization": Authorization
|
|
726
|
+ },
|
|
727
|
+ success: function (res) {
|
|
728
|
+ console.log(res)
|
|
729
|
+ },
|
|
730
|
+ fail(res) {
|
|
731
|
+ console.log(res)
|
|
732
|
+ }
|
|
733
|
+ })
|
|
734
|
+ },
|
|
735
|
+
|
|
736
|
+ showtoast: function (title) {
|
|
737
|
+ wx.showToast({
|
|
738
|
+ title: title,
|
|
739
|
+ })
|
30
|
740
|
},
|
31
|
741
|
|
32
|
742
|
/**
|
33
|
743
|
* 生命周期函数--监听页面隐藏
|
34
|
744
|
*/
|
35
|
745
|
onHide: function () {
|
36
|
|
-
|
|
746
|
+
|
37
|
747
|
},
|
38
|
748
|
|
39
|
749
|
/**
|
40
|
750
|
* 生命周期函数--监听页面卸载
|
41
|
751
|
*/
|
42
|
752
|
onUnload: function () {
|
43
|
|
-
|
|
753
|
+
|
44
|
754
|
},
|
45
|
755
|
|
46
|
756
|
/**
|
47
|
757
|
* 页面相关事件处理函数--监听用户下拉动作
|
48
|
758
|
*/
|
49
|
759
|
onPullDownRefresh: function () {
|
50
|
|
-
|
|
760
|
+
|
51
|
761
|
},
|
52
|
762
|
|
53
|
763
|
/**
|
54
|
764
|
* 页面上拉触底事件的处理函数
|
55
|
765
|
*/
|
56
|
766
|
onReachBottom: function () {
|
57
|
|
-
|
|
767
|
+
|
58
|
768
|
},
|
59
|
769
|
|
60
|
770
|
/**
|
61
|
771
|
* 用户点击右上角分享
|
62
|
772
|
*/
|
63
|
773
|
onShareAppMessage: function () {
|
64
|
|
-
|
|
774
|
+
|
65
|
775
|
}
|
66
|
776
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|