提交 2d083df8a8b49b5aaec1a383ad959b097e5a54e8

作者 wangyu
1 个父辈 c06e3926

调整共同赡养人相关选项

@@ -16,7 +16,10 @@ Page({ @@ -16,7 +16,10 @@ Page({
16 birthday: "", 16 birthday: "",
17 datas: "", 17 datas: "",
18 cardTypeArray : ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'], 18 cardTypeArray : ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'],
  19 + countryArray:[],
  20 + countryAbleChoosed:true,
19 cardtype:"", 21 cardtype:"",
  22 + nation:"",
20 birthday_datelong: -1, 23 birthday_datelong: -1,
21 }, 24 },
22 25
@@ -42,7 +45,7 @@ Page({ @@ -42,7 +45,7 @@ Page({
42 birthday_datelong: curdata.birthday 45 birthday_datelong: curdata.birthday
43 }) 46 })
44 } 47 }
45 - 48 + this.getCountry()
46 }, 49 },
47 50
48 /** 51 /**
@@ -91,6 +94,48 @@ Page({ @@ -91,6 +94,48 @@ Page({
91 }) 94 })
92 }, 95 },
93 96
  97 + //****************获取国籍数据************/
  98 + getCountry: function () {
  99 + var that = this
  100 + wx.showLoading({
  101 + title: '',
  102 + })
  103 + var Authorization = app.globalData.Authorization;
  104 + wx.request({
  105 + url: baseUrl + 'persontax/v1/nation-list',
  106 + method: "GET",
  107 + header: {
  108 + 'content-type': 'application/json', // 默认值
  109 + "Authorization": Authorization
  110 + },
  111 + success: function (res) {
  112 + var countrys = res.data.concat()
  113 + that.data.countryArray = res.data
  114 + if (countrys.indexOf('中国') > -1) {
  115 + countrys.splice(countrys.indexOf('中国'), 1);
  116 + }
  117 + if (countrys.indexOf('中国台湾') > -1) {
  118 + countrys.splice(countrys.indexOf('中国台湾'), 1);
  119 + }
  120 + if (countrys.indexOf('香港') > -1) {
  121 + countrys.splice(countrys.indexOf('香港'), 1);
  122 + }
  123 + if (countrys.indexOf('澳门') > -1) {
  124 + countrys.splice(countrys.indexOf('澳门'), 1);
  125 + }
  126 + that.setData({
  127 + countryArray: countrys,
  128 + })
  129 + },
  130 + fail(res) {
  131 + wx.hideLoading()
  132 + },
  133 + complete() {
  134 + wx.hideLoading()
  135 + }
  136 + })
  137 + },
  138 +
