缴费审核

This commit is contained in:
FLL
2025-09-04 16:12:11 +08:00
parent 6dc4727b15
commit b0d48d0425
9 changed files with 347 additions and 292 deletions

View File

@@ -1,8 +1,6 @@
import type { ParticipantsVO, ParticipantsForm, ParticipantsQuery } from './model'; import type { ParticipantsVO, ParticipantsForm, ParticipantsQuery } 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';
import { commonExport } from '#/api/helper'; import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request'; import { requestClient } from '#/api/request';

View File

@@ -112,6 +112,12 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'nfcCode', fieldName: 'nfcCode',
component: 'Input', component: 'Input',
}, },
{
label: '巡检位置',
fieldName: 'inspectionLocation',
component: 'Input',
rules: 'required',
},
{ {
label: '备注', label: '备注',
fieldName: 'remark', fieldName: 'remark',

View File

@@ -0,0 +1,122 @@
<script setup lang="ts">
import type { PropType } from 'vue';
import type { DeptTree } from '#/api/system/user/model';
import { onMounted, ref } from 'vue';
import { SyncOutlined } from '@ant-design/icons-vue';
import { Empty, InputSearch, Skeleton, Tree } from 'ant-design-vue';
import { getDeptTree } from '#/api/system/user';
defineOptions({ inheritAttrs: false });
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true });
const emit = defineEmits<{
/**
* 点击刷新按钮的事件
*/
reload: [];
/**
* 点击节点的事件
*/
select: [];
}>();
const selectDeptId = defineModel('selectDeptId', {
required: true,
type: Array as PropType<string[]>,
});
const searchValue = defineModel('searchValue', {
type: String,
default: '',
});
/** 部门数据源 */
type DeptTreeArray = DeptTree[];
const deptTreeArray = ref<DeptTreeArray>([]);
/** 骨架屏加载 */
const showTreeSkeleton = ref<boolean>(true);
async function loadTree() {
showTreeSkeleton.value = true;
searchValue.value = '';
selectDeptId.value = [];
const ret = await getDeptTree();
deptTreeArray.value = ret;
showTreeSkeleton.value = false;
}
async function handleReload() {
await loadTree();
emit('reload');
}
onMounted(loadTree);
</script>
<template>
<div :class="$attrs.class">
<Skeleton
:loading="showTreeSkeleton"
:paragraph="{ rows: 8 }"
active
class="p-[8px]"
>
<div
class="bg-background flex h-full flex-col overflow-y-auto rounded-lg"
>
<!-- 固定在顶部 必须加上bg-background背景色 否则会产生'穿透'效果 -->
<div
v-if="showSearch"
class="bg-background z-100 sticky left-0 top-0 p-[8px]"
>
<InputSearch
v-model:value="searchValue"
:placeholder="$t('pages.common.search')"
size="small"
>
<template #enterButton>
<a-button @click="handleReload">
<SyncOutlined class="text-primary" />
</a-button>
</template>
</InputSearch>
</div>
<div class="h-full overflow-x-hidden px-[8px]">
<Tree
v-bind="$attrs"
v-if="deptTreeArray.length > 0"
v-model:selected-keys="selectDeptId"
:class="$attrs.class"
:field-names="{ title: 'label', key: 'id' }"
:show-line="{ showLeafIcon: false }"
:tree-data="deptTreeArray"
:virtual="false"
default-expand-all
@select="$emit('select')"
>
<template #title="{ label }">
<span v-if="label.indexOf(searchValue) > -1">
{{ label.substring(0, label.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{
label.substring(
label.indexOf(searchValue) + searchValue.length,
)
}}
</span>
<span v-else>{{ label }}</span>
</template>
</Tree>
<!-- 仅本人数据权限 可以考虑直接不显示 -->
<div v-else class="mt-5">
<Empty
:image="Empty.PRESENTED_IMAGE_SIMPLE"
description="无部门数据"
/>
</div>
</div>
</div>
</Skeleton>
</div>
</template>

View File

@@ -1,18 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs'; import FloorTree from "./floor-tree.vue"
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
@@ -125,58 +120,65 @@ function handleDownloadExcel() {
</script> </script>
<template> <template>
<Page :auto-content-height="true"> <div style="display: grid;grid-template-columns: 1fr 5fr;">
<BasicTable table-title="房间信息列表"> <div style="padding: 15px 0 15px 15px;background-color: red">
<template #toolbar-tools> <FloorTree></FloorTree>
<Space> </div>
<a-button <div>
v-access:code="['property:room:export']" <Page :auto-content-height="true">
@click="handleDownloadExcel" <BasicTable table-title="房间信息列表">
> <template #toolbar-tools>
{{ $t('pages.common.export') }} <Space>
</a-button> <a-button
<a-button v-access:code="['property:room:export']"
:disabled="!vxeCheckboxChecked(tableApi)" @click="handleDownloadExcel"
danger >
type="primary" {{ $t('pages.common.export') }}
v-access:code="['property:room:remove']" </a-button>
@click="handleMultiDelete"> <a-button
{{ $t('pages.common.delete') }} :disabled="!vxeCheckboxChecked(tableApi)"
</a-button> danger
<a-button type="primary"
type="primary" v-access:code="['property:room:remove']"
v-access:code="['property:room:add']" @click="handleMultiDelete">
@click="handleAdd" {{ $t('pages.common.delete') }}
> </a-button>
{{ $t('pages.common.add') }} <a-button
</a-button> type="primary"
</Space> v-access:code="['property:room:add']"
</template> @click="handleAdd"
<template #action="{ row }"> >
<Space> {{ $t('pages.common.add') }}
<ghost-button </a-button>
v-access:code="['property:room:edit']" </Space>
@click.stop="handleEdit(row)" </template>
> <template #action="{ row }">
{{ $t('pages.common.edit') }} <Space>
</ghost-button> <ghost-button
<Popconfirm v-access:code="['property:room:edit']"
:get-popup-container="getVxePopupContainer" @click.stop="handleEdit(row)"
placement="left" >
title="确认删除?" {{ $t('pages.common.edit') }}
@confirm="handleDelete(row)" </ghost-button>
> <Popconfirm
<ghost-button :get-popup-container="getVxePopupContainer"
danger placement="left"
v-access:code="['property:room:remove']" title="确认删除?"
@click.stop="" @confirm="handleDelete(row)"
> >
{{ $t('pages.common.delete') }} <ghost-button
</ghost-button> danger
</Popconfirm> v-access:code="['property:room:remove']"
</Space> @click.stop=""
</template> >
</BasicTable> {{ $t('pages.common.delete') }}
<RoomModal @reload="tableApi.query()" /> </ghost-button>
</Page> </Popconfirm>
</Space>
</template>
</BasicTable>
<RoomModal @reload="tableApi.query()" />
</Page>
</div>
</div>
</template> </template>

View File

@@ -1,35 +1,82 @@
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 { personList } from '#/api/property/resident/person';
import {participantsList} from '#/api/property/roomBooking/participants';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
component: 'Input', label: '会议室名称',
fieldName: 'meetId', fieldName: 'meetBookId',
label: '会议室id', component: 'ApiSelect',
componentProps: {
api: async () => {
const rows = await participantsList({ pageSize: 1000000000, pageNum: 1 });
return rows;
},
resultField: 'rows',
labelField: 'meetBookingVo.name',
valueField: 'meetBookId',
},
}, },
{ {
component: 'Input', label: '发起人',
fieldName: 'residentPersonId', fieldName: 'residentPersonId',
label: '入驻人员id', component: 'ApiSelect',
componentProps: {
api: async () => {
const rows = await personList({ pageSize: 1000000000, pageNum: 1 });
return rows;
},
resultField: 'rows',
labelField: 'userName',
valueField: 'id',
},
}, },
]; ];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{ {
title: '主键id', title: '会议室名称',
field: 'id', field: 'meetBookingVo.name',
}, },
{ {
title: '会议室id', title: '会议主题',
field: 'meetId', field: 'meetBookingVo.meetTheme',
}, },
{ {
title: '入驻人员id', title: '会议时间',
field: 'residentPersonId', field: 'meetBookingVo.meetingTime',
slots: {
default: ({row}) => {
return row.meetBookingVo.scheduledStarttime+'~'+row.meetBookingVo.scheduledEndtime;
},
},
width:300
},
{
title: '发起人',
field: 'meetBookingVo.personName',
},
{
title: '发起单位',
field: 'meetBookingVo.unitName',
},
{
title: '会议室地点',
field: 'meetBookingVo.meetLocation',
},
{
title: '签到状态',
field: 'signState',
slots: {
default: ({row}) => {
return row.signState === '0' ? '未签到' : '已签到';
},
},
},
{
title: '签到时间',
field: 'signTime',
}, },
{ {
field: 'action', field: 'action',
@@ -39,27 +86,3 @@ export const columns: VxeGridProps['columns'] = [
width: 180, width: 180,
}, },
]; ];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '会议室id',
fieldName: 'meetId',
component: 'Input',
rules: 'required',
},
{
label: '入驻人员id',
fieldName: 'residentPersonId',
component: 'Input',
rules: 'required',
},
];

