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>{{totalCount}}小时</view> -->
</view> </view>
</scroll-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_" <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> @success="submitSuccess" :submit_b_func="submit_b_func" ref="ticketd_b_start"></ticketd_b>
</view> </view>
@ -171,24 +171,24 @@ import {actStateEnum} from "@/utils/enum.js"
} }
} }
await that.getmRooms(); await that.getmRooms();
if(options.slots){ // if(options.slots){
that.form.slots = []; // that.form.slots = [];
let slots = options.slots.split(','); // let slots = options.slots.split(',');
if(slots.length>0){ // if(slots.length>0){
slots.forEach(item=>{ // slots.forEach(item=>{
let slot = Number(item); // let slot = Number(item);
that.form.slots.push(slot); // that.form.slots.push(slot);
if(slot<12){ // if(slot<12){
that.timesListAm[slot].isSelect = true; // that.timesListAm[slot].isSelect = true;
that.selectList.push(that.timesListAm[slot]) // that.selectList.push(that.timesListAm[slot])
}else{ // }else{
that.timesListPm[slot].isSelect = true; // that.timesListPm[slot].isSelect = true;
that.selectList.push(that.timesListPm[slot]) // that.selectList.push(that.timesListPm[slot])
} // }
}) // })
that.totalCount = slots.length*0.5; // that.totalCount = slots.length*0.5;
} // }
} // }
}, },
methods:{ methods:{
async getmRooms(){ async getmRooms(){
@ -270,11 +270,18 @@ import {actStateEnum} from "@/utils/enum.js"
that.$api.bookingSlot(form).then(res=>{ that.$api.bookingSlot(form).then(res=>{
res.forEach(item=>{ res.forEach(item=>{
if(item.slot<12){ 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{ }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;
}
} }
}) })
}) })
}, },