会议管理
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
FLL
2025-07-04 17:56:14 +08:00
parent e21c76cc6f
commit e28ddabf57
20 changed files with 1433 additions and 520 deletions

View File

@@ -40,7 +40,6 @@ export interface AttachVO {
* *
*/ */
createTime: string; createTime: string;
} }
export interface AttachForm extends BaseEntity { export interface AttachForm extends BaseEntity {
@@ -117,3 +116,45 @@ export interface AttachQuery extends PageQuery {
*/ */
params?: any; params?: any;
} }
export interface conferenceAddServices extends BaseEntity {
/**
*
*/
id: string | number;
/**
* id
*/
meetId: string | number;
/**
*
*/
projectName: string;
/**
*
*/
price: number;
/**
*
*/
unit: string;
/**
*
*/
type: string;
/**
*
*/
state: number;
/**
*
*/
createTime: string;
}

View File

@@ -0,0 +1,61 @@
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';
/**
* 查询booking列表
* @param params
* @returns booking列表
*/
export function bookingList(params?: BookingQuery) {
return requestClient.get<PageResult<BookingVO>>('/system/booking/list', { params });
}
/**
* 导出booking列表
* @param params
* @returns booking列表
*/
export function bookingExport(params?: BookingQuery) {
return commonExport('/system/booking/export', params ?? {});
}
/**
* 查询booking详情
* @param id id
* @returns booking详情
*/
export function bookingInfo(id: ID) {
return requestClient.get<BookingVO>(`/system/booking/${id}`);
}
/**
* 新增booking
* @param data
* @returns void
*/
export function bookingAdd(data: BookingForm) {
return requestClient.postWithMsg<void>('/system/booking', data);
}
/**
* 更新booking
* @param data
* @returns void
*/
export function bookingUpdate(data: BookingForm) {
return requestClient.putWithMsg<void>('/system/booking', data);
}
/**
* 删除booking
* @param id id
* @returns void
*/
export function bookingRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/system/booking/${id}`);
}

View File

@@ -0,0 +1,264 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface BookingVO {
/**
* 主键
*/
id: string | number;
/**
* 会议室名称
*/
name: string;
/**
* 会议室id
*/
meetId: string | number;
/**
* 会议室地址
*/
meetLocation: string;
/**
* 所属单位
*/
unit: string;
/**
* 预定人
*/
person: string;
/**
* 联系方式
*/
phone: string;
/**
* 预定开始时间
*/
scheduledStarttime: string;
/**
* 预定结束时间
*/
scheduledEndtime: string;
/**
* 参会人数
*/
personSum: number;
/**
* 费用
*/
price: number;
/**
* 是否包含增值服务
*/
attach: number;
/**
* 支付状态
*/
payState: number;
/**
* 状态
*/
state: number;
/**
* 创建人id
*/
createById: string | number;
/**
* 更新人id
*/
updateById: string | number;
/**
* 搜索值
*/
searchValue: string;
}
export interface BookingForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 会议室名称
*/
name?: string;
/**
* 会议室id
*/
meetId?: string | number;
/**
* 会议室地址
*/
meetLocation?: string;
/**
* 所属单位
*/
unit?: string;
/**
* 预定人
*/
person?: string;
/**
* 联系方式
*/
phone?: string;
/**
* 预定开始时间
*/
scheduledStarttime?: string;
/**
* 预定结束时间
*/
scheduledEndtime?: string;
/**
* 参会人数
*/
personSum?: number;
/**
* 费用
*/
price?: number;
/**
* 是否包含增值服务
*/
attach?: number;
/**
* 支付状态
*/
payState?: number;
/**
* 状态
*/
state?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
}
export interface BookingQuery extends PageQuery {
/**
* 会议室名称
*/
name?: string;
/**
* 会议室id
*/
meetId?: string | number;
/**
* 会议室地址
*/
meetLocation?: string;
/**
* 所属单位
*/
unit?: string;
/**
* 预定人
*/
person?: string;
/**
* 联系方式
*/
phone?: string;
/**
* 预定开始时间
*/
scheduledStarttime?: string;
/**
* 预定结束时间
*/
scheduledEndtime?: string;
/**
* 参会人数
*/
personSum?: number;
/**
* 费用
*/
price?: number;
/**
* 是否包含增值服务
*/
attach?: number;
/**
* 支付状态
*/
payState?: number;
/**
* 状态
*/
state?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { MeetVO, MeetForm, MeetQuery } 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';
/**
* 查询会议室设置列表
* @param params
* @returns 会议室设置列表
*/
export function meetList(params?: MeetQuery) {
return requestClient.get<PageResult<MeetVO>>('/system/meet/list', { params });
}
/**
* 导出会议室设置列表
* @param params
* @returns 会议室设置列表
*/
export function meetExport(params?: MeetQuery) {
return commonExport('/system/meet/export', params ?? {});
}
/**
* 查询会议室设置详情
* @param id id
* @returns 会议室设置详情
*/
export function meetInfo(id: ID) {
return requestClient.get<MeetVO>(`/system/meet/${id}`);
}
/**
* 新增会议室设置
* @param data
* @returns void
*/
export function meetAdd(data: MeetForm) {
return requestClient.postWithMsg<void>('/system/meet', data);
}
/**
* 更新会议室设置
* @param data
* @returns void
*/
export function meetUpdate(data: MeetForm) {
return requestClient.putWithMsg<void>('/system/meet', data);
}
/**
* 删除会议室设置
* @param id id
* @returns void
*/
export function meetRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/system/meet/${id}`);
}

