This commit is contained in:
@@ -40,7 +40,6 @@ export interface AttachVO {
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
}
|
||||
|
||||
export interface AttachForm extends BaseEntity {
|
||||
@@ -117,3 +116,45 @@ export interface AttachQuery extends PageQuery {
|
||||
*/
|
||||
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;
|
||||
}
|
@@ -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}`);
|
||||
}
|
264
apps/web-antd/src/api/property/roomBooking/conferenceReservationRecords/model.d.ts
vendored
Normal file
264
apps/web-antd/src/api/property/roomBooking/conferenceReservationRecords/model.d.ts
vendored
Normal 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;
|
||||
}
|
@@ -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}`);
|
||||
}
|
159
apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts
vendored
Normal file
159
apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts
vendored
Normal 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;
|
||||
}
|
@@ -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>
|
@@ -64,47 +64,47 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
field: 'orderId',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '租赁合同编号',
|
||||
field: 'userId',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '租赁人',
|
||||
field: 'userName',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '租金',
|
||||
field: 'rent',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '押金',
|
||||
field: 'deposit',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '违约金',
|
||||
field: 'penalty',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '总金额',
|
||||
field: 'totalAmount',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '收费日期',
|
||||
field: 'chargeDate',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '支付方式',
|
||||
@@ -114,7 +114,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.paymentMethod, 'pro_payment_method');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '开票状态',
|
||||
@@ -124,12 +124,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.invoiceStatus, 'pro_invoice_status');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '发票类型',
|
||||
field: 'invoiceType',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '收费状态',
|
||||
@@ -139,12 +139,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.chargeStatus, 'pro_charging_status');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
|
@@ -31,17 +31,17 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '养护名称',
|
||||
field: 'maintainName',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '服务地点(房间id)',
|
||||
field: 'roomId',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
@@ -51,7 +51,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.serveType, 'pro_service_type');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '养护周期类型',
|
||||
@@ -61,27 +61,27 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.periodType, 'wy_time_unit');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '养护周期频次',
|
||||
field: 'periodFrequency',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '关联订单',
|
||||
field: 'orderId',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '计划执行时间',
|
||||
field: 'startTime',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '计划完成时间',
|
||||
field: 'endTime',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '巡检结果',
|
||||
@@ -91,12 +91,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.inspectResult, 'pro_inspection_results');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '处理措施',
|
||||
field: 'measure',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '客户评分',
|
||||
@@ -109,12 +109,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
});
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '客户反馈',
|
||||
field: 'customerAdvice',
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '处理状态',
|
||||
@@ -124,7 +124,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.state, 'pro_processing_status');
|
||||
},
|
||||
},
|
||||
width: 'auto'
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
|
@@ -26,15 +26,6 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '产品编号',
|
||||
field: 'plantCode',
|
||||
@@ -104,12 +95,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '产品编号',
|
||||
fieldName: 'plantCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '产品名称',
|
||||
fieldName: 'plantName',
|
||||
|
@@ -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>
|
@@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
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 { modalSchema } from './data';
|
||||
@@ -15,13 +15,13 @@ const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
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({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[60%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
@@ -1,60 +1,40 @@
|
||||
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: 'meetId',
|
||||
label: '会议室id',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'projectName',
|
||||
label: '产品名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'price',
|
||||
label: '单价',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'unit',
|
||||
label: '单位',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('value_added_type'),
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('product_management_status'),
|
||||
},
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '会议室id',
|
||||
field: 'meetId',
|
||||
},
|
||||
{
|
||||
title: '产品名称',
|
||||
field: 'projectName',
|
||||
},
|
||||
{
|
||||
title: '单价',
|
||||
title: '单价(元)',
|
||||
field: 'price',
|
||||
},
|
||||
{
|
||||
@@ -64,14 +44,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '类型',
|
||||
field: 'type',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.type, 'value_added_type');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.state, 'product_management_status');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -92,16 +78,10 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议室id',
|
||||
fieldName: 'meetId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '产品名称',
|
||||
fieldName: 'projectName',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
@@ -121,13 +101,17 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('value_added_type'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('product_management_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
];
|
@@ -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>
|
||||
<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>
|
||||
<script></script>
|
||||
<style lang="scss"></style>
|
@@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
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 { modalSchema } from './data';
|
||||
@@ -58,7 +58,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await roomBookingInfo(id);
|
||||
const record = await bookingInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -76,7 +76,7 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? roomBookingUpdate(data) : roomBookingAdd(data));
|
||||
await (isUpdate.value ? bookingUpdate(data) : bookingAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
@@ -1,117 +1,113 @@
|
||||
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: 'roomName',
|
||||
fieldName: 'name',
|
||||
label: '会议室名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bookingName',
|
||||
label: '会议预订人',
|
||||
fieldName: 'person',
|
||||
label: '预定人',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_charging_status'),
|
||||
},
|
||||
fieldName: 'payState',
|
||||
label: '支付状态',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
},
|
||||
fieldName: 'bookingStatus',
|
||||
fieldName: 'state',
|
||||
label: '预约状态',
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '会议室id',
|
||||
field: 'tbConferenceId',
|
||||
title: '会议室名称',
|
||||
field: 'name',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
field: 'bookingStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
return renderDict(row.bookingStatus, 'wy_yyzt');
|
||||
},
|
||||
},
|
||||
title: '会议室地址',
|
||||
field: 'meetLocation',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
field: 'reviewStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
|
||||
return renderDict(row.reviewStatus, 'wy_shzt');
|
||||
},
|
||||
},
|
||||
title: '所属单位',
|
||||
field: 'unit',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '会议预订人',
|
||||
field: 'bookingName',
|
||||
title: '预定人',
|
||||
field: 'person',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '使用单位',
|
||||
field: 'userUnit',
|
||||
title: '联系方式',
|
||||
field: 'phone',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '会议主题',
|
||||
field: 'conferenceTheme',
|
||||
title: '预定开始时间',
|
||||
field: 'scheduledStarttime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预约日期',
|
||||
field: 'appointmentDate',
|
||||
},
|
||||
{
|
||||
title: '预约开始时段',
|
||||
field: 'appointmentBeginTime',
|
||||
},
|
||||
{
|
||||
title: '预约结束时段',
|
||||
field: 'appointmentEndTime',
|
||||
},
|
||||
{
|
||||
title: '参会人员',
|
||||
field: 'attendeesName',
|
||||
title: '预定结束时间',
|
||||
field: 'scheduledEndtime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '参会人数',
|
||||
field: 'approverCount',
|
||||
field: 'personSum',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '签到开始时间',
|
||||
field: 'checkInStartTime',
|
||||
title: '费用',
|
||||
field: 'price',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '签到结束时间',
|
||||
field: 'checkInEndTime',
|
||||
title: '是否有增值服务',
|
||||
field: 'attach',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '评价',
|
||||
field: 'evaluate',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
title: '是否需要增值服务',
|
||||
field: 'addServices',
|
||||
title: '支付状态',
|
||||
field: 'payState',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
||||
return renderDict(row.addServices, 'wy_sf');
|
||||
return renderDict(row.payState, 'pro_charging_status');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.state, 'wy_yyzt');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
field: 'updateTime',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -124,7 +120,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: 'id',
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
@@ -133,14 +129,94 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议室id',
|
||||
fieldName: 'tbConferenceId',
|
||||
label: '会议室名称',
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预约状态',
|
||||
fieldName: 'bookingStatus',
|
||||
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 便于维护
|
||||
@@ -149,122 +225,18 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '审核状态',
|
||||
fieldName: 'reviewStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
|
||||
options: getDictOptions('wy_shzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '会议预订人',
|
||||
fieldName: 'bookingName',
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '使用单位',
|
||||
fieldName: 'userUnit',
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议主题',
|
||||
fieldName: 'conferenceTheme',
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
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',
|
||||
},
|
||||
];
|
||||
|
@@ -1,14 +1,7 @@
|
||||
<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,
|
||||
@@ -16,14 +9,12 @@ import {
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
roomBookingExport,
|
||||
roomBookingList,
|
||||
roomBookingRemove,
|
||||
} from '#/api/property/roomBooking';
|
||||
import type { RoomBookingForm } from '#/api/property/roomBooking/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
bookingList,
|
||||
bookingRemove,
|
||||
} from '#/api/property/roomBooking/conferenceReservationRecords';
|
||||
import type { BookingForm } from '#/api/property/roomBooking/conferenceReservationRecords/model';
|
||||
|
||||
import roomBookingModal from './roomBooking-modal.vue';
|
||||
import ConferenceReservationRecordsModal from './conferenceReservationRecords-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
@@ -35,15 +26,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
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 = {
|
||||
@@ -52,11 +34,7 @@ const gridOptions: VxeGridProps = {
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
@@ -64,7 +42,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await roomBookingList({
|
||||
return await bookingList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
@@ -75,8 +53,7 @@ const gridOptions: VxeGridProps = {
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-roomBooking-index'
|
||||
id: 'system-booking-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@@ -84,8 +61,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [RoomBookingModal, modalApi] = useVbenModal({
|
||||
connectedComponent: roomBookingModal,
|
||||
const [BookingModal, modalApi] = useVbenModal({
|
||||
connectedComponent: ConferenceReservationRecordsModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
@@ -93,59 +70,47 @@ function handleAdd() {
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<RoomBookingForm>) {
|
||||
async function handleEdit(row: Required<BookingForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<RoomBookingForm>) {
|
||||
await roomBookingRemove(row.id);
|
||||
async function handleDelete(row: Required<BookingForm>) {
|
||||
await bookingRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
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({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await roomBookingRemove(ids);
|
||||
await bookingRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(roomBookingExport, '会议管理数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="会议管理列表">
|
||||
<BasicTable table-title="会议室预约记录列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:roomBooking:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:roomBooking:remove']"
|
||||
v-access:code="['system:booking:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:roomBooking:add']"
|
||||
v-access:code="['system:booking:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
@@ -155,7 +120,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:roomBooking:edit']"
|
||||
v-access:code="['system:booking:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
@@ -168,7 +133,7 @@ function handleDownloadExcel() {
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:roomBooking:remove']"
|
||||
v-access:code="['system:booking:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
@@ -177,6 +142,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<RoomBookingModal @reload="tableApi.query()" />
|
||||
<ConferenceReservationRecordsModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -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',
|
||||
},
|
||||
];
|
@@ -1,7 +1,147 @@
|
||||
<template>
|
||||
<div>会议室设置
|
||||
<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';
|
||||
|
||||
</div>
|
||||
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>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="会议室设置列表">
|
||||
<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>
|
||||
<script></script>
|
||||
<style lang="scss"></style>
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user