fix:预定页面调整

This commit is contained in:
shijing 2025-09-26 14:00:57 +08:00
parent db46b1d878
commit 4b50910cdd
2 changed files with 66 additions and 37 deletions

View File

@ -13,7 +13,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="会议室" prop="mroom">
<el-select v-model="form.mroom" placeholder="请选择" style="width: 100%;">
<el-select v-model="form.mroom" placeholder="请选择" @change="mRoomChange" style="width: 100%;">
<el-option
v-for="item in mRoomList"
:key="item.id"
@ -65,20 +65,32 @@ export default {
ticketd_b_start, ticketd
},
props: {
type: {
type: String,
default: "add",
},
editId: {
type: String,
default: "add",
},
bookingIitem: {
type: String,
default: "add",
},
t_id: {
type: String,
default: null
},
},
data() {
return {
apiObj: this.$API.ofm.mroombooking.list,
bookingTitle: "会议预定",
query: {},
editId: null,
mroomName:'',
isSaving: false,
limitedVisible: false,
type: "add",
titleMap: {
add: "新增会议预定",
edit: "编辑会议预定",
@ -147,12 +159,20 @@ export default {
{value:46,label:'23:00-23:30',isSelect:false},
{value:47,label:'23:30-24:00',isSelect:false}
],
mRoomList: []
mRoomList: [],
timeselectList: [],
};
},
mounted() {
this.getmRoomList();
this.getTid();
let that = this;
that.getmRoomList();
that.getTid();
if(that.type=='edit'){
that.form = that.bookingIitem;
that.mroomName = that.bookingIitem.mroom_name;
that.bookingTitle = that.mroomName+"预定";
that.handleEidt(that.editId);
}
},
methods: {
getmRoomList(){
@ -177,6 +197,15 @@ export default {
})
}
},
mRoomChange(){
let that = this;
that.mRoomList.forEach(item=>{
if(item.id == that.form.mroom){
that.mroomName = item.name;
that.bookingTitle = item.name+"预定";
}
})
},
selectTime(index){
let that = this;
that.form.slots = [];
@ -221,24 +250,20 @@ export default {
that.isSaving = false;
}
},
handleEidt(row) {
handleEidt(id) {
let that = this;
that.type = "edit";
that.editId = row.id;
that.$API.ofm.mroomslot.list.req({booking:row.id,page:0}).then(res=>{
console.log('mroomslotres',res);
that.$API.ofm.mroomslot.list.req({booking:id,page:0}).then(res=>{
res.forEach(item=>{
that.timesList[item.slot].isSelect = true;
})
})
that.limitedVisible = true;
that.form = Object.assign({}, row);
}
},
//
handleQuery() {
this.$refs.table.queryData(this.query);
},
},
};
</script>
<style scoped>

View File

@ -9,17 +9,23 @@
></el-button>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="会议室名称"
clearable
@keyup.enter="handleQuery"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-date-picker
v-model="query.slot_b__mdate"
type="date"
value-format="YYYY-MM-DD" />
<el-select v-model="query.slot_b__mroom" clearable placeholder="请选择会议室">
<el-option
v-for="item in mRoomList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -41,12 +47,6 @@
type="primary"
@click="handleEidt(scope.row)"
>编辑</el-button>
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm> -->
<el-popconfirm title="确定删除吗?" @confirm="handleDel(scope.row)">
<template #reference>
<el-button link size="small" type="danger">删除</el-button>
@ -60,8 +60,8 @@
<el-drawer :title="titleMap[type]" v-model="limitedVisible" :size="'80%'">
<bookingDialog
:type="type"
:id="editId"
:timeselectList="timeselectList"
:editId="editId"
:bookingIitem="bookingIitem"
@success="handleSuccess"
@cancel="handleCancel"
></bookingDialog>
@ -86,11 +86,19 @@ export default {
edit: "编辑会议预定",
show: "查看会议预定",
},
mRoomList: []
};
},
mounted() {
this.getmRoomList();
},
methods: {
getmRoomList(){
let that = this;
that.$API.ofm.mroom.list.req({page:0}).then(res=>{
that.mRoomList = res;
})
},
//
handleAdd() {
this.type = "add";
@ -104,11 +112,7 @@ export default {
that.type = "edit";
that.editId = row.id;
that.bookingIitem = row;
that.$API.ofm.mroomslot.list.req({booking:row.id,page:0}).then(res=>{
that.timeselectList = res;
})
that.limitedVisible = true;
that.form = Object.assign({}, row);
},
async handleDel(row) {
var id = row.id;