Commit 93cdbde3 authored by XieZhiXiong's avatar XieZhiXiong

chore: 删除不必要的代码及优化展示

parent d9b3f0b1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04 * @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-04 18:04:07 * @LastEditTime: 2021-02-02 10:26:13
* @Description: 换货收货地址 * @Description: 换货收货地址
*/ */
import React from 'react'; import React from 'react';
...@@ -64,7 +64,7 @@ interface ExchangeAddressInfo { ...@@ -64,7 +64,7 @@ interface ExchangeAddressInfo {
}, },
// onSubmit // onSubmit
onSubmit?: (values: Values) => void; onSubmit: (values: Values) => void;
}; };
const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
...@@ -125,6 +125,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -125,6 +125,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
shippingAddress: shippingAddress.id, shippingAddress: shippingAddress.id,
pickupAddress: shippingAddress.id, pickupAddress: shippingAddress.id,
}} }}
previewPlaceholder=" "
expressionScope={{ expressionScope={{
Address, Address,
ShippingAddress, ShippingAddress,
...@@ -136,7 +137,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -136,7 +137,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
// 联动配送方式 // 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => { onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState; const { value } = fieldState;
switch (value) { switch (value) {
// 物流 // 物流
...@@ -172,10 +173,28 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -172,10 +173,28 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
default: default:
break break
}; };
if (onSubmit) {
onSubmit({
deliveryType: value,
id: undefined,
isDefault: undefined,
sendAddress: undefined,
sendUserName: undefined,
sendUserTel: undefined,
});
}
});
onFieldInputChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
if (value) {
linkage.value('*(shippingAddress,pickupAddress)', undefined);
}
}); });
onFieldValueChange$('*(shippingAddress,pickupAddress)').subscribe(fieldState => { onFieldInputChange$('*(shippingAddress,pickupAddress)').subscribe(fieldState => {
const { name, value, originAsyncData = [] } = fieldState; const { value, originAsyncData = [] } = fieldState;
const deliveryTypeValue = getFieldValue('deliveryType'); const deliveryTypeValue = getFieldValue('deliveryType');
const fullData = originAsyncData.find(item => item.id === value); const fullData = originAsyncData.find(item => item.id === value);
...@@ -195,6 +214,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({ ...@@ -195,6 +214,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
actions={modalFormActions} actions={modalFormActions}
schema={schema} schema={schema}
onSubmit={handleSubmit} onSubmit={handleSubmit}
colon
/> />
</MellowCard> </MellowCard>
); );
......
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-09 15:56:35 * @Date: 2020-11-09 15:56:35
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-25 15:19:36 * @LastEditTime: 2021-01-21 14:14:26
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { UPLOAD_TYPE, DELIVERY_TYPE_ENUM } from '@/constants'; import { DELIVERY_TYPE_ENUM } from '@/constants';
export const schema: ISchema = { export const schema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
MEGA_LAYOUT: { MEGA_LAYOUT: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
labelCol: 8, labelCol: 6,
wrapperCol: 16, wrapperCol: 16,
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
deliveryType: { deliveryType: {
title: '配送方式', title: '配送方式',
type: 'string', type: 'string',
default: 1, enum: DELIVERY_TYPE_ENUM,
enum: DELIVERY_TYPE_ENUM, 'x-component-props': {
'x-component-props': { placeholder: '请选择',
style: { style: {
width: '80%', width: '80%',
}, },
}, },
}, 'x-rules': [
deliveryAddress: { {
type: 'object', required: true,
title: '换货收货地址', message: '请选择配送方式',
'x-component': 'Children', },
'x-component-props': { ],
children: '{{Address}}', },
}, deliveryAddress: {
}, type: 'object',
shippingAddress: { title: '换货收货地址',
type: 'string', 'x-component': 'Children',
title: '换货发货地址', 'x-component-props': {
enum: [], children: '{{Address}}',
'x-component-props': { },
placeholder: '请选择', },
style: { shippingAddress: {
width: '80%', type: 'string',
}, title: '换货发货地址',
}, visible: false,
'x-rules': [ enum: [],
{ 'x-component-props': {
required: true, placeholder: '请选择',
message: '请选择换货发货地址', style: {
}, width: '80%',
], },
}, },
pickupAddress: { 'x-rules': [
type: 'string', {
title: '换货自提地址', required: true,
enum: [], message: '请选择换货发货地址',
'x-component-props': { },
placeholder: '请选择', ],
style: { },
width: '80%', pickupAddress: {
}, type: 'string',
}, title: '换货自提地址',
'x-rules': [ visible: false,
{ enum: [],
required: true, 'x-component-props': {
message: '请选择换货自提地址', placeholder: '请选择',
}, style: {
], width: '80%',
}, },
shippingAddressShow: { },
type: 'object', 'x-rules': [
title: '换货发货地址', {
visible: false, required: true,
'x-component': 'Children', message: '请选择换货自提地址',
'x-component-props': { },
children: '{{ShippingAddress}}', ],
}, },
}, shippingAddressShow: {
}, type: 'object',
}, title: '换货发货地址',
}, visible: false,
'x-component': 'Children',
'x-component-props': {
children: '{{ShippingAddress}}',
},
},
},
},
},
}; };
\ No newline at end of file
...@@ -38,30 +38,12 @@ interface ExchangeDeliverInfoProps { ...@@ -38,30 +38,12 @@ interface ExchangeDeliverInfoProps {
* 是否是采购商 * 是否是采购商
*/ */
isPurchaser?: boolean; isPurchaser?: boolean;
/**
* 确认退货回单
*/
onConfirmExchangeBack?: (id: number) => void;
/**
* 确认退货发货
*/
onConfirmExchangeDeliver?: (id: number) => Promise<any>;
/**
* 确认退货收货
*/
onConfirmExchangeReceive?: (id: number) => Promise<any>;
}; };
const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
summary = [], summary = [],
detailed = [], detailed = [],
isPurchaser = false, isPurchaser = false,
onConfirmExchangeBack,
onConfirmExchangeDeliver,
onConfirmExchangeReceive,
}) => { }) => {
const summaryColumns: EditableColumns[] = [ const summaryColumns: EditableColumns[] = [
...@@ -78,6 +60,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -78,6 +60,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
...@@ -135,6 +118,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -135,6 +118,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
...@@ -177,38 +161,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -177,38 +161,6 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
}; };
const handleConfirmExchangeDeliver = (id) => {
if (onConfirmExchangeDeliver) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `是否确认换货发货?`,
onOk() {
return onConfirmExchangeDeliver(id);
},
});
}
};
const handleConfirmExchangeReceive = (id) => {
if (onConfirmExchangeReceive) {
confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: `是否确认换货收货?`,
onOk() {
return onConfirmExchangeReceive(id);
},
});
}
};
const handleConfirmExchangeBack = (id) => {
if (onConfirmExchangeBack) {
onConfirmExchangeBack(id);
}
};
return ( return (
<MellowCard> <MellowCard>
<Tabs defaultActiveKey="2"> <Tabs defaultActiveKey="2">
...@@ -268,39 +220,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({ ...@@ -268,39 +220,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} /> <Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
{item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmExchangeDeliver(item.deliveryId)}
>
确认换货发货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmExchangeReceive(item.deliveryId)}
>
确认换货收货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmExchangeBack(item.deliveryId)}
>
确认换货回单
</a>
)}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
</Col> </Col>
......
...@@ -79,6 +79,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -79,6 +79,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
...@@ -136,6 +137,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -136,6 +137,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
...@@ -276,39 +278,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({ ...@@ -276,39 +278,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} /> <Badge color={'#6C9CEB'} text={item.innerStatusName} />
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
{item.innerStatus === MAIL_INNER_STATUS_UNCONFIRMED_DELIVER && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmReturnDeliver(item.deliveryId)}
>
确认退货发货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_DELIVER && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmReturnReceive(item.deliveryId)}
>
确认退货收货
</a>
)}
{item.innerStatus === MAIL_INNER_STATUS_CONFIRMED_RECEIVING && (
<a
style={{
textAlign: 'right',
display: 'block',
}}
onClick={() => handleConfirmReturnBack(item.deliveryId)}
>
确认退货回单
</a>
)}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
</Col> </Col>
......
...@@ -121,6 +121,7 @@ const DetailInfo: React.FC = () => { ...@@ -121,6 +121,7 @@ const DetailInfo: React.FC = () => {
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
......
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-12-18 16:55:17 * @Date: 2020-12-18 16:55:17
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-18 16:55:17 * @LastEditTime: 2021-02-02 10:27:36
* @Description: * @Description:
*/ */
import { import {
REPAIR_OUTER_STATUS_UNCOMMITTED, REPAIR_OUTER_STATUS_UNCOMMITTED,
REPAIR_OUTER_STATUS_UNCONFIRMED, REPAIR_OUTER_STATUS_UNCONFIRMED,
REPAIR_OUTER_STATUS_FAILED, REPAIR_OUTER_STATUS_FAILED,
REPAIR_OUTER_STATUS_SUCCESS, REPAIR_OUTER_STATUS_SUCCESS,
REPAIR_OUTER_STATUS_FINISHED, REPAIR_OUTER_STATUS_FINISHED,
REPAIR_INNER_STATUS_UNCOMMITTED, REPAIR_INNER_STATUS_UNCOMMITTED,
REPAIR_INNER_STATUS_COMMITTED, REPAIR_INNER_STATUS_COMMIT_SUCCESS,
REPAIR_INNER_STATUS_SUCCESS_1, REPAIR_INNER_STATUS_SUCCESS_1,
REPAIR_INNER_STATUS_SUCCESS_2, REPAIR_INNER_STATUS_SUCCESS_2,
REPAIR_INNER_STATUS_FAILED, REPAIR_INNER_STATUS_FAILED_2,
REPAIR_INNER_STATUS_CONFIRM_SUCCESS, REPAIR_INNER_STATUS_CONFIRM_SUCCESS,
REPAIR_INNER_STATUS_CONFIRM_FAILED, REPAIR_INNER_STATUS_CONFIRM_FAILED,
REPAIR_INNER_STATUS_FINISHED, REPAIR_INNER_STATUS_FINISHED,
} from '@/constants'; REPAIR_INNER_STATUS_COMMIT_FAILED,
REPAIR_INNER_STATUS_FAILED_1,
// 售后维修外部状态 StatusTag map } from '@/constants';
export const REPAIR_OUTER_STATUS_TAG_MAP = {
[REPAIR_OUTER_STATUS_UNCOMMITTED]: 'default', // 售后维修外部状态 StatusTag map
[REPAIR_OUTER_STATUS_UNCONFIRMED]: 'success', export const REPAIR_OUTER_STATUS_TAG_MAP = {
[REPAIR_OUTER_STATUS_FAILED]: 'danger', [REPAIR_OUTER_STATUS_UNCOMMITTED]: 'default',
[REPAIR_OUTER_STATUS_SUCCESS]: 'primary', [REPAIR_OUTER_STATUS_UNCONFIRMED]: 'success',
[REPAIR_OUTER_STATUS_FINISHED]: 'success', [REPAIR_OUTER_STATUS_FAILED]: 'danger',
}; [REPAIR_OUTER_STATUS_SUCCESS]: 'primary',
[REPAIR_OUTER_STATUS_FINISHED]: 'success',
// 售后维修内部部状态 Badge map };
export const REPAIR_INNER_STATUS_BADGE_MAP = {
[REPAIR_INNER_STATUS_UNCOMMITTED]: '#669EDE', // 售后维修内部部状态 Badge map
[REPAIR_INNER_STATUS_COMMITTED]: '#41CC9E', export const REPAIR_INNER_STATUS_BADGE_MAP = {
[REPAIR_INNER_STATUS_SUCCESS_1]: '#41CC9E', [REPAIR_INNER_STATUS_UNCOMMITTED]: '#669EDE',
[REPAIR_INNER_STATUS_SUCCESS_2]: '#41CC9E', [REPAIR_INNER_STATUS_COMMIT_SUCCESS]: '#41CC9E',
[REPAIR_INNER_STATUS_FAILED]: '#EF6260', [REPAIR_INNER_STATUS_SUCCESS_1]: '#41CC9E',
[REPAIR_INNER_STATUS_CONFIRM_SUCCESS]: '#6C9CEB', [REPAIR_INNER_STATUS_SUCCESS_2]: '#41CC9E',
[REPAIR_INNER_STATUS_CONFIRM_FAILED]: '#EF6260', [REPAIR_INNER_STATUS_FAILED_2]: '#EF6260',
[REPAIR_INNER_STATUS_FINISHED]: '#41CC9E', [REPAIR_INNER_STATUS_CONFIRM_SUCCESS]: '#6C9CEB',
[REPAIR_INNER_STATUS_CONFIRM_FAILED]: '#EF6260',
[REPAIR_INNER_STATUS_FINISHED]: '#41CC9E',
[REPAIR_INNER_STATUS_COMMIT_FAILED]: '#EF6260',
[REPAIR_INNER_STATUS_FAILED_1]: '#EF6260',
}; };
\ No newline at end of file
...@@ -67,6 +67,7 @@ const DetailInfo: React.FC = () => { ...@@ -67,6 +67,7 @@ const DetailInfo: React.FC = () => {
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
......
...@@ -128,6 +128,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -128,6 +128,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '品类', title: '品类',
......
...@@ -110,6 +110,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({ ...@@ -110,6 +110,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
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