...
|
...
|
@@ -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,
|
...
|
...
|
|