...
|
...
|
@@ -3,11 +3,12 @@ var app = getApp(); |
3
|
3
|
var format = require('../../../../utils/util.js');
|
4
|
4
|
var baseUrl = app.globalData.baseUrl;
|
5
|
5
|
Page({
|
6
|
|
-
|
|
6
|
+ cur_id:null,
|
7
|
7
|
/**
|
8
|
8
|
* 页面的初始数据
|
9
|
9
|
*/
|
10
|
10
|
data: {
|
|
11
|
+ isEnable: true,
|
11
|
12
|
isshow01: false,
|
12
|
13
|
isshow02: false,
|
13
|
14
|
isshow03: false,
|
...
|
...
|
@@ -32,15 +33,6 @@ Page({ |
32
|
33
|
values: ["子","女" ,"配偶", "父母", "祖父母", "外祖父母"],
|
33
|
34
|
onChange: 'onPickerSelect'
|
34
|
35
|
},
|
35
|
|
- personstatusData: {
|
36
|
|
- isrequre: true,
|
37
|
|
- label: '纳税人状态',
|
38
|
|
- bindtype: 'personstatus',
|
39
|
|
- selected: '',
|
40
|
|
- placeholder: '请选择纳税人状态',
|
41
|
|
- values: ["正常", "非正常"],
|
42
|
|
- onChange: 'onPickerSelect'
|
43
|
|
- },
|
44
|
36
|
cardtypeData: {
|
45
|
37
|
isrequre: true,
|
46
|
38
|
label: '证照类型',
|
...
|
...
|
@@ -61,13 +53,6 @@ Page({ |
61
|
53
|
values: ["否", "是"],
|
62
|
54
|
onChange: 'onPickerSelect'
|
63
|
55
|
},
|
64
|
|
- bankInfo: {
|
65
|
|
- label: '开户银行',
|
66
|
|
- bindtype: 'bank',
|
67
|
|
- selected: '',
|
68
|
|
- placeholder: '请选择开户银行',
|
69
|
|
- onChange: 'onPickerSelect'
|
70
|
|
- },
|
71
|
56
|
genderData: {
|
72
|
57
|
isblack:true,
|
73
|
58
|
label: '性别',
|
...
|
...
|
@@ -77,278 +62,73 @@ Page({ |
77
|
62
|
values: ["男", "女"],
|
78
|
63
|
onChange: 'onPickerSelect'
|
79
|
64
|
},
|
80
|
|
- professionData: {
|
81
|
|
- mode: 'multiSelector',
|
82
|
|
- label: '职业',
|
83
|
|
- bindtype: 'profession',
|
84
|
|
- selected: '',
|
85
|
|
- range_key: 'label',
|
86
|
|
- placeholder: '请选择职业',
|
87
|
|
- onChange: 'onPickerSelect'
|
88
|
|
- },
|
89
|
|
- degreeData: {
|
90
|
|
- label: '学历',
|
91
|
|
- bindtype: 'degree',
|
92
|
|
- selected: '',
|
93
|
|
- placeholder: '请选择学历',
|
94
|
|
- values: ["研究生", "大学本科", '大学本科以下'],
|
95
|
|
- onChange: 'onPickerSelect'
|
96
|
|
- },
|
97
|
|
- disabilityInfo: {
|
98
|
|
- label: '是否残疾',
|
99
|
|
- bindtype: 'disable',
|
100
|
|
- selected: '',
|
101
|
|
- placeholder: '请选择是否残疾',
|
102
|
|
- values: ["否", "是"],
|
103
|
|
- onChange: 'onPickerSelect'
|
104
|
|
- },
|
105
|
|
- lieshuInfo: {
|
106
|
|
- label: '是否烈属',
|
107
|
|
- bindtype: 'lieshu',
|
108
|
|
- selected: '',
|
109
|
|
- placeholder: '请选择是否烈属',
|
110
|
|
- values: ["否", "是"],
|
111
|
|
- onChange: 'onPickerSelect'
|
112
|
|
- },
|
113
|
|
- lonelyolderInfo: {
|
114
|
|
- label: '是否孤老',
|
115
|
|
- bindtype: 'lonelyolder',
|
116
|
|
- selected: '',
|
117
|
|
- placeholder: '请选择是否孤老',
|
118
|
|
- values: ["否", "是"],
|
119
|
|
- onChange: 'onPickerSelect'
|
120
|
|
- },
|
121
|
|
- investInfo: {
|
122
|
|
- isrequre: true,
|
123
|
|
- label: '是否股东、投资者',
|
124
|
|
- bindtype: 'invest',
|
125
|
|
- selected: '',
|
126
|
|
- placeholder: '请选择是否股东、投资者',
|
127
|
|
- values: ["否", "是"],
|
128
|
|
- onChange: 'onPickerSelect'
|
129
|
|
- },
|
130
|
|
- specificIndustryInfo: {
|
131
|
|
- isrequre: true,
|
132
|
|
- label: '是否特定行业',
|
133
|
|
- bindtype: 'specificIndustry',
|
134
|
|
- selected: '',
|
135
|
|
- placeholder: '请选择是否特定行业',
|
136
|
|
- values: ["否", "是"],
|
137
|
|
- onChange: 'onPickerSelect'
|
138
|
|
- },
|
139
|
|
- employeeInfo: {
|
140
|
|
- isrequre: true,
|
141
|
|
- label: '是否雇员',
|
142
|
|
- bindtype: 'employee',
|
143
|
|
- selected: '',
|
144
|
|
- placeholder: '请选择是否雇员',
|
145
|
|
- values: ["否", "是"],
|
146
|
|
- onChange: 'onPickerSelect'
|
147
|
|
- },
|
148
|
|
- investpersonalInfo: {
|
149
|
|
- label: '是否天使投资个人',
|
150
|
|
- bindtype: 'investpersonal',
|
151
|
|
- selected: '',
|
152
|
|
- placeholder: '请选择是否天使投资个人',
|
153
|
|
- values: ["否", "是"],
|
154
|
|
- onChange: 'onPickerSelect'
|
155
|
|
- },
|
156
|
|
- // 时间picker
|
157
|
|
- birthDate: {
|
158
|
|
- label: '出生年月',
|
159
|
|
- bindtype: 'birthday',
|
160
|
|
- selected: '',
|
161
|
|
- placeholder: '请选择出生日期',
|
162
|
|
- mode: "date",
|
163
|
|
- fields: "day",
|
164
|
|
- start: '1949-01-01',
|
165
|
|
- onChange: 'birthdayChange',
|
166
|
|
- },
|
167
|
|
- startDate: {
|
168
|
|
- label: '任职受雇日期',
|
169
|
|
- bindtype: 'startday',
|
170
|
|
- selected: '',
|
171
|
|
- placeholder: '请选择受雇日期',
|
172
|
|
- mode: "date",
|
173
|
|
- fields: "day",
|
174
|
|
- start: '1990-01-01',
|
175
|
|
- onChange: 'startChange',
|
176
|
|
- },
|
177
|
|
- endDate: {
|
178
|
|
- label: '离职日期',
|
179
|
|
- bindtype: 'endday',
|
180
|
|
- selected: '',
|
181
|
|
- placeholder: '请选择离职日期',
|
182
|
|
- mode: "date",
|
183
|
|
- fields: "day",
|
184
|
|
- start: '2010-01-01',
|
185
|
|
- onChange: 'endChange',
|
186
|
|
- },
|
187
|
|
- // 地址选择器
|
188
|
|
- contactaddressInfo: {
|
189
|
|
- label: '联系地址',
|
190
|
|
- mode: 'region',
|
191
|
|
- address_code: ['', '', ''],
|
192
|
|
- address_value: ['', '', ''],
|
193
|
|
- selected: '',
|
194
|
|
- placeholder: '请选择联系地址',
|
195
|
|
- onChange: 'contactAddressSelect'
|
196
|
|
- },
|
197
|
|
- currentaddressInfo: {
|
198
|
|
- label: '居住地',
|
199
|
|
- mode: 'region',
|
200
|
|
- address_code: ['', '', ''],
|
201
|
|
- address_value: ['', '', ''],
|
202
|
|
- selected: '',
|
203
|
|
- placeholder: '请选择居住地',
|
204
|
|
- onChange: 'currentAddressSelect'
|
205
|
|
- },
|
206
|
|
- birthaddressInfo: {
|
207
|
|
- label: '户籍所在地',
|
208
|
|
- mode: 'region',
|
209
|
|
- address_code: ['', '', ''],
|
210
|
|
- address_value: ['', '', ''],
|
211
|
|
- selected: '',
|
212
|
|
- placeholder: '请选择户籍所在地',
|
213
|
|
- onChange: 'birthAddressSelect'
|
214
|
|
- },
|
215
|
|
- title: '',
|
216
|
|
- condition: false
|
|
65
|
+
|
217
|
66
|
},
|
218
|
67
|
|
219
|
68
|
/**
|
220
|
69
|
* 生命周期函数--监听页面加载
|
221
|
70
|
*/
|
222
|
71
|
onLoad: function(options) {
|
223
|
|
- this.handleData()
|
224
|
|
- this.getproffessiondata()
|
225
|
|
- this.getbanklist()
|
226
|
|
- },
|
227
|
|
-
|
228
|
|
- handleData: function() {
|
229
|
|
- var curdate = format.curDateTime()
|
230
|
|
- console.log('curdate', curdate)
|
231
|
|
- this.data.birthDate.end = curdate
|
232
|
|
- this.data.startDate.end = curdate
|
233
|
|
- this.data.endDate.end = curdate
|
|
72
|
+ console.log('options.id', options.id)
|
|
73
|
+ if (options.id && options.id.length > 0) {
|
|
74
|
+ this.cur_id = options.id
|
|
75
|
+ this.getpersonalTax(options.id)
|
|
76
|
+ }
|
234
|
77
|
},
|
235
|
78
|
|
236
|
|
- getproffessiondata: function() {
|
|
79
|
+ //****************获取自然人数据************/
|
|
80
|
+ getpersonalTax: function (id) {
|
237
|
81
|
var that = this
|
|
82
|
+ wx.showLoading({
|
|
83
|
+ title: '',
|
|
84
|
+ })
|
238
|
85
|
var Authorization = app.globalData.Authorization;
|
239
|
|
- var proffession_info = that.data.professionData
|
240
|
86
|
wx.request({
|
241
|
|
- url: baseUrl + 'common/v1/professions',
|
|
87
|
+ url: baseUrl + 'persontax/v1/personal-taxes/' + id,
|
242
|
88
|
method: "GET",
|
243
|
89
|
header: {
|
244
|
90
|
'content-type': 'application/json', // 默认值
|
245
|
91
|
"Authorization": Authorization
|
246
|
92
|
},
|
247
|
|
- success: function(res) {
|
248
|
|
- proffession_info.values = that.handleProfession(res.data.items)
|
249
|
|
- console.log('proffession_info------', proffession_info)
|
|
93
|
+ success: function (res) {
|
|
94
|
+ console.log('taxInfo', res)
|
250
|
95
|
that.setData({
|
251
|
|
- proffessionlist: res.data.items,
|
252
|
|
- professionData: proffession_info
|
|
96
|
+ taxInfo: res.data,
|
|
97
|
+ isself: res.data.family_ties ? false : true
|
253
|
98
|
})
|
|
99
|
+ that.handleDatas(res.data)
|
254
|
100
|
},
|
255
|
101
|
fail(res) {
|
256
|
102
|
console.log(res)
|
|
103
|
+ wx.hideLoading()
|
|
104
|
+ },
|
|
105
|
+ complete() {
|
|
106
|
+ wx.hideLoading()
|
257
|
107
|
}
|
258
|
108
|
})
|
259
|
109
|
},
|
|
110
|
+ //对各参数初始赋值
|
|
111
|
+ handleDatas: function (tax_info) {
|
260
|
112
|
|
261
|
|
- handleProfession: function(items) {
|
262
|
|
- var new_profession_data = []
|
263
|
|
- var list = [],
|
264
|
|
- tempTwo = {},
|
265
|
|
- tempOne = {},
|
266
|
|
- tempThree = {};
|
267
|
|
- items.map((d) => {
|
268
|
|
- if (!tempOne[d.one_level_code]) {
|
269
|
|
- tempOne[d.one_level_code] = {
|
270
|
|
- "value": d.one_level_code,
|
271
|
|
- "label": d.one_level_name,
|
272
|
|
- "children": []
|
273
|
|
- };
|
274
|
|
- }
|
275
|
|
- if (!tempTwo[d.two_level_code]) {
|
276
|
|
- var districtArray = [];
|
277
|
|
- districtArray.push({
|
278
|
|
- "value": d.three_level_code,
|
279
|
|
- "label": d.three_level_name,
|
280
|
|
- "children": []
|
281
|
|
- });
|
282
|
|
-
|
283
|
|
- tempTwo[d.two_level_code] = {
|
284
|
|
- "value": d.two_level_code,
|
285
|
|
- "label": d.two_level_name,
|
286
|
|
- "children": districtArray
|
287
|
|
- };
|
288
|
|
-
|
289
|
|
- } else {
|
290
|
|
- if (!tempThree[d.three_level_code]) {
|
291
|
|
- tempTwo[d.two_level_code].children.push({
|
292
|
|
- "value": d.three_level_code,
|
293
|
|
- "label": d.three_level_name,
|
294
|
|
- "children": []
|
295
|
|
- });
|
296
|
|
- tempThree[d.three_level_code] = "y"
|
297
|
|
- }
|
298
|
|
- }
|
299
|
|
- });
|
300
|
|
- items.map((d) => {
|
301
|
|
- if (tempTwo[d.two_level_code]) {
|
302
|
|
- tempOne[d.one_level_code].children.push(tempTwo[d.two_level_code]);
|
303
|
|
- tempTwo[d.two_level_code] = null;
|
304
|
|
- }
|
305
|
|
- });
|
306
|
|
- for (var key in tempOne) {
|
307
|
|
- list.push(tempOne[key]);
|
308
|
|
- }
|
309
|
|
- new_profession_data = [list, list[0].children, list[0].children[0].children]
|
310
|
|
- console.log('new_profession_data', new_profession_data)
|
311
|
|
- return new_profession_data;
|
|
113
|
+ var isDisable = tax_info.certification_status != 'active'//已通过拍摄身份证认证过,不能修改
|
312
|
114
|
|
313
|
|
- },
|
314
|
|
-
|
315
|
|
- getbanklist: function() {
|
316
|
|
- var that = this
|
317
|
|
- var Authorization = app.globalData.Authorization;
|
318
|
|
- var bank_info = that.data.bankInfo
|
319
|
|
- wx.request({
|
320
|
|
- url: baseUrl + 'walletmgm/v1/bankinfos',
|
321
|
|
- method: "GET",
|
322
|
|
- header: {
|
323
|
|
- 'content-type': 'application/json', // 默认值
|
324
|
|
- "Authorization": Authorization
|
325
|
|
- },
|
326
|
|
- success: function(res) {
|
327
|
|
- console.log(res)
|
328
|
|
- if (res.data && res.data.items && res.data.items.length > 0) {
|
329
|
|
- bank_info.values = that.handleBankinfo(res.data.items)
|
330
|
|
-
|
331
|
|
- that.setData({
|
332
|
|
- banklist: res.data.items,
|
333
|
|
- bankInfo: bank_info
|
334
|
|
- })
|
335
|
|
- }
|
336
|
|
- console.log("bankInfo", that.data.bankInfo)
|
337
|
|
- },
|
338
|
|
- fail(res) {
|
339
|
|
- console.log(res)
|
340
|
|
- }
|
|
115
|
+ this.data.relativeData.selected = tax_info.family_ties
|
|
116
|
+ // this.data.cardtypeData.selected = tax_info.id_card_type
|
|
117
|
+ this.data.genderData.selected = tax_info.gender
|
|
118
|
+ this.data.genderData.disabled = isDisable
|
|
119
|
+
|
|
120
|
+ this.setData({
|
|
121
|
+ isDisable: isDisable,
|
|
122
|
+ relativeData: this.data.relativeData,
|
|
123
|
+ name: tax_info.name,
|
|
124
|
+ // cardtypeData: this.data.cardtypeData,
|
|
125
|
+ genderData: this.data.genderData,
|
|
126
|
+ isIdCard: '居民身份证' == tax_info.id_card_type ? true : false,
|
|
127
|
+ card_number: tax_info.id_card_no
|
341
|
128
|
})
|
|
129
|
+ this.dealIdInfo(tax_info.id_card_no)//处理了性别和年龄
|
342
|
130
|
},
|
343
|
|
-
|
344
|
|
- handleBankinfo: function(data) {
|
345
|
|
- var bank_name = []
|
346
|
|
- for (var i = 0; i < data.length; i++) {
|
347
|
|
- bank_name.push(data[i].bank_name)
|
348
|
|
- }
|
349
|
|
- return bank_name
|
350
|
|
- },
|
351
|
|
-
|
|
131
|
+
|
352
|
132
|
/**
|
353
|
133
|
* 生命周期函数--监听页面初次渲染完成
|
354
|
134
|
*/
|
...
|
...
|
@@ -378,8 +158,8 @@ Page({ |
378
|
158
|
} else if (id_info.birthday.month < 10 && id_info.birthday.day < 10) {
|
379
|
159
|
birth_day = id_info.birthday.year + '-0' + id_info.birthday.month + '-0' + id_info.birthday.day;
|
380
|
160
|
}
|
381
|
|
- var cardtype_Data = that.data.cardtypeData
|
382
|
|
- cardtype_Data.selected = '居民身份证'
|
|
161
|
+ // var cardtype_Data = that.data.cardtypeData
|
|
162
|
+ // cardtype_Data.selected = '居民身份证'
|
383
|
163
|
var gender_Data = that.data.genderData
|
384
|
164
|
gender_Data.selected = id_info.gender
|
385
|
165
|
|
...
|
...
|
@@ -397,7 +177,7 @@ Page({ |
397
|
177
|
idInfoData: id_info,
|
398
|
178
|
name: id_info.name,
|
399
|
179
|
birthday: birth_day,
|
400
|
|
- cardtypeData: cardtype_Data,
|
|
180
|
+ // cardtypeData: cardtype_Data,
|
401
|
181
|
genderData: gender_Data,
|
402
|
182
|
long_birth_date: Date.parse(new Date(birth_day)) / 1000,
|
403
|
183
|
birthDate: that.data.birthDate,
|
...
|
...
|
@@ -415,23 +195,6 @@ Page({ |
415
|
195
|
})
|
416
|
196
|
},
|
417
|
197
|
|
418
|
|
- span: function(e) {
|
419
|
|
- console.log(e)
|
420
|
|
- if ("1" == e.target.id) {
|
421
|
|
- this.setData({
|
422
|
|
- isshow01: !this.data.isshow01
|
423
|
|
- })
|
424
|
|
- } else if ("2" == e.target.id) {
|
425
|
|
- this.setData({
|
426
|
|
- isshow02: !this.data.isshow02
|
427
|
|
- })
|
428
|
|
- } else if ("3" == e.target.id) {
|
429
|
|
- this.setData({
|
430
|
|
- isshow03: !this.data.isshow03
|
431
|
|
- })
|
432
|
|
- }
|
433
|
|
-
|
434
|
|
- },
|
435
|
198
|
// =============普通单列picker选中处理==============
|
436
|
199
|
onPickerSelect: function(e) {
|
437
|
200
|
console.log('picker发送选择改变,携带值为', e)
|
...
|
...
|
@@ -443,13 +206,6 @@ Page({ |
443
|
206
|
relativeData: relative_data
|
444
|
207
|
})
|
445
|
208
|
break;
|
446
|
|
- case 'personstatus':
|
447
|
|
- var personstatus_data = this.data.personstatusData
|
448
|
|
- personstatus_data.selected = personstatus_data.values[e.detail.value]
|
449
|
|
- this.setData({
|
450
|
|
- personstatusData: personstatus_data
|
451
|
|
- })
|
452
|
|
- break;
|
453
|
209
|
case 'cardtype':
|
454
|
210
|
var is_idcard = this.data.isIdCard
|
455
|
211
|
var cardtype_data = this.data.cardtypeData
|
...
|
...
|
@@ -464,20 +220,6 @@ Page({ |
464
|
220
|
cardtypeData: cardtype_data
|
465
|
221
|
})
|
466
|
222
|
break;
|
467
|
|
- case 'forigner':
|
468
|
|
- var forigner_data = this.data.forignerInfo
|
469
|
|
- forigner_data.selected = forigner_data.values[e.detail.value]
|
470
|
|
- this.setData({
|
471
|
|
- forignerInfo: forigner_data
|
472
|
|
- })
|
473
|
|
- break;
|
474
|
|
- case 'bank':
|
475
|
|
- var bank_data = this.data.bankInfo
|
476
|
|
- bank_data.selected = bank_data.values[e.detail.value]
|
477
|
|
- this.setData({
|
478
|
|
- bankInfo: bank_data
|
479
|
|
- })
|
480
|
|
- break;
|
481
|
223
|
case 'gender':
|
482
|
224
|
var gender_data = this.data.genderData
|
483
|
225
|
gender_data.selected = gender_data.values[e.detail.value]
|
...
|
...
|
@@ -485,134 +227,11 @@ Page({ |
485
|
227
|
genderData: gender_data
|
486
|
228
|
})
|
487
|
229
|
break;
|
488
|
|
- case 'profession':
|
489
|
|
- var profession_data = this.data.professionData
|
490
|
|
- console.log(profession_data.values[e.detail.value[e.detail.value[0]]][0])
|
491
|
|
- var profession_name = profession_data.values[e.detail.value[e.detail.value[0]]][0].children[e.detail.value[1]].children[e.detail.value[2]].label
|
492
|
|
- profession_data.selected = profession_name
|
493
|
|
- this.setData({
|
494
|
|
- profession_index: e.detail.value,
|
495
|
|
- professionData: profession_data
|
496
|
|
- })
|
497
|
|
- break;
|
498
|
|
- case 'degree':
|
499
|
|
- var degree_data = this.data.degreeData
|
500
|
|
- degree_data.selected = degree_data.values[e.detail.value]
|
501
|
|
- this.setData({
|
502
|
|
- degreeData: degree_data
|
503
|
|
- })
|
504
|
|
- break;
|
505
|
|
- case 'disable':
|
506
|
|
- var disable_data = this.data.disabilityInfo
|
507
|
|
- disable_data.selected = disable_data.values[e.detail.value]
|
508
|
|
- this.setData({
|
509
|
|
- disabilityInfo: disable_data
|
510
|
|
- })
|
511
|
|
- break;
|
512
|
|
- case 'lieshu':
|
513
|
|
- var lieshu_data = this.data.lieshuInfo
|
514
|
|
- lieshu_data.selected = lieshu_data.values[e.detail.value]
|
515
|
|
- this.setData({
|
516
|
|
- lieshuInfo: lieshu_data
|
517
|
|
- })
|
518
|
|
- break;
|
519
|
|
- case 'lonelyolder':
|
520
|
|
- var lonelyolder_data = this.data.lonelyolderInfo
|
521
|
|
- lonelyolder_data.selected = lonelyolder_data.values[e.detail.value]
|
522
|
|
- this.setData({
|
523
|
|
- lonelyolderInfo: lonelyolder_data
|
524
|
|
- })
|
525
|
|
- break;
|
526
|
|
- case 'invest':
|
527
|
|
- var invest_data = this.data.investInfo
|
528
|
|
- invest_data.selected = invest_data.values[e.detail.value]
|
529
|
|
- this.setData({
|
530
|
|
- investInfo: invest_data
|
531
|
|
- })
|
532
|
|
- break;
|
533
|
|
- case 'specificIndustry':
|
534
|
|
- var specificIndustry_data = this.data.specificIndustryInfo
|
535
|
|
- specificIndustry_data.selected = specificIndustry_data.values[e.detail.value]
|
536
|
|
- this.setData({
|
537
|
|
- specificIndustryInfo: specificIndustry_data
|
538
|
|
- })
|
539
|
|
- break;
|
540
|
|
- case 'employee':
|
541
|
|
- var employee_data = this.data.employeeInfo
|
542
|
|
- employee_data.selected = employee_data.values[e.detail.value]
|
543
|
|
- this.setData({
|
544
|
|
- employeeInfo: employee_data
|
545
|
|
- })
|
546
|
|
- break;
|
547
|
|
- case 'investpersonal':
|
548
|
|
- var investpersonal_data = this.data.investpersonalInfo
|
549
|
|
- investpersonal_data.selected = investpersonal_data.values[e.detail.value]
|
550
|
|
- this.setData({
|
551
|
|
- investpersonalInfo: investpersonal_data
|
552
|
|
- })
|
553
|
|
- break;
|
|
230
|
+
|
554
|
231
|
}
|
555
|
232
|
|
556
|
233
|
},
|
557
|
234
|
|
558
|
|
- // =============日期picker选中处理==============
|
559
|
|
- birthdayChange: function(e) {
|
560
|
|
- var birth_date = this.data.birthDate;
|
561
|
|
- birth_date.selected = e.detail.value
|
562
|
|
- console.log('long_birth_date', Date.parse(new Date(e.detail.value)) / 1000)
|
563
|
|
- this.setData({
|
564
|
|
- long_birth_date: (Date.parse(new Date(e.detail.value)) / 1000),
|
565
|
|
- birthDate: birth_date
|
566
|
|
- })
|
567
|
|
- },
|
568
|
|
-
|
569
|
|
- startChange: function(e) {
|
570
|
|
- var start_date = this.data.startDate;
|
571
|
|
- start_date.selected = e.detail.value
|
572
|
|
- this.setData({
|
573
|
|
- startDate: start_date
|
574
|
|
- })
|
575
|
|
- },
|
576
|
|
-
|
577
|
|
- endChange: function(e) {
|
578
|
|
- var end_date = this.data.endDate;
|
579
|
|
- end_date.selected = e.detail.value
|
580
|
|
- this.setData({
|
581
|
|
- endDate: end_date
|
582
|
|
- })
|
583
|
|
- },
|
584
|
|
-
|
585
|
|
- // =============地区picker选中处理==============
|
586
|
|
-
|
587
|
|
- contactAddressSelect: function(e) {
|
588
|
|
- console.log('contactAddressSelect', e)
|
589
|
|
- var contact_address = this.data.contactaddressInfo;
|
590
|
|
- contact_address.address_value = e.detail.value
|
591
|
|
- contact_address.address_code = e.detail.code
|
592
|
|
- this.setData({
|
593
|
|
- contactaddressInfo: contact_address
|
594
|
|
- })
|
595
|
|
- },
|
596
|
|
-
|
597
|
|
- currentAddressSelect: function(e) {
|
598
|
|
- console.log('currentAddressSelect', e)
|
599
|
|
- var current_address = this.data.currentaddressInfo;
|
600
|
|
- current_address.address_value = e.detail.value
|
601
|
|
- current_address.address_code = e.detail.code
|
602
|
|
- this.setData({
|
603
|
|
- currentaddressInfo: current_address
|
604
|
|
- })
|
605
|
|
- },
|
606
|
|
-
|
607
|
|
- birthAddressSelect: function(e) {
|
608
|
|
- console.log('birthAddressSelect', e)
|
609
|
|
- var birth_address = this.data.birthaddressInfo;
|
610
|
|
- birth_address.address_value = e.detail.value
|
611
|
|
- birth_address.address_code = e.detail.code
|
612
|
|
- this.setData({
|
613
|
|
- birthaddressInfo: birth_address
|
614
|
|
- })
|
615
|
|
- },
|
616
|
235
|
|
617
|
236
|
// =============其他数据选中处理==============
|
618
|
237
|
|
...
|
...
|
@@ -644,14 +263,6 @@ Page({ |
644
|
263
|
this.showtoast('有必填项未填写');
|
645
|
264
|
return
|
646
|
265
|
}
|
647
|
|
- // else if (this.data.personstatusData.selected.length < 1) {
|
648
|
|
- // this.showtoast('有必填项未填写');
|
649
|
|
- // return
|
650
|
|
- // }
|
651
|
|
- // else if (this.data.cardtypeData.selected.length < 1) {
|
652
|
|
- // this.showtoast('有必填项未填写');
|
653
|
|
- // return
|
654
|
|
- // }
|
655
|
266
|
else if (this.data.isIdCard && (this.data.card_number.length < 1 && formdata.id_card_no.length < 1)) {
|
656
|
267
|
this.showtoast('有必填项未填写');
|
657
|
268
|
return
|
...
|
...
|
@@ -662,35 +273,10 @@ Page({ |
662
|
273
|
this.showtoast('有必填项未填写');
|
663
|
274
|
return
|
664
|
275
|
}
|
665
|
|
- // else if (formdata.mobile.length < 1) {
|
666
|
|
- // this.showtoast('有必填项未填写');
|
667
|
|
- // return
|
668
|
|
- // }
|
669
|
|
- // else if (!regMobile.test(formdata.mobile)) {
|
670
|
|
- // this.showtoast('请输入正确手机号');
|
671
|
|
- // return
|
672
|
|
- // }
|
673
|
|
- // else if (this.data.investInfo.selected.length < 1) {
|
674
|
|
- // this.showtoast('有必填项未填写');
|
675
|
|
- // return
|
676
|
|
- // } else if (this.data.specificIndustryInfo.selected.length < 1) {
|
677
|
|
- // this.showtoast('有必填项未填写');
|
678
|
|
- // return
|
679
|
|
- // } else if (this.data.employeeInfo.selected.length < 1) {
|
680
|
|
- // this.showtoast('有必填项未填写');
|
681
|
|
- // return
|
682
|
|
- // }
|
683
|
276
|
else if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)) {
|
684
|
277
|
this.showtoast('请输入正确邮箱');
|
685
|
278
|
return
|
686
|
279
|
}
|
687
|
|
- // else if (formdata.company_equity_total && formdata.company_equity_total.length > 0 && !regMoney.test(formdata.company_equity_total)) {
|
688
|
|
- // this.showtoast('请输入正确金额');
|
689
|
|
- // return
|
690
|
|
- // } else if (formdata.personal_equity_total && formdata.personal_equity_total.length > 0 && !regMoney.test(formdata.personal_equity_total)) {
|
691
|
|
- // this.showtoast('请输入正确金额');
|
692
|
|
- // return
|
693
|
|
- // }
|
694
|
280
|
var new_card_num = ''
|
695
|
281
|
if (this.data.isIdCard) {
|
696
|
282
|
if (this.data.card_number.length > 0) {
|
...
|
...
|
@@ -715,72 +301,28 @@ Page({ |
715
|
301
|
var formdata = data
|
716
|
302
|
console.log("form_data", formdata);
|
717
|
303
|
var Authorization = app.globalData.Authorization;
|
718
|
|
- var request_profession = that.getProfessionRequest()
|
|
304
|
+ var url = baseUrl + 'persontax/v1/personal-taxes', method = "POST"
|
|
305
|
+ if (this.cur_id.length){
|
|
306
|
+ url = baseUrl + 'persontax/v1/personal-taxes/' + this.cur_id
|
|
307
|
+ method = "PUT"
|
|
308
|
+ }
|
|
309
|
+ console.log('this.cur_id', this.cur_id)
|
|
310
|
+ wx.showLoading({
|
|
311
|
+ title: '',
|
|
312
|
+ })
|
719
|
313
|
wx.request({
|
720
|
|
- url: baseUrl + 'persontax/v1/personal-taxes',
|
721
|
|
- method: "POST",
|
|
314
|
+ url: url,
|
|
315
|
+ method: method,
|
722
|
316
|
data: {
|
723
|
317
|
'certification_status': that.getCertifyStatus(formdata),
|
724
|
318
|
"family_ties": that.data.relativeData.selected,
|
725
|
319
|
"id_card_type": '居民身份证',//that.data.cardtypeData.selected,
|
726
|
320
|
"id_card_no": formdata.id_card_no ? formdata.id_card_no : that.data.card_number,
|
727
|
|
- "name": that.data.name.length > 0 ? that.data.name : formdata.name,
|
|
321
|
+ "name": formdata.name,
|
728
|
322
|
"gender": that.data.genderData.selected,
|
729
|
323
|
//"age": formdata.age ? formdata.age : '',//不传
|
730
|
324
|
"native": "中国",
|
731
|
325
|
"is_overseas_personnel": "否",
|
732
|
|
-
|
733
|
|
- // "birth_date": that.data.long_birth_date,
|
734
|
|
- // "profession": request_profession,
|
735
|
|
- // "education": that.data.degreeData.selected,
|
736
|
|
- // "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '',
|
737
|
|
- // "taxpayer_status": that.data.personstatusData.selected,
|
738
|
|
- // "is_martyr_family": that.data.lieshuInfo.selected,
|
739
|
|
- // "martyr_family_no": that.data.lieshuInfo.selected == '否' ? '' : formdata.martyr_family_no,
|
740
|
|
- // "is_disability": that.data.disabilityInfo.selected,
|
741
|
|
- // "disability_no": that.data.disabilityInfo.selected == '否' ? '' : formdata.disability_no,
|
742
|
|
- // "is_lonely_man": that.data.lonelyolderInfo.selected,
|
743
|
|
- // "comment": formdata.comment,
|
744
|
|
- // "current_address": {
|
745
|
|
- // "province_code": that.data.currentaddressInfo.address_code[0],
|
746
|
|
- // "province": that.data.currentaddressInfo.address_value[0],
|
747
|
|
- // "city_code": that.data.currentaddressInfo.address_code[1],
|
748
|
|
- // "city": that.data.currentaddressInfo.address_value[1],
|
749
|
|
- // "district_code": that.data.currentaddressInfo.address_code[2],
|
750
|
|
- // "district": that.data.currentaddressInfo.address_value[2]
|
751
|
|
- // },
|
752
|
|
- // "current_address_detail": formdata.current_address_detail,
|
753
|
|
- // "huji_address": {
|
754
|
|
- // "province_code": that.data.birthaddressInfo.address_code[0],
|
755
|
|
- // "province": that.data.birthaddressInfo.address_value[0],
|
756
|
|
- // "city_code": that.data.birthaddressInfo.address_code[1],
|
757
|
|
- // "city": that.data.birthaddressInfo.address_value[1],
|
758
|
|
- // "district_code": that.data.birthaddressInfo.address_code[2],
|
759
|
|
- // "district": that.data.birthaddressInfo.address_value[2]
|
760
|
|
- // },
|
761
|
|
- // "huji_address_detail": formdata.huji_address_detail.replace(/(^\s*)|(\s*$)/g, ""),
|
762
|
|
- // "mobile": formdata.mobile + "",
|
763
|
|
- // "contact_address": {
|
764
|
|
- // "province_code": that.data.contactaddressInfo.address_code[0],
|
765
|
|
- // "province": that.data.contactaddressInfo.address_value[0],
|
766
|
|
- // "city_code": that.data.contactaddressInfo.address_code[1],
|
767
|
|
- // "city": that.data.contactaddressInfo.address_value[1],
|
768
|
|
- // "district_code": that.data.contactaddressInfo.address_code[2],
|
769
|
|
- // "district": that.data.contactaddressInfo.address_value[2]
|
770
|
|
- // },
|
771
|
|
- // "contact_address_detail": formdata.contact_address_detail,
|
772
|
|
- // "email": formdata.email,
|
773
|
|
- // "bank": that.data.bankInfo.selected,
|
774
|
|
- // "bank_account": formdata.bank_account,
|
775
|
|
- // "join_date": that.data.startDate.selected.length > 0 ? Date.parse(new Date(that.data.startDate.selected)) / 1000 : null,
|
776
|
|
- // "separate_date": that.data.endDate.selected.length > 0 ? Date.parse(new Date(that.data.endDate.selected)) / 1000 : null,
|
777
|
|
- // "is_employee": that.data.employeeInfo.selected,
|
778
|
|
- // "is_specific_profession": that.data.specificIndustryInfo.selected,
|
779
|
|
- // "is_investor": that.data.investInfo.selected,
|
780
|
|
- // "is_business_angel": that.data.investpersonalInfo.selected,
|
781
|
|
- // "company_equity_total": parseFloat(formdata.company_equity_total),
|
782
|
|
- // "personal_equity_total": parseFloat(formdata.personal_equity_total),
|
783
|
|
- // "employee_no": formdata.employee_no
|
784
|
326
|
},
|
785
|
327
|
header: {
|
786
|
328
|
'content-type': 'application/json', // 默认值
|
...
|
...
|
@@ -798,40 +340,15 @@ Page({ |
798
|
340
|
content: '',
|
799
|
341
|
})
|
800
|
342
|
}
|
801
|
|
-
|
|
343
|
+ wx.hideLoading()
|
802
|
344
|
},
|
803
|
345
|
fail(res) {
|
804
|
346
|
console.log(res)
|
|
347
|
+ wx.hideLoading()
|
805
|
348
|
}
|
806
|
349
|
})
|
807
|
350
|
},
|
808
|
351
|
|
809
|
|
- getProfessionRequest: function() {
|
810
|
|
- var that = this
|
811
|
|
- var pro_index = that.data.profession_index
|
812
|
|
-
|
813
|
|
- if (pro_index.length == 3) {
|
814
|
|
- var profession_data_info = that.data.professionData.values[pro_index[pro_index[0]]][0]
|
815
|
|
- console.log('profession_datas', profession_data_info)
|
816
|
|
- return {
|
817
|
|
- "one_level_code": profession_data_info.value,
|
818
|
|
- "one_level_name": profession_data_info.label,
|
819
|
|
- "two_level_code": profession_data_info.children[pro_index[1]].value,
|
820
|
|
- "two_level_name": profession_data_info.children[pro_index[1]].label,
|
821
|
|
- "three_level_code": profession_data_info.children[pro_index[1]].children[pro_index[2]].value,
|
822
|
|
- "three_level_name": profession_data_info.children[pro_index[1]].children[pro_index[2]].label
|
823
|
|
- }
|
824
|
|
- } else {
|
825
|
|
- return {
|
826
|
|
- "one_level_code": '',
|
827
|
|
- "one_level_name": '',
|
828
|
|
- "two_level_code": '',
|
829
|
|
- "two_level_name": '',
|
830
|
|
- "three_level_code": '',
|
831
|
|
- "three_level_name": ''
|
832
|
|
- }
|
833
|
|
- }
|
834
|
|
- },
|
835
|
352
|
|
836
|
353
|
getCertifyStatus: function(formdata) {
|
837
|
354
|
var iddata = this.data.idInfoData;
|
...
|
...
|
@@ -870,7 +387,6 @@ Page({ |
870
|
387
|
genderData: gender_data
|
871
|
388
|
})
|
872
|
389
|
}
|
873
|
|
-
|
874
|
390
|
},
|
875
|
391
|
|
876
|
392
|
idChange: function (e) {
|
...
|
...
|
|