1
|
1
|
// pages/main/addtionalreduce/addextrainfo/addextrainfo.js
|
2
|
2
|
var format = require('../../../../utils/util.js');
|
3
|
|
-var countryInfo = require('../../../../utils/country.js');
|
|
3
|
+// var countryInfo = require('../../../../utils/country.js');
|
4
|
4
|
var OSSInit;
|
5
|
5
|
var app = getApp();
|
6
|
6
|
var baseUrl = app.globalData.baseUrl;
|
...
|
...
|
@@ -384,7 +384,7 @@ Page({ |
384
|
384
|
selected: '',
|
385
|
385
|
isrequre: true,
|
386
|
386
|
isblack: 'true',
|
387
|
|
- values: ["企业", "个人"],
|
|
387
|
+ values: ["组织", "个人"],
|
388
|
388
|
placeholder: '请选择出租方类型',
|
389
|
389
|
onChange: 'onPickerSelect'
|
390
|
390
|
},
|
...
|
...
|
@@ -557,10 +557,14 @@ Page({ |
557
|
557
|
// deduction_amount = Deduce_amounts_year[nameKey] ? Deduce_amounts_year[nameKey] : 0
|
558
|
558
|
}
|
559
|
559
|
if ("children_education" == options.status) {
|
560
|
|
- this.loadCountry()
|
|
560
|
+ this.getCountry()
|
561
|
561
|
if (options.isedit != 'true'){
|
562
|
562
|
this.getTaxList()
|
563
|
563
|
}
|
|
564
|
+ this.data.taxperson_relativeData.values = ['子','女']
|
|
565
|
+ this.setData({
|
|
566
|
+ taxperson_relativeData: this.data.taxperson_relativeData
|
|
567
|
+ })
|
564
|
568
|
} else if ("continuing_education" == options.status) {
|
565
|
569
|
this.getCertificates()
|
566
|
570
|
var studystart_date = this.data.studystartdate
|
...
|
...
|
@@ -722,16 +726,56 @@ Page({ |
722
|
726
|
}
|
723
|
727
|
})
|
724
|
728
|
},
|
725
|
|
- loadCountry: function() {
|
726
|
|
- countryInfo.init(this)
|
727
|
|
- var countrylist = this.data.country
|
728
|
|
- var country_data = this.data.schoolCountryData
|
729
|
|
- for (var i = 0; i < countrylist.length; i++) {
|
730
|
|
- country_data.values.push(countrylist[i].name)
|
731
|
|
- }
|
732
|
|
- console.log("countrydata", country_data)
|
733
|
|
- this.setData({
|
734
|
|
- schoolCountryData: country_data
|
|
729
|
+ // loadCountry: function() {
|
|
730
|
+ // countryInfo.init(this)
|
|
731
|
+ // var countrylist = this.data.country
|
|
732
|
+ // var country_data = this.data.schoolCountryData
|
|
733
|
+ // for (var i = 0; i < countrylist.length; i++) {
|
|
734
|
+ // country_data.values.push(countrylist[i].name)
|
|
735
|
+ // }
|
|
736
|
+ // console.log("countrydata", country_data)
|
|
737
|
+ // this.setData({
|
|
738
|
+ // schoolCountryData: country_data
|
|
739
|
+ // })
|
|
740
|
+ // },
|
|
741
|
+
|
|
742
|
+ //****************获取国籍数据************/
|
|
743
|
+ getCountry: function () {
|
|
744
|
+ var that = this
|
|
745
|
+ wx.showLoading()
|
|
746
|
+ var Authorization = app.globalData.Authorization;
|
|
747
|
+ wx.request({
|
|
748
|
+ url: baseUrl + 'persontax/v1/nation-list',
|
|
749
|
+ method: "GET",
|
|
750
|
+ header: {
|
|
751
|
+ 'content-type': 'application/json', // 默认值
|
|
752
|
+ "Authorization": Authorization
|
|
753
|
+ },
|
|
754
|
+ success: function (res) {
|
|
755
|
+ var countrys = res.data.concat()
|
|
756
|
+ if (countrys.indexOf('中国') > -1) {
|
|
757
|
+ countrys.splice(countrys.indexOf('中国'), 1);
|
|
758
|
+ }
|
|
759
|
+ if (countrys.indexOf('中国台湾') > -1) {
|
|
760
|
+ countrys.splice(countrys.indexOf('中国台湾'), 1);
|
|
761
|
+ }
|
|
762
|
+ if (countrys.indexOf('香港') > -1) {
|
|
763
|
+ countrys.splice(countrys.indexOf('香港'), 1);
|
|
764
|
+ }
|
|
765
|
+ if (countrys.indexOf('澳门') > -1) {
|
|
766
|
+ countrys.splice(countrys.indexOf('澳门'), 1);
|
|
767
|
+ }
|
|
768
|
+ // that.data.countryData.values = countrys
|
|
769
|
+ that.data.schoolCountryData.values = res.data
|
|
770
|
+ that.countrys = countrys
|
|
771
|
+ that.setData({
|
|
772
|
+ // countryData: that.data.countryData,
|
|
773
|
+ schoolCountryData: that.data.schoolCountryData
|
|
774
|
+ })
|
|
775
|
+ },
|
|
776
|
+ complete() {
|
|
777
|
+ wx.hideLoading()
|
|
778
|
+ }
|
735
|
779
|
})
|
736
|
780
|
},
|
737
|
781
|
handlEditData: function (data) {
|
...
|
...
|
@@ -741,6 +785,10 @@ Page({ |
741
|
785
|
switch (this.data.cur_index + '') {
|
742
|
786
|
case 'children_education':
|
743
|
787
|
var setData = {}
|
|
788
|
+ if (data.relationship && data.relationship.length) {
|
|
789
|
+ this.data.taxperson_relativeData.selected = data.relationship
|
|
790
|
+ setData.taxperson_relativeData = this.data.taxperson_relativeData
|
|
791
|
+ }
|
744
|
792
|
var commonbirthDate = this.data.commonbirthDate
|
745
|
793
|
commonbirthDate.selected = format.formatTime_date(data.birth_date)
|
746
|
794
|
commonbirthDate.datelong = data.birth_date
|
...
|
...
|
@@ -753,9 +801,11 @@ Page({ |
753
|
801
|
studystartdate.datelong = data.education_start
|
754
|
802
|
setData.studystartdate = studystartdate
|
755
|
803
|
var studyEndDate = this.data.studyEndDate
|
756
|
|
- studyEndDate.selected = format.formatTime_month(data.education_end)
|
757
|
|
- studyEndDate.datelong = data.education_end
|
758
|
|
- setData.studyEndDate = studyEndDate
|
|
804
|
+ if (data.education_end > 0) {
|
|
805
|
+ studyEndDate.selected = format.formatTime_month(data.education_end)
|
|
806
|
+ studyEndDate.datelong = data.education_end
|
|
807
|
+ setData.studyEndDate = studyEndDate
|
|
808
|
+ }
|
759
|
809
|
var studyPeriodDate = this.data.studyPeriodDate
|
760
|
810
|
if (data.education_period_end > 0){
|
761
|
811
|
studyPeriodDate.selected = format.formatTime_month(data.education_period_end)
|
...
|
...
|
@@ -937,7 +987,7 @@ Page({ |
937
|
987
|
})
|
938
|
988
|
var leasetype_Data = this.data.leasetypeData
|
939
|
989
|
leasetype_Data.selected = data.owner_type
|
940
|
|
- this.data.cardtypeData.hidden = data.owner_type == "企业"
|
|
990
|
+ this.data.cardtypeData.hidden = data.owner_type == "组织"
|
941
|
991
|
setData.leasetypeData = leasetype_Data,
|
942
|
992
|
setData.cardtypeData = this.data.cardtypeData
|
943
|
993
|
setData.owner_name = data.owner_name
|
...
|
...
|
@@ -1057,6 +1107,11 @@ Page({ |
1057
|
1107
|
if (data.name && data.name.length) {
|
1058
|
1108
|
setData.children_name = data.name
|
1059
|
1109
|
}
|
|
1110
|
+ if (data.family_ties && data.family_ties.length) {
|
|
1111
|
+ var taxperson_relativeData = this.data.taxperson_relativeData
|
|
1112
|
+ taxperson_relativeData.selected = data.family_ties
|
|
1113
|
+ setData.taxperson_relativeData = taxperson_relativeData
|
|
1114
|
+ }
|
1060
|
1115
|
this.setData(setData)
|
1061
|
1116
|
break;
|
1062
|
1117
|
case 'support_duty':
|
...
|
...
|
@@ -1327,6 +1382,11 @@ Page({ |
1327
|
1382
|
// this.showToast('请选择子女出生日期')
|
1328
|
1383
|
// return
|
1329
|
1384
|
// }
|
|
1385
|
+
|
|
1386
|
+ if (this.data.taxperson_relativeData.selected.length < 1) {
|
|
1387
|
+ this.showToast('请选择与纳税人关系')
|
|
1388
|
+ return
|
|
1389
|
+ }
|
1330
|
1390
|
if (this.data.childrenpercentData.selected.length < 1) {
|
1331
|
1391
|
this.showToast('请选择分配比例')
|
1332
|
1392
|
return
|
...
|
...
|
@@ -1654,7 +1714,7 @@ Page({ |
1654
|
1714
|
this.showToast('请填写出租方名称')
|
1655
|
1715
|
return
|
1656
|
1716
|
}
|
1657
|
|
- if (this.data.leasetypeData.selected=='企业'){
|
|
1717
|
+ if (this.data.leasetypeData.selected =='组织'){
|
1658
|
1718
|
if (!formdata.owner_credit_no || formdata.owner_credit_no.length < 1) {
|
1659
|
1719
|
this.showToast('请填写统一社会信用代码')
|
1660
|
1720
|
return
|
...
|
...
|
@@ -2276,7 +2336,7 @@ Page({ |
2276
|
2336
|
case 'lease_type':
|
2277
|
2337
|
var leasetype_Data = this.data.leasetypeData
|
2278
|
2338
|
leasetype_Data.selected = leasetype_Data.values[e.detail.value]
|
2279
|
|
- this.data.cardtypeData.hidden = leasetype_Data.selected == "企业"
|
|
2339
|
+ this.data.cardtypeData.hidden = leasetype_Data.selected == "组织"
|
2280
|
2340
|
this.setData({
|
2281
|
2341
|
leasetypeData: leasetype_Data,
|
2282
|
2342
|
cardtypeData: this.data.cardtypeData
|
...
|
...
|
|