Commit f8f580e6 authored by 李腾's avatar 李腾

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

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