提交 146247f8 作者: ZhangLingKun

优化:任务订单结算

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