正在显示
2 个修改的文件
包含
23 行增加
和
40 行删除
... | ... | @@ -8,6 +8,7 @@ Page({ |
8 | 8 | * Page initial data |
9 | 9 | */ |
10 | 10 | data: { |
11 | + deduction_amount:'', | |
11 | 12 | lable: 0, |
12 | 13 | datas02: [], |
13 | 14 | title: '', |
... | ... | @@ -174,7 +175,7 @@ Page({ |
174 | 175 | reducetypeData: { |
175 | 176 | label: '扣除方式', |
176 | 177 | bindtype: 'reduce_type', |
177 | - selected: '月度扣除', | |
178 | + selected: '', | |
178 | 179 | isblack: 'true', |
179 | 180 | values: ["月度扣除", "年度扣除"], |
180 | 181 | placeholder: '请选择扣除方式', |
... | ... | @@ -318,14 +319,18 @@ Page({ |
318 | 319 | onLoad: function(options) { |
319 | 320 | var that = this |
320 | 321 | console.log("options", options); |
321 | - this.setData({ | |
322 | - title: '添加' + options.title, | |
323 | - cur_index: options.index | |
324 | - }) | |
325 | 322 | wx.setNavigationBarTitle({ |
326 | 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 | 336 | this.initOSS() |
... | ... | @@ -503,11 +508,6 @@ Page({ |
503 | 508 | newdata.education_period = this.data.childedudegreeData.selected |
504 | 509 | newdata.children_nation = "中国" |
505 | 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 | 511 | break; |
512 | 512 | case '1': |
513 | 513 | if (this.data.edutypeData.selected.length < 1) { |
... | ... | @@ -554,11 +554,6 @@ Page({ |
554 | 554 | newdata.education_type = this.data.edutypeData.selected |
555 | 555 | newdata.education_end = this.data.studystartdate.datelong |
556 | 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 | 557 | break; |
563 | 558 | case '2': |
564 | 559 | if (this.data.supporttypeData.selected.length < 1) { |
... | ... | @@ -589,11 +584,6 @@ Page({ |
589 | 584 | |
590 | 585 | newdata.support_type = this.data.supporttypeData.selected |
591 | 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 | 587 | break; |
598 | 588 | case '3': |
599 | 589 | if (!formdata.name || formdata.name.length < 1) { |
... | ... | @@ -617,11 +607,6 @@ Page({ |
617 | 607 | } |
618 | 608 | newdata.cardtype = this.data.cardtypeData.selected |
619 | 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 | 610 | break; |
626 | 611 | case '4': |
627 | 612 | console.log('TITLE', this.data.title) |
... | ... | @@ -700,23 +685,19 @@ Page({ |
700 | 685 | } |
701 | 686 | newdata.lover_cardtype = this.data.lovercardtypeData.selected |
702 | 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 | 688 | break; |
709 | 689 | } |
710 | 690 | |
711 | 691 | if (this.data.reducetypeData.selected.length < 1) { |
712 | 692 | this.showToast('请选择扣除方式') |
713 | 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 | 701 | newdata.legal_entity = "" |
721 | 702 | newdata.legal_entity_id = "" |
722 | 703 | this.addDatas(newdata) |
... | ... | @@ -839,9 +820,11 @@ Page({ |
839 | 820 | break; |
840 | 821 | case 'reduce_type': |
841 | 822 | var reduce_typeData = this.data.reducetypeData |
823 | + var deduction_amount = 1200 | |
842 | 824 | reduce_typeData.selected = reduce_typeData.values[e.detail.value] |
843 | 825 | this.setData({ |
844 | - reducetypeData: reduce_typeData | |
826 | + reducetypeData: reduce_typeData, | |
827 | + deduction_amount: deduction_amount | |
845 | 828 | }) |
846 | 829 | break; |
847 | 830 | case 'edu_type': | ... | ... |
... | ... | @@ -223,8 +223,8 @@ |
223 | 223 | <view class='divide_line_f5f5f5'></view> |
224 | 224 | <view style='height:90rpx'> |
225 | 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 | 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 | 229 | </view> |
230 | 230 | <view class='divide_line_f5f5f5'></view> | ... | ... |
请
注册
或
登录
后发表评论