View File

@@ -1,25 +1,17 @@
<script setup lang="ts"> <script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { Space } from 'ant-design-vue';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
participantsExport, participantsExport,
participantsList, participantsList,
participantsRemove,
} from '#/api/property/roomBooking/participants'; } from '#/api/property/roomBooking/participants';
import type { ParticipantsForm } from '#/api/property/roomBooking/participants/model'; import type { ParticipantsForm } from '#/api/property/roomBooking/participants/model';
import { commonDownloadExcel } from '#/utils/file/download'; import { commonDownloadExcel } from '#/utils/file/download';
import participantsDetail from './participants-detail.vue';
import participantsModal from './participants-modal.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
@@ -31,28 +23,13 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
}; };
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
// 高亮
highlight: true, highlight: true,
// 翻页时保留选中状态
reserve: true, reserve: true,
// 点击行选中
// trigger: 'row',
}, },
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns, columns,
height: 'auto', height: 'auto',
keepSource: true, keepSource: true,
@@ -80,37 +57,13 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
gridOptions, gridOptions,
}); });
const [ParticipantsModal, modalApi] = useVbenModal({ const [ParticipantsDetail, participantsDetailApi] = useVbenModal({
connectedComponent: participantsModal, connectedComponent: participantsDetail,
}); });
function handleAdd() { async function handleInfo(row: Required<ParticipantsForm>) {
modalApi.setData({}); participantsDetailApi.setData({ id: row.id });
modalApi.open(); participantsDetailApi.open();
}
async function handleEdit(row: Required<ParticipantsForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<ParticipantsForm>) {
await participantsRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<ParticipantsForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await participantsRemove(ids);
await tableApi.query();
},
});
} }
function handleDownloadExcel() { function handleDownloadExcel() {
@@ -131,48 +84,18 @@ function handleDownloadExcel() {
> >
{{ $t('pages.common.export') }} {{ $t('pages.common.export') }}
</a-button> </a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:participants:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:participants:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space> </Space>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:participants:edit']" @click.stop="handleInfo(row)"
@click.stop="handleEdit(row)"
> >
{{ $t('pages.common.edit') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:participants:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space> </Space>
</template> </template>
</BasicTable> </BasicTable>
<ParticipantsModal @reload="tableApi.query()" /> <ParticipantsDetail/>
</Page> </Page>
</template> </template>

View File

@@ -0,0 +1,82 @@
<script setup lang="ts">
import type {ParticipantsVO} from '#/api/property/roomBooking/participants/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {participantsInfo} from '#/api/property/roomBooking/participants';
import {ossInfo} from "#/api/system/oss";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
ParticipantsDetail.value = null;
},
});
const ParticipantsDetail = shallowRef<null | ParticipantsVO>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
ParticipantsDetail.value = await participantsInfo(id);
try {
if (ParticipantsDetail.value.residentPersonVo.img) {
const res = await ossInfo([ParticipantsDetail.value.residentPersonVo.img]);
ParticipantsDetail.value.residentPersonVo.img = res?.[0]?.url
}
} catch (e) {}
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="会议室详情" class="w-[70%]">
<Descriptions v-if="ParticipantsDetail" size="small" :column="2" bordered
:labelStyle="{width:'120px'}">
<DescriptionsItem label="会议室名称">
{{ ParticipantsDetail.meetBookingVo.name }}
</DescriptionsItem>
<DescriptionsItem label="会议主题">
{{ ParticipantsDetail.meetBookingVo.meetTheme }}
</DescriptionsItem>
<DescriptionsItem label="会议时间">
{{ ParticipantsDetail.meetBookingVo.scheduledStarttime }}
</DescriptionsItem>
<DescriptionsItem label="发起人">
{{ ParticipantsDetail.meetBookingVo.personName }}
</DescriptionsItem>
<DescriptionsItem label="发起单位">
{{ ParticipantsDetail.meetBookingVo.unitName }}
</DescriptionsItem>
<DescriptionsItem label="会议室地点">
{{ ParticipantsDetail.meetBookingVo.meetLocation }}
</DescriptionsItem>
<DescriptionsItem label="参会姓名">
{{ ParticipantsDetail.residentPersonVo.userName }}
</DescriptionsItem>
<DescriptionsItem label="证件号">
{{ ParticipantsDetail.residentPersonVo.idCard }}
</DescriptionsItem>
<DescriptionsItem label="所属公司">
{{ ParticipantsDetail.residentPersonVo.unitName }}
</DescriptionsItem>
<DescriptionsItem label="联系电话">
{{ ParticipantsDetail.residentPersonVo.phone }}
</DescriptionsItem>
<DescriptionsItem label="人脸图片" v-if="ParticipantsDetail.residentPersonVo.img" :span="2">
<img :src="ParticipantsDetail.residentPersonVo.img" alt="图片加载失败" class="w-[100px] h-[100px]"/>
</DescriptionsItem>
<DescriptionsItem label="签到状态">
{{ ParticipantsDetail.signState === '0' ? '未签到' : '已签到'}}
</DescriptionsItem>
<DescriptionsItem label="签到时间">
{{ ParticipantsDetail.signTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -1,101 +0,0 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { participantsAdd, participantsInfo, participantsUpdate } from '#/api/property/roomBooking/participants';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await participantsInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? participantsUpdate(data) : participantsAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -27,7 +27,7 @@ export default defineConfig(async () => {
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
// mock代理目标地址 // mock代理目标地址
target: 'http://183.230.235.66:11010/api/', target: 'http://192.168.1.110:8080',
ws: true, ws: true,
}, },
}, },