提交 fe685e4d2a3345f9a9b5f8835b0e2484da0e3cbd

作者 pangy
1 个父辈 12f05a5a

1、法务实体字段

2、子女教育(新添)
@@ -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,
@@ -41,14 +41,14 @@ @@ -41,14 +41,14 @@
41 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 41 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
42 <text class='text_black_30 float_left'>分配比例</text> 42 <text class='text_black_30 float_left'>分配比例</text>
43 <text class='text_black_30 float_right' style='line-height: 90rpx;margin-left:20rpx;text-align: right'>%</text> 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 </view> 45 </view>
46 46
47 <view class='divide_line_f5f5f5'></view> 47 <view class='divide_line_f5f5f5'></view>
48 <view style='height:90rpx'> 48 <view style='height:90rpx'>
49 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> 49 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
50 <text class='text_black_30 float_left'>子女学籍号</text> 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 </view> 52 </view>
53 <view class='divide_line_f5f5f5'></view> 53 <view class='divide_line_f5f5f5'></view>
54 54
@@ -49,7 +49,7 @@ Page({ @@ -49,7 +49,7 @@ Page({
49 console.log("lookandadd", e); 49 console.log("lookandadd", e);
50 if (this.data.additiondata.options && this.data.additiondata.options.length>0){ 50 if (this.data.additiondata.options && this.data.additiondata.options.length>0){
51 wx.navigateTo({ 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,7 +61,7 @@ Page({
61 console.log("lookandadd", str); 61 console.log("lookandadd", str);
62 62
63 wx.navigateTo({ 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,6 +10,7 @@ Page({
10 data: { 10 data: {
11 cur_status: "", 11 cur_status: "",
12 legal_entity_id: "", 12 legal_entity_id: "",
  13 + legal_entity:"",
13 declareStatus: { 14 declareStatus: {
14 "to_declare ": "待申报", 15 "to_declare ": "待申报",
15 "declaring": "申报中", 16 "declaring": "申报中",
@@ -80,7 +81,8 @@ Page({ @@ -80,7 +81,8 @@ Page({
80 console.log("options", options); 81 console.log("options", options);
81 this.setData({ 82 this.setData({
82 cur_status: options.status, 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 wx.setNavigationBarTitle({ 87 wx.setNavigationBarTitle({
86 "title": that.data.additiontitle[options.status], 88 "title": that.data.additiontitle[options.status],
@@ -302,11 +302,10 @@ Page({ @@ -302,11 +302,10 @@ Page({
302 console.log("form_data", formdata); 302 console.log("form_data", formdata);
303 var Authorization = app.globalData.Authorization; 303 var Authorization = app.globalData.Authorization;
304 var url = baseUrl + 'persontax/v1/personal-taxes', method = "POST" 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 url = baseUrl + 'persontax/v1/personal-taxes/' + this.cur_id 306 url = baseUrl + 'persontax/v1/personal-taxes/' + this.cur_id
307 method = "PUT" 307 method = "PUT"
308 } 308 }
309 - console.log('this.cur_id', this.cur_id)  
310 wx.showLoading({ 309 wx.showLoading({
311 title: '', 310 title: '',
312 }) 311 })
注册登录 后发表评论