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

173 lines
4.6 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"
@finish="onFinish"
@finishFailed="onFinishFailed"
class="form-box"
>
<a-form-item label="会议日期">
2025-07-08 17:33:42 +08:00
<DatePicker v-model:value="formState.appointmentTime" style="width: 200px;"/>
</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="参会人数" style="width: 400px;">
2025-07-08 17:33:42 +08:00
<InputNumber style="width: 200px;" placeholder="请输入参会人数"
v-model:value="formState.personNumber"/>
2025-07-07 16:31:20 +08:00
</a-form-item>
<a-form-item class="form-button">
2025-07-07 17:24:28 +08:00
<a-button @click="handleClean">重置</a-button>
2025-07-09 10:36:42 +08:00
<a-button type="primary" class="primary-button"
:disabled="!formState.appointmentTime||!formState.openHours||!formState.personNumber"
@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
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';
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
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
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
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 = null;
formState.appointmentTime = 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
2025-07-08 17:33:42 +08:00
function handleAdd(id:string) {
modalApi.setData({id});
2025-07-07 16:31:20 +08:00
modalApi.open();
}
2025-07-08 17:33:42 +08:00
2025-07-07 16:31:20 +08:00
const onFinish = (values: any) => {
console.log('Success:', values);
};
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
2025-07-07 17:24:28 +08:00
2025-07-08 17:33:42 +08:00
const meetingList = ref<MeetVO[]>([])
2025-07-05 17:47:26 +08:00
</script>
<style lang="scss">
2025-07-08 17:33:42 +08:00
.form-box {
2025-07-07 16:31:20 +08:00
width: 100%;
2025-07-08 17:33:42 +08:00
padding: 10px 30px 0 30px;
2025-07-07 16:31:20 +08:00
position: relative;
2025-07-08 17:33:42 +08:00
.form-button {
2025-07-07 16:31:20 +08:00
position: absolute;
right: 30px;
2025-07-08 17:33:42 +08:00
.primary-button {
2025-07-07 16:31:20 +08:00
margin-left: 15px;
}
}
}
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>