Commit d6417922 authored by XieZhiXiong's avatar XieZhiXiong

feat: 拆分可编辑状态

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