提交 8229ed527dabd715f5d113a3a73b5475ada86a05

作者 pangy
1 个父辈 fdffcbc5

子女教育 日期优化

@@ -311,10 +311,10 @@ Page({ @@ -311,10 +311,10 @@ Page({
311 // end: (new Date()).getFullYear() + '-09-01', 311 // end: (new Date()).getFullYear() + '-09-01',
312 // onTap: 'studyDataTap' 312 // onTap: 'studyDataTap'
313 }, 313 },
314 - studyCompleteDate: { 314 + studyEndDate: {
315 label: '受教育时间止', 315 label: '受教育时间止',
316 isrequre: true, 316 isrequre: true,
317 - bindtype: 'study_comp_date', 317 + bindtype: 'study_end_date',
318 selected: '', 318 selected: '',
319 isblack: 'true', 319 isblack: 'true',
320 values: ["是", "否"], 320 values: ["是", "否"],
@@ -327,10 +327,10 @@ Page({ @@ -327,10 +327,10 @@ Page({
327 // end: (new Date()).getFullYear() + '-09-01', 327 // end: (new Date()).getFullYear() + '-09-01',
328 // onTap: 'studyDataTap' 328 // onTap: 'studyDataTap'
329 }, 329 },
330 - studyenddate: { 330 + studyPeriodDate: {
331 label: '教育终止时间', 331 label: '教育终止时间',
332 // isrequre: true, 332 // isrequre: true,
333 - bindtype: 'study_end_date', 333 + bindtype: 'study_per_date',
334 selected: '', 334 selected: '',
335 values: ["是", "否"], 335 values: ["是", "否"],
336 placeholder: '请选择时间', 336 placeholder: '请选择时间',
@@ -564,12 +564,12 @@ Page({ @@ -564,12 +564,12 @@ Page({
564 this.getCertificates() 564 this.getCertificates()
565 var studystart_date = this.data.studystartdate 565 var studystart_date = this.data.studystartdate
566 studystart_date.label = "入学时间起" 566 studystart_date.label = "入学时间起"
567 - var studyend_date = this.data.studyenddate 567 + var studyend_date = this.data.studyEndDate
568 studyend_date.label = "(预计)毕业时间" 568 studyend_date.label = "(预计)毕业时间"
569 studyend_date.isrequre = true 569 studyend_date.isrequre = true
570 this.setData({ 570 this.setData({
571 studystartdate: studystart_date, 571 studystartdate: studystart_date,
572 - studyenddate: studyend_date 572 + studyEndDate: studyend_date
573 }) 573 })
574 } else if ("medical_fund" == options.status) { 574 } else if ("medical_fund" == options.status) {
575 var cardtype_data = this.data.cardtypeData 575 var cardtype_data = this.data.cardtypeData
@@ -720,14 +720,18 @@ Page({ @@ -720,14 +720,18 @@ Page({
720 studystartdate.selected = format.formatTime_month(data.education_start) 720 studystartdate.selected = format.formatTime_month(data.education_start)
721 studystartdate.datelong = data.education_start 721 studystartdate.datelong = data.education_start
722 setData.studystartdate = studystartdate 722 setData.studystartdate = studystartdate
723 - var studyCompleteDate = this.data.studyCompleteDate  
724 - studyCompleteDate.selected = format.formatTime_month(data.education_period_end)  
725 - studyCompleteDate.datelong = data.education_period_end  
726 - setData.studyCompleteDate = studyCompleteDate  
727 - var studyenddate = this.data.studyenddate  
728 - studyenddate.selected = format.formatTime_month(data.education_end)  
729 - studyenddate.datelong = data.education_end  
730 - setData.studyenddate = studyenddate 723 + var studyEndDate = this.data.studyEndDate
  724 + studyEndDate.selected = format.formatTime_month(data.education_end)
  725 + studyEndDate.datelong = data.education_end
  726 + setData.studyEndDate = studyEndDate
  727 + var studyPeriodDate = this.data.studyPeriodDate
  728 + if (data.education_period_end > 0){
  729 + studyPeriodDate.selected = format.formatTime_month(data.education_period_end)
  730 + studyPeriodDate.datelong = data.education_period_end
  731 + }
  732 + studyPeriodDate.start = studystartdate.selected
  733 + studyPeriodDate.end = studyEndDate.selected
  734 + setData.studyPeriodDate = studyPeriodDate
731 setData.deduction_amount = data.deduction_amount 735 setData.deduction_amount = data.deduction_amount
732 if (data.children_id_card_no && data.children_id_card_no.length) { 736 if (data.children_id_card_no && data.children_id_card_no.length) {
733 setData.children_id_card_no = data.children_id_card_no 737 setData.children_id_card_no = data.children_id_card_no
@@ -786,10 +790,10 @@ Page({ @@ -786,10 +790,10 @@ Page({
786 studystartdate.selected = format.formatTime_month(data.education_start) 790 studystartdate.selected = format.formatTime_month(data.education_start)
787 studystartdate.datelong = data.education_start 791 studystartdate.datelong = data.education_start
788 setData.studystartdate = studystartdate 792 setData.studystartdate = studystartdate
789 - var studyenddate = this.data.studyenddate  
790 - studyenddate.selected = format.formatTime_month(data.education_end)  
791 - studyenddate.datelong = data.education_end  
792 - setData.studyenddate = studyenddate 793 + var studyEndDate = this.data.studyEndDate
  794 + studyEndDate.selected = format.formatTime_month(data.education_end)
  795 + studyEndDate.datelong = data.education_end
  796 + setData.studyEndDate = studyEndDate
793 797
794 } else { 798 } else {
795 setData.edu_lable = 'tech' 799 setData.edu_lable = 'tech'
@@ -1297,19 +1301,19 @@ Page({ @@ -1297,19 +1301,19 @@ Page({
1297 this.showToast('请选择受教育起始日期') 1301 this.showToast('请选择受教育起始日期')
1298 return 1302 return
1299 } 1303 }
1300 - if (this.data.studyCompleteDate.selected.length < 1) { 1304 + if (this.data.studyEndDate.selected.length < 1) {
1301 this.showToast('请选择受教育时间止') 1305 this.showToast('请选择受教育时间止')
1302 return 1306 return
1303 }else{ 1307 }else{
1304 - // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)  
1305 - // if (this.data.studyCompleteDate.datelong < activedDate) {  
1306 - // this.showToast('受教育时间止不符合要求,无法申报')  
1307 - // return  
1308 - // }  
1309 - // if (this.data.studyenddate.selected.length > 0 && this.data.studyenddate.datelong < activedDate) {  
1310 - // this.showToast('教育终止时间不符合要求,无法申报')  
1311 - // return  
1312 - // } 1308 + var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
  1309 + if (this.data.studyEndDate.datelong < activedDate) {
  1310 + this.showToast('受教育时间止不符合要求,无法申报')
  1311 + return
  1312 + }
  1313 + if (this.data.studyPeriodDate.selected.length > 0 && this.data.studyPeriodDate.datelong < activedDate) {
  1314 + this.showToast('教育终止时间不符合要求,无法申报')
  1315 + return
  1316 + }
1313 } 1317 }
1314 if (!formdata.school_name || formdata.school_name.length < 1) { 1318 if (!formdata.school_name || formdata.school_name.length < 1) {
1315 this.showToast('请填写就读学校') 1319 this.showToast('请填写就读学校')
@@ -1342,8 +1346,8 @@ Page({ @@ -1342,8 +1346,8 @@ Page({
1342 newdata.percent = parseFloat(this.data.childrenpercentData.selected.replace("%","")) 1346 newdata.percent = parseFloat(this.data.childrenpercentData.selected.replace("%",""))
1343 newdata.children_id_card_type = '1' //this.data.childrencardtypeData.selected 1347 newdata.children_id_card_type = '1' //this.data.childrencardtypeData.selected
1344 newdata.children_birthday = this.data.commonbirthDate.datelong 1348 newdata.children_birthday = this.data.commonbirthDate.datelong
1345 - newdata.education_period_end = this.data.studyCompleteDate.datelong  
1346 - newdata.education_end = this.data.studyenddate.datelong 1349 + newdata.education_period_end = this.data.studyPeriodDate.datelong
  1350 + newdata.education_end = this.data.studyEndDate.datelong
1347 newdata.education_start = this.data.studystartdate.datelong 1351 newdata.education_start = this.data.studystartdate.datelong
1348 newdata.education_period = this.data.childedudegreeData.selected 1352 newdata.education_period = this.data.childedudegreeData.selected
1349 newdata.school_country = this.data.schoolCountryData.selected 1353 newdata.school_country = this.data.schoolCountryData.selected
@@ -1365,18 +1369,18 @@ Page({ @@ -1365,18 +1369,18 @@ Page({
1365 this.showToast('请选择入学时间') 1369 this.showToast('请选择入学时间')
1366 return 1370 return
1367 } 1371 }
1368 - if (this.data.studyenddate.selected.length < 1) { 1372 + if (this.data.studyEndDate.selected.length < 1) {
1369 this.showToast('请选择毕业时间') 1373 this.showToast('请选择毕业时间')
1370 return 1374 return
1371 } else { 1375 } else {
1372 var activedDate = (Date.parse(new Date('2019-01-01')) / 1000) 1376 var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
1373 - if (this.data.studyenddate.datelong < activedDate) { 1377 + if (this.data.studyEndDate.datelong < activedDate) {
1374 this.showToast('毕业日期不符合要求,无法申报') 1378 this.showToast('毕业日期不符合要求,无法申报')
1375 return 1379 return
1376 } 1380 }
1377 } 1381 }
1378 newdata.education_start = this.data.studystartdate.datelong 1382 newdata.education_start = this.data.studystartdate.datelong
1379 - newdata.education_end = this.data.studyenddate.datelong 1383 + newdata.education_end = this.data.studyEndDate.datelong
1380 newdata.education_type = 'title' //学历 1384 newdata.education_type = 'title' //学历
1381 newdata.education_period = this.data.edulevelData.selected 1385 newdata.education_period = this.data.edulevelData.selected
1382 } else if (this.data.edu_lable == 'tech') { 1386 } else if (this.data.edu_lable == 'tech') {
@@ -1886,11 +1890,11 @@ Page({ @@ -1886,11 +1890,11 @@ Page({
1886 // }) 1890 // })
1887 // } else if (e.currentTarget.id == 'study_end_date') { 1891 // } else if (e.currentTarget.id == 'study_end_date') {
1888 // console.log('study_end_date') 1892 // console.log('study_end_date')
1889 - // var study_enddate = this.data.studyenddate 1893 + // var study_enddate = this.data.studyEndDate
1890 // study_enddate.start = '1970-01-01' 1894 // study_enddate.start = '1970-01-01'
1891 // study_enddate.end = '' 1895 // study_enddate.end = ''
1892 // this.setData({ 1896 // this.setData({
1893 - // studyenddate: study_enddate 1897 + // studyEndDate: study_enddate
1894 // }) 1898 // })
1895 // } 1899 // }
1896 // }, 1900 // },
@@ -1978,47 +1982,56 @@ Page({ @@ -1978,47 +1982,56 @@ Page({
1978 if (select_year<2019){ 1982 if (select_year<2019){
1979 start = '2019-01' 1983 start = '2019-01'
1980 } 1984 }
1981 - var studyCompleteDate = this.data.studyCompleteDate  
1982 - studyCompleteDate.start = start  
1983 - studyCompleteDate.selected = ''  
1984 - var study_enddate = this.data.studyenddate 1985 + var studyPeriodDate = this.data.studyPeriodDate
  1986 + studyPeriodDate.start = start
  1987 + studyPeriodDate.selected = ''
  1988 + studyPeriodDate.datelong = null
  1989 + var study_enddate = this.data.studyEndDate
1985 study_enddate.start = start 1990 study_enddate.start = start
1986 study_enddate.selected = '' 1991 study_enddate.selected = ''
1987 this.setData({ 1992 this.setData({
1988 studystartdate: study_startdate, 1993 studystartdate: study_startdate,
1989 - studyCompleteDate: studyCompleteDate,  
1990 - studyenddate: study_enddate 1994 + studyPeriodDate: studyPeriodDate,
  1995 + studyEndDate: study_enddate
1991 }) 1996 })
1992 break; 1997 break;
1993 - case 'study_comp_date':  
1994 - var studyCompleteDate = this.data.studyCompleteDate  
1995 - studyCompleteDate.selected = e.detail.value 1998 + case 'study_end_date':
  1999 + var study_enddate = this.data.studyEndDate
  2000 + study_enddate.selected = e.detail.value
1996 var datelong = (Date.parse(new Date(e.detail.value)) / 1000) 2001 var datelong = (Date.parse(new Date(e.detail.value)) / 1000)
1997 - studyCompleteDate.datelong = datelong  
1998 -  
1999 - var study_enddate = this.data.studyenddate  
2000 - study_enddate.end = e.detail.value  
2001 - study_enddate.selected = '' 2002 + study_enddate.datelong = datelong
  2003 +
  2004 + var studyPeriodDate = this.data.studyPeriodDate
  2005 + studyPeriodDate.end = e.detail.value
  2006 + studyPeriodDate.selected = ''
  2007 + studyPeriodDate.datelong = null
2002 this.setData({ 2008 this.setData({
2003 - studyCompleteDate: studyCompleteDate,  
2004 - studyenddate: study_enddate 2009 + studyPeriodDate: studyPeriodDate,
  2010 + studyEndDate: study_enddate
2005 }) 2011 })
2006 // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000) 2012 // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
2007 - // if (datelong < activedDate) {  
2008 - // this.showToast('受教育时间止不符合要求,无法申报') 2013 + // if (datelong < activedDate){
  2014 + // this.showToast('教育终止时间不符合要求,无法申报')
2009 // } 2015 // }
2010 break; 2016 break;
2011 - case 'study_end_date':  
2012 - var study_enddate = this.data.studyenddate  
2013 - study_enddate.selected = e.detail.value 2017 + case 'study_per_date':
  2018 + var studyPeriodDate = this.data.studyPeriodDate
  2019 + studyPeriodDate.selected = e.detail.value
2014 var datelong = (Date.parse(new Date(e.detail.value)) / 1000) 2020 var datelong = (Date.parse(new Date(e.detail.value)) / 1000)
2015 - study_enddate.datelong = datelong 2021 + studyPeriodDate.datelong = datelong
  2022 + if (datelong > this.data.studyEndDate.datelong) {
  2023 + wx.showToast({
  2024 + title: '教育终止日应不大于受教育时间止',
  2025 + icon:'none'
  2026 + })
  2027 + return
  2028 + }
2016 this.setData({ 2029 this.setData({
2017 - studyenddate: study_enddate 2030 + studyPeriodDate: studyPeriodDate,
2018 }) 2031 })
2019 // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000) 2032 // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
2020 - // if (datelong < activedDate){  
2021 - // this.showToast('教育终止时间不符合要求,无法申报') 2033 + // if (datelong < activedDate) {
  2034 + // this.showToast('受教育时间止不符合要求,无法申报')
2022 // } 2035 // }
2023 break; 2036 break;
2024 case 'child_edu_degree': 2037 case 'child_edu_degree':
@@ -60,10 +60,10 @@ @@ -60,10 +60,10 @@
60 <template is="picker_cell_normal" data="{{...studystartdate}}" /> 60 <template is="picker_cell_normal" data="{{...studystartdate}}" />
61 <view class='divide_line_30'></view> 61 <view class='divide_line_30'></view>
62 62
63 - <template is="picker_cell_normal" data="{{...studyCompleteDate}}" /> 63 + <template is="picker_cell_normal" data="{{...studyEndDate}}" />
64 <view class='divide_line_30'></view> 64 <view class='divide_line_30'></view>
65 65
66 - <template is="picker_cell_normal" data="{{...studyenddate}}" /> 66 + <template is="picker_cell_normal" data="{{...studyPeriodDate}}" />
67 <view class='divide_line_30'></view> 67 <view class='divide_line_30'></view>
68 <template is="picker_cell_normal" data="{{...schoolCountryData}}" /> 68 <template is="picker_cell_normal" data="{{...schoolCountryData}}" />
69 <view class='divide_line_30'></view> 69 <view class='divide_line_30'></view>
注册登录 后发表评论