|
@@ -3,7 +3,7 @@ var format = require('../../../utils/util.js'); |
|
@@ -3,7 +3,7 @@ var format = require('../../../utils/util.js'); |
3
|
var app = getApp();
|
3
|
var app = getApp();
|
4
|
var baseUrl = app.globalData.baseUrl;
|
4
|
var baseUrl = app.globalData.baseUrl;
|
5
|
Page({
|
5
|
Page({
|
6
|
-
|
6
|
+
|
7
|
/**
|
7
|
/**
|
8
|
* 页面的初始数据
|
8
|
* 页面的初始数据
|
9
|
*/
|
9
|
*/
|
|
@@ -21,7 +21,10 @@ Page({ |
|
@@ -21,7 +21,10 @@ Page({ |
21
|
name: '',
|
21
|
name: '',
|
22
|
mobile: '',
|
22
|
mobile: '',
|
23
|
birthday: '',
|
23
|
birthday: '',
|
24
|
- id_error:false,
|
24
|
+ id_error: false,
|
|
|
25
|
+ curAddress_haschanged:false,
|
|
|
26
|
+ birthAddress_haschanged: false,
|
|
|
27
|
+ contactAddress_haschanged: false,
|
25
|
card_number: '',
|
28
|
card_number: '',
|
26
|
long_birth_date: 0,
|
29
|
long_birth_date: 0,
|
27
|
long_start_date: 0,
|
30
|
long_start_date: 0,
|
|
@@ -164,6 +167,7 @@ Page({ |
|
@@ -164,6 +167,7 @@ Page({ |
164
|
selected: '',
|
167
|
selected: '',
|
165
|
mode: "date",
|
168
|
mode: "date",
|
166
|
fields: "day",
|
169
|
fields: "day",
|
|
|
170
|
+ start:'1949-01-01',
|
167
|
onChange: 'birthdayChange',
|
171
|
onChange: 'birthdayChange',
|
168
|
},
|
172
|
},
|
169
|
startDate: {
|
173
|
startDate: {
|
|
@@ -173,6 +177,7 @@ Page({ |
|
@@ -173,6 +177,7 @@ Page({ |
173
|
selected: '',
|
177
|
selected: '',
|
174
|
mode: "date",
|
178
|
mode: "date",
|
175
|
fields: "day",
|
179
|
fields: "day",
|
|
|
180
|
+ start: '1990-01-01',
|
176
|
onChange: 'startChange',
|
181
|
onChange: 'startChange',
|
177
|
},
|
182
|
},
|
178
|
endDate: {
|
183
|
endDate: {
|
|
@@ -182,6 +187,7 @@ Page({ |
|
@@ -182,6 +187,7 @@ Page({ |
182
|
selected: '',
|
187
|
selected: '',
|
183
|
mode: "date",
|
188
|
mode: "date",
|
184
|
fields: "day",
|
189
|
fields: "day",
|
|
|
190
|
+ start: '2010-01-01',
|
185
|
onChange: 'endChange',
|
191
|
onChange: 'endChange',
|
186
|
},
|
192
|
},
|
187
|
// 地址选择器
|
193
|
// 地址选择器
|
|
@@ -233,6 +239,9 @@ Page({ |
|
@@ -233,6 +239,9 @@ Page({ |
233
|
|
239
|
|
234
|
getpersonalTax: function(id) {
|
240
|
getpersonalTax: function(id) {
|
235
|
var that = this
|
241
|
var that = this
|
|
|
242
|
+ wx.showLoading({
|
|
|
243
|
+ title: '',
|
|
|
244
|
+ })
|
236
|
var Authorization = app.globalData.Authorization;
|
245
|
var Authorization = app.globalData.Authorization;
|
237
|
wx.request({
|
246
|
wx.request({
|
238
|
url: baseUrl + 'persontax/v1/personal-taxes/' + id,
|
247
|
url: baseUrl + 'persontax/v1/personal-taxes/' + id,
|
|
@@ -251,12 +260,19 @@ Page({ |
|
@@ -251,12 +260,19 @@ Page({ |
251
|
},
|
260
|
},
|
252
|
fail(res) {
|
261
|
fail(res) {
|
253
|
console.log(res)
|
262
|
console.log(res)
|
|
|
263
|
+ wx.hideLoading()
|
|
|
264
|
+ },
|
|
|
265
|
+ complete() {
|
|
|
266
|
+ wx.hideLoading()
|
254
|
}
|
267
|
}
|
255
|
})
|
268
|
})
|
256
|
},
|
269
|
},
|
257
|
|
270
|
|
258
|
//对各参数初始赋值
|
271
|
//对各参数初始赋值
|
259
|
handleDatas: function() {
|
272
|
handleDatas: function() {
|
|
|
273
|
+ //todo
|
|
|
274
|
+ // var curdate = format.getNowFormatDate()
|
|
|
275
|
+ console.log('curdate', curdate)
|
260
|
var tax_info = this.data.taxInfo
|
276
|
var tax_info = this.data.taxInfo
|
261
|
this.data.name = tax_info.name
|
277
|
this.data.name = tax_info.name
|
262
|
this.data.relativeData.selected = tax_info.family_ties
|
278
|
this.data.relativeData.selected = tax_info.family_ties
|
|
@@ -292,6 +308,7 @@ Page({ |
|
@@ -292,6 +308,7 @@ Page({ |
292
|
investInfo: this.data.investInfo,
|
308
|
investInfo: this.data.investInfo,
|
293
|
specificIndustryInfo: this.data.specificIndustryInfo,
|
309
|
specificIndustryInfo: this.data.specificIndustryInfo,
|
294
|
genderData: this.data.genderData,
|
310
|
genderData: this.data.genderData,
|
|
|
311
|
+ bankInfo: this.data.bankInfo,
|
295
|
|
312
|
|
296
|
professionData: this.data.professionData,
|
313
|
professionData: this.data.professionData,
|
297
|
degreeData: this.data.degreeData,
|
314
|
degreeData: this.data.degreeData,
|
|
@@ -310,10 +327,11 @@ Page({ |
|
@@ -310,10 +327,11 @@ Page({ |
310
|
startDate: this.data.startDate,
|
327
|
startDate: this.data.startDate,
|
311
|
long_end_date: tax_info.separate_date,
|
328
|
long_end_date: tax_info.separate_date,
|
312
|
endDate: this.data.endDate,
|
329
|
endDate: this.data.endDate,
|
313
|
- isIdCard: '居民身份证' == tax_info.id_card_type?true:false,
|
330
|
+ isIdCard: '居民身份证' == tax_info.id_card_type ? true : false,
|
314
|
card_number: this.data.card_number
|
331
|
card_number: this.data.card_number
|
315
|
|
332
|
|
316
|
})
|
333
|
})
|
|
|
334
|
+
|
317
|
},
|
335
|
},
|
318
|
|
336
|
|
319
|
getproffessiondata: function() {
|
337
|
getproffessiondata: function() {
|
|
@@ -337,6 +355,9 @@ Page({ |
|
@@ -337,6 +355,9 @@ Page({ |
337
|
},
|
355
|
},
|
338
|
fail(res) {
|
356
|
fail(res) {
|
339
|
console.log(res)
|
357
|
console.log(res)
|
|
|
358
|
+ },
|
|
|
359
|
+ complete() {
|
|
|
360
|
+ wx.hideLoading()
|
340
|
}
|
361
|
}
|
341
|
})
|
362
|
})
|
342
|
},
|
363
|
},
|
|
@@ -418,6 +439,9 @@ Page({ |
|
@@ -418,6 +439,9 @@ Page({ |
418
|
},
|
439
|
},
|
419
|
fail(res) {
|
440
|
fail(res) {
|
420
|
console.log(res)
|
441
|
console.log(res)
|
|
|
442
|
+ },
|
|
|
443
|
+ complete() {
|
|
|
444
|
+ wx.hideLoading()
|
421
|
}
|
445
|
}
|
422
|
})
|
446
|
})
|
423
|
},
|
447
|
},
|
|
@@ -440,12 +464,12 @@ Page({ |
|
@@ -440,12 +464,12 @@ Page({ |
440
|
/**
|
464
|
/**
|
441
|
* 生命周期函数--监听页面显示
|
465
|
* 生命周期函数--监听页面显示
|
442
|
*/
|
466
|
*/
|
443
|
- onShow: function () {
|
467
|
+ onShow: function() {
|
444
|
var that = this
|
468
|
var that = this
|
445
|
var id_error = this.data.id_error
|
469
|
var id_error = this.data.id_error
|
446
|
wx.getStorage({
|
470
|
wx.getStorage({
|
447
|
key: 'id_info',
|
471
|
key: 'id_info',
|
448
|
- success: function (res) {
|
472
|
+ success: function(res) {
|
449
|
console.log('id_info', res.data)
|
473
|
console.log('id_info', res.data)
|
450
|
if (res.data && res.data.length > 0) {
|
474
|
if (res.data && res.data.length > 0) {
|
451
|
var id_info = JSON.parse(res.data)
|
475
|
var id_info = JSON.parse(res.data)
|
|
@@ -483,7 +507,7 @@ Page({ |
|
@@ -483,7 +507,7 @@ Page({ |
483
|
})
|
507
|
})
|
484
|
wx.removeStorage({
|
508
|
wx.removeStorage({
|
485
|
key: 'id_info',
|
509
|
key: 'id_info',
|
486
|
- success: function (res) {
|
510
|
+ success: function(res) {
|
487
|
console.log('remove_idinfo', res)
|
511
|
console.log('remove_idinfo', res)
|
488
|
},
|
512
|
},
|
489
|
})
|
513
|
})
|
|
@@ -668,18 +692,20 @@ Page({ |
|
@@ -668,18 +692,20 @@ Page({ |
668
|
contact_address.address_value = e.detail.value
|
692
|
contact_address.address_value = e.detail.value
|
669
|
contact_address.address_code = e.detail.code
|
693
|
contact_address.address_code = e.detail.code
|
670
|
this.setData({
|
694
|
this.setData({
|
|
|
695
|
+ contactAddress_haschanged:true,
|
671
|
contactaddressInfo: contact_address
|
696
|
contactaddressInfo: contact_address
|
672
|
})
|
697
|
})
|
673
|
console.log('contactaddressInfo', this.data.contactaddressInfo)
|
698
|
console.log('contactaddressInfo', this.data.contactaddressInfo)
|
674
|
},
|
699
|
},
|
675
|
|
700
|
|
676
|
currentAddressSelect: function(e) {
|
701
|
currentAddressSelect: function(e) {
|
677
|
- // console.log('currentAddressSelect', e)
|
702
|
+ console.log('currentAddressSelect', e)
|
678
|
var current_address = this.data.currentaddressInfo;
|
703
|
var current_address = this.data.currentaddressInfo;
|
679
|
current_address.selected = e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
|
704
|
current_address.selected = e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
|
680
|
current_address.address_value = e.detail.value
|
705
|
current_address.address_value = e.detail.value
|
681
|
current_address.address_code = e.detail.code
|
706
|
current_address.address_code = e.detail.code
|
682
|
this.setData({
|
707
|
this.setData({
|
|
|
708
|
+ curAddress_haschanged:true,
|
683
|
currentaddressInfo: current_address
|
709
|
currentaddressInfo: current_address
|
684
|
})
|
710
|
})
|
685
|
},
|
711
|
},
|
|
@@ -691,6 +717,7 @@ Page({ |
|
@@ -691,6 +717,7 @@ Page({ |
691
|
birth_address.address_value = e.detail.value
|
717
|
birth_address.address_value = e.detail.value
|
692
|
birth_address.address_code = e.detail.code
|
718
|
birth_address.address_code = e.detail.code
|
693
|
this.setData({
|
719
|
this.setData({
|
|
|
720
|
+ birthAddress_haschanged: true,
|
694
|
birthaddressInfo: birth_address
|
721
|
birthaddressInfo: birth_address
|
695
|
})
|
722
|
})
|
696
|
console.log('birthaddressInfo', this.data.birthaddressInfo)
|
723
|
console.log('birthaddressInfo', this.data.birthaddressInfo)
|
|
@@ -714,7 +741,7 @@ Page({ |
|
@@ -714,7 +741,7 @@ Page({ |
714
|
var formdata = e.detail.value;
|
741
|
var formdata = e.detail.value;
|
715
|
console.log("formdata", formdata)
|
742
|
console.log("formdata", formdata)
|
716
|
console.log("card_number", this.data.card_number)
|
743
|
console.log("card_number", this.data.card_number)
|
717
|
- if (this.data.name&&this.data.name.length < 1 && formdata.name.length < 1) {
|
744
|
+ if (this.data.name && this.data.name.length < 1 && formdata.name.length < 1) {
|
718
|
this.showtoast('请输入姓名');
|
745
|
this.showtoast('请输入姓名');
|
719
|
return
|
746
|
return
|
720
|
} else if (!this.data.isself && this.data.relativeData.selected.length < 1) {
|
747
|
} else if (!this.data.isself && this.data.relativeData.selected.length < 1) {
|
|
@@ -760,6 +787,9 @@ Page({ |
|
@@ -760,6 +787,9 @@ Page({ |
760
|
var formdata = data
|
787
|
var formdata = data
|
761
|
console.log("form_data", formdata);
|
788
|
console.log("form_data", formdata);
|
762
|
var request_profession = that.getProfessionRequest()
|
789
|
var request_profession = that.getProfessionRequest()
|
|
|
790
|
+ var request_contact_address = that.getContactAddressRequest()
|
|
|
791
|
+ var request_current_address = that.getCurrentAddressRequest()
|
|
|
792
|
+ var request_birth_address = that.getBirthAddressRequest()
|
763
|
var Authorization = app.globalData.Authorization;
|
793
|
var Authorization = app.globalData.Authorization;
|
764
|
wx.request({
|
794
|
wx.request({
|
765
|
url: baseUrl + 'persontax/v1/personal-taxes/' + that.data.cur_id,
|
795
|
url: baseUrl + 'persontax/v1/personal-taxes/' + that.data.cur_id,
|
|
@@ -774,7 +804,7 @@ Page({ |
|
@@ -774,7 +804,7 @@ Page({ |
774
|
"birth_date": that.data.long_birth_date,
|
804
|
"birth_date": that.data.long_birth_date,
|
775
|
"profession": request_profession,
|
805
|
"profession": request_profession,
|
776
|
"education": that.data.degreeData.selected,
|
806
|
"education": that.data.degreeData.selected,
|
777
|
- "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '',
|
807
|
+ "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : that.data.taxInfo.taxpayer_no,
|
778
|
"taxpayer_status": that.data.personstatusData.selected,
|
808
|
"taxpayer_status": that.data.personstatusData.selected,
|
779
|
"is_martyr_family": that.data.lieshuInfo.selected,
|
809
|
"is_martyr_family": that.data.lieshuInfo.selected,
|
780
|
"martyr_family_no": formdata.martyr_family_no,
|
810
|
"martyr_family_no": formdata.martyr_family_no,
|
|
@@ -783,33 +813,12 @@ Page({ |
|
@@ -783,33 +813,12 @@ Page({ |
783
|
"is_lonely_man": that.data.lonelyolderInfo.selected,
|
813
|
"is_lonely_man": that.data.lonelyolderInfo.selected,
|
784
|
"is_overseas_personnel": "否",
|
814
|
"is_overseas_personnel": "否",
|
785
|
"comment": formdata.comment,
|
815
|
"comment": formdata.comment,
|
786
|
- "current_address": {
|
|
|
787
|
- "province_code": that.data.currentaddressInfo.address_code[0],
|
|
|
788
|
- "province": that.data.currentaddressInfo.address_value[0],
|
|
|
789
|
- "city_code": that.data.currentaddressInfo.address_code[1],
|
|
|
790
|
- "city": that.data.currentaddressInfo.address_value[1],
|
|
|
791
|
- "district_code": that.data.currentaddressInfo.address_code[2],
|
|
|
792
|
- "district": that.data.currentaddressInfo.address_value[2]
|
|
|
793
|
- },
|
|
|
794
|
- "current_address_detail": formdata.current_address_detail,
|
|
|
795
|
- "huji_address": {
|
|
|
796
|
- "province_code": that.data.birthaddressInfo.address_code[0],
|
|
|
797
|
- "province": that.data.birthaddressInfo.address_value[0],
|
|
|
798
|
- "city_code": that.data.birthaddressInfo.address_code[1],
|
|
|
799
|
- "city": that.data.birthaddressInfo.address_value[1],
|
|
|
800
|
- "district_code": that.data.birthaddressInfo.address_code[2],
|
|
|
801
|
- "district": that.data.birthaddressInfo.address_value[2]
|
|
|
802
|
- },
|
|
|
803
|
- "huji_address_detail": formdata.huji_address_detail,
|
816
|
+ "current_address": request_current_address,
|
|
|
817
|
+ "current_address_detail": formdata.current_address_detail ? formdata.current_address_detail : that.data.taxInfo.current_address_detail,
|
|
|
818
|
+ "huji_address": request_birth_address,
|
|
|
819
|
+ "huji_address_detail": formdata.huji_address_detail ? formdata.huji_address_detail : that.data.taxInfo.huji_address_detail,
|
804
|
"mobile": formdata.mobile,
|
820
|
"mobile": formdata.mobile,
|
805
|
- "contact_address": {
|
|
|
806
|
- "province_code": that.data.contactaddressInfo.address_code[0],
|
|
|
807
|
- "province": that.data.contactaddressInfo.address_value[0],
|
|
|
808
|
- "city_code": that.data.contactaddressInfo.address_code[1],
|
|
|
809
|
- "city": that.data.contactaddressInfo.address_value[1],
|
|
|
810
|
- "district_code": that.data.contactaddressInfo.address_code[2],
|
|
|
811
|
- "district": that.data.contactaddressInfo.address_value[2]
|
|
|
812
|
- },
|
821
|
+ "contact_address": request_contact_address ? request_contact_address : that.data.taxInfo.contact_address_detail,
|
813
|
"contact_address_detail": formdata.contact_address_detail,
|
822
|
"contact_address_detail": formdata.contact_address_detail,
|
814
|
"email": formdata.email,
|
823
|
"email": formdata.email,
|
815
|
"bank": that.data.bankInfo.selected,
|
824
|
"bank": that.data.bankInfo.selected,
|
|
@@ -830,7 +839,7 @@ Page({ |
|
@@ -830,7 +839,7 @@ Page({ |
830
|
},
|
839
|
},
|
831
|
success: function(res) {
|
840
|
success: function(res) {
|
832
|
console.log(res)
|
841
|
console.log(res)
|
833
|
- wx.redirectTo({
|
842
|
+ wx.reLaunch({
|
834
|
url: '../home/home',
|
843
|
url: '../home/home',
|
835
|
})
|
844
|
})
|
836
|
},
|
845
|
},
|
|
@@ -859,6 +868,54 @@ Page({ |
|
@@ -859,6 +868,54 @@ Page({ |
859
|
}
|
868
|
}
|
860
|
},
|
869
|
},
|
861
|
|
870
|
|
|
|
871
|
+ getContactAddressRequest: function() {
|
|
|
872
|
+ var that = this
|
|
|
873
|
+ if (that.data.contactAddress_haschanged) {
|
|
|
874
|
+ return {
|
|
|
875
|
+ "province_code": that.data.contactaddressInfo.address_code[0],
|
|
|
876
|
+ "province": that.data.contactaddressInfo.address_value[0],
|
|
|
877
|
+ "city_code": that.data.contactaddressInfo.address_code[1],
|
|
|
878
|
+ "city": that.data.contactaddressInfo.address_value[1],
|
|
|
879
|
+ "district_code": that.data.contactaddressInfo.address_code[2],
|
|
|
880
|
+ "district": that.data.contactaddressInfo.address_value[2]
|
|
|
881
|
+ }
|
|
|
882
|
+ } else {
|
|
|
883
|
+ return that.data.taxInfo.contact_address
|
|
|
884
|
+ }
|
|
|
885
|
+ },
|
|
|
886
|
+
|
|
|
887
|
+ getCurrentAddressRequest: function() {
|
|
|
888
|
+ var that = this
|
|
|
889
|
+ if (that.data.curAddress_haschanged) {
|
|
|
890
|
+ return {
|
|
|
891
|
+ "province_code": that.data.currentaddressInfo.address_code[0],
|
|
|
892
|
+ "province": that.data.currentaddressInfo.address_value[0],
|
|
|
893
|
+ "city_code": that.data.currentaddressInfo.address_code[1],
|
|
|
894
|
+ "city": that.data.currentaddressInfo.address_value[1],
|
|
|
895
|
+ "district_code": that.data.currentaddressInfo.address_code[2],
|
|
|
896
|
+ "district": that.data.currentaddressInfo.address_value[2]
|
|
|
897
|
+ }
|
|
|
898
|
+ } else {
|
|
|
899
|
+ return that.data.taxInfo.current_address
|
|
|
900
|
+ }
|
|
|
901
|
+ },
|
|
|
902
|
+
|
|
|
903
|
+ getBirthAddressRequest: function() {
|
|
|
904
|
+ var that = this
|
|
|
905
|
+ if (that.data.birthAddress_haschanged) {
|
|
|
906
|
+ return {
|
|
|
907
|
+ "province_code": that.data.birthaddressInfo.address_code[0],
|
|
|
908
|
+ "province": that.data.birthaddressInfo.address_value[0],
|
|
|
909
|
+ "city_code": that.data.birthaddressInfo.address_code[1],
|
|
|
910
|
+ "city": that.data.birthaddressInfo.address_value[1],
|
|
|
911
|
+ "district_code": that.data.birthaddressInfo.address_code[2],
|
|
|
912
|
+ "district": that.data.birthaddressInfo.address_value[2]
|
|
|
913
|
+ }
|
|
|
914
|
+ } else {
|
|
|
915
|
+ return that.data.taxInfo.huji_address
|
|
|
916
|
+ }
|
|
|
917
|
+ },
|
|
|
918
|
+
|
862
|
showtoast: function(str) {
|
919
|
showtoast: function(str) {
|
863
|
wx.showToast({
|
920
|
wx.showToast({
|
864
|
title: str,
|
921
|
title: str,
|