提交 1752d6722c1ea825f917fe52c22441affb10ad5c

作者 pangy
1 个父辈 b35d9026

子女教育 日期改版

... ... @@ -293,7 +293,7 @@ Page({
293 293 onChange: 'onPickerSelect'
294 294 },
295 295 studystartdate: {
296   - label: '受教育日期起',
  296 + label: '受教育时间起',
297 297 isrequre: true,
298 298 bindtype: 'study_start_date',
299 299 selected: '',
... ... @@ -305,16 +305,32 @@ Page({
305 305 fields: "month",
306 306 datelong: 0,
307 307 start: '1970-01-01',
  308 + end: (new Date()).getFullYear() +'-'+ ((new Date()).getMonth()+1),
  309 + // start: (new Date()).getFullYear() + '-09-01',//'1970-01-01',
  310 + // end: (new Date()).getFullYear() + '-09-01',
  311 + // onTap: 'studyDataTap'
  312 + },
  313 + studyCompleteDate: {
  314 + label: '受教育时间止',
  315 + isrequre: true,
  316 + bindtype: 'study_comp_date',
  317 + selected: '',
  318 + isblack: 'true',
  319 + values: ["是", "否"],
  320 + placeholder: '请选择时间',
  321 + onChange: 'onPickerSelect',
  322 + mode: "date",
  323 + fields: "month",
  324 + start: '1970-01-01',
308 325 // start: (new Date()).getFullYear() + '-09-01',//'1970-01-01',
309 326 // end: (new Date()).getFullYear() + '-09-01',
310 327 // onTap: 'studyDataTap'
311 328 },
312 329 studyenddate: {
313 330 label: '教育终止时间',
314   - isrequre: true,
  331 + // isrequre: true,
315 332 bindtype: 'study_end_date',
316 333 selected: '',
317   - isblack: 'true',
318 334 values: ["是", "否"],
319 335 placeholder: '请选择时间',
320 336 onChange: 'onPickerSelect',
... ... @@ -549,7 +565,7 @@ Page({
549 565 studystart_date.label = "入学时间起"
550 566 var studyend_date = this.data.studyenddate
551 567 studyend_date.label = "(预计)毕业时间"
552   -
  568 + studyend_date.isrequre = true
553 569 this.setData({
554 570 studystartdate: studystart_date,
555 571 studyenddate: studyend_date
... ... @@ -703,6 +719,10 @@ Page({
703 719 studystartdate.selected = format.formatTime_month(data.education_start)
704 720 studystartdate.datelong = data.education_start
705 721 setData.studystartdate = studystartdate
  722 + var studyCompleteDate = this.data.studyCompleteDate
  723 + studyCompleteDate.selected = format.formatTime_month(data.education_period_end)
  724 + studyCompleteDate.datelong = data.education_period_end
  725 + setData.studyCompleteDate = studyCompleteDate
706 726 var studyenddate = this.data.studyenddate
707 727 studyenddate.selected = format.formatTime_month(data.education_end)
708 728 studyenddate.datelong = data.education_end
... ... @@ -1263,15 +1283,19 @@ Page({
1263 1283 this.showToast('请选择受教育起始日期')
1264 1284 return
1265 1285 }
1266   - if (this.data.studyenddate.selected.length < 1) {
1267   - this.showToast('请选择受教育终止日期')
  1286 + if (this.data.studyCompleteDate.selected.length < 1) {
  1287 + this.showToast('请选择受教育时间止')
1268 1288 return
1269 1289 }else{
1270   - var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
1271   - if (this.data.studyenddate.datelong < activedDate) {
1272   - this.showToast('终止(毕业)日期不符合要求,无法申报')
1273   - return
1274   - }
  1290 + // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
  1291 + // if (this.data.studyCompleteDate.datelong < activedDate) {
  1292 + // this.showToast('受教育时间止不符合要求,无法申报')
  1293 + // return
  1294 + // }
  1295 + // if (this.data.studyenddate.selected.length > 0 && this.data.studyenddate.datelong < activedDate) {
  1296 + // this.showToast('教育终止时间不符合要求,无法申报')
  1297 + // return
  1298 + // }
1275 1299 }
1276 1300 if (!formdata.school_name || formdata.school_name.length < 1) {
1277 1301 this.showToast('请填写就读学校')
... ... @@ -1304,6 +1328,7 @@ Page({
1304 1328 newdata.percent = parseFloat(this.data.childrenpercentData.selected.replace("%",""))
1305 1329 newdata.children_id_card_type = '1' //this.data.childrencardtypeData.selected
1306 1330 newdata.children_birthday = this.data.commonbirthDate.datelong
  1331 + newdata.education_period_end = this.data.studyCompleteDate.datelong
1307 1332 newdata.education_end = this.data.studyenddate.datelong
1308 1333 newdata.education_start = this.data.studystartdate.datelong
1309 1334 newdata.education_period = this.data.childedudegreeData.selected
... ... @@ -1332,7 +1357,7 @@ Page({
1332 1357 } else {
1333 1358 var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
1334 1359 if (this.data.studyenddate.datelong < activedDate) {
1335   - this.showToast('终止(毕业)日期不符合要求,无法申报')
  1360 + this.showToast('毕业日期不符合要求,无法申报')
1336 1361 return
1337 1362 }
1338 1363 }
... ... @@ -1929,12 +1954,45 @@ Page({
1929 1954 })
1930 1955 break;
1931 1956 case 'study_start_date':
  1957 + var select_date = e.detail.value
1932 1958 var study_startdate = this.data.studystartdate
1933   - study_startdate.selected = e.detail.value
1934   - study_startdate.datelong = (Date.parse(new Date(e.detail.value)) / 1000)
  1959 + study_startdate.selected = select_date
  1960 + study_startdate.datelong = (Date.parse(new Date(select_date)) / 1000)
  1961 + //处理两个终止时间的限制
  1962 + var select_year = select_date.substring(0, 4)
  1963 + var start = select_date
  1964 + if (select_year<2019){
  1965 + start = '2019-01'
  1966 + }
  1967 + var studyCompleteDate = this.data.studyCompleteDate
  1968 + studyCompleteDate.start = start
  1969 + studyCompleteDate.selected = ''
  1970 + var study_enddate = this.data.studyenddate
  1971 + study_enddate.start = start
  1972 + study_enddate.selected = ''
  1973 + this.setData({
  1974 + studystartdate: study_startdate,
  1975 + studyCompleteDate: studyCompleteDate,
  1976 + studyenddate: study_enddate
  1977 + })
  1978 + break;
  1979 + case 'study_comp_date':
  1980 + var studyCompleteDate = this.data.studyCompleteDate
  1981 + studyCompleteDate.selected = e.detail.value
  1982 + var datelong = (Date.parse(new Date(e.detail.value)) / 1000)
  1983 + studyCompleteDate.datelong = datelong
  1984 +
  1985 + var study_enddate = this.data.studyenddate
  1986 + study_enddate.end = e.detail.value
  1987 + study_enddate.selected = ''
1935 1988 this.setData({
1936   - studystartdate: study_startdate
  1989 + studyCompleteDate: studyCompleteDate,
  1990 + studyenddate: study_enddate
1937 1991 })
  1992 + // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
  1993 + // if (datelong < activedDate) {
  1994 + // this.showToast('受教育时间止不符合要求,无法申报')
  1995 + // }
1938 1996 break;
1939 1997 case 'study_end_date':
1940 1998 var study_enddate = this.data.studyenddate
... ... @@ -1944,10 +2002,10 @@ Page({
1944 2002 this.setData({
1945 2003 studyenddate: study_enddate
1946 2004 })
1947   - var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
1948   - if (datelong < activedDate){
1949   - this.showToast('终止(毕业)日期不符合要求,无法申报')
1950   - }
  2005 + // var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
  2006 + // if (datelong < activedDate){
  2007 + // this.showToast('教育终止时间不符合要求,无法申报')
  2008 + // }
1951 2009 break;
1952 2010 case 'child_edu_degree':
1953 2011 var childedudegreeData = this.data.childedudegreeData
... ...
... ... @@ -60,8 +60,10 @@
60 60 <template is="picker_cell_normal" data="{{...studystartdate}}" />
61 61 <view class='divide_line_30'></view>
62 62
63   - <template is="picker_cell_normal" data="{{...studyenddate}}" />
  63 + <template is="picker_cell_normal" data="{{...studyCompleteDate}}" />
  64 + <view class='divide_line_30'></view>
64 65
  66 + <template is="picker_cell_normal" data="{{...studyenddate}}" />
65 67 <view class='divide_line_30'></view>
66 68 <template is="picker_cell_normal" data="{{...schoolCountryData}}" />
67 69 <view class='divide_line_30'></view>
... ...
注册登录 后发表评论