正在显示
2 个修改的文件
包含
23 行增加
和
40 行删除
@@ -8,6 +8,7 @@ Page({ | @@ -8,6 +8,7 @@ Page({ | ||
8 | * Page initial data | 8 | * Page initial data |
9 | */ | 9 | */ |
10 | data: { | 10 | data: { |
11 | + deduction_amount:'', | ||
11 | lable: 0, | 12 | lable: 0, |
12 | datas02: [], | 13 | datas02: [], |
13 | title: '', | 14 | title: '', |
@@ -174,7 +175,7 @@ Page({ | @@ -174,7 +175,7 @@ Page({ | ||
174 | reducetypeData: { | 175 | reducetypeData: { |
175 | label: '扣除方式', | 176 | label: '扣除方式', |
176 | bindtype: 'reduce_type', | 177 | bindtype: 'reduce_type', |
177 | - selected: '月度扣除', | 178 | + selected: '', |
178 | isblack: 'true', | 179 | isblack: 'true', |
179 | values: ["月度扣除", "年度扣除"], | 180 | values: ["月度扣除", "年度扣除"], |
180 | placeholder: '请选择扣除方式', | 181 | placeholder: '请选择扣除方式', |
@@ -318,14 +319,18 @@ Page({ | @@ -318,14 +319,18 @@ Page({ | ||
318 | onLoad: function(options) { | 319 | onLoad: function(options) { |
319 | var that = this | 320 | var that = this |
320 | console.log("options", options); | 321 | console.log("options", options); |
321 | - this.setData({ | ||
322 | - title: '添加' + options.title, | ||
323 | - cur_index: options.index | ||
324 | - }) | ||
325 | wx.setNavigationBarTitle({ | 322 | wx.setNavigationBarTitle({ |
326 | title: this.data.title, | 323 | title: this.data.title, |
327 | }) | 324 | }) |
328 | - | 325 | + var reduce_typeData = this.data.reducetypeData |
326 | + var deduction_amount = 1200 | ||
327 | + reduce_typeData.selected = '月度扣除' | ||
328 | + this.setData({ | ||
329 | + title: '添加' + options.title, | ||
330 | + cur_index: options.index, | ||
331 | + reducetypeData: reduce_typeData, | ||
332 | + deduction_amount: deduction_amount | ||
333 | + }) | ||
329 | 334 | ||
330 | 335 | ||
331 | this.initOSS() | 336 | this.initOSS() |
@@ -503,11 +508,6 @@ Page({ | @@ -503,11 +508,6 @@ Page({ | ||
503 | newdata.education_period = this.data.childedudegreeData.selected | 508 | newdata.education_period = this.data.childedudegreeData.selected |
504 | newdata.children_nation = "中国" | 509 | newdata.children_nation = "中国" |
505 | newdata.nation = "中国" | 510 | newdata.nation = "中国" |
506 | - newdata.deduction_type = this.data.reducetypeData.selected | ||
507 | - newdata.deduction_amount = '1000' | ||
508 | - if ('年度扣除' == newdata.deduction_type){ | ||
509 | - newdata.deduction_amount = '12000' | ||
510 | - } | ||
511 | break; | 511 | break; |
512 | case '1': | 512 | case '1': |
513 | if (this.data.edutypeData.selected.length < 1) { | 513 | if (this.data.edutypeData.selected.length < 1) { |
@@ -554,11 +554,6 @@ Page({ | @@ -554,11 +554,6 @@ Page({ | ||
554 | newdata.education_type = this.data.edutypeData.selected | 554 | newdata.education_type = this.data.edutypeData.selected |
555 | newdata.education_end = this.data.studystartdate.datelong | 555 | newdata.education_end = this.data.studystartdate.datelong |
556 | newdata.education_start = this.data.studyenddate.datelong | 556 | newdata.education_start = this.data.studyenddate.datelong |
557 | - newdata.deduction_type = this.data.reducetypeData.selected | ||
558 | - newdata.deduction_amount = '' | ||
559 | - if ('年度扣除' == newdata.deduction_type) { | ||
560 | - newdata.deduction_amount = '' | ||
561 | - } | ||
562 | break; | 557 | break; |
563 | case '2': | 558 | case '2': |
564 | if (this.data.supporttypeData.selected.length < 1) { | 559 | if (this.data.supporttypeData.selected.length < 1) { |
@@ -589,11 +584,6 @@ Page({ | @@ -589,11 +584,6 @@ Page({ | ||
589 | 584 | ||
590 | newdata.support_type = this.data.supporttypeData.selected | 585 | newdata.support_type = this.data.supporttypeData.selected |
591 | newdata.older_cardtype = this.data.oldercardtypeData.selected | 586 | newdata.older_cardtype = this.data.oldercardtypeData.selected |
592 | - newdata.deduction_type = this.data.reducetypeData.selected | ||
593 | - newdata.deduction_amount = '' | ||
594 | - if ('年度扣除' == newdata.deduction_type) { | ||
595 | - newdata.deduction_amount = '' | ||
596 | - } | ||
597 | break; | 587 | break; |
598 | case '3': | 588 | case '3': |
599 | if (!formdata.name || formdata.name.length < 1) { | 589 | if (!formdata.name || formdata.name.length < 1) { |
@@ -617,11 +607,6 @@ Page({ | @@ -617,11 +607,6 @@ Page({ | ||
617 | } | 607 | } |
618 | newdata.cardtype = this.data.cardtypeData.selected | 608 | newdata.cardtype = this.data.cardtypeData.selected |
619 | newdata.taxperson_relative = this.data.taxperson_relativeData.selected | 609 | newdata.taxperson_relative = this.data.taxperson_relativeData.selected |
620 | - newdata.deduction_type = this.data.reducetypeData.selected | ||
621 | - newdata.deduction_amount = '' | ||
622 | - if ('年度扣除' == newdata.deduction_type) { | ||
623 | - newdata.deduction_amount = '' | ||
624 | - } | ||
625 | break; | 610 | break; |
626 | case '4': | 611 | case '4': |
627 | console.log('TITLE', this.data.title) | 612 | console.log('TITLE', this.data.title) |
@@ -700,23 +685,19 @@ Page({ | @@ -700,23 +685,19 @@ Page({ | ||
700 | } | 685 | } |
701 | newdata.lover_cardtype = this.data.lovercardtypeData.selected | 686 | newdata.lover_cardtype = this.data.lovercardtypeData.selected |
702 | newdata.lover_birthdate = this.data.loverbirthDate.selected | 687 | newdata.lover_birthdate = this.data.loverbirthDate.selected |
703 | - newdata.deduction_type = this.data.reducetypeData.selected | ||
704 | - newdata.deduction_amount = '' | ||
705 | - if ('年度扣除' == newdata.deduction_type) { | ||
706 | - newdata.deduction_amount = '' | ||
707 | - } | ||
708 | break; | 688 | break; |
709 | } | 689 | } |
710 | 690 | ||
711 | if (this.data.reducetypeData.selected.length < 1) { | 691 | if (this.data.reducetypeData.selected.length < 1) { |
712 | this.showToast('请选择扣除方式') | 692 | this.showToast('请选择扣除方式') |
713 | return | 693 | return |
714 | - } else if (!formdata.reduce_money || formdata.reduce_money.length < 1) { | ||
715 | - this.showToast('请填写扣除金额') | ||
716 | - return | ||
717 | - } | ||
718 | - // newdata.deduction_type = this.data.reducetypeData.selected | ||
719 | - // newdata.deduction_amount = formdata.reduce_money | 694 | + } |
695 | + // else if (!formdata.reduce_money || formdata.reduce_money.length < 1) { | ||
696 | + // this.showToast('请填写扣除金额') | ||
697 | + // return | ||
698 | + // } | ||
699 | + newdata.deduction_type = this.data.reducetypeData.selected | ||
700 | + newdata.deduction_amount = this.data.deduction_amount//formdata.reduce_money | ||
720 | newdata.legal_entity = "" | 701 | newdata.legal_entity = "" |
721 | newdata.legal_entity_id = "" | 702 | newdata.legal_entity_id = "" |
722 | this.addDatas(newdata) | 703 | this.addDatas(newdata) |
@@ -839,9 +820,11 @@ Page({ | @@ -839,9 +820,11 @@ Page({ | ||
839 | break; | 820 | break; |
840 | case 'reduce_type': | 821 | case 'reduce_type': |
841 | var reduce_typeData = this.data.reducetypeData | 822 | var reduce_typeData = this.data.reducetypeData |
823 | + var deduction_amount = 1200 | ||
842 | reduce_typeData.selected = reduce_typeData.values[e.detail.value] | 824 | reduce_typeData.selected = reduce_typeData.values[e.detail.value] |
843 | this.setData({ | 825 | this.setData({ |
844 | - reducetypeData: reduce_typeData | 826 | + reducetypeData: reduce_typeData, |
827 | + deduction_amount: deduction_amount | ||
845 | }) | 828 | }) |
846 | break; | 829 | break; |
847 | case 'edu_type': | 830 | case 'edu_type': |
@@ -223,8 +223,8 @@ | @@ -223,8 +223,8 @@ | ||
223 | <view class='divide_line_f5f5f5'></view> | 223 | <view class='divide_line_f5f5f5'></view> |
224 | <view style='height:90rpx'> | 224 | <view style='height:90rpx'> |
225 | <text class='text_black_30 float_left'>扣除金额</text> | 225 | <text class='text_black_30 float_left'>扣除金额</text> |
226 | - <text wx:if="{{reducetypeData.selected=='月度扣除'}}" class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right;color:#FF9F00;'>¥1000/月</text> | ||
227 | - <text wx:if="{{reducetypeData.selected=='年度扣除'}}" class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right;color:#FF9F00;'>¥12000/年</text> | 226 | + <text wx:if="{{reducetypeData.selected=='月度扣除'}}" class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right;color:#FF9F00;'>¥{{deduction_amount}}/月</text> |
227 | + <text wx:if="{{reducetypeData.selected=='年度扣除'}}" class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right;color:#FF9F00;'>¥{{deduction_amount}}/年</text> | ||
228 | <!-- <input class='input_wrap01 float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#FF9F00;' placeholder='请输入扣除金额' type='digit' name='reduce_money'></input> --> | 228 | <!-- <input class='input_wrap01 float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#FF9F00;' placeholder='请输入扣除金额' type='digit' name='reduce_money'></input> --> |
229 | </view> | 229 | </view> |
230 | <view class='divide_line_f5f5f5'></view> | 230 | <view class='divide_line_f5f5f5'></view> |
请
注册
或
登录
后发表评论