正在显示
1 个修改的文件
包含
40 行增加
和
0 行删除
| @@ -536,6 +536,7 @@ Page({ | @@ -536,6 +536,7 @@ Page({ | ||
| 536 | */ | 536 | */ |
| 537 | onLoad: function(options) { | 537 | onLoad: function(options) { |
| 538 | 538 | ||
| 539 | + this.getTaxHostInfo() | ||
| 539 | var pages = getCurrentPages() | 540 | var pages = getCurrentPages() |
| 540 | var frontPage = pages[pages.length - 2] | 541 | var frontPage = pages[pages.length - 2] |
| 541 | console.log('---------frontPage', frontPage.data) | 542 | console.log('---------frontPage', frontPage.data) |
| @@ -642,6 +643,37 @@ Page({ | @@ -642,6 +643,37 @@ Page({ | ||
| 642 | } | 643 | } |
| 643 | } | 644 | } |
| 644 | }, | 645 | }, |
| 646 | + | ||
| 647 | + getTaxHostInfo: function () { | ||
| 648 | + var that = this; | ||
| 649 | + var Authorization = app.globalData.Authorization; | ||
| 650 | + wx.request({ | ||
| 651 | + url: baseUrl + 'persontax/v1/personal-taxes', | ||
| 652 | + method: "GET", | ||
| 653 | + header: { | ||
| 654 | + 'content-type': 'application/json', // 默认值 | ||
| 655 | + "Authorization": Authorization | ||
| 656 | + }, | ||
| 657 | + data: { | ||
| 658 | + 'all': true | ||
| 659 | + }, | ||
| 660 | + success: function (res) { | ||
| 661 | + if (res.statusCode == 200) { | ||
| 662 | + var data = res.data | ||
| 663 | + if (data.items && data.items.length > 0) { | ||
| 664 | + for (var i = 0; i < data.items.length; i++) { | ||
| 665 | + if (data.items[i].family_ties == "本人") { | ||
| 666 | + app.globalData.hostInfo = data.items[i] | ||
| 667 | + break; | ||
| 668 | + } | ||
| 669 | + } | ||
| 670 | + } | ||
| 671 | + } | ||
| 672 | + } | ||
| 673 | + }) | ||
| 674 | + }, | ||
| 675 | + | ||
| 676 | + | ||
| 645 | getTaxList: function () { | 677 | getTaxList: function () { |
| 646 | var that = this; | 678 | var that = this; |
| 647 | wx.showLoading({ | 679 | wx.showLoading({ |
| @@ -1277,6 +1309,10 @@ Page({ | @@ -1277,6 +1309,10 @@ Page({ | ||
| 1277 | this.showToast('子女年龄小于3岁,不可申报') | 1309 | this.showToast('子女年龄小于3岁,不可申报') |
| 1278 | return | 1310 | return |
| 1279 | } | 1311 | } |
| 1312 | + if (this.data.commonbirthDate.datelong < app.globalData.hostInfo.birth_date) { | ||
| 1313 | + this.showToast('子女年龄不得大于本人'); | ||
| 1314 | + return | ||
| 1315 | + } | ||
| 1280 | if (!formdata.children_name || formdata.children_name.length < 1) { | 1316 | if (!formdata.children_name || formdata.children_name.length < 1) { |
| 1281 | this.showToast('请填写子女姓名') | 1317 | this.showToast('请填写子女姓名') |
| 1282 | return | 1318 | return |
| @@ -1457,6 +1493,10 @@ Page({ | @@ -1457,6 +1493,10 @@ Page({ | ||
| 1457 | this.showToast('被赡养人年龄不足60岁,不可申报') | 1493 | this.showToast('被赡养人年龄不足60岁,不可申报') |
| 1458 | return | 1494 | return |
| 1459 | } | 1495 | } |
| 1496 | + if (this.data.olderbirthDate.datelong > app.globalData.hostInfo.birth_date) { | ||
| 1497 | + this.showToast('被赡养人年龄应大于本人'); | ||
| 1498 | + return | ||
| 1499 | + } | ||
| 1460 | if (this.data.older_relativeData.selected.length < 1) { | 1500 | if (this.data.older_relativeData.selected.length < 1) { |
| 1461 | this.showToast('请选择与纳税人关系') | 1501 | this.showToast('请选择与纳税人关系') |
| 1462 | return | 1502 | return |
请
注册
或
登录
后发表评论