Commit 8e038f49 authored by 李腾's avatar 李腾

feat: 修改查看物流

parent a0f494bf
...@@ -64,15 +64,15 @@ const TableList = props => { ...@@ -64,15 +64,15 @@ const TableList = props => {
const multiLogisticsModalRef = useRef(); const multiLogisticsModalRef = useRef();
const actionRef = useRef(); const actionRef = useRef();
const ref = useRef(FormInstance); const ref = useRef(FormInstance);
const handleCom = async (record, skuItem) => { const handleCom = async (skuInfo, expressInfo) => {
const tempObj = { const tempObj = {
expressCompanyCode: skuItem?.expressCompanyCode ?? '', expressCompanyCode: expressInfo?.expressCompanyCode ?? '',
expressCompanyName: skuItem.expressCompanyName ?? '', expressCompanyName: expressInfo.expressCompanyName ?? '',
deliveryNo: skuItem?.deliveryNo ?? '', deliveryNo: expressInfo?.expressNo ?? '',
detailList: [], detailList: [],
key: Date.now(), key: Date.now(),
}; };
const data = await getJDLogisticsInfo(skuItem.orderSkuId); const data = await getJDLogisticsInfo(skuInfo.orderSkuId);
if (!data) { if (!data) {
notification.info({ message: '暂无物流信息' }); notification.info({ message: '暂无物流信息' });
return; return;
...@@ -114,14 +114,51 @@ const TableList = props => { ...@@ -114,14 +114,51 @@ const TableList = props => {
const renderContent = (record, key) => { const renderContent = (record, key) => {
if (record.mchOrderSkuVoList) { if (record.mchOrderSkuVoList) {
return record?.mchOrderSkuVoList.map((item, index) => ( return record?.mchOrderSkuVoList.map((item, index) => (
<p <div
className={[ className={[
'tableContent', 'tableContent',
index < record?.mchOrderSkuVoList?.length - 1 ? 'border' : null, index < record?.mchOrderSkuVoList?.length - 1 ? 'border' : null,
].join(' ')} ].join(' ')}
// style={{ height: `${(item.expressList?.length || 1) * 60}px` }}
key={item.orderSkuId} key={item.orderSkuId}
> >
{key === 'skuName' ? <PopoverDom name={item[key]} url={item.imageUrl} /> : ''} {key === 'skuName' ? <PopoverDom name={item[key]} url={item.imageUrl} /> : ''}
{key === 'expressCompanyName' ? (
<div className="expressList">
{item.expressList?.map((info, idx) => (
<span
className={[
'subContent',
idx < item.expressList?.length - 1 ? 'border' : null,
].join(' ')}
>
{info.expressCompanyName}
</span>
))}
</div>
) : (
''
)}
{key === 'deliveryNo' ? (
<div className="expressList">
{item.expressList?.map((info, idx) => (
<a
onClick={() => {
handleCom(item, info);
}}
className={[
'subContent',
idx < item.expressList?.length - 1 ? 'border' : null,
].join(' ')}
>
{info.expressNo}
</a>
))}
</div>
) : (
''
)}
{key === 'action' && props.type === 2 ? ( {key === 'action' && props.type === 2 ? (
<Button <Button
size="small" size="small"
...@@ -130,12 +167,12 @@ const TableList = props => { ...@@ -130,12 +167,12 @@ const TableList = props => {
handleCom(record, item); handleCom(record, item);
}} }}
> >
查看物流 查看物流1
</Button> </Button>
) : ( ) : (
item[key] item[key]
)} )}
</p> </div>
)); ));
} }
return ''; return '';
...@@ -340,15 +377,15 @@ const TableList = props => { ...@@ -340,15 +377,15 @@ const TableList = props => {
hideInSearch: true, hideInSearch: true,
render: (_, record) => renderContent(record, 'deliveryNo'), render: (_, record) => renderContent(record, 'deliveryNo'),
}, },
{ // {
title: '物流信息', // title: '物流信息',
dataIndex: 'action', // dataIndex: 'action',
key: 'action', // key: 'action',
width: 150, // width: 150,
hideInSearch: true, // hideInSearch: true,
className: 'colStyle', // className: 'colStyle',
render: (_, record) => renderContent(record, 'action'), // render: (_, record) => renderContent(record, 'action'),
}, // },
{ {
title: '订单状态', title: '订单状态',
dataIndex: 'orderStatusDesc', dataIndex: 'orderStatusDesc',
......
...@@ -5,12 +5,25 @@ ...@@ -5,12 +5,25 @@
.tableContent { .tableContent {
display: flex; display: flex;
align-items: center; align-items: center;
height: 60px; // height: 60px;
min-height: 60px;
padding: 16px; padding: 16px;
} }
.border { .border {
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
} }
.subContent {
flex: 1;
padding: 16px;
}
.expressList {
display: flex;
flex-direction: column;
width: calc(100% + 32px);
margin: -16px;
}
tbody .colStyle { tbody .colStyle {
padding: 0; padding: 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment