feat: replace tenants with organization management
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
Spin,
|
||||
Empty,
|
||||
Tooltip,
|
||||
} from 'antd';
|
||||
} from 'antd';
|
||||
import { CalendarOutlined, FileTextOutlined } from '@ant-design/icons';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import api from '../../api';
|
||||
@@ -24,7 +24,7 @@ interface ScheduleData {
|
||||
month: number;
|
||||
days: number;
|
||||
classrooms: any[];
|
||||
tenants: any[];
|
||||
organizations: any[];
|
||||
matrix: Record<number, Record<number, any>>;
|
||||
summary: Record<
|
||||
number,
|
||||
@@ -95,10 +95,7 @@ const ClassroomSchedulePage: React.FC = () => {
|
||||
|
||||
const handleDownloadContract = async (id: number, filename?: string) => {
|
||||
try {
|
||||
await downloadBlob(
|
||||
`/classroom-rentals/${id}/contract`,
|
||||
filename || `contract-${id}.pdf`,
|
||||
);
|
||||
await downloadBlob(`/classroom-rentals/${id}/contract`, filename || `contract-${id}.pdf`);
|
||||
} catch {
|
||||
// downloadBlob already shows an error via throw
|
||||
}
|
||||
@@ -175,7 +172,7 @@ const ClassroomSchedulePage: React.FC = () => {
|
||||
<Card size="small" style={{ marginBottom: 16 }} title="图例">
|
||||
<Space wrap>
|
||||
<Tag color="#52c41a">内部排课</Tag>
|
||||
{data.tenants.map((t) => (
|
||||
{data.organizations.map((t) => (
|
||||
<Tag
|
||||
key={t.id}
|
||||
color={t.color}
|
||||
@@ -184,7 +181,9 @@ const ClassroomSchedulePage: React.FC = () => {
|
||||
{t.name} (租赁)
|
||||
</Tag>
|
||||
))}
|
||||
<Tag color="#d9d9d9" style={{ color: '#999' }}>空闲</Tag>
|
||||
<Tag color="#d9d9d9" style={{ color: '#999' }}>
|
||||
空闲
|
||||
</Tag>
|
||||
</Space>
|
||||
</Card>
|
||||
)}
|
||||
@@ -310,7 +309,7 @@ const ClassroomSchedulePage: React.FC = () => {
|
||||
title={
|
||||
isInternal
|
||||
? `${cell.className} · ${cell.subject}\n${cell.teacherName} · ${cell.startTime}-${cell.endTime}`
|
||||
: `${cell.tenantName}${cell.hasContract ? ' · 有合同' : ''}`
|
||||
: `${cell.organizationName}${cell.hasContract ? ' · 有合同' : ''}`
|
||||
}
|
||||
>
|
||||
<span style={{ color: '#fff', fontSize: 10, fontWeight: 600 }}>
|
||||
@@ -347,21 +346,22 @@ const ClassroomSchedulePage: React.FC = () => {
|
||||
{detailModal.classroom?.roomType})
|
||||
</div>
|
||||
<div>
|
||||
<strong>租赁方:</strong>
|
||||
<strong>承租机构:</strong>
|
||||
<Tag
|
||||
color={detailModal.tenant?.color}
|
||||
color={detailModal.lesseeOrganization?.color}
|
||||
style={{
|
||||
background: detailModal.tenant?.color,
|
||||
background: detailModal.lesseeOrganization?.color,
|
||||
color: '#fff',
|
||||
borderColor: detailModal.tenant?.color,
|
||||
borderColor: detailModal.lesseeOrganization?.color,
|
||||
}}
|
||||
>
|
||||
{detailModal.tenant?.name}
|
||||
{detailModal.lesseeOrganization?.name}
|
||||
</Tag>
|
||||
</div>
|
||||
<div>
|
||||
<strong>联系人:</strong>
|
||||
{detailModal.tenant?.contact || '-'} {detailModal.tenant?.phone || ''}
|
||||
{detailModal.lesseeOrganization?.contactName || '-'}{' '}
|
||||
{detailModal.lesseeOrganization?.phone || ''}
|
||||
</div>
|
||||
<div>
|
||||
<strong>起止日期:</strong>
|
||||
|
||||
Reference in New Issue
Block a user