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,8 +277,18 @@ const OrderList = ref => { ...@@ -277,8 +277,18 @@ 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 = '';
if ([12, 14].includes(record.orderStatus)) {
text = '发货';
}
if ([13].includes(record.orderStatus)) {
text = '修改物流';
}
console.log(text);
return (
<> <>
{text ? (
<Button <Button
type="primary" type="primary"
onClick={async () => { onClick={async () => {
...@@ -297,10 +307,14 @@ const OrderList = ref => { ...@@ -297,10 +307,14 @@ const OrderList = ref => {
handleModalVisible(true); handleModalVisible(true);
}} }}
> >
发货 {text}
</Button> </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