Commit c1a0cfc2 authored by XieZhiXiong's avatar XieZhiXiong

fix: 添加是否可退款判断

parent 63cee027
......@@ -400,6 +400,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
dataSource={detailInfo && detailInfo.refundList ? detailInfo.refundList : []}
onRefund={handleRefund}
isPurchaser={isPurchaser}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......
......@@ -18,6 +18,8 @@ import {
PAY_CHANNEL_BALANCE,
PAY_CHANNEL_CREDIT,
PAY_CHANNEL_COD,
RETURN_INNER_STATUS_TO_BE_REFUNDED,
RETURN_INNER_STATUS_UNCONFIRMED_REFUNDED,
} from '@/constants';
import Stamp from '../Stamp';
import CheckVoucherModal from '../CheckVoucherModal';
......@@ -51,6 +53,10 @@ interface ReturnDetailInfoProps {
* 是否是采购商
*/
isPurchaser?: boolean;
/**
* 退货申请单内部状态
*/
innerStatus: number;
};
const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
......@@ -58,6 +64,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
onRefund,
onConfirm,
isPurchaser = false,
innerStatus,
}) => {
const [visibleResult, setVisibleResult] = useState(false);
const [notReceivedLoading, setNotReceivedLoading] = useState(false);
......@@ -207,9 +214,11 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
const handleRefundConfirm = (values, modalName) => {
setSubmitLoading(true);
if (onRefund) {
onRefund(values).finally(() => {
setSubmitLoading(false);
});
}
};
return (
......@@ -219,7 +228,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
pagination={false}
expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
......@@ -255,7 +264,9 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
<div className={styles['deliver-item-actions']}>
{
!isPurchaser && (
!isPurchaser &&
innerStatus === RETURN_INNER_STATUS_TO_BE_REFUNDED &&
item.canRefund && (
item.outerStatus === REFUND_OUTER_STATUS_NOT_RECEIVED ||
item.innerStatus === REFUND_INNER_STATUS_NO_REFUND ||
item.innerStatus === REFUND_INNER_STATUS_REFUND_FAILED
......@@ -272,7 +283,8 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
{item.channel === PAY_CHANNEL_OFFLINE && (
<>
{
isPurchaser && (
isPurchaser &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_REFUNDED && (
item.outerStatus === REFUND_OUTER_STATUS_UNCONFIRMED_REFUND ||
item.outerStatus === REFUND_OUTER_STATUS_NOT_RECEIVED
) && (
......
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