Commit a276facc authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加售后退货待审核退货申请相关

parent 3505d197
......@@ -28,7 +28,7 @@ const returnManageRoute = {
{
path: '/afterService/returnManage/query/orderDetail',
name: 'orderDetail',
component: '@/pages/orderSystem/orderDetail',
component: '@/pages/orderManage/orderSystem/orderDetail',
hideInMenu: true,
hidePageHeader: true
},
......@@ -58,10 +58,32 @@ const returnManageRoute = {
{
path: '/afterService/returnManage/returnPrReturn/orderDetail',
name: 'orderDetail',
component: '@/pages/orderSystem/orderDetail',
component: '@/pages/orderManage/orderSystem/orderDetail',
hideInMenu: true,
hidePageHeader: true
},
// 待审核退货申请单
{
path: '/afterService/returnManage/returnPrVerify',
name: 'returnPrVerify',
component: '@/pages/afterService/returnManage/returnPrVerify/index',
},
// 待审核退货申请单-详情
{
path: '/afterService/returnManage/returnPrVerify/detail',
name: 'returnPrVerifyDetail',
component: '@/pages/afterService/returnManage/returnPrVerify/detail',
hideInMenu: true,
hidePageHeader: true,
},
// 待审核退货申请单-审核
{
path: '/afterService/returnManage/returnPrVerify/verify',
name: 'returnVerify',
component: '@/pages/afterService/returnManage/returnPrVerify/verify',
hideInMenu: true,
hidePageHeader: true,
},
],
};
......
......@@ -256,6 +256,9 @@ export default {
'menu.returnManage.returnPrReturn': '待退款',
'menu.returnManage.returnPrReturnDetail': '待退款详情',
'menu.returnManage.prReturnVerify': '退款',
'menu.returnManage.returnPrVerify': '待审核退货申请单',
'menu.returnManage.returnPrVerifyDetail': '待审核退货申请单详情',
'menu.returnManage.returnVerify': '审核退货申请单',
'menu.returnManage.orderDetail': '查看订单',
// 营销能力
......
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import {
RETURN_OUTER_STATUS_TAG_MAP,
} from '../../constants';
const createColumns: (parentPath: string) => ColumnType<any>[] = (parentPath) => ([
{
title: '申请单号',
dataIndex: 'applyNo',
align: 'center',
render: (text, record) => (
<>
<EyePreview
url={`${parentPath}/detail?id=${record.returnId}`}
>
{text}
</EyePreview>
</>
),
},
{
title: '申请单摘要',
dataIndex: 'applyAbstract',
align: 'center',
},
{
title: '采购会员',
dataIndex: 'consumerName',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplierName',
align: 'center',
},
{
title: '退款金额',
dataIndex: 'refundAmount',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'applyTime',
align: 'center',
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type={RETURN_OUTER_STATUS_TAG_MAP[record.outerStatus]} title={text} />
),
},
]);
export default createColumns;
import React, { useState, useEffect } from 'react';
export type ResponseType<P> = {
data: P,
code: number
}
export interface IConfig<P> {
/**
* 请求详情方法
*/
fetchDetail: () => Promise<ResponseType<P>>;
/**
* fetch callback
*/
fetchCallback?: (data: P) => void;
}
const FetchDetailHoc = <P, T extends {}>(config: IConfig<P>, WrapComponent: React.ComponentType<T>) => {
const { fetchDetail, fetchCallback } = config;
const [detail, setDetail] = useState<P>();
const [loading, setLoading] = useState(false);
const getDetail = () => {
if (fetchDetail) {
setLoading(true);
fetchDetail().then((res) => {
if (res.code === 1000) {
setDetail(res.data);
fetchCallback?.(res.data);
}
}).finally(() => {
setLoading(false);
});
}
};
useEffect(() => {
getDetail();
}, []);
return React.useMemo(() => {
return (props: Omit<T, ('dataSource' | 'loading')>): JSX.Element => {
return (
<div>
<WrapComponent {...props as any} dataSource={detail} loading={loading} />
</div>
);
}
}, [WrapComponent, detail, loading]);
};
export default FetchDetailHoc;
\ No newline at end of file
import React, { useState } from 'react';
import { Tooltip, Button } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import ReturnInfoDrawer, { OrderInfoType, PayListItemType } from '../ReturnInfoDrawer';
export type ReturnProductListItemType = {
/**
* 退货详情id
*/
returnDetailId: number
/**
* 退货商品id
*/
returnGoodsId: number
/**
* 订单记录id
*/
orderRecordId: number
/**
* 订单id
*/
orderId: number
/**
* 订单号
*/
orderNo: string
/**
* 商品id物料编号
*/
productId: string
/**
* 商品名称物料名称、规格
*/
productName: string
/**
* 品类
*/
category: string
/**
* 品牌
*/
brand: string
/**
* 单位
*/
unit: string
/**
* skuId
*/
skuId: number
/**
* sku图片
*/
skuPic: string
/**
* 采购数量
*/
purchaseCount: number
/**
* 采购单价
*/
purchasePrice: number
/**
* 采购金额
*/
purchaseAmount: number
/**
* 支付金额
*/
payAmount: number
/**
* 退货数量
*/
returnCount: number
/**
* 已退货发货(发货数量)
*/
deliveryCount: number
/**
* 退货未发货
*/
noDeliveryCount: number
/**
* 已退货收货(收货数量)
*/
receiveCount: number
/**
* 差异数量
*/
subCount: number
/**
* 退款金额
*/
refundAmount: number
/**
* 退货原因
*/
returnReason: string
/**
* 是否需要退货:0.否1.是
*/
isNeedReturn: number
/**
* 是否需要退货
*/
needReturnName: string
/**
* 是否含税:0-否,1-是
*/
isHasTax: number
/**
* 税率
*/
taxRate: number
/**
* 支付信息 ,ReturnGoodsPayVO
*/
payList: PayListItemType[]
/**
* 商品规格
*/
type: string
/**
* 关联商品ID
*/
associatedProductId: string
/**
* 关联商品名称、规格
*/
associatedProductName: string
/**
* 关联商品规格
*/
associatedType: string
/**
* 关联商品品类
*/
associatedCategory: string
/**
* 关联商品品牌
*/
associatedBrand: string
/**
* 关联商品单位
*/
associatedUnit: string
/**
* 合同id
*/
contractId: number
/**
* 合同编号
*/
contractNo: string
}
interface ReturnProductListProps {
/**
* 数据
*/
dataSource: ReturnProductListItemType[],
/**
* 是否加载中
*/
loading?: boolean,
}
const ReturnProductList: React.FC<ReturnProductListProps> = (props: ReturnProductListProps) => {
const { dataSource, loading } = props;
const [orderInfo, setOrderInfo] = useState<OrderInfoType | null>(null);
const [visibleReturnInfo, setVisibleReturnInfo] = useState(false);
const handleCheckOrderDetial = (record: ReturnProductListItemType) => {
setOrderInfo({
orderNo: record.orderNo,
productName: record.productName,
category: record.category,
brand: record.brand,
unit: record.unit,
purchaseCount: record.purchaseCount,
purchasePrice: record.purchasePrice,
purchaseAmount: record.purchaseAmount,
returnCount: record.returnCount,
returnReason: record.returnReason,
payList: record.payList.map(item => ({
...item,
payWayTxt: item.payWayName,
channelTxt: item.channelName,
payRatio: item.payRatio * 100,
})),
refundAmount: record.refundAmount,
});
setVisibleReturnInfo(true);
};
const columns: EditableColumns<ReturnProductListItemType>[] = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
},
{
title: '采购单价',
dataIndex: 'purchasePrice',
align: 'center',
},
{
title: '采购金额',
dataIndex: 'purchaseAmount',
align: 'center',
},
{
title: '已支付金额',
dataIndex: 'payAmount',
align: 'center',
},
{
title: '退货数量',
dataIndex: 'returnCount',
align: 'center',
},
{
title: '退货金额',
dataIndex: 'refundAmount',
align: 'center',
},
{
title: (
<>
<span style={{ marginRight: 8 }}>是否需要退货</span>
<Tooltip title="如果商品因为缺陷原因,无法再退回加工后重新使用,可选择不需要退货,选择后,采购方无须退回不良品。">
<QuestionCircleOutlined />
</Tooltip>
</>
),
dataIndex: 'needReturnName',
align: 'center',
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => handleCheckOrderDetial(record)}
>
查看详情
</Button>
</>
),
},
];
return (
<>
<MellowCard
title="退货商品"
>
<PolymericTable
rowKey="orderRecordId"
dataSource={dataSource}
columns={columns}
loading={!!loading}
pagination={null}
/>
</MellowCard>
<ReturnInfoDrawer
visible={visibleReturnInfo}
orderInfo={orderInfo!}
onClose={() => setVisibleReturnInfo(false)}
/>
</>
);
};
export default ReturnProductList;
import React, { Suspense } from 'react';
import {
PageHeader,
Descriptions,
Spin,
Row,
Col,
Badge,
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import {
RETURN_OUTER_STATUS_FINISHED,
RETURN_OUTER_STATUS_TO_BE_REFUNDED,
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED,
RETURN_OUTER_STATUS_NOT_RECEIVED,
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED,
} from '@/constants';
import { findLastIndexFlowState } from '@/utils';
import {
RETURN_OUTER_STATUS_TAG_MAP,
RETURN_INNER_STATUS_BADGE_MAP,
} from '../../constants';
import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag';
import AuditProcess from '@/components/AuditProcess';
import { FlowRecordsProps } from '../FlowRecords';
import { DetailType } from './interface';
const ReturnAnalysis = React.lazy(() => import('../ReturnAnalysis'));
const ReturnDetailInfo = React.lazy(() => import('../ReturnDetailInfo'));
const FileList = React.lazy(() => import('../FileList'));
const ReturnAddressInfo = React.lazy(() => import('../ReturnAddressInfo'));
const Score = React.lazy(() => import('../Score'));
const FlowRecords = React.lazy(() => import('../FlowRecords'));
const ReturnProductList = React.lazy(() => import('../ReturnProductList'));
interface ReturnProfileProps {
/**
* 数据
*/
dataSource: DetailType,
/**
* 是否加载中
*/
loading: boolean,
/**
* 获取外部流转记录方法
*/
fetchOuterHistory?: FlowRecordsProps['fetchOuterHistory'],
/**
* 是否是采购商
*/
isPurchaser?: boolean,
/**
* 拓展区域
*/
extra?: (info: DetailType) => React.ReactNode,
}
const ReturnProfile: React.FC<ReturnProfileProps> = (props: ReturnProfileProps) => {
const {
dataSource,
loading,
fetchOuterHistory,
isPurchaser,
extra,
} = props;
return (
<Spin spinning={loading}>
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
aloneTxt: '单',
name: `申请单号:${dataSource && dataSource.applyNo ? dataSource.applyNo : ''}`,
}}
/>
}
extra={extra ? extra(dataSource) : null}
>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="申请单摘要">{dataSource?.applyAbstract}</Descriptions.Item>
<Descriptions.Item label="采购会员">{dataSource?.consumerName}</Descriptions.Item>
<Descriptions.Item label="单据时间">{dataSource?.applyTime}</Descriptions.Item>
<Descriptions.Item label="外部状态">
<StatusTag type={RETURN_OUTER_STATUS_TAG_MAP[dataSource?.outerStatus]} title={dataSource?.outerStatusName} />
</Descriptions.Item>
<Descriptions.Item label="内部状态">
<Badge color={RETURN_INNER_STATUS_BADGE_MAP[dataSource?.innerStatus]} text={dataSource?.innerStatusName} />
</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<Row gutter={[24, 24]}>
<Col span={24}>
<Suspense fallback={null}>
<AuditProcess
outerVerifySteps={
dataSource && dataSource.outerTaskList ?
dataSource.outerTaskList.map(item => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
isExecute: item.isExecute,
})) :
[]
}
outerVerifyCurrent={findLastIndexFlowState(dataSource?.outerTaskList)}
innerVerifySteps={
dataSource && dataSource.innerTaskList ?
dataSource.innerTaskList.map(item => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
isExecute: item.isExecute,
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(dataSource?.innerTaskList)}
/>
</Suspense>
</Col>
<Col span={24}>
<Suspense fallback={null}>
<ReturnProductList
dataSource={dataSource?.goodsDetailList}
/>
</Suspense>
</Col>
<Col span={24}>
<Suspense fallback={null}>
{/* 退货发货信息 */}
<ReturnAnalysis
summary={dataSource && dataSource.returnStatisticsList ? dataSource.returnStatisticsList : []}
detailed={dataSource && dataSource.returnDeliveryGoodsList ? dataSource.returnDeliveryGoodsList : []}
/>
</Suspense>
</Col>
{/* 退款明细信息 */}
{
dataSource && (
dataSource.outerStatus === RETURN_OUTER_STATUS_TO_BE_REFUNDED ||
dataSource.outerStatus === RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED ||
dataSource.outerStatus === RETURN_OUTER_STATUS_NOT_RECEIVED ||
dataSource.outerStatus === RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED ||
dataSource.outerStatus === RETURN_OUTER_STATUS_FINISHED
) && (
<Col span={24}>
<Suspense fallback={null}>
<ReturnDetailInfo
dataSource={dataSource && dataSource.refundList ? dataSource.refundList : []}
isPurchaser={isPurchaser}
outerStatus={dataSource?.outerStatus}
purchaserId={dataSource?.memberId}
purchaserRoleId={dataSource?.roleId}
isEdit={false}
/>
</Suspense>
</Col>
)
}
<Col span={24}>
<Row
gutter={24}
>
<Col span={dataSource && dataSource.outerStatus === RETURN_OUTER_STATUS_FINISHED ? 6 : 9}>
<Suspense fallback={null}>
<FileList fileList={dataSource?.faultFileList} />
</Suspense>
</Col>
<Col span={dataSource && dataSource.outerStatus === RETURN_OUTER_STATUS_FINISHED ? 12 : 15}>
<Suspense fallback={null}>
<ReturnAddressInfo
deliveryAddress={{
id: dataSource?.returnGoodsAddress?.receiveId,
name: dataSource?.returnGoodsAddress?.receiveUserName,
phone: dataSource?.returnGoodsAddress?.receiveUserTel,
fullAddress: dataSource?.returnGoodsAddress?.receiveAddress,
}}
shippingAddress={{
deliveryType: dataSource?.returnGoodsAddress?.deliveryType,
name: dataSource?.returnGoodsAddress?.sendUserName,
phone: dataSource?.returnGoodsAddress?.sendUserTel,
fullAddress: dataSource?.returnGoodsAddress?.sendAddress,
}}
isEdit={false}
/>
</Suspense>
</Col>
{dataSource && dataSource.outerStatus === RETURN_OUTER_STATUS_FINISHED && (
<Col span={6}>
{/* 售后评价 */}
<Suspense fallback={null}>
<Score score={dataSource?.evaluate?.level} />
</Suspense>
</Col>
)}
</Row>
</Col>
<Col span={24}>
{/* 内、外部流转记录 */}
<Suspense fallback={null}>
<FlowRecords
fetchOuterHistory={fetchOuterHistory}
outerStatusMap={RETURN_OUTER_STATUS_TAG_MAP}
/>
</Suspense>
</Col>
</Row>
</PageHeaderWrapper>
</Spin>
);
};
export default ReturnProfile;
import { ReturnProductListItemType } from '../ReturnProductList';
import { ReturnStatisticsListItem } from '../ReturnAnalysis/interface';
export type ManualReturnGoodsAddressType = {
/**
* 售后id
*/
dataId: number
/**
* 发货地址
*/
deliveryAddress: string
/**
* 发货时间
*/
deliveryTime: number
/**
* 物流单号
*/
logisticsOrderNo: string
/**
* 物流公司
*/
logisticsName: string
/**
* 退货商品数量 ,ManualDeliveryGoodsProductVO
*/
productList: {
/**
* 换货详情id
*/
replaceDetailId: number
/**
* 商品id
*/
productId: string
/**
* 退货数量
*/
returnCount: number
}[]
}
export type ReturnGoodsAddress = {
/**
* 配送方式:1-物流(默认),2-自提,3-无需配送
*/
deliveryType: number
/**
* 发货地址id
*/
sendId: number
/**
* 发货地址
*/
sendAddress: string
/**
* 发货者名称
*/
sendUserName: string
/**
* 发货者电话
*/
sendUserTel: string
/**
* 收货地址id
*/
receiveId: number
/**
* 收货地址
*/
receiveAddress: string
/**
* 收货者名称
*/
receiveUserName: string
/**
* 收货者电话
*/
receiveUserTel: string
}
export type EvaluateType = {
/**
* 评价等级(5个级别)
*/
level: number
/**
* 评价内容
*/
content: string
}
export type TaskListItem = {
/**
* 任务步骤
*/
step: number
/**
* 任务名称
*/
taskName: string
/**
* 执行当前任务的角色名称,@return
*/
roleName: string
/**
* 是否执行0-否1-是
*/
isExecute: number
}
export type RefundDetailListItem = {
/**
* 退款id
*/
refundId?: number
/**
* 支付id
*/
payId?: number
/**
* 支付外部状态:1.待支付2.待确认支付结果3.确认到账4.确认未到账
*/
externalState?: number
/**
* 支付次数
*/
payCount?: number
/**
* 支付环节
*/
payNode?: string
/**
* 支付比例
*/
payRatio?: number
/**
* 支付金额
*/
payAmount?: number
/**
* 支付方式:1.线上支付2.线下支付3.授信额度支付4.货到付款支付
*/
payWay?: number
/**
* 支付方式名称
*/
payWayName?: string
/**
* 支付渠道:0.积分支付1.支付宝2.微信3.银联4.余额支付5.线下支付线上确认6.授信额度支付7.货到付款
*/
channel?: number
/**
* 支付渠道名称
*/
channelName?: string
/**
* 退款金额
*/
refundAmount?: number
/**
* 外部状态:0.所有1.待退款2.待确认退款3.退款未到账4.退款到账5.无需退款
*/
outerStatus?: number
/**
* 外部状态名称
*/
outerStatusName?: string
/**
* 内部状态:0.所有1.未退款2.退款失败3.退款成功4.无需退款
*/
innerStatus?: number
/**
* 内部状态名称
*/
innerStatusName?: string
/**
* 退款时间(yyyy-MM-ddHH:mm)
*/
refundTime?: string
/**
* 支付凭证 ,PayProveBO
*/
payProve?: {
/**
* 账户名称
*/
name?: string
/**
* 银行账号
*/
bankAccount?: string
/**
* 开户行
*/
bankDeposit?: string
/**
* 支付凭证文件 ,PayProveFileBO
*/
fileList?: {
/**
* 证明名称
*/
name: string
/**
* 证明地址
*/
proveUrl: string
}[]
}
/**
* 是否允许退款:0-否,1-是
*/
canRefund?: number
}
export type RefundListItem = {
/**
* 订单号
*/
orderNo: string
/**
* 商品id
*/
productId: string
/**
* 商品名称
*/
productName: string
/**
* 品类
*/
category: string
/**
* 品牌
*/
brand: string
/**
* 单位
*/
unit: string
/**
* 采购单价
*/
purchasePrice: number
/**
* 采购数量
*/
purchaseCount: number
/**
* 采购金额
*/
purchaseAmount: number
/**
* 支付金额
*/
payAmount: number
/**
* 退货数量
*/
returnCount: number
/**
* 退款金额
*/
refundAmount: number
/**
* 退款明细 ,ReturnGoodsRefundDetailVO
*/
detailList: []
}
export type DetailType = {
/**
* 退货id
*/
returnId: number
/**
* 申请单号
*/
applyNo: string
/**
* 申请摘要
*/
applyAbstract: string
/**
* 采购商会员名称
*/
consumerName: string
/**
* 采购商会员id
*/
memberId: number
/**
* 采购商会员角色id
*/
roleId: number
/**
* 供应商名称
*/
supplierName: string
/**
* 供应商会员id
*/
parentMemberId: number
/**
* 供应商会员角色id
*/
parentMemberRoleId: number
/**
* 单据时间
*/
applyTime: string
/**
* 内部状态,待提交退货申请单-1,审核通过(提交)-2,审核不通过(提交)-24,审核通过(一级)-3,审核不通过(一级)-25,审核通过(二级)-4,审核不通过(二级)-5,审核通过(确认)-6,审核不通过(确认)-7,待新增退货发货单-8,待审核退货发货单-9,采购商待新增物流单-10,采购商待确认物流单-11,待确认退货发货-12,待新增退货入库单-13,待审核退货入库单-14,待确认退货收货-15,待确认退货回单-16,待退款-17,待确认退款-18,退款失败-19,退款成功-20,待确认售后完成-21,确认售后完成-22,不接受物流单-23
*/
innerStatus: number
/**
* 内部状态名称
*/
innerStatusName: string
/**
* 外部状态,待提交申请单-1,待确认申请单(已提交申请单)-2,待平台确认申请单-21,不接受申请(确认申请单)-3,接受申请(确认申请单)-4,待新增退货发货单(确认申请单后)-5,采购商待新增物流单(新增换货发货单审核通过)-6,待退货发货(新增物流单审核通过)-7,待新增退货入库单(已退货发货)-8,待退货收货(已新增换货入库单)-9,待确认退货回单(已换货收货)-10,待退款(确认退货回单)-11,待确认退款(退款)-12,确认退款未到账-13,待确认售后完成(确认退款)-14,售后完成-15
*/
outerStatus: number
/**
* 外部状态名称
*/
outerStatusName: string
/**
* 任务类型:18:默认,31:手工发货:,43:合同,44:合同手工发货
*/
taskType: number
/**
* 任务key.
*/
taskTypeKey: string
/**
* 手工退货发货地址
*/
manualReturnGoodsAddress: ManualReturnGoodsAddressType
/**
* 相关故障文件 ,ProofFileBO
*/
faultFileList: FaultFileListItem[]
/**
* 退货地址 ,ReceiveGoodsBO
*/
returnGoodsAddress: ReturnGoodsAddress
/**
* 评价 ,EvaluateBO
*/
evaluate: EvaluateType
/**
* 外部流转 ,TaskStepVO
*/
outerTaskList: TaskListItem[]
/**
* 内部流转 ,TaskStepVO
*/
innerTaskList: TaskListItem[]
/**
* 外部单据流转记录 ,ReturnOuterWorkflowRecordVO
*/
outerRecordList: {
/**
* 步骤
*/
step: number
/**
* 角色名称
*/
roleName: string
/**
* 状态
*/
status: string
/**
* 状态编码,待提交申请单-1,待确认申请单(已提交申请单)-2,不接受申请(确认申请单)-3,接受申请(确认申请单)-4,待新增退货发货单(确认申请单后)-5,采购商待新增物流单(新增换货发货单审核通过)-6,待退货发货(新增物流单审核通过)-7,待新增退货入库单(已退货发货)-8,待退货收货(已新增换货入库单)-9,待确认退货回单(已换货收货)-10,待退款(确认退货回单)-11,待确认退款(退款)-12,确认退款未到账-13,待确认售后完成(确认退款)-14,售后完成-15
*/
statusCode: number
/**
* 操作
*/
operate: string
/**
* 操作时间
*/
operateTime: string
/**
* 审核意见
*/
opinion: string
}[]
/**
* 内部单据流转记录 ,ReturnInnerWorkflowRecordVO
*/
innerRecordList: {
/**
* 步骤
*/
step: number
/**
* 操作者
*/
operator: string
/**
* 部门
*/
department: string
/**
* 职位
*/
jobTitle: string
/**
* 状态
*/
status: string
/**
* 状态编码,待提交退货申请单-1,审核通过(提交)-2,审核不通过(提交)-24,审核通过(一级)-3,审核不通过(一级)-25,审核通过(二级)-4,审核不通过(二级)-5,审核通过(确认)-6,审核不通过(确认)-7,待新增退货发货单-8,待审核退货发货单-9,采购商待新增物流单-10,采购商待确认物流单-11,待确认退货发货-12,待新增退货入库单-13,待审核退货入库单-14,待确认退货收货-15,待确认退货回单-16,待退款-17,待确认退款-18,退款失败-19,退款成功-20,待确认售后完成-21,确认售后完成-22,不接受物流单-23
*/
statusCode: number
/**
* 操作
*/
operate: string
/**
* 操作时间
*/
operateTime: string
/**
* 审核意见
*/
opinion: string
}[]
/**
* 退货批次
*/
returnBatch: number
/**
* 退货商品明细 ,ReturnGoodsDetailQueryVO
*/
goodsDetailList: ReturnProductListItemType[]
/**
* 退货统计 ,ReturnGoodsStatisticsVO
*/
returnStatisticsList: ReturnStatisticsListItem[]
/**
* 退货明细 ,DeliveryGoodsVO
*/
returnDeliveryGoodsList: []
/**
* 退款明细 ,ReturnGoodsRefundVO
*/
refundList: RefundListItem[]
/**
* 订单类型
*/
orderType: number
/**
* 退货原因
*/
returnReason: string
/**
* 店铺名称
*/
shopName: string
/**
* 店铺Id
*/
shopId: number
/**
* 店铺Logo
*/
shopLogo: string
/**
* AgentFlagEnum,代客标识:0-非代客;1-代客
*/
agentFlag: number
}
\ No newline at end of file
import React from 'react';
import { Modal } from 'antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import schema from './schema';
const formActions = createFormActions();
const {
onFieldValueChange$,
} = FormEffectHooks;
export type ValueType = {
/**
* 是否同意
*/
agree: number,
/**
* 理由
*/
reason: string,
}
interface IProps {
/**
* 是否可见
*/
visible: boolean,
/**
* Modal 关闭事件
*/
onClose: () => void,
/**
* Form 提交事件
*/
onSubmit: (value: any) => void,
/**
* 提交loading
*/
submitLoading: boolean,
}
const VerifyModal: React.FC<IProps> = (props: IProps) => {
const {
visible,
onClose,
onSubmit,
submitLoading,
} = props;
const handleClose = () => {
if (onClose) {
onClose();
}
};
const handleSubmit = (values: ValueType) => {
if (onSubmit) {
onSubmit(values);
}
};
return (
<Modal
title='单据审核'
visible={visible}
confirmLoading={submitLoading}
onOk={() => formActions.submit()}
onCancel={handleClose}
destroyOnClose
>
<NiceForm
effects={($, { setFieldState }) => {
onFieldValueChange$('agree').subscribe(fieldState => {
setFieldState('reason', state => {
state.title = fieldState.value === 0 ? '不通过原因' : '通过原因';
state.required = fieldState.value === 0;
setTimeout(() => {
formActions.validate('reason');
}, 0);
});
});
}}
actions={formActions}
schema={schema}
onSubmit={handleSubmit}
/>
</Modal>
);
};
export default VerifyModal;
\ No newline at end of file
import { ISchema } from '@formily/antd';
const schema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
agree: {
type: 'string',
default: 1,
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
'x-component': 'radio',
'x-component-props': {},
},
reason: {
type: 'string',
title: '不通过原因',
'x-component': 'textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
rows: 5,
},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 120,
}
],
},
},
},
},
};
export default schema;
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import { getAsReturnGoodsGetDetailPlatform, getAsReturnGoodsPageOuterWorkflowRecord } from '@/services/AfterServiceV2Api';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import ReturnProfile from '../components/ReturnProfile';
import { OuterHistoryData } from '../components/FlowRecords';
const ReturnPrVerifyDetailInfo: React.FC = () => {
const { id } = usePageStatus();
const ReturnProfilePro = fetchDetailHoc({
fetchDetail: () => getAsReturnGoodsGetDetailPlatform({
returnId: id,
}),
}, ReturnProfile);
const fetchOuterHistory = (params): Promise<OuterHistoryData> => {
return new Promise((resolve, reject) => {
getAsReturnGoodsPageOuterWorkflowRecord({
...params,
dataId: id,
})
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject(res);
})
.catch(err => {
reject(err);
});
});
};
return (
<ReturnProfilePro fetchOuterHistory={fetchOuterHistory} />
);
};
export default ReturnPrVerifyDetailInfo;
\ No newline at end of file
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import { Card, Button } from 'antd';
import { StandardTable } from 'god';
import moment from 'moment';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import NiceForm from '@/components/NiceForm';
import { listSearchSchema } from './schema';
import createColumns from '../common/columns/basic';
import { postAsPlatformReturnGoodsPageToBeVerify, PostAsPlatformReturnGoodsPageToBeVerifyResponseDetail } from '@/services/AfterServiceV2Api';
const formActions = createFormActions();
const ReturnPrVerifyList: React.FC = (props: any) => {
const ref = useRef<any>({});
const handleJumpAudit = (record: PostAsPlatformReturnGoodsPageToBeVerifyResponseDetail) => {
history.push(`${props.location.pathname}/verify?id=${record.returnId}`);
};
const [columns] = useState<any[]>(createColumns(props.location.pathname).concat([
{
title: '操作',
dataIndex: 'option',
render: (_, record) => (
<Button
type="link"
onClick={() => handleJumpAudit(record)}
>
审核
</Button>
),
},
]));
const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params;
return new Promise((resolve, reject) => {
postAsPlatformReturnGoodsPageToBeVerify({
startTime: startTime ? moment(+startTime).format('YYYY-MM-DD HH:mm:ss') : null,
endTime: endTime ? moment(+endTime).format('YYYY-MM-DD HH:mm:ss') : null,
...rest,
}, {
ctlType: 'none',
})
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
})
.catch(() => {
reject();
});
});
};
return (
<Card>
<StandardTable
tableProps={{
rowKey: 'returnId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
);
};
export default ReturnPrVerifyList;
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
applyAbstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
consumerName: {
type: 'string',
'x-component-props': {
placeholder: '采购会员',
allowClear: true,
},
},
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import React, { useState } from 'react';
import { Button } from 'antd';
import {
CheckCircleOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { getAsReturnGoodsGetDetailPlatform, getAsReturnGoodsPageOuterWorkflowRecord, postAsPlatformReturnGoodsVerify } from '@/services/AfterServiceV2Api';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import ReturnProfile from '../components/ReturnProfile';
import { OuterHistoryData } from '../components/FlowRecords';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
const ReturnVerify: React.FC = () => {
const { id } = usePageStatus();
const [visibleVerifyModal, setVisibleVerifyModal] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const ReturnProfilePro = fetchDetailHoc({
fetchDetail: () => getAsReturnGoodsGetDetailPlatform({
returnId: id,
}),
}, ReturnProfile);
const fetchOuterHistory = (params): Promise<OuterHistoryData> => {
return new Promise((resolve, reject) => {
getAsReturnGoodsPageOuterWorkflowRecord({
...params,
dataId: id,
})
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject(res);
})
.catch(err => {
reject(err);
});
});
};
const handleVisibleVerifyModal = (flag?) => {
setVisibleVerifyModal(!!flag);
};
const handleSubmit = (value: VerifyData) => {
setSubmitLoading(true);
postAsPlatformReturnGoodsVerify({
applyId: id,
isPass: value.agree,
opinion: value.reason,
}, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
handleVisibleVerifyModal(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
};
return (
<ReturnProfilePro
fetchOuterHistory={fetchOuterHistory}
extra={() => (
<>
<Button
type="primary"
icon={<CheckCircleOutlined />}
onClick={() => handleVisibleVerifyModal(true)}
>
审核
</Button>
<VerifyModal
visible={visibleVerifyModal}
onClose={() => handleVisibleVerifyModal(false)}
submitLoading={submitLoading}
onSubmit={handleSubmit}
/>
</>
)}
/>
);
};
export default ReturnVerify;
\ No newline at end of file
......@@ -11,7 +11,7 @@ const tokenList = [
{ name: 'SearchV2', token: 'f3e6ec26764f54d06ba33f487ff42d7debeaef397e51dc395040447737eb2e66', categoryIds: [0] }, // 搜索服务V2
{ name: 'PurchaseV2', token: '5f5468ce1cac41c42359a64cb2d1a96e609226bed219727a32bb90467cdd2a75', categoryIds: [0] }, //采购服务V2
{ name: 'EnhanceV2', token: 'f3400c8a9e46e7b3acbc5585f915df9e4badefb36f312486ad30df47563063b9', categoryIds: [0] }, // 加工服务V2
{ name: 'AfterServiceV2', token: 'c7d26d1f7df05ac202074603d53ce7985d7b8d5462425b3bd592ac4c00686b85', categoryIds: [0] }, // 售后服务V2
{ name: 'AfterServiceV2', token: '58748fc89dcdb33ec5cac520c00293ba92abca362a8ddb979df589effd0db9bd', categoryIds: [0] }, // 售后服务V2
{ name: 'ManageV2', token: '9ee3a1cb5a73ca02935e70debeda5bde0464f2fe1eb32c25855fd8acff9f68f2', categoryIds: [0] }, // 平台后台v2
{ name: 'MemberV2', token: 'be87c2732cb1253f82fe6c27d6cca9982c7dca9b384e46cc2e797b5835846834', categoryIds: [0] }, //会员服务 V2
{ name: 'ReportV2', token: 'dab50c384c27f1c981a03f2c44ad76d1e7e1f60b4520bd279cea67f5cf146cee', categoryIds: [0] }, // 报表服务v2
......
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