Commit 29109a26 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复操作按钮显示错误的问题

parent 28021cdf
......@@ -14,6 +14,11 @@ import { EditableColumns } from '@/components/PolymericTable/interface';
import PolymericTable from '@/components/PolymericTable';
import EyePreview from '@/components/EyePreview';
import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_DELIVERY,
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIVE,
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIPT,
} from '@/constants';
import {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
......@@ -53,6 +58,11 @@ interface ExchangeDeliverInfoProps {
* 确认退货收货
*/
onConfirmExchangeReceive?: (id: number) => Promise<any>;
/**
* 换货申请单内部状态
*/
innerStatus: number;
};
const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
......@@ -62,6 +72,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
onConfirmExchangeBack,
onConfirmExchangeDeliver,
onConfirmExchangeReceive,
innerStatus,
}) => {
const summaryColumns: EditableColumns[] = [
......@@ -282,7 +293,11 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item>
{item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER && (
{(
!isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_DELIVERY
) && (
<a
style={{
textAlign: 'right',
......@@ -293,7 +308,11 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
确认换货发货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER && (
{(
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIVE
) && (
<a
style={{
textAlign: 'right',
......@@ -304,7 +323,11 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
确认换货收货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING && (
{(
!isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIPT
) && (
<a
style={{
textAlign: 'right',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-08 16:29:30
* @LastEditTime: 2020-12-22 11:25:50
* @Description: 退货收货统计、退货发货明细
*/
import React from 'react';
......@@ -17,6 +17,11 @@ import { EditableColumns } from '@/components/PolymericTable/interface';
import PolymericTable from '@/components/PolymericTable';
import EyePreview from '@/components/EyePreview';
import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY,
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE,
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT,
} from '@/constants';
import {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
......@@ -56,6 +61,11 @@ interface ExchangeReceivedInfoProps {
* 确认退货收货
*/
onConfirmReturnReceive?: (id: number) => Promise<any>;
/**
* 换货申请单内部状态
*/
innerStatus: number;
};
const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
......@@ -65,6 +75,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
onConfirmReturnBack,
onConfirmReturnDeliver,
onConfirmReturnReceive,
innerStatus,
}) => {
const summaryColumns: EditableColumns[] = [
......@@ -292,7 +303,11 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item>
{item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER && (
{(
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY
) && (
<a
style={{
textAlign: 'right',
......@@ -303,7 +318,11 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
确认退货发货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER && (
{(
!isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE
) && (
<a
style={{
textAlign: 'right',
......@@ -314,7 +333,11 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
确认退货收货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING && (
{(
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING &&
innerStatus === EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT
) && (
<a
style={{
textAlign: 'right',
......
......@@ -92,7 +92,7 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({
dataIndex: 'status',
align: 'center',
render: (text, record) => (
<StatusTag type={outerStatusMap[record.status] || 'default'} title={text} />
<StatusTag type={outerStatusMap[record.statusCode] || 'default'} title={text} />
),
},
{
......
......@@ -17,6 +17,11 @@ import { EditableColumns } from '@/components/PolymericTable/interface';
import PolymericTable from '@/components/PolymericTable';
import EyePreview from '@/components/EyePreview';
import {
RETURN_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY,
RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE,
RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT,
} from '@/constants';
import {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
......@@ -55,6 +60,11 @@ interface ReturnInfoProps {
* 确认退货收货
*/
onConfirmReturnReceive?: (id: number) => Promise<any>;
/**
* 退货申请单内部状态
*/
innerStatus: number;
};
const ReturnInfo: React.FC<ReturnInfoProps> = ({
......@@ -64,6 +74,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
onConfirmReturnBack,
onConfirmReturnDeliver,
onConfirmReturnReceive,
innerStatus,
}) => {
const summaryColumns: EditableColumns[] = [
......@@ -281,7 +292,11 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item>
{item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER && (
{(
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY
) && (
<a
style={{
textAlign: 'right',
......@@ -292,7 +307,11 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
确认退货发货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER && (
{(
!isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE
) && (
<a
style={{
textAlign: 'right',
......@@ -303,7 +322,11 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
确认退货收货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING && (
{(
isPurchaser &&
item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT
) && (
<a
style={{
textAlign: 'right',
......
......@@ -18,6 +18,8 @@ import {
PAY_CHANNEL_BALANCE,
PAY_CHANNEL_CREDIT,
PAY_CHANNEL_COD,
RETURN_INNER_STATUS_TO_BE_REFUNDED,
RETURN_INNER_STATUS_UNCONFIRMED_REFUNDED,
} from '@/constants';
import Stamp from '../Stamp';
import CheckVoucherModal from '../CheckVoucherModal';
......@@ -51,6 +53,11 @@ interface ReturnDetailInfoProps {
* 是否是采购商
*/
isPurchaser?: boolean;
/**
* 退货申请单内部状态
*/
innerStatus: number;
};
const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
......@@ -58,6 +65,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
onRefund,
onConfirm,
isPurchaser = false,
innerStatus,
}) => {
const [visibleResult, setVisibleResult] = useState(false);
const [notReceivedLoading, setNotReceivedLoading] = useState(false);
......@@ -255,7 +263,8 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
<div className={styles['deliver-item-actions']}>
{
!isPurchaser && (
!isPurchaser &&
innerStatus === RETURN_INNER_STATUS_TO_BE_REFUNDED && (
item.outerStatus === REFUND_OUTER_STATUS_NOT_RECEIVED ||
item.innerStatus === REFUND_INNER_STATUS_NO_REFUND ||
item.innerStatus === REFUND_INNER_STATUS_REFUND_FAILED
......@@ -272,7 +281,8 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
{item.channel === PAY_CHANNEL_OFFLINE && (
<>
{
isPurchaser && (
isPurchaser &&
innerStatus === RETURN_INNER_STATUS_UNCONFIRMED_REFUNDED && (
item.outerStatus === REFUND_OUTER_STATUS_UNCONFIRMED_REFUND ||
item.outerStatus === REFUND_OUTER_STATUS_NOT_RECEIVED
) && (
......
......@@ -352,6 +352,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmReturnDeliver={handleReceivedConfirmReturnDeliver}
onConfirmReturnBack={handleConfirmReturnBack}
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......@@ -364,6 +365,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
detailed={detailInfo && detailInfo.replaceDeliveryGoodsList ? detailInfo.replaceDeliveryGoodsList : []}
onConfirmExchangeReceive={handleConfirmExchangeReceive}
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......
......@@ -405,6 +405,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
summary={detailInfo && detailInfo.returnStatisticsList ? detailInfo.returnStatisticsList : []}
detailed={detailInfo && detailInfo.returnDeliveryGoodsList ? detailInfo.returnDeliveryGoodsList : []}
onConfirmReturnReceive={handleReceivedConfirmReturnReceive}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......@@ -417,6 +418,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
detailed={detailInfo && detailInfo.replaceDeliveryGoodsList ? detailInfo.replaceDeliveryGoodsList : []}
onConfirmExchangeDeliver={handleConfirmExchangeDeliver}
onConfirmExchangeBack={handleConfirmExchangeBack}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......
......@@ -390,6 +390,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
onConfirmReturnDeliver={handleReceivedConfirmReturnDeliver}
onConfirmReturnBack={handleConfirmReturnBack}
isPurchaser={true}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......@@ -408,6 +409,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<ReturnDetailInfo
dataSource={detailInfo && detailInfo.refundList ? detailInfo.refundList : []}
onConfirm={handleConfirm}
innerStatus={detailInfo?.innerStatus}
isPurchaser
/>
</Suspense>
......
......@@ -7,7 +7,7 @@ import { history, Prompt } from 'umi';
import moment from 'moment';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined, PlusOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { GetAsReturnGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
......@@ -497,7 +497,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
};
const handleReturnInfoSubmit = values => {
const { getFieldValue, setFieldValue } = addSchemaAction;
const { getFieldValue, setFieldValue, setFieldState } = addSchemaAction;
const { index } = orderInfo;
const newData = [...getFieldValue('returnGoodsList')];
newData.splice(index, 1, {
......@@ -511,6 +511,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
},
});
setFieldValue('returnGoodsList', newData);
addSchemaAction.clearErrors(`returnGoodsList.${index}.returnCount`);
addSchemaAction.clearErrors(`returnGoodsList.${index}.refundAmount`);
setVisibleReturnInfoDrawer(false);
};
......@@ -559,6 +561,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...detailInfo,
returnGoodsList: returnGoodsList.data,
}}
previewPlaceholder=" "
expressionScope={{
TableAddButton,
OuterStatus,
......
......@@ -437,6 +437,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
summary={detailInfo && detailInfo.returnStatisticsList ? detailInfo.returnStatisticsList : []}
detailed={detailInfo && detailInfo.returnDeliveryGoodsList ? detailInfo.returnDeliveryGoodsList : []}
onConfirmReturnReceive={handleReceivedConfirmReturnReceive}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......@@ -455,6 +456,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<ReturnDetailInfo
dataSource={detailInfo && detailInfo.refundList ? detailInfo.refundList : []}
onRefund={handleRefund}
innerStatus={detailInfo?.innerStatus}
/>
</Suspense>
</Col>
......
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