提交 6e6eb9641decf86a697712097b564cb3f51914d0

作者 wangyu
1 个父辈 d278e155

添加赡养老人相关逻辑

... ... @@ -11,7 +11,7 @@ Page({
11 11 cur_status: "",
12 12 legal_entity_id: "",
13 13 legal_entity: "",
14   - house_type:"",
  14 + house_type: "",
15 15 declareStatus: {
16 16 "to_declare": "待申报",
17 17 "declaring": "申报中",
... ... @@ -49,6 +49,24 @@ Page({
49 49 "month": "月",
50 50 "year": "年"
51 51 },
  52 + issinglechildData: {
  53 + label: '是否独生子女',
  54 + bindtype: 'issingle_child',
  55 + selected: '',
  56 + isblack: '',
  57 + placeholder: '请选择是否独生子女',
  58 + values: ["是", "否"],
  59 + onChange: 'onPickerSelect'
  60 + },
  61 + shareMethodData: {
  62 + label: '分摊方式',
  63 + bindtype: 'share_method',
  64 + selected: '',
  65 + isblack: '',
  66 + values: ["赡养人平均分摊", "赡养人约定分摊", "被赡养人指定分摊"],
  67 + placeholder: '请选择分摊方式',
  68 + onChange: 'onPickerSelect'
  69 + },
52 70 additionInfo: [],
53 71 reducetypeData: ["月度", "年度"],
54 72 modalData: {},
... ... @@ -70,6 +88,7 @@ Page({
70 88 lefttext: "添加家庭成员并申报",
71 89 righttext: "确定为该选择的人申报",
72 90 },
  91 + reduce_amount:0,
73 92 selected_reduceindex: 0,
74 93 selected_addindex: 0
75 94 },
... ... @@ -81,7 +100,7 @@ Page({
81 100 var that = this
82 101 var housetype, housestatus
83 102 console.log("options", options);
84   - if (options.status == 'house_fund_rent') {
  103 + if (options.status == 'house_fund_rent') {
85 104 housetype = 'house_fund_rent'
86 105 housestatus = 'house_fund'
87 106 } else if (options.status == 'house_fund_loan') {
... ... @@ -96,12 +115,12 @@ Page({
96 115 house_type: housetype,
97 116 legal_entity_id: options.legal_entity_id,
98 117 legal_entity: options.legal_entity,
99   - selected_reduceindex: options.status =='medical_fund'?1:0
  118 + selected_reduceindex: options.status == 'medical_fund' ? 1 : 0
100 119 })
101 120 wx.setNavigationBarTitle({
102 121 "title": that.data.additiontitle[this.data.cur_status],
103 122 })
104   -
  123 +
105 124 },
106 125
107 126 /**
... ... @@ -153,15 +172,15 @@ Page({
153 172 if (newdata[i].patient_birthday && newdata[i].patient_birthday > 0) {
154 173 newdata[i].patient_birthday = format.formatTime_date(newdata[i].patient_birthday)
155 174 }
156   - if (newdata[i].house_address){
157   - if (newdata[i].house_address.province == newdata[i].house_address.city){
158   - newdata[i].house_address_new = newdata[i].house_address.city + newdata[i].house_address.district
159   - }else{
160   - newdata[i].house_address_new = newdata[i].house_address.province + newdata[i].house_address.city + newdata[i].house_address.district
  175 + if (newdata[i].house_address) {
  176 + if (newdata[i].house_address.province == newdata[i].house_address.city) {
  177 + newdata[i].house_address_new = newdata[i].house_address.city + newdata[i].house_address.district
  178 + } else {
  179 + newdata[i].house_address_new = newdata[i].house_address.province + newdata[i].house_address.city + newdata[i].house_address.district
161 180 }
162 181 }
163   - if (newdata[i].co_supporters && newdata[i].co_supporters.length>0){
164   - for (var j = 0; j < newdata[i].co_supporters.length;j++){
  182 + if (newdata[i].co_supporters && newdata[i].co_supporters.length > 0) {
  183 + for (var j = 0; j < newdata[i].co_supporters.length; j++) {
165 184 if (newdata[i].co_supporters[j].birthday && newdata[i].birthday > 0) {
166 185 newdata[i].co_supporters[j].birthday = format.formatTime_date(newdata[i].co_supporters[j].birthday)
167 186 }
... ... @@ -169,9 +188,9 @@ Page({
169 188 }
170 189 }
171 190
172   - var housetype_new = this.data.house_type
173   - if (newdata.length > 0 && newdata[0].type){
174   - housetype_new = newdata[0].type == 'loan' ? "house_fund_loan" :"house_fund_rent"
  191 + var housetype_new = this.data.house_type
  192 + if (newdata.length > 0 && newdata[0].type) {
  193 + housetype_new = newdata[0].type == 'loan' ? "house_fund_loan" : "house_fund_rent"
175 194 }
176 195 console.log("housetype_new", housetype_new)
177 196 this.setData({
... ... @@ -245,6 +264,26 @@ Page({
245 264 goadd: function(e) { //添加
246 265 console.log("goadd", e)
247 266 var that = this
  267 + if (this.data.cur_status == 'support_duty'){
  268 + if (this.data.issinglechildData.selected.length < 1) {
  269 + this.showToast("请选择是否独生子女")
  270 + return
  271 + }
  272 + if (this.data.issinglechildData.selected == "否") {
  273 + if (this.data.shareMethodData.selected.length < 1) {
  274 + this.showToast("请选择分摊方式")
  275 + return
  276 + }
  277 + if (this.data.reduce_amount < 1 || this.data.reduce_amount > 1000) {
  278 + this.showToast("请输入合理金额")
  279 + return
  280 + }
  281 + } else {
  282 + this.setData({
  283 + reduce_amount: 2000
  284 + })
  285 + }
  286 + }
248 287 var modalinfo, senddata
249 288 if (this.data.cur_status == 'continuing_education' || this.data.cur_status == 'house_fund') {
250 289
... ... @@ -384,7 +423,7 @@ Page({
384 423 showModal_addtype: false
385 424 })
386 425 var senddata = ""
387   - if (this.data.cur_status == 'support_duty' ){
  426 + if (this.data.cur_status == 'support_duty') {
388 427 // senddata = JSON.stringify(this.data.additionInfo[0]);
389 428 }
390 429 wx.navigateTo({
... ... @@ -419,11 +458,47 @@ Page({
419 458 }
420 459 },
421 460
  461 + onPickerSelect: function(e) {
  462 + console.log('picker发送选择改变,携带值为', e)
  463 + switch (e.currentTarget.id) {
  464 + case 'issingle_child':
  465 + var issinglechildData = this.data.issinglechildData
  466 + issinglechildData.selected = issinglechildData.values[e.detail.value]
  467 + this.setData({
  468 + issinglechildData: issinglechildData
  469 + })
  470 + break;
  471 + case 'share_method':
  472 + var share_methodData = this.data.shareMethodData
  473 + share_methodData.selected = share_methodData.values[e.detail.value]
  474 + this.setData({
  475 + shareMethodData: share_methodData
  476 + })
  477 + break;
  478 + }
  479 + },
  480 +
  481 + bindinput:function(e){
  482 + console.log("bindinput",e)
  483 + this.setData({
  484 + reduce_amount: parseFloat(e.detail.value)
  485 + })
  486 + },
  487 +
  488 + showToast: function (data) {
  489 + if (data && data.length > 0) {
  490 + wx.showToast({
  491 + title: data,
  492 + icon: "none"
  493 + })
  494 + }
  495 + },
  496 +
422 497 /**
423 498 * Lifecycle function--Called when page hide
424 499 */
425 500 onHide: function() {
426   -
  501 +
427 502 },
428 503
429 504 /**
... ...
1 1 <!--pages/main/addtionalreduce/childreneducate/childreneducate.wxml-->
  2 +<import src="../../../common/picker_cell" />
2 3
3 4 <view style='width:100%;height:100%;background:#FCFCFC;'>
4 5 <view style='display:flex;flex-direction:column;margin-bottom:140rpx;'>
... ... @@ -8,11 +9,33 @@
8 9 <text style='font-size:30rpx;color:#333;line-height:100rpx;font-family: PingFangSC-Semibold;float:left'>扣除方式</text>
9 10 <text class='text_999_30 float_right' style='line-height:100rpx'>年度</text>
10 11 </view>
11   - <view style='height:100rpx;padding:0 30rpx;background:#FFF' bindtap='showModalReducetype' wx:elif="{{cur_status!='continuing_education'}}">
  12 + <view style='height:100rpx;padding:0 30rpx;background:#FFF' bindtap='showModalReducetype' wx:elif="{{cur_status!='continuing_education'&&cur_status!='support_duty'}}">
12 13 <text style='font-size:30rpx;color:#333;line-height:100rpx;font-family: PingFangSC-Semibold;float:left'>扣除方式</text>
13 14 <image class='arrow_img float_right' style='margin-top:28rpx' src="/images/arrow_right.png"></image>
14 15 <text class='text_999_30 float_right' style='line-height:100rpx'>{{reducetypeData[selected_reduceindex]}}</text>
15 16 </view>
  17 + <view wx:if="{{cur_status=='support_duty'}}" style='padding:0 30rpx;background:#FFF'>
  18 + <template is="picker_cell_normal" data="{{...issinglechildData}}" />
  19 + <view class='divide_line_f5f5f5'></view>
  20 + <view wx:if="{{issinglechildData.selected=='否'}}">
  21 + <template is="picker_cell_normal" data="{{...shareMethodData}}" />
  22 + <view class='divide_line_f5f5f5'></view>
  23 + <view style='height:90rpx'>
  24 + <text style='line-height: 90rpx;text-align:right;font-size: 30rpx;color: #666;'>本年度月扣除金额</text>
  25 + <text class='float_right' style='line-height: 90rpx;text-align:right;font-size: 30rpx;color: #999;' name='country'>/月</text>
  26 + <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入扣除金额(不超过1000)' type='digit' name='reduce_amount' bindinput='bindinput'></input>
  27 + </view>
  28 + </view>
  29 + <view wx:elif="{{issinglechildData.selected=='是'}}">
  30 + <view class='divide_line_f5f5f5'></view>
  31 + <view style='height:90rpx'>
  32 + <text style='line-height: 90rpx;text-align:right;font-size: 30rpx;color: #666;'>本年度月扣除金额</text>
  33 + <text class='float_right' style='line-height: 90rpx;text-align:right;font-size: 30rpx;color: #ff9f00;' name='country'>2000/月</text>
  34 + </view>
  35 +
  36 + </view>
  37 + </view>
  38 +
16 39
17 40 <view wx:if="{{additionInfo&&additionInfo.length>0}}">
18 41
... ... @@ -145,7 +168,7 @@
145 168 </view>
146 169
147 170 <view wx:if="{{cur_status=='support_duty'}}">
148   - <view wx:if="{{additionInfo.length>0}}" wx:for="{{additionInfo}}" >
  171 + <view wx:if="{{additionInfo.length>0}}" wx:for="{{additionInfo}}">
149 172 <view style='margin:30rpx;padding-left:30rpx' class='card_rectangle_bg_column'>
150 173 <view style='height:110rpx'>
151 174 <text class='text_gray_36 float_left' style='line-height:110rpx'>被赡养人</text>
... ... @@ -157,7 +180,7 @@
157 180 <view class='divide_line_f5f5f5'></view>
158 181 <view style='height:70rpx'>
159 182 <text class='text_999_28 ' style='line-height:70rpx'>被赡养人姓名:</text>
160   - <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{item.name}}</text>
  183 + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{item.supported_name}}</text>
161 184 </view>
162 185 <!-- <view style='height:70rpx'>
163 186 <text class='text_999_28 ' style='line-height:70rpx'>分摊比例:</text>
... ... @@ -180,7 +203,7 @@
180 203 </view>
181 204
182 205 </view>
183   - <view wx:if="{{item.co_supporters&&item.co_supporters.length>0}}" >
  206 + <view wx:if="{{item.co_supporters&&item.co_supporters.length>0}}">
184 207 <view wx:for="{{item.co_supporters}}" style='margin:30rpx;padding-left:30rpx' class='card_rectangle_bg_column' wx:for-item="itemdetail">
185 208 <view style='height:110rpx'>
186 209 <text class='text_gray_36 float_left' style='line-height:110rpx'>共同赡养人</text>
... ...
... ... @@ -118,6 +118,21 @@
118 118 bottom: 0;
119 119 }
120 120
  121 +.input_wrap {
  122 + width: 380rpx;
  123 + height: 90rpx;
  124 + font-size: 30rpx;
  125 + color: #333;
  126 + text-align: right;
  127 + overflow: hidden;
  128 + text-overflow: ellipsis;
  129 + white-space: nowrap;
  130 +}
  131 +
  132 +
  133 +
  134 +
  135 +
121 136 /* 遮罩层 */
122 137
123 138 .mask {
... ...
... ... @@ -8,7 +8,7 @@ Page({
8 8 */
9 9 data: {
10 10 load_finish: false,
11   - text_tip: "自然人信息不完善,立即完善",
  11 + text_tip: "去查看",
12 12 taxlist: ['']
13 13 },
14 14
... ... @@ -140,11 +140,7 @@ Page({
140 140
141 141 getStatus: function (data) {
142 142 console.log('data', data)
143   - if (data[0].family_ties.length < 1 && data[0].name.length > 0 && data[0].id_card_type.length > 0 && data[0].id_card_no.length > 0 && data[0].mobile.length > 0) {
144   - this.setData({
145   - text_tip: '去查看'
146   - })
147   - } else {
  143 + if (data[0].family_ties.length < 1 || data[0].name.length < 1 || data[0].id_card_type.length < 1 || data[0].id_card_no.length <1 || data[0].mobile.length < 1) {
148 144 this.setData({
149 145 text_tip: '自然人信息不完善,立即完善'
150 146 })
... ...
注册登录 后发表评论