This commit is contained in:
parent
602e8951cc
commit
b1265fb00c
@ -12,7 +12,7 @@ import { requestClient } from '#/api/request';
|
||||
* @returns 会议室设置列表
|
||||
*/
|
||||
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 会议室设置列表
|
||||
*/
|
||||
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 会议室设置详情
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 创建人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 {
|
||||
@ -103,6 +120,39 @@ export interface MeetForm extends BaseEntity {
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principals: string;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
descs: string;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phoneNo: string;
|
||||
/**
|
||||
* 是否审核
|
||||
*/
|
||||
isCheck: string;
|
||||
/**
|
||||
* 开放时间
|
||||
*/
|
||||
openHours: string;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
/**
|
||||
*费用模式
|
||||
*/
|
||||
expenseType: string;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MeetQuery extends PageQuery {
|
||||
@ -155,6 +205,39 @@ export interface MeetQuery extends PageQuery {
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principals: string;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
descs: string;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phoneNo: string;
|
||||
/**
|
||||
* 是否审核
|
||||
*/
|
||||
isCheck: string;
|
||||
/**
|
||||
* 开放时间
|
||||
*/
|
||||
openHours: string;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
/**
|
||||
*费用模式
|
||||
*/
|
||||
expenseType: string;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
}
|
||||
|
||||
export interface conferenceSettingsDetail extends BaseEntity {
|
||||
@ -173,6 +256,8 @@ export interface conferenceSettingsDetail extends BaseEntity {
|
||||
*/
|
||||
location: string;
|
||||
|
||||
locationName: string;
|
||||
|
||||
/**
|
||||
* 容纳人数
|
||||
*/
|
||||
@ -207,4 +292,37 @@ export interface conferenceSettingsDetail extends BaseEntity {
|
||||
* 搜索值
|
||||
*/
|
||||
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',
|
||||
label: '租赁方式',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_charging_status')
|
||||
},
|
||||
fieldName: 'paymentStatus',
|
||||
label: '支付状态',
|
||||
},
|
||||
// {
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_charging_status')
|
||||
// },
|
||||
// fieldName: 'paymentStatus',
|
||||
// label: '支付状态',
|
||||
// },
|
||||
|
||||
];
|
||||
|
||||
@ -99,16 +99,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
field: 'paymentStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.paymentStatus, 'pro_charging_status');
|
||||
},
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// title: '支付状态',
|
||||
// field: 'paymentStatus',
|
||||
// slots: {
|
||||
// default: ({ row }) => {
|
||||
// return renderDict(row.paymentStatus, 'pro_charging_status');
|
||||
// },
|
||||
// },
|
||||
// width: 100
|
||||
// },
|
||||
{
|
||||
title: '是否续租',
|
||||
field: 'isRelet',
|
||||
|
@ -74,11 +74,11 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="支付状态">
|
||||
<component
|
||||
:is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="支付状态">-->
|
||||
<!-- <component-->
|
||||
<!-- :is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"-->
|
||||
<!-- />-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="是否续租">
|
||||
<component
|
||||
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
||||
|
@ -156,9 +156,9 @@ const modalSchema = [
|
||||
min: 1,
|
||||
max: plantInfo.value?.inventory,
|
||||
precision: 0,
|
||||
onChange:async ()=>{
|
||||
onChange: async () => {
|
||||
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);
|
||||
}
|
||||
},
|
||||
@ -182,7 +182,6 @@ const modalSchema = [
|
||||
step: 1,
|
||||
placeholder: '租赁数量不可超出绿植产品库存数量',
|
||||
onChange: async (value: number) => {
|
||||
console.log(value,'================vvvv')
|
||||
if (plantInfo.value) {
|
||||
singleAmount.value = (plantInfo.value.rent * value).toFixed(2);
|
||||
}
|
||||
@ -202,8 +201,8 @@ const modalSchema = [
|
||||
slots: {default: 'totalAmount'},
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues: any) => formValues.productNum&&formValues.productId&&formValues.rentalType === '1',
|
||||
triggerFields: ['productNum','rentalType'],
|
||||
show: (formValues: any) => formValues.productNum && formValues.productId && formValues.rentalType === '1',
|
||||
triggerFields: ['productNum', 'rentalType'],
|
||||
disabled: true,
|
||||
},
|
||||
labelWidth: 110
|
||||
@ -317,14 +316,14 @@ async function handleConfirm() {
|
||||
} else {
|
||||
data.productId = undefined;
|
||||
data.productNum = undefined;
|
||||
data.productList = plantsList.value
|
||||
data.productList = planProducts.value
|
||||
data.totalAmount = totalAmount.value
|
||||
}
|
||||
if (data.rentalTime) {
|
||||
data.startTime = data.rentalTime[0];
|
||||
data.endTime = data.rentalTime[1];
|
||||
}
|
||||
data.paymentStatus=0
|
||||
data.paymentStatus = 0
|
||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@ -339,7 +338,12 @@ async function handleConfirm() {
|
||||
//获取有库存的绿植
|
||||
async function getPlanProducts(id: string) {
|
||||
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)
|
||||
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
initLocationOptions()
|
||||
await initLocationOptions()
|
||||
if (isUpdate.value && id) {
|
||||
const record = await resident_unitInfo(id);
|
||||
await formApi.setValues(record);
|
||||
|
@ -8,6 +8,7 @@ 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);
|
||||
|
||||
@ -33,27 +34,46 @@ async function handleOpenChange(open: boolean) {
|
||||
</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}}
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="会议室详情" class="w-[70%]">
|
||||
<Descriptions v-if="conferenceSettingsDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="会议室名称">
|
||||
{{ conferenceSettingsDetail.name }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单价(元)">
|
||||
{{ conferenceSettingsDetail.price }}
|
||||
<DescriptionsItem label="可容纳人数">
|
||||
{{ conferenceSettingsDetail.personNumber }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位">
|
||||
{{ conferenceSettingsDetail.unit }}
|
||||
<DescriptionsItem label="会议室地址" :span="2">
|
||||
{{ conferenceSettingsDetail.locationName }}
|
||||
</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
|
||||
:is="renderDict(conferenceSettingsDetail.type,'wy_parking_spot')"
|
||||
:is="renderDict(conferenceSettingsDetail.expenseType,'wy_fyms')"
|
||||
/>
|
||||
</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
|
||||
:is="renderDict(conferenceSettingsDetail.state,'wy_appointment_tatus')"
|
||||
:is="renderDict(conferenceSettingsDetail.isCheck,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开放时段" :span="2">
|
||||
{{ conferenceSettingsDetail.openHours }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室描述" :span="2">
|
||||
{{ conferenceSettingsDetail.descs }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@ -1,16 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep, getPopupContainer, handleNode} 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';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {meetAdd, meetInfo, meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
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 isUpdate = ref(false);
|
||||
@ -21,7 +25,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@ -34,7 +38,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@ -43,7 +47,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[60%]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@ -53,12 +57,22 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
await formApi.setValues({
|
||||
expenseType:'1',
|
||||
isCheck:'0',
|
||||
})
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
await queryPerson()
|
||||
await initLocationOptions()
|
||||
if (isUpdate.value && 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 markInitialized();
|
||||
@ -70,12 +84,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
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));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@ -91,11 +108,75 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
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>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm>
|
||||
<template #openHours="slotProps">
|
||||
<TimeRangePicker v-bind="slotProps" format="HH:mm"></TimeRangePicker>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
@ -10,69 +10,70 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'name',
|
||||
label: '会议室名称',
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'personNumber',
|
||||
label: '可容纳人数',
|
||||
componentProps: {
|
||||
min: 1,
|
||||
step: 1,
|
||||
precision:0,
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('meeting_room_status'),
|
||||
},
|
||||
fieldName: 'attach',
|
||||
fieldName: 'status',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'createById',
|
||||
label: '创建人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'updateById',
|
||||
label: '更新人id',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '会议室名称',
|
||||
field: 'name',
|
||||
minWidth:100,
|
||||
},
|
||||
{
|
||||
title: '会议室地址',
|
||||
field: 'location',
|
||||
field: 'locationName',
|
||||
width:210,
|
||||
},
|
||||
{
|
||||
title: '可容纳人数',
|
||||
field: 'personNumber',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '基础服务',
|
||||
field: 'baseServiceId',
|
||||
title: '费用模式',
|
||||
field: 'expenseType',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.expenseType, 'wy_fyms');
|
||||
},
|
||||
},
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '基础价格',
|
||||
field: 'basePrice',
|
||||
title: '开放时段',
|
||||
field: 'openHours',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'attach',
|
||||
field: 'status',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.attach, 'meeting_room_status');
|
||||
default: 'status'
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建人id',
|
||||
field: 'createById',
|
||||
},
|
||||
{
|
||||
title: '更新人id',
|
||||
field: 'updateById',
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@ -93,50 +94,96 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '会议室地址',
|
||||
fieldName: 'location',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-1',
|
||||
},
|
||||
{
|
||||
label: '可容纳人数',
|
||||
fieldName: 'personNumber',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '基础服务',
|
||||
fieldName: 'baseServiceId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '基础价格',
|
||||
fieldName: 'basePrice',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'attach',
|
||||
component: 'Select',
|
||||
formItemClass: 'col-span-1',
|
||||
componentProps: {
|
||||
options: getDictOptions('meeting_room_status'),
|
||||
min: 1,
|
||||
step: 1,
|
||||
precision:0,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '会议室地址',
|
||||
fieldName: 'location',
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
label: '配套设备',
|
||||
fieldName: 'baseService',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
label: '负责人',
|
||||
fieldName: 'principals',
|
||||
component: 'Select',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '费用模式',
|
||||
fieldName: 'expenseType',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_fyms'),
|
||||
},
|
||||
formItemClass: 'col-span-1',
|
||||
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,
|
||||
} from '#/api/property/roomBooking/conferenceSettings';
|
||||
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 { columns, querySchema } from './data';
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {meetUpdate} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {useAccess} from "@vben/access";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@ -62,8 +65,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [conferenceSettingsModal, modalApi] = useVbenModal({
|
||||
connectedComponent: ConferenceSettingsModal,
|
||||
const [ConferenceSettingsModal, modalApi] = useVbenModal({
|
||||
connectedComponent: conferenceSettingsModal,
|
||||
});
|
||||
|
||||
const [ConferenceSettingsDetailModal, ConferenceSettingsDetailApi] = useVbenModal({
|
||||
@ -103,6 +106,8 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -156,8 +161,18 @@ function handleMultiDelete() {
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</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>
|
||||
<conferenceSettingsModal @reload="tableApi.query()" />
|
||||
<ConferenceSettingsModal @reload="tableApi.query()" />
|
||||
<ConferenceSettingsDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user