cfa5a586 by zhangmeng

时间限制

1 parent 3282934d
......@@ -35,7 +35,8 @@
format="YYYY-MM-DD"
size="small"
@change="dateChange"
:disabled-date="disabledDate"
:disabled-date="disabledDateRZ"
:clearable='false'
/>
</div>
</el-col>
......@@ -151,6 +152,20 @@ function getScheduleList() {
schList.value.forEach(item=>item.active=true)
})
}
function disabledDateRZ(date) {
if (formTime.value) {
const toDay=dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
const start=dayjs(formTime.value.mealStart).valueOf()
const end=dayjs(formTime.value.mealEnd).valueOf()
if (toDay<start) {
return date.getTime()<start||date.getTime()>end
} else if(toDay>start&&toDay <end) {
return date.getTime()<toDay||date.getTime()>end
}else return true
}
}
function selectDate(date) {
currentDate1.value= currentDate.value=dayjs(date).toDate()
console.log(date)
......
......@@ -35,6 +35,8 @@
format="YYYY-MM-DD"
size="small"
@change="dateChange"
:disabled-date="disabledDateRZ"
:clearable="false"
/>
</div>
</el-col>
......@@ -178,8 +180,17 @@ function goMatch(n) {
})
}
function changee(){
console.log(value2.value)
function disabledDateRZ(date) {
if (formTime.value) {
const toDay=dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
const start=dayjs(formTime.value.photoStart).valueOf()
const end=dayjs(formTime.value.photoEnd).valueOf()
if (toDay<start) {
return date.getTime()<start||date.getTime()>end
} else if(toDay>start&&toDay <end) {
return date.getTime()<toDay||date.getTime()>end
}else return true
}
}
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!