diff --git a/src/pages/contract/contract_borrows/modals/Show.tsx b/src/pages/contract/contract_borrows/modals/Show.tsx index f443898..042761f 100644 --- a/src/pages/contract/contract_borrows/modals/Show.tsx +++ b/src/pages/contract/contract_borrows/modals/Show.tsx @@ -63,25 +63,30 @@ export default function Show(props: MyBetaModalFormProps) { {data?.borrow_reason} - {!data?.borrow_files || data.borrow_files.length === 0 ? ( + {!data?.contract_archive_borrow_files || + !data.contract_archive_borrow_files.length ? ( '-' ) : (
- {data.borrow_files.map((file: any, index: number) => ( -
-
- 文件 {index + 1}: {file?.file?.name} -
-
借阅数量: {file?.borrow_number}
- {/* {file?.return_status && ( + {data.contract_archive_borrow_files.map( + (file: any, index: number) => ( +
+
+ 文件 {index + 1}: + {file?.contract_archive_file?.name} +
+
借阅数量: {file?.borrow_number}
+ {/* {file?.return_status && (
归还状态:{' '} {ContractArchiveFileReturnStatusEnum[ @@ -89,20 +94,21 @@ export default function Show(props: MyBetaModalFormProps) { ]?.text || file.return_status}
)} */} - {file?.lost_number > 0 && ( -
遗失数量: {file?.lost_number}
- )} - {file?.damaged_number > 0 && ( -
损坏数量: {file?.damaged_number}
- )} - {file?.lost_description && ( -
遗失描述: {file?.lost_description}
- )} - {file?.damaged_description && ( -
损坏描述: {file?.damaged_description}
- )} -
- ))} + {file?.lost_number > 0 && ( +
遗失数量: {file?.lost_number}
+ )} + {file?.damaged_number > 0 && ( +
损坏数量: {file?.damaged_number}
+ )} + {file?.lost_description && ( +
遗失描述: {file?.lost_description}
+ )} + {file?.damaged_description && ( +
损坏描述: {file?.damaged_description}
+ )} +
+ ), + )}
)}
diff --git a/src/pages/contract/contract_borrows/modals/Update.tsx b/src/pages/contract/contract_borrows/modals/Update.tsx index d89084b..82b7934 100644 --- a/src/pages/contract/contract_borrows/modals/Update.tsx +++ b/src/pages/contract/contract_borrows/modals/Update.tsx @@ -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, + }), + ), }); } }}