Commit b42f6723 authored by XieZhiXiong's avatar XieZhiXiong

feat: 显示售后换货积分订单相关

parent f7678690
......@@ -19,6 +19,8 @@ import {
import {
EXCHANGE_OUTER_STATUS_FINISHED,
EXCHANGE_INNER_STATUS_UNCOMMITTED,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
......@@ -76,6 +78,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [replaceGoodsLoading, setExchangeGoodsLoading] = useState(false);
const [infoLoading, setInfoloading] = useState(false);
const isPointsOrder = detailInfo?.orderType === ORDER_TYPE2_POINTS || detailInfo?.orderType === ORDER_TYPE2_CHANNEL_POINTS;
const productColumns: EditableColumns[] = [
{
title: '订单号',
......@@ -114,17 +117,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
align: 'center',
},
{
title: '采购数量',
title: !isPointsOrder ? '采购数量' : '兑换数量',
dataIndex: 'purchaseCount',
align: 'center',
},
{
title: '采购单价',
title: !isPointsOrder ? '采购单价' : '所需积分',
dataIndex: 'purchasePrice',
align: 'center',
},
{
title: '采购金额',
title: !isPointsOrder ? '采购金额' : '所需积分小计',
dataIndex: 'purchaseAmount',
align: 'center',
},
......
......@@ -188,6 +188,19 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
];
};
const setColumnsTitle = (orderType: number) => {
const isPointsOrder = orderType === ORDER_TYPE2_POINTS || orderType === ORDER_TYPE2_CHANNEL_POINTS;
// addSchemaAction.setFieldState('replaceGoodsList.*.purchasePrice', state => {
// state.title = !isPointsOrder ? '采购单价' : '所需积分';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseCount', state => {
// state.title = !isPointsOrder ? '采购数量' : '兑换数量';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseAmount', state => {
// state.title = !isPointsOrder ? '采购金额' : '所需积分小计';
// });
};
// 根据供应会员获取订单列表
const getOrderList = (params): Promise<OrderListRes> => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
......@@ -295,6 +308,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
...rest,
});
setGoodsValue(goodsDetailList.map(item => item.orderRecordId));
setColumnsTitle(orderType);
}
}).finally(() => {
setInfoLoading(false);
......@@ -514,6 +528,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const handleGoodsConfirm = values => {
const preValues = addSchemaAction.getFieldValue('replaceGoodsList');
const value = [];
const first = values.length ? values[0] : {};
values.forEach(item => {
const atom = {
......@@ -541,6 +556,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
if (preValues.length) {
newData.reverse();
}
setColumnsTitle(first.orderType);
addSchemaAction.setFieldValue('replaceGoodsList', newData);
};
......
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