Commit ca1f9e59 by zhangzhen

细节优化

parent cc649ea7
...@@ -746,21 +746,24 @@ ...@@ -746,21 +746,24 @@
this.intervalList = [ this.intervalList = [
...this.dateIntervalList ...this.dateIntervalList
] ]
for (start; start <= end; start++) { for (let index = start; index <= end; index++) {
let endTimeM = 0
if(this.dateIntervalList[index].status ==1){
endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm')
}
// 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前 // 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前
if (this.dateIntervalList[start].status === 1 && if ((this.dateIntervalList[index].status == 1 && index > start && index < start+this.duration)||
startM < moment(this.dateIntervalList[start].endHoldTime).format("mm") && (this.dateIntervalList[index].status == 1 && index == end && Number(startM)>= Number(endTimeM) )
endM >= moment(this.dateIntervalList[start].startHoldTime).format("mm")
) { ) {
// 表示时间点被占用,无法选择 // 表示时间点被占用,无法选择
this.useDateStatus = false this.useDateStatus = false
this.intervalList[start] = { this.intervalList[index] = {
...this.dateIntervalList[start], ...this.dateIntervalList[index],
status: 2 status: 2
} }
} else { } else {
this.intervalList[start] = { this.intervalList[index] = {
...this.dateIntervalList[start], ...this.dateIntervalList[index],
status: 2 status: 2
} }
} }
...@@ -928,7 +931,14 @@ ...@@ -928,7 +931,14 @@
let status = item.status; let status = item.status;
if(index>=val && index<= val+duration){ if(index>=val && index<= val+duration){
status = 2 status = 2
if(this.dateIntervalList[index].status === 1 && index !== val){
let endTimeM = 0
if(this.dateIntervalList[index].status ==1){
endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm')
}
if((this.dateIntervalList[index].status === 1 && index > val && index < val+duration) ||
(this.dateIntervalList[index].status === 1 && index == val+duration && Number(startM)>= Number(endTimeM))){
this.useDateStatus = false this.useDateStatus = false
} }
}else{ }else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment