提交 fe685e4d2a3345f9a9b5f8835b0e2484da0e3cbd

作者 pangy
1 个父辈 12f05a5a

1、法务实体字段

2、子女教育(新添)
... ... @@ -2,9 +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 11 legal_entity_id: "",
  12 + legal_entity:"",
8 13 data: {
9 14 deduction_amount:'',
10 15 lable: 0,
... ... @@ -75,7 +80,7 @@ Page({
75 80 childedudegreeData: {
76 81 label: '子女受教育阶段',
77 82 isrequre: true,
78   - bindtype: 'edu_degree',
  83 + bindtype: 'child_edu_degree',
79 84 selected: '',
80 85 isblack: 'true',
81 86 values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育","硕士研究生教育","博士研究生教育"],
... ... @@ -315,22 +320,36 @@ Page({
315 320 * Lifecycle function--Called when page load
316 321 */
317 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 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 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 344 this.setData({
328   - title: '添加' + options.title,
329   - cur_index: options.status,
  345 + title: title,
  346 + cur_index: nameKey,
330 347 reducetypeData: reduce_typeData,
331 348 deduction_amount: deduction_amount
332 349 })
333   -
  350 + wx.setNavigationBarTitle({
  351 + title: title,
  352 + })
334 353 this.initOSS()
335 354 },
336 355
... ... @@ -460,6 +479,8 @@ Page({
460 479 if (!formdata.percent || formdata.percent.length < 1) {
461 480 this.showToast('请填写扣除分配比例')
462 481 return
  482 + }else{
  483 + newdata.percent = parseFloat(formdata.percent)
463 484 }
464 485 if (!formdata.children_student_no || formdata.children_student_no.length < 1) {
465 486 this.showToast('请填写学籍号')
... ... @@ -489,22 +510,21 @@ Page({
489 510 this.showToast('请选择配偶出生日期')
490 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 519 newdata.relationship = this.data.taxperson_relativeData.selected
502 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 522 newdata.education_end = this.data.studystartdate.datelong
505 523 newdata.education_start = this.data.studyenddate.datelong
506 524 newdata.education_period = this.data.childedudegreeData.selected
507 525 newdata.children_nation = "中国"
  526 + newdata.spouse_id_card_type = '1'//this.data.lovercardtypeData.selected
  527 + newdata.spouse_birthday = this.data.loverbirthDate.selected
508 528 newdata.nation = "中国"
509 529 break;
510 530 case 'continuing_education':
... ... @@ -696,8 +716,8 @@ Page({
696 716 // }
697 717 newdata.deduction_type = this.data.reducetypeData.selected
698 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 721 this.addDatas(newdata)
702 722 },
703 723
... ... @@ -767,6 +787,7 @@ Page({
767 787 case 'childrenbirthday':
768 788 var children_birthDate = this.data.childrenbirthDate
769 789 children_birthDate.selected = e.detail.value
  790 + children_birthDate.datelong = (Date.parse(new Date(e.detail.value)) / 1000)
770 791 this.setData({
771 792 childrenbirthDate: children_birthDate
772 793 })
... ... @@ -787,6 +808,13 @@ Page({
787 808 studyenddate: study_enddate
788 809 })
789 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 818 case 'edu_degree':
791 819 var edudegree_data = this.data.edudegreeData
792 820 edudegree_data.selected = edudegree_data.values[e.detail.value]
... ... @@ -818,7 +846,12 @@ Page({
818 846 break;
819 847 case 'reduce_type':
820 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 855 reduce_typeData.selected = reduce_typeData.values[e.detail.value]
823 856 this.setData({
824 857 reducetypeData: reduce_typeData,
... ...
... ... @@ -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
... ...
... ... @@ -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 })
... ...
注册登录 后发表评论