Commit 93cdbde3 authored by XieZhiXiong's avatar XieZhiXiong

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

parent d9b3f0b1
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-04 18:04:07
* @LastEditTime: 2021-02-02 10:26:13
* @Description: 换货收货地址
*/
import React from 'react';
......@@ -64,7 +64,7 @@ interface ExchangeAddressInfo {
},
// onSubmit
onSubmit?: (values: Values) => void;
onSubmit: (values: Values) => void;
};
const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
......@@ -125,6 +125,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
shippingAddress: shippingAddress.id,
pickupAddress: shippingAddress.id,
}}
previewPlaceholder=" "
expressionScope={{
Address,
ShippingAddress,
......@@ -136,7 +137,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
const { value } = fieldState;
switch (value) {
// 物流
......@@ -172,10 +173,28 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
default:
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 => {
const { name, value, originAsyncData = [] } = fieldState;
onFieldInputChange$('*(shippingAddress,pickupAddress)').subscribe(fieldState => {
const { value, originAsyncData = [] } = fieldState;
const deliveryTypeValue = getFieldValue('deliveryType');
const fullData = originAsyncData.find(item => item.id === value);
......@@ -195,6 +214,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
actions={modalFormActions}
schema={schema}
onSubmit={handleSubmit}
colon
/>
</MellowCard>
);
......
......@@ -2,11 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-11-09 15:56:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-25 15:19:36
* @LastEditTime: 2021-01-21 14:14:26
* @Description:
*/
import { ISchema } from '@formily/antd';
import { UPLOAD_TYPE, DELIVERY_TYPE_ENUM } from '@/constants';
import { DELIVERY_TYPE_ENUM } from '@/constants';
export const schema: ISchema = {
type: 'object',
......@@ -15,7 +15,7 @@ export const schema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 8,
labelCol: 6,
wrapperCol: 16,
labelAlign: 'left',
},
......@@ -23,13 +23,19 @@ export const schema: ISchema = {
deliveryType: {
title: '配送方式',
type: 'string',
default: 1,
enum: DELIVERY_TYPE_ENUM,
'x-component-props': {
placeholder: '请选择',
style: {
width: '80%',
},
},
'x-rules': [
{
required: true,
message: '请选择配送方式',
},
],
},
deliveryAddress: {
type: 'object',
......@@ -42,6 +48,7 @@ export const schema: ISchema = {
shippingAddress: {
type: 'string',
title: '换货发货地址',
visible: false,
enum: [],
'x-component-props': {
placeholder: '请选择',
......@@ -59,6 +66,7 @@ export const schema: ISchema = {
pickupAddress: {
type: 'string',
title: '换货自提地址',
visible: false,
enum: [],
'x-component-props': {
placeholder: '请选择',
......
......@@ -38,30 +38,12 @@ interface ExchangeDeliverInfoProps {
* 是否是采购商
*/
isPurchaser?: boolean;
/**
* 确认退货回单
*/
onConfirmExchangeBack?: (id: number) => void;
/**
* 确认退货发货
*/
onConfirmExchangeDeliver?: (id: number) => Promise<any>;
/**
* 确认退货收货
*/
onConfirmExchangeReceive?: (id: number) => Promise<any>;
};
const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
summary = [],
detailed = [],
isPurchaser = false,
onConfirmExchangeBack,
onConfirmExchangeDeliver,
onConfirmExchangeReceive,
}) => {
const summaryColumns: EditableColumns[] = [
......@@ -78,6 +60,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......@@ -135,6 +118,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......@@ -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 (
<MellowCard>
<Tabs defaultActiveKey="2">
......@@ -268,39 +220,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</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>
</Col>
......
......@@ -79,6 +79,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......@@ -136,6 +137,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......@@ -276,39 +278,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Badge color={'#6C9CEB'} text={item.innerStatusName} />
</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>
</Col>
......
......@@ -121,6 +121,7 @@ const DetailInfo: React.FC = () => {
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-12-18 16:55:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-18 16:55:17
* @LastEditTime: 2021-02-02 10:27:36
* @Description:
*/
import {
......@@ -13,13 +13,15 @@ import {
REPAIR_OUTER_STATUS_FINISHED,
REPAIR_INNER_STATUS_UNCOMMITTED,
REPAIR_INNER_STATUS_COMMITTED,
REPAIR_INNER_STATUS_COMMIT_SUCCESS,
REPAIR_INNER_STATUS_SUCCESS_1,
REPAIR_INNER_STATUS_SUCCESS_2,
REPAIR_INNER_STATUS_FAILED,
REPAIR_INNER_STATUS_FAILED_2,
REPAIR_INNER_STATUS_CONFIRM_SUCCESS,
REPAIR_INNER_STATUS_CONFIRM_FAILED,
REPAIR_INNER_STATUS_FINISHED,
REPAIR_INNER_STATUS_COMMIT_FAILED,
REPAIR_INNER_STATUS_FAILED_1,
} from '@/constants';
// 售后维修外部状态 StatusTag map
......@@ -34,11 +36,13 @@ export const REPAIR_OUTER_STATUS_TAG_MAP = {
// 售后维修内部部状态 Badge map
export const REPAIR_INNER_STATUS_BADGE_MAP = {
[REPAIR_INNER_STATUS_UNCOMMITTED]: '#669EDE',
[REPAIR_INNER_STATUS_COMMITTED]: '#41CC9E',
[REPAIR_INNER_STATUS_COMMIT_SUCCESS]: '#41CC9E',
[REPAIR_INNER_STATUS_SUCCESS_1]: '#41CC9E',
[REPAIR_INNER_STATUS_SUCCESS_2]: '#41CC9E',
[REPAIR_INNER_STATUS_FAILED]: '#EF6260',
[REPAIR_INNER_STATUS_FAILED_2]: '#EF6260',
[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 = () => {
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......
......@@ -128,6 +128,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......
......@@ -87,6 +87,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
title: '品类',
......
......@@ -110,6 +110,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
title: '商品名称',
dataIndex: 'productName',
align: 'center',
ellipsis: true,
},
{
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