cfa5a586 by zhangmeng

时间限制

1 parent 3282934d
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
35 format="YYYY-MM-DD" 35 format="YYYY-MM-DD"
36 size="small" 36 size="small"
37 @change="dateChange" 37 @change="dateChange"
38 :disabled-date="disabledDate" 38 :disabled-date="disabledDateRZ"
39 :clearable='false'
39 /> 40 />
40 </div> 41 </div>
41 </el-col> 42 </el-col>
...@@ -151,6 +152,20 @@ function getScheduleList() { ...@@ -151,6 +152,20 @@ function getScheduleList() {
151 schList.value.forEach(item=>item.active=true) 152 schList.value.forEach(item=>item.active=true)
152 }) 153 })
153 } 154 }
155
156 function disabledDateRZ(date) {
157 if (formTime.value) {
158 const toDay=dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
159 const start=dayjs(formTime.value.mealStart).valueOf()
160 const end=dayjs(formTime.value.mealEnd).valueOf()
161 if (toDay<start) {
162 return date.getTime()<start||date.getTime()>end
163 } else if(toDay>start&&toDay <end) {
164 return date.getTime()<toDay||date.getTime()>end
165 }else return true
166 }
167 }
168
154 function selectDate(date) { 169 function selectDate(date) {
155 currentDate1.value= currentDate.value=dayjs(date).toDate() 170 currentDate1.value= currentDate.value=dayjs(date).toDate()
156 console.log(date) 171 console.log(date)
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
35 format="YYYY-MM-DD" 35 format="YYYY-MM-DD"
36 size="small" 36 size="small"
37 @change="dateChange" 37 @change="dateChange"
38 :disabled-date="disabledDateRZ"
39 :clearable="false"
38 /> 40 />
39 </div> 41 </div>
40 </el-col> 42 </el-col>
...@@ -178,8 +180,17 @@ function goMatch(n) { ...@@ -178,8 +180,17 @@ function goMatch(n) {
178 }) 180 })
179 } 181 }
180 182
181 function changee(){ 183 function disabledDateRZ(date) {
182 console.log(value2.value) 184 if (formTime.value) {
185 const toDay=dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
186 const start=dayjs(formTime.value.photoStart).valueOf()
187 const end=dayjs(formTime.value.photoEnd).valueOf()
188 if (toDay<start) {
189 return date.getTime()<start||date.getTime()>end
190 } else if(toDay>start&&toDay <end) {
191 return date.getTime()<toDay||date.getTime()>end
192 }else return true
193 }
183 } 194 }
184 </script> 195 </script>
185 196
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!