diff --git a/config/routes.ts b/config/routes.ts index e2b1ecd..6d77756 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -259,6 +259,17 @@ export default [ name: 'company', path: '/company', routes: [ + { + name: '企业列表', + path: '/company/list', + component: './Company/List', + }, + { + name: '未参加招聘会详情', + path: '/company/list/missed-outdoor-fairs', + component: './Company/List/MissedOutdoorFairs', + hideInMenu: true, + }, { name: '企业信息', path: '/company/info/index', diff --git a/src/pages/Company/List/MissedOutdoorFairs/index.tsx b/src/pages/Company/List/MissedOutdoorFairs/index.tsx new file mode 100644 index 0000000..dd561c8 --- /dev/null +++ b/src/pages/Company/List/MissedOutdoorFairs/index.tsx @@ -0,0 +1,58 @@ +import React from 'react'; +import { history, useSearchParams } from '@umijs/max'; +import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; +import { Button, message } from 'antd'; +import { ArrowLeftOutlined } from '@ant-design/icons'; +import { getCmsCompanyMissedOutdoorFairs } from '@/services/company/list'; + +const MissedOutdoorFairs: React.FC = () => { + const [searchParams] = useSearchParams(); + const companyId = Number(searchParams.get('companyId')); + + const columns: ProColumns[] = [ + { title: '招聘会名称', dataIndex: 'title', ellipsis: true }, + { title: '举办单位', dataIndex: 'hostUnit', ellipsis: true }, + { title: '举办地址', dataIndex: 'address', ellipsis: true }, + { title: '举办开始时间', dataIndex: 'holdTime', valueType: 'dateTime', width: 180 }, + { title: '举办结束时间', dataIndex: 'endTime', valueType: 'dateTime', width: 180 }, + { title: '报名时间', dataIndex: 'registrationTime', valueType: 'dateTime', width: 180 }, + ]; + + return ( + } onClick={() => history.back()}> + 返回企业列表 + , + ], + }} + > + + rowKey="fairId" + columns={columns} + search={false} + options={false} + pagination={{ pageSize: 10 }} + request={async (params) => { + if (!companyId) { + message.error('缺少企业ID'); + return { data: [], total: 0, success: false }; + } + const res = await getCmsCompanyMissedOutdoorFairs(companyId, { + current: params.current, + pageSize: params.pageSize, + }); + return { + data: res.rows || [], + total: res.total || 0, + success: res.code === 200, + }; + }} + /> + + ); +}; + +export default MissedOutdoorFairs; diff --git a/src/pages/Company/List/index.tsx b/src/pages/Company/List/index.tsx index 40ee021..8896fa2 100644 --- a/src/pages/Company/List/index.tsx +++ b/src/pages/Company/List/index.tsx @@ -1,5 +1,5 @@ import React, { Fragment, useEffect, useRef, useState } from 'react'; -import { FormattedMessage, useAccess } from '@umijs/max'; +import { FormattedMessage, history, useAccess } from '@umijs/max'; import { Button, FormInstance, message, Modal, Tag } from 'antd'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { DeleteOutlined, FormOutlined, PlusOutlined, AlignLeftOutlined, AuditOutlined } from '@ant-design/icons'; @@ -196,6 +196,34 @@ function ManagementList() { return 待审核; }, }, + { + title: '招聘会参会情况', + dataIndex: 'missedOutdoorFairOnly', + valueType: 'select', + hideInTable: true, + valueEnum: { + true: { text: '有未参加招聘会记录' }, + }, + }, + { + title: '未参加招聘会详情', + dataIndex: 'missedOutdoorFairCount', + hideInSearch: true, + align: 'center', + render: (_, record) => { + const count = record.missedOutdoorFairCount || 0; + if (!count) return '0'; + return ( + + ); + }, + }, { title: '驳回原因', dataIndex: 'notPassReason', diff --git a/src/pages/Jobfair/Outdoorfair/Detail/components/CompanyAttendanceTab.tsx b/src/pages/Jobfair/Outdoorfair/Detail/components/CompanyAttendanceTab.tsx new file mode 100644 index 0000000..c733f02 --- /dev/null +++ b/src/pages/Jobfair/Outdoorfair/Detail/components/CompanyAttendanceTab.tsx @@ -0,0 +1,85 @@ +import React from 'react'; +import { Card, Col, Row, Tag } from 'antd'; +import { ProColumns, ProTable } from '@ant-design/pro-components'; +import { + getOutdoorFairCompanyAttendanceList, +} from '@/services/jobportal/outdoorFairDetail'; +import type { OutdoorFairCompanyAttendanceItem } from '@/services/jobportal/outdoorFairDetail'; + +interface Props { + fairId: number; +} + +const columns: ProColumns[] = [ + { title: '企业名称', dataIndex: 'companyName', ellipsis: true }, + { + title: '行业', + dataIndex: 'industry', + hideInSearch: true, + render: (_, record) => record.industry || '--', + }, + { + title: '联系人', + dataIndex: 'contactPerson', + hideInSearch: true, + render: (_, record) => record.contactPerson || '--', + }, + { + title: '签到时间', + dataIndex: 'checkInTime', + valueType: 'dateTime', + hideInSearch: true, + render: (_, record) => record.checkInTime || '--', + }, +]; + +const CompanyAttendanceList: React.FC<{ fairId: number; checkedIn: boolean }> = ({ + fairId, + checkedIn, +}) => ( + + rowKey="id" + columns={columns} + search={{ labelWidth: 'auto' }} + options={false} + pagination={{ pageSize: 8 }} + request={async (params) => { + const res = await getOutdoorFairCompanyAttendanceList(fairId, { + current: params.current, + pageSize: params.pageSize, + companyName: params.companyName, + checkedIn, + }); + return { + data: res.rows || [], + total: res.total || 0, + success: res.code === 200, + }; + }} + /> +); + +const CompanyAttendanceTab: React.FC = ({ fairId }) => ( + + + 已签到} + bodyStyle={{ padding: 0 }} + > + + + + + 未签到} + bodyStyle={{ padding: 0 }} + > + + + + +); + +export default CompanyAttendanceTab; diff --git a/src/pages/Jobfair/Outdoorfair/Detail/index.tsx b/src/pages/Jobfair/Outdoorfair/Detail/index.tsx index 80fb7c7..cffb95c 100644 --- a/src/pages/Jobfair/Outdoorfair/Detail/index.tsx +++ b/src/pages/Jobfair/Outdoorfair/Detail/index.tsx @@ -11,6 +11,7 @@ import ParticipatingCompaniesTab from './components/ParticipatingCompaniesTab'; import ParticipatingJobsTab from './components/ParticipatingJobsTab'; import CompanyUnsubscribeTab from './components/CompanyUnsubscribeTab'; import AttendeeTab from './components/AttendeeTab'; +import CompanyAttendanceTab from './components/CompanyAttendanceTab'; import DeviceTab from './components/DeviceTab'; const OutdoorFairDetail: React.FC = () => { @@ -43,6 +44,7 @@ const OutdoorFairDetail: React.FC = () => { const tabItems = [ { key: 'fair-info', label: '招聘会管理' }, { key: 'participating-companies', label: '参会企业' }, + { key: 'company-attendance', label: '企业签到' }, { key: 'company-unsubscribe', label: '企业退订' }, { key: 'participating-jobs', label: '参会岗位' }, { key: 'attendee', label: '参会人员管理' }, @@ -88,6 +90,8 @@ const OutdoorFairDetail: React.FC = () => { return ; case 'participating-companies': return ; + case 'company-attendance': + return ; case 'company-unsubscribe': return ; case 'participating-jobs': diff --git a/src/pages/Jobfair/Outdoorfair/index.tsx b/src/pages/Jobfair/Outdoorfair/index.tsx index 7159629..5c43c93 100644 --- a/src/pages/Jobfair/Outdoorfair/index.tsx +++ b/src/pages/Jobfair/Outdoorfair/index.tsx @@ -10,6 +10,7 @@ import { QrcodeOutlined, UnorderedListOutlined, ExportOutlined, + CheckOutlined, } from '@ant-design/icons'; import { getOutdoorFairList, @@ -20,6 +21,7 @@ import { signupOutdoorFair, unsubscribeOutdoorFair, getMyOutdoorFairQrCode, + checkInOutdoorFair, getOutdoorFairMiniProgramQrCode, exportOutdoorFair, } from '@/services/jobportal/outdoorFair'; @@ -193,6 +195,16 @@ const OutdoorFairList: React.FC = () => { } }; + const handleCheckIn = async (record: OutdoorFairItem) => { + const res = await checkInOutdoorFair(record.id); + if (res.code === 200) { + message.success('签到成功'); + actionRef.current?.reload(); + } else { + message.error(res.msg || '签到失败'); + } + }; + const openQrCode = async (record: OutdoorFairItem) => { const res = await getMyOutdoorFairQrCode(record.id); if (res.code === 200) { @@ -451,7 +463,7 @@ const OutdoorFairList: React.FC = () => { { title: '操作', valueType: 'option', - width: isEnterprise ? 520 : 260, + width: isEnterprise ? 620 : 260, fixed: 'right', render: (_, record) => [ isEnterprise && !record.signedUp ? ( @@ -475,6 +487,29 @@ const OutdoorFairList: React.FC = () => { 添加岗位 ) : null, + isEnterprise && + record.signedUp && + record.reviewStatus === '1' && + record.companyCheckInStatus === 'checked_in' ? ( + + ) : null, + isEnterprise && + record.signedUp && + record.reviewStatus === '1' && + record.companyCheckInStatus !== 'checked_in' && + record.companyCheckInAllowed ? ( + + ) : null, isEnterprise && record.signedUp && record.reviewStatus === '1' ? (