提交 146247f8 作者: ZhangLingKun

优化:任务订单结算

上级 40ae836a
流水线 #7318 已通过 于阶段
in 1 分 41 秒
......@@ -673,6 +673,8 @@ export type serviceOrderFormListType = InterItemFunction<
*/
serviceName?: string;
waiting: string;
fatherRequireId: number;
childrenRequire?: any[];
}[]
>;
// 需求订单-详情
......
......@@ -43,9 +43,31 @@ const DemandOrderList = () => {
];
const tableColumns: ColumnsType<demandOrderListType[0]> = [
{
title: '发单时间',
title: '订单编号',
align: 'center',
dataIndex: 'createTime',
dataIndex: 'publisherNumber',
render: (text: string, record) => (
<>
<Tag
color={
record?.fatherRequireId === 0
? record?.childrenRequire?.length
? 'green'
: 'volcano'
: 'blue'
}
>
{record?.fatherRequireId === 0 ? '主订单' : '子订单'}
</Tag>
<span>{text}</span>
</>
),
width: 250,
},
{
title: '订单状态',
align: 'center',
dataIndex: 'waiting',
},
{
title: '订单类型',
......@@ -61,11 +83,6 @@ const DemandOrderList = () => {
),
},
{
title: '订单编号',
align: 'center',
dataIndex: 'publisherNumber',
},
{
title: '发单方信息',
align: 'center',
dataIndex: 'publishPhone',
......@@ -76,11 +93,6 @@ const DemandOrderList = () => {
dataIndex: 'preemptPhone',
},
{
title: '订单状态',
align: 'center',
dataIndex: 'waiting',
},
{
title: '订单属性',
align: 'center',
dataIndex: 'orderAttribute',
......@@ -93,13 +105,20 @@ const DemandOrderList = () => {
render: (text: number) => text.toFixed(2).toLocaleString(),
},
{
title: '发单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '操作',
align: 'center',
render: (_text: any, record) => (
<Button type='link' onClick={() => toOrderDetail(record)}>
查看订单
</Button>
),
fixed: 'right',
render: (_text: any, record) =>
!record?.childrenRequire?.length && (
<Button type='link' onClick={() => toOrderDetail(record)}>
查看订单
</Button>
),
},
];
......@@ -110,7 +129,8 @@ const DemandOrderList = () => {
totalCount: 0,
});
const [query, setQuery] = useState<demandOrderListParameterType>();
// 刷新子组件
// const [refresh, setRefresh] = useState<boolean>(true);
// 获取需求订单列表
const getServiceOrderFormList = (query?: demandOrderListParameterType) => {
OrderManageAPI.getServiceOrderFormList({
......@@ -118,7 +138,11 @@ const DemandOrderList = () => {
pageSize: pagination.pageSize,
...query,
}).then(({ result }) => {
setTableData(result.list || []);
const list = (result.list || [])?.map((i) => ({
...i,
childrenRequire: i.childrenRequire?.length ? i.childrenRequire : undefined,
}));
setTableData(list);
pagination.totalCount = result.totalCount;
setPagination({ ...pagination });
});
......@@ -153,6 +177,11 @@ const DemandOrderList = () => {
bordered
rowKey='id'
dataSource={tableData}
expandable={{
defaultExpandAllRows: false,
childrenColumnName: 'childrenRequire',
}}
scroll={{ x: 1000 }}
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论