Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<script setup lang="ts">
|
||||
import type {BookingVO} from '#/api/property/roomBooking/conferenceReservationRecords/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {bookingInfo} from '#/api/property/roomBooking/conferenceReservationRecords';
|
||||
import {renderDict} from "#/utils/render";
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
conferenceReservationRecordsDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const conferenceReservationRecordsDetail = shallowRef<null | BookingVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const res = await bookingInfo(id);
|
||||
conferenceReservationRecordsDetail.value = res;
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="会议室预约记录信息" class="w-[70%]">
|
||||
<Descriptions v-if="conferenceReservationRecordsDetail" size="small" :column="2" bordered :labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="会议室名称">
|
||||
{{ conferenceReservationRecordsDetail.name}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室地址">
|
||||
{{ conferenceReservationRecordsDetail.locationName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属单位">
|
||||
{{ conferenceReservationRecordsDetail.unitName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预定人">
|
||||
{{ conferenceReservationRecordsDetail.personName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系方式">
|
||||
{{ conferenceReservationRecordsDetail.phone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预定时间">
|
||||
{{ conferenceReservationRecordsDetail.scheduledStarttime + '-' + conferenceReservationRecordsDetail.scheduledEndtime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="参会人数">
|
||||
{{ conferenceReservationRecordsDetail.personSum }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="费用">
|
||||
{{ conferenceReservationRecordsDetail.price }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否有增值服务" v-if="conferenceReservationRecordsDetail.payState!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceReservationRecordsDetail.payState,'pro_add_service')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="支付状态" v-if="conferenceReservationRecordsDetail.payState!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceReservationRecordsDetail.payState,'pro_charging_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约状态" v-if="conferenceReservationRecordsDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceReservationRecordsDetail.state,'pro_appointment_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="提交时间">
|
||||
{{ conferenceReservationRecordsDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -1,101 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { bookingAdd, bookingInfo, bookingUpdate } from '#/api/property/roomBooking/conferenceReservationRecords';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await bookingInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? bookingUpdate(data) : bookingAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -25,7 +25,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
options: getDictOptions('pro_appointment_status'),
|
||||
},
|
||||
fieldName: 'state',
|
||||
label: '预约状态',
|
||||
@@ -33,25 +33,19 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '会议室名称',
|
||||
field: 'name',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '会议室地址',
|
||||
field: 'meetLocation',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '所属单位',
|
||||
field: 'unit',
|
||||
field: 'unitName',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预定人',
|
||||
field: 'person',
|
||||
field: 'personName',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
@@ -59,15 +53,29 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'phone',
|
||||
minWidth:'120'
|
||||
},
|
||||
// {
|
||||
// title: '预定时间',
|
||||
// field: 'scheduledStarttime',
|
||||
// minWidth: '180',
|
||||
// formatter: ({ row }) => {
|
||||
// return `${row.scheduledStarttime} ~ ${row.scheduledEndtime}`;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '预定开始时间',
|
||||
title: '预定时间',
|
||||
field: 'scheduledStarttime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预定结束时间',
|
||||
field: 'scheduledEndtime',
|
||||
minWidth:'120'
|
||||
minWidth: '180',
|
||||
formatter: ({ row }) => {
|
||||
const start = row.scheduledStarttime;
|
||||
const end = row.scheduledEndtime;
|
||||
|
||||
const startDate = start.substring(0, 10);
|
||||
const endDate = end.substring(0, 10);
|
||||
|
||||
const endDisplay = startDate === endDate ? end.substring(11) : end;
|
||||
|
||||
return `${start}-${endDisplay}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '参会人数',
|
||||
@@ -82,6 +90,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '是否有增值服务',
|
||||
field: 'attach',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.attach, 'pro_add_service');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
@@ -99,14 +112,14 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.state, 'wy_yyzt');
|
||||
return renderDict(row.state, 'pro_appointment_status');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
field: 'updateTime',
|
||||
field: 'createTime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
@@ -117,126 +130,3 @@ export const columns: VxeGridProps['columns'] = [
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议室名称',
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室id',
|
||||
fieldName: 'meetId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室地址',
|
||||
fieldName: 'meetLocation',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '所属单位',
|
||||
fieldName: 'unit',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预定人',
|
||||
fieldName: 'person',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
fieldName: 'phone',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预定开始时间',
|
||||
fieldName: 'scheduledStarttime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预定结束时间',
|
||||
fieldName: 'scheduledEndtime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '参会人数',
|
||||
fieldName: 'personSum',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '费用',
|
||||
fieldName: 'price',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '是否包含增值服务',
|
||||
fieldName: 'attach',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '支付状态',
|
||||
fieldName: 'payState',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.PRO_CHARGING_STATUS 便于维护
|
||||
options: getDictOptions('pro_charging_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
@@ -1,21 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import { Popconfirm, Space } from 'ant-design-vue';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
bookingList,
|
||||
bookingRemove,
|
||||
bookingUpdate,
|
||||
} from '#/api/property/roomBooking/conferenceReservationRecords';
|
||||
import type { BookingForm } from '#/api/property/roomBooking/conferenceReservationRecords/model';
|
||||
|
||||
import ConferenceReservationRecordsModal from './conferenceReservationRecords-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import conferenceReservationRecordsDetail
|
||||
from "#/views/property/roomBooking/conferenceReservationRecords/conferenceReservationRecords-detail.vue";
|
||||
import type {BookingForm} from "#/api/property/roomBooking/conferenceReservationRecords/model";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -30,9 +28,7 @@ const formOptions: VbenFormProps = {
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
},
|
||||
columns,
|
||||
@@ -61,87 +57,67 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [BookingModal, modalApi] = useVbenModal({
|
||||
connectedComponent: ConferenceReservationRecordsModal,
|
||||
const [conferenceReservationRecordsDetailModal, conferenceReservationRecordsDetailApi] = useVbenModal({
|
||||
connectedComponent: conferenceReservationRecordsDetail,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
async function handleInfo(row: Required<BookingForm>) {
|
||||
conferenceReservationRecordsDetailApi.setData({ id: row.id });
|
||||
conferenceReservationRecordsDetailApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<BookingForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<BookingForm>) {
|
||||
await bookingRemove(row.id);
|
||||
async function handleExamine(row: Required<BookingForm>) {
|
||||
row.state = 2
|
||||
await bookingUpdate(row);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<BookingForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await bookingRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
async function handleUnsubscribe(row: Required<BookingForm>) {
|
||||
row.state = 3
|
||||
await bookingUpdate(row);
|
||||
await tableApi.query();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="会议室预约记录列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['system:booking:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['system:booking:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['system:booking:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
title="确认通过?"
|
||||
@confirm="handleExamine(row)"
|
||||
v-if="row.state === 0"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['system:booking:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认退订?"
|
||||
@confirm="handleUnsubscribe(row)"
|
||||
v-if="!(row.state === 2) && !(row.state === 3)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '退订' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ConferenceReservationRecordsModal @reload="tableApi.query()" />
|
||||
<conferenceReservationRecordsDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -0,0 +1,238 @@
|
||||
<script setup lang="ts">
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {attachListAll} from '#/api/property/roomBooking/conferenceAddServices';
|
||||
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
import {modalSchema} from './data';
|
||||
import type {conferenceSettingsDetail} from "#/api/property/roomBooking/conferenceSettings/model";
|
||||
import type {AttachVO} from "#/api/property/roomBooking/conferenceAddServices/model";
|
||||
import {addServiceColumns} from "./data";
|
||||
import {Table, InputNumber, TimeRangePicker} from "ant-design-vue";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {resident_unitList} from "#/api/property/resident/unit";
|
||||
import {reservationAdd} from "#/api/property/roomBooking/conferenceReservations";
|
||||
import {ref} from "vue";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const conferenceSettingDetail = ref<conferenceSettingsDetail>()
|
||||
const addServiceList = ref<AttachVO[]>([])
|
||||
const totalAmount = ref<number>(0)
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
await handleOpenChange()
|
||||
await queryAddServices()
|
||||
await queryPersonData()
|
||||
await queryUnitData()
|
||||
await formApi.setValues({
|
||||
attach: '1',
|
||||
})
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.meetId=conferenceSettingDetail.value?.id;
|
||||
data.name=conferenceSettingDetail.value?.name;
|
||||
if (data.timeSpan && data.timeSpan.length) {
|
||||
data.scheduledStarttime = data.timeSpan[0]?.format("HH:mm");
|
||||
data.scheduledEndtime = data.timeSpan[1]?.format("HH:mm");
|
||||
}
|
||||
data.price=totalAmount.value
|
||||
if(data.attach=='0'){
|
||||
data.meetAttachOrderBoList=addServiceList.value.filter(item=>item.quantity>0);
|
||||
}
|
||||
await (reservationAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function handleOpenChange() {
|
||||
const {id} = modalApi.getData() as { id?: number };
|
||||
if (id) {
|
||||
conferenceSettingDetail.value = await meetInfo(id);
|
||||
}
|
||||
}
|
||||
|
||||
async function queryAddServices() {
|
||||
const res = await attachListAll()
|
||||
addServiceList.value = res.map(item => ({
|
||||
meetAttachId: item.id,
|
||||
projectName: item.projectName,
|
||||
price: item.price,
|
||||
unit: item.unit,
|
||||
quantity: 0
|
||||
}))
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
filterOption: filterOption
|
||||
}),
|
||||
fieldName: 'person',
|
||||
}])
|
||||
}
|
||||
|
||||
async function queryUnitData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await resident_unitList(params);
|
||||
const options = res.rows.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
filterOption: filterOption,
|
||||
showSearch:true,
|
||||
}),
|
||||
fieldName: 'unit',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
async function changeProjectNum() {
|
||||
totalAmount.value = 0;
|
||||
addServiceList.value.forEach(item => {
|
||||
totalAmount.value += item.price * item.quantity
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal title="会议室预约">
|
||||
<div class="detail-box" v-if="conferenceSettingDetail">
|
||||
<div>
|
||||
<span>会议室名称: {{ conferenceSettingDetail.name }}</span>
|
||||
<span>容纳人数: {{ conferenceSettingDetail.personNumber }}</span>
|
||||
</div>
|
||||
<div><span>会议室地址: {{ conferenceSettingDetail.locationName }}</span>
|
||||
<span>配套设备: {{ conferenceSettingDetail.baseService }}</span>
|
||||
</div>
|
||||
<div><span>会议室负责人: {{ conferenceSettingDetail.principalsName }}</span>
|
||||
<span>联系电话: {{ conferenceSettingDetail.phoneNo }}</span>
|
||||
</div>
|
||||
<div><span>基础费用: {{
|
||||
conferenceSettingDetail.expenseType == '2' ? conferenceSettingDetail.basePrice + '元' :
|
||||
renderDictValue(conferenceSettingDetail.expenseType, 'wy_fyms')
|
||||
}}</span>
|
||||
<span>开放时段:{{ conferenceSettingDetail.openHours }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<BasicForm>
|
||||
<template #timeSpan="slotProps">
|
||||
<TimeRangePicker style="width: 200px;" format="HH:mm"
|
||||
v-bind="slotProps"></TimeRangePicker>
|
||||
</template>
|
||||
<template #serverInfo="slotProps">
|
||||
<Table :dataSource="addServiceList" v-bind="slotProps" :columns="addServiceColumns"
|
||||
:pagination="false"
|
||||
size="small" :show-header="false" bordered>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.field === 'price'">
|
||||
{{ record.price + '元/' + renderDictValue(record.unit, 'pro_product_unit') }}
|
||||
</template>
|
||||
<template v-else-if="column.field === 'quantity'">
|
||||
<InputNumber id="inputNumber" v-model:value="record.quantity" :min="0"
|
||||
:precision="0" @change="changeProjectNum"/>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ record[column.field] }}
|
||||
</template>
|
||||
</template>
|
||||
<template #footer v-if="totalAmount">
|
||||
<div style="text-align: right;margin-right: 20px">
|
||||
<b>总金额(元):</b>
|
||||
{{ totalAmount }}
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.detail-box {
|
||||
width: 100%;
|
||||
|
||||
div {
|
||||
display: grid;
|
||||
margin: 20px;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -0,0 +1,118 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type {VxeGridProps} from "#/adapter/vxe-table";
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议预定人',
|
||||
fieldName: 'person',
|
||||
component: 'ApiSelect',
|
||||
rules: 'selectRequired',
|
||||
formItemClass:'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '使用单位',
|
||||
fieldName: 'unit',
|
||||
component: 'ApiSelect',
|
||||
rules: 'selectRequired',
|
||||
formItemClass:'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '会议主题',
|
||||
fieldName: 'meetTheme',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '预约日期',
|
||||
fieldName: 'appointmentTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预约时段',
|
||||
fieldName: 'timeSpan',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
slots:{
|
||||
default: 'meetTheme'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '参会人数',
|
||||
fieldName: 'personSum',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
min:1,
|
||||
precision:0,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Textarea',
|
||||
formItemClass:'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '是否需要增值服务',
|
||||
fieldName: 'attach',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: '0' },
|
||||
{ label: '否', value: '1' },
|
||||
],
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2',
|
||||
labelWidth:130
|
||||
},
|
||||
{
|
||||
label: '增值服务',
|
||||
fieldName: 'serverInfo',
|
||||
component: 'Input',
|
||||
formItemClass:'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) =>formValue.attach=='0' ,
|
||||
triggerFields: ['attach'],
|
||||
},
|
||||
slots:{default:'serverInfo'}
|
||||
},
|
||||
];
|
||||
export const addServiceColumns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '产品名称',
|
||||
field: 'projectName',
|
||||
width: 120,
|
||||
align:"center"
|
||||
},
|
||||
{
|
||||
title: '产品价格',
|
||||
field: 'price',
|
||||
width: 120,
|
||||
align:"center"
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
field: 'quantity',
|
||||
width: 200
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
@@ -1,53 +1,140 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="card-box">
|
||||
<Alert message="请先填写以下信息,查询可用会议室" show-icon banner closable type="info"></Alert>
|
||||
<a-form
|
||||
:model="formState"
|
||||
layout="inline"
|
||||
@finish="onFinish"
|
||||
@finishFailed="onFinishFailed"
|
||||
class="form-box"
|
||||
>
|
||||
<a-form-item label="会议日期">
|
||||
<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>
|
||||
</a-form-item>
|
||||
<a-form-item label="参会人数" style="width: 400px;">
|
||||
<InputNumber style="width: 200px;" placeholder="请输入参会人数"
|
||||
v-model:value="formState.personNumber"/>
|
||||
</a-form-item>
|
||||
<a-form-item class="form-button">
|
||||
<a-button @click="handleClean">重置</a-button>
|
||||
<a-button type="primary" class="primary-button"
|
||||
:disabled="!formState.appointmentTime||!formState.openHours||!formState.personNumber"
|
||||
@click="handleSearch">搜索</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div v-if="meetingList?.length" class="card-box">
|
||||
<div v-for="(item,index) in meetingList" :key="index" class="card-list">
|
||||
<div><span class="card-title">{{ item.one }}</span><a-button class="card-button" type="primary">去预约</a-button></div>
|
||||
<div>容纳人数: {{ item.two }}人</div>
|
||||
<div>基础费用: {{ item.three }}元</div>
|
||||
<div>基础服务: {{ item.four }}</div>
|
||||
<div>基础服务: {{ item.five }}</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="text-align: center;margin-top: 20%">
|
||||
<Empty :image="simpleImage"/>
|
||||
</div>
|
||||
<modal/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const meetingList = ref([
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
])
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {reactive} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {
|
||||
Form as AForm,
|
||||
FormItem as AFormItem,
|
||||
Button as AButton,
|
||||
TimeRangePicker,
|
||||
InputNumber,
|
||||
Empty,
|
||||
Alert,
|
||||
DatePicker
|
||||
} from 'ant-design-vue';
|
||||
import conferenceAddServicesModal from '../conferenceReservations/conferenceReservations-modal.vue';
|
||||
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';
|
||||
|
||||
interface FormState {
|
||||
openHours?: any[];
|
||||
personNumber?: number|undefined;
|
||||
appointmentTime?:Dayjs|undefined
|
||||
}
|
||||
|
||||
const formState = reactive<FormState>({
|
||||
openHours: [],
|
||||
personNumber: undefined,
|
||||
appointmentTime:undefined
|
||||
});
|
||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||
|
||||
async function handleSearch() {
|
||||
let hours = '';
|
||||
if (formState.openHours && formState.openHours.length) {
|
||||
hours = formState.openHours[0]?.format("HH:mm") + '-' + formState.openHours[1]?.format("HH:mm");
|
||||
}
|
||||
const obj = {
|
||||
openHours: hours??undefined,
|
||||
personNumber: formState.personNumber,
|
||||
appointmentTime:formState.appointmentTime?formState.appointmentTime.format('YYYY-MM-DD'):undefined
|
||||
}
|
||||
meetingList.value =await notlist(obj);
|
||||
}
|
||||
|
||||
const handleClean = () => {
|
||||
formState.openHours = [];
|
||||
formState.personNumber = null;
|
||||
formState.appointmentTime = undefined;
|
||||
}
|
||||
|
||||
const [modal, modalApi] = useVbenModal({
|
||||
connectedComponent: conferenceAddServicesModal,
|
||||
});
|
||||
|
||||
function handleAdd(id:string) {
|
||||
modalApi.setData({id});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
console.log('Success:', values);
|
||||
};
|
||||
const onFinishFailed = (errorInfo: any) => {
|
||||
console.log('Failed:', errorInfo);
|
||||
};
|
||||
|
||||
const meetingList = ref<MeetVO[]>([])
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.card-box{
|
||||
.form-box {
|
||||
width: 100%;
|
||||
padding: 10px 30px 0 30px;
|
||||
position: relative;
|
||||
|
||||
.form-button {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
|
||||
.primary-button {
|
||||
margin-left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-box {
|
||||
width: 100%;
|
||||
background-color: transparent;
|
||||
padding: 30px;
|
||||
@@ -56,28 +143,26 @@ const meetingList = ref([
|
||||
gap: 30px;
|
||||
border: none;
|
||||
|
||||
.card-list{
|
||||
.card-list {
|
||||
padding: 15px;
|
||||
background-color: white;
|
||||
border: 1px solid gray;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
|
||||
.card-title{
|
||||
font-size: 1.2vw;
|
||||
.card-title {
|
||||
font-size: 25px;
|
||||
font-weight: bold;
|
||||
}
|
||||
div:nth-child(1){
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
div{
|
||||
line-height: 1.5vw;
|
||||
|
||||
div {
|
||||
margin: 0.5vw 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 200px;
|
||||
max-width: 300px;
|
||||
|
||||
.card-button{
|
||||
.card-button {
|
||||
right: 15px;
|
||||
position: absolute;
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -26,34 +27,52 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await meetInfo(id);
|
||||
conferenceSettingsDetail.value = response;
|
||||
conferenceSettingsDetail.value =await meetInfo(id);
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
|
||||
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="产品名称">
|
||||
{{ conferenceSettingsDetail.projectName}}
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="会议室详情" class="w-[70%]">
|
||||
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="会议室名称">
|
||||
{{ conferenceSettingsDetail.name }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单价(元)">
|
||||
{{ conferenceSettingsDetail.price }}
|
||||
<DescriptionsItem label="可容纳人数">
|
||||
{{ conferenceSettingsDetail.personNumber }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位">
|
||||
{{ conferenceSettingsDetail.unit }}
|
||||
<DescriptionsItem label="会议室地址" :span="2">
|
||||
{{ conferenceSettingsDetail.locationName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="类型" v-if="conferenceSettingsDetail.type!=null">
|
||||
<DescriptionsItem label="配套设备" :span="2">
|
||||
{{ conferenceSettingsDetail.baseService }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="负责人" :span="2">
|
||||
{{ conferenceSettingsDetail.principalsName+'-'+conferenceSettingsDetail.phoneNo }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="费用模式" :span="conferenceSettingsDetail.expenseType=='2'?1:2">
|
||||
<component
|
||||
:is="renderDict(conferenceSettingsDetail.type,'wy_parking_spot')"
|
||||
:is="renderDict(conferenceSettingsDetail.expenseType,'wy_fyms')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="conferenceSettingsDetail.state!=null">
|
||||
<DescriptionsItem label="付费金额(元)" v-if="conferenceSettingsDetail.expenseType=='2'">
|
||||
{{ conferenceSettingsDetail.basePrice }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室图片" :span="2">
|
||||
{{ conferenceSettingsDetail.picture }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约是否审核">
|
||||
<component
|
||||
:is="renderDict(conferenceSettingsDetail.state,'wy_appointment_tatus')"
|
||||
:is="renderDict(conferenceSettingsDetail.isCheck,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开放时段" :span="2">
|
||||
{{ conferenceSettingsDetail.openHours }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室描述" :span="2">
|
||||
{{ conferenceSettingsDetail.descs }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -1,16 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep, getPopupContainer, handleNode} from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { meetAdd, meetInfo, meetUpdate } from '#/api/property/roomBooking/conferenceSettings';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {meetAdd, meetInfo, meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import {modalSchema} from './data';
|
||||
import {TimeRangePicker} from 'ant-design-vue'
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {communityTree} from "#/api/property/community";
|
||||
import dayjs from 'dayjs';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
@@ -21,7 +25,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@@ -34,7 +38,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@@ -43,7 +47,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[60%]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -53,12 +57,22 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
await formApi.setValues({
|
||||
expenseType:'1',
|
||||
isCheck:'0',
|
||||
})
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
await queryPerson()
|
||||
await initLocationOptions()
|
||||
if (isUpdate.value && id) {
|
||||
const record = await meetInfo(id);
|
||||
record.expenseType=record.expenseType.toString()
|
||||
record.isCheck=record.isCheck.toString()
|
||||
let hour = record.openHours.split('-');
|
||||
if(hour.length>1){
|
||||
record.openHours=[dayjs(hour[0],'HH:mm'),dayjs(hour[1],'HH:mm')]
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -70,12 +84,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.openHours) {
|
||||
data.openHours = data.openHours[0]?.format("HH:mm") + '-' + data.openHours[1]?.format("HH:mm");
|
||||
}
|
||||
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -91,11 +108,76 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function queryPerson() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
filterOption: filterOption,
|
||||
showSearch:true,
|
||||
}),
|
||||
fieldName: 'principals',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* 地址数据
|
||||
*/
|
||||
async function initLocationOptions() {
|
||||
const locationList = await communityTree(5);
|
||||
const splitStr = '/';
|
||||
handleNode(locationList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 5) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
getPopupContainer,
|
||||
placeholder: '请选择会议室地址',
|
||||
showSearch: true,
|
||||
treeData: locationList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: {showLeafIcon: false},
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
}),
|
||||
fieldName: 'location',
|
||||
},
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm>
|
||||
<template #openHours="slotProps">
|
||||
<TimeRangePicker v-bind="slotProps" format="HH:mm"></TimeRangePicker>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
@@ -10,69 +10,70 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'name',
|
||||
label: '会议室名称',
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'personNumber',
|
||||
label: '可容纳人数',
|
||||
componentProps: {
|
||||
min: 1,
|
||||
step: 1,
|
||||
precision:0,
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('meeting_room_status'),
|
||||
},
|
||||
fieldName: 'attach',
|
||||
fieldName: 'status',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'createById',
|
||||
label: '创建人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'updateById',
|
||||
label: '更新人id',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '会议室名称',
|
||||
field: 'name',
|
||||
minWidth:100,
|
||||
},
|
||||
{
|
||||
title: '会议室地址',
|
||||
field: 'location',
|
||||
field: 'locationName',
|
||||
width:210,
|
||||
},
|
||||
{
|
||||
title: '可容纳人数',
|
||||
field: 'personNumber',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '基础服务',
|
||||
field: 'baseServiceId',
|
||||
title: '费用模式',
|
||||
field: 'expenseType',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.expenseType, 'wy_fyms');
|
||||
},
|
||||
},
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '基础价格',
|
||||
field: 'basePrice',
|
||||
title: '开放时段',
|
||||
field: 'openHours',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'attach',
|
||||
field: 'status',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.attach, 'meeting_room_status');
|
||||
},
|
||||
default: 'status'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建人id',
|
||||
field: 'createById',
|
||||
},
|
||||
{
|
||||
title: '更新人id',
|
||||
field: 'updateById',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@@ -93,50 +94,96 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室地址',
|
||||
fieldName: 'location',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-1',
|
||||
},
|
||||
{
|
||||
label: '可容纳人数',
|
||||
fieldName: 'personNumber',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '基础服务',
|
||||
fieldName: 'baseServiceId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '基础价格',
|
||||
fieldName: 'basePrice',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'attach',
|
||||
component: 'Select',
|
||||
formItemClass: 'col-span-1',
|
||||
componentProps: {
|
||||
options: getDictOptions('meeting_room_status'),
|
||||
},
|
||||
min: 1,
|
||||
step: 1,
|
||||
precision:0,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '会议室地址',
|
||||
fieldName: 'location',
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
label: '配套设备',
|
||||
fieldName: 'baseService',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
label: '负责人',
|
||||
fieldName: 'principals',
|
||||
component: 'Select',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '费用模式',
|
||||
fieldName: 'expenseType',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_fyms'),
|
||||
},
|
||||
formItemClass: 'col-span-1',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '付费金额',
|
||||
fieldName: 'basePrice',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
min: 0,
|
||||
step: 1,
|
||||
precision:2,
|
||||
},
|
||||
formItemClass: 'col-span-1',
|
||||
dependencies: {
|
||||
// 仅当 费用模式 为 2(付费) 时显示
|
||||
show: (formValues: any) => formValues.expenseType === '2',
|
||||
triggerFields: ['expenseType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室图片',
|
||||
fieldName: 'picture',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 10, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预约是否需要审核',
|
||||
fieldName: 'isCheck',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
labelWidth:130,
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '开放时段',
|
||||
fieldName: 'openHours',
|
||||
component: 'Input',
|
||||
slots: {default: 'openHours'},
|
||||
formItemClass: 'col-span-1',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室描述',
|
||||
fieldName: 'descs',
|
||||
component: 'Textarea',
|
||||
},
|
||||
];
|
||||
|
@@ -13,9 +13,12 @@ import {
|
||||
meetRemove,
|
||||
} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import type { MeetForm } from '#/api/property/roomBooking/conferenceSettings/model';
|
||||
import ConferenceSettingsModal from './conferenceSettings-modal.vue';
|
||||
import conferenceSettingsModal from './conferenceSettings-modal.vue';
|
||||
import ConferenceSettingsDetail from './conferenceSettings-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {useAccess} from "@vben/access";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -62,8 +65,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [conferenceSettingsModal, modalApi] = useVbenModal({
|
||||
connectedComponent: ConferenceSettingsModal,
|
||||
const [ConferenceSettingsModal, modalApi] = useVbenModal({
|
||||
connectedComponent: conferenceSettingsModal,
|
||||
});
|
||||
|
||||
const [ConferenceSettingsDetailModal, ConferenceSettingsDetailApi] = useVbenModal({
|
||||
@@ -103,6 +106,8 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -156,8 +161,20 @@ function handleMultiDelete() {
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<TableSwitch
|
||||
:checkedValue="0"
|
||||
:unCheckedValue="1"
|
||||
:checkedText="'启用'"
|
||||
:unCheckedText="'停用'"
|
||||
v-model:value="row.status"
|
||||
:api="() => meetUpdate(row)"
|
||||
:disabled=" !hasAccessByCodes(['system:meet:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<conferenceSettingsModal @reload="tableApi.query()" />
|
||||
<ConferenceSettingsModal @reload="tableApi.query()" />
|
||||
<ConferenceSettingsDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user