fix:修复:文件归还的弹窗异常 #19

Merged
zsq merged 1 commits from develop into main 2026-04-28 11:20:26 +08:00
2 changed files with 43 additions and 35 deletions
Showing only changes of commit 544abaa4ea - Show all commits

View File

@ -63,25 +63,30 @@ export default function Show(props: MyBetaModalFormProps) {
{data?.borrow_reason}
</ProDescriptions.Item>
<ProDescriptions.Item label="借阅文件" span={2}>
{!data?.borrow_files || data.borrow_files.length === 0 ? (
{!data?.contract_archive_borrow_files ||
!data.contract_archive_borrow_files.length ? (
'-'
) : (
<div>
{data.borrow_files.map((file: any, index: number) => (
<div
key={index}
style={{
marginBottom: 8,
padding: 8,
border: '1px solid #f0f0f0',
borderRadius: 4,
}}
>
<div style={{ fontWeight: 'bold', marginBottom: 4 }}>
{index + 1}: {file?.file?.name}
</div>
<div>: {file?.borrow_number}</div>
{/* {file?.return_status && (
{data.contract_archive_borrow_files.map(
(file: any, index: number) => (
<div
key={index}
style={{
marginBottom: 8,
padding: 8,
border: '1px solid #f0f0f0',
borderRadius: 4,
}}
>
<div
style={{ fontWeight: 'bold', marginBottom: 4 }}
>
{index + 1}:
{file?.contract_archive_file?.name}
</div>
<div>: {file?.borrow_number}</div>
{/* {file?.return_status && (
<div>
:{' '}
{ContractArchiveFileReturnStatusEnum[
@ -89,20 +94,21 @@ export default function Show(props: MyBetaModalFormProps) {
]?.text || file.return_status}
</div>
)} */}
{file?.lost_number > 0 && (
<div>: {file?.lost_number}</div>
)}
{file?.damaged_number > 0 && (
<div>: {file?.damaged_number}</div>
)}
{file?.lost_description && (
<div>: {file?.lost_description}</div>
)}
{file?.damaged_description && (
<div>: {file?.damaged_description}</div>
)}
</div>
))}
{file?.lost_number > 0 && (
<div>: {file?.lost_number}</div>
)}
{file?.damaged_number > 0 && (
<div>: {file?.damaged_number}</div>
)}
{file?.lost_description && (
<div>: {file?.lost_description}</div>
)}
{file?.damaged_description && (
<div>: {file?.damaged_description}</div>
)}
</div>
),
)}
</div>
)}
</ProDescriptions.Item>

View File

@ -37,11 +37,13 @@ export default function Update(props: MyBetaModalFormProps) {
onOpenChange={(open: any) => {
if (open && props.item) {
form.setFieldsValue({
files: props.item?.borrow_files?.map((res: any) => ({
id: res?.id,
name: res?.file?.name,
borrow_number: res?.borrow_number,
})),
files: props.item?.contract_archive_borrow_files?.map(
(res: any) => ({
id: res?.id,
name: res?.contract_archive_file?.name,
borrow_number: res?.borrow_number,
}),
),
});
}
}}