提交 d5053091236da14e416681918ee3bfc9de1a01df

作者 pangy
2 个父辈 e06a6be6 d089e441

Merge branch 'dev_py' into dev2.0

... ... @@ -146,6 +146,7 @@ App({
146 146 // baseUrl: "https://api.workai.com.cn/",
147 147 OSSUrl: "", //"https://oss.workai.com.cn/",
148 148 userInfo: null,
  149 + hostInfo:null,
149 150 hasLogin: false,
150 151 openid: null,
151 152 Authorization: null,
... ...
... ... @@ -81,16 +81,17 @@ Page({
81 81 end: '2018-01-01',
82 82 onChange: 'onPickerSelect',
83 83 },
84   - // older_relativeData: {
85   - // label: '与纳税人关系',
86   - // isrequre: true,
87   - // bindtype: 'older_relative',
88   - // selected: '',
89   - // isblack: 'true',
90   - // placeholder: '请选择与纳税人关系',
91   - // values: ["父母", "祖父母、外祖父母"],
92   - // onChange: 'onPickerSelect'
93   - // },
  84 + older_relativeData: {
  85 + label: '与纳税人关系',
  86 + isrequre: true,
  87 + // disabled: true,
  88 + bindtype: 'older_relative',
  89 + selected: "",
  90 + isblack: 'true',
  91 + placeholder: '请选择与纳税人关系',
  92 + values: ["父母", "其他"],
  93 + onChange: 'onPickerSelect'
  94 + },
94 95 taxperson_relativeData: {
95 96 label: '与纳税人的关系',
96 97 isrequre: true,
... ... @@ -127,10 +128,11 @@ Page({
127 128 commonbirthDate: {
128 129 label: '出生日期',
129 130 isrequre: true,
  131 + disabled:true,
130 132 bindtype: 'commonbirthday',
131 133 selected: '',
132 134 isblack: 'true',
133   - placeholder: '请选择出生日期',
  135 + placeholder: '出生日期',
134 136 mode: "date",
135 137 fields: "day",
136 138 start: '1970-01-01',
... ... @@ -143,7 +145,8 @@ Page({
143 145 bindtype: 'child_edu_degree',
144 146 selected: '',
145 147 isblack: 'true',
146   - values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育", "硕士研究生教育", "博士研究生教育"],
  148 + // values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育", "硕士研究生教育", "博士研究生教育"],
  149 + values: ["学前教育阶段", "义务教育", "高中阶段教育", "高等教育"],
147 150 placeholder: '请选择教育阶段',
148 151 onChange: 'onPickerSelect'
149 152 },
... ... @@ -182,7 +185,8 @@ Page({
182 185 bindtype: 'edu_level',
183 186 selected: '',
184 187 isblack: 'true',
185   - values: ["专科", "本科", "硕士研究生", "博士研究生", "其他"],
  188 + // values: ["专科", "本科", "硕士研究生", "博士研究生", "其他"],
  189 + values: ["大学专科", "大学本科", "硕士研究生", "博士研究生", "其他"],
186 190 placeholder: '请选择学历教育阶段',
187 191 onChange: 'onPickerSelect'
188 192 },
... ... @@ -235,10 +239,11 @@ Page({
235 239 olderbirthDate: {
236 240 label: '被赡养人出生日期',
237 241 isrequre: true,
  242 + disabled: true,
238 243 bindtype: 'olderbirthday',
239 244 selected: '',
240 245 isblack: 'true',
241   - placeholder: '请选择日期',
  246 + placeholder: '出生日期',
242 247 mode: "date",
243 248 fields: "day",
244 249 start: '1970-01-01',
... ... @@ -285,7 +290,7 @@ Page({
285 290 placeholder: '请选择时间',
286 291 onChange: 'onPickerSelect',
287 292 mode: "date",
288   - fields: "day",
  293 + fields: "month",
289 294 datelong: 0,
290 295 start: '1970-01-01',
291 296 // start: (new Date()).getFullYear() + '-09-01',//'1970-01-01',
... ... @@ -302,7 +307,7 @@ Page({
302 307 placeholder: '请选择时间',
303 308 onChange: 'onPickerSelect',
304 309 mode: "date",
305   - fields: "day",
  310 + fields: "month",
306 311 start: '1970-01-01',
307 312 // start: (new Date()).getFullYear() + '-07-31',//'1970-01-01',
308 313 // end: (new Date()).getFullYear() + '-07-31',
... ... @@ -658,6 +663,10 @@ Page({
658 663 switch (this.data.cur_index + '') {
659 664 case 'children_education':
660 665 var setData = {}
  666 + var commonbirthDate = this.data.commonbirthDate
  667 + commonbirthDate.selected = format.formatTime_date(data.birth_date)
  668 + commonbirthDate.datelong = data.birth_date
  669 + setData.commonbirthDate = commonbirthDate
661 670 if (data.id_card_no && data.id_card_no.length) {
662 671 setData.children_id_card_no = data.id_card_no
663 672 this.dealIdInfo(data.id_card_no, 'children_id_card_no_input')
... ... @@ -665,12 +674,6 @@ Page({
665 674 if (data.name && data.name.length) {
666 675 setData.children_name = data.name
667 676 }
668   - if (data.birth_date && data.birth_date > 0) {
669   - var commonbirthDate = this.data.commonbirthDate
670   - commonbirthDate.selected = format.formatTime_date(data.birth_date)
671   - commonbirthDate.datelong = data.birth_date
672   - setData.commonbirthDate = commonbirthDate
673   - }
674 677 if (data.percent && data.percent.length) {
675 678 var childrenpercentData = this.data.childrenpercentData
676 679 childrenpercentData.selected = data.percent
... ... @@ -770,6 +773,10 @@ Page({
770 773 break;
771 774 case 'support_duty':
772 775 var setData = {}
  776 + var olderbirthDate = this.data.olderbirthDate
  777 + olderbirthDate.selected = format.formatTime_date(data.birth_date)
  778 + olderbirthDate.datelong = data.birth_date
  779 + setData.olderbirthDate = olderbirthDate
773 780 if (data.name && data.name.length) {
774 781 setData.supported_name = data.name
775 782 }
... ... @@ -777,16 +784,14 @@ Page({
777 784 setData.id_card_no = data.id_card_no
778 785 this.dealIdInfo(data.id_card_no, 'older_id_card_no_input')
779 786 }
780   - if (data.birth_date && data.birth_date.length) {
781   - var olderbirthDate = this.data.olderbirthDate
782   - olderbirthDate.selected = format.formatTime_date(data.birth_date)
783   - olderbirthDate.datelong = data.birth_date
784   - setData.olderbirthDate = olderbirthDate
785   - }
786 787 this.setData(setData)
787 788 break;
788 789 case 'medical_fund':
789 790 var setData = {}
  791 + var commonbirthDate = this.data.commonbirthDate
  792 + commonbirthDate.selected = format.formatTime_date(data.patient_birthday)
  793 + commonbirthDate.datelong = data.patient_birthday
  794 + setData.commonbirthDate = commonbirthDate
790 795 if (data.name && data.name.length) {
791 796 setData.name = data.name
792 797 }
... ... @@ -799,12 +804,6 @@ Page({
799 804 taxperson_relativeData.selected = data.family_ties
800 805 setData.taxperson_relativeData = taxperson_relativeData
801 806 }
802   - if (data.patient_birthday && data.patient_birthday > 0) {
803   - var commonbirthDate = this.data.commonbirthDate
804   - commonbirthDate.selected = format.formatTime_date(data.patient_birthday)
805   - commonbirthDate.datelong = data.birth_date
806   - setData.commonbirthDate = commonbirthDate
807   - }
808 807 this.setData(setData)
809 808 break;
810 809 case "house_fund":
... ... @@ -960,6 +959,9 @@ Page({
960 959 children_name: id_info.name,
961 960 commonbirthDate: that.data.commonbirthDate
962 961 }
  962 + if (format.getAge(birth_day) < 3) {
  963 + this.showToast('子女年龄小于3岁,不可申报')
  964 + }
963 965 } else if (that.idcard_belong == 'spouse_id_card_no') {
964 966 that.data.loverbirthDate.selected = birth_day
965 967 that.data.loverbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000)
... ... @@ -976,6 +978,9 @@ Page({
976 978 supported_name: id_info.name,
977 979 olderbirthDate: that.data.olderbirthDate
978 980 }
  981 + if (format.getAge(birth_day) < 60) {
  982 + this.showToast('被赡养人年龄不足60岁,不可申报')
  983 + }
979 984 } else if (that.idcard_belong == 'medical_id_card_no') {
980 985 that.data.commonbirthDate.selected = birth_day
981 986 that.data.commonbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000)
... ... @@ -1053,14 +1058,18 @@ Page({
1053 1058 this.showToast('身份证格式有误')
1054 1059 return
1055 1060 }
1056   - if (!formdata.children_name || formdata.children_name.length < 1) {
1057   - this.showToast('请填写子女姓名')
  1061 + if (format.getAge(this.data.commonbirthDate.selected) < 3) {
  1062 + this.showToast('子女年龄小于3岁,不可申报')
1058 1063 return
1059 1064 }
1060   - if (this.data.commonbirthDate.selected.length < 1) {
1061   - this.showToast('请选择子女出生日期')
  1065 + if (!formdata.children_name || formdata.children_name.length < 1) {
  1066 + this.showToast('请填写子女姓名')
1062 1067 return
1063 1068 }
  1069 + // if (this.data.commonbirthDate.selected.length < 1) {
  1070 + // this.showToast('请选择子女出生日期')
  1071 + // return
  1072 + // }
1064 1073 if (this.data.childrenpercentData.selected.length < 1) {
1065 1074 this.showToast('请选择分配比例')
1066 1075 return
... ... @@ -1195,14 +1204,18 @@ Page({
1195 1204 this.showToast('被赡养人身份证格式有误')
1196 1205 return
1197 1206 }
1198   - if (this.data.olderbirthDate.selected.length < 1) {
1199   - this.showToast('请选择被赡养人出生日期')
1200   - return
1201   - }
1202   - // if (this.data.older_relativeData.selected.length < 1) {
1203   - // this.showToast('请选择与纳税人关系')
  1207 + // if (this.data.olderbirthDate.selected.length < 1) {
  1208 + // this.showToast('请选择被赡养人出生日期')
1204 1209 // return
1205 1210 // }
  1211 + if (format.getAge(this.data.olderbirthDate.selected) < 60) {
  1212 + this.showToast('被赡养人年龄不足60岁,不可申报')
  1213 + return
  1214 + }
  1215 + if (this.data.older_relativeData.selected.length < 1) {
  1216 + this.showToast('请选择与纳税人关系')
  1217 + return
  1218 + }
1206 1219 // if (!formdata.percentage || formdata.percentage.length < 1 || formdata.percentage > 100) {
1207 1220 // this.showToast('请填写合理分摊比例')
1208 1221 // return
... ... @@ -1215,7 +1228,7 @@ Page({
1215 1228 newdata.share_method = this.share_method
1216 1229 }
1217 1230 newdata.birthday = this.data.olderbirthDate.datelong
1218   - // newdata.relationship = this.data.older_relativeData.selected
  1231 + newdata.relationship = this.data.older_relativeData.selected
1219 1232 newdata.id_card_type = '1' //this.data.oldercardtypeData.selected
1220 1233 newdata.nation = "中国"
1221 1234 break;
... ... @@ -1513,26 +1526,38 @@ Page({
1513 1526 }
1514 1527 },
1515 1528 loan_input: function (e) {
1516   - console.log('-------', e.detail.value)
  1529 + var value = e.detail.value
1517 1530 switch (e.currentTarget.id) {
1518 1531 case 'loan_contract_no':
1519 1532 this.setData({
1520   - loan_contract_no: e.detail.value
  1533 + loan_contract_no: value
1521 1534 })
1522 1535 break;
1523 1536 case 'loan_months':
  1537 + if (value.length && value <= 0) {
  1538 + value = 1
  1539 + } else if (value > 240) {
  1540 + value = 240
  1541 + this.showToast('月数不得大于240')
  1542 + }
1524 1543 this.setData({
1525   - loan_months: e.detail.value
  1544 + loan_months: value
1526 1545 })
1527 1546 break;
1528 1547 case 'sec_loan_contract_no':
1529 1548 this.setData({
1530   - sec_loan_contract_no: e.detail.value
  1549 + sec_loan_contract_no: value
1531 1550 })
1532 1551 break;
1533 1552 case 'sec_loan_months':
  1553 + if (value.length && value <= 0) {
  1554 + value = 1
  1555 + }else if (value>240){
  1556 + value = 240
  1557 + this.showToast('月数不得大于240')
  1558 + }
1534 1559 this.setData({
1535   - sec_loan_months: e.detail.value
  1560 + sec_loan_months: value
1536 1561 })
1537 1562 break;
1538 1563 }
... ... @@ -1548,6 +1573,9 @@ Page({
1548 1573 data = {
1549 1574 commonbirthDate: this.data.commonbirthDate
1550 1575 }
  1576 + if (info.age<3){
  1577 + this.showToast('子女年龄小于3岁,不可申报')
  1578 + }
1551 1579 } else if (idcard_belong == 'spouse_id_card_no_input') {
1552 1580 this.data.loverbirthDate.selected = info.birthDay
1553 1581 this.data.loverbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000)
... ... @@ -1566,6 +1594,9 @@ Page({
1566 1594 data = {
1567 1595 olderbirthDate: this.data.olderbirthDate
1568 1596 }
  1597 + if (info.age < 60) {
  1598 + this.showToast('被赡养人年龄不足60岁,不可申报')
  1599 + }
1569 1600 } else if (idcard_belong == 'owner_id_card_no_input') {
1570 1601 // this.data.olderbirthDate.selected = info.birthDay
1571 1602 // this.data.olderbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000)
... ... @@ -1629,13 +1660,13 @@ Page({
1629 1660 loverbirthDate: lover_birthDate
1630 1661 })
1631 1662 break;
1632   - // case 'older_relative':
1633   - // var older_relativeData = this.data.older_relativeData
1634   - // older_relativeData.selected = older_relativeData.values[e.detail.value]
1635   - // this.setData({
1636   - // older_relativeData: older_relativeData
1637   - // })
1638   - // break;
  1663 + case 'older_relative':
  1664 + var older_relativeData = this.data.older_relativeData
  1665 + older_relativeData.selected = older_relativeData.values[e.detail.value]
  1666 + this.setData({
  1667 + older_relativeData: older_relativeData
  1668 + })
  1669 + break;
1639 1670 case 'taxperson_relative':
1640 1671 var taxperson_relativedata = this.data.taxperson_relativeData
1641 1672 taxperson_relativedata.selected = taxperson_relativedata.values[e.detail.value]
... ...
... ... @@ -145,7 +145,7 @@
145 145 </view>
146 146 <view class='divide_line_30'></view>
147 147
148   - <!-- <template is="picker_cell_normal" data="{{...older_relativeData}}" /> -->
  148 + <template is="picker_cell_normal" data="{{...older_relativeData}}" />
149 149 <!-- <view style='height:90rpx;'>
150 150 <text class='red_star_right_10'>*</text>
151 151 <text class='text_777_30 float_left'>分摊比例</text>
... ...
... ... @@ -31,7 +31,7 @@ Page({
31 31 disabled: false,
32 32 placeholder: '请选择关系',
33 33 // values: ["子","女" ,"配偶", "父母", "祖父母、外祖父母"],
34   - values: ["子", "女", "配偶", "父母"],
  34 + values: ["子", "女", "配偶", "父母","其他"],
35 35 onChange: 'onPickerSelect'
36 36 },
37 37 cardtypeData: {
... ... @@ -58,8 +58,10 @@ Page({
58 58 genderData: {
59 59 label: '性别',
60 60 bindtype: 'gender',
  61 + disabled: true,
61 62 selected: '',
62   - placeholder: '请选择性别',
  63 + // placeholder: '请选择性别',
  64 + placeholder: '性别',
63 65 values: ["男", "女"],
64 66 onChange: 'onPickerSelect'
65 67 },
... ... @@ -116,7 +118,7 @@ Page({
116 118 this.data.relativeData.selected = tax_info.family_ties
117 119 // this.data.cardtypeData.selected = tax_info.id_card_type
118 120 this.data.genderData.selected = tax_info.gender
119   - this.data.genderData.disabled = isDisable
  121 + // this.data.genderData.disabled = isDisable
120 122
121 123 this.setData({
122 124 isDisable: isDisable,
... ... @@ -287,6 +289,23 @@ Page({
287 289 this.showtoast('手机号码有误');
288 290 return
289 291 }
  292 + if (this.data.genderData.selected == '男') {
  293 + var rel = this.data.relativeData.selected
  294 + if (rel == '女'){
  295 + this.showtoast('关系和性别冲突');
  296 + return
  297 + }
  298 + }else{
  299 + var rel = this.data.relativeData.selected
  300 + if (rel == '子') {
  301 + this.showtoast('关系和性别冲突');
  302 + return
  303 + }
  304 + }
  305 + if (this.data.genderData.selected == app.globalData.hostInfo.gender) {
  306 + this.showtoast('关系和性别冲突');
  307 + return
  308 + }
290 309 this.goCommit(formdata);
291 310 },
292 311
... ...
... ... @@ -24,10 +24,10 @@
24 24 <view wx:if="{{isIdCard}}" >
25 25 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo'></image>
26 26 <!-- <text class='text_333_28 float_right'>{{card_number}}</text> -->
27   - <input class='input_wrap' placeholder='请输入或拍摄身份证' placeholder-class='text_777_30' name='id_card_no' maxlength='18' value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}' type='idcard' ></input>
  27 + <input class='input_wrap' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}' type='idcard' ></input>
28 28 </view>
29 29 <view wx:else>
30   - <input class='input_wrap' placeholder='请输入证照号码' placeholder-class='text_777_30' name='id_card_no' maxlength='18' type="idcard" value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}'></input>
  30 + <input class='input_wrap' placeholder='请输入证照号码' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type="idcard" value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}'></input>
31 31 </view>
32 32 </view>
33 33 <view class="divide_line_30"></view>
... ... @@ -35,7 +35,7 @@
35 35 <view class='item_body'>
36 36 <text class='red_star_right_10'>*</text>
37 37 <text class='text_777_30 float_left' style='line-height: 90rpx'>姓名</text>
38   - <input class='input_wrap' placeholder='请填写姓名' name='person_name' value='{{name}}' placeholder-class='text_777_30' maxlength='15' disabled='{{isDisable}}' bindinput='nameInput'></input>
  38 + <input class='input_wrap' placeholder='请填写姓名' name='person_name' value='{{name}}' placeholder-class='text_999_30' maxlength='15' disabled='{{isDisable}}' bindinput='nameInput'></input>
39 39 </view>
40 40 <view class="divide_line_30"></view>
41 41
... ... @@ -43,7 +43,7 @@
43 43 <view class="divide_line_30"></view>
44 44 <view class='item_body'>
45 45 <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>年龄</text>
46   - <input class='input_wrap' name='age' type='number' placeholder-class='text_777_30' placeholder='请输入年龄' maxlength='2' value='{{age}}' disabled='{{isDisable}}'></input>
  46 + <input class='input_wrap' name='age' type='number' placeholder-class='text_999_30' placeholder='年龄' maxlength='2' value='{{age}}' disabled='true'></input>
47 47 </view>
48 48 <view class="divide_line_30"></view>
49 49
... ...
... ... @@ -74,7 +74,8 @@ Page({
74 74 genderData: {
75 75 label: '性别',
76 76 bindtype: 'gender',
77   - placeholder: '请选择性别',
  77 + disabled: true,
  78 + placeholder: '性别',
78 79 values: ["男", "女"],
79 80 selected: '',
80 81 onChange: 'onPickerSelect'
... ... @@ -159,8 +160,9 @@ Page({
159 160 // 时间picker
160 161 birthDate: {
161 162 label: '出生年月',
  163 + disabled:true,
162 164 bindtype: 'birthday',
163   - placeholder: '请选择出生日期',
  165 + placeholder: '出生日期',
164 166 selected: '',
165 167 mode: "date",
166 168 fields: "day",
... ...
... ... @@ -112,6 +112,7 @@ Page({
112 112 text_tip: '去查看'
113 113 })
114 114 }
  115 + app.globalData.hostInfo = data.items[i]
115 116 }
116 117 datalist.push(data.items[i])
117 118 }
... ...
... ... @@ -150,6 +150,21 @@ function checkNumber(theObj) {
150 150 return false;
151 151 }
152 152
  153 +function getAge(birthdate) {
  154 + var yearBirth = birthdate.substring(0, 4);
  155 + var monthBirth = birthdate.substring(5, 7);
  156 + var dayBirth = birthdate.substring(8, 10);
  157 + //获取当前年月日并计算年龄
  158 + var myDate = new Date();
  159 + var monthNow = myDate.getMonth() + 1;
  160 + var dayNow = myDate.getDay();
  161 + var age = myDate.getFullYear() - yearBirth;
  162 + if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
  163 + age--;
  164 + }
  165 + return age;
  166 +}
  167 +
153 168 module.exports = {
154 169 formatTime: formatTime,
155 170 formatTime_date: formatTime_date,
... ... @@ -162,5 +177,6 @@ module.exports = {
162 177 curDateTime: curDateTime,
163 178 analyzeIDCard: analyzeIDCard,
164 179 checkNumber: checkNumber,
165   - isMobile: isMobile
  180 + isMobile: isMobile,
  181 + getAge: getAge
166 182 }
... ...
注册登录 后发表评论