View File

@@ -0,0 +1,159 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface MeetVO {
/**
* 主键
*/
id: string | number;
/**
* 会议室名称
*/
name: string;
/**
* 位置
*/
location: string;
/**
* 容纳人数
*/
personNumber: number;
/**
* 基础服务
*/
baseServiceId: string | number;
/**
* 基础价格
*/
basePrice: number;
/**
* 增值服务是否启用
*/
attach: number;
/**
* 创建人id
*/
createById: string | number;
/**
* 更新人id
*/
updateById: string | number;
/**
* 搜索值
*/
searchValue: string;
}
export interface MeetForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 会议室名称
*/
name?: string;
/**
* 位置
*/
location?: string;
/**
* 容纳人数
*/
personNumber?: number;
/**
* 基础服务
*/
baseServiceId?: string | number;
/**
* 基础价格
*/
basePrice?: number;
/**
* 增值服务是否启用
*/
attach?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
}
export interface MeetQuery extends PageQuery {
/**
* 会议室名称
*/
name?: string;
/**
* 位置
*/
location?: string;
/**
* 容纳人数
*/
personNumber?: number;
/**
* 基础服务
*/
baseServiceId?: string | number;
/**
* 基础价格
*/
basePrice?: number;
/**
* 增值服务是否启用
*/
attach?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,182 +0,0 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
attachExport,
attachList,
attachRemove,
} from '#/api/property/attach';
import type { AttachForm } from '#/api/property/attach/model';
import { commonDownloadExcel } from '#/utils/file/download';
import attachModal from './attach-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await attachList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-attach-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [AttachModal, modalApi] = useVbenModal({
connectedComponent: attachModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<AttachForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<AttachForm>) {
await attachRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<AttachForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await attachRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(attachExport, '会议室增值服务数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="会议室增值服务列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:attach:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:attach:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:attach:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:attach:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:attach:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<AttachModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -64,47 +64,47 @@ export const columns: VxeGridProps['columns'] = [
return (rowIndex + 1).toString(); return (rowIndex + 1).toString();
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '订单号', title: '订单号',
field: 'orderId', field: 'orderId',
width: 'auto' minWidth: '120'
}, },
{ {
title: '租赁合同编号', title: '租赁合同编号',
field: 'userId', field: 'userId',
width: 'auto' minWidth: '120'
}, },
{ {
title: '租赁人', title: '租赁人',
field: 'userName', field: 'userName',
width: 'auto' minWidth: '120'
}, },
{ {
title: '租金', title: '租金',
field: 'rent', field: 'rent',
width: 'auto' minWidth: '120'
}, },
{ {
title: '押金', title: '押金',
field: 'deposit', field: 'deposit',
width: 'auto' minWidth: '120'
}, },
{ {
title: '违约金', title: '违约金',
field: 'penalty', field: 'penalty',
width: 'auto' minWidth: '120'
}, },
{ {
title: '总金额', title: '总金额',
field: 'totalAmount', field: 'totalAmount',
width: 'auto' minWidth: '120'
}, },
{ {
title: '收费日期', title: '收费日期',
field: 'chargeDate', field: 'chargeDate',
width: 'auto' minWidth: '120'
}, },
{ {
title: '支付方式', title: '支付方式',
@@ -114,7 +114,7 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.paymentMethod, 'pro_payment_method'); return renderDict(row.paymentMethod, 'pro_payment_method');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '开票状态', title: '开票状态',
@@ -124,12 +124,12 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.invoiceStatus, 'pro_invoice_status'); return renderDict(row.invoiceStatus, 'pro_invoice_status');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '发票类型', title: '发票类型',
field: 'invoiceType', field: 'invoiceType',
width: 'auto' minWidth: '120'
}, },
{ {
title: '收费状态', title: '收费状态',
@@ -139,12 +139,12 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.chargeStatus, 'pro_charging_status'); return renderDict(row.chargeStatus, 'pro_charging_status');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '创建时间', title: '创建时间',
field: 'createTime', field: 'createTime',
width: 'auto' minWidth: '120'
}, },
{ {
field: 'action', field: 'action',

View File

@@ -31,17 +31,17 @@ export const columns: VxeGridProps['columns'] = [
return (rowIndex + 1).toString(); return (rowIndex + 1).toString();
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '养护名称', title: '养护名称',
field: 'maintainName', field: 'maintainName',
width: 'auto' minWidth: '120'
}, },
{ {
title: '服务地点房间id', title: '服务地点房间id',
field: 'roomId', field: 'roomId',
width: 'auto' minWidth: '120'
}, },
{ {
title: '服务类型', title: '服务类型',
@@ -51,7 +51,7 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.serveType, 'pro_service_type'); return renderDict(row.serveType, 'pro_service_type');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '养护周期类型', title: '养护周期类型',
@@ -61,27 +61,27 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.periodType, 'wy_time_unit'); return renderDict(row.periodType, 'wy_time_unit');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '养护周期频次', title: '养护周期频次',
field: 'periodFrequency', field: 'periodFrequency',
width: 'auto' minWidth: '120'
}, },
{ {
title: '关联订单', title: '关联订单',
field: 'orderId', field: 'orderId',
width: 'auto' minWidth: '120'
}, },
{ {
title: '计划执行时间', title: '计划执行时间',
field: 'startTime', field: 'startTime',
width: 'auto' minWidth: '120'
}, },
{ {
title: '计划完成时间', title: '计划完成时间',
field: 'endTime', field: 'endTime',
width: 'auto' minWidth: '120'
}, },
{ {
title: '巡检结果', title: '巡检结果',
@@ -91,12 +91,12 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.inspectResult, 'pro_inspection_results'); return renderDict(row.inspectResult, 'pro_inspection_results');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '处理措施', title: '处理措施',
field: 'measure', field: 'measure',
width: 'auto' minWidth: '120'
}, },
{ {
title: '客户评分', title: '客户评分',
@@ -109,12 +109,12 @@ export const columns: VxeGridProps['columns'] = [
}); });
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
title: '客户反馈', title: '客户反馈',
field: 'customerAdvice', field: 'customerAdvice',
width: 'auto' minWidth: '120'
}, },
{ {
title: '处理状态', title: '处理状态',
@@ -124,7 +124,7 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.state, 'pro_processing_status'); return renderDict(row.state, 'pro_processing_status');
}, },
}, },
width: 'auto' minWidth: '120'
}, },
{ {
field: 'action', field: 'action',

View File

@@ -26,15 +26,6 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 }, { type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{ {
title: '产品编号', title: '产品编号',
field: 'plantCode', field: 'plantCode',
@@ -104,12 +95,6 @@ export const modalSchema: FormSchemaGetter = () => [
triggerFields: [''], triggerFields: [''],
}, },
}, },
{
label: '产品编号',
fieldName: 'plantCode',
component: 'Input',
rules: 'required',
},
{ {
label: '产品名称', label: '产品名称',
fieldName: 'plantName', fieldName: 'plantName',

View File

@@ -0,0 +1,59 @@
<script setup lang="ts">
import type {conferenceAddServices} from '#/api/property/roomBooking/conferenceAddServices/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 {attachInfo} from '#/api/property/roomBooking/conferenceAddServices';
import {renderDict} from "#/utils/render";
dayjs.extend(duration);
dayjs.extend(relativeTime);
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
conferenceAddServicesDetail.value = null;
},
});
const conferenceAddServicesDetail = shallowRef<null | conferenceAddServices>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await attachInfo(id);
conferenceAddServicesDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
<Descriptions v-if="conferenceAddServicesDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="产品名称">
{{ conferenceAddServicesDetail.projectName}}
</DescriptionsItem>
<DescriptionsItem label="单价(元)">
{{ conferenceAddServicesDetail.price }}
</DescriptionsItem>
<DescriptionsItem label="单位">
{{ conferenceAddServicesDetail.unit }}
</DescriptionsItem>
<DescriptionsItem label="类型" v-if="conferenceAddServicesDetail.type!=null">
<component
:is="renderDict(conferenceAddServicesDetail.type,'wy_parking_spot')"
/>
</DescriptionsItem>
<DescriptionsItem label="状态" v-if="conferenceAddServicesDetail.state!=null">
<component
:is="renderDict(conferenceAddServicesDetail.state,'wy_appointment_tatus')"
/>
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { attachAdd, attachInfo, attachUpdate } from '#/api/property/attach'; import { attachAdd, attachInfo, attachUpdate } from '#/api/property/roomBooking/conferenceAddServices';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data'; import { modalSchema } from './data';
@@ -15,13 +15,13 @@ const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false); const isUpdate = ref(false);
const title = computed(() => { const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); return isUpdate.value ? $t('pages.common.edit') : $t('新增产品');
}); });
const [BasicForm, formApi] = useVbenForm({ const [BasicForm, formApi] = useVbenForm({
commonConfig: { commonConfig: {
// //
formItemClass: 'col-span-2', formItemClass: 'col-span-1',
// label px // label px
labelWidth: 80, labelWidth: 80,
// //
@@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
// //
class: 'w-[550px]', class: 'w-[60%]',
fullscreenButton: false, fullscreenButton: false,
onBeforeClose, onBeforeClose,
onClosed: handleClosed, onClosed: handleClosed,

View File

@@ -1,60 +1,40 @@
import type { FormSchemaGetter } from '#/adapter/form'; import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
component: 'Input', component: 'Input',
fieldName: 'meetId',
label: '会议室id',
},
{
component: 'Textarea',
fieldName: 'projectName', fieldName: 'projectName',
label: '产品名称', label: '产品名称',
}, },
{
component: 'Input',
fieldName: 'price',
label: '单价',
},
{
component: 'Input',
fieldName: 'unit',
label: '单位',
},
{ {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions('value_added_type'),
}, },
fieldName: 'type', fieldName: 'type',
label: '类型', label: '类型',
}, },
{ {
component: 'Input', component: 'Select',
componentProps: {
options: getDictOptions('product_management_status'),
},
fieldName: 'state', fieldName: 'state',
label: '状态', label: '状态',
}, },
]; ];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 }, { type: 'checkbox', width: 60 },
{
title: '主键',
field: 'id',
},
{
title: '会议室id',
field: 'meetId',
},
{ {
title: '产品名称', title: '产品名称',
field: 'projectName', field: 'projectName',
}, },
{ {
title: '单价', title: '单价(元)',
field: 'price', field: 'price',
}, },
{ {
@@ -64,14 +44,20 @@ export const columns: VxeGridProps['columns'] = [
{ {
title: '类型', title: '类型',
field: 'type', field: 'type',
slots: {
default: ({ row }) => {
return renderDict(row.type, 'value_added_type');
},
},
}, },
{ {
title: '状态', title: '状态',
field: 'state', field: 'state',
}, slots: {
{ default: ({ row }) => {
title: '创建时间', return renderDict(row.state, 'product_management_status');
field: 'createTime', },
},
}, },
{ {
field: 'action', field: 'action',
@@ -92,16 +78,10 @@ export const modalSchema: FormSchemaGetter = () => [
triggerFields: [''], triggerFields: [''],
}, },
}, },
{
label: '会议室id',
fieldName: 'meetId',
component: 'Input',
rules: 'required',
},
{ {
label: '产品名称', label: '产品名称',
fieldName: 'projectName', fieldName: 'projectName',
component: 'Textarea', component: 'Input',
rules: 'required', rules: 'required',
}, },
{ {
@@ -121,13 +101,17 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'type', fieldName: 'type',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions('value_added_type'),
}, },
rules: 'selectRequired', rules: 'selectRequired',
}, },
{ {
label: '状态', label: '状态',
fieldName: 'state', fieldName: 'state',
component: 'Input', component: 'Select',
rules: 'required', componentProps: {
options: getDictOptions('product_management_status'),
},
rules: 'selectRequired',
}, },
]; ];

