feat: 优化会议室预定页面

This commit is contained in:
caoqianming 2025-11-09 12:33:34 +08:00
parent def8713e8e
commit 84f0cef581
2 changed files with 18 additions and 30 deletions

View File

@ -10,12 +10,12 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="会议名称" prop="title"> <el-form-item label="会议名称" prop="title">
<el-input v-model="form.title" clearable placeholder="请输入会议名称" :readonly="mode === 'show'"></el-input> <el-input v-model="form.title" clearable placeholder="请输入会议名称" :readonly="localMode === 'show'"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="会议室" prop="mroom"> <el-form-item label="会议室" prop="mroom">
<el-select v-model="form.mroom" placeholder="请选择会议室" @change="mRoomChange" style="width: 100%;" :readonly="mode === 'show'"> <el-select v-model="form.mroom" placeholder="请选择会议室" @change="mRoomChange" style="width: 100%;" :readonly="localMode === 'show'">
<el-option <el-option
v-for="item in mRoomList" v-for="item in mRoomList"
:key="item.id" :key="item.id"
@ -27,17 +27,17 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="参会领导" prop="key_participants"> <el-form-item label="参会领导" prop="key_participants">
<el-input v-model="form.key_participants" clearable placeholder="请输入参会领导" :readonly="mode === 'show'"></el-input> <el-input v-model="form.key_participants" clearable placeholder="请输入参会领导" :readonly="localMode === 'show'"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="会议人数" prop="participant_count"> <el-form-item label="会议人数" prop="participant_count">
<el-input-number v-model="form.participant_count" clearable style="width: 100%;" :precision="0" :step="1" :min="1" :readonly="mode === 'show'"></el-input-number> <el-input-number v-model="form.participant_count" clearable style="width: 100%;" :precision="0" :step="1" :min="1" :readonly="localMode === 'show'"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="会议日期" prop="mdate"> <el-form-item label="会议日期" prop="mdate">
<el-date-picker v-model="form.mdate" type="date" value-format="YYYY-MM-DD" style="width: 100%;" placeholder="请选择会议日期" :readonly="mode === 'show'" @change="mdateChange"></el-date-picker> <el-date-picker v-model="form.mdate" type="date" value-format="YYYY-MM-DD" style="width: 100%;" placeholder="请选择会议日期" :readonly="localMode === 'show'" @change="mdateChange"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -46,7 +46,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="24"> <!-- <el-col :span="24">
<el-form-item label="会议时间段" prop="slots" required v-if="mode != 'show'"> <el-form-item label="会议时间段" prop="slots" required v-if="localMode != 'show'">
<div v-for="(item,$index) in timesList" :key="item.value"> <div v-for="(item,$index) in timesList" :key="item.value">
<div v-if="item.isSelect" class="timeBlock selectedTimeBlock" @click="selectTime($index)">{{ item.label }}</div> <div v-if="item.isSelect" class="timeBlock selectedTimeBlock" @click="selectTime($index)">{{ item.label }}</div>
<div v-else class="timeBlock" @click="selectTime($index)">{{ item.label }}</div> <div v-else class="timeBlock" @click="selectTime($index)">{{ item.label }}</div>
@ -68,7 +68,7 @@
<el-footer> <el-footer>
<el-button @click="$emit('closed')" style="margin-right: 4px">取消</el-button> <el-button @click="$emit('closed')" style="margin-right: 4px">取消</el-button>
<ticketd_b <ticketd_b
:workflow_key="'booking'" :workflow_key="'mroombooking.create'"
:title="form.title+'-会议室预定'" :title="form.title+'-会议室预定'"
:t_id="form.id" :t_id="form.id"
:ticket_="form.ticket_" :ticket_="form.ticket_"
@ -97,10 +97,6 @@ export default {
mode: { mode: {
type: String, type: String,
default: "show", default: "show",
},
bookingIitem: {
type: Object,
default: null,
}, },
t_id: { t_id: {
type: String, type: String,
@ -181,6 +177,7 @@ export default {
], ],
mRoomList: [], mRoomList: [],
timeselectList: [], timeselectList: [],
localMode: this.mode,
}; };
}, },
mounted() { mounted() {
@ -190,12 +187,8 @@ export default {
that.getTid(); that.getTid();
} }
else { else {
if(that.mode=='add'){ that.localMode = "add";
that.form.belong_dept = that.$TOOL.data.get("USER_INFO").belong_dept; that.form.belong_dept = that.$TOOL.data.get("USER_INFO").belong_dept;
}
else if (that.mode=='edit'||that.mode=='show'){
that.form = that.bookingIitem;
}
} }
}, },
@ -212,9 +205,9 @@ export default {
that.form = res; that.form = res;
that.handleEidt(that.t_id); that.handleEidt(that.t_id);
if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) { if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
that.$emit("changeMode", "edit"); that.localMode = "edit";
}else{ }else{
that.$emit("changeMode", "show"); that.localMode = "show";
} }
}) })
}, },
@ -263,11 +256,11 @@ export default {
}, },
async submit_b_func() { async submit_b_func() {
let that = this; let that = this;
if(that.mode == "add") { if(that.localMode == "add") {
that.form.belong_dept = that.$TOOL.data.get("USER_INFO").belong_dept; that.form.belong_dept = that.$TOOL.data.get("USER_INFO").belong_dept;
let res = await that.$API.ofm.mroombooking.create.req(that.form); let res = await that.$API.ofm.mroombooking.create.req(that.form);
that.form.id = res.id; that.form.id = res.id;
} else if (that.mode == "edit") { } else if (that.localMode == "edit") {
await that.$API.ofm.mroombooking.update.req(that.form.id, that.form); await that.$API.ofm.mroombooking.update.req(that.form.id, that.form);
} }
}, },

View File

@ -71,8 +71,6 @@
v-if="limitedVisible" v-if="limitedVisible"
:mode="mode" :mode="mode"
:t_id="t_id" :t_id="t_id"
:bookingIitem="bookingIitem"
@changeMode="(mode)=>{this.mode=mode;}"
@success="handleSuccess" @success="handleSuccess"
@closed="handleCancel" @closed="handleCancel"
></bookingDialog> ></bookingDialog>
@ -116,7 +114,6 @@ export default {
handleAdd() { handleAdd() {
this.mode = "add"; this.mode = "add";
this.t_id = null; this.t_id = null;
this.bookingIitem = {};
this.limitedVisible = true; this.limitedVisible = true;
}, },
handleCancel() { handleCancel() {
@ -130,17 +127,15 @@ export default {
let that = this; let that = this;
that.mode = "show"; that.mode = "show";
that.t_id = row.id; that.t_id = row.id;
that.bookingIitem = row;
that.limitedVisible = true; that.limitedVisible = true;
}, },
async handleDel(row) { async handleDel(row) {
var id = row.id; var id = row.id;
var res = await this.$API.ofm.mroombooking.delete.req(id); try {
if (res.err_msg) { await this.$API.ofm.mroombooking.checkDelete.req(id);
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh();
} catch (error) {
} }
}, },
// //