94 getIdInfo: function(e) { 139 getIdInfo: function(e) {
95 wx.navigateTo({ 140 wx.navigateTo({
96 url: '../../taxperson/idinfo/idinfo' 141 url: '../../taxperson/idinfo/idinfo'
@@ -104,7 +149,11 @@ Page({ @@ -104,7 +149,11 @@ Page({
104 if (!formdata.name || formdata.name.length < 1) { 149 if (!formdata.name || formdata.name.length < 1) {
105 this.showToast("请输入姓名") 150 this.showToast("请输入姓名")
106 return; 151 return;
107 - } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) { 152 + }
  153 + if (this.data.cardtype.length<1){
  154 + this.showToast("请选择证照类型")
  155 + return;
  156 + }else if (!formdata.id_card_no || formdata.id_card_no.length < 1) {
108 this.showToast("请输入身份证号") 157 this.showToast("请输入身份证号")
109 return; 158 return;
110 } else if (!format.isIDCardNum(formdata.id_card_no)) { 159 } else if (!format.isIDCardNum(formdata.id_card_no)) {
@@ -115,6 +164,10 @@ Page({ @@ -115,6 +164,10 @@ Page({
115 this.showToast("请选择出生日期") 164 this.showToast("请选择出生日期")
116 return; 165 return;
117 } 166 }
  167 + if (this.data.nation.length < 1) {
  168 + this.showToast("请选择出生日期")
  169 + return;
  170 + }
118 this.goAdd(formdata) 171 this.goAdd(formdata)
119 }, 172 },
120 173
@@ -127,10 +180,10 @@ Page({ @@ -127,10 +180,10 @@ Page({
127 "id": that.data.supporter_id, 180 "id": that.data.supporter_id,
128 "legal_entity_id": that.data.legal_entity_id, 181 "legal_entity_id": that.data.legal_entity_id,
129 "co_supporter": formdata.name, 182 "co_supporter": formdata.name,
130 - "id_card_type": "1", 183 + "id_card_type": that.data.cardtype,
131 "id_card_no": formdata.id_card_no, 184 "id_card_no": formdata.id_card_no,
132 "birthday": that.data.birthday_datelong, 185 "birthday": that.data.birthday_datelong,
133 - "nation": "中国", 186 + "nation": that.data.nation,
134 "relation_ship": "兄、弟、姐、妹" 187 "relation_ship": "兄、弟、姐、妹"
135 }, 188 },
136 header: { 189 header: {
@@ -167,7 +220,23 @@ Page({ @@ -167,7 +220,23 @@ Page({
167 220
168 bindCardtypeChange:function(e){ 221 bindCardtypeChange:function(e){
169 console.log('bindCardtypeChange', e) 222 console.log('bindCardtypeChange', e)
170 - 223 + var card_type = this.data.cardTypeArray[e.detail.value]
  224 + var
  225 + var nation = this.data.nation
  226 + if (card_type=="居民身份证"||card_type=="中国护照"){
  227 + nation = "中国"
  228 + }
  229 + this.setData({
  230 + cardtype: card_type,
  231 + nation: nation
  232 + })
  233 + },
  234 +
  235 + bindnationChange: function (e) {
  236 + console.log('bindnationChange', e)
  237 + this.setData({
  238 + nation: this.data.countryArray[e.detail.value]
  239 + })
171 }, 240 },
172 241
173 showToast: function(data) { 242 showToast: function(data) {
@@ -182,7 +251,7 @@ Page({ @@ -182,7 +251,7 @@ Page({
182 bindinput: function(e) { 251 bindinput: function(e) {
183 console.log("bindinput", e.detail.value) 252 console.log("bindinput", e.detail.value)
184 var idCardNo = e.detail.value 253 var idCardNo = e.detail.value
185 - if (idCardNo.length == 18) { 254 + if (this.data.cardtype=='居民身份证'&&idCardNo.length == 18) {
186 if (!format.isIDCardNum(idCardNo)) { 255 if (!format.isIDCardNum(idCardNo)) {
187 wx.showToast({ 256 wx.showToast({
188 image: "../../../../images/warn.png", 257 image: "../../../../images/warn.png",
@@ -10,23 +10,26 @@ @@ -10,23 +10,26 @@
10 <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入姓名' name='name' value='{{name}}'></input> 10 <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入姓名' name='name' value='{{name}}'></input>
11 </view> 11 </view>
12 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 12 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
13 -  
14 - <picker bindchange="bindPickerChange" value="{{index}}" range="{{cardTypeArray}}">  
15 - <view style='height:90rpx;padding:0 30rpx ' bindchange="bindCardtypeChange"> 13 + <picker bindchange="bindCardtypeChange" value="{{index}}" range="{{cardTypeArray}}">
  14 + <view style='height:90rpx;padding:0 30rpx '>
16 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 15 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
17 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照类型</text> 16 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照类型</text>
18 <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> 17 <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image>
19 - <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{cardtype}}</text> 18 + <text wx:if="{{cardtype.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请输入证照类型</text>
  19 + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{cardtype}}</text>
20 </view> 20 </view>
21 </picker> 21 </picker>
22 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 22 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
23 <view style='height:90rpx;padding:0 30rpx'> 23 <view style='height:90rpx;padding:0 30rpx'>
24 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 24 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
25 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照号码</text> 25 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照号码</text>
26 - <view> 26 + <view wx:if="{{cardtype=='居民身份证'}}">
27 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no"></image> 27 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no"></image>
28 <input class='input_wrap01 float_right' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type='idcard' value='{{id_card_no}}' bindinput="bindinput"></input> 28 <input class='input_wrap01 float_right' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type='idcard' value='{{id_card_no}}' bindinput="bindinput"></input>
29 </view> 29 </view>
  30 + <view wx:else>
  31 + <input class='input_wrap01 float_right' placeholder='请输入证件号码' placeholder-class='text_999_30' name='id_card_no' maxlength='24' value='{{id_card_no}}' bindinput="bindinput"></input>
  32 + </view>
30 </view> 33 </view>
31 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 34 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
32 <picker mode="date" value="{{date}}" start="1919-01-01" end="2017-09-01" bindchange="bindDateChange"> 35 <picker mode="date" value="{{date}}" start="1919-01-01" end="2017-09-01" bindchange="bindDateChange">
@@ -34,16 +37,26 @@ @@ -34,16 +37,26 @@
34 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 37 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
35 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人出生日期</text> 38 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人出生日期</text>
36 <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> 39 <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image>
37 - <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{birthday}}</text> 40 + <text wx:if="{{birthday.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请输入出生日期</text>
  41 + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{birthday}}</text>
38 </view> 42 </view>
39 </picker> 43 </picker>
40 <!-- <template is="picker_cell_normal" data="{{...commonbirthDate}}" /> --> 44 <!-- <template is="picker_cell_normal" data="{{...commonbirthDate}}" /> -->
41 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 45 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
42 - <view style='height:90rpx;padding:0 30rpx'> 46 + <!-- <view style='height:90rpx;padding:0 30rpx'>
43 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 47 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
44 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>被赡养人国籍</text> 48 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>被赡养人国籍</text>
45 <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>中国</text> 49 <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>中国</text>
  50 + </view> -->
  51 + <picker bindchange="bindnationChange" value="{{index}}" range="{{countryArray}}">
  52 + <view style='height:90rpx;padding:0 30rpx '>
  53 + <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
  54 + <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>被赡养人国籍</text>
  55 + <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image>
  56 + <text wx:if="{{nation.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请选择国籍</text>
  57 + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{nation}}</text>
46 </view> 58 </view>
  59 + </picker>
47 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 60 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
48 <view style='height:90rpx;padding:0 30rpx'> 61 <view style='height:90rpx;padding:0 30rpx'>
49 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 62 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
@@ -231,7 +231,7 @@ @@ -231,7 +231,7 @@
231 </view> 231 </view>
232 <view style='height:70rpx'> 232 <view style='height:70rpx'>
233 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照类型:</text> 233 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照类型:</text>
234 - <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.id_card_type=='1'?"居民身份证":itemdetail.id_card_type}}</text> 234 + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.id_card_type}}</text>
235 </view> 235 </view>
236 <view style='height:70rpx'> 236 <view style='height:70rpx'>
237 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照号码:</text> 237 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照号码:</text>
注册登录 后发表评论