Commit cf3c15c8 authored by XieZhiXiong's avatar XieZhiXiong

feat: 拆分可编辑状态

parent aff1a078
...@@ -54,9 +54,21 @@ interface DetailInfoProps { ...@@ -54,9 +54,21 @@ interface DetailInfoProps {
*/ */
id: string; id: string;
/** /**
* 是否是编辑的 * 是否是可编辑 是否需要退货
*/ */
isEdit?: boolean; isEditReturn?: boolean;
/**
* 是否是 可以编辑 地址的
*/
isEditAddress?: boolean;
/**
* 是否是 可以编辑 退货发货相关
*/
isEditRefundDeliver?: boolean;
/**
* 是否是 可以编辑 换货发货相关
*/
isEditExchangeDeliver?: boolean;
/** /**
* 历史记录目标路径 * 历史记录目标路径
*/ */
...@@ -73,7 +85,10 @@ interface DetailInfo extends GetAsReplaceGoodsGetDetailBySupplierResponse { ...@@ -73,7 +85,10 @@ interface DetailInfo extends GetAsReplaceGoodsGetDetailBySupplierResponse {
const DetailInfo: React.FC<DetailInfoProps> = ({ const DetailInfo: React.FC<DetailInfoProps> = ({
id, id,
isEdit = false, isEditReturn = false,
isEditAddress = false,
isEditRefundDeliver = false,
isEditExchangeDeliver = false,
target, target,
headExtra, headExtra,
}) => { }) => {
...@@ -130,7 +145,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -130,7 +145,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}; };
const handleReturn = record => { const handleReturn = record => {
if (!isEdit || !id) { if (!isEditReturn || !id) {
return; return;
} }
const msg = message.loading({ const msg = message.loading({
...@@ -225,7 +240,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -225,7 +240,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<> <>
{!isEdit ? ( {!isEditReturn ? (
text text
) : ( ) : (
<Switch checked={record.isNeedReturn} onChange={() => handleReturn(record)} /> <Switch checked={record.isNeedReturn} onChange={() => handleReturn(record)} />
...@@ -422,7 +437,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -422,7 +437,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmReturnReceive={handleReceivedConfirmReturnReceive} onConfirmReturnReceive={handleReceivedConfirmReturnReceive}
innerStatus={detailInfo?.innerStatus} innerStatus={detailInfo?.innerStatus}
target={target} target={target}
isEdit={isEdit} isEdit={isEditRefundDeliver}
/> />
</Suspense> </Suspense>
</Col> </Col>
...@@ -443,7 +458,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -443,7 +458,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmExchangeBack={handleConfirmExchangeBack} onConfirmExchangeBack={handleConfirmExchangeBack}
innerStatus={detailInfo?.innerStatus} innerStatus={detailInfo?.innerStatus}
target={target} target={target}
isEdit={isEdit} isEdit={isEditExchangeDeliver}
/> />
</Suspense> </Suspense>
</Col> </Col>
...@@ -477,7 +492,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -477,7 +492,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
phone: detailInfo?.returnGoodsAddress?.sendUserTel, phone: detailInfo?.returnGoodsAddress?.sendUserTel,
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress, fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}} }}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED} isEdit={isEditAddress && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
onSubmit={handleReturnAddressSubmit} onSubmit={handleReturnAddressSubmit}
/> />
</Suspense> </Suspense>
...@@ -499,7 +514,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -499,7 +514,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
phone: detailInfo?.replaceGoodsAddress?.sendUserTel, phone: detailInfo?.replaceGoodsAddress?.sendUserTel,
fullAddress: detailInfo?.replaceGoodsAddress?.sendAddress, fullAddress: detailInfo?.replaceGoodsAddress?.sendAddress,
}} }}
isEdit={isEdit && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED} isEdit={isEditAddress && detailInfo?.innerStatus === EXCHANGE_INNER_STATUS_UNCOMMITTED}
onSubmit={handleExchangeAddressSubmit} onSubmit={handleExchangeAddressSubmit}
/> />
</Suspense> </Suspense>
......
...@@ -103,7 +103,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => { ...@@ -103,7 +103,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
</Space> </Space>
)} )}
target="/memberCenter/afterService/exchangeManage/exchangePrConfirmBack" target="/memberCenter/afterService/exchangeManage/exchangePrConfirmBack"
isEdit isEditExchangeDeliver
/> />
</> </>
); );
......
...@@ -52,7 +52,7 @@ const ExchangePrDeliverVerify: React.FC = () => { ...@@ -52,7 +52,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
</> </>
)} )}
target="/memberCenter/afterService/exchangeManage/exchangePrDeliver" target="/memberCenter/afterService/exchangeManage/exchangePrDeliver"
isEdit isEditExchangeDeliver
/> />
<ManualDeliveryModal <ManualDeliveryModal
......
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-20 17:10:14
* @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';
...@@ -74,7 +81,7 @@ const ExchangePrReceivedVerify: React.FC = () => { ...@@ -74,7 +81,7 @@ const ExchangePrReceivedVerify: React.FC = () => {
) )
}} }}
target="/memberCenter/afterService/exchangeManage/exchangePrReceived" target="/memberCenter/afterService/exchangeManage/exchangePrReceived"
isEdit isEditRefundDeliver
/> />
</> </>
); );
......
...@@ -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-02-19 20:34:16 * @LastEditTime: 2021-02-20 17:06:52
* @Description: * @Description:
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -152,7 +152,8 @@ const ExchangePrSubmitVerify: React.FC = () => { ...@@ -152,7 +152,8 @@ const ExchangePrSubmitVerify: React.FC = () => {
提交审核 提交审核
</Button> </Button>
)} )}
isEdit isEditReturn
isEditAddress
/> />
<VerifyModal <VerifyModal
......
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