View File

@@ -1,5 +1,166 @@
<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 {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
attachList,
attachRemove,
} from '#/api/property/roomBooking/conferenceAddServices';
import type { AttachForm } from '#/api/property/roomBooking/conferenceAddServices/model';
import conferenceAddServicesModal from './conferenceAddServices-modal.vue';
import { columns, querySchema } from './data';
import conferenceAddServicesDetail from "#/views/property/roomBooking/conferenceAddServices/conferenceAddServices-detail.vue";
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await attachList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-conferenceAddServices-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [ConferenceAddServicesModal, modalApi] = useVbenModal({
connectedComponent: conferenceAddServicesModal,
});
const [conferenceAddServicesDetailModal, conferenceAddServicesDetailApi] = useVbenModal({
connectedComponent: conferenceAddServicesDetail,
});
async function handleInfo(row: Required<AttachForm>) {
conferenceAddServicesDetailApi.setData({ id: row.id });
conferenceAddServicesDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<AttachForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<AttachForm>) {
await attachRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<AttachForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await attachRemove(ids);
await tableApi.query();
},
});
}
</script>
<template> <template>
<div>会议室增值服务</div> <Page :auto-content-height="true">
<BasicTable table-title="会议室增值服务列表">
<template #toolbar-tools>
<Space>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:conferenceAddServices:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:conferenceAddServices:add']"
@click="handleAdd"
>
{{ '新增产品' }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:conferenceAddServices:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:conferenceAddServices:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<ConferenceAddServicesModal @reload="tableApi.query()" />
<conferenceAddServicesDetailModal/>
</Page>
</template> </template>
<script></script>
<style lang="scss"></style>

View File

@@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { roomBookingAdd, roomBookingInfo, roomBookingUpdate } from '#/api/property/roomBooking'; import { bookingAdd, bookingInfo, bookingUpdate } from '#/api/property/roomBooking/conferenceReservationRecords';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data'; import { modalSchema } from './data';
@@ -58,7 +58,7 @@ const [BasicModal, modalApi] = useVbenModal({
isUpdate.value = !!id; isUpdate.value = !!id;
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await roomBookingInfo(id); const record = await bookingInfo(id);
await formApi.setValues(record); await formApi.setValues(record);
} }
await markInitialized(); await markInitialized();
@@ -76,7 +76,7 @@ async function handleConfirm() {
} }
// getValuesreadonly // getValuesreadonly
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? roomBookingUpdate(data) : roomBookingAdd(data)); await (isUpdate.value ? bookingUpdate(data) : bookingAdd(data));
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');
modalApi.close(); modalApi.close();

