Commit cf3c15c8 authored by XieZhiXiong's avatar XieZhiXiong

feat: 拆分可编辑状态

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