Commit f41afe39 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents a9d64e94 9eef4761
......@@ -2,10 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 14:23:40
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-09 16:53:25
* @LastEditTime: 2021-08-18 11:04:54
* @Description: 地址单选框组
*/
import React, { useState, useEffect, useMemo } from 'react';
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { Radio, Button, Modal, message, RadioChangeEvent } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
......@@ -86,6 +86,9 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
const context = React.useContext(AddressSelectContext);
// 记录是否是新增或编辑操作
const actionFlagRef = useRef<boolean>(false);
const triggerChange = (value: AddressValueType) => {
if (onChange) {
onChange(value);
......@@ -123,7 +126,7 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
triggerChange(undefined);
}
if (isDefaultAddress && defaultItem) {
if (isDefaultAddress && defaultItem && !actionFlagRef.current) {
const { shipperName, receiverName, ...rest } = defaultItem;
const next = {
name: shipperName || receiverName,
......@@ -141,8 +144,15 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
});
};
const refresh = () => {
context ? context?.refresh() : getAddressList();
const refresh = (actionFlag?: boolean) => {
if (context) {
context?.refresh(actionFlag);
} {
// 重新获取列表,把新添加的内容加载出来
// 不触发默认值提交
actionFlagRef.current = true;
getAddressList();
}
};
useEffect(() => {
......@@ -224,7 +234,7 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
try {
const res = addressType === 2 ? await PublicApi.getLogisticsShipperAddressGet({ id: `${id}`}) : await PublicApi.getLogisticsReceiverAddressGet({ id: `${id}`});
if (res.code === 1000) {
addressType === 2
const updateRes = addressType === 2
? await PublicApi.postLogisticsShipperAddressUpdate({
...(res.data as GetLogisticsShipperAddressGetResponse),
isDefault: 1,
......@@ -233,6 +243,9 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
...(res.data as GetLogisticsReceiverAddressGetResponse),
isDefault: 1,
});
if (updateRes.code === 1000) {
refresh(true);
}
}
} catch (error) {
console.warn(error);
......
......@@ -256,7 +256,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
name: values.name,
phone: values.phone,
};
// 重新获取列表,新添加的内容加载出来
// 重新获取列表,新添加的内容加载出来
// 不触发默认值提交
actionFlagRef.current = true;
getAddressList();
......@@ -295,7 +295,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
name: values.name,
phone: values.phone,
};
// 重新获取列表,新添加的内容加载出来
// 重新获取列表,新添加的内容加载出来
// 不触发默认值提交
actionFlagRef.current = true;
getAddressList();
......@@ -437,6 +437,11 @@ const AddressSelect: React.FC<IProps> = (props) => {
}
};
const onRefresh = (actionFlag?: boolean) => {
actionFlagRef.current = !!actionFlag;
getAddressList();
};
const options = useMemo(() => {
return list.map((item) => ({
value: item.id,
......@@ -448,7 +453,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
<AddressSelectContextProvider
value={{
addressList: list,
refresh: getAddressList,
refresh: onRefresh,
}}
>
<div className={styles['address-select']}>
......
......@@ -15,5 +15,5 @@ export interface AddressSelectContextProps {
/**
* 重新加载列表
*/
refresh: () => void,
refresh: (actionFlag?: boolean) => void,
}
\ No newline at end of file
......@@ -2,11 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2021-08-17 10:22:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-17 11:03:30
* @LastEditTime: 2021-08-17 16:11:31
* @Description: 退货发货抽屉
*/
import React from 'react';
import React, { useEffect } from 'react';
import {
Drawer,
Button,
......@@ -130,11 +130,13 @@ type ProductListItemType = {
count: number,
}
export type AfterType = 2 | 3
interface IProps {
/**
* 售后类型,2 换货,3 退货
*/
afterType: 2 | 3,
afterType: AfterType,
/**
* 流程类型,'returnDeliver' 退货发货,exchangeDeliver 换货发货
* 换货流程包含两个退货步骤,一是 退货发货,二是 换货发货
......@@ -153,6 +155,22 @@ interface IProps {
* 商品列表
*/
productList: ProductListItemType[],
/**
* 发货地址id
*/
returnDeliverAddress?: number,
/**
* 发货时间
*/
deliveryTime?: string,
/**
* 物流单号
*/
logisticsOrderNo?: string,
/**
* 物流公司id
*/
logisticsName?: number | string,
},
/**
* 配送方式
......@@ -170,6 +188,14 @@ interface IProps {
* 确认按钮 loading
*/
submitLoading: boolean,
/**
* 是否可编辑商品相关,默认为 true
*/
ediableProduct?: boolean,
/**
* 是否可编辑物流相关,默认为 true
*/
ediableLogistics?: boolean,
}
const DeliverDrawer: React.FC<IProps> = (props) => {
......@@ -182,6 +208,8 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
onSubmit,
onClose,
submitLoading,
ediableProduct = true,
ediableLogistics = true,
} = props;
// 获取物流公司
......@@ -207,6 +235,18 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
});
};
useEffect(() => {
formActions.setFieldState('productList.*.count', (fieldState) => {
fieldState.editable = ediableProduct;
});
}, [ediableProduct]);
useEffect(() => {
formActions.setFieldState('LOGISTICS_LAYOUT.*', (fieldState) => {
fieldState.editable = ediableLogistics;
});
}, [ediableLogistics]);
const handleClose = () => {
if (onClose) {
onClose();
......@@ -258,7 +298,9 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
effects={($, { setFieldValue, getFieldValue, setFieldState }) => {
const linkage = useLinkageUtils();
useAsyncSelect('logisticsName', fetchLogisticsCompany, ['label', 'value']);
if (!value.deliveryTime) {
useAsyncSelect('logisticsName', fetchLogisticsCompany, ['label', 'value']);
}
onFormInit$().subscribe(() => {
// 自提隐藏物流编号、物流公司
......
......@@ -107,7 +107,7 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
},
}
},
MEGA_LAYOUT: {
LOGISTICS_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-08 14:53:46
* @LastEditTime: 2021-08-18 10:42:45
* @Description: 换货发货统计、换货发货明细
*/
import React, { useState } from 'react';
......@@ -102,14 +102,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
{
title: '订单号',
dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
},
{
title: '商品ID',
......@@ -176,14 +168,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
{
title: '订单号',
dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
},
{
title: '商品ID',
......@@ -296,7 +280,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
>
{radioValue === '1' ? (
<PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`}
rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={summary}
columns={summaryColumns}
loading={false}
......@@ -327,11 +311,26 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
)}
</Descriptions.Item>
<Descriptions.Item label="物流单号">
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
{!isPurchaser ? (
<>
{item.logisticsId ? (
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
)}
</>
) : (
item.logisticsOrderNo
)}
</Descriptions.Item>
<Descriptions.Item label="换货入库单号">
{isPurchaser ? (
......@@ -358,7 +357,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
<Descriptions.Item label="内部状态">
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item>
<Descriptions.Item contentStyle={{ display: 'block', textAlign: 'right' }}>
{(
isEdit &&
!isPurchaser &&
......@@ -414,7 +413,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
</div>
<PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`}
rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={item.detailList}
columns={detailedColumns}
loading={false}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-30 18:19:05
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-16 19:38:10
* @LastEditTime: 2021-08-18 10:43:40
* @Description:
*/
export interface SummaryData {
......@@ -58,6 +58,10 @@ export interface Detailed {
*/
deliveryId: number
/**
* 退货发货单据Id
*/
deliveryNoId: number
/**
* 批次
*/
batch: number
......
......@@ -2,8 +2,8 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-09 18:09:01
* @Description: 换货收货统计、换货发货明细
* @LastEditTime: 2021-08-18 10:41:43
* @Description: 换货退货收货统计、换货退货发货明细
*/
import React, { useState } from 'react';
import {
......@@ -104,14 +104,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
{
title: '订单号',
dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
},
{
title: '商品ID',
......@@ -178,14 +170,6 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
{
title: '订单号',
dataIndex: 'orderNo',
render: (text, record) => (
<a
href={`${target}/orderDetail?orderNo=${text}`}
target="_blank"
>
{text}
</a>
),
},
{
title: '商品ID',
......@@ -305,7 +289,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
>
{radioValue === '1' ? (
<PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`}
rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={summary}
columns={summaryColumns}
loading={false}
......@@ -314,7 +298,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
) : null}
{radioValue === '2' ? (
<>
<Tabs>
<Tabs defaultActiveKey={detailed ? `${detailed[detailed.length - 1].batch}` : ''}>
{detailed.map((item) => (
<TabPane
tab={`第 ${item.batch} 批次`}
......@@ -336,11 +320,27 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
)}
</Descriptions.Item>
<Descriptions.Item label="物流单号">
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
{isPurchaser ? (
<>
{item.logisticsId ? (
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
)}
</>
) : (
item.logisticsOrderNo
)}
</Descriptions.Item>
<Descriptions.Item label="退货入库单号">
{!isPurchaser ? (
......@@ -367,7 +367,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Descriptions.Item label="内部状态">
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item>
<Descriptions.Item contentStyle={{ display: 'block', textAlign: 'right' }}>
{(
isEdit &&
isPurchaser &&
......@@ -423,7 +423,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
</div>
<PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`}
rowKey={() => Math.random().toFixed(16).slice(2, 10)}
dataSource={item.detailList}
columns={detailedColumns}
loading={false}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-16 15:02:26
* @LastEditTime: 2021-08-17 16:30:36
* @Description: 退货收货统计、退货发货明细
*/
import React, { useState } from 'react';
......@@ -34,6 +34,7 @@ import {
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
} from '../../constants';
import ReturnDeliverDrawer, { AfterType } from '../DeliverDrawer';
import styles from './index.less';
const { confirm } = Modal;
......@@ -84,6 +85,16 @@ interface ReturnInfoProps extends MellowCardProps {
* 是否可编辑
*/
isEdit?: boolean;
/**
* 售后类型,2 换货,3 退货
*/
afterType: AfterType,
/**
* 退货配送方式
*/
deliveryType: number,
};
const ReturnInfo: React.FC<ReturnInfoProps> = ({
......@@ -96,9 +107,14 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
innerStatus,
target,
isEdit = false,
afterType,
deliveryType,
...rest
}) => {
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
const [visible, setVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [currentDetailed, setCurrentDetailed] = useState<Detailed | null>(null);
const summaryColumns: EditableColumns[] = [
{
......@@ -218,17 +234,13 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
},
];
const handleConfirmReturnDeliver = (id) => {
if (onConfirmReturnDeliver) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `是否确认退货发货?`,
onOk() {
return onConfirmReturnDeliver(id);
},
});
}
const handleVisibleDrawer = flag => {
setVisible(!!flag);
};
const handleConfirmReturnDeliver = (record: Detailed) => {
setCurrentDetailed(record);
handleVisibleDrawer(true);
};
const handleConfirmReturnReceive = (id) => {
......@@ -261,6 +273,15 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
setRadioValue(value);
};
const handleReturnDeliverSubmit = () => {
if (onConfirmReturnDeliver) {
setSubmitLoading(true);
onConfirmReturnDeliver(currentDetailed.deliveryId).finally(() => {
setSubmitLoading(false);
});
}
};
const options = [
{
label: `退货${!isPurchaser ? '收货' : '发货'}统计`,
......@@ -320,19 +341,25 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
)}
</Descriptions.Item>
<Descriptions.Item label="物流单号">
{item.logisticsId ? (
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
{isPurchaser ? (
<>
{item.logisticsId ? (
<Link
to={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?id=${item.logisticsId}`}
>
{item.logisticsOrderNo}
</Link>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
)}
</>
) : (
<a
href={`https://www.kuaidi100.com/chaxun?nu=${item.logisticsOrderNo}`}
target="_blank"
>
{item.logisticsOrderNo}
</a>
item.logisticsOrderNo
)}
</Descriptions.Item>
<Descriptions.Item label="退货入库单号">
......@@ -372,7 +399,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmReturnDeliver(item.deliveryId)}
onClick={() => handleConfirmReturnDeliver(item)}
>
确认退货发货
</a>
......@@ -427,6 +454,38 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
</Tabs>
</>
) : null}
<ReturnDeliverDrawer
afterType={afterType}
flowType="returnDeliver"
value={{
productList: currentDetailed?.detailList?.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
applyCount: item.count,
deliveryCount: item.deliveryCount,
noDeliveryCount: item.count - item.deliveryCount,
receiveCount: item.storageCount,
subCount: item.differenceCount,
count: item.deliveryCount,
})),
returnDeliverAddress: 0, // 缺少
deliveryTime: currentDetailed?.deliveryTime,
logisticsOrderNo: currentDetailed?.logisticsOrderNo,
logisticsName: currentDetailed?.logisticsName,
}}
deliveryType={deliveryType}
visible={visible}
onClose={() => handleVisibleDrawer(false)}
onSubmit={handleReturnDeliverSubmit}
submitLoading={submitLoading}
ediableProduct={false}
ediableLogistics={!!currentDetailed?.deliveryTime}
/>
</MellowCard>
);
};
......
......@@ -52,6 +52,49 @@ export interface SummaryData {
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 {
/**
* 退货发货单号Id
......@@ -108,46 +151,5 @@ export interface Detailed {
/**
* 发货明细 ,DeliveryGoodsDetailVO
*/
detailList: {
/**
* 订单号
*/
orderNo?: string
/**
* 商品id
*/
productId?: string
/**
* 商品名称
*/
productName?: string
/**
* 品类
*/
category?: string
/**
* 品牌
*/
brand?: string
/**
* 单位
*/
unit?: string
/**
* 数量
*/
count?: number
/**
* 发货数量
*/
deliveryCount?: number
/**
* 入库数量
*/
storageCount?: number
/**
* 差异数量,(差异数量=发货数量-入库数量)
*/
differenceCount?: number
}[]
detailList: DetailedListItem[]
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 17:08:04
* @LastEditTime: 2021-08-17 13:53:35
* @Description:
*/
import React, { useState } from 'react';
......@@ -10,67 +10,104 @@ import { Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { SettingOutlined } from '@ant-design/icons';
import moment from 'moment';
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 ReturnDeliverDrawer, { ValuesType } from '../../components/DeliverDrawer';
const ExchangePrDeliverVerify: React.FC = () => {
const { id } = usePageStatus();
const [modalVisible, setModalVisible] = useState(false);
const [visible, setVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = values => {
const handleSubmit = (values: ValuesType) => {
if (!id) {
return;
}
const {
productList,
returnDeliverAddress,
deliveryTime,
logisticsNameTxt,
logisticsOrderNo,
} = values;
setSubmitLoading(true);
PublicApi.postAsReplaceGoodsManualReturnDeliveryGoods({
dataId: id,
...values,
dataId: +id,
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 => {
if (res.code === 1000) {
history.goBack();
handleVisibleDrawer(false);
setTimeout(() => {
history.goBack();
}, 800);
}
}).finally(() => {
setSubmitLoading(false);
});
};
const handleVisible = flag => {
setModalVisible(!!flag);
const handleVisibleDrawer = flag => {
setVisible(!!flag);
};
return (
<>
<DetailInfo
id={id}
headExtra={info => (
<>
{(info && (info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY || info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT)) && (
<Button
type="default"
icon={<SettingOutlined />}
onClick={() => handleVisible(true)}
>
手工退货发货
</Button>
)}
</>
)}
target="/memberCenter/afterService/exchangeApplication/exchangePrDeliver"
isEditRefundDeliver
/>
<ManualDeliveryModal
title="退货发货处理"
visible={modalVisible}
confirmLoading={submitLoading}
onSubmit={handleSubmit}
onVisible={handleVisible}
isEdit={true}
/>
</>
<DetailInfo
id={id}
headExtra={info => (
<>
{(info && (info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY || info.taskType === EXCHANGE_GOODS_MANUAL_DELIVERY_CONTRACT)) && (
<Button
type="default"
icon={<SettingOutlined />}
onClick={() => handleVisibleDrawer(true)}
>
退货发货
</Button>
)}
<ReturnDeliverDrawer
afterType={2}
flowType="returnDeliver"
value={{
productList: (
info?.goodsDetailList
.filter((item) => item.isNeedReturn && item.noDeliveryCount > 0)
.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
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 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-07 19:36:18
* @LastEditTime: 2021-08-17 17:20:05
* @Description:
*/
import React, { useState } from 'react';
import { Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { SettingOutlined } from '@ant-design/icons';
import React from 'react';
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';
const ExchangePrReceivedVerify: React.FC = () => {
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 (
<>
<DetailInfo
id={id}
headExtra={info => {
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
/>
</>
<DetailInfo
id={id}
target="/memberCenter/afterService/exchangeManage/exchangePrReceived"
isEditRefundDeliver
/>
);
};
......
......@@ -608,6 +608,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEditRefundDeliver}
afterType={3}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 15:53:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-12 16:28:45
* @LastEditTime: 2021-08-18 09:54:52
* @Description: 新增退货发货单
*/
import React, { useState } from 'react';
......@@ -59,7 +59,7 @@ const ReturnAddDeliverBill = () => {
returnId: applyId,
deliveryTime: values.createTime ? moment(values.createTime).valueOf() : 0,
orderAbstract: values.digest,
remark: '',
remark: values.remark,
inventoryName: values.inventoryName,
inventoryRole: values.inventoryRole,
detailList: values.billDetails.map((item) => ({
......
import React, { useState } from 'react';
import { Button, Space, Modal } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { SettingOutlined, RollbackOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-18 11:24:25
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const { confirm } = Modal;
const ReturnPrConfirmBackVerify: React.FC = () => {
const { id } = usePageStatus();
const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = (info) => {
if (!id) {
return;
}
if (
info &&
info.returnDeliveryGoodsList &&
info.returnDeliveryGoodsList.length
) {
// 未退货发货数量有大于 0 时
if (
info.returnDeliveryGoodsList.some(item => {
return item.detailList.some(good => good.count - good.deliveryCount > 0)
})
) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `您还有未退货发货的商品,是否确认全部退货发货都已完成?`,
onOk() {
return PublicApi.postAsReturnGoodsConfirmAllReturnGoodsReceipt({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
}
// 未退货发货数量全部小于或等于 0 时
if (
info.returnDeliveryGoodsList.every(item => {
return item.detailList.every(good => good.count - good.deliveryCount <= 0)
})
) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `是否确认全部退货发货单已收到回单?`,
onOk() {
return PublicApi.postAsReturnGoodsConfirmAllReturnGoodsReceipt({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
}
}
};
const handleDeliverAgain = (info) => {
if (
info &&
info.returnDeliveryGoodsList &&
info.returnDeliveryGoodsList.length
) {
// 未退货发货数量全部小于或等于 0 时
if (
info.returnDeliveryGoodsList.every(item => {
return item.detailList.every(good => good.count - good.deliveryCount <= 0)
})
) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `您商品都已退货发货,是否确认还需要继续退货发货?`,
onOk() {
return PublicApi.postAsReturnGoodsContinueReturnDeliveryGoods({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
}
// 未退货发货数量有大于 0 时
if (
info.returnDeliveryGoodsList.some(item => {
return item.detailList.some(good => good.count - good.deliveryCount > 0)
})
) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `是否继续退货发货?`,
onOk() {
return PublicApi.postAsReturnGoodsContinueReturnDeliveryGoods({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
}
}
};
return (
<>
<DetailInfo
id={id}
headExtra={detailInfo => (
<Space>
<Button
type="default"
icon={<SettingOutlined />}
onClick={() => handleSubmit(detailInfo)}
>
确认全部退货发货单已收到回单
</Button>
<Button
type="default"
icon={<RollbackOutlined />}
onClick={() => handleDeliverAgain(detailInfo)}
>
继续退货发货
</Button>
</Space>
)}
target="/memberCenter/afterService/returnApplication/returnPrConfirmBack"
isEditRefundDeliver
/>
......
......@@ -647,6 +647,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEditRefundDeliver}
afterType={3}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......
......@@ -60,7 +60,7 @@ const ReturnAddWarehouseBill = () => {
returnId: applyId,
storageTime: values.createTime ? moment(values.createTime).valueOf() : 0,
orderAbstract: values.digest,
remark: '',
remark: values.remark,
inventoryName: values.inventoryName,
inventoryRole: values.inventoryRole,
detailList: values.billDetails.map((item) => ({
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-07-09 11:09:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-27 18:11:59
* @LastEditTime: 2021-08-18 11:47:31
* @Description: 会员详情信息
*/
import React, { Ref } from 'react';
......@@ -116,8 +116,6 @@ const MemberProfile: React.FC<IProps> = (props) => {
qualitiesRef,
} = props;
const depositDetails = dataSource?.depositDetailTexts || dataSource?.depositDetails || [];
const anchorsArr = [
{
key: 'verifySteps',
......@@ -148,8 +146,11 @@ const MemberProfile: React.FC<IProps> = (props) => {
: []
),
(
depositDetails
&& depositDetails.length
dataSource
&& (
dataSource.depositDetailTexts?.length
|| dataSource.depositDetails?.length
)
? {
key: 'incomingInfo',
name: '入库信息',
......@@ -329,12 +330,12 @@ const MemberProfile: React.FC<IProps> = (props) => {
{/* 入库信息 */}
{(
depositDetails.length > 0
dataSource?.depositDetailTexts?.length > 0
&& !editableDeposit
) ? (
<Col span={24}>
<MemberDocIncomingInfo
dataSource={depositDetails}
dataSource={dataSource?.depositDetailTexts || []}
showNew={showNew}
id="incomingInfo"
/>
......@@ -343,12 +344,12 @@ const MemberProfile: React.FC<IProps> = (props) => {
{/* 入库信息,可编辑的 */}
{(
depositDetails.length > 0
dataSource?.depositDetails?.length > 0
&& editableDeposit
) ? (
<Col span={24}>
<MemberDocIncomingInfoForm
groups={dataSource?.depositDetails}
groups={dataSource?.depositDetails || []}
ref={depositRef}
onInputChange={handleDepositChange}
id="incomingInfo"
......
......@@ -146,4 +146,8 @@ export type BillSubmitValuesType = RelatedInfoType & {
* 关联对应单据会员名称
*/
memberName: string,
/**
* 备注
*/
remark: string,
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 13:59:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-16 15:28:50
* @LastEditTime: 2021-08-18 09:53:05
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -187,6 +187,17 @@ const createSchema = (billType: number): ISchema => {
},
],
},
remark: {
type: 'string',
title: '备注',
'x-component': 'textarea',
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 200,
}
],
},
// 收集值用
inventoryName: {
type: 'string',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-11 14:20:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-11 15:28:33
* @LastEditTime: 2021-08-18 10:44:56
* @Description: 解释 Modal
*/
import React from 'react';
......@@ -67,6 +67,7 @@ const ExplainModal: React.FC<ExplainModalProps> = (props) => {
confirmLoading={confirmLoading}
onOk={() => modalFormActions.submit()}
onCancel={handleClose}
destroyOnClose
>
<NiceForm
effects={() => {
......
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