This commit is contained in:
parent
602e8951cc
commit
b1265fb00c
@ -12,7 +12,7 @@ import { requestClient } from '#/api/request';
|
|||||||
* @returns 会议室设置列表
|
* @returns 会议室设置列表
|
||||||
*/
|
*/
|
||||||
export function meetList(params?: MeetQuery) {
|
export function meetList(params?: MeetQuery) {
|
||||||
return requestClient.get<PageResult<MeetVO>>('/system/meet/list', { params });
|
return requestClient.get<PageResult<MeetVO>>('/property/meet/list', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +21,7 @@ export function meetList(params?: MeetQuery) {
|
|||||||
* @returns 会议室设置列表
|
* @returns 会议室设置列表
|
||||||
*/
|
*/
|
||||||
export function meetExport(params?: MeetQuery) {
|
export function meetExport(params?: MeetQuery) {
|
||||||
return commonExport('/system/meet/export', params ?? {});
|
return commonExport('/property/meet/export', params ?? {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,7 +30,7 @@ export function meetExport(params?: MeetQuery) {
|
|||||||
* @returns 会议室设置详情
|
* @returns 会议室设置详情
|
||||||
*/
|
*/
|
||||||
export function meetInfo(id: ID) {
|
export function meetInfo(id: ID) {
|
||||||
return requestClient.get<MeetVO>(`/system/meet/${id}`);
|
return requestClient.get<MeetVO>(`/property/meet/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,7 +39,7 @@ export function meetInfo(id: ID) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function meetAdd(data: MeetForm) {
|
export function meetAdd(data: MeetForm) {
|
||||||
return requestClient.postWithMsg<void>('/system/meet', data);
|
return requestClient.postWithMsg<void>('/property/meet', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,7 +48,7 @@ export function meetAdd(data: MeetForm) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function meetUpdate(data: MeetForm) {
|
export function meetUpdate(data: MeetForm) {
|
||||||
return requestClient.putWithMsg<void>('/system/meet', data);
|
return requestClient.putWithMsg<void>('/property/meet', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,5 +57,5 @@ export function meetUpdate(data: MeetForm) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function meetRemove(id: ID | IDS) {
|
export function meetRemove(id: ID | IDS) {
|
||||||
return requestClient.deleteWithMsg<void>(`/system/meet/${id}`);
|
return requestClient.deleteWithMsg<void>(`/property/meet/${id}`);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export interface MeetVO {
|
|||||||
/**
|
/**
|
||||||
* 基础服务
|
* 基础服务
|
||||||
*/
|
*/
|
||||||
baseServiceId: string | number;
|
baseService: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础价格
|
* 基础价格
|
||||||
@ -35,21 +35,38 @@ export interface MeetVO {
|
|||||||
* 增值服务是否启用
|
* 增值服务是否启用
|
||||||
*/
|
*/
|
||||||
attach: number;
|
attach: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人id
|
* 负责人
|
||||||
*/
|
*/
|
||||||
createById: string | number;
|
principals: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新人id
|
* 描述
|
||||||
*/
|
*/
|
||||||
updateById: string | number;
|
descs: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索值
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
searchValue: string;
|
phoneNo: string;
|
||||||
|
/**
|
||||||
|
* 是否审核
|
||||||
|
*/
|
||||||
|
isCheck: string;
|
||||||
|
/**
|
||||||
|
* 开放时间
|
||||||
|
*/
|
||||||
|
openHours: string;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
/**
|
||||||
|
*费用模式
|
||||||
|
*/
|
||||||
|
expenseType: string;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
picture: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MeetForm extends BaseEntity {
|
export interface MeetForm extends BaseEntity {
|
||||||
@ -103,6 +120,39 @@ export interface MeetForm extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
searchValue?: string;
|
searchValue?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
principals: string;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
descs: string;
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
phoneNo: string;
|
||||||
|
/**
|
||||||
|
* 是否审核
|
||||||
|
*/
|
||||||
|
isCheck: string;
|
||||||
|
/**
|
||||||
|
* 开放时间
|
||||||
|
*/
|
||||||
|
openHours: string;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
/**
|
||||||
|
*费用模式
|
||||||
|
*/
|
||||||
|
expenseType: string;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
picture: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MeetQuery extends PageQuery {
|
export interface MeetQuery extends PageQuery {
|
||||||
@ -155,6 +205,39 @@ export interface MeetQuery extends PageQuery {
|
|||||||
* 日期范围参数
|
* 日期范围参数
|
||||||
*/
|
*/
|
||||||
params?: any;
|
params?: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
principals: string;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
descs: string;
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
phoneNo: string;
|
||||||
|
/**
|
||||||
|
* 是否审核
|
||||||
|
*/
|
||||||
|
isCheck: string;
|
||||||
|
/**
|
||||||
|
* 开放时间
|
||||||
|
*/
|
||||||
|
openHours: string;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
/**
|
||||||
|
*费用模式
|
||||||
|
*/
|
||||||
|
expenseType: string;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
picture: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface conferenceSettingsDetail extends BaseEntity {
|
export interface conferenceSettingsDetail extends BaseEntity {
|
||||||
@ -173,6 +256,8 @@ export interface conferenceSettingsDetail extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
location: string;
|
location: string;
|
||||||
|
|
||||||
|
locationName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 容纳人数
|
* 容纳人数
|
||||||
*/
|
*/
|
||||||
@ -207,4 +292,37 @@ export interface conferenceSettingsDetail extends BaseEntity {
|
|||||||
* 搜索值
|
* 搜索值
|
||||||
*/
|
*/
|
||||||
searchValue: string;
|
searchValue: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
principals: string;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
descs: string;
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
phoneNo: string;
|
||||||
|
/**
|
||||||
|
* 是否审核
|
||||||
|
*/
|
||||||
|
isCheck: string;
|
||||||
|
/**
|
||||||
|
* 开放时间
|
||||||
|
*/
|
||||||
|
openHours: string;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
/**
|
||||||
|
*费用模式
|
||||||
|
*/
|
||||||
|
expenseType: string;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
picture: string;
|
||||||
}
|
}
|
||||||
|
@ -31,14 +31,14 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'rentalType',
|
fieldName: 'rentalType',
|
||||||
label: '租赁方式',
|
label: '租赁方式',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
component: 'Select',
|
// component: 'Select',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
options: getDictOptions('pro_charging_status')
|
// options: getDictOptions('pro_charging_status')
|
||||||
},
|
// },
|
||||||
fieldName: 'paymentStatus',
|
// fieldName: 'paymentStatus',
|
||||||
label: '支付状态',
|
// label: '支付状态',
|
||||||
},
|
// },
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -99,16 +99,16 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
},
|
},
|
||||||
width: 100
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '支付状态',
|
// title: '支付状态',
|
||||||
field: 'paymentStatus',
|
// field: 'paymentStatus',
|
||||||
slots: {
|
// slots: {
|
||||||
default: ({ row }) => {
|
// default: ({ row }) => {
|
||||||
return renderDict(row.paymentStatus, 'pro_charging_status');
|
// return renderDict(row.paymentStatus, 'pro_charging_status');
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
width: 100
|
// width: 100
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '是否续租',
|
title: '是否续租',
|
||||||
field: 'isRelet',
|
field: 'isRelet',
|
||||||
|
@ -74,11 +74,11 @@ async function handleOpenChange(open: boolean) {
|
|||||||
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
||||||
/>
|
/>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="支付状态">
|
<!-- <DescriptionsItem label="支付状态">-->
|
||||||
<component
|
<!-- <component-->
|
||||||
:is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"
|
<!-- :is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</DescriptionsItem>
|
<!-- </DescriptionsItem>-->
|
||||||
<DescriptionsItem label="是否续租">
|
<DescriptionsItem label="是否续租">
|
||||||
<component
|
<component
|
||||||
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
||||||
|
@ -156,9 +156,9 @@ const modalSchema = [
|
|||||||
min: 1,
|
min: 1,
|
||||||
max: plantInfo.value?.inventory,
|
max: plantInfo.value?.inventory,
|
||||||
precision: 0,
|
precision: 0,
|
||||||
onChange:async ()=>{
|
onChange: async () => {
|
||||||
const formValues = await formApi.getValues();
|
const formValues = await formApi.getValues();
|
||||||
if (formValues.productNum&&plantInfo.value?.rent) {
|
if (formValues.productNum && plantInfo.value?.rent) {
|
||||||
singleAmount.value = (plantInfo.value.rent * formValues.productNum).toFixed(2);
|
singleAmount.value = (plantInfo.value.rent * formValues.productNum).toFixed(2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -182,7 +182,6 @@ const modalSchema = [
|
|||||||
step: 1,
|
step: 1,
|
||||||
placeholder: '租赁数量不可超出绿植产品库存数量',
|
placeholder: '租赁数量不可超出绿植产品库存数量',
|
||||||
onChange: async (value: number) => {
|
onChange: async (value: number) => {
|
||||||
console.log(value,'================vvvv')
|
|
||||||
if (plantInfo.value) {
|
if (plantInfo.value) {
|
||||||
singleAmount.value = (plantInfo.value.rent * value).toFixed(2);
|
singleAmount.value = (plantInfo.value.rent * value).toFixed(2);
|
||||||
}
|
}
|
||||||
@ -202,8 +201,8 @@ const modalSchema = [
|
|||||||
slots: {default: 'totalAmount'},
|
slots: {default: 'totalAmount'},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
// 仅当 租赁方式 为 1(单点) 时显示
|
// 仅当 租赁方式 为 1(单点) 时显示
|
||||||
show: (formValues: any) => formValues.productNum&&formValues.productId&&formValues.rentalType === '1',
|
show: (formValues: any) => formValues.productNum && formValues.productId && formValues.rentalType === '1',
|
||||||
triggerFields: ['productNum','rentalType'],
|
triggerFields: ['productNum', 'rentalType'],
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
labelWidth: 110
|
labelWidth: 110
|
||||||
@ -317,14 +316,14 @@ async function handleConfirm() {
|
|||||||
} else {
|
} else {
|
||||||
data.productId = undefined;
|
data.productId = undefined;
|
||||||
data.productNum = undefined;
|
data.productNum = undefined;
|
||||||
data.productList = plantsList.value
|
data.productList = planProducts.value
|
||||||
data.totalAmount = totalAmount.value
|
data.totalAmount = totalAmount.value
|
||||||
}
|
}
|
||||||
if (data.rentalTime) {
|
if (data.rentalTime) {
|
||||||
data.startTime = data.rentalTime[0];
|
data.startTime = data.rentalTime[0];
|
||||||
data.endTime = data.rentalTime[1];
|
data.endTime = data.rentalTime[1];
|
||||||
}
|
}
|
||||||
data.paymentStatus=0
|
data.paymentStatus = 0
|
||||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@ -339,7 +338,12 @@ async function handleConfirm() {
|
|||||||
//获取有库存的绿植
|
//获取有库存的绿植
|
||||||
async function getPlanProducts(id: string) {
|
async function getPlanProducts(id: string) {
|
||||||
const res = await rentalPlanInfo(id)
|
const res = await rentalPlanInfo(id)
|
||||||
plantsList.value=res.productList;
|
planProducts.value = res.productList.map(item => ({
|
||||||
|
id:item.productId,
|
||||||
|
plantName: item.product?.plantName,
|
||||||
|
rent: item.product?.rent,
|
||||||
|
inventory: item.productNum,
|
||||||
|
}))
|
||||||
totalAmount.value = planProducts.value?.reduce((sum, item: any) => sum + (item.rent * item.inventory), 0).toFixed(2)
|
totalAmount.value = planProducts.value?.reduce((sum, item: any) => sum + (item.rent * item.inventory), 0).toFixed(2)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
initLocationOptions()
|
await initLocationOptions()
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await resident_unitInfo(id);
|
const record = await resident_unitInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
|
@ -8,6 +8,7 @@ import duration from 'dayjs/plugin/duration';
|
|||||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||||
import {renderDict} from "#/utils/render";
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
dayjs.extend(duration);
|
dayjs.extend(duration);
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
|
|
||||||
@ -33,27 +34,46 @@ async function handleOpenChange(open: boolean) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
|
<BasicModal :footer="false" :fullscreen-button="false" title="会议室详情" class="w-[70%]">
|
||||||
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered
|
||||||
<DescriptionsItem label="产品名称">
|
:labelStyle="{width:'120px'}">
|
||||||
{{ conferenceSettingsDetail.projectName}}
|
<DescriptionsItem label="会议室名称">
|
||||||
|
{{ conferenceSettingsDetail.name }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="单价(元)">
|
<DescriptionsItem label="可容纳人数">
|
||||||
{{ conferenceSettingsDetail.price }}
|
{{ conferenceSettingsDetail.personNumber }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="单位">
|
<DescriptionsItem label="会议室地址" :span="2">
|
||||||
{{ conferenceSettingsDetail.unit }}
|
{{ conferenceSettingsDetail.locationName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="类型" v-if="conferenceSettingsDetail.type!=null">
|
<DescriptionsItem label="配套设备" :span="2">
|
||||||
|
{{ conferenceSettingsDetail.baseService }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="负责人" :span="2">
|
||||||
|
{{ conferenceSettingsDetail.principals }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="费用模式">
|
||||||
<component
|
<component
|
||||||
:is="renderDict(conferenceSettingsDetail.type,'wy_parking_spot')"
|
:is="renderDict(conferenceSettingsDetail.expenseType,'wy_fyms')"
|
||||||
/>
|
/>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="状态" v-if="conferenceSettingsDetail.state!=null">
|
<DescriptionsItem label="付费金额(元)" v-if="conferenceSettingsDetail.expenseType=='2'">
|
||||||
|
{{ conferenceSettingsDetail.basePrice }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="会议室图片" :span="2">
|
||||||
|
{{ conferenceSettingsDetail.picture }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="预约是否审核">
|
||||||
<component
|
<component
|
||||||
:is="renderDict(conferenceSettingsDetail.state,'wy_appointment_tatus')"
|
:is="renderDict(conferenceSettingsDetail.isCheck,'wy_sf')"
|
||||||
/>
|
/>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="开放时段" :span="2">
|
||||||
|
{{ conferenceSettingsDetail.openHours }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="会议室描述" :span="2">
|
||||||
|
{{ conferenceSettingsDetail.descs }}
|
||||||
|
</DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import {$t} from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import {cloneDeep, getPopupContainer, handleNode} from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import {useVbenForm} from '#/adapter/form';
|
||||||
import { meetAdd, meetInfo, meetUpdate } from '#/api/property/roomBooking/conferenceSettings';
|
import {meetAdd, meetInfo, meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
|
||||||
|
|
||||||
|
import {modalSchema} from './data';
|
||||||
|
import {TimeRangePicker} from 'ant-design-vue'
|
||||||
|
import {renderDictValue} from "#/utils/render";
|
||||||
|
import {personList} from "#/api/property/resident/person";
|
||||||
|
import {communityTree} from "#/api/property/community";
|
||||||
|
import dayjs from 'dayjs';
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@ -21,7 +25,7 @@ const title = computed(() => {
|
|||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
formItemClass: 'col-span-1',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
@ -34,7 +38,7 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||||
{
|
{
|
||||||
initializedGetter: defaultFormValueGetter(formApi),
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
@ -43,7 +47,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[60%]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
onClosed: handleClosed,
|
onClosed: handleClosed,
|
||||||
@ -53,12 +57,22 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
await formApi.setValues({
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
expenseType:'1',
|
||||||
|
isCheck:'0',
|
||||||
|
})
|
||||||
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
await queryPerson()
|
||||||
|
await initLocationOptions()
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await meetInfo(id);
|
const record = await meetInfo(id);
|
||||||
|
record.expenseType=record.expenseType.toString()
|
||||||
|
record.isCheck=record.isCheck.toString()
|
||||||
|
let hour = record.openHours.split('-');
|
||||||
|
if(hour.length>1){
|
||||||
|
record.openHours=[dayjs(hour[0],'HH:mm'),dayjs(hour[1],'HH:mm')]
|
||||||
|
}
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@ -70,12 +84,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
try {
|
try {
|
||||||
modalApi.lock(true);
|
modalApi.lock(true);
|
||||||
const { valid } = await formApi.validate();
|
const {valid} = await formApi.validate();
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
if (data.openHours) {
|
||||||
|
data.openHours = data.openHours[0]?.format("HH:mm") + '-' + data.openHours[1]?.format("HH:mm");
|
||||||
|
}
|
||||||
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@ -91,11 +108,75 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryPerson() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
const res = await personList(params);
|
||||||
|
const options = res.rows.map((user) => ({
|
||||||
|
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||||
|
value: user.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
filterOption: filterOption
|
||||||
|
}),
|
||||||
|
fieldName: 'principals',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOption = (input: string, option: any) => {
|
||||||
|
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址数据
|
||||||
|
*/
|
||||||
|
async function initLocationOptions() {
|
||||||
|
const locationList = await communityTree(5);
|
||||||
|
const splitStr = '/';
|
||||||
|
handleNode(locationList, 'label', splitStr, function (node: any) {
|
||||||
|
if (node.level != 5) {
|
||||||
|
node.disabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: () => ({
|
||||||
|
class: 'w-full',
|
||||||
|
fieldNames: {
|
||||||
|
key: 'id',
|
||||||
|
label: 'label',
|
||||||
|
value: 'code',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
getPopupContainer,
|
||||||
|
placeholder: '请选择会议室地址',
|
||||||
|
showSearch: true,
|
||||||
|
treeData: locationList,
|
||||||
|
treeDefaultExpandAll: true,
|
||||||
|
treeLine: {showLeafIcon: false},
|
||||||
|
// 筛选的字段
|
||||||
|
treeNodeFilterProp: 'label',
|
||||||
|
// 选中后显示在输入框的值
|
||||||
|
treeNodeLabelProp: 'fullName',
|
||||||
|
}),
|
||||||
|
fieldName: 'location',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
<BasicForm />
|
<BasicForm>
|
||||||
|
<template #openHours="slotProps">
|
||||||
|
<TimeRangePicker v-bind="slotProps" format="HH:mm"></TimeRangePicker>
|
||||||
|
</template>
|
||||||
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
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";
|
||||||
|
|
||||||
@ -10,69 +10,70 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'name',
|
fieldName: 'name',
|
||||||
label: '会议室名称',
|
label: '会议室名称',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'InputNumber',
|
||||||
|
fieldName: 'personNumber',
|
||||||
|
label: '可容纳人数',
|
||||||
|
componentProps: {
|
||||||
|
min: 1,
|
||||||
|
step: 1,
|
||||||
|
precision:0,
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: getDictOptions('meeting_room_status'),
|
options: getDictOptions('meeting_room_status'),
|
||||||
},
|
},
|
||||||
fieldName: 'attach',
|
fieldName: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'createById',
|
|
||||||
label: '创建人id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'updateById',
|
|
||||||
label: '更新人id',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{type: 'checkbox', width: 60},
|
||||||
{
|
{
|
||||||
title: '会议室名称',
|
title: '会议室名称',
|
||||||
field: 'name',
|
field: 'name',
|
||||||
|
minWidth:100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '会议室地址',
|
title: '会议室地址',
|
||||||
field: 'location',
|
field: 'locationName',
|
||||||
|
width:210,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '可容纳人数',
|
title: '可容纳人数',
|
||||||
field: 'personNumber',
|
field: 'personNumber',
|
||||||
|
width:100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '基础服务',
|
title: '费用模式',
|
||||||
field: 'baseServiceId',
|
field: 'expenseType',
|
||||||
|
slots: {
|
||||||
|
default: ({row}) => {
|
||||||
|
return renderDict(row.expenseType, 'wy_fyms');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
width:100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '基础价格',
|
title: '开放时段',
|
||||||
field: 'basePrice',
|
field: 'openHours',
|
||||||
|
width:100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'attach',
|
field: 'status',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: 'status'
|
||||||
return renderDict(row.attach, 'meeting_room_status');
|
|
||||||
},
|
},
|
||||||
},
|
width:100,
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建人id',
|
|
||||||
field: 'createById',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '更新人id',
|
|
||||||
field: 'updateById',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'action' },
|
slots: {default: 'action'},
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
@ -93,50 +94,96 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'name',
|
fieldName: 'name',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
formItemClass: 'col-span-1',
|
||||||
{
|
|
||||||
label: '会议室地址',
|
|
||||||
fieldName: 'location',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '可容纳人数',
|
label: '可容纳人数',
|
||||||
fieldName: 'personNumber',
|
fieldName: 'personNumber',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
formItemClass: 'col-span-1',
|
||||||
{
|
|
||||||
label: '基础服务',
|
|
||||||
fieldName: 'baseServiceId',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '基础价格',
|
|
||||||
fieldName: 'basePrice',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '状态',
|
|
||||||
fieldName: 'attach',
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: getDictOptions('meeting_room_status'),
|
min: 1,
|
||||||
|
step: 1,
|
||||||
|
precision:0,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '会议室地址',
|
||||||
|
fieldName: 'location',
|
||||||
|
component: 'TreeSelect',
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '创建人id',
|
label: '配套设备',
|
||||||
fieldName: 'createById',
|
fieldName: 'baseService',
|
||||||
component: 'Input',
|
component: 'Textarea',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '更新人id',
|
label: '负责人',
|
||||||
fieldName: 'updateById',
|
fieldName: 'principals',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '费用模式',
|
||||||
|
fieldName: 'expenseType',
|
||||||
|
component: 'RadioGroup',
|
||||||
|
componentProps: {
|
||||||
|
buttonStyle: 'solid',
|
||||||
|
options: getDictOptions('wy_fyms'),
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-1',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '付费金额',
|
||||||
|
fieldName: 'basePrice',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps: {
|
||||||
|
min: 0,
|
||||||
|
step: 1,
|
||||||
|
precision:2,
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-1',
|
||||||
|
dependencies: {
|
||||||
|
// 仅当 费用模式 为 2(付费) 时显示
|
||||||
|
show: (formValues: any) => formValues.expenseType === '2',
|
||||||
|
triggerFields: ['expenseType'],
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '会议室图片',
|
||||||
|
fieldName: 'picture',
|
||||||
|
component: 'ImageUpload',
|
||||||
|
componentProps: {
|
||||||
|
maxCount: 10, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '预约是否需要审核',
|
||||||
|
fieldName: 'isCheck',
|
||||||
|
component: 'RadioGroup',
|
||||||
|
componentProps: {
|
||||||
|
buttonStyle: 'solid',
|
||||||
|
options: getDictOptions('wy_sf'),
|
||||||
|
},
|
||||||
|
labelWidth:130,
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '开放时段',
|
||||||
|
fieldName: 'openHours',
|
||||||
|
component: 'Input',
|
||||||
|
slots: {default: 'openHours'},
|
||||||
|
formItemClass: 'col-span-1',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '会议室描述',
|
||||||
|
fieldName: 'descs',
|
||||||
|
component: 'Textarea',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
@ -13,9 +13,12 @@ import {
|
|||||||
meetRemove,
|
meetRemove,
|
||||||
} from '#/api/property/roomBooking/conferenceSettings';
|
} from '#/api/property/roomBooking/conferenceSettings';
|
||||||
import type { MeetForm } from '#/api/property/roomBooking/conferenceSettings/model';
|
import type { MeetForm } from '#/api/property/roomBooking/conferenceSettings/model';
|
||||||
import ConferenceSettingsModal from './conferenceSettings-modal.vue';
|
import conferenceSettingsModal from './conferenceSettings-modal.vue';
|
||||||
import ConferenceSettingsDetail from './conferenceSettings-detail.vue';
|
import ConferenceSettingsDetail from './conferenceSettings-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
|
import {TableSwitch} from "#/components/table";
|
||||||
|
import {meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||||
|
import {useAccess} from "@vben/access";
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@ -62,8 +65,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
gridOptions,
|
gridOptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [conferenceSettingsModal, modalApi] = useVbenModal({
|
const [ConferenceSettingsModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: ConferenceSettingsModal,
|
connectedComponent: conferenceSettingsModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [ConferenceSettingsDetailModal, ConferenceSettingsDetailApi] = useVbenModal({
|
const [ConferenceSettingsDetailModal, ConferenceSettingsDetailApi] = useVbenModal({
|
||||||
@ -103,6 +106,8 @@ function handleMultiDelete() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { hasAccessByCodes } = useAccess();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -156,8 +161,18 @@ function handleMultiDelete() {
|
|||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
|
<template #status="{ row }">
|
||||||
|
<TableSwitch
|
||||||
|
:checkedValue="0"
|
||||||
|
:unCheckedValue="1"
|
||||||
|
v-model:value="row.status"
|
||||||
|
:api="() => meetUpdate(row)"
|
||||||
|
:disabled=" !hasAccessByCodes(['system:meet:edit'])"
|
||||||
|
@reload="() => tableApi.query()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<conferenceSettingsModal @reload="tableApi.query()" />
|
<ConferenceSettingsModal @reload="tableApi.query()" />
|
||||||
<ConferenceSettingsDetailModal/>
|
<ConferenceSettingsDetailModal/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user