|
@@ -2,9 +2,14 @@ |
|
@@ -2,9 +2,14 @@ |
2
|
var OSSInit;
|
2
|
var OSSInit;
|
3
|
var app = getApp();
|
3
|
var app = getApp();
|
4
|
var baseUrl = app.globalData.baseUrl;
|
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
|
Page({
|
9
|
Page({
|
6
|
idcard_belong:null,//照片信息获取返回时判断所属
|
10
|
idcard_belong:null,//照片信息获取返回时判断所属
|
7
|
legal_entity_id: "",
|
11
|
legal_entity_id: "",
|
|
|
12
|
+ legal_entity:"",
|
8
|
data: {
|
13
|
data: {
|
9
|
deduction_amount:'',
|
14
|
deduction_amount:'',
|
10
|
lable: 0,
|
15
|
lable: 0,
|
|
@@ -75,7 +80,7 @@ Page({ |
|
@@ -75,7 +80,7 @@ Page({ |
75
|
childedudegreeData: {
|
80
|
childedudegreeData: {
|
76
|
label: '子女受教育阶段',
|
81
|
label: '子女受教育阶段',
|
77
|
isrequre: true,
|
82
|
isrequre: true,
|
78
|
- bindtype: 'edu_degree',
|
83
|
+ bindtype: 'child_edu_degree',
|
79
|
selected: '',
|
84
|
selected: '',
|
80
|
isblack: 'true',
|
85
|
isblack: 'true',
|
81
|
values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育","硕士研究生教育","博士研究生教育"],
|
86
|
values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育","硕士研究生教育","博士研究生教育"],
|
|
@@ -315,22 +320,36 @@ Page({ |
|
@@ -315,22 +320,36 @@ Page({ |
315
|
* Lifecycle function--Called when page load
|
320
|
* Lifecycle function--Called when page load
|
316
|
*/
|
321
|
*/
|
317
|
onLoad: function(options) {
|
322
|
onLoad: function(options) {
|
318
|
- var that = this
|
323
|
+
|
|
|
324
|
+ var pages = getCurrentPages()
|
|
|
325
|
+ var frontPage = pages[pages.length - 2]
|
|
|
326
|
+ console.log('---------frontPage', frontPage.data)
|
319
|
console.log("options", options);
|
327
|
console.log("options", options);
|
320
|
- wx.setNavigationBarTitle({
|
|
|
321
|
- title: this.data.title,
|
|
|
322
|
- })
|
|
|
323
|
- this.legal_entity_id = options.legal_entity_id
|
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
|
+
|
324
|
var reduce_typeData = this.data.reducetypeData
|
333
|
var reduce_typeData = this.data.reducetypeData
|
325
|
- var deduction_amount = 1200
|
|
|
326
|
- 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])
|
327
|
this.setData({
|
344
|
this.setData({
|
328
|
- title: '添加' + options.title,
|
|
|
329
|
- cur_index: options.status,
|
345
|
+ title: title,
|
|
|
346
|
+ cur_index: nameKey,
|
330
|
reducetypeData: reduce_typeData,
|
347
|
reducetypeData: reduce_typeData,
|
331
|
deduction_amount: deduction_amount
|
348
|
deduction_amount: deduction_amount
|
332
|
})
|
349
|
})
|
333
|
-
|
350
|
+ wx.setNavigationBarTitle({
|
|
|
351
|
+ title: title,
|
|
|
352
|
+ })
|
334
|
this.initOSS()
|
353
|
this.initOSS()
|
335
|
},
|
354
|
},
|
336
|
|
355
|
|
|
@@ -460,6 +479,8 @@ Page({ |
|
@@ -460,6 +479,8 @@ Page({ |
460
|
if (!formdata.percent || formdata.percent.length < 1) {
|
479
|
if (!formdata.percent || formdata.percent.length < 1) {
|
461
|
this.showToast('请填写扣除分配比例')
|
480
|
this.showToast('请填写扣除分配比例')
|
462
|
return
|
481
|
return
|
|
|
482
|
+ }else{
|
|
|
483
|
+ newdata.percent = parseFloat(formdata.percent)
|
463
|
}
|
484
|
}
|
464
|
if (!formdata.children_student_no || formdata.children_student_no.length < 1) {
|
485
|
if (!formdata.children_student_no || formdata.children_student_no.length < 1) {
|
465
|
this.showToast('请填写学籍号')
|
486
|
this.showToast('请填写学籍号')
|
|
@@ -489,22 +510,21 @@ Page({ |
|
@@ -489,22 +510,21 @@ Page({ |
489
|
this.showToast('请选择配偶出生日期')
|
510
|
this.showToast('请选择配偶出生日期')
|
490
|
return
|
511
|
return
|
491
|
}
|
512
|
}
|
492
|
- if (this.data.taxperson_relativeData.selected.length < 1) {
|
|
|
493
|
- this.showToast('请选择与纳税人关系')
|
|
|
494
|
- return
|
|
|
495
|
- }
|
513
|
+ // if (this.data.taxperson_relativeData.selected.length < 1) {
|
|
|
514
|
+ // this.showToast('请选择与纳税人关系')
|
|
|
515
|
+ // return
|
|
|
516
|
+ // }
|
496
|
|
517
|
|
497
|
}
|
518
|
}
|
498
|
-
|
|
|
499
|
- newdata.spouse_id_card_type = '1'//this.data.lovercardtypeData.selected
|
|
|
500
|
- newdata.spouse_birthday = this.data.loverbirthDate.selected
|
|
|
501
|
newdata.relationship = this.data.taxperson_relativeData.selected
|
519
|
newdata.relationship = this.data.taxperson_relativeData.selected
|
502
|
newdata.children_id_card_type = '1'//this.data.childrencardtypeData.selected
|
520
|
newdata.children_id_card_type = '1'//this.data.childrencardtypeData.selected
|
503
|
- newdata.children_birthday = this.data.childrenbirthDate.selected
|
521
|
+ newdata.children_birthday = this.data.childrenbirthDate.datelong
|
504
|
newdata.education_end = this.data.studystartdate.datelong
|
522
|
newdata.education_end = this.data.studystartdate.datelong
|
505
|
newdata.education_start = this.data.studyenddate.datelong
|
523
|
newdata.education_start = this.data.studyenddate.datelong
|
506
|
newdata.education_period = this.data.childedudegreeData.selected
|
524
|
newdata.education_period = this.data.childedudegreeData.selected
|
507
|
newdata.children_nation = "中国"
|
525
|
newdata.children_nation = "中国"
|
|
|
526
|
+ newdata.spouse_id_card_type = '1'//this.data.lovercardtypeData.selected
|
|
|
527
|
+ newdata.spouse_birthday = this.data.loverbirthDate.selected
|
508
|
newdata.nation = "中国"
|
528
|
newdata.nation = "中国"
|
509
|
break;
|
529
|
break;
|
510
|
case 'continuing_education':
|
530
|
case 'continuing_education':
|
|
@@ -696,8 +716,8 @@ Page({ |
|
@@ -696,8 +716,8 @@ Page({ |
696
|
// }
|
716
|
// }
|
697
|
newdata.deduction_type = this.data.reducetypeData.selected
|
717
|
newdata.deduction_type = this.data.reducetypeData.selected
|
698
|
newdata.deduction_amount = this.data.deduction_amount//formdata.reduce_money
|
718
|
newdata.deduction_amount = this.data.deduction_amount//formdata.reduce_money
|
699
|
- newdata.legal_entity = ""
|
|
|
700
|
- newdata.legal_entity_id = ""
|
719
|
+ newdata.legal_entity_id = this.legal_entity_id
|
|
|
720
|
+ newdata.legal_entity = this.legal_entity
|
701
|
this.addDatas(newdata)
|
721
|
this.addDatas(newdata)
|
702
|
},
|
722
|
},
|
703
|
|
723
|
|
|
@@ -767,6 +787,7 @@ Page({ |
|
@@ -767,6 +787,7 @@ Page({ |
767
|
case 'childrenbirthday':
|
787
|
case 'childrenbirthday':
|
768
|
var children_birthDate = this.data.childrenbirthDate
|
788
|
var children_birthDate = this.data.childrenbirthDate
|
769
|
children_birthDate.selected = e.detail.value
|
789
|
children_birthDate.selected = e.detail.value
|
|
|
790
|
+ children_birthDate.datelong = (Date.parse(new Date(e.detail.value)) / 1000)
|
770
|
this.setData({
|
791
|
this.setData({
|
771
|
childrenbirthDate: children_birthDate
|
792
|
childrenbirthDate: children_birthDate
|
772
|
})
|
793
|
})
|
|
@@ -787,6 +808,13 @@ Page({ |
|
@@ -787,6 +808,13 @@ Page({ |
787
|
studyenddate: study_enddate
|
808
|
studyenddate: study_enddate
|
788
|
})
|
809
|
})
|
789
|
break;
|
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;
|
790
|
case 'edu_degree':
|
818
|
case 'edu_degree':
|
791
|
var edudegree_data = this.data.edudegreeData
|
819
|
var edudegree_data = this.data.edudegreeData
|
792
|
edudegree_data.selected = edudegree_data.values[e.detail.value]
|
820
|
edudegree_data.selected = edudegree_data.values[e.detail.value]
|
|
@@ -818,7 +846,12 @@ Page({ |
|
@@ -818,7 +846,12 @@ Page({ |
818
|
break;
|
846
|
break;
|
819
|
case 'reduce_type':
|
847
|
case 'reduce_type':
|
820
|
var reduce_typeData = this.data.reducetypeData
|
848
|
var reduce_typeData = this.data.reducetypeData
|
821
|
- 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
|
+ }
|
822
|
reduce_typeData.selected = reduce_typeData.values[e.detail.value]
|
855
|
reduce_typeData.selected = reduce_typeData.values[e.detail.value]
|
823
|
this.setData({
|
856
|
this.setData({
|
824
|
reducetypeData: reduce_typeData,
|
857
|
reducetypeData: reduce_typeData,
|