正在显示
9 个修改的文件
包含
202 行增加
和
30 行删除
images/home_tip.png
0 → 100644
13.1 KB
images/warn_yellow.png
0 → 100644
352 Bytes
| ... | ... | @@ -22,13 +22,20 @@ Page({ |
| 22 | 22 | cardtype: "", |
| 23 | 23 | nation: "", |
| 24 | 24 | birthday_datelong: -1, |
| 25 | + choosed_date: ""//上一个页面选择的年份 | |
| 25 | 26 | }, |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * Lifecycle function--Called when page load |
| 29 | 30 | */ |
| 30 | 31 | onLoad: function(options) { |
| 32 | + var pages = getCurrentPages() | |
| 33 | + var frontPage = pages[pages.length - 2] | |
| 34 | + console.log("front", frontPage.data) | |
| 31 | 35 | console.log("onLoad", options) |
| 36 | + this.setData({ | |
| 37 | + choosed_date: frontPage.data.choosed_date, | |
| 38 | + }) | |
| 32 | 39 | if (options.id) { |
| 33 | 40 | this.setData({ |
| 34 | 41 | legal_entity_id: options.id, |
| ... | ... | @@ -191,6 +198,7 @@ Page({ |
| 191 | 198 | wx.request({ |
| 192 | 199 | url: baseUrl + 'persontax/v1/co-supporters', |
| 193 | 200 | data: { |
| 201 | + 'years': that.data.choosed_date+"", | |
| 194 | 202 | "id": that.data.supporter_id, |
| 195 | 203 | "legal_entity_id": that.data.legal_entity_id, |
| 196 | 204 | "co_supporter": formdata.name, | ... | ... |
| ... | ... | @@ -537,7 +537,8 @@ Page({ |
| 537 | 537 | // }, |
| 538 | 538 | edu_lable: "school", |
| 539 | 539 | oldersupport_lable: "", |
| 540 | - img_path: "/images/upload_img.png" | |
| 540 | + img_path: "/images/upload_img.png", | |
| 541 | + choosed_date: ""//上一个页面选择的年份 | |
| 541 | 542 | }, |
| 542 | 543 | |
| 543 | 544 | /** |
| ... | ... | @@ -636,6 +637,7 @@ Page({ |
| 636 | 637 | } |
| 637 | 638 | |
| 638 | 639 | this.setData({ |
| 640 | + choosed_date: frontPage.data.choosed_date, | |
| 639 | 641 | title: title, |
| 640 | 642 | cur_index: nameKey, |
| 641 | 643 | house_type: house_type, |
| ... | ... | @@ -1975,6 +1977,7 @@ Page({ |
| 1975 | 1977 | } |
| 1976 | 1978 | newdata.legal_entity_id = this.legal_entity_id |
| 1977 | 1979 | newdata.legal_entity = this.legal_entity |
| 1980 | + newdata.years = this.data.choosed_date+"" | |
| 1978 | 1981 | if (this.isEdit) { |
| 1979 | 1982 | newdata.id = this.edit_id |
| 1980 | 1983 | } | ... | ... |
| ... | ... | @@ -41,7 +41,8 @@ Page({ |
| 41 | 41 | sureid: false, |
| 42 | 42 | disable_change: '', |
| 43 | 43 | status: "", |
| 44 | - extra_message: '' | |
| 44 | + extra_message: '', | |
| 45 | + choosed_date: ""//上一个页面选择的年份 | |
| 45 | 46 | }, |
| 46 | 47 | ], |
| 47 | 48 | }, |
| ... | ... | @@ -50,10 +51,14 @@ Page({ |
| 50 | 51 | * Lifecycle function--Called when page load |
| 51 | 52 | */ |
| 52 | 53 | onLoad: function(options) { |
| 54 | + var pages = getCurrentPages() | |
| 55 | + var frontPage = pages[pages.length - 2] | |
| 56 | + console.log("front", frontPage.data) | |
| 53 | 57 | console.log("onLoad", options) |
| 54 | 58 | this.setData({ |
| 55 | 59 | legal_entity_id: options.legal_entity_id, |
| 56 | 60 | legal_entity: options.legal_entity, |
| 61 | + choosed_date: frontPage.data.choosed_date, | |
| 57 | 62 | type: options.type, |
| 58 | 63 | selectdata: options.select_data ? JSON.parse(options.select_data) : {} |
| 59 | 64 | }) |
| ... | ... | @@ -222,6 +227,7 @@ Page({ |
| 222 | 227 | wx.request({ |
| 223 | 228 | url: baseUrl + 'persontax/v1/additional-settings', |
| 224 | 229 | data: { |
| 230 | + "years": that.data.choosed_date+"", | |
| 225 | 231 | "legal_entity_id": this.data.legal_entity_id, |
| 226 | 232 | "legal_entity": this.data.legal_entity, |
| 227 | 233 | "options": array | ... | ... |
| 1 | 1 | // pages/main/addtionalreduce/home.js |
| 2 | 2 | var app = getApp(); |
| 3 | 3 | var baseUrl = app.globalData.baseUrl; |
| 4 | +var format = require('../../../utils/util.js'); | |
| 4 | 5 | Page({ |
| 5 | 6 | |
| 6 | 7 | /** |
| ... | ... | @@ -12,6 +13,11 @@ Page({ |
| 12 | 13 | hascompleted:false, |
| 13 | 14 | additionlist: [], |
| 14 | 15 | complete_item:[], |
| 16 | + choosed_date: '', | |
| 17 | + addition_data_last_year:false,//上一年是否有数据 | |
| 18 | + has_showModal:false,//当前页面是否展示过modal | |
| 19 | + show_modal:false, | |
| 20 | + tip_detail:"尊敬的用户您好!2020年度的专项附加扣除申报已经启动,请您及时确认填报信息,确保专项附加扣除能正常享受扣除。", | |
| 15 | 21 | declareStatus: { |
| 16 | 22 | "to_declare ": "待申报", |
| 17 | 23 | "declaring": "申报中", |
| ... | ... | @@ -40,6 +46,10 @@ Page({ |
| 40 | 46 | */ |
| 41 | 47 | onLoad: function (options) { |
| 42 | 48 | console.log("onLoad"); |
| 49 | + var mydate = new Date(); | |
| 50 | + this.setData({ | |
| 51 | + choosed_date: mydate.getFullYear() , | |
| 52 | + }) | |
| 43 | 53 | }, |
| 44 | 54 | |
| 45 | 55 | godeclare: function (e) { |
| ... | ... | @@ -67,7 +77,7 @@ Page({ |
| 67 | 77 | lookandadd: function (e) { |
| 68 | 78 | var str = e.currentTarget.id.split('-') |
| 69 | 79 | var data = this.data.additionlist; |
| 70 | - console.log("lookandadd", str); | |
| 80 | + console.log("lookandadd", str,data); | |
| 71 | 81 | |
| 72 | 82 | wx.navigateTo({ |
| 73 | 83 | url: 'lookandupdate/lookandupdate?status=' + data[str[0]].addition_items[str[1]].addition_category + "&employee_status=" + data[str[0]].employee_status + "&legal_entity_id=" + data[str[0]].legal_entity_id + "&legal_entity=" + data[str[0]].legal_entity, |
| ... | ... | @@ -87,29 +97,33 @@ Page({ |
| 87 | 97 | onShow: function () { |
| 88 | 98 | console.log("onShow"); |
| 89 | 99 | var that = this |
| 90 | - wx.showLoading({ | |
| 91 | - title: '', | |
| 92 | - }) | |
| 93 | 100 | this.getAdditionList() |
| 94 | 101 | }, |
| 95 | 102 | |
| 103 | + //获取申报列表 | |
| 96 | 104 | getAdditionList: function () { |
| 105 | + wx.showLoading({ | |
| 106 | + title: '', | |
| 107 | + }) | |
| 97 | 108 | var that = this; |
| 98 | 109 | var Authorization = getApp().globalData.Authorization; |
| 99 | 110 | wx.request({ |
| 100 | 111 | url: baseUrl + 'persontax/v1/person-additions', |
| 101 | - // data: { | |
| 102 | - // limit: 10, | |
| 103 | - // offset: 0 | |
| 104 | - // }, | |
| 112 | + data: { | |
| 113 | + years:that.data.choosed_date | |
| 114 | + // limit: 10, | |
| 115 | + // offset: 0 | |
| 116 | + }, | |
| 105 | 117 | header: { |
| 106 | 118 | 'content-type': 'application/json', |
| 107 | 119 | "Authorization": Authorization |
| 108 | 120 | }, |
| 109 | 121 | success: function (res) { |
| 110 | 122 | if (res && res.data) { |
| 111 | - console.log("res", res) | |
| 123 | + console.log("show_modal", !res.data.new_addition_status) | |
| 112 | 124 | that.setData({ |
| 125 | + addition_data_last_year: res.data.last_addition_status, | |
| 126 | + show_modal: !that.data.has_showModal&&!res.data.new_addition_status, | |
| 113 | 127 | complete_item: res.data.complete_item, |
| 114 | 128 | additionlist: that.handleData(res.data.items) |
| 115 | 129 | }) |
| ... | ... | @@ -145,9 +159,66 @@ Page({ |
| 145 | 159 | } |
| 146 | 160 | } |
| 147 | 161 | } |
| 148 | - console.log('ddddd', items) | |
| 162 | + console.log('items', items) | |
| 149 | 163 | return items |
| 150 | 164 | }, |
| 165 | + | |
| 166 | + datePickerChange: function (e) { | |
| 167 | + console.log("e", e) | |
| 168 | + var timestamp = Date.parse(new Date(e.detail.value)) / 1000 | |
| 169 | + this.setData({ | |
| 170 | + choosed_date: format.yearFormString(timestamp) | |
| 171 | + }) | |
| 172 | + this.getAdditionList() | |
| 173 | + }, | |
| 174 | + | |
| 175 | +// 暂不确认 | |
| 176 | + doNotConfirm:function(){ | |
| 177 | + this.setData({ | |
| 178 | + show_modal: false, | |
| 179 | + has_showModal: true | |
| 180 | + }) | |
| 181 | + }, | |
| 182 | + | |
| 183 | +// 立即确认 | |
| 184 | + doConfirm: function () { | |
| 185 | + this.setData({ | |
| 186 | + show_modal: false, | |
| 187 | + has_showModal:true | |
| 188 | + }) | |
| 189 | + this.quickAdd() | |
| 190 | + }, | |
| 191 | + | |
| 192 | +// 一键带入 | |
| 193 | + quickAdd:function(){ | |
| 194 | + var that = this; | |
| 195 | + var Authorization = getApp().globalData.Authorization; | |
| 196 | + wx.request({ | |
| 197 | + url: baseUrl + 'persontax/v1/person-additions-update', | |
| 198 | + method:"POST", | |
| 199 | + data: { | |
| 200 | + user_id: app.globalData.userInfo?app.globalData.userInfo.id:"" | |
| 201 | + }, | |
| 202 | + header: { | |
| 203 | + 'content-type': 'application/json', | |
| 204 | + "Authorization": Authorization | |
| 205 | + }, | |
| 206 | + success: function (res) { | |
| 207 | + if (res && res.data) { | |
| 208 | + console.log("res", res) | |
| 209 | + that.setData({ | |
| 210 | + choosed_date: "2020" | |
| 211 | + }) | |
| 212 | + that.getAdditionList() | |
| 213 | + } | |
| 214 | + wx.hideLoading() | |
| 215 | + }, | |
| 216 | + complete(res) { | |
| 217 | + console.log(res.data) | |
| 218 | + } | |
| 219 | + }) | |
| 220 | + }, | |
| 221 | + | |
| 151 | 222 | /** |
| 152 | 223 | * Lifecycle function--Called when page hide |
| 153 | 224 | */ | ... | ... |
| 1 | 1 | <!--pages/main/addtionalreduce/home.wxml--> |
| 2 | 2 | <view class='page'> |
| 3 | - | |
| 3 | + <!-- 新增日期选择器 --> | |
| 4 | + <picker mode="date" fields="year" start="2019-01-01" end="2020-01-01" bindchange="datePickerChange"> | |
| 5 | + <view style="height:80rpx;width:280rpx"> | |
| 6 | + <text style="line-height:80rpx;margin:0 20rpx;font-size: 28rpx;color: #999;">年份: </text> | |
| 7 | + <text style="line-height:80rpx;font-size: 28rpx;color: #333;">{{choosed_date}} </text> | |
| 8 | + <image style=" width: 24rpx;height: 16rpx;align-items: center;" src="/images/arrow_down.png"></image> | |
| 9 | + </view> | |
| 10 | + </picker> | |
| 11 | + <view style='height:20rpx;background:#F5F5F5'></view> | |
| 12 | + <!-- 新增弹窗 --> | |
| 13 | + <view wx:if="{{show_modal}}" class="mask"></view> | |
| 14 | + <view wx:if="{{show_modal}}" style='top:320rpx;position:absolute;z-index:10;width:650rpx;right:0;left:0;margin:auto;'> | |
| 15 | + <image class='modal_img' src="/images/home_tip.png"></image> | |
| 16 | + <view style="background:white;"> | |
| 17 | + <view style='font-size:30rpx;color:#666;padding:20rpx 40rpx'>{{tip_detail}}</view> | |
| 18 | + <view class="divide_line" style="margin-top:40rpx"></view> | |
| 19 | + <view style='height:100rpx;width:100%;display: flex;'> | |
| 20 | + <text class='text_cancel' bindtap='doNotConfirm'>暂不确认</text> | |
| 21 | + <view style='width:1px;background:#e5e5e5;'></view> | |
| 22 | + <text class='text_confirm' bindtap='doConfirm'>立即确认</text> | |
| 23 | + </view> | |
| 24 | + </view> | |
| 25 | + </view> | |
| 26 | + <!-- 数据列表 --> | |
| 4 | 27 | <view wx:if="{{additionlist.length>0}}" style='margin-bottom:30rpx;background:#fff'> |
| 5 | - <view wx:for="{{additionlist}}" wx:key="" style='display:flex;flex-direction:column' wx:for-index="idx01" wx:for-item="item"> | |
| 28 | + <view wx:for="{{additionlist}}" wx:key="" style='display:flex;flex-direction:column' wx:for-index="idx01" wx:for-item="item"> | |
| 6 | 29 | <view style='margin:30rpx 44rpx;float:left;display:flex;flex-direction:column'> |
| 7 | 30 | <text class=' text_333_40 float_left'>{{item.legal_entity}}</text> |
| 8 | 31 | <view wx:if="{{item.employee_status!='inactive'&&item.addition_items.length<1&&item.status=='init'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> |
| ... | ... | @@ -17,7 +40,7 @@ |
| 17 | 40 | <block wx:for="{{item.addition_items}}" wx:key="" wx:for-item="itemData" wx:for-index="idx02"> |
| 18 | 41 | <view wx:if="{{itemData.addition_category!='medical_fund'}}"> |
| 19 | 42 | <view style='margin:0 50rpx;background:#e5e5e5;height:2rpx;'></view> |
| 20 | - <view style='padding:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx01}}-{{idx02}}'> | |
| 43 | + <view style='padding:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx01}}-{{idx02}}'> | |
| 21 | 44 | <view style='height:40rpx'> |
| 22 | 45 | <text class='text_333_32 float_left'>{{additiontitle[itemData.addition_category]}}</text> |
| 23 | 46 | <text class='text_333_32 float_left' hidden="{{(itemData.addition_category=='continuing_education'||itemData.addition_category=='house_fund')||itemData.count<2}}">({{itemData.count}})</text> |
| ... | ... | @@ -41,7 +64,7 @@ |
| 41 | 64 | </view> |
| 42 | 65 | </view> |
| 43 | 66 | </view> |
| 44 | - <view wx:for="{{itemData.professions}}" wx:key="" wx:for-item="profession"> | |
| 67 | + <view wx:for="{{itemData.professions}}" wx:key="" wx:for-item="profession"> | |
| 45 | 68 | <view wx:if="{{index==0}}"> |
| 46 | 69 | <text wx:if='{{itemData.professions.length>1}}' style='font-size:28rpx;color:#666'>职业资格继续教育 ({{itemData.professions.length}})</text> |
| 47 | 70 | <text wx:else style='font-size:28rpx;color:#666'>职业资格继续教育</text> |
| ... | ... | @@ -108,9 +131,20 @@ |
| 108 | 131 | <!-- <view wx:else> |
| 109 | 132 | <image style='width:55%;height:254rpx;margin:166rpx;' src='/images/noreduce_img.png'></image> |
| 110 | 133 | </view> --> |
| 111 | - | |
| 134 | + | |
| 112 | 135 | </view> |
| 113 | - <view wx:if="{{hascompleted&&additionlist.length<1}}" style='background:#fff;'> | |
| 114 | - <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/noreduce_img.png'></image> | |
| 136 | + <view wx:if="{{hascompleted&&additionlist.length<1&&choosed_date==2020&&addition_data_last_year}}" style='background:#fef6e9;padding:40rpx 30rpx;display:flex;'> | |
| 137 | + <view style="margin-right:20rpx;margin-top:10rpx"> | |
| 138 | + <image style='width:40rpx;height:40rpx;' src='/images/warn_yellow.png'></image> | |
| 139 | + </view> | |
| 140 | + <view > | |
| 141 | + <text style="font-size: 32rpx;color: #2B2B2B;">您还没有填报2020年度的专项附加扣除,点击</text> | |
| 142 | + <text style="font-size: 32rpx;color: #357AEB;" bindtap="quickAdd"> [一键带入] </text> | |
| 143 | + <text style="font-size: 32rpx;color: #2B2B2B;">将2019年度已填报的扣除信息在2020年度继续填报。</text> | |
| 115 | 144 | </view> |
| 145 | + | |
| 146 | + </view> | |
| 147 | + <view wx:elif="{{hascompleted&&additionlist.length<1}}" style='background:#fff;'> | |
| 148 | + <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/noreduce_img.png'></image> | |
| 149 | + </view> | |
| 116 | 150 | </view> |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -117,3 +117,43 @@ line-height: 17px; |
| 117 | 117 | line-height: 13px; |
| 118 | 118 | padding: 10rpx 30rpx; |
| 119 | 119 | } |
| 120 | + | |
| 121 | +/* 遮罩层 */ | |
| 122 | + | |
| 123 | +.mask { | |
| 124 | + width: 100%; | |
| 125 | + height: 100%; | |
| 126 | + position: fixed; | |
| 127 | + top: 0; | |
| 128 | + left: 0; | |
| 129 | + background: #000; | |
| 130 | + opacity: 0.7; | |
| 131 | + z-index: 10; | |
| 132 | +} | |
| 133 | + | |
| 134 | +.modal_img { | |
| 135 | + width: 650rpx; | |
| 136 | + height: 160rpx; | |
| 137 | + margin: 0 auto; | |
| 138 | + display: block; | |
| 139 | +} | |
| 140 | + | |
| 141 | +.text_cancel { | |
| 142 | + font-family:PingFangSC-Regular,PingFang SC; | |
| 143 | + font-size: 36rpx; | |
| 144 | + color: #999; | |
| 145 | + letter-spacing: 0; | |
| 146 | + text-align: center; | |
| 147 | + flex: 1; | |
| 148 | + padding: 30rpx; | |
| 149 | +} | |
| 150 | + | |
| 151 | +.text_confirm { | |
| 152 | + font-family:PingFangSC-Regular,PingFang SC; | |
| 153 | + font-size: 36rpx; | |
| 154 | + color: #108ee9; | |
| 155 | + letter-spacing: 0; | |
| 156 | + text-align: center; | |
| 157 | + flex: 1; | |
| 158 | + padding: 30rpx; | |
| 159 | +} | ... | ... |
| ... | ... | @@ -100,13 +100,17 @@ Page({ |
| 100 | 100 | spousedataData: {}, //配偶数据 |
| 101 | 101 | reduce_amount: -1, |
| 102 | 102 | selected_reduceindex: 0, |
| 103 | - selected_addindex: 0 | |
| 103 | + selected_addindex: 0, | |
| 104 | + choosed_date:""//上一个页面选择的年份 | |
| 104 | 105 | }, |
| 105 | 106 | |
| 106 | 107 | /** |
| 107 | 108 | * Lifecycle function--Called when page load |
| 108 | 109 | */ |
| 109 | 110 | onLoad: function(options) { |
| 111 | + var pages = getCurrentPages() | |
| 112 | + var frontPage = pages[pages.length - 2] | |
| 113 | + console.log("front",frontPage.data) | |
| 110 | 114 | var that = this |
| 111 | 115 | var housetype, housestatus |
| 112 | 116 | wx.showLoading({ |
| ... | ... | @@ -124,6 +128,7 @@ Page({ |
| 124 | 128 | housestatus = options.status |
| 125 | 129 | } |
| 126 | 130 | this.setData({ |
| 131 | + choosed_date: frontPage.data.choosed_date, | |
| 127 | 132 | cur_status: housestatus, |
| 128 | 133 | employee_status: options.employee_status ? options.employee_status:"", |
| 129 | 134 | house_type: housetype, |
| ... | ... | @@ -158,6 +163,7 @@ Page({ |
| 158 | 163 | var Authorization = getApp().globalData.Authorization; |
| 159 | 164 | wx.request({ |
| 160 | 165 | url: baseUrl + that.data.url_arr[that.data.cur_status] + that.data.legal_entity_id, |
| 166 | + data: { years: that.data.choosed_date}, | |
| 161 | 167 | header: { |
| 162 | 168 | 'content-type': 'application/json', |
| 163 | 169 | "Authorization": Authorization |
| ... | ... | @@ -185,21 +191,25 @@ Page({ |
| 185 | 191 | var btn_show = this.data.btn_show |
| 186 | 192 | if (that.data.cur_status == "continuing_education") { |
| 187 | 193 | var professionlist = newdata[0].profession_items |
| 188 | - for (var i = 0; i < professionlist.length > 0; i++) { | |
| 189 | - if (professionlist[i].approval_date) { | |
| 190 | - professionlist[i].approval_date = this.formatDate(professionlist[i].approval_date) | |
| 194 | + if (professionlist && professionlist.length>0){ | |
| 195 | + for (var i = 0; i < professionlist.length > 0; i++) { | |
| 196 | + if (professionlist[i].approval_date) { | |
| 197 | + professionlist[i].approval_date = this.formatDate(professionlist[i].approval_date) | |
| 198 | + } | |
| 191 | 199 | } |
| 192 | 200 | } |
| 193 | 201 | var titlelist = newdata[0].title_items |
| 194 | - for (var i = 0; i < titlelist.length > 0; i++) { | |
| 195 | - if (titlelist[i].education_start) { | |
| 196 | - titlelist[i].education_start = this.formatDate(titlelist[i].education_start).substring(0, 7) | |
| 197 | - } | |
| 198 | - if (titlelist[i].education_end) { | |
| 199 | - titlelist[i].education_end = this.formatDate(titlelist[i].education_end).substring(0, 7) | |
| 202 | + if(titlelist&&titlelist.length>0){ | |
| 203 | + for (var i = 0; i < titlelist.length > 0; i++) { | |
| 204 | + if (titlelist[i].education_start) { | |
| 205 | + titlelist[i].education_start = this.formatDate(titlelist[i].education_start).substring(0, 7) | |
| 206 | + } | |
| 207 | + if (titlelist[i].education_end) { | |
| 208 | + titlelist[i].education_end = this.formatDate(titlelist[i].education_end).substring(0, 7) | |
| 209 | + } | |
| 200 | 210 | } |
| 201 | 211 | } |
| 202 | - btn_show = true | |
| 212 | + btn_show = true | |
| 203 | 213 | // this.setData({ |
| 204 | 214 | // issinglechildData: issinglechild_Data, |
| 205 | 215 | // shareMethodData: shareMethod_Data | ... | ... |
请
注册
或
登录
后发表评论