提交 bc679746bd312ed359e5d10ace4cdf840eeaaf48

作者 wangyu
1 个父辈 ef048c49

专项附加扣除增加修改选项功能

@@ -12,36 +12,38 @@ Page({ @@ -12,36 +12,38 @@ Page({
12 flag_housing02: false, 12 flag_housing02: false,
13 legal_entity_id: '', 13 legal_entity_id: '',
14 legal_entity: '', 14 legal_entity: '',
15 - 15 + type: "",
  16 + selectdata: {},
16 selectIndex: [{ 17 selectIndex: [{
17 - message: '子女教育',  
18 - disable_change: '',  
19 - status: "children_education",  
20 - sureid: false  
21 - }, {  
22 - message: '继续教育',  
23 - disable_change: '',  
24 - status: "continuing_education",  
25 - sureid: false  
26 - }, {  
27 - message: '赡养老人',  
28 - disable_change: '',  
29 - status: "support_duty",  
30 - sureid: false  
31 - },  
32 - // {  
33 - // message: '大病医疗',  
34 - // disable_change: '',  
35 - // status: "medical_fund",  
36 - // sureid: false  
37 - // },  
38 - {  
39 - message: '住房',  
40 - sureid: false,  
41 - disable_change: '',  
42 - status: "",  
43 - extra_message: ''  
44 - }, ], 18 + message: '子女教育',
  19 + disable_change: '',
  20 + status: "children_education",
  21 + sureid: false
  22 + }, {
  23 + message: '继续教育',
  24 + disable_change: '',
  25 + status: "continuing_education",
  26 + sureid: false
  27 + }, {
  28 + message: '赡养老人',
  29 + disable_change: '',
  30 + status: "support_duty",
  31 + sureid: false
  32 + },
  33 + // {
  34 + // message: '大病医疗',
  35 + // disable_change: '',
  36 + // status: "medical_fund",
  37 + // sureid: false
  38 + // },
  39 + {
  40 + message: '住房',
  41 + sureid: false,
  42 + disable_change: '',
  43 + status: "",
  44 + extra_message: ''
  45 + },
  46 + ],
45 }, 47 },
46 48
47 /** 49 /**
@@ -51,9 +53,13 @@ Page({ @@ -51,9 +53,13 @@ Page({
51 console.log("onLoad", options) 53 console.log("onLoad", options)
52 this.setData({ 54 this.setData({
53 legal_entity_id: options.legal_entity_id, 55 legal_entity_id: options.legal_entity_id,
54 - legal_entity: options.legal_entity 56 + legal_entity: options.legal_entity,
  57 + type: options.type,
  58 + selectdata: options.select_data ? JSON.parse(options.select_data) : {}
55 }) 59 })
56 - 60 + if (options.type == '1' && options.select_data && JSON.parse(options.select_data)) {
  61 + this.handleData(JSON.parse(options.select_data))
  62 + }
57 }, 63 },
58 64
59 /** 65 /**
@@ -70,6 +76,52 @@ Page({ @@ -70,6 +76,52 @@ Page({
70 76
71 }, 77 },
72 78
  79 + handleData: function(data) {
  80 + var selectarray = data.addition_items;
  81 + console.log("handleData", data)
  82 + var selectIndex = this.data.selectIndex;
  83 +
  84 + if (selectarray.length > 0) {
  85 + wx.showLoading({
  86 + title: '',
  87 + })
  88 + for (var i = 0; i < selectarray.length; i++) {
  89 + if (selectarray[i].addition_category == 'children_education') { //子女教育
  90 + selectIndex[0].sureid = true
  91 + selectIndex[0].disable_change = true
  92 + }
  93 + if (selectarray[i].addition_category == 'continuing_education') { //继续教育
  94 + selectIndex[1].sureid = true
  95 + selectIndex[1].disable_change = true
  96 + }
  97 + if (selectarray[i].addition_category == 'support_duty') { //赡养老人
  98 + selectIndex[2].sureid = true
  99 + selectIndex[2].disable_change = true
  100 + }
  101 + if (selectarray[i].addition_category == 'house_fund_rent') { //住房(租房)
  102 + selectIndex[3].sureid = true
  103 + selectIndex[3].disable_change = true
  104 + this.setData({
  105 + flag_housing01: false,
  106 + flag_housing02: true,
  107 + })
  108 + }
  109 + if (selectarray[i].addition_category == 'house_fund_loan') { //住房(租房)
  110 + selectIndex[3].sureid = true
  111 + selectIndex[3].disable_change = true
  112 + this.setData({
  113 + flag_housing01: true,
  114 + flag_housing02: false,
  115 + })
  116 + }
  117 + }
  118 + this.setData({
  119 + selectIndex: selectIndex
  120 + })
  121 + wx.hideLoading()
  122 + }
  123 + },
  124 +
73 selectRep: function(e) { 125 selectRep: function(e) {
74 let index = e.currentTarget.dataset.selectindex; 126 let index = e.currentTarget.dataset.selectindex;
75 let selectIndex = this.data.selectIndex; //取到data里的selectIndex 127 let selectIndex = this.data.selectIndex; //取到data里的selectIndex
@@ -136,7 +188,7 @@ Page({ @@ -136,7 +188,7 @@ Page({
136 } else { 188 } else {
137 wx.showToast({ 189 wx.showToast({
138 title: '请选择住房类型', 190 title: '请选择住房类型',
139 - icon:"none" 191 + icon: "none"
140 }) 192 })
141 return; 193 return;
142 } 194 }
@@ -155,8 +207,11 @@ Page({ @@ -155,8 +207,11 @@ Page({
155 }) 207 })
156 return; 208 return;
157 } 209 }
158 - this.goDeclare(stuatusarray)  
159 - 210 + if (this.data.type == '0') {
  211 + this.goDeclare(stuatusarray)
  212 + } else if (this.data.type == '1'){
  213 + this.goUpdate(stuatusarray)
  214 + }
160 }, 215 },
161 216
162 goDeclare: function(array) { 217 goDeclare: function(array) {
@@ -185,6 +240,32 @@ Page({ @@ -185,6 +240,32 @@ Page({
185 }) 240 })
186 }, 241 },
187 242
  243 + goUpdate: function (array) {
  244 + var that = this;
  245 + var Authorization = getApp().globalData.Authorization;
  246 + wx.request({
  247 + url: baseUrl + 'persontax/v1/update-addition-setting',
  248 + data: {
  249 + "legal_entity_id": that.data.legal_entity_id,
  250 + "id": that.data.selectdata?that.data.selectdata.id:'',
  251 + "options": array
  252 + },
  253 + method: "PUT",
  254 + header: {
  255 + 'content-type': 'application/json',
  256 + "Authorization": Authorization
  257 + },
  258 + success: function (res) {
  259 + if (res && res.data) {
  260 + console.log("res", res)
  261 + wx.redirectTo({
  262 + url: '../godetail/godetail?datas=' + JSON.stringify(res.data)
  263 + })
  264 + }
  265 + }
  266 + })
  267 + },
  268 +
188 /** 269 /**
189 * Lifecycle function--Called when page hide 270 * Lifecycle function--Called when page hide
190 */ 271 */
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <text class='text_black_30' style='padding-left:30rpx'>选择专项附加扣除项</text> 12 <text class='text_black_30' style='padding-left:30rpx'>选择专项附加扣除项</text>
13 13
14 <view wx:for="{{selectIndex}}" class="multi-selection" style='padding:0 30rpx'> 14 <view wx:for="{{selectIndex}}" class="multi-selection" style='padding:0 30rpx'>
15 - <view data-selectIndex="{{index}}" bindtap="selectRep"> 15 + <view data-selectIndex="{{index}}" bindtap="selectRep" >
16 <view class='float_left'> 16 <view class='float_left'>
17 <image src="{{selectIndex[index].sureid? '/images/selected.png' : '/images/unselected.png'}}" class="multi-img" style='margin-top:20rpx' /> 17 <image src="{{selectIndex[index].sureid? '/images/selected.png' : '/images/unselected.png'}}" class="multi-img" style='margin-top:20rpx' />
18 </view> 18 </view>
@@ -45,7 +45,15 @@ Page({ @@ -45,7 +45,15 @@ Page({
45 console.log("godeclare", e); 45 console.log("godeclare", e);
46 var newdata = this.data.additionlist[e.currentTarget.id] 46 var newdata = this.data.additionlist[e.currentTarget.id]
47 wx.navigateTo({ 47 wx.navigateTo({
48 - url: 'godeclare/godeclare?legal_entity_id=' + newdata.legal_entity_id + "&legal_entity=" + newdata.legal_entity, 48 + url: 'godeclare/godeclare?legal_entity_id=' + newdata.legal_entity_id + "&legal_entity=" + newdata.legal_entity + "&type=0",
  49 + })
  50 + },
  51 +
  52 + goupdate: function (e) {
  53 + console.log("goupdate", e);
  54 + var newdata = this.data.additionlist[e.currentTarget.id]
  55 + wx.navigateTo({
  56 + url: 'godeclare/godeclare?legal_entity_id=' + newdata.legal_entity_id + "&legal_entity=" + newdata.legal_entity + "&select_data=" + JSON.stringify(newdata) + "&type=1",
49 }) 57 })
50 }, 58 },
51 59
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
9 <!-- <view wx:if="{{item.status=='to_declare'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> --> 9 <!-- <view wx:if="{{item.status=='to_declare'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> -->
10 立即申报 10 立即申报
11 </view> 11 </view>
  12 + <view wx:elif="{{item.addition_items&&item.addition_items.length>0&&item.addition_items.length<4}}" class='view_godeclare_wrap' bindtap='goupdate' id='{{idx01}}'>
  13 + 查看并调整
  14 + </view>
12 </view> 15 </view>
13 <view wx:if="{{item.addition_items&&item.addition_items.length>0}}"> 16 <view wx:if="{{item.addition_items&&item.addition_items.length>0}}">
14 <block wx:for="{{item.addition_items}}" wx:key="" wx:for-item="itemData" wx:for-index="idx02"> 17 <block wx:for="{{item.addition_items}}" wx:key="" wx:for-item="itemData" wx:for-index="idx02">
1 { 1 {
2 - "description": "项目配置文件",  
3 - "packOptions": {  
4 - "ignore": []  
5 - },  
6 - "setting": {  
7 - "urlCheck": false,  
8 - "es6": true,  
9 - "postcss": true,  
10 - "minified": true,  
11 - "newFeature": true  
12 - },  
13 - "compileType": "miniprogram", 2 + "description": "项目配置文件",
  3 + "packOptions": {
  4 + "ignore": []
  5 + },
  6 + "setting": {
  7 + "urlCheck": false,
  8 + "es6": true,
  9 + "postcss": true,
  10 + "minified": true,
  11 + "newFeature": true
  12 + },
  13 + "compileType": "miniprogram",
14 "libVersion": "2.2.2", 14 "libVersion": "2.2.2",
15 "appid": "wxe91c67adba6ac02d", 15 "appid": "wxe91c67adba6ac02d",
16 "projectname": "%E8%87%AA%E7%84%B6%E4%BA%BA%E7%A8%8E%E6%94%B6", 16 "projectname": "%E8%87%AA%E7%84%B6%E4%BA%BA%E7%A8%8E%E6%94%B6",
17 - "isGameTourist": false,  
18 - "condition": {  
19 - "search": {  
20 - "current": -1,  
21 - "list": []  
22 - },  
23 - "conversation": {  
24 - "current": -1,  
25 - "list": []  
26 - },  
27 - "game": {  
28 - "currentL": -1,  
29 - "list": []  
30 - },  
31 - "miniprogram": {  
32 - "current": -1,  
33 - "list": []  
34 - }  
35 - } 17 + "isGameTourist": false,
  18 + "condition": {
  19 + "search": {
  20 + "current": -1,
  21 + "list": []
  22 + },
  23 + "conversation": {
  24 + "current": -1,
  25 + "list": []
  26 + },
  27 + "game": {
  28 + "currentL": -1,
  29 + "list": []
  30 + },
  31 + "miniprogram": {
  32 + "current": -1,
  33 + "list": []
  34 + }
  35 + }
36 } 36 }
注册登录 后发表评论