From 595567438279ac5967935bde6f13a32ff4133be9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 28 Apr 2026 17:33:06 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0=E5=90=88?= =?UTF-8?q?=E5=90=8C=E5=80=9F=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/approval/my_processed/index.tsx | 2 +- .../contract_borrows/borrows/index.tsx | 162 +++++++++++++++ .../{ => borrows}/modals/Create.tsx | 0 .../{ => borrows}/modals/Show.tsx | 0 .../{ => borrows}/modals/Update.tsx | 0 src/pages/contract/contract_borrows/index.tsx | 188 +++--------------- .../contract_borrows/read/modals/Show.tsx | 36 ++-- src/pages/contract/contracts/index.tsx | 8 +- src/pages/customer/list/index.tsx | 2 +- 9 files changed, 216 insertions(+), 182 deletions(-) create mode 100644 src/pages/contract/contract_borrows/borrows/index.tsx rename src/pages/contract/contract_borrows/{ => borrows}/modals/Create.tsx (100%) rename src/pages/contract/contract_borrows/{ => borrows}/modals/Show.tsx (100%) rename src/pages/contract/contract_borrows/{ => borrows}/modals/Update.tsx (100%) diff --git a/src/pages/approval/my_processed/index.tsx b/src/pages/approval/my_processed/index.tsx index e10fb98..67cc852 100644 --- a/src/pages/approval/my_processed/index.tsx +++ b/src/pages/approval/my_processed/index.tsx @@ -7,7 +7,7 @@ import { import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import Show from './modals/Show'; -export default function Index({ title = '我的发起' }) { +export default function Index({ title = '我的已办' }) { return ( + MyProTableProps.request( + params, + sort, + Apis.Contract.ContractArchiveBorrows.List, + ) + } + headerTitle="合同借用列表" + toolBarRender={(action) => [ + , + read: , + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + MyColumns.EnumTag({ + title: '借用状态', + dataIndex: 'borrow_status', + valueEnum: ContractArchiveBorrowStatusEnum, + }), + // MyColumns.EnumTag({ + // title: '归还状态', + // dataIndex: 'return_status', + // valueEnum: ContractArchiveFileReturnStatusEnum, + // }), + { + title: '档案编号', + dataIndex: ['contract_archive', 'code'], + render: (_, item: any) => ( + + ), + }, + { + title: '借用信息', + search: false, + render: (_, item: any) => { + if (!item?.contract_archive_borrow_files) { + return '-'; + } + return ( +
+ {item.contract_archive_borrow_files.map( + (res: any, index: number) => ( +
+ 文件: {res?.contract_archive_file?.name},借用: + {res?.contract_archive_file?.borrow_number},遗失: + {res?.contract_archive_file?.lost_number},损坏: + { + res?.contract_archive_file?.contract_archive_file + ?.lost_number + } + ,损坏: {res?.contract_archive_file?.damaged_number} +
+ ), + )} +
+ ); + }, + }, + { + title: '借用人', + dataIndex: 'borrower_name', + search: false, + render: (_, item: any) => ( + + ), + }, + + { + title: '借用日期', + dataIndex: 'borrow_date', + search: false, + }, + { + title: '应归还日期', + dataIndex: 'expected_return_date', + search: false, + }, + MyColumns.Boolean({ + title: '需要归还', + dataIndex: 'is_need_return', + search: false, + }), + { + title: '登记人', + dataIndex: ['registrar', 'name'], + search: false, + render: (_, item: any) => ( + + ), + }, + // MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), + MyColumns.Option({ + width: 100, + render: (_, item: any, _index, action) => ( + + ), + record: ( + + Apis.Contract.ContractArchiveBorrows.Borrow({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + update: ( + + ), + }} + /> + ), + }), + ]} + /> + ); +} diff --git a/src/pages/contract/contract_borrows/modals/Create.tsx b/src/pages/contract/contract_borrows/borrows/modals/Create.tsx similarity index 100% rename from src/pages/contract/contract_borrows/modals/Create.tsx rename to src/pages/contract/contract_borrows/borrows/modals/Create.tsx diff --git a/src/pages/contract/contract_borrows/modals/Show.tsx b/src/pages/contract/contract_borrows/borrows/modals/Show.tsx similarity index 100% rename from src/pages/contract/contract_borrows/modals/Show.tsx rename to src/pages/contract/contract_borrows/borrows/modals/Show.tsx diff --git a/src/pages/contract/contract_borrows/modals/Update.tsx b/src/pages/contract/contract_borrows/borrows/modals/Update.tsx similarity index 100% rename from src/pages/contract/contract_borrows/modals/Update.tsx rename to src/pages/contract/contract_borrows/borrows/modals/Update.tsx diff --git a/src/pages/contract/contract_borrows/index.tsx b/src/pages/contract/contract_borrows/index.tsx index 6d5c6a3..220fb7c 100644 --- a/src/pages/contract/contract_borrows/index.tsx +++ b/src/pages/contract/contract_borrows/index.tsx @@ -1,22 +1,23 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, - MyTableActions, - MyToolBarActions, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ContractArchiveBorrowStatusEnum } from '@/gen/Enums'; -import EmployeeShow from '@/pages/company/employees/modals/EmployeeShow'; -import CodeInfo from '@/pages/contract/contract_archives/modals/Show'; -import { ProTable } from '@ant-design/pro-components'; -import Create from './modals/Create'; -import Show from './modals/Show'; -import Update from './modals/Update'; -import Read from './read/modals/Read'; - +import { MyPageContainer } from '@/common'; +import { Tabs } from 'antd'; +import { useState } from 'react'; +import Borrows from './borrows'; +import Read from './read'; export default function Index({ title = '合同档案借用' }) { + const [activeKey, setActiveKey] = useState('Borrows'); + const items = [ + { + key: 'Borrows', + label: '合同借用', + children: , + }, + { + key: 'Read', + label: '合同借阅', + children: , + }, + ]; + return ( - - MyProTableProps.request( - params, - sort, - Apis.Contract.ContractArchiveBorrows.List, - ) - } - headerTitle="合同借用列表" - toolBarRender={(action) => [ - - ), - read: ( - - ), - }} - />, - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - MyColumns.EnumTag({ - title: '借用状态', - dataIndex: 'borrow_status', - valueEnum: ContractArchiveBorrowStatusEnum, - }), - // MyColumns.EnumTag({ - // title: '归还状态', - // dataIndex: 'return_status', - // valueEnum: ContractArchiveFileReturnStatusEnum, - // }), - { - title: '档案编号', - dataIndex: ['contract_archive', 'code'], - render: (_, item: any) => ( - - ), - }, - { - title: '借用信息', - search: false, - render: (_, item: any) => { - if (!item?.contract_archive_borrow_files) { - return '-'; - } - return ( -
- {item.contract_archive_borrow_files.map( - (res: any, index: number) => ( -
- 文件: {res?.contract_archive_file?.name},借用: - {res?.contract_archive_file?.borrow_number},遗失: - {res?.contract_archive_file?.lost_number},损坏: - { - res?.contract_archive_file?.contract_archive_file - ?.lost_number - } - ,损坏: {res?.contract_archive_file?.damaged_number} -
- ), - )} -
- ); - }, - }, - { - title: '借用人', - dataIndex: 'borrower_name', - search: false, - render: (_, item: any) => ( - - ), - }, - - { - title: '借用日期', - dataIndex: 'borrow_date', - search: false, - }, - { - title: '应归还日期', - dataIndex: 'expected_return_date', - search: false, - }, - MyColumns.Boolean({ - title: '需要归还', - dataIndex: 'is_need_return', - search: false, - }), - { - title: '登记人', - dataIndex: ['registrar', 'name'], - search: false, - render: (_, item: any) => ( - - ), - }, - // MyColumns.CreatedAt(), - MyColumns.UpdatedAt(), - MyColumns.Option({ - width: 100, - render: (_, item: any, _index, action) => ( - - ), - record: ( - - Apis.Contract.ContractArchiveBorrows.Borrow({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - update: ( - - ), - }} - /> - ), - }), - ]} + { + setActiveKey(key); + }} />
); diff --git a/src/pages/contract/contract_borrows/read/modals/Show.tsx b/src/pages/contract/contract_borrows/read/modals/Show.tsx index d5affb4..0de94d5 100644 --- a/src/pages/contract/contract_borrows/read/modals/Show.tsx +++ b/src/pages/contract/contract_borrows/read/modals/Show.tsx @@ -49,25 +49,31 @@ export default function Show(props: MyBetaModalFormProps) { {data?.read_reason} - {!data?.read_files || data.read_files.length === 0 ? ( + {!data?.contract_archive_read_files || + data.contract_archive_read_files.length === 0 ? ( '-' ) : (
- {data.read_files.map((file: any, index: number) => ( -
-
- 文件 {index + 1}: {file?.file?.name} + {data.contract_archive_read_files.map( + (file: any, index: number) => ( +
+
+ 文件 {index + 1}: + {file?.contract_archive_file?.name} +
-
- ))} + ), + )}
)} diff --git a/src/pages/contract/contracts/index.tsx b/src/pages/contract/contracts/index.tsx index 344d786..e04708c 100644 --- a/src/pages/contract/contracts/index.tsx +++ b/src/pages/contract/contracts/index.tsx @@ -154,9 +154,11 @@ export default function Index({ title = '合同拟制' }) { title: '有效期', search: false, render: (_, item: any) => { - return `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( - item.end_time, - ).format('YYYY-MM-DD')}`; + return item.start_time + ? `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( + item.end_time, + ).format('YYYY-MM-DD')}` + : '-'; }, }, { diff --git a/src/pages/customer/list/index.tsx b/src/pages/customer/list/index.tsx index fb62207..3c37534 100644 --- a/src/pages/customer/list/index.tsx +++ b/src/pages/customer/list/index.tsx @@ -110,7 +110,7 @@ export default function Index({ title = '客户列表' }) { }, MyColumns.EnumTag({ title: '关联身份', - dataIndex: 'relation_with_owner', + dataIndex: 'residential_relation', valueEnum: HouseOccupantsResidentialRelationEnum, search: false, }), -- 2.47.2