提交 896f9d15dbc56666e4f57112d4736cb608e30490
1 个父辈
394b980b
Merge branch '机器人' into 海峡
# Conflicts: # pages/main/advancepayment/adPayHome.js
正在显示
3 个修改的文件
包含
111 行增加
和
50 行删除
... | ... | @@ -37,9 +37,13 @@ Page({ |
37 | 37 | }, |
38 | 38 | data: { 'declare_month': timestamp }, |
39 | 39 | success: function (result) { |
40 | - that.setData({ | |
41 | - taxDatas: that.handleTaxData(result.data.items) | |
42 | - }) | |
40 | + let taxDatas = that.handleTaxData(result.data.items) | |
41 | + if (taxDatas) { | |
42 | + that.setData({ | |
43 | + taxDatas: taxDatas | |
44 | + }) | |
45 | + } | |
46 | + | |
43 | 47 | |
44 | 48 | }, |
45 | 49 | fail: function (res) { |
... | ... | @@ -83,6 +87,7 @@ Page({ |
83 | 87 | |
84 | 88 | }, |
85 | 89 | handleTaxData: function (items) { |
90 | + if (!items) return | |
86 | 91 | for (var i = 0; i < items.length; ++i) { |
87 | 92 | var item = items[i] |
88 | 93 | var method |
... | ... | @@ -189,8 +194,9 @@ Page({ |
189 | 194 | |
190 | 195 | handleDetailsData: function (data) { |
191 | 196 | |
192 | - var titles = JSON.parse(data['slip_titles']) | |
193 | - var detail = JSON.parse(data['detail']) | |
197 | + let titles = JSON.parse(data['slip_titles']) | |
198 | + let detail = JSON.parse(data['detail']) | |
199 | + let mapping_keys = data["mapping_keys"] ? data["mapping_keys"]:[] | |
194 | 200 | var details = [] |
195 | 201 | for (var i = 0; i < titles.length; ++i) { |
196 | 202 | var titleData = titles[i] |
... | ... | @@ -200,9 +206,13 @@ Page({ |
200 | 206 | title = titleData['original_column'] |
201 | 207 | } |
202 | 208 | if (!value) { |
203 | - value = data[titleData['key']] + ('tax_rate' == titleData['key'] ? '%' : '') | |
209 | + value = data[titleData['key']] | |
210 | + if (value != undefined) { | |
211 | + value += 'tax_rate' == titleData['key'] ? '%' : '' | |
212 | + } | |
204 | 213 | } |
205 | - if (!title || value == '0') continue; | |
214 | + if (!title || !value) continue; | |
215 | + if (mapping_keys.indexOf(title) == -1 && value == '0') continue; | |
206 | 216 | details.push({ |
207 | 217 | title: title, |
208 | 218 | value: value | ... | ... |
... | ... | @@ -3,9 +3,10 @@ var app = getApp(); |
3 | 3 | var baseUrl = app.globalData.baseUrl; |
4 | 4 | const reg_18_Number = /^[0-9]{18}$/; |
5 | 5 | const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; |
6 | +const reg_15_n_a = /^([a-zA-z]|[0-9]){15}$/; | |
6 | 7 | // var countryInfo = require('../../../../utils/country.js'); |
7 | -// const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | |
8 | -const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | |
8 | +const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | |
9 | +// const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | |
9 | 10 | // const cardTypeDicts = [{ 'code': '1', 'name': '居民身份证' }, { 'code': '2', 'name': '中国护照' }, { 'code': '3', 'name': '港澳居民来往内地通行证' }, { 'code': '4', 'name': '港澳居民居住证' }, { 'code': '5', 'name': '台湾居民来往大陆通行证' }, { 'code': '6', 'name': '台湾居民居住证' }, { 'code': '7', 'name': '外国护照' }, { 'code': '8', 'name': '外国人永久居留身份证' }, { 'code': '9', 'name': '外国人工作许可证(A类)' }, { 'code': '10', 'name': '外国人工作许可证(B类)' }, { 'code': '11', 'name': '外国人工作许可证(C类)'}]; |
10 | 11 | // const cardTypes8 = [{ 'code': '1', 'name': '居民身份证' }, { 'code': '2', 'name': '中国护照' }, { 'code': '4', 'name': '港澳居民居住证' }, { 'code': '6', 'name': '台湾居民居住证' }, { 'code': '8', 'name': '外国人永久居留身份证' }, { 'code': '9', 'name': '外国人工作许可证(A类)' }, { 'code': '10', 'name': '外国人工作许可证(B类)' }, { 'code': '11', 'name': '外国人工作许可证(C类)' }]; |
11 | 12 | |
... | ... | @@ -57,7 +58,7 @@ Page({ |
57 | 58 | bindtype: 'cardtype', |
58 | 59 | placeholder: '请选择证照类型', |
59 | 60 | selected: '', |
60 | - values: cardTypeArray8, | |
61 | + values: cardTypeArray, | |
61 | 62 | // range_key:'name', |
62 | 63 | // values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照', |
63 | 64 | // '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证' |
... | ... | @@ -65,7 +66,7 @@ Page({ |
65 | 66 | onChange: 'onPickerSelect' |
66 | 67 | }, |
67 | 68 | otherCardtypeData: { |
68 | - isrequre: true, | |
69 | + // isrequre: true, | |
69 | 70 | label: '其他证照类型', |
70 | 71 | bindtype: 'other_cardtype', |
71 | 72 | placeholder: '请选择证照类型', |
... | ... | @@ -90,6 +91,14 @@ Page({ |
90 | 91 | placeholder: '请选择出生国家(地区)', |
91 | 92 | onChange: 'onPickerSelect', |
92 | 93 | }, |
94 | + // taxReasonData: { | |
95 | + // isrequre: true, | |
96 | + // label: '涉税事由', | |
97 | + // bindtype: 'tax_reason', | |
98 | + // placeholder: '请选择涉税事由', | |
99 | + // values: ["任职受雇","提供临时劳务","转让财产","从事投资和经营活动","其他"], | |
100 | + // onChange: 'onPickerSelect', | |
101 | + // }, | |
93 | 102 | taxpayerTypeData: { |
94 | 103 | isrequre: true, |
95 | 104 | label: '纳税人类型', |
... | ... | @@ -444,7 +453,7 @@ Page({ |
444 | 453 | this.data.predictLeaveDate.selected = (predictLeaveDate.indexOf("01-01-01") == -1) ? predictLeaveDate : '' |
445 | 454 | this.data.predictLeaveDate.datelong = tax_info.predict_leave_date |
446 | 455 | // this.data.professionData.selected = tax_info.profession.three_level_name |
447 | - | |
456 | + // this.data.taxReasonData.selected = tax_info.tax_reason | |
448 | 457 | this.data.birthDate.end = curdate |
449 | 458 | this.data.startDate.end = curdate |
450 | 459 | this.data.endDate.end = curdate |
... | ... | @@ -491,6 +500,7 @@ Page({ |
491 | 500 | long_end_date: tax_info.separate_date ? tax_info.separate_date : 0, |
492 | 501 | endDate: this.data.endDate, |
493 | 502 | firstEntryDate: this.data.firstEntryDate, |
503 | + // taxReasonData: this.data.taxReasonData, | |
494 | 504 | predictLeaveDate: this.data.predictLeaveDate, |
495 | 505 | isIdCard: '居民身份证' == tax_info.id_card_type ? true : false, |
496 | 506 | card_number: this.data.card_number, |
... | ... | @@ -724,6 +734,7 @@ Page({ |
724 | 734 | // const new_type = cardTypeDicts[parseInt(new_type_code)-1]['name'] |
725 | 735 | // this.data.cardtypeData.selected_code = new_type_code |
726 | 736 | this.data.cardtypeData.selected = new_type |
737 | + this.data.otherCardtypeData.selected = '' | |
727 | 738 | this.data.nameText = '' |
728 | 739 | if ('居民身份证' == new_type) { |
729 | 740 | is_idcard = true |
... | ... | @@ -750,34 +761,41 @@ Page({ |
750 | 761 | this.data.countryData.selected = '' |
751 | 762 | this.data.countryData.disabled = false |
752 | 763 | this.data.nameText = '英文名' |
753 | - // if (new_type.indexOf('通行证') != -1){ | |
754 | - // this.data.otherCardtypeData.values = [{ 'code': '4', 'name': '港澳居民居住证'}]; | |
755 | - // }else{ | |
756 | - this.data.otherCardtypeData.values = ['港澳居民来往内地通行证'];// [{ 'code': '3', 'name': '港澳居民来往内地通行证'}]; | |
757 | - this.data.otherCardtypeData.selected = '港澳居民来往内地通行证'; | |
758 | - // } | |
764 | + if (new_type.indexOf('通行证') != -1){ | |
765 | + this.data.otherCardtypeData.values = ['港澳居民居住证'];// [{ 'code': '4', 'name': '港澳居民居住证'}]; | |
766 | + this.data.otherCardtypeData.isrequre = false | |
767 | + }else{ | |
768 | + this.data.otherCardtypeData.values = ['港澳居民来往内地通行证'];// [{ 'code': '3', 'name': '港澳居民来往内地通行证'}]; | |
769 | + this.data.otherCardtypeData.selected = '港澳居民来往内地通行证'; | |
770 | + this.data.otherCardtypeData.isrequre = true | |
771 | + } | |
759 | 772 | } else if (new_type.indexOf("台湾") != -1) { |
760 | 773 | this.data.countryData.selected = '中国台湾' |
761 | 774 | this.data.countryData.disabled = true |
762 | 775 | this.data.nameText = '英文名' |
763 | - // if (new_type.indexOf('通行证') != -1) { | |
764 | - // this.data.otherCardtypeData.values = [{ 'code': '6', 'name': '台湾居民居住证' }]; | |
765 | - // } else { | |
766 | - this.data.otherCardtypeData.values = ['台湾居民来往大陆通行证']; //[{ 'code': '5', 'name': '台湾居民来往大陆通行证' }]; | |
767 | - this.data.otherCardtypeData.selected = '台湾居民来往大陆通行证'; | |
768 | - // } | |
776 | + if (new_type.indexOf('通行证') != -1) { | |
777 | + this.data.otherCardtypeData.values = ['台湾居民居住证'];//[{ 'code': '6', 'name': '台湾居民居住证' }]; | |
778 | + this.data.otherCardtypeData.isrequre = false | |
779 | + } else { | |
780 | + this.data.otherCardtypeData.values = ['台湾居民来往大陆通行证']; //[{ 'code': '5', 'name': '台湾居民来往大陆通行证' }]; | |
781 | + this.data.otherCardtypeData.selected = '台湾居民来往大陆通行证'; | |
782 | + this.data.otherCardtypeData.isrequre = true | |
783 | + } | |
769 | 784 | |
770 | 785 | } else { |
771 | 786 | this.data.countryData.selected = '' |
772 | 787 | this.data.countryData.values = this.countrys ? this.countrys : [] |
773 | 788 | this.data.countryData.disabled = false |
774 | 789 | this.data.nameText = '中文名' |
775 | - // if (new_type.indexOf("外国护照") != -1) { | |
790 | + if (new_type.indexOf("外国护照") != -1) { | |
776 | 791 | // this.data.otherCardtypeData.values = [{ 'code': '8', 'name': '外国人永久居留身份证' }, { 'code': '9', 'name': '外国人工作许可证(A类)' }, { 'code': '10', 'name': '外国人工作许可证(B类)' }, { 'code': '11', 'name': '外国人工作许可证(C类)' }]; |
777 | - // } else { | |
778 | - this.data.otherCardtypeData.values = ['外国护照']; //[{ 'code': '7', 'name': '外国护照' }]; | |
779 | - this.data.otherCardtypeData.selected = '外国护照'; | |
780 | - // } | |
792 | + this.data.otherCardtypeData.values = ['外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)','外国人工作许可证(C类)']; | |
793 | + this.data.otherCardtypeData.isrequre = false | |
794 | + } else { | |
795 | + this.data.otherCardtypeData.values = ['外国护照']; //[{ 'code': '7', 'name': '外国护照' }]; | |
796 | + this.data.otherCardtypeData.selected = '外国护照'; | |
797 | + this.data.otherCardtypeData.isrequre = true | |
798 | + } | |
781 | 799 | } |
782 | 800 | this.setData({ |
783 | 801 | isIdCard: is_idcard, |
... | ... | @@ -817,8 +835,6 @@ Page({ |
817 | 835 | if ((new_type.indexOf('外国人') != -1) && (selected.indexOf('外国人') != -1)) { |
818 | 836 | console.log('外国人', new_type, selected) |
819 | 837 | }else { |
820 | - // this.data.otherCardtypeData.selected = '' | |
821 | - // setData.otherCardtypeData = this.data.otherCardtypeData | |
822 | 838 | setData.other_card_number = '' |
823 | 839 | } |
824 | 840 | this.setData(setData) |
... | ... | @@ -858,6 +874,16 @@ Page({ |
858 | 874 | }) |
859 | 875 | } |
860 | 876 | break; |
877 | + // case 'tax_reason': | |
878 | + // var taxReasonData = this.data.taxReasonData | |
879 | + // var reason = taxReasonData.values[e.detail.value] | |
880 | + // if (reason != taxReasonData.selected) { | |
881 | + // taxReasonData.selected = reason | |
882 | + // this.setData({ | |
883 | + // taxReasonData: taxReasonData | |
884 | + // }) | |
885 | + // } | |
886 | + // break; | |
861 | 887 | case 'taxpayerType': |
862 | 888 | var taxpayerTypeData = this.data.taxpayerTypeData |
863 | 889 | taxpayerTypeData.selected = taxpayerTypeData.values[e.detail.value] |
... | ... | @@ -1095,7 +1121,10 @@ Page({ |
1095 | 1121 | this.showtoast('证照号码有误'); |
1096 | 1122 | return |
1097 | 1123 | } |
1098 | - | |
1124 | + if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(idCardNo)) { | |
1125 | + this.showtoast('证照号码有误'); | |
1126 | + return | |
1127 | + } | |
1099 | 1128 | }, |
1100 | 1129 | bindinputcardnum: function(e) { |
1101 | 1130 | var idCardNo = e.detail.value |
... | ... | @@ -1122,6 +1151,12 @@ Page({ |
1122 | 1151 | return |
1123 | 1152 | } |
1124 | 1153 | } |
1154 | + if (e.detail.value.length == 15) { | |
1155 | + if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(idCardNo)) { | |
1156 | + this.showtoast('证照号码有误'); | |
1157 | + return | |
1158 | + } | |
1159 | + } | |
1125 | 1160 | }, |
1126 | 1161 | //根据身份证号码,获取相关信息 |
1127 | 1162 | dealIdInfo: function (idCardNum) { |
... | ... | @@ -1181,6 +1216,9 @@ Page({ |
1181 | 1216 | } else if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(this.data.card_number)) { |
1182 | 1217 | this.showtoast('证照号码有误'); |
1183 | 1218 | return |
1219 | + } else if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(this.data.card_number)) { | |
1220 | + this.showtoast('证照号码有误'); | |
1221 | + return | |
1184 | 1222 | } else if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(this.data.card_number)) { |
1185 | 1223 | this.showtoast('证照号码有误'); |
1186 | 1224 | return |
... | ... | @@ -1216,20 +1254,28 @@ Page({ |
1216 | 1254 | this.showtoast('请选择预计离境时间'); |
1217 | 1255 | return |
1218 | 1256 | } |
1219 | - if (this.data.hasOtherCard && !this.data.otherCardtypeData.selected) { | |
1257 | + // if (this.data.hasOtherCard && !this.data.taxReasonData.selected) { | |
1258 | + // this.showtoast('请选择涉税事由'); | |
1259 | + // return | |
1260 | + // } | |
1261 | + let otherTypeSel = this.data.otherCardtypeData.selected | |
1262 | + let otherHasInput = formdata.other_card_number && formdata.other_card_number.length | |
1263 | + | |
1264 | + if (this.data.hasOtherCard && !otherTypeSel && this.data.otherCardtypeData.isrequre) { | |
1220 | 1265 | this.showtoast('请选择其他证照类型'); |
1221 | 1266 | return |
1222 | 1267 | } |
1223 | - if (this.data.hasOtherCard && !formdata.other_card_number.length) { | |
1268 | + if (this.data.hasOtherCard && !otherHasInput && this.data.otherCardtypeData.isrequre) { | |
1224 | 1269 | this.showtoast('请输入其他证照号码'); |
1225 | 1270 | return |
1226 | - } else if (this.data.otherCardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.other_card_number)) { | |
1271 | + } | |
1272 | + if (otherTypeSel.indexOf('居住证') > -1 && otherHasInput && !reg_18_Number.test(formdata.other_card_number)) { | |
1227 | 1273 | this.showtoast('其他证照号码有误'); |
1228 | 1274 | return |
1229 | - } else if (this.data.otherCardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.other_card_number)) { | |
1275 | + }else if (otherTypeSel.indexOf('永久居留') > -1 && otherHasInput && !reg_15_n_a.test(formdata.other_card_number)) { | |
1230 | 1276 | this.showtoast('其他证照号码有误'); |
1231 | 1277 | return |
1232 | - } | |
1278 | + } | |
1233 | 1279 | if (this.data.hasOtherCard && !this.data.birthCountryData.selected) { |
1234 | 1280 | this.showtoast('请选择出生国家'); |
1235 | 1281 | return |
... | ... | @@ -1376,11 +1422,12 @@ Page({ |
1376 | 1422 | "id_card_type": that.data.cardtypeData.selected, //selected_code, |
1377 | 1423 | "id_card_no": that.data.card_number, |
1378 | 1424 | "other_id_card_type": that.data.hasOtherCard ? that.data.otherCardtypeData.selected : '', //selected_code, |
1379 | - "other_id_card_no": that.data.hasOtherCard ? formdata.other_card_number : '', | |
1425 | + "other_id_card_no": that.data.hasOtherCard ? (formdata.other_card_number ? formdata.other_card_number : '') : '', | |
1380 | 1426 | "gender": that.data.genderData.selected, |
1381 | 1427 | "birth_date": that.data.long_birth_date, |
1382 | 1428 | "first_entry_date": that.data.hasOtherCard ? that.data.firstEntryDate.datelong : null, |
1383 | 1429 | "predict_leave_date": that.data.hasOtherCard ? that.data.predictLeaveDate.datelong : null, |
1430 | + // "tax_reason": that.data.hasOtherCard ? that.data.taxReasonData.selected : null, | |
1384 | 1431 | "mobile": that.data.mobile, |
1385 | 1432 | "current_address": request_current_address, |
1386 | 1433 | "current_address_detail": formdata.current_address_detail, | ... | ... |
... | ... | @@ -73,20 +73,24 @@ |
73 | 73 | <view class="divide_line_30"></view> |
74 | 74 | <template is="picker_cell_normal" data="{{...predictLeaveDate}}" /> |
75 | 75 | <view class="divide_line_30"></view> |
76 | - <template is="picker_cell_normal" data="{{...otherCardtypeData}}" /> | |
77 | - <view class="divide_line_30"></view> | |
78 | - <view class='item_body'> | |
79 | - <text class='red_star_right_10'>*</text> | |
80 | - <text class='text_777_30 float_left' style='line-height: 90rpx'>其他证照号码</text> | |
81 | - <view> | |
82 | - <input class='input_wrap' placeholder="请输入证照号码" value="{{other_card_number}}" name='other_card_number' maxlength='20'></input> | |
83 | - </view> | |
84 | - </view> | |
85 | - <view class="divide_line_30"></view> | |
86 | 76 | <template is="picker_cell_normal" data="{{...birthCountryData}}" /> |
77 | + <!-- <view class="divide_line_30"></view> | |
78 | + <template is="picker_cell_normal" data="{{...taxReasonData}}" /> --> | |
87 | 79 | </view> |
88 | - <view hidden='{{!isshow01}}'> | |
89 | - <view wx:if='{{hasOtherCard}}'> | |
80 | + <view wx:if='{{hasOtherCard}}'> | |
81 | + <view wx:if='{{isshow01 || otherCardtypeData.isrequre}}'> | |
82 | + <view class="divide_line_30"></view> | |
83 | + <template is="picker_cell_normal" data="{{...otherCardtypeData}}" /> | |
84 | + <view class="divide_line_30"></view> | |
85 | + <view class='item_body'> | |
86 | + <text wx:if='{{otherCardtypeData.isrequre}}' class='red_star_right_10'>*</text> | |
87 | + <text class="text_777_30 float_left {{otherCardtypeData.isrequre?'':'head_in'}}"style='line-height: 90rpx'>其他证照号码</text> | |
88 | + <view> | |
89 | + <input class='input_wrap' placeholder="请输入证照号码" value="{{other_card_number}}" name='other_card_number' maxlength='20'></input> | |
90 | + </view> | |
91 | + </view> | |
92 | + </view> | |
93 | + <view wx:if='{{isshow01}}'> | |
90 | 94 | <view class="divide_line_30"></view> |
91 | 95 | <view class='item_body'> |
92 | 96 | <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>{{nameText}}</text> | ... | ... |
请
注册
或
登录
后发表评论