Commit 54b67ebf authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复操作按钮不能正确展示的问题

parent 0b7bcd97
......@@ -1686,7 +1686,7 @@ export const EXCHANGE_OUTER_STATUS = {
// 售后退货内部状态
/**
* 待提交
* 待提交退
*/
export const RETURN_INNER_STATUS_UNCOMMITTED = 1;
/**
......
......@@ -71,6 +71,11 @@ interface ReturnInfoProps {
* 历史记录目标路径
*/
target: string;
/**
* 是否可编辑
*/
isEdit?: boolean;
};
const ReturnInfo: React.FC<ReturnInfoProps> = ({
......@@ -82,6 +87,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
onConfirmReturnReceive,
innerStatus,
target,
isEdit = false,
}) => {
const [currentBatch, setCurrentBatch] = useState(1);
......@@ -338,6 +344,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
</Descriptions.Item>
<Descriptions.Item>
{(
isEdit &&
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY
......@@ -353,6 +360,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
</a>
)}
{(
isEdit &&
!isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE
......@@ -368,6 +376,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
</a>
)}
{(
isEdit &&
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT
......
......@@ -2,17 +2,13 @@ import React, { Suspense, useEffect, useState } from 'react';
import {
PageHeader,
Descriptions,
Card,
Spin,
Button,
Row,
Col,
Badge,
Switch,
Tooltip,
message,
} from 'antd';
import { FormOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
......@@ -20,12 +16,14 @@ import {
GetAsReplaceGoodsGetDetailByConsumerResponse,
GetAsReplaceGoodsPageReturnedGoodsResponse,
} from '@/services/AfterServiceApi';
import { EXCHANGE_OUTER_STATUS_FINISHED } from '@/constants';
import {
EXCHANGE_OUTER_STATUS_FINISHED,
EXCHANGE_INNER_STATUS_UNCOMMITTED,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag';
import EyePreview from '@/components/EyePreview';
import AuditProcess from '@/components/AuditProcess';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { OuterHistoryData, InnerHistoryData } from '../../../components/FlowRecords';
import {
......@@ -367,6 +365,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEdit}
/>
</Suspense>
</Col>
......@@ -387,6 +386,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEdit}
/>
</Suspense>
</Col>
......@@ -421,7 +421,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}}
onSubmit={() => {}}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
/>
</Suspense>
</Col>
......@@ -442,7 +442,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
phone: detailInfo?.replaceGoodsAddress?.sendUserTel,
fullAddress: detailInfo?.replaceGoodsAddress?.sendAddress,
}}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
onSubmit={() => {}}
/>
</Suspense>
......
......@@ -141,6 +141,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
</Space>
)}
target="/memberCenter/afterService/exchangeApplication/exchangePrConfirmBack"
isEdit
/>
</>
);
......
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-29 15:47:54
* @Description:
*/
import React, { useState } from 'react';
import { Button } from 'antd';
import { history } from 'umi';
......@@ -52,6 +59,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
</>
)}
target="/memberCenter/afterService/exchangeApplication/exchangePrDeliver"
isEdit
/>
<ManualDeliveryModal
......
......@@ -50,6 +50,7 @@ const ExchangePrFinishedDetailVerify: React.FC = () => {
</Button>
)}
target="/memberCenter/afterService/exchangeApplication/exchangePrFinished"
isEdit
/>
<FinishedModal
......
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-29 15:48:28
* @Description:
*/
import React, { useState } from 'react';
import { Button } from 'antd';
import { history } from 'umi';
......@@ -75,6 +82,7 @@ const ExchangePrReceivedVerify: React.FC = () => {
)
}}
target="/memberCenter/afterService/exchangeApplication/exchangePrReceived"
isEdit
/>
</>
);
......
......@@ -20,7 +20,10 @@ import {
GetAsReplaceGoodsGetDetailBySupplierResponse,
GetAsReplaceGoodsPageReturnedGoodsResponse,
} from '@/services/AfterServiceApi';
import { EXCHANGE_OUTER_STATUS_FINISHED } from '@/constants';
import {
EXCHANGE_OUTER_STATUS_FINISHED,
EXCHANGE_INNER_STATUS_UNCOMMITTED,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag';
......@@ -474,7 +477,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
phone: detailInfo?.returnGoodsAddress?.sendUserTel,
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
onSubmit={handleReturnAddressSubmit}
/>
</Suspense>
......@@ -496,7 +499,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
phone: detailInfo?.replaceGoodsAddress?.sendUserTel,
fullAddress: detailInfo?.replaceGoodsAddress?.sendAddress,
}}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
onSubmit={handleExchangeAddressSubmit}
/>
</Suspense>
......
......@@ -50,6 +50,7 @@ const ExchangePr1Verify: React.FC = () => {
单据审核
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -50,6 +50,7 @@ const ExchangePr2Verify: React.FC = () => {
单据审核
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -69,6 +69,7 @@ const ExchangePrConfirmVerify: React.FC = () => {
确认单据
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -94,6 +94,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
</Space>
)}
target="/memberCenter/afterService/exchangeManage/exchangePrConfirmBack"
isEdit
/>
</>
);
......
......@@ -52,6 +52,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
</>
)}
target="/memberCenter/afterService/exchangeManage/exchangePrDeliver"
isEdit
/>
<ManualDeliveryModal
......
......@@ -74,6 +74,7 @@ const ExchangePrReceivedVerify: React.FC = () => {
)
}}
target="/memberCenter/afterService/exchangeManage/exchangePrReceived"
isEdit
/>
</>
);
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-29 14:11:59
* @LastEditTime: 2021-01-29 15:50:05
* @Description:
*/
import React, { useState } from 'react';
......
......@@ -24,6 +24,7 @@ import {
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED,
RETURN_OUTER_STATUS_NOT_RECEIVED,
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED,
RETURN_INNER_STATUS_UNCOMMITTED,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
......@@ -412,6 +413,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEdit}
/>
</Suspense>
</Col>
......@@ -472,7 +474,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}}
onSubmit={() => {}}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === RETURN_INNER_STATUS_UNCOMMITTED}
/>
</Suspense>
</Col>
......
......@@ -141,6 +141,7 @@ const ReturnPrConfirmBackVerify: React.FC = () => {
</Space>
)}
target="/memberCenter/afterService/returnApplication/returnPrConfirmBack"
isEdit
/>
</>
);
......
......@@ -43,6 +43,7 @@ const ReturnPrConfirmFinishVerify: React.FC = () => {
</Button>
)}
target="/memberCenter/afterService/returnApplication/returnPrConfirmFinish"
isEdit
/>
<FinishedModal
......
......@@ -41,6 +41,7 @@ const ReturnPrConfirmResultVerify: React.FC = () => {
</Button>
)}
target="/memberCenter/afterService/returnApplication/returnPrConfirmResult"
isEdit
/>
</>
);
......
......@@ -52,6 +52,7 @@ const ReturnPrDeliverVerify: React.FC = () => {
</>
)}
target="/memberCenter/afterService/returnApplication/returnPrDeliver"
isEdit
/>
<ManualDeliveryModal
......
......@@ -26,6 +26,7 @@ import {
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED,
RETURN_OUTER_STATUS_NOT_RECEIVED,
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED,
RETURN_INNER_STATUS_UNCOMMITTED,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
......@@ -451,6 +452,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmReturnReceive={handleReceivedConfirmReturnReceive}
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEdit}
/>
</Suspense>
</Col>
......@@ -510,7 +512,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}}
onSubmit={handleReturnAddressSubmit}
isEdit={isEdit}
isEdit={isEdit && detailInfo?.innerStatus === RETURN_INNER_STATUS_UNCOMMITTED}
/>
</Suspense>
</Col>
......
......@@ -50,6 +50,7 @@ const ReturnPr1Verify: React.FC = () => {
单据审核
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -50,6 +50,7 @@ const ReturnPr2Verify: React.FC = () => {
单据审核
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -67,6 +67,7 @@ const ReturnPrConfirmVerify: React.FC = () => {
确认单据
</Button>
)}
isEdit
/>
<VerifyModal
......
......@@ -75,6 +75,7 @@ const ReturnPrReceivedVerify: React.FC = () => {
)
}}
target="/memberCenter/afterService/returnManage/returnPrReceived"
isEdit
/>
</>
......
......@@ -49,6 +49,7 @@ const ReturnPrReturnVerify: React.FC = () => {
确认本单已完成所有退款
</Button>
)}
isEdit
/>
</>
);
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-14 18:07:20
* @LastEditTime: 2021-01-29 15:55:33
* @Description:
*/
import React, { useState } from 'react';
......
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