会议管理
This commit is contained in:
parent
ddf8251ce8
commit
1d7fbf78b6
@ -34,7 +34,7 @@ export interface OrderMaintainVO {
|
||||
/**
|
||||
* 养护周期类型
|
||||
*/
|
||||
periodType: number;
|
||||
periodType: string | number;
|
||||
|
||||
/**
|
||||
* 养护周期频次
|
||||
@ -116,7 +116,7 @@ export interface OrderMaintainForm extends BaseEntity {
|
||||
/**
|
||||
* 养护周期类型
|
||||
*/
|
||||
periodType?: number;
|
||||
periodType?: string | number;
|
||||
|
||||
/**
|
||||
* 养护周期频次
|
||||
@ -193,7 +193,7 @@ export interface OrderMaintainQuery extends PageQuery {
|
||||
/**
|
||||
* 养护周期类型
|
||||
*/
|
||||
periodType?: number;
|
||||
periodType?: string | number;
|
||||
|
||||
/**
|
||||
* 养护周期频次
|
||||
@ -257,6 +257,11 @@ export interface conservationManagement extends BaseEntity {
|
||||
*/
|
||||
maintainName: string;
|
||||
|
||||
/**
|
||||
* 服务地点
|
||||
*/
|
||||
roomName:string;
|
||||
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
@ -280,7 +285,7 @@ export interface conservationManagement extends BaseEntity {
|
||||
/**
|
||||
* 养护周期类型
|
||||
*/
|
||||
periodType: number;
|
||||
periodType: string | number;
|
||||
|
||||
/**
|
||||
* 养护周期频次
|
||||
|
@ -34,7 +34,7 @@ export interface AttachVO {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number;
|
||||
state: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@ -76,7 +76,7 @@ export interface AttachForm extends BaseEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: number;
|
||||
state?: string | number;
|
||||
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ export interface AttachQuery extends PageQuery {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: number;
|
||||
state?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
@ -151,7 +151,7 @@ export interface conferenceAddServices extends BaseEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number;
|
||||
state: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
@ -50,7 +50,6 @@ export interface MeetVO {
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MeetForm extends BaseEntity {
|
||||
@ -157,3 +156,55 @@ export interface MeetQuery extends PageQuery {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface conferenceSettingsDetail 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;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import {h} from "vue";
|
||||
import {Rate} from "ant-design-vue";
|
||||
import {rentalOrderList} from "#/api/property/rentalOrder";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@ -38,11 +39,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'maintainName',
|
||||
minWidth: '120'
|
||||
},
|
||||
{
|
||||
title: '服务地点',
|
||||
field: 'roomId',
|
||||
minWidth: '120'
|
||||
},
|
||||
// {
|
||||
// title: '服务地点',
|
||||
// field: 'roomName',
|
||||
// minWidth: '120'
|
||||
// },
|
||||
{
|
||||
title: '服务类型',
|
||||
field: 'serveType',
|
||||
@ -109,7 +110,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
});
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '150'
|
||||
},
|
||||
{
|
||||
title: '客户反馈',
|
||||
@ -154,8 +155,9 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '服务地点',
|
||||
fieldName: 'communityId',
|
||||
component: 'Input',
|
||||
fieldName: 'roomId',
|
||||
component: 'TreeSelect',
|
||||
defaultValue: undefined,
|
||||
rules: 'required',
|
||||
labelWidth:100
|
||||
},
|
||||
@ -190,7 +192,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '关联订单',
|
||||
fieldName: 'orderId',
|
||||
component: 'Input',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: rentalOrderList,
|
||||
resultField: 'rows',
|
||||
labelField: 'orderNo',
|
||||
valueField: 'id',
|
||||
},
|
||||
rules: 'required',
|
||||
labelWidth:100
|
||||
},
|
||||
@ -231,7 +239,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '处理措施',
|
||||
fieldName: 'measure',
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
labelWidth:100
|
||||
},
|
||||
|
@ -34,15 +34,15 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ conservationManagementDetail.maintainName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="服务地点">
|
||||
{{ conservationManagementDetail.roomId }}
|
||||
{{ conservationManagementDetail.roomName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="服务类型" v-if="conservationManagementDetail.serveType!=null">
|
||||
<component
|
||||
:is="renderDict(conservationManagementDetail.serveType,'pro_service_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="养护周期">
|
||||
{{ conservationManagementDetail.orderId }}
|
||||
<DescriptionsItem label="养护周期" v-if="conservationManagementDetail.periodType!=null">
|
||||
1<component style="display: inline-block" :is="renderDict(conservationManagementDetail.periodType,'wy_time_unit')"/>{{ conservationManagementDetail.periodFrequency }}次
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="关联订单">
|
||||
{{ conservationManagementDetail.orderId }}
|
||||
|
@ -2,12 +2,12 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import { cloneDeep,handleNode,getPopupContainer } from '@vben/utils';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { orderMaintainAdd, orderMaintainInfo, orderMaintainUpdate } from '#/api/property/conservationManagement';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import { modalSchema } from './data';
|
||||
|
||||
import { communityTree } from '#/api/property/community';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
|
||||
@ -45,6 +45,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
setupCommunitySelect()
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
@ -55,6 +56,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
record.serveType = record.serveType?.toString();
|
||||
record.state = record.state?.toString();
|
||||
record.inspectResult = record.inspectResult?.toString();
|
||||
record.periodType = record.periodType?.toString();
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@ -86,6 +88,43 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
// 获取服务地址
|
||||
async function setupCommunitySelect() {
|
||||
const areaList = await communityTree(5);
|
||||
// 选中后显示在输入框的值 即父节点 / 子节点
|
||||
// addFullName(areaList, 'areaName', ' / ');
|
||||
const splitStr = '/';
|
||||
handleNode(areaList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 5) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
getPopupContainer,
|
||||
placeholder: '请选择',
|
||||
showSearch: true,
|
||||
treeData: areaList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: { showLeafIcon: false },
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
}),
|
||||
fieldName: 'roomId',
|
||||
},
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -41,17 +41,19 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="单价(元)">
|
||||
{{ conferenceAddServicesDetail.price }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位">
|
||||
{{ conferenceAddServicesDetail.unit }}
|
||||
<DescriptionsItem label="单位" v-if="conferenceAddServicesDetail.unit!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceAddServicesDetail.unit,'pro_product_unit')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="类型" v-if="conferenceAddServicesDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceAddServicesDetail.type,'wy_parking_spot')"
|
||||
:is="renderDict(conferenceAddServicesDetail.type,'value_added_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="conferenceAddServicesDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceAddServicesDetail.state,'wy_appointment_tatus')"
|
||||
:is="renderDict(conferenceAddServicesDetail.state,'product_management_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
|
@ -59,6 +59,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await attachInfo(id);
|
||||
record.unit = record.unit?.toString();
|
||||
record.state = record.state?.toString();
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
@ -40,6 +40,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '单位',
|
||||
field: 'unit',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.unit, 'pro_product_unit');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
@ -93,8 +98,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '单位',
|
||||
fieldName: 'unit',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_product_unit'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
|
@ -1,5 +1,87 @@
|
||||
<template>
|
||||
<div>会议室预约</div>
|
||||
<div>
|
||||
<div class="card-box">
|
||||
<div v-for="(item,index) in meetingList" :key="index" class="card-list">
|
||||
<div><span class="card-title">{{ item.one }}</span><a-button class="card-button" type="primary">去预约</a-button></div>
|
||||
<div>容纳人数: {{ item.two }}人</div>
|
||||
<div>基础费用: {{ item.three }}元</div>
|
||||
<div>基础服务: {{ item.four }}</div>
|
||||
<div>基础服务: {{ item.five }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script></script>
|
||||
<style lang="scss"></style>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const meetingList = ref([
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
{
|
||||
one: '10楼1002会议室',
|
||||
two: 50,
|
||||
three: 300,
|
||||
four: '话筒、音响、大屏',
|
||||
five: '开水、基础保洁'
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.card-box{
|
||||
width: 100%;
|
||||
background-color: transparent;
|
||||
padding: 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 30px;
|
||||
border: none;
|
||||
|
||||
.card-list{
|
||||
padding: 15px;
|
||||
background-color: white;
|
||||
border: 1px solid gray;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
|
||||
.card-title{
|
||||
font-size: 1.2vw;
|
||||
font-weight: bold;
|
||||
}
|
||||
div:nth-child(1){
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
div{
|
||||
line-height: 1.5vw;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 200px;
|
||||
|
||||
.card-button{
|
||||
right: 15px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,59 @@
|
||||
<script setup lang="ts">
|
||||
import type {conferenceSettingsDetail} from '#/api/property/roomBooking/conferenceSettings/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 {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {renderDict} from "#/utils/render";
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
conferenceSettingsDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const conferenceSettingsDetail = shallowRef<null | conferenceSettingsDetail>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await meetInfo(id);
|
||||
conferenceSettingsDetail.value = response;
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
|
||||
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="产品名称">
|
||||
{{ conferenceSettingsDetail.projectName}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单价(元)">
|
||||
{{ conferenceSettingsDetail.price }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位">
|
||||
{{ conferenceSettingsDetail.unit }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="类型" v-if="conferenceSettingsDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceSettingsDetail.type,'wy_parking_spot')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="conferenceSettingsDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(conferenceSettingsDetail.state,'wy_appointment_tatus')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -13,7 +13,8 @@ import {
|
||||
meetRemove,
|
||||
} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import type { MeetForm } from '#/api/property/roomBooking/conferenceSettings/model';
|
||||
import meetModal from './meet-modal.vue';
|
||||
import ConferenceSettingsModal from './conferenceSettings-modal.vue';
|
||||
import ConferenceSettingsDetail from './conferenceSettings-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
@ -61,10 +62,19 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [MeetModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meetModal,
|
||||
const [conferenceSettingsModal, modalApi] = useVbenModal({
|
||||
connectedComponent: ConferenceSettingsModal,
|
||||
});
|
||||
|
||||
const [ConferenceSettingsDetailModal, ConferenceSettingsDetailApi] = useVbenModal({
|
||||
connectedComponent: ConferenceSettingsDetail,
|
||||
});
|
||||
|
||||
async function handleInfo(row: Required<MeetForm>) {
|
||||
ConferenceSettingsDetailApi.setData({ id: row.id });
|
||||
ConferenceSettingsDetailApi.open();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
@ -119,6 +129,11 @@ function handleMultiDelete() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['system:meet:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@ -142,6 +157,7 @@ function handleMultiDelete() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MeetModal @reload="tableApi.query()" />
|
||||
<conferenceSettingsModal @reload="tableApi.query()" />
|
||||
<ConferenceSettingsDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -1,369 +0,0 @@
|
||||
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: 'tbConferenceId',
|
||||
label: '会议室id',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
},
|
||||
fieldName: 'bookingStatus',
|
||||
label: '预约状态',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
|
||||
options: getDictOptions('wy_shzt'),
|
||||
},
|
||||
fieldName: 'reviewStatus',
|
||||
label: '审核状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bookingName',
|
||||
label: '会议预订人',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userUnit',
|
||||
label: '使用单位',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'conferenceTheme',
|
||||
label: '会议主题',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'appointmentDate',
|
||||
label: '预约日期',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'appointmentBeginTime',
|
||||
label: '预约开始时段',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'appointmentEndTime',
|
||||
label: '预约结束时段',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'attendeesName',
|
||||
label: '参会人员',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'approverCount',
|
||||
label: '参会人数',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'checkInStartTime',
|
||||
label: '签到开始时间',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'checkInEndTime',
|
||||
label: '签到结束时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'evaluate',
|
||||
label: '评价',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
||||
options: getDictOptions('wy_sf'),
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
fieldName: 'addServices',
|
||||
label: '是否需要增值服务',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '会议室id',
|
||||
field: 'tbConferenceId',
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
field: 'bookingStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
return renderDict(row.bookingStatus, 'wy_yyzt');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
field: 'reviewStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
|
||||
return renderDict(row.reviewStatus, 'wy_shzt');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '会议预订人',
|
||||
field: 'bookingName',
|
||||
},
|
||||
{
|
||||
title: '使用单位',
|
||||
field: 'userUnit',
|
||||
},
|
||||
{
|
||||
title: '会议主题',
|
||||
field: 'conferenceTheme',
|
||||
},
|
||||
{
|
||||
title: '预约日期',
|
||||
field: 'appointmentDate',
|
||||
},
|
||||
{
|
||||
title: '预约开始时段',
|
||||
field: 'appointmentBeginTime',
|
||||
},
|
||||
{
|
||||
title: '预约结束时段',
|
||||
field: 'appointmentEndTime',
|
||||
},
|
||||
{
|
||||
title: '参会人员',
|
||||
field: 'attendeesName',
|
||||
},
|
||||
{
|
||||
title: '参会人数',
|
||||
field: 'approverCount',
|
||||
},
|
||||
{
|
||||
title: '签到开始时间',
|
||||
field: 'checkInStartTime',
|
||||
},
|
||||
{
|
||||
title: '签到结束时间',
|
||||
field: 'checkInEndTime',
|
||||
},
|
||||
{
|
||||
title: '评价',
|
||||
field: 'evaluate',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
title: '是否需要增值服务',
|
||||
field: 'addServices',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SF 便于维护
|
||||
return renderDict(row.addServices, 'wy_sf');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: 'id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议室id',
|
||||
fieldName: 'tbConferenceId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预约状态',
|
||||
fieldName: 'bookingStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_YYZT 便于维护
|
||||
options: getDictOptions('wy_yyzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '审核状态',
|
||||
fieldName: 'reviewStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SHZT 便于维护
|
||||
options: getDictOptions('wy_shzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '会议预订人',
|
||||
fieldName: 'bookingName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '使用单位',
|
||||
fieldName: 'userUnit',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议主题',
|
||||
fieldName: 'conferenceTheme',
|
||||
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,101 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { roomBookingAdd, roomBookingInfo, roomBookingUpdate } from '#/api/property/roomBooking';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await roomBookingInfo(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 ? roomBookingUpdate(data) : roomBookingAdd(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>
|
||||
|
Loading…
Reference in New Issue
Block a user