Commit 54b67ebf authored by XieZhiXiong's avatar XieZhiXiong

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

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