Commit 6f5cf3ec authored by XieZhiXiong's avatar XieZhiXiong

feat: 完善换货退货收、发货相关

parent 4dd8b2c4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15 * @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-08 14:53:46 * @LastEditTime: 2021-08-17 18:27:41
* @Description: 换货发货统计、换货发货明细 * @Description: 换货发货统计、换货发货明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -102,14 +102,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -102,14 +102,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
{ {
title: '订单号', title: '订单号',
dataIndex: 'orderNo', dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
}, },
{ {
title: '商品ID', title: '商品ID',
...@@ -176,14 +168,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -176,14 +168,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
{ {
title: '订单号', title: '订单号',
dataIndex: 'orderNo', dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
}, },
{ {
title: '商品ID', title: '商品ID',
...@@ -296,7 +280,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -296,7 +280,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
> >
{radioValue === '1' ? ( {radioValue === '1' ? (
<PolymericTable <PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`} rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={summary} dataSource={summary}
columns={summaryColumns} columns={summaryColumns}
loading={false} loading={false}
...@@ -327,11 +311,20 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -327,11 +311,20 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
)} )}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="物流单号"> <Descriptions.Item label="物流单号">
<Link {item.logisticsId ? (
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`} <Link
> to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
{item.logisticsOrderNo} >
</Link> {item.logisticsOrderNo}
</Link>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
)}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="换货入库单号"> <Descriptions.Item label="换货入库单号">
{isPurchaser ? ( {isPurchaser ? (
...@@ -358,7 +351,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -358,7 +351,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
<Descriptions.Item label="内部状态"> <Descriptions.Item label="内部状态">
<Badge color={'#6C9CEB'} text={item.innerStatusName} /> <Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item contentStyle={{ display: 'block', textAlign: 'right' }}>
{( {(
isEdit && isEdit &&
!isPurchaser && !isPurchaser &&
...@@ -414,7 +407,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -414,7 +407,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
</div> </div>
<PolymericTable <PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`} rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={item.detailList} dataSource={item.detailList}
columns={detailedColumns} columns={detailedColumns}
loading={false} loading={false}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15 * @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-09 18:09:01 * @LastEditTime: 2021-08-17 17:30:29
* @Description: 换货收货统计、换货发货明细 * @Description: 换货收货统计、换货发货明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -104,14 +104,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -104,14 +104,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
{ {
title: '订单号', title: '订单号',
dataIndex: 'orderNo', dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
}, },
{ {
title: '商品ID', title: '商品ID',
...@@ -178,14 +170,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -178,14 +170,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
{ {
title: '订单号', title: '订单号',
dataIndex: 'orderNo', dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
}, },
{ {
title: '商品ID', title: '商品ID',
...@@ -305,7 +289,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -305,7 +289,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
> >
{radioValue === '1' ? ( {radioValue === '1' ? (
<PolymericTable <PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`} rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={summary} dataSource={summary}
columns={summaryColumns} columns={summaryColumns}
loading={false} loading={false}
...@@ -314,7 +298,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -314,7 +298,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
) : null} ) : null}
{radioValue === '2' ? ( {radioValue === '2' ? (
<> <>
<Tabs> <Tabs defaultActiveKey={detailed ? `${detailed[detailed.length - 1].batch}` : ''}>
{detailed.map((item) => ( {detailed.map((item) => (
<TabPane <TabPane
tab={`第 ${item.batch} 批次`} tab={`第 ${item.batch} 批次`}
...@@ -336,11 +320,20 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -336,11 +320,20 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
)} )}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="物流单号"> <Descriptions.Item label="物流单号">
<Link {item.logisticsId ? (
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`} <Link
> to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
{item.logisticsOrderNo} >
</Link> {item.logisticsOrderNo}
</Link>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
)}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="退货入库单号"> <Descriptions.Item label="退货入库单号">
{!isPurchaser ? ( {!isPurchaser ? (
...@@ -367,7 +360,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -367,7 +360,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Descriptions.Item label="内部状态"> <Descriptions.Item label="内部状态">
<Badge color={'#6C9CEB'} text={item.innerStatusName} /> <Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item contentStyle={{ display: 'block', textAlign: 'right' }}>
{( {(
isEdit && isEdit &&
isPurchaser && isPurchaser &&
...@@ -423,7 +416,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -423,7 +416,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
</div> </div>
<PolymericTable <PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`} rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={item.detailList} dataSource={item.detailList}
columns={detailedColumns} columns={detailedColumns}
loading={false} loading={false}
......
...@@ -52,6 +52,49 @@ export interface SummaryData { ...@@ -52,6 +52,49 @@ export interface SummaryData {
differenceCount: number differenceCount: number
} }
export type DetailedListItem = {
/**
* 订单号
*/
orderNo?: string
/**
* 商品id
*/
productId?: string
/**
* 商品名称
*/
productName?: string
/**
* 品类
*/
category?: string
/**
* 品牌
*/
brand?: string
/**
* 单位
*/
unit?: string
/**
* 数量
*/
count?: number
/**
* 发货数量
*/
deliveryCount?: number
/**
* 入库数量
*/
storageCount?: number
/**
* 差异数量,(差异数量=发货数量-入库数量)
*/
differenceCount?: number
}
export interface Detailed { export interface Detailed {
/** /**
* 退货发货单号Id * 退货发货单号Id
...@@ -108,46 +151,5 @@ export interface Detailed { ...@@ -108,46 +151,5 @@ export interface Detailed {
/** /**
* 发货明细 ,DeliveryGoodsDetailVO * 发货明细 ,DeliveryGoodsDetailVO
*/ */
detailList: { detailList: DetailedListItem[]
/**
* 订单号
*/
orderNo?: string
/**
* 商品id
*/
productId?: string
/**
* 商品名称
*/
productName?: string
/**
* 品类
*/
category?: string
/**
* 品牌
*/
brand?: string
/**
* 单位
*/
unit?: string
/**
* 数量
*/
count?: number
/**
* 发货数量
*/
deliveryCount?: number
/**
* 入库数量
*/
storageCount?: number
/**
* 差异数量,(差异数量=发货数量-入库数量)
*/
differenceCount?: number
}[]
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34 * @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 17:08:04 * @LastEditTime: 2021-08-17 13:53:35
* @Description: * @Description:
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -10,67 +10,104 @@ import { Button } from 'antd'; ...@@ -10,67 +10,104 @@ import { Button } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { SettingOutlined } from '@ant-design/icons'; import { SettingOutlined } from '@ant-design/icons';
import moment from 'moment';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { EXCHANGE_GOODS_MANUAL_DELIVERY, EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT } from '../../constants'; import { EXCHANGE_GOODS_MANUAL_DELIVERY, EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT } from '../../constants';
import ManualDeliveryModal from '../../components/ManualDeliveryModal';
import DetailInfo from '../components/DetailInfo'; import DetailInfo from '../components/DetailInfo';
import ReturnDeliverDrawer, { ValuesType } from '../../components/DeliverDrawer';
const ExchangePrDeliverVerify: React.FC = () => { const ExchangePrDeliverVerify: React.FC = () => {
const { id } = usePageStatus(); const { id } = usePageStatus();
const [modalVisible, setModalVisible] = useState(false); const [visible, setVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = values => { const handleSubmit = (values: ValuesType) => {
if (!id) { if (!id) {
return; return;
} }
const {
productList,
returnDeliverAddress,
deliveryTime,
logisticsNameTxt,
logisticsOrderNo,
} = values;
setSubmitLoading(true); setSubmitLoading(true);
PublicApi.postAsReplaceGoodsManualReturnDeliveryGoods({ PublicApi.postAsReplaceGoodsManualReturnDeliveryGoods({
dataId: id, dataId: +id,
...values, deliveryAddress: `${returnDeliverAddress.fullAddress} ${returnDeliverAddress.name}/${returnDeliverAddress.phone}`,
productList: productList.map((item) => ({
productId: item.productId,
returnCount: +item.count,
})),
deliveryTime: moment(deliveryTime).valueOf(),
logisticsName: logisticsNameTxt,
logisticsOrderNo,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
history.goBack(); handleVisibleDrawer(false);
setTimeout(() => {
history.goBack();
}, 800);
} }
}).finally(() => { }).finally(() => {
setSubmitLoading(false); setSubmitLoading(false);
}); });
}; };
const handleVisible = flag => { const handleVisibleDrawer = flag => {
setModalVisible(!!flag); setVisible(!!flag);
}; };
return ( return (
<> <DetailInfo
<DetailInfo id={id}
id={id} headExtra={info => (
headExtra={info => ( <>
<> {(info && (info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY || info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT)) && (
{(info && (info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY || info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT)) && ( <Button
<Button type="default"
type="default" icon={<SettingOutlined />}
icon={<SettingOutlined />} onClick={() => handleVisibleDrawer(true)}
onClick={() => handleVisible(true)} >
> 退货发货
手工退货发货 </Button>
</Button> )}
)}
</> <ReturnDeliverDrawer
)} afterType={2}
target="/memberCenter/afterService/exchangeApplication/exchangePrDeliver" flowType="returnDeliver"
isEditRefundDeliver value={{
/> productList: (
info?.goodsDetailList
<ManualDeliveryModal .filter((item) => item.isNeedReturn && item.noDeliveryCount > 0)
title="退货发货处理" .map((item) => ({
visible={modalVisible} orderNo: item.orderNo,
confirmLoading={submitLoading} productId: item.productId,
onSubmit={handleSubmit} productName: item.productName,
onVisible={handleVisible} category: item.category,
isEdit={true} brand: item.brand,
/> unit: item.unit,
</> applyCount: item.replaceCount,
deliveryCount: item.deliveryCount,
noDeliveryCount: item.noDeliveryCount,
receiveCount: item.receiveCount,
subCount: item.subCount,
count: item.noDeliveryCount,
}))
),
}}
deliveryType={info?.returnGoodsAddress.deliveryType}
visible={visible}
onClose={() => handleVisibleDrawer(false)}
onSubmit={handleSubmit}
submitLoading={submitLoading}
/>
</>
)}
target="/memberCenter/afterService/exchangeApplication/exchangePrDeliver"
isEditRefundDeliver
/>
); );
}; };
......
...@@ -2,88 +2,22 @@ ...@@ -2,88 +2,22 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34 * @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-07 19:36:18 * @LastEditTime: 2021-08-17 17:20:05
* @Description: * @Description:
*/ */
import React, { useState } from 'react'; import React from 'react';
import { Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { SettingOutlined } from '@ant-design/icons';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { EXCHANGE_GOODS_MANUAL_DELIVERY, EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT } from '../../constants';
import ManualDeliveryModal from '../../components/ManualDeliveryModal';
import DetailInfo from '../components/DetailInfo'; import DetailInfo from '../components/DetailInfo';
const ExchangePrReceivedVerify: React.FC = () => { const ExchangePrReceivedVerify: React.FC = () => {
const { id } = usePageStatus(); const { id } = usePageStatus();
const [modalVisible, setModalVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = values => {
if (!id) {
return;
}
setSubmitLoading(true);
PublicApi.postAsReplaceGoodsConfirmManualReturnReceiveGoods({
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
}).finally(() => {
setSubmitLoading(false);
});
};
const handleVisible = flag => {
setModalVisible(!!flag);
};
return ( return (
<> <DetailInfo
<DetailInfo id={id}
id={id} target="/memberCenter/afterService/exchangeManage/exchangePrReceived"
headExtra={info => { isEditRefundDeliver
const detailed = info || {}; />
// @ts-ignore
const { manualReturnGoodsAddress = {} } = detailed;
return (
<>
{(info && (info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY || info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT)) && (
<>
<Button
type="default"
icon={<SettingOutlined />}
onClick={() => handleVisible(true)}
>
手工确认退货收货
</Button>
<ManualDeliveryModal
key="2"
value={{
deliveryAddressTxt: manualReturnGoodsAddress?.deliveryAddress,
deliveryTime: manualReturnGoodsAddress?.deliveryTime,
logisticsOrderNo: manualReturnGoodsAddress?.logisticsOrderNo,
logisticsNameTxt: manualReturnGoodsAddress?.logisticsName,
}}
visible={modalVisible}
confirmLoading={submitLoading}
onSubmit={handleSubmit}
onVisible={handleVisible}
isEdit={false}
/>
</>
)}
</>
)
}}
target="/memberCenter/afterService/exchangeManage/exchangePrReceived"
isEditRefundDeliver
/>
</>
); );
}; };
......
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