提交 aff078f990fc80e1e897b044cadbbb49f1c076a3
Merge branch 'dev2.0' of http://192.144.137.25:8888/wangyu/naturalPersonTax into dev2.0
正在显示
6 个修改的文件
包含
77 行增加
和
45 行删除
... | ... | @@ -2,11 +2,14 @@ |
2 | 2 | var OSSInit; |
3 | 3 | var app = getApp(); |
4 | 4 | var baseUrl = app.globalData.baseUrl; |
5 | +const AddTypeNames = { 'children_education': '子女教育', 'continuing_education': '继续教育', 'support_duty': '赡养老人', 'medical_fund': '大病医疗', 'house_fund_rent': '住房' } | |
6 | +const Deduce_amounts_month = { 'children_education': 1000, 'continuing_education': '', 'support_duty': '', 'medical_fund': '','house_fund_rent':''} | |
7 | +const Deduce_amounts_year = { 'children_education': 12000, 'continuing_education': '', 'support_duty': '', 'medical_fund': '', 'house_fund_rent': '' } | |
8 | + | |
5 | 9 | Page({ |
6 | 10 | idcard_belong:null,//照片信息获取返回时判断所属 |
7 | - /** | |
8 | - * Page initial data | |
9 | - */ | |
11 | + legal_entity_id: "", | |
12 | + legal_entity:"", | |
10 | 13 | data: { |
11 | 14 | deduction_amount:'', |
12 | 15 | lable: 0, |
... | ... | @@ -14,7 +17,7 @@ Page({ |
14 | 17 | title: '', |
15 | 18 | isIdCard:true, |
16 | 19 | extrainfo_arr: ["请上传子女出生证明、学籍信息凭证、学费凭证、本人结婚证和分摊协议", "请上传学历学籍凭证", "请上传出生证明或关系证明、独生子女证、分摊协议、其他法定赡养人赡养证明", "请上传诊断书和医疗费用收据", "请上传首套房证明、还款证明、不动产登记证、结婚证和夫妻约定抵扣协议"], |
17 | - cur_index: 0, | |
20 | + cur_index: 'children_education', | |
18 | 21 | lovercardtypeData: { |
19 | 22 | label: '身份证件类型', |
20 | 23 | bindtype: 'lovercardtype', |
... | ... | @@ -77,7 +80,7 @@ Page({ |
77 | 80 | childedudegreeData: { |
78 | 81 | label: '子女受教育阶段', |
79 | 82 | isrequre: true, |
80 | - bindtype: 'edu_degree', | |
83 | + bindtype: 'child_edu_degree', | |
81 | 84 | selected: '', |
82 | 85 | isblack: 'true', |
83 | 86 | values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育","硕士研究生教育","博士研究生教育"], |
... | ... | @@ -317,22 +320,36 @@ Page({ |
317 | 320 | * Lifecycle function--Called when page load |
318 | 321 | */ |
319 | 322 | onLoad: function(options) { |
320 | - var that = this | |
323 | + | |
324 | + var pages = getCurrentPages() | |
325 | + var frontPage = pages[pages.length - 2] | |
326 | + console.log('---------frontPage', frontPage.data) | |
321 | 327 | console.log("options", options); |
322 | - wx.setNavigationBarTitle({ | |
323 | - title: this.data.title, | |
324 | - }) | |
328 | + const nameKey = options.status | |
329 | + | |
330 | + this.legal_entity_id = frontPage.data.legal_entity_id | |
331 | + this.legal_entity = frontPage.data.legal_entity | |
332 | + | |
325 | 333 | var reduce_typeData = this.data.reducetypeData |
326 | - var deduction_amount = 1200 | |
327 | - reduce_typeData.selected = '月度扣除' | |
334 | + var deduction_amount | |
335 | + if (options.reducetype == '月度'){ | |
336 | + reduce_typeData.selected = '月度扣除' | |
337 | + deduction_amount = Deduce_amounts_month[nameKey] | |
338 | + }else { | |
339 | + deduction_amount = Deduce_amounts_year[nameKey] | |
340 | + reduce_typeData.selected = '年度扣除' | |
341 | + } | |
342 | + | |
343 | + var title = '添加' + (options.title ? options.title : AddTypeNames[nameKey]) | |
328 | 344 | this.setData({ |
329 | - title: '添加' + options.title, | |
330 | - cur_index: options.index, | |
345 | + title: title, | |
346 | + cur_index: nameKey, | |
331 | 347 | reducetypeData: reduce_typeData, |
332 | 348 | deduction_amount: deduction_amount |
333 | 349 | }) |
334 | - | |
335 | - | |
350 | + wx.setNavigationBarTitle({ | |
351 | + title: title, | |
352 | + }) | |
336 | 353 | this.initOSS() |
337 | 354 | }, |
338 | 355 | |
... | ... | @@ -446,7 +463,7 @@ Page({ |
446 | 463 | var formdata = e.detail.value |
447 | 464 | var newdata = formdata; |
448 | 465 | switch (this.data.cur_index + '') { |
449 | - case '0': | |
466 | + case 'children_education': | |
450 | 467 | if (!formdata.children_id_card_no || formdata.children_id_card_no.length < 1) { |
451 | 468 | this.showToast('请填写子女证件号码') |
452 | 469 | return |
... | ... | @@ -462,6 +479,8 @@ Page({ |
462 | 479 | if (!formdata.percent || formdata.percent.length < 1) { |
463 | 480 | this.showToast('请填写扣除分配比例') |
464 | 481 | return |
482 | + }else{ | |
483 | + newdata.percent = parseFloat(formdata.percent) | |
465 | 484 | } |
466 | 485 | if (!formdata.children_student_no || formdata.children_student_no.length < 1) { |
467 | 486 | this.showToast('请填写学籍号') |
... | ... | @@ -491,25 +510,24 @@ Page({ |
491 | 510 | this.showToast('请选择配偶出生日期') |
492 | 511 | return |
493 | 512 | } |
494 | - if (this.data.taxperson_relativeData.selected.length < 1) { | |
495 | - this.showToast('请选择与纳税人关系') | |
496 | - return | |
497 | - } | |
513 | + // if (this.data.taxperson_relativeData.selected.length < 1) { | |
514 | + // this.showToast('请选择与纳税人关系') | |
515 | + // return | |
516 | + // } | |
498 | 517 | |
499 | 518 | } |
500 | - | |
501 | - newdata.spouse_id_card_type = '1'//this.data.lovercardtypeData.selected | |
502 | - newdata.spouse_birthday = this.data.loverbirthDate.selected | |
503 | 519 | newdata.relationship = this.data.taxperson_relativeData.selected |
504 | 520 | newdata.children_id_card_type = '1'//this.data.childrencardtypeData.selected |
505 | - newdata.children_birthday = this.data.childrenbirthDate.selected | |
521 | + newdata.children_birthday = this.data.childrenbirthDate.datelong | |
506 | 522 | newdata.education_end = this.data.studystartdate.datelong |
507 | 523 | newdata.education_start = this.data.studyenddate.datelong |
508 | 524 | newdata.education_period = this.data.childedudegreeData.selected |
509 | 525 | newdata.children_nation = "中国" |
526 | + newdata.spouse_id_card_type = '1'//this.data.lovercardtypeData.selected | |
527 | + newdata.spouse_birthday = this.data.loverbirthDate.selected | |
510 | 528 | newdata.nation = "中国" |
511 | 529 | break; |
512 | - case '1': | |
530 | + case 'continuing_education': | |
513 | 531 | if (this.data.edutypeData.selected.length < 1) { |
514 | 532 | this.showToast('请选择教育类型') |
515 | 533 | return |
... | ... | @@ -555,7 +573,7 @@ Page({ |
555 | 573 | newdata.education_end = this.data.studystartdate.datelong |
556 | 574 | newdata.education_start = this.data.studyenddate.datelong |
557 | 575 | break; |
558 | - case '2': | |
576 | + case 'support_duty': | |
559 | 577 | if (this.data.supporttypeData.selected.length < 1) { |
560 | 578 | this.showToast('请选择赡养类型') |
561 | 579 | return |
... | ... | @@ -585,7 +603,7 @@ Page({ |
585 | 603 | newdata.support_type = this.data.supporttypeData.selected |
586 | 604 | newdata.older_cardtype = this.data.oldercardtypeData.selected |
587 | 605 | break; |
588 | - case '3': | |
606 | + case 'medical_fund': | |
589 | 607 | if (!formdata.name || formdata.name.length < 1) { |
590 | 608 | this.showToast('请填写姓名') |
591 | 609 | return |
... | ... | @@ -608,7 +626,7 @@ Page({ |
608 | 626 | newdata.cardtype = this.data.cardtypeData.selected |
609 | 627 | newdata.taxperson_relative = this.data.taxperson_relativeData.selected |
610 | 628 | break; |
611 | - case '4': | |
629 | + case 'house_fund_rent': | |
612 | 630 | console.log('TITLE', this.data.title) |
613 | 631 | if (!formdata.lover_name || formdata.lover_name.length < 1) { |
614 | 632 | this.showToast('请填写配偶姓名') |
... | ... | @@ -698,8 +716,8 @@ Page({ |
698 | 716 | // } |
699 | 717 | newdata.deduction_type = this.data.reducetypeData.selected |
700 | 718 | newdata.deduction_amount = this.data.deduction_amount//formdata.reduce_money |
701 | - newdata.legal_entity = "" | |
702 | - newdata.legal_entity_id = "" | |
719 | + newdata.legal_entity_id = this.legal_entity_id | |
720 | + newdata.legal_entity = this.legal_entity | |
703 | 721 | this.addDatas(newdata) |
704 | 722 | }, |
705 | 723 | |
... | ... | @@ -769,6 +787,7 @@ Page({ |
769 | 787 | case 'childrenbirthday': |
770 | 788 | var children_birthDate = this.data.childrenbirthDate |
771 | 789 | children_birthDate.selected = e.detail.value |
790 | + children_birthDate.datelong = (Date.parse(new Date(e.detail.value)) / 1000) | |
772 | 791 | this.setData({ |
773 | 792 | childrenbirthDate: children_birthDate |
774 | 793 | }) |
... | ... | @@ -789,6 +808,13 @@ Page({ |
789 | 808 | studyenddate: study_enddate |
790 | 809 | }) |
791 | 810 | break; |
811 | + case 'child_edu_degree': | |
812 | + var childedudegreeData = this.data.childedudegreeData | |
813 | + childedudegreeData.selected = childedudegreeData.values[e.detail.value] | |
814 | + this.setData({ | |
815 | + childedudegreeData: childedudegreeData | |
816 | + }) | |
817 | + break; | |
792 | 818 | case 'edu_degree': |
793 | 819 | var edudegree_data = this.data.edudegreeData |
794 | 820 | edudegree_data.selected = edudegree_data.values[e.detail.value] |
... | ... | @@ -820,7 +846,12 @@ Page({ |
820 | 846 | break; |
821 | 847 | case 'reduce_type': |
822 | 848 | var reduce_typeData = this.data.reducetypeData |
823 | - var deduction_amount = 1200 | |
849 | + var deduction_amount | |
850 | + if (e.detail.value == '0') { | |
851 | + deduction_amount = Deduce_amounts_month[this.data.cur_index] | |
852 | + } else { | |
853 | + deduction_amount = Deduce_amounts_year[this.data.cur_indexfan] | |
854 | + } | |
824 | 855 | reduce_typeData.selected = reduce_typeData.values[e.detail.value] |
825 | 856 | this.setData({ |
826 | 857 | reducetypeData: reduce_typeData, |
... | ... |
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <view class='page'> |
5 | 5 | <form bindsubmit='formSubmit'> |
6 | 6 | <!-- 添加子女 --> |
7 | - <view wx:if="{{cur_index==0}}"> | |
7 | + <view wx:if="{{cur_index=='children_education'}}"> | |
8 | 8 | <view style='padding:0 30rpx;'> |
9 | 9 | <template is="picker_cell_normal" data="{{...childrencardtypeData}}" /> |
10 | 10 | <view class='divide_line_f5f5f5'></view> |
... | ... | @@ -41,14 +41,14 @@ |
41 | 41 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
42 | 42 | <text class='text_black_30 float_left'>分配比例</text> |
43 | 43 | <text class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right'>%</text> |
44 | - <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入分配比例' name='reduce_ratio'></input> | |
44 | + <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入分配比例' type='number' name='percent'></input> | |
45 | 45 | </view> |
46 | 46 | |
47 | 47 | <view class='divide_line_f5f5f5'></view> |
48 | 48 | <view style='height:90rpx'> |
49 | 49 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
50 | 50 | <text class='text_black_30 float_left'>子女学籍号</text> |
51 | - <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入子女学籍号' name='children_schoolno'></input> | |
51 | + <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入子女学籍号' name='children_student_no'></input> | |
52 | 52 | </view> |
53 | 53 | <view class='divide_line_f5f5f5'></view> |
54 | 54 | |
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | </view> |
64 | 64 | </view> |
65 | 65 | <!-- 继续教育 --> |
66 | - <view wx:if="{{cur_index==1}}" style='padding:0 30rpx;'> | |
66 | + <view wx:if="{{cur_index=='continuing_education'}}" style='padding:0 30rpx;'> | |
67 | 67 | |
68 | 68 | <template is="picker_cell_normal" data="{{...edutypeData}}" /> |
69 | 69 | <view class='divide_line_f5f5f5'></view> |
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | |
101 | 101 | </view> |
102 | 102 | <!-- 赡养老人 --> |
103 | - <view wx:if="{{cur_index==2}}" style='padding:0 30rpx;'> | |
103 | + <view wx:if="{{cur_index=='support_duty'}}" style='padding:0 30rpx;'> | |
104 | 104 | <template is="picker_cell_normal" data="{{...supporttypeData}}" /> |
105 | 105 | <view class='divide_line_f5f5f5'></view> |
106 | 106 | <view style='height:90rpx'> |
... | ... | @@ -133,7 +133,7 @@ |
133 | 133 | </view> --> |
134 | 134 | </view> |
135 | 135 | <!-- 大病医疗 --> |
136 | - <view wx:if="{{cur_index==3}}" style='padding:0 30rpx;'> | |
136 | + <view wx:if="{{cur_index=='medical_fund'}}" style='padding:0 30rpx;'> | |
137 | 137 | <view style='height:90rpx'> |
138 | 138 | <text class='text_black_30 float_left'>姓名</text> |
139 | 139 | <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入姓名' name='name'></input> |
... | ... | @@ -160,7 +160,7 @@ |
160 | 160 | </view> |
161 | 161 | </view> |
162 | 162 | <!-- 住房 --> |
163 | - <view wx:if="{{cur_index==4}}" style='padding:0 30rpx;'> | |
163 | + <view wx:if="{{cur_index=='house_fund_rent'}}" style='padding:0 30rpx;'> | |
164 | 164 | |
165 | 165 | <view wx:if="{{title=='添加住房贷款利息'}}"> |
166 | 166 | |
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | |
236 | 236 | <view style='padding:0 30rpx;'> |
237 | 237 | |
238 | - <view wx:if="{{cur_index==0}}"> | |
238 | + <view wx:if="{{cur_index=='children_education'}}"> | |
239 | 239 | <view style='height:90rpx'> |
240 | 240 | <text class='text_black_30 float_left'>配偶姓名</text> |
241 | 241 | <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}'></input> |
... | ... | @@ -267,7 +267,7 @@ |
267 | 267 | </view> |
268 | 268 | </view> |
269 | 269 | |
270 | - <view wx:if="{{cur_index==4}}"> | |
270 | + <view wx:if="{{cur_index=='house_fund_rent'}}"> | |
271 | 271 | <view style='height:90rpx'> |
272 | 272 | <text class='text_black_30 float_left'>配偶姓名</text> |
273 | 273 | <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}'></input> |
... | ... |
... | ... | @@ -49,7 +49,7 @@ Page({ |
49 | 49 | console.log("lookandadd", e); |
50 | 50 | if (this.data.additiondata.options && this.data.additiondata.options.length>0){ |
51 | 51 | wx.navigateTo({ |
52 | - url: '../lookandupdate/lookandupdate?status=' + this.data.additiondata.options[e.currentTarget.id] + "&legal_entity_id=" + this.data.additiondata.legal_entity_id, | |
52 | + url: '../lookandupdate/lookandupdate?status=' + this.data.additiondata.options[e.currentTarget.id] + "&legal_entity_id=" + this.data.additiondata.legal_entity_id + "&legal_entity=" + this.data.additiondata.legal_entity, | |
53 | 53 | }) |
54 | 54 | } |
55 | 55 | |
... | ... |
... | ... | @@ -61,7 +61,7 @@ Page({ |
61 | 61 | console.log("lookandadd", str); |
62 | 62 | |
63 | 63 | wx.navigateTo({ |
64 | - url: 'lookandupdate/lookandupdate?status=' + data[str[0]].addition_items[str[1]].addition_category + "&legal_entity_id=" + data[str[0]].legal_entity_id, | |
64 | + url: 'lookandupdate/lookandupdate?status=' + data[str[0]].addition_items[str[1]].addition_category + "&legal_entity_id=" + data[str[0]].legal_entity_id + "&legal_entity=" + data[str[0]].legal_entity, | |
65 | 65 | }) |
66 | 66 | }, |
67 | 67 | |
... | ... |
... | ... | @@ -10,6 +10,7 @@ Page({ |
10 | 10 | data: { |
11 | 11 | cur_status: "", |
12 | 12 | legal_entity_id: "", |
13 | + legal_entity:"", | |
13 | 14 | declareStatus: { |
14 | 15 | "to_declare ": "待申报", |
15 | 16 | "declaring": "申报中", |
... | ... | @@ -80,7 +81,8 @@ Page({ |
80 | 81 | console.log("options", options); |
81 | 82 | this.setData({ |
82 | 83 | cur_status: options.status, |
83 | - legal_entity_id: options.legal_entity_id | |
84 | + legal_entity_id: options.legal_entity_id, | |
85 | + legal_entity: options.legal_entity | |
84 | 86 | }) |
85 | 87 | wx.setNavigationBarTitle({ |
86 | 88 | "title": that.data.additiontitle[options.status], |
... | ... |
... | ... | @@ -302,11 +302,10 @@ Page({ |
302 | 302 | console.log("form_data", formdata); |
303 | 303 | var Authorization = app.globalData.Authorization; |
304 | 304 | var url = baseUrl + 'persontax/v1/personal-taxes', method = "POST" |
305 | - if (this.cur_id.length){ | |
305 | + if (this.cur_id && this.cur_id.length){ | |
306 | 306 | url = baseUrl + 'persontax/v1/personal-taxes/' + this.cur_id |
307 | 307 | method = "PUT" |
308 | 308 | } |
309 | - console.log('this.cur_id', this.cur_id) | |
310 | 309 | wx.showLoading({ |
311 | 310 | title: '', |
312 | 311 | }) |
... | ... |
请
注册
或
登录
后发表评论