Commit b065c34d authored by 李腾's avatar 李腾

feat: 修改商户后台查询订单发货按钮文案

parent a2f9c83c
import React, { useState, forwardRef, useImperativeHandle } from 'react'; import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
import { Modal, Table } from 'antd'; import { Modal, Table } from 'antd';
import { queryOrderDetail } from '../../service';
import style from './index.less'; import style from './index.less';
const DetailModal = (props, ref) => { const DetailModal = (props, ref) => {
...@@ -14,6 +15,15 @@ const DetailModal = (props, ref) => { ...@@ -14,6 +15,15 @@ const DetailModal = (props, ref) => {
setVisible(false); setVisible(false);
}, },
}; };
const getDetail = async orderNo => {
const params = {
orderNo,
};
const res = await queryOrderDetail(params);
console.log(res);
};
/** @module 基本信息 */ /** @module 基本信息 */
const [baseInfo, setBaseInfo] = useState({}); const [baseInfo, setBaseInfo] = useState({});
...@@ -91,6 +101,8 @@ const DetailModal = (props, ref) => { ...@@ -91,6 +101,8 @@ const DetailModal = (props, ref) => {
orderTime, orderTime,
payTime, payTime,
}); });
getDetail(orderNo);
}; };
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
......
...@@ -69,7 +69,7 @@ const OrderList = ref => { ...@@ -69,7 +69,7 @@ const OrderList = ref => {
queryOrderList(searchParams).then(res => { queryOrderList(searchParams).then(res => {
setLoading(false); setLoading(false);
const { current, total, records } = res.data; const { total, records } = res.data;
setDataTotal(total); setDataTotal(total);
setTableData(records); setTableData(records);
}); });
...@@ -277,30 +277,44 @@ const OrderList = ref => { ...@@ -277,30 +277,44 @@ const OrderList = ref => {
rowSpanMode: 'auto', rowSpanMode: 'auto',
align: 'center', align: 'center',
width: 100, width: 100,
render: ({ value, record, index, subRecord, subIndex }) => ( render: ({ value, record, index, subRecord, subIndex }) => {
<> let text = '';
<Button if ([12, 14].includes(record.orderStatus)) {
type="primary" text = '发货';
onClick={async () => { }
const skuListData = await getGoods(record?.orderId); if ([13].includes(record.orderStatus)) {
let logisticsData = [{}]; text = '修改物流';
setSkuList(skuListData); }
const res = await getLogistics(record?.orderId); console.log(text);
logisticsData = res.map(item => ({ return (
selectedGoods: item?.skus?.map(sku => sku?.orderSkuId), <>
selectedCompany: item.expressCompanyCode {text ? (
? `${item?.expressCompanyCode}-${item?.expressCompanyName}` <Button
: null, type="primary"
orderNum: item?.deliveryNo, onClick={async () => {
})); const skuListData = await getGoods(record?.orderId);
setLogisticsData(logisticsData); let logisticsData = [{}];
handleModalVisible(true); setSkuList(skuListData);
}} const res = await getLogistics(record?.orderId);
> logisticsData = res.map(item => ({
发货 selectedGoods: item?.skus?.map(sku => sku?.orderSkuId),
</Button> selectedCompany: item.expressCompanyCode
</> ? `${item?.expressCompanyCode}-${item?.expressCompanyName}`
), : null,
orderNum: item?.deliveryNo,
}));
setLogisticsData(logisticsData);
handleModalVisible(true);
}}
>
{text}
</Button>
) : (
''
)}
</>
);
},
}, },
]; ];
......
...@@ -12,7 +12,13 @@ export async function queryOrderList(params) { ...@@ -12,7 +12,13 @@ export async function queryOrderList(params) {
data: params, data: params,
}); });
} }
// 订单详情
export async function queryOrderDetail(params) {
return request.post('/api/kdsp/queryOrderDetail', {
prefix: config.kdspApi,
data: params,
});
}
// 待发货订单 // 待发货订单
export async function queryToSend(params) { export async function queryToSend(params) {
try { try {
......
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