Commit db81af5e authored by FE-安焕焕's avatar FE-安焕焕 👣

修改问题

parent d0a905f0
...@@ -59,7 +59,7 @@ const LogisticsCom = props => { ...@@ -59,7 +59,7 @@ const LogisticsCom = props => {
return ( return (
<Modal <Modal
destroyOnClose destroyOnClose
title="企业物流信息" title="物流信息"
visible={modalVisible} visible={modalVisible}
onCancel={() => onCancel()} onCancel={() => onCancel()}
onOk={() => onCancel()} onOk={() => onCancel()}
......
import { Button } from 'antd'; import { Button, notification } from 'antd';
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
...@@ -43,7 +43,7 @@ const TableList = props => { ...@@ -43,7 +43,7 @@ const TableList = props => {
const tempObj = {}; const tempObj = {};
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
record?.mchOrderSkuVoList?.forEach(item => { record?.mchOrderSkuVoList?.forEach(item => {
if (!(item.deliveryNo in tempObj)) { if (item.deliveryNo && !(item.deliveryNo in tempObj)) {
tempObj[item.deliveryNo] = { tempObj[item.deliveryNo] = {
deliveryNo: item.deliveryNo, deliveryNo: item.deliveryNo,
expressCompanyCode: item.expressCompanyCode, expressCompanyCode: item.expressCompanyCode,
...@@ -52,6 +52,10 @@ const TableList = props => { ...@@ -52,6 +52,10 @@ const TableList = props => {
} }
}); });
const keys = Object.keys(tempObj); const keys = Object.keys(tempObj);
if (!keys.length) {
notification.warning({ message: '暂无物流信息' });
return;
}
const firstObj = tempObj[keys[0]]; const firstObj = tempObj[keys[0]];
const data = await getLogisticsInfo(firstObj?.expressCompanyCode, firstObj?.deliveryNo); const data = await getLogisticsInfo(firstObj?.expressCompanyCode, firstObj?.deliveryNo);
tempObj[keys[0]].detailList = data?.logisticsList?.[0]?.detailList || []; tempObj[keys[0]].detailList = data?.logisticsList?.[0]?.detailList || [];
......
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