Commit 7c932fe2 authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善展示

parent fa266fc5
.steps {
padding-top: 2px;
overflow: auto;
}
\ No newline at end of file
...@@ -5,15 +5,16 @@ ...@@ -5,15 +5,16 @@
* @LastEditTime: 2021-01-13 15:36:08 * @LastEditTime: 2021-01-13 15:36:08
* @Description: 内外部流转记录组件 * @Description: 内外部流转记录组件
*/ */
import React from 'react'; import React, { useState } from 'react';
import { import {
Steps, Steps,
Tabs, Tabs,
} from 'antd'; } from 'antd';
import MellowCard from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import ButtonSwitch from '@/components/ButtonSwitch';
import styles from './index.less'; import styles from './index.less';
interface AuditProcessProp { interface AuditProcessProp extends MellowCardProps {
outerVerifyCurrent?: number; outerVerifyCurrent?: number;
innerVerifyCurrent?: number; innerVerifyCurrent?: number;
outerVerifySteps?: { outerVerifySteps?: {
...@@ -38,15 +39,48 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -38,15 +39,48 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
outerVerifySteps = [], outerVerifySteps = [],
innerVerifySteps = [], innerVerifySteps = [],
customTitleKey, customTitleKey,
customKey customKey,
}) => ( ...rest
<MellowCard> }) => {
<Tabs onChange={() => {}}> const [radioValue, setRadioValue] = useState<('inner' | 'outer')>('inner');
{
outerVerifySteps?.length && const handleRadioChange = (value: ('inner' | 'outer')) => {
<Tabs.TabPane tab="外部审核流程" key="1"> setRadioValue(value);
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={outerVerifyCurrent}> };
{outerVerifySteps.map(item => (
const options = [
(
outerVerifySteps
&& outerVerifySteps.length
? {
label: '外部流转',
value: 'outer',
disabled: !outerVerifySteps || !outerVerifySteps.length,
}
: null
),
{
label: '内部流转',
value: 'inner',
},
].filter(Boolean);
return (
<MellowCard
title="流转进度"
extra={(
<ButtonSwitch
options={options}
onChange={handleRadioChange}
value={radioValue}
/>
)}
{...rest}
>
{radioValue === 'outer' ? (
<div className={styles.steps}>
<Steps progressDot current={outerVerifyCurrent}>
{outerVerifySteps && outerVerifySteps.map(item => (
<Steps.Step <Steps.Step
key={customKey ? item[customKey] : item.step} key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName} title={customTitleKey ? item[customTitleKey] : item.stepName}
...@@ -55,13 +89,12 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -55,13 +89,12 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
/> />
))} ))}
</Steps> </Steps>
</Tabs.TabPane> </div>
} ) : null}
{ {radioValue === 'inner' ? (
innerVerifySteps?.length && <div className={styles.steps}>
<Tabs.TabPane tab="内部审核流程" key="2"> <Steps progressDot current={innerVerifyCurrent}>
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={innerVerifyCurrent}> {innerVerifySteps && innerVerifySteps.map(item => (
{innerVerifySteps.map(item => (
<Steps.Step <Steps.Step
key={customKey ? item[customKey] : item.step} key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName} title={customTitleKey ? item[customTitleKey] : item.stepName}
...@@ -70,10 +103,10 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -70,10 +103,10 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
/> />
))} ))}
</Steps> </Steps>
</Tabs.TabPane> </div>
} ) : null}
</Tabs> </MellowCard>
</MellowCard> )
); };
export default AuditProcess; export default AuditProcess;
...@@ -6,20 +6,17 @@ ...@@ -6,20 +6,17 @@
* @Description: 换货收货地址 * @Description: 换货收货地址
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import MellowCard from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'; import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils'; import { useLinkageUtils } from '@/utils/formEffectUtils';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { schema } from './schema'; import { schema } from './schema';
import styles from './index.less';
const modalFormActions = createAsyncFormActions(); const modalFormActions = createAsyncFormActions();
const { const {
onFieldValueChange$,
onFieldInputChange$, onFieldInputChange$,
onFormInit$,
} = FormEffectHooks; } = FormEffectHooks;
export interface Values { export interface Values {
...@@ -31,47 +28,76 @@ export interface Values { ...@@ -31,47 +28,76 @@ export interface Values {
sendUserTel: string | undefined, sendUserTel: string | undefined,
}; };
interface ExchangeAddressInfo { interface ExchangeAddressInfo extends MellowCardProps {
// 是否是编辑的 /**
* 是否是编辑的
*/
isEdit?: boolean; isEdit?: boolean;
// 换货收货地址 /**
* 换货收货地址
*/
deliveryAddress: { deliveryAddress: {
// id /**
* id
*/
id?: number; id?: number;
// 配送方式 /**
* 配送方式
*/
deliveryType?: number; deliveryType?: number;
// 收件人姓名 /**
* 收件人姓名
*/
name: string; name: string;
// phone /**
* phone
*/
phone: string; phone: string;
// 完整地址 /**
* 完整地址
*/
fullAddress: string; fullAddress: string;
}, },
// 换货发货地址 /**
* 换货发货地址
*/
shippingAddress: { shippingAddress: {
// id /**
* id
*/
id?: number; id?: number;
// 配送方式 /**
* 配送方式
*/
deliveryType?: number; deliveryType?: number;
// 收件人姓名 /**
* 收件人姓名
*/
name: string; name: string;
// phone /**
* phone
*/
phone: string; phone: string;
// 完整地址 /**
* 完整地址
*/
fullAddress: string; fullAddress: string;
}, },
// onSubmit /**
onSubmit: (values: Values) => void; * 提交事件
*/
onFormSubmit: (values: Values) => void;
}; };
const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
isEdit = false, isEdit = false,
deliveryAddress = {}, deliveryAddress = {},
shippingAddress = {}, shippingAddress = {},
onSubmit, onFormSubmit,
...rest
}) => { }) => {
useEffect(() => { useEffect(() => {
...@@ -179,7 +205,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -179,7 +205,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
return ( return (
<MellowCard <MellowCard
title="换货收货地址" title="换货收货地址"
fullHeight {...rest}
> >
<NiceForm <NiceForm
initialValues={{ initialValues={{
...@@ -192,7 +218,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -192,7 +218,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
Address, Address,
ShippingAddress, ShippingAddress,
}} }}
effects={($, { setFieldState, getFieldValue }) => { effects={($, { getFieldValue }) => {
useAsyncSelect('*(shippingAddress,pickupAddress)', fetchShipperAddress, ['label', 'value']); useAsyncSelect('*(shippingAddress,pickupAddress)', fetchShipperAddress, ['label', 'value']);
const linkage = useLinkageUtils(); const linkage = useLinkageUtils();
...@@ -223,8 +249,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -223,8 +249,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
break break
}; };
if (onSubmit) { if (onFormSubmit) {
onSubmit({ onFormSubmit({
deliveryType: value, deliveryType: value,
id: undefined, id: undefined,
isDefault: undefined, isDefault: undefined,
...@@ -247,8 +273,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -247,8 +273,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
const deliveryTypeValue = await getFieldValue('deliveryType'); const deliveryTypeValue = await getFieldValue('deliveryType');
const fullData = originAsyncData.find(item => item.id === value); const fullData = originAsyncData.find(item => item.id === value);
if (onSubmit) { if (onFormSubmit) {
onSubmit({ onFormSubmit({
deliveryType: deliveryTypeValue, deliveryType: deliveryTypeValue,
id: fullData ? fullData.id : undefined, id: fullData ? fullData.id : undefined,
isDefault: fullData ? fullData.isDefault : undefined, isDefault: fullData ? fullData.isDefault : undefined,
......
...@@ -6,14 +6,15 @@ ...@@ -6,14 +6,15 @@
* @Description: 换货发货统计、换货发货明细 * @Description: 换货发货统计、换货发货明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Tabs, Button, Row, Col, Descriptions, Badge, Radio, Modal } from 'antd'; import { Row, Col, Descriptions, Badge, Radio, Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Link } from 'umi'; import { Link } from 'umi';
import { SummaryData, Detailed } from './interface'; import { SummaryData, Detailed } from './interface';
import MellowCard from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import PolymericTable from '@/components/PolymericTable'; import PolymericTable from '@/components/PolymericTable';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import ButtonSwitch from '@/components/ButtonSwitch';
import { import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_DELIVERY, EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_DELIVERY,
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIVE, EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIVE,
...@@ -26,10 +27,9 @@ import { ...@@ -26,10 +27,9 @@ import {
} from '../../constants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const { TabPane } = Tabs;
const { confirm } = Modal; const { confirm } = Modal;
interface ExchangeDeliverInfoProps { interface ExchangeDeliverInfoProps extends MellowCardProps {
/** /**
* 换货发货统计 * 换货发货统计
*/ */
...@@ -77,17 +77,19 @@ interface ExchangeDeliverInfoProps { ...@@ -77,17 +77,19 @@ interface ExchangeDeliverInfoProps {
}; };
const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
summary = [], summary = [],
detailed = [], detailed = [],
isPurchaser = false, isPurchaser = false,
onConfirmExchangeBack, onConfirmExchangeBack,
onConfirmExchangeDeliver, onConfirmExchangeDeliver,
onConfirmExchangeReceive, onConfirmExchangeReceive,
innerStatus, innerStatus,
target, target,
isEdit = false, isEdit = false,
...rest
}) => { }) => {
const [currentBatch, setCurrentBatch] = useState(1); const [currentBatch, setCurrentBatch] = useState(1);
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
const summaryColumns: EditableColumns[] = [ const summaryColumns: EditableColumns[] = [
{ {
...@@ -247,26 +249,45 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -247,26 +249,45 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
onConfirmExchangeBack(id); onConfirmExchangeBack(id);
} }
}; };
const handleRadioChange = (value: ('1' | '2')) => {
setRadioValue(value);
};
const options = [
{
label: `换货${!isPurchaser ? '发货' : '收货'}统计`,
value: '1',
},
{
label: `换货${!isPurchaser ? '发货' : '收货'}明细`,
value: '2',
},
];
return ( return (
<MellowCard> <MellowCard
<Tabs defaultActiveKey="2"> title="换货收货信息"
<TabPane extra={(
tab={`换货${!isPurchaser ? '发货' : '收货'}统计`} <ButtonSwitch
key="1" options={options}
> onChange={handleRadioChange}
<PolymericTable value={radioValue}
rowKey={record => `${record.orderNo}+${record.productId}`} />
dataSource={summary} )}
columns={summaryColumns} {...rest}
loading={false} >
pagination={null} {radioValue === '1' ? (
/> <PolymericTable
</TabPane> rowKey={record => `${record.orderNo}+${record.productId}`}
<TabPane dataSource={summary}
tab={`换货${!isPurchaser ? '发货' : '收货'}明细`} columns={summaryColumns}
key="2" loading={false}
> pagination={null}
/>
) : null}
{radioValue === '2' ? (
<>
<Radio.Group <Radio.Group
options={ options={
detailed.map(item => ({ detailed.map(item => ({
...@@ -397,8 +418,8 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -397,8 +418,8 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
/> />
</div> </div>
))} ))}
</TabPane> </>
</Tabs> ) : null}
</MellowCard> </MellowCard>
); );
}; };
......
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
* @Description: 换货收货统计、换货发货明细 * @Description: 换货收货统计、换货发货明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Tabs, Button, Row, Col, Descriptions, Badge, Radio, Modal } from 'antd'; import { Row, Col, Descriptions, Badge, Radio, Modal } from 'antd';
import { import {
ClockCircleOutlined,
ExclamationCircleOutlined, ExclamationCircleOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { Link } from 'umi'; import { Link } from 'umi';
import { SummaryData, Detailed } from './interface'; import { SummaryData, Detailed } from './interface';
import MellowCard from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import PolymericTable from '@/components/PolymericTable'; import PolymericTable from '@/components/PolymericTable';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import ButtonSwitch from '@/components/ButtonSwitch';
import { import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY, EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_DELIVERY,
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE, EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIVE,
...@@ -29,10 +29,9 @@ import { ...@@ -29,10 +29,9 @@ import {
} from '../../constants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const { TabPane } = Tabs;
const { confirm } = Modal; const { confirm } = Modal;
interface ExchangeReceivedInfoProps { interface ExchangeReceivedInfoProps extends MellowCardProps {
/** /**
* 退货收货统计 * 退货收货统计
*/ */
...@@ -80,17 +79,19 @@ interface ExchangeReceivedInfoProps { ...@@ -80,17 +79,19 @@ interface ExchangeReceivedInfoProps {
}; };
const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
summary = [], summary = [],
detailed = [], detailed = [],
isPurchaser = false, isPurchaser = false,
onConfirmReturnBack, onConfirmReturnBack,
onConfirmReturnDeliver, onConfirmReturnDeliver,
onConfirmReturnReceive, onConfirmReturnReceive,
innerStatus, innerStatus,
target, target,
isEdit = false, isEdit = false,
...rest
}) => { }) => {
const [currentBatch, setCurrentBatch] = useState(1); const [currentBatch, setCurrentBatch] = useState(1);
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
const summaryColumns: EditableColumns[] = [ const summaryColumns: EditableColumns[] = [
{ {
...@@ -258,25 +259,44 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -258,25 +259,44 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
} }
}; };
const handleRadioChange = (value: ('1' | '2')) => {
setRadioValue(value);
};
const options = [
{
label: `退货${!isPurchaser ? '收货' : '发货'}统计`,
value: '1',
},
{
label: `退货${!isPurchaser ? '收货' : '发货'}明细`,
value: '2',
},
];
return ( return (
<MellowCard> <MellowCard
<Tabs defaultActiveKey="2"> title="退货发货信息"
<TabPane extra={(
tab={`退货${!isPurchaser ? '收货' : '发货'}统计`} <ButtonSwitch
key="1" options={options}
> onChange={handleRadioChange}
<PolymericTable value={radioValue}
rowKey={record => `${record.orderNo}+${record.productId}`} />
dataSource={summary} )}
columns={summaryColumns} {...rest}
loading={false} >
pagination={null} {radioValue === '1' ? (
/> <PolymericTable
</TabPane> rowKey={record => `${record.orderNo}+${record.productId}`}
<TabPane dataSource={summary}
tab={`退货${!isPurchaser ? '收货' : '发货'}明细`} columns={summaryColumns}
key="2" loading={false}
> pagination={null}
/>
) : null}
{radioValue === '2' ? (
<>
<Radio.Group <Radio.Group
options={ options={
detailed.map(item => ({ detailed.map(item => ({
...@@ -407,8 +427,8 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -407,8 +427,8 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
/> />
</div> </div>
))} ))}
</TabPane> </>
</Tabs> ) : null}
</MellowCard> </MellowCard>
); );
}; };
......
...@@ -38,13 +38,21 @@ export interface InnerHistoryData { ...@@ -38,13 +38,21 @@ export interface InnerHistoryData {
interface FlowRecordsProps extends MellowCardProps { interface FlowRecordsProps extends MellowCardProps {
/** /**
* 外部流转记录,不能与 fetchOuterHistory 共存
*/
outerHistory?: OuterHistoryItem[];
/**
* 内部流转记录,不能与 fetchInnerHistory 共存
*/
innerHistory?: InnerHistoryItem[];
/**
* 获取外部流转记录 * 获取外部流转记录
*/ */
fetchOuterHistory?: (params: { [key: string]: any }) => Promise<OuterHistoryData>; fetchOuterHistory?: (params: { [key: string]: any }) => Promise<OuterHistoryData>;
/** /**
* 获取内部流转记录 * 获取内部流转记录
*/ */
fetchInnerHistory: (params: { [key: string]: any }) => Promise<InnerHistoryData>; fetchInnerHistory?: (params: { [key: string]: any }) => Promise<InnerHistoryData>;
/** /**
* 外部状态map * 外部状态map
*/ */
...@@ -57,10 +65,12 @@ interface FlowRecordsProps extends MellowCardProps { ...@@ -57,10 +65,12 @@ interface FlowRecordsProps extends MellowCardProps {
const PAGE_SIZE = 10; const PAGE_SIZE = 10;
const FlowRecords: React.FC<FlowRecordsProps> = ({ const FlowRecords: React.FC<FlowRecordsProps> = ({
fetchOuterHistory, outerHistory,
fetchInnerHistory, innerHistory,
outerStatusMap = {}, fetchOuterHistory,
fetchInnerHistory,
outerStatusMap = {},
innerStatusColorMap = {}, innerStatusColorMap = {},
...rest ...rest
}) => { }) => {
...@@ -162,6 +172,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ ...@@ -162,6 +172,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({
]; ];
const getOuterHistory = params => { const getOuterHistory = params => {
if (outerHistory) {
setOuterData({ data: outerHistory, totalCount: outerHistory.length });
return;
}
if (fetchOuterHistory) { if (fetchOuterHistory) {
setOuterLoading(true); setOuterLoading(true);
fetchOuterHistory(params).then(res => { fetchOuterHistory(params).then(res => {
...@@ -175,6 +189,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ ...@@ -175,6 +189,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({
}; };
const getInnerHistory = params => { const getInnerHistory = params => {
if (innerHistory) {
setInnerData({ data: innerHistory, totalCount: innerHistory.length });
return;
}
if (fetchInnerHistory) { if (fetchInnerHistory) {
setInnerLoading(true); setInnerLoading(true);
fetchInnerHistory(params).then(res => { fetchInnerHistory(params).then(res => {
...@@ -192,11 +210,14 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ ...@@ -192,11 +210,14 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({
current: outerPage, current: outerPage,
pageSize: outerSize, pageSize: outerSize,
}); });
}, [outerHistory]);
useEffect(() => {
getInnerHistory({ getInnerHistory({
current: innerPage, current: innerPage,
pageSize: innerSize, pageSize: innerSize,
}); });
} ,[]); }, [innerHistory]);
const handleOuterPaginationChange = (current, pageSize) => { const handleOuterPaginationChange = (current, pageSize) => {
setOuterPage(current); setOuterPage(current);
......
...@@ -44,7 +44,7 @@ const OuterCirculation: React.FC<OuterCirculation> = ({ ...@@ -44,7 +44,7 @@ const OuterCirculation: React.FC<OuterCirculation> = ({
> >
<div className={styles.steps}> <div className={styles.steps}>
{(steps && steps.length > 0) ? ( {(steps && steps.length > 0) ? (
<Steps style={{ marginTop: 30 }} progressDot current={current}> <Steps progressDot current={current}>
{steps.map((item, index) => ( {steps.map((item, index) => (
<Steps.Step <Steps.Step
key={index} key={index}
......
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 15:04:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-22 11:45:59
* @Description: 外部流转记录
*/
import React from 'react';
import { REPAIR_OUTER_STATUS } from '@/constants';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import StatusTag from '@/components/StatusTag';
import { REPAIR_OUTER_STATUS_TAG_MAP } from '../../constants';
interface OuterCirculationRecordProps {
dataSource: {
roleName: string,
status: number | string,
operate: string,
operateTime: string,
opinion: string,
}[];
onPaginationChange?: (page: number, size: number) => void;
};
const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
dataSource = [],
onPaginationChange,
}) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'order',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
ellipsis: true,
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const handlePaginationChange = (page, size) => {
if (onPaginationChange) {
onPaginationChange(page, size);
}
};
return (
<MellowCard
title="外部流转记录"
>
<PolymericTable
rowKey="step"
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
/>
</MellowCard>
);
};
export default OuterCirculationRecord;
\ No newline at end of file
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-03 13:53:58 * @Date: 2020-11-03 13:53:58
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-16 17:59:26 * @LastEditTime: 2021-05-12 17:09:35
* @Description: 维修地址 * @Description: 维修地址
*/ */
import React from 'react'; import React from 'react';
import { Descriptions } from 'antd'; import { Descriptions } from 'antd';
import MellowCard from '@/components/MellowCard'; import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import styles from './index.less'; import styles from './index.less';
export interface RepairAddressInfoProps { export interface RepairAddressInfoProps extends MellowCardProps {
info: { info: {
id: string; id: string;
// 收件人 // 收件人
...@@ -23,15 +23,16 @@ export interface RepairAddressInfoProps { ...@@ -23,15 +23,16 @@ export interface RepairAddressInfoProps {
}; };
const RepairAddressInfo: React.FC<RepairAddressInfoProps> = ({ const RepairAddressInfo: React.FC<RepairAddressInfoProps> = ({
info = {}, info = {},
...rest
}) => { }) => {
return ( return (
<MellowCard <MellowCard
title="维修地址" title="维修地址"
fullHeight {...rest}
> >
<Descriptions column={1} className={styles.desc}> <Descriptions column={1} className={styles.desc}>
<Descriptions.Item label="维修地址"> <Descriptions.Item label="维修地址" labelStyle={{ width: 106 }}>
<p>{info.receiverName || ''} / {info.phone || ''}</p> <p>{info.receiverName || ''} / {info.phone || ''}</p>
<p>{info.fullAddress || ''}</p> <p>{info.fullAddress || ''}</p>
</Descriptions.Item> </Descriptions.Item>
......
...@@ -192,7 +192,7 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({ ...@@ -192,7 +192,7 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
deliveryAddressShow: deliveryAddress, deliveryAddressShow: deliveryAddress,
}} }}
previewPlaceholder=" " previewPlaceholder=" "
effects={($, { setFieldState, getFieldValue }) => { effects={($, { getFieldValue }) => {
useAsyncSelect('deliveryAddress', fetchDeliveryAddress, ['label', 'value']); useAsyncSelect('deliveryAddress', fetchDeliveryAddress, ['label', 'value']);
const linkage = useLinkageUtils(); const linkage = useLinkageUtils();
...@@ -241,10 +241,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({ ...@@ -241,10 +241,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
} }
}); });
}} }}
// expressionScope={{
// Address,
// DeliveryAddress,
// }}
components={{ components={{
Address, Address,
DeliveryAddress, DeliveryAddress,
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15 * @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-12 14:54:59 * @LastEditTime: 2021-05-12 18:37:13
* @Description: 退货收货统计、退货发货明细 * @Description: 退货收货统计、退货发货明细
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Tabs, Row, Col, Descriptions, Badge, Radio, Modal } from 'antd'; import { Row, Col, Descriptions, Badge, Radio, Modal } from 'antd';
import { import {
ExclamationCircleOutlined, ExclamationCircleOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
...@@ -30,7 +30,6 @@ import { ...@@ -30,7 +30,6 @@ import {
} from '../../constants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const { TabPane } = Tabs;
const { confirm } = Modal; const { confirm } = Modal;
interface ReturnInfoProps extends MellowCardProps { interface ReturnInfoProps extends MellowCardProps {
/** /**
...@@ -92,7 +91,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({ ...@@ -92,7 +91,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
...rest ...rest
}) => { }) => {
const [currentBatch, setCurrentBatch] = useState(1); const [currentBatch, setCurrentBatch] = useState(1);
const [radioValue, setRadioValue] = useState<('1' | '2')>('1'); const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
const summaryColumns: EditableColumns[] = [ const summaryColumns: EditableColumns[] = [
{ {
......
...@@ -189,11 +189,13 @@ const ReturnForm: React.FC<BillsFormProps> = ({ ...@@ -189,11 +189,13 @@ const ReturnForm: React.FC<BillsFormProps> = ({
title: '单价', title: '单价',
dataIndex: 'price', dataIndex: 'price',
align: 'center', align: 'center',
render: (text) => ${text}`,
}, },
{ {
title: '金额', title: '金额',
dataIndex: 'price', dataIndex: 'money',
align: 'center', align: 'center',
render: (text) => ${text}`,
}, },
{ {
title: '已退货数量', title: '已退货数量',
......
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