fix:修复:文件归还的弹窗异常 #19
@ -63,25 +63,30 @@ 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?.borrow_files || data.borrow_files.length === 0 ? (
|
{!data?.contract_archive_borrow_files ||
|
||||||
|
!data.contract_archive_borrow_files.length ? (
|
||||||
'-'
|
'-'
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
{data.borrow_files.map((file: any, index: number) => (
|
{data.contract_archive_borrow_files.map(
|
||||||
<div
|
(file: any, index: number) => (
|
||||||
key={index}
|
<div
|
||||||
style={{
|
key={index}
|
||||||
marginBottom: 8,
|
style={{
|
||||||
padding: 8,
|
marginBottom: 8,
|
||||||
border: '1px solid #f0f0f0',
|
padding: 8,
|
||||||
borderRadius: 4,
|
border: '1px solid #f0f0f0',
|
||||||
}}
|
borderRadius: 4,
|
||||||
>
|
}}
|
||||||
<div style={{ fontWeight: 'bold', marginBottom: 4 }}>
|
>
|
||||||
文件 {index + 1}: {file?.file?.name}
|
<div
|
||||||
</div>
|
style={{ fontWeight: 'bold', marginBottom: 4 }}
|
||||||
<div>借阅数量: {file?.borrow_number}</div>
|
>
|
||||||
{/* {file?.return_status && (
|
文件 {index + 1}:
|
||||||
|
{file?.contract_archive_file?.name}
|
||||||
|
</div>
|
||||||
|
<div>借阅数量: {file?.borrow_number}</div>
|
||||||
|
{/* {file?.return_status && (
|
||||||
<div>
|
<div>
|
||||||
归还状态:{' '}
|
归还状态:{' '}
|
||||||
{ContractArchiveFileReturnStatusEnum[
|
{ContractArchiveFileReturnStatusEnum[
|
||||||
@ -89,20 +94,21 @@ 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>
|
||||||
|
|||||||
@ -37,11 +37,13 @@ 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?.borrow_files?.map((res: any) => ({
|
files: props.item?.contract_archive_borrow_files?.map(
|
||||||
id: res?.id,
|
(res: any) => ({
|
||||||
name: res?.file?.name,
|
id: res?.id,
|
||||||
borrow_number: res?.borrow_number,
|
name: res?.contract_archive_file?.name,
|
||||||
})),
|
borrow_number: res?.borrow_number,
|
||||||
|
}),
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user