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 { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
@ -12,7 +17,9 @@ import { requestClient } from '#/api/request';
|
|||||||
* @returns 会议室名称列表
|
* @returns 会议室名称列表
|
||||||
*/
|
*/
|
||||||
export function getMeetName() {
|
export function getMeetName() {
|
||||||
return requestClient.get<PageResult<GetMeetNameVO>>(`/property/enum-fetcher/enum-values/${'getMeetName'}`);
|
return requestClient.get<GetMeetNameVO[]>(
|
||||||
|
`/property/enum-fetcher/enum-values/${'getMeetName'}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +28,10 @@ export function getMeetName() {
|
|||||||
* @returns 会议管理列表
|
* @returns 会议管理列表
|
||||||
*/
|
*/
|
||||||
export function roomBookingList(params?: RoomBookingQuery) {
|
export function roomBookingList(params?: RoomBookingQuery) {
|
||||||
return requestClient.get<PageResult<RoomBookingVO>>('/property/roomBooking/list', { params });
|
return requestClient.get<PageResult<RoomBookingVO>>(
|
||||||
|
'/property/roomBooking/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +83,11 @@ export function roomBookingRemove(id: ID | IDS) {
|
|||||||
* @param params
|
* @param params
|
||||||
* @returns 会议预约列表
|
* @returns 会议预约列表
|
||||||
*/
|
*/
|
||||||
export function meetbookingAppointmentList(params?: MeetbookingAppointmentQuery) {
|
export function meetbookingAppointmentList(
|
||||||
return requestClient.get<PageResult<MeetbookingVO>>('/property/meetbooking/appointment-list', { params });
|
params?: MeetbookingAppointmentQuery,
|
||||||
|
) {
|
||||||
|
return requestClient.get<PageResult<MeetbookingVO>>(
|
||||||
|
'/property/meetbooking/appointment-list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
}
|
}
|
@ -160,15 +160,6 @@ function handleRefund(row:any) {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.export') }}
|
{{ $t('pages.common.export') }}
|
||||||
</a-button>
|
</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
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-access:code="['property:clean:add']"
|
v-access:code="['property:clean:add']"
|
||||||
@ -187,11 +178,20 @@ function handleRefund(row:any) {
|
|||||||
<Space>
|
<Space>
|
||||||
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button>
|
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button>
|
||||||
<template v-if="row.state === 0">
|
<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>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<ghost-button danger @click.stop="handleRefund(row)" v-if="row.isUnbooking === 0">退定</ghost-button>
|
<ghost-button
|
||||||
<ghost-button disabled v-else>已退定</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>
|
</template>
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
|
@ -42,7 +42,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '劳务名称',
|
title: '劳务名称',
|
||||||
field: 'name',
|
field: 'name',
|
||||||
width: '120',
|
minWidth: '120',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
@ -95,6 +95,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'action' },
|
slots: { default: 'action' },
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
width: '230',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import dayjs from 'dayjs';
|
|||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps,
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
|
|||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
id: 'property-inspectionTask-index'
|
id: 'property-inspectionTask-index',
|
||||||
};
|
};
|
||||||
|
|
||||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
@ -118,9 +118,14 @@ function handleMultiDelete() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleDownloadExcel() {
|
function handleDownloadExcel() {
|
||||||
commonDownloadExcel(inspectionTaskExport, '巡检任务数据', tableApi.formApi.form.values, {
|
commonDownloadExcel(
|
||||||
|
inspectionTaskExport,
|
||||||
|
'巡检任务数据',
|
||||||
|
tableApi.formApi.form.values,
|
||||||
|
{
|
||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -140,16 +145,9 @@ function handleDownloadExcel() {
|
|||||||
danger
|
danger
|
||||||
type="primary"
|
type="primary"
|
||||||
v-access:code="['property:inspectionTask:remove']"
|
v-access:code="['property:inspectionTask:remove']"
|
||||||
@click="handleMultiDelete">
|
@click="handleMultiDelete"
|
||||||
{{ $t('pages.common.delete') }}
|
|
||||||
</a-button>
|
|
||||||
<a-button
|
|
||||||
:disabled="true"
|
|
||||||
type="primary"
|
|
||||||
v-access:code="['property:inspectionTask:add']"
|
|
||||||
@click="handleAdd"
|
|
||||||
>
|
>
|
||||||
{{ $t('pages.common.add') }}
|
{{ $t('pages.common.delete') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
|
@ -24,7 +24,7 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
schema: modalSchema(),
|
schema: modalSchema(),
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
@ -53,10 +53,13 @@ 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;
|
||||||
setupCommunitySelect()
|
setupCommunitySelect();
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await roomInfo(id);
|
const record = await roomInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues({
|
||||||
|
...record,
|
||||||
|
isForSale: String(record.isForSale),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
@ -84,7 +87,6 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化城市
|
* 初始化城市
|
||||||
*/
|
*/
|
||||||
@ -134,4 +136,3 @@ async function handleClosed() {
|
|||||||
<BasicForm />
|
<BasicForm />
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@ import dayjs from 'dayjs';
|
|||||||
import type { TableColumnType } from 'ant-design-vue';
|
import type { TableColumnType } from 'ant-design-vue';
|
||||||
import { Radio, Select, Button, Table } from 'ant-design-vue';
|
import { Radio, Select, Button, Table } from 'ant-design-vue';
|
||||||
import { getMeetName } from '#/api/property/roomBooking';
|
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 { RadioChangeEvent } from 'ant-design-vue';
|
||||||
import type { SelectValue } from 'ant-design-vue/es/select';
|
import type { SelectValue } from 'ant-design-vue/es/select';
|
||||||
|
|
||||||
@ -70,12 +73,12 @@ async function fetchBookings(): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
if (viewMode.value === 'date') {
|
if (viewMode.value === 'date') {
|
||||||
const roomRes = await getMeetName();
|
const roomRes = await getMeetName();
|
||||||
roomList.value = ([roomRes]).map((item: any) => ({
|
roomList.value = roomRes.map((item: any) => ({
|
||||||
id: item.value,
|
id: item.value,
|
||||||
name: item.name
|
name: item.name,
|
||||||
}));
|
}));
|
||||||
const appointmentRes = await getAppointmentListByDate({
|
const appointmentRes = await getAppointmentListByDate({
|
||||||
appointmentDate: selectedDate.value
|
appointmentDate: selectedDate.value,
|
||||||
});
|
});
|
||||||
bookings.value = (appointmentRes || []).map((item: any) => ({
|
bookings.value = (appointmentRes || []).map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@ -98,17 +101,19 @@ async function fetchBookings(): Promise<void> {
|
|||||||
// 兼容后续渲染
|
// 兼容后续渲染
|
||||||
}));
|
}));
|
||||||
// 处理为表格结构
|
// 处理为表格结构
|
||||||
const table: Record<string, Record<string, any>> = { '上午': {}, '下午': {} };
|
const table: Record<string, Record<string, any>> = { 上午: {}, 下午: {} };
|
||||||
roomList.value.forEach(room => {
|
roomList.value.forEach((room) => {
|
||||||
['上午', '下午'].forEach(slot => {
|
['上午', '下午'].forEach((slot) => {
|
||||||
const booking = bookings.value.find(b => b.name === room.name && b.slots === slot);
|
const booking = bookings.value.find(
|
||||||
|
(b) => b.name === room.name && b.slots === slot,
|
||||||
|
);
|
||||||
table[slot][room.name] = booking || null;
|
table[slot][room.name] = booking || null;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
bookingTable.value = table;
|
bookingTable.value = table;
|
||||||
} else {
|
} else {
|
||||||
const res = await getAppointmentListBymeetId({
|
const res = await getAppointmentListBymeetId({
|
||||||
meetId: selectedRoom.value
|
meetId: selectedRoom.value,
|
||||||
});
|
});
|
||||||
bookings.value = (res || []).map((item: any) => ({
|
bookings.value = (res || []).map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@ -129,16 +134,19 @@ async function fetchBookings(): Promise<void> {
|
|||||||
bookingDate: item.scheduledStarttime,
|
bookingDate: item.scheduledStarttime,
|
||||||
tbConferenceId: item.meetId,
|
tbConferenceId: item.meetId,
|
||||||
}));
|
}));
|
||||||
const table: Record<string, Record<string, any>> = { '上午': {}, '下午': {} };
|
const table: Record<string, Record<string, any>> = { 上午: {}, 下午: {} };
|
||||||
weekDates.value.forEach(date => {
|
weekDates.value.forEach((date) => {
|
||||||
['上午', '下午'].forEach(slot => {
|
['上午', '下午'].forEach((slot) => {
|
||||||
const booking = bookings.value.find(b => dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === date && b.slots === slot);
|
const booking = bookings.value.find(
|
||||||
|
(b) =>
|
||||||
|
dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === date &&
|
||||||
|
b.slots === slot,
|
||||||
|
);
|
||||||
table[slot][date] = booking || null;
|
table[slot][date] = booking || null;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
bookingTable.value = table;
|
bookingTable.value = table;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取预约数据失败:', error);
|
console.error('获取预约数据失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
@ -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) {
|
function isMorning(startTime: string) {
|
||||||
const hour = dayjs(startTime).hour();
|
const hour = dayjs(startTime).hour();
|
||||||
return hour < 12;
|
return hour < 12;
|
||||||
}
|
}
|
||||||
if (viewMode.value === 'date') {
|
if (viewMode.value === 'date') {
|
||||||
const room = roomList.value.find(r => r.name === col);
|
const room = roomList.value.find((r) => r.name === col);
|
||||||
return bookings.value.find(b =>
|
return bookings.value.find(
|
||||||
|
(b) =>
|
||||||
b.tbConferenceId === room?.id &&
|
b.tbConferenceId === room?.id &&
|
||||||
((time === '上午' && isMorning(b.startTime)) || (time === '下午' && !isMorning(b.startTime)))
|
((time === '上午' && isMorning(b.startTime)) ||
|
||||||
|
(time === '下午' && !isMorning(b.startTime))),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return bookings.value.find(b =>
|
return bookings.value.find(
|
||||||
|
(b) =>
|
||||||
dayjs(b.bookingDate).format('YYYY-MM-DD') === col &&
|
dayjs(b.bookingDate).format('YYYY-MM-DD') === col &&
|
||||||
((time === '上午' && isMorning(b.startTime)) || (time === '下午' && !isMorning(b.startTime)))
|
((time === '上午' && isMorning(b.startTime)) ||
|
||||||
|
(time === '下午' && !isMorning(b.startTime))),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改渲染预约单元格的函数
|
// 修改渲染预约单元格的函数
|
||||||
function renderBookingCell(booking: ConferenceBooking) {
|
function renderBookingCell(booking: ConferenceBooking) {
|
||||||
return h('div',
|
return h(
|
||||||
|
'div',
|
||||||
{
|
{
|
||||||
class: 'booking-cell'
|
class: 'booking-cell',
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
h('span',
|
h('span', { class: 'booking-user' }, `预约人:${booking.bookingName}`),
|
||||||
{ class: 'booking-user' },
|
h('span', { class: 'booking-dept' }, `单位:${booking.deptName}`),
|
||||||
`预约人:${booking.bookingName}`
|
h('span', { class: 'booking-subject' }, `主题:${booking.subject}`),
|
||||||
),
|
],
|
||||||
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)`,
|
background: `rgba(${r},${g},${b},0.5)`,
|
||||||
borderRadius: '6px',
|
borderRadius: '6px',
|
||||||
padding: '60px 10px',
|
padding: '60px 10px',
|
||||||
transition: 'background 0.3s'
|
transition: 'background 0.3s',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,21 +254,24 @@ function getFullRoomList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns = computed<TableColumnType<TableRecord>[]>(() => {
|
const columns = computed<TableColumnType<TableRecord>[]>(() => {
|
||||||
const baseColumns: TableColumnType<TableRecord>[] = [{
|
const baseColumns: TableColumnType<TableRecord>[] = [
|
||||||
|
{
|
||||||
title: '时间',
|
title: '时间',
|
||||||
dataIndex: 'slot',
|
dataIndex: 'slot',
|
||||||
key: 'slot',
|
key: 'slot',
|
||||||
width: 100,
|
width: 100,
|
||||||
fixed: 'left' as const
|
fixed: 'left' as const,
|
||||||
}];
|
},
|
||||||
const dynamicColumns: TableColumnType<TableRecord>[] = viewMode.value === 'date'
|
];
|
||||||
? getFullRoomList().map(room => ({
|
const dynamicColumns: TableColumnType<TableRecord>[] =
|
||||||
|
viewMode.value === 'date'
|
||||||
|
? getFullRoomList().map((room) => ({
|
||||||
title: room.name || ' ',
|
title: room.name || ' ',
|
||||||
dataIndex: room.name,
|
dataIndex: room.name,
|
||||||
key: room.name,
|
key: room.name,
|
||||||
width: 200,
|
width: 200,
|
||||||
}))
|
}))
|
||||||
: weekDates.value.map(date => ({
|
: weekDates.value.map((date) => ({
|
||||||
title: dayjs(date).format('YYYY-MM-DD'),
|
title: dayjs(date).format('YYYY-MM-DD'),
|
||||||
dataIndex: date,
|
dataIndex: date,
|
||||||
key: date,
|
key: date,
|
||||||
@ -272,12 +282,13 @@ const columns = computed<TableColumnType<TableRecord>[]>(() => {
|
|||||||
|
|
||||||
const tableData = computed<TableRecord[]>(() => {
|
const tableData = computed<TableRecord[]>(() => {
|
||||||
const slots = ['上午', '下午'];
|
const slots = ['上午', '下午'];
|
||||||
return slots.map(slot => {
|
return slots.map((slot) => {
|
||||||
const row: any = { slot };
|
const row: any = { slot };
|
||||||
const cols = viewMode.value === 'date'
|
const cols =
|
||||||
? getFullRoomList().map(room => room.name)
|
viewMode.value === 'date'
|
||||||
|
? getFullRoomList().map((room) => room.name)
|
||||||
: weekDates.value;
|
: weekDates.value;
|
||||||
cols.forEach(col => {
|
cols.forEach((col) => {
|
||||||
row[col] = bookingTable.value[slot]?.[col] || null;
|
row[col] = bookingTable.value[slot]?.[col] || null;
|
||||||
});
|
});
|
||||||
return row;
|
return row;
|
||||||
@ -336,10 +347,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex !== 'slot'">
|
<template v-if="column.dataIndex !== 'slot'">
|
||||||
<div
|
<div v-if="record[column.dataIndex]" :style="getRandomBgColor()">
|
||||||
v-if="record[column.dataIndex]"
|
|
||||||
:style="getRandomBgColor()"
|
|
||||||
>
|
|
||||||
<div>预约人:{{ record[column.dataIndex].personName }}</div>
|
<div>预约人:{{ record[column.dataIndex].personName }}</div>
|
||||||
<div>单位:{{ record[column.dataIndex].unitName }}</div>
|
<div>单位:{{ record[column.dataIndex].unitName }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,9 +3,10 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
|||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'TreeSelect',
|
component: 'Input',
|
||||||
fieldName: 'unitName',
|
fieldName: 'unitName',
|
||||||
label: '单元名称',
|
label: '单元名称',
|
||||||
|
labelWidth: 100,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user