fix: mroombooking在初始状态编辑时slot问题

This commit is contained in:
caoqianming 2025-12-01 13:47:07 +08:00
parent 8e7e36ca29
commit c6e09c0cef
1 changed files with 29 additions and 22 deletions

View File

@ -55,7 +55,7 @@
<view>{{totalCount}}小时</view> -->
</view>
</scroll-view>
<view class="footer_sticky">
<view class="footer_fixed">
<ticketd_b :workflow_key="'wf_mroombooking'" :title="form.title + '-会议室预定'" :t_id="form.id" :ticket_="form.ticket_"
@success="submitSuccess" :submit_b_func="submit_b_func" ref="ticketd_b_start"></ticketd_b>
</view>
@ -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){
if(item.booking == that.form.id) {
that.timesListAm[item.slot].isSelect = true;
}else{
that.timesListAm[item.slot].sloted = true;
}
}else{
if(item.booking == that.form.id) {
that.timesListPm[item.slot-12].isSelect = true;
}else{
that.timesListPm[item.slot-12].sloted = true;
}
}
})
})
},