Compare commits
2 Commits
80f0b9bd10
...
e860009b61
Author | SHA1 | Date | |
---|---|---|---|
e860009b61 | |||
2f38afa645 |
@ -1,8 +1,6 @@
|
||||
import type { BookingVO, BookingForm, BookingQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
@ -12,7 +10,7 @@ import { requestClient } from '#/api/request';
|
||||
* @returns booking列表
|
||||
*/
|
||||
export function bookingList(params?: BookingQuery) {
|
||||
return requestClient.get<PageResult<BookingVO>>('/system/booking/list', { params });
|
||||
return requestClient.get<PageResult<BookingVO>>('/property/meetbooking/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -30,7 +28,7 @@ export function bookingExport(params?: BookingQuery) {
|
||||
* @returns booking详情
|
||||
*/
|
||||
export function bookingInfo(id: ID) {
|
||||
return requestClient.get<BookingVO>(`/system/booking/${id}`);
|
||||
return requestClient.get<BookingVO>(`/property/meetbooking/{id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,7 +85,6 @@ export interface BookingVO {
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface BookingForm extends BaseEntity {
|
||||
@ -173,7 +172,6 @@ export interface BookingForm extends BaseEntity {
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface BookingQuery extends PageQuery {
|
||||
|
@ -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:'100px'}">
|
||||
<DescriptionsItem label="会议室名称">
|
||||
{{ conferenceReservationRecordsDetail.name}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室地址">
|
||||
{{ conferenceReservationRecordsDetail.meetLocation }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属单位">
|
||||
{{ conferenceReservationRecordsDetail.unit }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预定人">
|
||||
{{ conferenceReservationRecordsDetail.person }}
|
||||
</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,'wy_yyzt')"
|
||||
/>
|
||||
</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>
|
||||
|
@ -33,7 +33,6 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '会议室名称',
|
||||
field: 'name',
|
||||
@ -60,14 +59,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预定开始时间',
|
||||
title: '预定时间',
|
||||
field: 'scheduledStarttime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预定结束时间',
|
||||
field: 'scheduledEndtime',
|
||||
minWidth:'120'
|
||||
minWidth: '180',
|
||||
formatter: ({ row }) => {
|
||||
return `${row.scheduledStarttime} ~ ${row.scheduledEndtime}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '参会人数',
|
||||
@ -82,6 +79,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '是否有增值服务',
|
||||
field: 'attach',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.attach, 'pro_add_service');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
@ -209,7 +211,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'payState',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.PRO_CHARGING_STATUS 便于维护
|
||||
options: getDictOptions('pro_charging_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
@ -219,7 +220,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'state',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
|
@ -1,21 +1,18 @@
|
||||
<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,
|
||||
} 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 +27,7 @@ const formOptions: VbenFormProps = {
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
},
|
||||
columns,
|
||||
@ -61,70 +56,59 @@ 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>) {
|
||||
await handleInfo(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>) {
|
||||
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="handleExamine(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleUnsubscribe(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '退订' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
@ -132,16 +116,14 @@ function handleMultiDelete() {
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['system:booking:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
{{ '改签' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ConferenceReservationRecordsModal @reload="tableApi.query()" />
|
||||
<conferenceReservationRecordsDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -27,7 +27,7 @@ export default defineConfig(async () => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
target: 'http://192.168.0.103:8080',
|
||||
target: 'http://192.168.0.108:8080',
|
||||
// target: 'http://192.168.0.106:8080',
|
||||
// target: 'http://47.109.37.87:3010',
|
||||
ws: true,
|
||||
|
Loading…
Reference in New Issue
Block a user