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 { queryOrderDetail } from '../../service';
import style from './index.less';
const DetailModal = (props, ref) => {
......@@ -14,6 +15,15 @@ const DetailModal = (props, ref) => {
setVisible(false);
},
};
const getDetail = async orderNo => {
const params = {
orderNo,
};
const res = await queryOrderDetail(params);
console.log(res);
};
/** @module 基本信息 */
const [baseInfo, setBaseInfo] = useState({});
......@@ -91,6 +101,8 @@ const DetailModal = (props, ref) => {
orderTime,
payTime,
});
getDetail(orderNo);
};
useImperativeHandle(ref, () => ({
......
......@@ -69,7 +69,7 @@ const OrderList = ref => {
queryOrderList(searchParams).then(res => {
setLoading(false);
const { current, total, records } = res.data;
const { total, records } = res.data;
setDataTotal(total);
setTableData(records);
});
......@@ -277,8 +277,18 @@ const OrderList = ref => {
rowSpanMode: 'auto',
align: 'center',
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
type="primary"
onClick={async () => {
......@@ -297,10 +307,14 @@ const OrderList = ref => {
handleModalVisible(true);
}}
>
发货
{text}
</Button>
) : (
''
)}
</>
),
);
},
},
];
......
......@@ -12,7 +12,13 @@ export async function queryOrderList(params) {
data: params,
});
}
// 订单详情
export async function queryOrderDetail(params) {
return request.post('/api/kdsp/queryOrderDetail', {
prefix: config.kdspApi,
data: params,
});
}
// 待发货订单
export async function queryToSend(params) {
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