View File

@@ -1,117 +1,113 @@
import type { FormSchemaGetter } from '#/adapter/form'; import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict'; import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render'; import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
component: 'Input', component: 'Input',
fieldName: 'roomName', fieldName: 'name',
label: '会议室名称', label: '会议室名称',
}, },
{ {
component: 'Input', component: 'Input',
fieldName: 'bookingName', fieldName: 'person',
label: '会议预订人', label: '预定人',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_charging_status'),
},
fieldName: 'payState',
label: '支付状态',
}, },
{ {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
options: getDictOptions('wy_yyzt'), options: getDictOptions('wy_yyzt'),
}, },
fieldName: 'bookingStatus', fieldName: 'state',
label: '预约状态', label: '预约状态',
}, },
]; ];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 }, { type: 'checkbox', width: 60 },
{ {
title: '会议室id', title: '会议室名称',
field: 'tbConferenceId', field: 'name',
minWidth:'120'
}, },
{ {
title: '预约状态', title: '会议室地址',
field: 'bookingStatus', field: 'meetLocation',
slots: { minWidth:'120'
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
return renderDict(row.bookingStatus, 'wy_yyzt');
},
},
}, },
{ {
title: '审核状态', title: '所属单位',
field: 'reviewStatus', field: 'unit',
slots: { minWidth:'120'
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
return renderDict(row.reviewStatus, 'wy_shzt');
},
},
}, },
{ {
title: '会议预订人', title: '预定人',
field: 'bookingName', field: 'person',
minWidth:'120'
}, },
{ {
title: '使用单位', title: '联系方式',
field: 'userUnit', field: 'phone',
minWidth:'120'
}, },
{ {
title: '会议主题', title: '预定开始时间',
field: 'conferenceTheme', field: 'scheduledStarttime',
minWidth:'120'
}, },
{ {
title: '预约日期', title: '预定结束时间',
field: 'appointmentDate', field: 'scheduledEndtime',
}, minWidth:'120'
{
title: '预约开始时段',
field: 'appointmentBeginTime',
},
{
title: '预约结束时段',
field: 'appointmentEndTime',
},
{
title: '参会人员',
field: 'attendeesName',
}, },
{ {
title: '参会人数', title: '参会人数',
field: 'approverCount', field: 'personSum',
minWidth:'120'
}, },
{ {
title: '签到开始时间', title: '费用',
field: 'checkInStartTime', field: 'price',
minWidth:'120'
}, },
{ {
title: '签到结束时间', title: '是否有增值服务',
field: 'checkInEndTime', field: 'attach',
minWidth:'120'
}, },
{ {
title: '评价', title: '支付状态',
field: 'evaluate', field: 'payState',
},
{
title: '备注',
field: 'remark',
},
{
title: '是否需要增值服务',
field: 'addServices',
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护 return renderDict(row.payState, 'pro_charging_status');
return renderDict(row.addServices, 'wy_sf');
}, },
}, },
minWidth:'120'
},
{
title: '预约状态',
field: 'state',
slots: {
default: ({ row }) => {
return renderDict(row.state, 'wy_yyzt');
},
},
minWidth:'120'
},
{
title: '提交时间',
field: 'updateTime',
minWidth:'120'
}, },
{ {
field: 'action', field: 'action',
@@ -124,7 +120,7 @@ export const columns: VxeGridProps['columns'] = [
export const modalSchema: FormSchemaGetter = () => [ export const modalSchema: FormSchemaGetter = () => [
{ {
label: 'id', label: '主键',
fieldName: 'id', fieldName: 'id',
component: 'Input', component: 'Input',
dependencies: { dependencies: {
@@ -133,14 +129,94 @@ export const modalSchema: FormSchemaGetter = () => [
}, },
}, },
{ {
label: '会议室id', label: '会议室名称',
fieldName: 'tbConferenceId', fieldName: 'name',
component: 'Input', component: 'Input',
rules: 'required', rules: 'required',
}, },
{ {
label: '预约状态', label: '会议室id',
fieldName: 'bookingStatus', 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', component: 'Select',
componentProps: { componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护 // 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
@@ -149,122 +225,18 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'selectRequired', rules: 'selectRequired',
}, },
{ {
label: '审核状态', label: '创建人id',
fieldName: 'reviewStatus', fieldName: 'createById',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
options: getDictOptions('wy_shzt'),
},
rules: 'selectRequired',
},
{
label: '会议预订人',
fieldName: 'bookingName',
component: 'Input', component: 'Input',
rules: 'required',
}, },
{ {
label: '使用单位', label: '更新人id',
fieldName: 'userUnit', fieldName: 'updateById',
component: 'Input', component: 'Input',
rules: 'required',
}, },
{ {
label: '会议主题', label: '搜索值',
fieldName: 'conferenceTheme', fieldName: 'searchValue',
component: 'Input', component: 'Input',
rules: 'required',
},
{
label: '预约日期',
fieldName: 'appointmentDate',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '预约开始时段',
fieldName: 'appointmentBeginTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '预约结束时段',
fieldName: 'appointmentEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '参会人员',
fieldName: 'attendeesName',
component: 'Input',
rules: 'required',
},
{
label: '参会人数',
fieldName: 'approverCount',
component: 'Input',
rules: 'required',
},
{
label: '签到开始时间',
fieldName: 'checkInStartTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '签到结束时间',
fieldName: 'checkInEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '评价',
fieldName: 'evaluate',
component: 'Input',
rules: 'required',
},
{
label: '备注',
fieldName: 'remark',
component: 'Input',
rules: 'required',
},
{
label: '是否需要增值服务',
fieldName: 'addServices',
component: 'RadioGroup',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
options: getDictOptions('wy_sf'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: 'selectRequired',
}, },
]; ];

View File

@@ -1,29 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs'; import {
import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
roomBookingExport, bookingList,
roomBookingList, bookingRemove,
roomBookingRemove, } from '#/api/property/roomBooking/conferenceReservationRecords';
} from '#/api/property/roomBooking'; import type { BookingForm } from '#/api/property/roomBooking/conferenceReservationRecords/model';
import type { RoomBookingForm } from '#/api/property/roomBooking/model';
import { commonDownloadExcel } from '#/utils/file/download';
import roomBookingModal from './roomBooking-modal.vue'; import ConferenceReservationRecordsModal from './conferenceReservationRecords-modal.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
@@ -35,15 +26,6 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
}; };
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
@@ -52,11 +34,7 @@ const gridOptions: VxeGridProps = {
highlight: true, highlight: true,
// 翻页时保留选中状态 // 翻页时保留选中状态
reserve: true, reserve: true,
// 点击行选中
// trigger: 'row',
}, },
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns, columns,
height: 'auto', height: 'auto',
keepSource: true, keepSource: true,
@@ -64,7 +42,7 @@ const gridOptions: VxeGridProps = {
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }, formValues = {}) => { query: async ({ page }, formValues = {}) => {
return await roomBookingList({ return await bookingList({
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
@@ -75,8 +53,7 @@ const gridOptions: VxeGridProps = {
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
}, },
// 表格全局唯一表示 保存列配置需要用到 id: 'system-booking-index'
id: 'property-roomBooking-index'
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -84,8 +61,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
gridOptions, gridOptions,
}); });
const [RoomBookingModal, modalApi] = useVbenModal({ const [BookingModal, modalApi] = useVbenModal({
connectedComponent: roomBookingModal, connectedComponent: ConferenceReservationRecordsModal,
}); });
function handleAdd() { function handleAdd() {
@@ -93,59 +70,47 @@ function handleAdd() {
modalApi.open(); modalApi.open();
} }
async function handleEdit(row: Required<RoomBookingForm>) { async function handleEdit(row: Required<BookingForm>) {
modalApi.setData({ id: row.id }); modalApi.setData({ id: row.id });
modalApi.open(); modalApi.open();
} }
async function handleDelete(row: Required<RoomBookingForm>) { async function handleDelete(row: Required<BookingForm>) {
await roomBookingRemove(row.id); await bookingRemove(row.id);
await tableApi.query(); await tableApi.query();
} }
function handleMultiDelete() { function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords(); const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RoomBookingForm>) => row.id); const ids = rows.map((row: Required<BookingForm>) => row.id);
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
okType: 'danger', okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`, content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => { onOk: async () => {
await roomBookingRemove(ids); await bookingRemove(ids);
await tableApi.query(); await tableApi.query();
}, },
}); });
} }
function handleDownloadExcel() {
commonDownloadExcel(roomBookingExport, '会议管理数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script> </script>
<template> <template>
<Page :auto-content-height="true"> <Page :auto-content-height="true">
<BasicTable table-title="会议管理列表"> <BasicTable table-title="会议室预约记录列表">
<template #toolbar-tools> <template #toolbar-tools>
<Space> <Space>
<a-button
v-access:code="['property:roomBooking:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button <a-button
:disabled="!vxeCheckboxChecked(tableApi)" :disabled="!vxeCheckboxChecked(tableApi)"
danger danger
type="primary" type="primary"
v-access:code="['property:roomBooking:remove']" v-access:code="['system:booking:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button
type="primary" type="primary"
v-access:code="['property:roomBooking:add']" v-access:code="['system:booking:add']"
@click="handleAdd" @click="handleAdd"
> >
{{ $t('pages.common.add') }} {{ $t('pages.common.add') }}
@@ -155,7 +120,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:roomBooking:edit']" v-access:code="['system:booking:edit']"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"
> >
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
@@ -168,7 +133,7 @@ function handleDownloadExcel() {
> >
<ghost-button <ghost-button
danger danger
v-access:code="['property:roomBooking:remove']" v-access:code="['system:booking:remove']"
@click.stop="" @click.stop=""
> >
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
@@ -177,6 +142,6 @@ function handleDownloadExcel() {
</Space> </Space>
</template> </template>
</BasicTable> </BasicTable>
<RoomBookingModal @reload="tableApi.query()" /> <ConferenceReservationRecordsModal @reload="tableApi.query()" />
</Page> </Page>
</template> </template>

View File

@@ -0,0 +1,142 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '会议室名称',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('meeting_room_status'),
},
fieldName: 'attach',
label: '状态',
},
{
component: 'Input',
fieldName: 'createById',
label: '创建人id',
},
{
component: 'Input',
fieldName: 'updateById',
label: '更新人id',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '会议室名称',
field: 'name',
},
{
title: '会议室地址',
field: 'location',
},
{
title: '可容纳人数',
field: 'personNumber',
},
{
title: '基础服务',
field: 'baseServiceId',
},
{
title: '基础价格',
field: 'basePrice',
},
{
title: '状态',
field: 'attach',
slots: {
default: ({ row }) => {
return renderDict(row.attach, 'meeting_room_status');
},
},
},
{
title: '创建人id',
field: 'createById',
},
{
title: '更新人id',
field: 'updateById',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '会议室名称',
fieldName: 'name',
component: 'Input',
rules: 'required',
},
{
label: '会议室地址',
fieldName: 'location',
component: 'Input',
rules: 'required',
},
{
label: '可容纳人数',
fieldName: 'personNumber',
component: 'Input',
rules: 'required',
},
{
label: '基础服务',
fieldName: 'baseServiceId',
component: 'Input',
rules: 'required',
},
{
label: '基础价格',
fieldName: 'basePrice',
component: 'Input',
rules: 'required',
},
{
label: '状态',
fieldName: 'attach',
component: 'Select',
componentProps: {
options: getDictOptions('meeting_room_status'),
},
rules: 'selectRequired',
},
{
label: '创建人id',
fieldName: 'createById',
component: 'Input',
rules: 'required',
},
{
label: '更新人id',
fieldName: 'updateById',
component: 'Input',
rules: 'required',
},
];

View File

@@ -1,7 +1,147 @@
<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 {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
meetList,
meetRemove,
} from '#/api/property/roomBooking/conferenceSettings';
import type { MeetForm } from '#/api/property/roomBooking/conferenceSettings/model';
import meetModal from './meet-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await meetList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'system-meet-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [MeetModal, modalApi] = useVbenModal({
connectedComponent: meetModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<MeetForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<MeetForm>) {
await meetRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<MeetForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await meetRemove(ids);
await tableApi.query();
},
});
}
</script>
<template> <template>
<div>会议室设置 <Page :auto-content-height="true">
<BasicTable table-title="会议室设置列表">
</div> <template #toolbar-tools>
<Space>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['system:meet:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['system:meet:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['system:meet:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['system:meet:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<MeetModal @reload="tableApi.query()" />
</Page>
</template> </template>
<script></script>
<style lang="scss"></style>

View File

@@ -0,0 +1,101 @@
<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 { meetAdd, meetInfo, meetUpdate } from '#/api/property/roomBooking/conferenceSettings';
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-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-[60%]',
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 meetInfo(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 ? meetUpdate(data) : meetAdd(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>