Merge remote-tracking branch 'origin/master'
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
commit
3749f4bbb9
@ -1,4 +1,9 @@
|
||||
import type { RoomBookingVO, RoomBookingForm, RoomBookingQuery,GetMeetNameVO } from './model';
|
||||
import type {
|
||||
RoomBookingVO,
|
||||
RoomBookingForm,
|
||||
RoomBookingQuery,
|
||||
GetMeetNameVO,
|
||||
} from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
@ -7,21 +12,26 @@ import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询会议室名称列表
|
||||
* @param getMeetName 后端约定传'getMeetName'
|
||||
* @returns 会议室名称列表
|
||||
*/
|
||||
* 查询会议室名称列表
|
||||
* @param getMeetName 后端约定传'getMeetName'
|
||||
* @returns 会议室名称列表
|
||||
*/
|
||||
export function getMeetName() {
|
||||
return requestClient.get<PageResult<GetMeetNameVO>>(`/property/enum-fetcher/enum-values/${'getMeetName'}`);
|
||||
return requestClient.get<GetMeetNameVO[]>(
|
||||
`/property/enum-fetcher/enum-values/${'getMeetName'}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会议管理列表
|
||||
* @param params
|
||||
* @returns 会议管理列表
|
||||
*/
|
||||
* 查询会议管理列表
|
||||
* @param params
|
||||
* @returns 会议管理列表
|
||||
*/
|
||||
export function roomBookingList(params?: RoomBookingQuery) {
|
||||
return requestClient.get<PageResult<RoomBookingVO>>('/property/roomBooking/list', { params });
|
||||
return requestClient.get<PageResult<RoomBookingVO>>(
|
||||
'/property/roomBooking/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,10 +79,15 @@ export function roomBookingRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/roomBooking/${id}`);
|
||||
}
|
||||
/**
|
||||
* 按照日期查询已预约会议预约记录列表
|
||||
* @param params
|
||||
* @returns 会议预约列表
|
||||
*/
|
||||
export function meetbookingAppointmentList(params?: MeetbookingAppointmentQuery) {
|
||||
return requestClient.get<PageResult<MeetbookingVO>>('/property/meetbooking/appointment-list', { params });
|
||||
}
|
||||
* 按照日期查询已预约会议预约记录列表
|
||||
* @param params
|
||||
* @returns 会议预约列表
|
||||
*/
|
||||
export function meetbookingAppointmentList(
|
||||
params?: MeetbookingAppointmentQuery,
|
||||
) {
|
||||
return requestClient.get<PageResult<MeetbookingVO>>(
|
||||
'/property/meetbooking/appointment-list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
@ -127,24 +127,24 @@ function handleDownloadExcel() {
|
||||
);
|
||||
}
|
||||
|
||||
function handleView(row: Required<CleanForm>) {
|
||||
function handleView(row: Required<CleanForm>) {
|
||||
modalApi.setData({ id: row.id, readonly: true });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
function handleAudit(row:any) {
|
||||
function handleAudit(row: any) {
|
||||
// 审核逻辑
|
||||
// TODO: 实现审核功能
|
||||
console.log('审核', row);
|
||||
modalApi.setData({ id: row.id, readonly: true,audit:true,row:row });
|
||||
modalApi.setData({ id: row.id, readonly: true, audit: true, row: row });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
function handleRefund(row:any) {
|
||||
function handleRefund(row: any) {
|
||||
// 退定逻辑
|
||||
// TODO: 实现退定功能
|
||||
console.log('退定', row);
|
||||
modalApi.setData({ id: row.id, readonly: true,refund:true,row:row });
|
||||
modalApi.setData({ id: row.id, readonly: true, refund: true, row: row });
|
||||
modalApi.open();
|
||||
}
|
||||
</script>
|
||||
@ -160,15 +160,6 @@ function handleRefund(row:any) {
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:clean:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:clean:add']"
|
||||
@ -187,11 +178,20 @@ function handleRefund(row:any) {
|
||||
<Space>
|
||||
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button>
|
||||
<template v-if="row.state === 0">
|
||||
<ghost-button type="primary" @click.stop="handleAudit(row)">审核</ghost-button>
|
||||
<ghost-button type="primary" @click.stop="handleAudit(row)"
|
||||
>审核</ghost-button
|
||||
>
|
||||
</template>
|
||||
<template v-else>
|
||||
<ghost-button danger @click.stop="handleRefund(row)" v-if="row.isUnbooking === 0">退定</ghost-button>
|
||||
<ghost-button disabled v-else>已退定</ghost-button>
|
||||
<ghost-button
|
||||
danger
|
||||
@click.stop="handleRefund(row)"
|
||||
v-if="row.isUnbooking === 0"
|
||||
>退定</ghost-button
|
||||
>
|
||||
<ghost-button disabled v-else-if="row.isUnbooking === 1"
|
||||
>已退定</ghost-button
|
||||
>
|
||||
</template>
|
||||
</Space>
|
||||
</template>
|
||||
|
@ -42,7 +42,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '劳务名称',
|
||||
field: 'name',
|
||||
width: '120',
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
@ -95,6 +95,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: '230',
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -12,7 +12,7 @@ import dayjs from 'dayjs';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionTask-index'
|
||||
id: 'property-inspectionTask-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@ -118,9 +118,14 @@ function handleMultiDelete() {
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionTaskExport, '巡检任务数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
commonDownloadExcel(
|
||||
inspectionTaskExport,
|
||||
'巡检任务数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -140,16 +145,9 @@ function handleDownloadExcel() {
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionTask:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="true"
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionTask:add']"
|
||||
@click="handleAdd"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
@ -158,7 +156,7 @@ function handleDownloadExcel() {
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionTask:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>详情
|
||||
>详情
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
|
@ -24,7 +24,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
@ -53,10 +53,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
setupCommunitySelect()
|
||||
setupCommunitySelect();
|
||||
if (isUpdate.value && id) {
|
||||
const record = await roomInfo(id);
|
||||
await formApi.setValues(record);
|
||||
await formApi.setValues({
|
||||
...record,
|
||||
isForSale: String(record.isForSale),
|
||||
});
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
@ -84,7 +87,6 @@ async function handleConfirm() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化城市
|
||||
*/
|
||||
@ -134,4 +136,3 @@ async function handleClosed() {
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@ -5,7 +5,10 @@ import dayjs from 'dayjs';
|
||||
import type { TableColumnType } from 'ant-design-vue';
|
||||
import { Radio, Select, Button, Table } from 'ant-design-vue';
|
||||
import { getMeetName } from '#/api/property/roomBooking';
|
||||
import { getAppointmentListByDate,getAppointmentListBymeetId } from '#/api/property/roomBooking/conferenceView';
|
||||
import {
|
||||
getAppointmentListByDate,
|
||||
getAppointmentListBymeetId,
|
||||
} from '#/api/property/roomBooking/conferenceView';
|
||||
import type { RadioChangeEvent } from 'ant-design-vue';
|
||||
import type { SelectValue } from 'ant-design-vue/es/select';
|
||||
|
||||
@ -17,13 +20,13 @@ interface ConferenceRoom {
|
||||
interface ConferenceBooking {
|
||||
id: string | number;
|
||||
tbConferenceId: string | number; // 会议室ID
|
||||
bookingName: string; // 预约人
|
||||
deptName: string; // 部门名称
|
||||
subject: string; // 会议主题
|
||||
startTime: string; // 开始时间
|
||||
endTime: string; // 结束时间
|
||||
bookingDate: string; // 预约日期
|
||||
status: number; // 状态
|
||||
bookingName: string; // 预约人
|
||||
deptName: string; // 部门名称
|
||||
subject: string; // 会议主题
|
||||
startTime: string; // 开始时间
|
||||
endTime: string; // 结束时间
|
||||
bookingDate: string; // 预约日期
|
||||
status: number; // 状态
|
||||
}
|
||||
|
||||
// 视图模式
|
||||
@ -70,12 +73,12 @@ async function fetchBookings(): Promise<void> {
|
||||
try {
|
||||
if (viewMode.value === 'date') {
|
||||
const roomRes = await getMeetName();
|
||||
roomList.value = ([roomRes]).map((item: any) => ({
|
||||
roomList.value = roomRes.map((item: any) => ({
|
||||
id: item.value,
|
||||
name: item.name
|
||||
name: item.name,
|
||||
}));
|
||||
const appointmentRes = await getAppointmentListByDate({
|
||||
appointmentDate: selectedDate.value
|
||||
appointmentDate: selectedDate.value,
|
||||
});
|
||||
bookings.value = (appointmentRes || []).map((item: any) => ({
|
||||
id: item.id,
|
||||
@ -98,17 +101,19 @@ async function fetchBookings(): Promise<void> {
|
||||
// 兼容后续渲染
|
||||
}));
|
||||
// 处理为表格结构
|
||||
const table: Record<string, Record<string, any>> = { '上午': {}, '下午': {} };
|
||||
roomList.value.forEach(room => {
|
||||
['上午', '下午'].forEach(slot => {
|
||||
const booking = bookings.value.find(b => b.name === room.name && b.slots === slot);
|
||||
const table: Record<string, Record<string, any>> = { 上午: {}, 下午: {} };
|
||||
roomList.value.forEach((room) => {
|
||||
['上午', '下午'].forEach((slot) => {
|
||||
const booking = bookings.value.find(
|
||||
(b) => b.name === room.name && b.slots === slot,
|
||||
);
|
||||
table[slot][room.name] = booking || null;
|
||||
});
|
||||
});
|
||||
bookingTable.value = table;
|
||||
} else {
|
||||
const res = await getAppointmentListBymeetId({
|
||||
meetId: selectedRoom.value
|
||||
meetId: selectedRoom.value,
|
||||
});
|
||||
bookings.value = (res || []).map((item: any) => ({
|
||||
id: item.id,
|
||||
@ -129,16 +134,19 @@ async function fetchBookings(): Promise<void> {
|
||||
bookingDate: item.scheduledStarttime,
|
||||
tbConferenceId: item.meetId,
|
||||
}));
|
||||
const table: Record<string, Record<string, any>> = { '上午': {}, '下午': {} };
|
||||
weekDates.value.forEach(date => {
|
||||
['上午', '下午'].forEach(slot => {
|
||||
const booking = bookings.value.find(b => dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === date && b.slots === slot);
|
||||
const table: Record<string, Record<string, any>> = { 上午: {}, 下午: {} };
|
||||
weekDates.value.forEach((date) => {
|
||||
['上午', '下午'].forEach((slot) => {
|
||||
const booking = bookings.value.find(
|
||||
(b) =>
|
||||
dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === date &&
|
||||
b.slots === slot,
|
||||
);
|
||||
table[slot][date] = booking || null;
|
||||
});
|
||||
});
|
||||
bookingTable.value = table;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('获取预约数据失败:', error);
|
||||
} finally {
|
||||
@ -150,8 +158,8 @@ async function fetchBookings(): Promise<void> {
|
||||
function handleViewModeChange(e: RadioChangeEvent): void {
|
||||
viewMode.value = e.target.value;
|
||||
if (viewMode.value === 'date') {
|
||||
// 默认选中今天
|
||||
selectedDate.value = dayjs().format('YYYY-MM-DD');
|
||||
// 默认选中今天
|
||||
selectedDate.value = dayjs().format('YYYY-MM-DD');
|
||||
} else {
|
||||
selectedRoom.value = roomList.value[0]?.id ?? '';
|
||||
}
|
||||
@ -171,46 +179,45 @@ function handleRoomChange(value: SelectValue): void {
|
||||
}
|
||||
|
||||
// 获取单元格预约信息(上午/下午)
|
||||
function getCellBooking(col: string, time: string): ConferenceBooking | undefined {
|
||||
function getCellBooking(
|
||||
col: string,
|
||||
time: string,
|
||||
): ConferenceBooking | undefined {
|
||||
// 判断时间属于上午还是下午
|
||||
function isMorning(startTime: string) {
|
||||
const hour = dayjs(startTime).hour();
|
||||
return hour < 12;
|
||||
}
|
||||
if (viewMode.value === 'date') {
|
||||
const room = roomList.value.find(r => r.name === col);
|
||||
return bookings.value.find(b =>
|
||||
b.tbConferenceId === room?.id &&
|
||||
((time === '上午' && isMorning(b.startTime)) || (time === '下午' && !isMorning(b.startTime)))
|
||||
const room = roomList.value.find((r) => r.name === col);
|
||||
return bookings.value.find(
|
||||
(b) =>
|
||||
b.tbConferenceId === room?.id &&
|
||||
((time === '上午' && isMorning(b.startTime)) ||
|
||||
(time === '下午' && !isMorning(b.startTime))),
|
||||
);
|
||||
} else {
|
||||
return bookings.value.find(b =>
|
||||
dayjs(b.bookingDate).format('YYYY-MM-DD') === col &&
|
||||
((time === '上午' && isMorning(b.startTime)) || (time === '下午' && !isMorning(b.startTime)))
|
||||
return bookings.value.find(
|
||||
(b) =>
|
||||
dayjs(b.bookingDate).format('YYYY-MM-DD') === col &&
|
||||
((time === '上午' && isMorning(b.startTime)) ||
|
||||
(time === '下午' && !isMorning(b.startTime))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 修改渲染预约单元格的函数
|
||||
function renderBookingCell(booking: ConferenceBooking) {
|
||||
return h('div',
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
class: 'booking-cell'
|
||||
class: 'booking-cell',
|
||||
},
|
||||
[
|
||||
h('span',
|
||||
{ class: 'booking-user' },
|
||||
`预约人:${booking.bookingName}`
|
||||
),
|
||||
h('span',
|
||||
{ class: 'booking-dept' },
|
||||
`单位:${booking.deptName}`
|
||||
),
|
||||
h('span',
|
||||
{ class: 'booking-subject' },
|
||||
`主题:${booking.subject}`
|
||||
)
|
||||
]
|
||||
h('span', { class: 'booking-user' }, `预约人:${booking.bookingName}`),
|
||||
h('span', { class: 'booking-dept' }, `单位:${booking.deptName}`),
|
||||
h('span', { class: 'booking-subject' }, `主题:${booking.subject}`),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -223,7 +230,7 @@ function getRandomBgColor() {
|
||||
background: `rgba(${r},${g},${b},0.5)`,
|
||||
borderRadius: '6px',
|
||||
padding: '60px 10px',
|
||||
transition: 'background 0.3s'
|
||||
transition: 'background 0.3s',
|
||||
};
|
||||
}
|
||||
|
||||
@ -247,37 +254,41 @@ function getFullRoomList() {
|
||||
}
|
||||
|
||||
const columns = computed<TableColumnType<TableRecord>[]>(() => {
|
||||
const baseColumns: TableColumnType<TableRecord>[] = [{
|
||||
title: '时间',
|
||||
dataIndex: 'slot',
|
||||
key: 'slot',
|
||||
width: 100,
|
||||
fixed: 'left' as const
|
||||
}];
|
||||
const dynamicColumns: TableColumnType<TableRecord>[] = viewMode.value === 'date'
|
||||
? getFullRoomList().map(room => ({
|
||||
title: room.name || ' ',
|
||||
dataIndex: room.name,
|
||||
key: room.name,
|
||||
width: 200,
|
||||
}))
|
||||
: weekDates.value.map(date => ({
|
||||
title: dayjs(date).format('YYYY-MM-DD'),
|
||||
dataIndex: date,
|
||||
key: date,
|
||||
width: 200,
|
||||
}));
|
||||
const baseColumns: TableColumnType<TableRecord>[] = [
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'slot',
|
||||
key: 'slot',
|
||||
width: 100,
|
||||
fixed: 'left' as const,
|
||||
},
|
||||
];
|
||||
const dynamicColumns: TableColumnType<TableRecord>[] =
|
||||
viewMode.value === 'date'
|
||||
? getFullRoomList().map((room) => ({
|
||||
title: room.name || ' ',
|
||||
dataIndex: room.name,
|
||||
key: room.name,
|
||||
width: 200,
|
||||
}))
|
||||
: weekDates.value.map((date) => ({
|
||||
title: dayjs(date).format('YYYY-MM-DD'),
|
||||
dataIndex: date,
|
||||
key: date,
|
||||
width: 200,
|
||||
}));
|
||||
return [...baseColumns, ...dynamicColumns];
|
||||
});
|
||||
|
||||
const tableData = computed<TableRecord[]>(() => {
|
||||
const slots = ['上午', '下午'];
|
||||
return slots.map(slot => {
|
||||
return slots.map((slot) => {
|
||||
const row: any = { slot };
|
||||
const cols = viewMode.value === 'date'
|
||||
? getFullRoomList().map(room => room.name)
|
||||
: weekDates.value;
|
||||
cols.forEach(col => {
|
||||
const cols =
|
||||
viewMode.value === 'date'
|
||||
? getFullRoomList().map((room) => room.name)
|
||||
: weekDates.value;
|
||||
cols.forEach((col) => {
|
||||
row[col] = bookingTable.value[slot]?.[col] || null;
|
||||
});
|
||||
return row;
|
||||
@ -336,10 +347,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex !== 'slot'">
|
||||
<div
|
||||
v-if="record[column.dataIndex]"
|
||||
:style="getRandomBgColor()"
|
||||
>
|
||||
<div v-if="record[column.dataIndex]" :style="getRandomBgColor()">
|
||||
<div>预约人:{{ record[column.dataIndex].personName }}</div>
|
||||
<div>单位:{{ record[column.dataIndex].unitName }}</div>
|
||||
</div>
|
||||
@ -409,8 +417,8 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
:deep(.ant-table-tbody > tr > td:first-child) {
|
||||
padding: 10px;
|
||||
height: 200px;
|
||||
}
|
||||
padding: 10px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -3,9 +3,10 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'TreeSelect',
|
||||
component: 'Input',
|
||||
fieldName: 'unitName',
|
||||
label: '单元名称',
|
||||
labelWidth: 100,
|
||||
},
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user