Commit f8f580e6 authored by 李腾's avatar 李腾

fix: 修复退货物流参数问题

parent abcf181f
......@@ -11,10 +11,11 @@ const LogisticsRecordModal = (props, ref) => {
const [visible, setVisible] = useState(false);
const [loading, setLoading] = useState(false);
const [dataList, setDataList] = useState([]);
const [isSingle, setIsSingle] = useState(false);
const getRecordList = async ({ orderNo, skuNo }) => {
const getRecordList = async params => {
setLoading(true);
const res = await apiDeliveriesTraceList({ orderNo, skuNo });
const res = await apiDeliveriesTraceList(params);
setLoading(false);
if (!res) {
notification.info({ message: '暂无物流信息' });
......@@ -24,9 +25,12 @@ const LogisticsRecordModal = (props, ref) => {
setDataList(res.data);
};
const open = record => {
const open = (record, type) => {
setVisible(true);
getRecordList(record);
if (type === 'single') {
setIsSingle(true);
}
};
const onCancel = () => {
setVisible(false);
......@@ -58,7 +62,11 @@ const LogisticsRecordModal = (props, ref) => {
{dataList.length ? (
dataList.map((dataItem, dataIndex) => (
<div className={styles['logistics-record']}>
<div className={styles['logistics-record__topbar']}>包裹{dataIndex + 1}</div>
{!isSingle ? (
<div className={styles['logistics-record__topbar']}>包裹{dataIndex + 1}</div>
) : (
''
)}
<div className={styles['logistics-record__head']}>
<span className={styles.name}>物流公司:{dataItem.expressCompanyName}</span>
<span className={styles.no}>物流单号:{dataItem.expressNo}</span>
......
......@@ -105,7 +105,8 @@ const AuditModal = props => {
};
const openLogisticsRecord = () => {
logisticsRecordModalRef.current.open(formData);
const { orderNo, skuNo } = formData;
logisticsRecordModalRef.current.open({ orderNo, skuNo });
};
const layout = {
......
......@@ -134,8 +134,10 @@ const AfterSale = props => {
};
// 查看物流
const handleCom = async ({ orderNo, skuNo }) => {
logisticsRecordModalRef.current.open({ orderNo, skuNo });
const handleCom = async record => {
console.log('record', record);
const { expressCompanyCode, deliveryNo: expressNo } = record;
logisticsRecordModalRef.current.open({ expressCompanyCode, expressNo }, 'single');
// const tempObj = {
// detailList: [],
// key: Date.now(),
......
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