refactor(components): 重构业务详情组件布局并添加付款记录功能
- 移除未使用的 column 工具函数 - 将平铺模式的卡片布局改为直接映射渲染 - 统一移动端和桌面端的卡片方向为垂直布局 - 移除动态列跨度计算,统一设置为 24 列 - 在付款记录列表中添加付款任务 VO 属性 - 从付款记录列表中移除账号列的固定宽度 - 将付款记录列表集成到付款任务详情的标签页中 - 更新本地化文件中的付款记录和任务编号字段 - 调整付款记录列表的容器样式配置
This commit is contained in:
parent
b98026b9b7
commit
22889e3f1b
@ -1,5 +1,4 @@
|
|||||||
import { BizValueType, ButtonAccess } from '@/components';
|
import { BizValueType, ButtonAccess } from '@/components';
|
||||||
import column from '@/utils/column';
|
|
||||||
import { formLayout } from '@/utils/formLayout';
|
import { formLayout } from '@/utils/formLayout';
|
||||||
import { useIntl } from '@@/exports';
|
import { useIntl } from '@@/exports';
|
||||||
import {
|
import {
|
||||||
@ -59,25 +58,21 @@ export default function BizDetail<
|
|||||||
|
|
||||||
// 平铺模式:直接垂直堆叠所有内容
|
// 平铺模式:直接垂直堆叠所有内容
|
||||||
if (formContextMode === 'flat') {
|
if (formContextMode === 'flat') {
|
||||||
return (
|
return contextItems?.map((item, index) => (
|
||||||
<ProCard ghost={true} direction={'column'}>
|
<ProCard
|
||||||
{contextItems?.map((item, index) => (
|
key={item.key || index}
|
||||||
<ProCard
|
bordered={true}
|
||||||
key={item.key || index}
|
headerBordered={false}
|
||||||
bordered={true}
|
title={item.label}
|
||||||
headerBordered={false}
|
style={{
|
||||||
title={item.label}
|
marginBottom: 16,
|
||||||
style={{
|
}}
|
||||||
marginBottom: 16,
|
// @ts-ignore
|
||||||
}}
|
subTitle={item.subTitle}
|
||||||
// @ts-ignore
|
>
|
||||||
subTitle={item.subTitle}
|
{item.children}
|
||||||
>
|
|
||||||
{item.children}
|
|
||||||
</ProCard>
|
|
||||||
))}
|
|
||||||
</ProCard>
|
</ProCard>
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tab 模式:使用 tabs 渲染
|
// Tab 模式:使用 tabs 渲染
|
||||||
@ -149,17 +144,14 @@ export default function BizDetail<
|
|||||||
<ProFormDependency name={[`${method}VO`, 'isMobile', 'activeKey']}>
|
<ProFormDependency name={[`${method}VO`, 'isMobile', 'activeKey']}>
|
||||||
{(data, form) => {
|
{(data, form) => {
|
||||||
return (
|
return (
|
||||||
<ProCard
|
<ProCard ghost={true} gutter={24} direction={'column'}>
|
||||||
ghost={true}
|
|
||||||
gutter={24}
|
|
||||||
direction={data.isMobile ? 'column' : 'row'}
|
|
||||||
>
|
|
||||||
<ProCard
|
<ProCard
|
||||||
bordered={true}
|
bordered={true}
|
||||||
headerBordered={true}
|
headerBordered={true}
|
||||||
colSpan={
|
colSpan={24}
|
||||||
data.isMobile || formContext === undefined ? 24 : 6
|
style={{
|
||||||
}
|
marginBottom: 16,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ProDescriptions<BizVO, BizValueType>
|
<ProDescriptions<BizVO, BizValueType>
|
||||||
params={{ data: data[`${method}VO`] }}
|
params={{ data: data[`${method}VO`] }}
|
||||||
@ -170,10 +162,9 @@ export default function BizDetail<
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
columns={[...columns]}
|
columns={[...columns]}
|
||||||
column={column(data.isMobile, formContext)}
|
|
||||||
/>
|
/>
|
||||||
</ProCard>
|
</ProCard>
|
||||||
{renderFormContext(data, form, data.isMobile ? 24 : 18)}
|
{renderFormContext(data, form, 24)}
|
||||||
</ProCard>
|
</ProCard>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
@ -207,13 +198,14 @@ export default function BizDetail<
|
|||||||
<ProFormDependency name={[`${method}VO`, 'isMobile', 'activeKey']}>
|
<ProFormDependency name={[`${method}VO`, 'isMobile', 'activeKey']}>
|
||||||
{(data, form) => {
|
{(data, form) => {
|
||||||
return (
|
return (
|
||||||
<ProCard ghost={true} gutter={24} direction={'row'}>
|
<ProCard ghost={true} gutter={24} direction={'column'}>
|
||||||
<ProCard
|
<ProCard
|
||||||
bordered={true}
|
bordered={true}
|
||||||
headerBordered={true}
|
headerBordered={true}
|
||||||
colSpan={
|
colSpan={24}
|
||||||
data.isMobile || formContext === undefined ? 24 : 6
|
style={{
|
||||||
}
|
marginBottom: 16,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ProDescriptions<BizVO, BizValueType>
|
<ProDescriptions<BizVO, BizValueType>
|
||||||
params={{ data: data[`${method}VO`] }}
|
params={{ data: data[`${method}VO`] }}
|
||||||
@ -224,10 +216,9 @@ export default function BizDetail<
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
columns={[...columns]}
|
columns={[...columns]}
|
||||||
column={column(data.isMobile, formContext)}
|
|
||||||
/>
|
/>
|
||||||
</ProCard>
|
</ProCard>
|
||||||
{renderFormContext(data, form, data.isMobile ? 24 : 18)}
|
{renderFormContext(data, form, 24)}
|
||||||
</ProCard>
|
</ProCard>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import React, { useRef, useState } from 'react';
|
|||||||
interface IPaymentRecordListProps {
|
interface IPaymentRecordListProps {
|
||||||
ghost?: boolean;
|
ghost?: boolean;
|
||||||
paymentRecordId?: BusinessAPI.PaymentRecordVO['paymentRecordId'];
|
paymentRecordId?: BusinessAPI.PaymentRecordVO['paymentRecordId'];
|
||||||
|
paymentTaskVO?: BusinessAPI.PaymentTaskVO;
|
||||||
search?: boolean;
|
search?: boolean;
|
||||||
onValueChange?: () => void;
|
onValueChange?: () => void;
|
||||||
mode?: ModeType;
|
mode?: ModeType;
|
||||||
@ -24,6 +25,7 @@ export default function PaymentRecordList(props: IPaymentRecordListProps) {
|
|||||||
mode = 'page',
|
mode = 'page',
|
||||||
trigger,
|
trigger,
|
||||||
onValueChange,
|
onValueChange,
|
||||||
|
paymentTaskVO,
|
||||||
} = props;
|
} = props;
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const intlPrefix = 'paymentRecord';
|
const intlPrefix = 'paymentRecord';
|
||||||
@ -132,7 +134,6 @@ export default function PaymentRecordList(props: IPaymentRecordListProps) {
|
|||||||
dataIndex: 'accountNumber',
|
dataIndex: 'accountNumber',
|
||||||
key: 'accountNumber',
|
key: 'accountNumber',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
width: 180,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: intlPrefix + '.column.paidAmount' }),
|
title: intl.formatMessage({ id: intlPrefix + '.column.paidAmount' }),
|
||||||
@ -277,6 +278,7 @@ export default function PaymentRecordList(props: IPaymentRecordListProps) {
|
|||||||
modeType={mode}
|
modeType={mode}
|
||||||
onValueChange={onValueChange}
|
onValueChange={onValueChange}
|
||||||
container={{
|
container={{
|
||||||
|
ghost,
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
ghost,
|
ghost,
|
||||||
},
|
},
|
||||||
@ -330,6 +332,9 @@ export default function PaymentRecordList(props: IPaymentRecordListProps) {
|
|||||||
...(activeKey !== 'ALL' && {
|
...(activeKey !== 'ALL' && {
|
||||||
paidState: activeKey,
|
paidState: activeKey,
|
||||||
}),
|
}),
|
||||||
|
...(paymentTaskVO && {
|
||||||
|
paymentTaskId: paymentTaskVO.paymentTaskId,
|
||||||
|
}),
|
||||||
targetType: 'SUPPLIER',
|
targetType: 'SUPPLIER',
|
||||||
},
|
},
|
||||||
toolbar: {
|
toolbar: {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import {
|
|||||||
InvoicerStatisticCard,
|
InvoicerStatisticCard,
|
||||||
ModeType,
|
ModeType,
|
||||||
OrderSupplierInvoiceList,
|
OrderSupplierInvoiceList,
|
||||||
|
PaymentRecordList,
|
||||||
PaymentTaskCreate,
|
PaymentTaskCreate,
|
||||||
PaymentTaskPay,
|
PaymentTaskPay,
|
||||||
SupplierFarmerList,
|
SupplierFarmerList,
|
||||||
@ -416,6 +417,20 @@ export default function PaymentTaskList(props: IPaymentTaskListProps) {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
// 付款记录 Tab
|
||||||
|
{
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.detail.tab.paymentRecord',
|
||||||
|
}),
|
||||||
|
key: 'paymentRecord',
|
||||||
|
children: (
|
||||||
|
<PaymentRecordList
|
||||||
|
paymentTaskVO={paymentTaskVO}
|
||||||
|
ghost={true}
|
||||||
|
search={false}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2641,6 +2641,7 @@ export default {
|
|||||||
'(实际瓜农≠开票方,注意核实收款人)',
|
'(实际瓜农≠开票方,注意核实收款人)',
|
||||||
noInvoiceList: '无发票车次列表',
|
noInvoiceList: '无发票车次列表',
|
||||||
'noInvoiceList.subTitle': '(需微信个人支付,必须上传截图)',
|
'noInvoiceList.subTitle': '(需微信个人支付,必须上传截图)',
|
||||||
|
paymentRecord: '付款记录',
|
||||||
},
|
},
|
||||||
invoiceType: {
|
invoiceType: {
|
||||||
selfInvoice: '自开票',
|
selfInvoice: '自开票',
|
||||||
@ -2720,7 +2721,7 @@ export default {
|
|||||||
totalAmount: '总应付金额',
|
totalAmount: '总应付金额',
|
||||||
paidAmount: '已付金额',
|
paidAmount: '已付金额',
|
||||||
unpaidAmount: '剩余付款金额',
|
unpaidAmount: '剩余付款金额',
|
||||||
paymentRecordSn: '任务编号',
|
paymentTaskSn: '任务编号',
|
||||||
taskName: '任务名称',
|
taskName: '任务名称',
|
||||||
},
|
},
|
||||||
currentPayment: {
|
currentPayment: {
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
export default function column(isMobile?: boolean, formContext?: any) {
|
|
||||||
if (isMobile || formContext !== undefined) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
xs: 1,
|
|
||||||
sm: 1,
|
|
||||||
md: 2,
|
|
||||||
lg: 2,
|
|
||||||
xl: 2,
|
|
||||||
xxl: 3,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user