Compare commits

..

No commits in common. "36c0675e292d5141f7468303a60338458cd10f17" and "e6d6129635c85ab5c8330497476d895e18bb6890" have entirely different histories.

2 changed files with 35 additions and 43 deletions

View File

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

View File

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