Commit 91599ce3 authored by 李腾's avatar 李腾

fix: 修复订单查询售后字段展示&服务订单不展示物流信息

parent b065c34d
import React, { useState, useEffect, 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 { queryOrderDetail } from '../../service';
import { COUPON_CODE_STATUS } from '../../const';
import style from './index.less'; import style from './index.less';
const DetailModal = (props, ref) => { const DetailModal = (props, ref) => {
...@@ -16,13 +17,13 @@ const DetailModal = (props, ref) => { ...@@ -16,13 +17,13 @@ const DetailModal = (props, ref) => {
}, },
}; };
const getDetail = async orderNo => { // const getDetail = async orderNo => {
const params = { // const params = {
orderNo, // orderNo,
}; // };
const res = await queryOrderDetail(params); // const res = await queryOrderDetail(params);
console.log(res); // console.log(res);
}; // };
/** @module 基本信息 */ /** @module 基本信息 */
const [baseInfo, setBaseInfo] = useState({}); const [baseInfo, setBaseInfo] = useState({});
...@@ -44,11 +45,15 @@ const DetailModal = (props, ref) => { ...@@ -44,11 +45,15 @@ const DetailModal = (props, ref) => {
}, },
{ {
title: '小计', title: '小计',
dataIndex: 'skuName', dataIndex: 'subTotal',
render: (value, record) => {
const { supplyPrice, count } = record;
return (supplyPrice * count).toFixed(2);
},
}, },
{ {
title: '售后状态', title: '售后状态',
dataIndex: 'afterServiceStatus', dataIndex: 'afterServiceStatusDesc',
}, },
]; ];
...@@ -57,23 +62,30 @@ const DetailModal = (props, ref) => { ...@@ -57,23 +62,30 @@ const DetailModal = (props, ref) => {
const couponColumns = [ const couponColumns = [
{ {
title: '券码', title: '券码',
render: (_, record, index) => `券码${index + 1}`, render: (value, record, index) => `券码${index + 1}`,
}, },
{ {
title: '有效期', title: '有效期',
dataIndex: 'price', dataIndex: 'useStartTime',
render: (value, record) => {
const { useEndTime } = record;
return `${value} - ${useEndTime}`;
},
}, },
{ {
title: '核销时间', title: '核销时间',
dataIndex: 'count', dataIndex: 'useTime',
render: value => value || '-',
}, },
{ {
title: '核销人', title: '核销人',
dataIndex: 'skuName', dataIndex: 'usedByShopName',
render: value => value || '-',
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'afterStatus', dataIndex: 'codeStatus',
render: value => COUPON_CODE_STATUS[value],
}, },
]; ];
...@@ -102,7 +114,7 @@ const DetailModal = (props, ref) => { ...@@ -102,7 +114,7 @@ const DetailModal = (props, ref) => {
payTime, payTime,
}); });
getDetail(orderNo); // getDetail(orderNo);
}; };
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
......
...@@ -73,3 +73,9 @@ export const ORDER_STATUS = [ ...@@ -73,3 +73,9 @@ export const ORDER_STATUS = [
name: '已关闭', name: '已关闭',
}, },
]; ];
export const COUPON_CODE_STATUS = {
1: '待核销',
2: '已核销',
3: '已取消',
};
...@@ -268,9 +268,15 @@ const OrderList = ref => { ...@@ -268,9 +268,15 @@ const OrderList = ref => {
width: 150, width: 150,
}, },
{ {
title: '售后状态', title: '售后',
dataIndex: 'afterStatus', dataIndex: 'afterServiceStatusDesc',
width: 200, width: 200,
render: ({ value, subRecord }) => (
<>
<div>{value}</div>
<div className={style.blue}>{subRecord.afterServiceNo}</div>
</>
),
}, },
{ {
title: '操作', title: '操作',
...@@ -279,13 +285,17 @@ const OrderList = ref => { ...@@ -279,13 +285,17 @@ const OrderList = ref => {
width: 100, width: 100,
render: ({ value, record, index, subRecord, subIndex }) => { render: ({ value, record, index, subRecord, subIndex }) => {
let text = ''; let text = '';
if ([12, 14].includes(record.orderStatus)) { if ([12, 14].includes(record.orderStatus)) {
text = '发货'; text = '发货';
} }
if ([13].includes(record.orderStatus)) { if ([13].includes(record.orderStatus)) {
text = '修改物流'; text = '修改物流';
} }
console.log(text); // 服务订单不展示发货/修改物流
if (record.productType === 4) {
return <></>;
}
return ( return (
<> <>
{text ? ( {text ? (
......
...@@ -37,3 +37,7 @@ ...@@ -37,3 +37,7 @@
margin-left: 10px; margin-left: 10px;
} }
} }
.blue {
color: #61b0ff;
}
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