Commit d6417922 authored by XieZhiXiong's avatar XieZhiXiong

feat: 拆分可编辑状态

parent de25b1a0
......@@ -280,7 +280,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 可退货数量,这里取 采购数量判断即可
extraData: {
returnReason: item.returnReason,
payList: item.payList || [],
payList: (item.payList || []).map(({ payId, ...rest }) => ({ ...rest, id: payId })),
id: item.orderRecordId,
taskType,
},
......@@ -302,6 +302,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
setInfoLoading(true);
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
})
.then(res => {
if (res.code === 1000) {
......
......@@ -57,9 +57,21 @@ interface DetailInfoProps {
*/
id: string;
/**
* 是否是编辑的
* 是否是可编辑 是否需要退货
*/
isEdit?: boolean;
isEditReturn?: boolean;
/**
* 是否是 可以退款的
*/
isEditRefund?: boolean;
/**
* 是否是 可以编辑 地址的
*/
isEditAddress?: boolean;
/**
* 是否是 可以编辑 退货发货相关
*/
isEditRefundDeliver?: boolean;
/**
* 历史记录目标路径
*/
......@@ -76,7 +88,10 @@ interface DetailInfo extends GetAsReturnGoodsGetDetailBySupplierResponse {
const DetailInfo: React.FC<DetailInfoProps> = ({
id,
isEdit = false,
isEditReturn = false,
isEditRefund = false,
isEditAddress = false,
isEditRefundDeliver = false,
target,
headExtra = null,
}) => {
......@@ -110,7 +125,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
};
const handleReturn = record => {
if (!isEdit || !id) {
if (!isEditReturn || !id) {
return;
}
const msg = message.loading({
......@@ -210,7 +225,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
align: 'center',
render: (text, record) => (
<>
{!isEdit ? (
{!isEditReturn ? (
text
) : (
<Switch checked={record.isNeedReturn} onChange={() => handleReturn(record)} />
......@@ -452,7 +467,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmReturnReceive={handleReceivedConfirmReturnReceive}
innerStatus={detailInfo?.innerStatus}
target={target}
isEdit={isEdit}
isEdit={isEditRefundDeliver}
/>
</Suspense>
</Col>
......@@ -479,7 +494,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
purchaserRoleId={detailInfo?.roleId}
supplierId={detailInfo?.parentMemberId}
supplierRoleId={detailInfo?.parentMemberRoleId}
isEdit={isEdit}
isEdit={isEditRefund}
/>
</Suspense>
</Col>
......@@ -498,6 +513,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Col span={detailInfo && detailInfo.outerStatus === RETURN_OUTER_STATUS_FINISHED ? 12 : 15}>
<Suspense fallback={null}>
{/* 退货地址信息 */}
<ReturnAddressInfo
deliveryAddress={{
id: detailInfo?.returnGoodsAddress?.receiveId,
......@@ -512,7 +528,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
fullAddress: detailInfo?.returnGoodsAddress?.sendAddress,
}}
onSubmit={handleReturnAddressSubmit}
isEdit={isEdit && detailInfo?.innerStatus === RETURN_INNER_STATUS_UNCOMMITTED}
isEdit={isEditAddress && detailInfo?.innerStatus === RETURN_INNER_STATUS_UNCOMMITTED}
/>
</Suspense>
</Col>
......
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-20 16:42:26
* @Description:
*/
import React, { useState } from 'react';
import { Button } from 'antd';
import { history } from 'umi';
......@@ -75,9 +82,8 @@ const ReturnPrReceivedVerify: React.FC = () => {
)
}}
target="/memberCenter/afterService/returnManage/returnPrReceived"
isEdit
isEditRefundDeliver
/>
</>
);
};
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-08 14:03:31
* @LastEditTime: 2021-02-20 16:39:44
* @Description:
*/
import React, { useState } from 'react';
......@@ -49,7 +49,7 @@ const ReturnPrReturnVerify: React.FC = () => {
确认本单已完成所有退款
</Button>
)}
isEdit
isEditRefund
/>
</>
);
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-29 15:55:33
* @LastEditTime: 2021-02-20 16:44:40
* @Description:
*/
import React, { useState } from 'react';
......@@ -91,7 +91,8 @@ const ReturnPrSubmitVerify: React.FC = () => {
提交审核
</Button>
)}
isEdit
isEditAddress
isEditReturn
/>
<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