lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
b5e712ef07
Modificáronse 1 ficheiros con 17 adicións e 3 borrados
  1. 17 3
      pages/spotCheckConfigure/addSpotCheck.vue

+ 17 - 3
pages/spotCheckConfigure/addSpotCheck.vue

@@ -210,8 +210,15 @@ export default {
 		// 开始日期
 		confirmStartDate(val) {
 			let d = val.year + '-' + val.month + '-' + val.day;
-			this.form.startDate = d
-			this.form.endDate = ''
+			if(moment(d).isSameOrAfter(moment(),'day')){
+				this.form.startDate = d
+				this.form.endDate = ''
+			}else{
+				uni.showToast({
+					icon: 'none',
+					title: '请选择今天或之后的日期'
+				});
+			}
 		},
 		openEndDate(){
 			this.showPickerEnd = this.form.cycleType=='WEEK'
@@ -221,7 +228,14 @@ export default {
 			let d = val.year + '-' + val.month + '-' + val.day;
 			let a = this.form.startDate;
 			if (a == '' || moment(d).isAfter(a)) {
-				this.form.endDate = d;
+				if(a=='' && moment(d).isSameOrAfter(moment(),'day')){
+					this.form.endDate = d;
+				}else{
+					uni.showToast({
+						icon: 'none',
+						title: '请选择今天或之后的日期'
+					});
+				}
 			} else {
 				uni.showToast({
 					icon: 'none',