Files
admin-vben5/apps/web-antd/src/views/property/roomBooking/conferenceReservations/index.vue

175 lines
5.0 KiB
Vue
Raw Normal View History

2025-06-19 16:54:36 +08:00
<template>
2025-07-05 17:47:26 +08:00
<div>
2025-07-08 17:33:42 +08:00
<Alert message="请先填写以下信息,查询可用会议室" show-icon banner closable type="info"></Alert>
2025-07-07 16:31:20 +08:00
<a-form
:model="formState"
layout="inline"
class="form-box"
>
<a-form-item label="会议室类型">
<Select
v-model:value="formState.meetingRoomType"
class="room-select"
placeholder="请选择会议室类型"
style="width: 180px;"
>
<SelectOption
v-for="item in getDictOptions('meeting_room_type')"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</SelectOption>
</Select>
</a-form-item>
2025-07-07 16:31:20 +08:00
<a-form-item label="会议日期">
<DatePicker v-model:value="formState.appointmentTime" style="width: 180px;"/>
2025-07-08 17:33:42 +08:00
</a-form-item>
<a-form-item label="会议时段">
<TimeRangePicker style="width: 200px;" format="HH:mm"
v-model:value="formState.openHours"></TimeRangePicker>
2025-07-07 16:31:20 +08:00
</a-form-item>
<a-form-item label="参会人数">
<InputNumber style="width: 150px;" placeholder="请输入参会人数"
2025-07-08 17:33:42 +08:00
v-model:value="formState.personNumber"/>
2025-07-07 16:31:20 +08:00
</a-form-item>
<a-form-item >
2025-07-07 17:24:28 +08:00
<a-button @click="handleClean">重置</a-button>
</a-form-item>
<a-form-item>
2025-07-09 10:36:42 +08:00
<a-button type="primary" class="primary-button"
:disabled="!formState.meetingRoomType||!formState.appointmentTime
||!(formState.openHours&&formState.openHours.length)||!formState.personNumber"
2025-07-09 10:36:42 +08:00
@click="handleSearch">搜索</a-button>
2025-07-07 16:31:20 +08:00
</a-form-item>
</a-form>
2025-07-08 17:33:42 +08:00
<div v-if="meetingList?.length" class="card-box">
2025-07-05 17:47:26 +08:00
<div v-for="(item,index) in meetingList" :key="index" class="card-list">
2025-07-08 17:33:42 +08:00
<div><span class="card-title">{{ item.name }}</span>
<a-button class="card-button" type="primary" @click="handleAdd(item.id)">去预约</a-button>
</div>
<div>容纳人数: {{ item.personNumber }}</div>
<div>基础费用: {{
item.expenseType == '2' ? (item.basePrice+"元") : renderDictValue(item.expenseType, 'wy_fyms')
}}
</div>
<div>开放时段: {{ item.openHours }}</div>
<div>配套设备: {{ item.baseService }}</div>
2025-07-05 17:47:26 +08:00
</div>
</div>
2025-07-08 17:33:42 +08:00
<div v-else style="text-align: center;margin-top: 20%">
<Empty :image="simpleImage"/>
</div>
2025-07-07 16:31:20 +08:00
<modal/>
2025-07-05 17:47:26 +08:00
</div>
2025-06-19 16:54:36 +08:00
</template>
2025-07-05 17:47:26 +08:00
2025-07-07 16:31:20 +08:00
<script setup lang="ts">
2025-07-08 17:33:42 +08:00
import {ref} from 'vue'
import {reactive} from 'vue';
import {useVbenModal} from '@vben/common-ui';
2025-07-07 16:31:20 +08:00
import {
Form as AForm,
FormItem as AFormItem,
Button as AButton,
2025-07-08 17:33:42 +08:00
TimeRangePicker,
InputNumber,
Empty,
Alert,
DatePicker, Select,SelectOption
2025-07-07 16:31:20 +08:00
} from 'ant-design-vue';
import conferenceAddServicesModal from '../conferenceReservations/conferenceReservations-modal.vue';
2025-07-08 17:33:42 +08:00
import {notlist} from "#/api/property/roomBooking/conferenceSettings";
import type {MeetVO} from "#/api/property/roomBooking/conferenceSettings/model";
import {renderDictValue} from "#/utils/render";
import type { Dayjs } from 'dayjs';
import {getDictOptions} from "#/utils/dict";
2025-07-07 17:24:28 +08:00
2025-07-07 16:31:20 +08:00
interface FormState {
2025-07-08 17:33:42 +08:00
openHours?: any[];
personNumber?: number|undefined;
appointmentTime?:Dayjs|undefined;
meetingRoomType:string|undefined;
2025-07-07 16:31:20 +08:00
}
2025-07-08 17:33:42 +08:00
2025-07-07 16:31:20 +08:00
const formState = reactive<FormState>({
2025-07-08 17:33:42 +08:00
openHours: [],
personNumber: undefined,
appointmentTime:undefined,
meetingRoomType:undefined,
2025-07-07 16:31:20 +08:00
});
2025-07-08 17:33:42 +08:00
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
2025-07-07 17:24:28 +08:00
2025-07-10 14:30:51 +08:00
const meetingList = ref<MeetVO[]>([])
2025-07-07 17:24:28 +08:00
async function handleSearch() {
2025-07-08 17:33:42 +08:00
let hours = '';
if (formState.openHours && formState.openHours.length) {
hours = formState.openHours[0]?.format("HH:mm") + '-' + formState.openHours[1]?.format("HH:mm");
}
2025-07-07 17:24:28 +08:00
const obj = {
2025-07-08 17:33:42 +08:00
openHours: hours??undefined,
personNumber: formState.personNumber,
appointmentTime:formState.appointmentTime?formState.appointmentTime.format('YYYY-MM-DD'):undefined
2025-07-07 17:24:28 +08:00
}
2025-07-08 17:33:42 +08:00
meetingList.value =await notlist(obj);
2025-07-07 17:24:28 +08:00
}
2025-07-08 17:33:42 +08:00
const handleClean = () => {
formState.openHours = [];
formState.personNumber = undefined;
2025-07-08 17:33:42 +08:00
formState.appointmentTime = undefined;
formState.meetingRoomType = undefined;
2025-07-07 17:24:28 +08:00
}
2025-07-07 16:31:20 +08:00
const [modal, modalApi] = useVbenModal({
connectedComponent: conferenceAddServicesModal,
});
2025-07-07 17:24:28 +08:00
function handleAdd(id:string|number) {
2025-07-08 17:33:42 +08:00
modalApi.setData({id});
2025-07-07 16:31:20 +08:00
modalApi.open();
}
2025-07-05 17:47:26 +08:00
</script>
<style lang="scss">
2025-07-08 17:33:42 +08:00
.form-box {
margin: 10px 0 0 5px;
2025-07-07 16:31:20 +08:00
}
2025-07-08 17:33:42 +08:00
.card-box {
2025-07-05 17:47:26 +08:00
width: 100%;
background-color: transparent;
padding: 30px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 30px;
border: none;
2025-07-08 17:33:42 +08:00
.card-list {
2025-07-05 17:47:26 +08:00
padding: 15px;
background-color: white;
border: 1px solid gray;
border-radius: 10px;
position: relative;
2025-07-08 17:33:42 +08:00
.card-title {
2025-07-07 16:31:20 +08:00
font-size: 25px;
2025-07-05 17:47:26 +08:00
font-weight: bold;
}
2025-07-08 17:33:42 +08:00
div {
2025-07-07 16:31:20 +08:00
margin: 0.5vw 0;
2025-07-05 17:47:26 +08:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2025-07-07 16:31:20 +08:00
max-width: 300px;
2025-07-05 17:47:26 +08:00
2025-07-08 17:33:42 +08:00
.card-button {
2025-07-05 17:47:26 +08:00
right: 15px;
position: absolute;
}
}
}
}
</style>