diff --git a/pages/ofm/mroombooking_form.vue b/pages/ofm/mroombooking_form.vue index be22f32..c2f2147 100644 --- a/pages/ofm/mroombooking_form.vue +++ b/pages/ofm/mroombooking_form.vue @@ -55,7 +55,7 @@ 共{{totalCount}}小时 --> - + @@ -171,24 +171,24 @@ import {actStateEnum} from "@/utils/enum.js" } } await that.getmRooms(); - if(options.slots){ - that.form.slots = []; - let slots = options.slots.split(','); - if(slots.length>0){ - slots.forEach(item=>{ - let slot = Number(item); - that.form.slots.push(slot); - if(slot<12){ - that.timesListAm[slot].isSelect = true; - that.selectList.push(that.timesListAm[slot]) - }else{ - that.timesListPm[slot].isSelect = true; - that.selectList.push(that.timesListPm[slot]) - } - }) - that.totalCount = slots.length*0.5; - } - } + // if(options.slots){ + // that.form.slots = []; + // let slots = options.slots.split(','); + // if(slots.length>0){ + // slots.forEach(item=>{ + // let slot = Number(item); + // that.form.slots.push(slot); + // if(slot<12){ + // that.timesListAm[slot].isSelect = true; + // that.selectList.push(that.timesListAm[slot]) + // }else{ + // that.timesListPm[slot].isSelect = true; + // that.selectList.push(that.timesListPm[slot]) + // } + // }) + // that.totalCount = slots.length*0.5; + // } + // } }, methods:{ async getmRooms(){ @@ -270,11 +270,18 @@ import {actStateEnum} from "@/utils/enum.js" that.$api.bookingSlot(form).then(res=>{ res.forEach(item=>{ if(item.slot<12){ - that.timesListAm[item.slot].sloted = true; + if(item.booking == that.form.id) { + that.timesListAm[item.slot].isSelect = true; + }else{ + that.timesListAm[item.slot].sloted = true; + } }else{ - that.timesListPm[item.slot-12].sloted = true; + if(item.booking == that.form.id) { + that.timesListPm[item.slot-12].isSelect = true; + }else{ + that.timesListPm[item.slot-12].sloted = true; + } } - }) }) },