Commit d3938b76 authored by XieZhiXiong's avatar XieZhiXiong

添加新增物流单跳转

parent 4f840d2a
......@@ -18,6 +18,7 @@ import { GetOrderOneBatchOrderListResponse } from '@/services/OrderApi';
import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import NiceForm from '@/components/NiceForm';
import NestTable from '@/components/NestTable';
import { goodItem, OrderListParams, OrderListRes } from './interface';
import { listSearchSchema } from './schema';
import styles from './index.less';
......@@ -25,48 +26,6 @@ const formActions = createFormActions();
const PAGE_SIZE = 5;
interface goodItem {
// ID
id: string;
// 商品ID
productId: string;
// 订单ID
orderId: string;
// productName
productName: string;
// 品类
category: string;
// 品牌
brand: string;
// 单位
unit: string;
// 价格
price: number;
// 采购数量
purchaseCount: number;
// 退货数据
returnCount: number;
// 换货数量
replaceCount: number;
// 维修数量
repairCount: number;
// 一加工数量
processNum: number;
};
export interface OrderListParams {
orderNo: string;
orderThe: string;
startCreateTime: string;
endCreateTime: string;
type: number;
};
export interface OrderListRes {
data: { [key: string]: any }[];
totalCount: number;
};
interface GoodsDrawerProps {
// 选中值(子表格的值)
checked: number[];
......@@ -422,6 +381,17 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
fullDate.push({
...product,
orderNo: item.orderNo, // 手动补全订单单号
payList:
item.payInfoList ?
item.payInfoList.map(item => {
const { payPrice, ...rest } = item;
return {
payAmount: payPrice,
...rest,
}
}) :
[]
,
});
}
});
......
/*
* @Author: XieZhiXiong
* @Date: 2020-12-09 16:28:28
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 16:28:29
* @Description:
*/
export interface goodItem {
/**
* ID
*/
id: string;
/**
* 商品ID
*/
productId: string;
/**
* 订单ID
*/
orderId: string;
/**
* 商品名称
*/
productName: string;
/**
* 品类
*/
category: string;
/**
* 品牌
*/
brand: string;
/**
* 单位
*/
unit: string;
/**
* 价格
*/
price: number;
/**
* 采购数量
*/
purchaseCount: number;
/**
* 退货数据
*/
returnCount: number;
/**
* 换货数量
*/
replaceCount: number;
/**
* 维修数量
*/
repairCount: number;
/**
* 一加工数量
*/
processNum: number;
/**
* 支付信息
*/
payInfoList: {
id?: number
/**
* 采购单ID
*/
orderId?: number
/**
* 支付次数
*/
payCount?: number
/**
* 支付环节
*/
payNode?: string
/**
* 外部状态:1.待支付2.待确认支付结果3.确认到账4.确认未到账
*/
externalState?: number
/**
* 支付比例
*/
payRatio?: number
/**
* 支付金额
*/
payPrice?: number
/**
* 支付方式:1.线上支付2.线下3.授信4.货到付款
*/
payWay?: number
/**
* 支付渠道
*/
channel?: number
/**
* 支付时间
*/
payTime?: number
/**
* 支付凭证
*/
payOrderUrls?: string
/**
* 支付流水号
*/
payCode?: string
/**
* 支付配置:1.平台代收2.会员直接到账
*/
ruleConfigurationId?: number
}[]
};
export interface OrderListParams {
orderNo: string;
orderThe: string;
startCreateTime: string;
endCreateTime: string;
type: number;
};
export interface OrderListRes {
data: { [key: string]: any }[];
totalCount: number;
};
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 14:11:01
* @LastEditTime: 2020-12-09 16:38:48
* @Description: 查看退货数量与退款金额 抽屉
*/
import React from 'react';
......@@ -167,6 +167,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
>
<NiceForm
initialValues={orderInfo}
previewPlaceholder=" "
components={{
Stamp,
SteamerTicket,
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-18 11:22:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-19 18:16:33
* @LastEditTime: 2020-12-09 17:06:14
* @Description: 待新增换货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -17,6 +17,10 @@ import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import {
EXCHANGE_INNER_STATUS_CONSUMER_NOT_ADDED_LOGISTICS,
EXCHANGE_INNER_STATUS_CONSUMER_UNCONFIRMED_LOGISTICS,
} from '@/constants';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
......@@ -95,18 +99,28 @@ const ExchangePrAddLogistics: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => {}}
>
查看物流单
</Button>
{record.innerStatus === EXCHANGE_INNER_STATUS_CONSUMER_NOT_ADDED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${4}&shipmentOrderCode=${record.returnDeliveryNo}&relevanceOrderId=${record.replaceId}&relevanceType=${2}`)
}
>
新增
</Button>
)}
{record.innerStatus === EXCHANGE_INNER_STATUS_CONSUMER_UNCONFIRMED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${record.returnDeliveryId}`)
}
>
查看物流单
</Button>
)}
</>
),
},
......
......@@ -15,7 +15,8 @@ import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm';
import GoodsDrawer, { OrderListRes } from '../../../../components/GoodsDrawer';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import { addBillSchema } from './schema';
import { createEffects } from './effects';
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-18 11:22:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-19 18:57:56
* @LastEditTime: 2020-12-09 17:10:48
* @Description: 待新增换货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -17,6 +17,10 @@ import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import {
EXCHANGE_INNER_STATUS_SUPPLIER_NOT_ADDED_LOGISTICS,
EXCHANGE_INNER_STATUS_SUPPLIER_UNCONFIRMED_LOGISTICS,
} from '@/constants';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
......@@ -71,7 +75,7 @@ const ReturnPrAddLogistics: React.FC = () => {
},
{
title: '换货发货单号',
dataIndex: 'returnDeliveryNo',
dataIndex: 'replaceDeliveryNo',
align: 'center',
render: text => <a>{text}</a>,
},
......@@ -95,18 +99,28 @@ const ReturnPrAddLogistics: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => {}}
>
查看物流单
</Button>
{record.innerStatus === EXCHANGE_INNER_STATUS_SUPPLIER_NOT_ADDED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${5}&shipmentOrderCode=${record.replaceDeliveryNo}&relevanceOrderId=${record.replaceId}&relevanceType=${3}`)
}
>
新增
</Button>
)}
{record.innerStatus === EXCHANGE_INNER_STATUS_SUPPLIER_UNCONFIRMED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${record.replaceDeliveryId}`)
}
>
查看物流单
</Button>
)}
</>
),
},
......
......@@ -13,7 +13,8 @@ import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import GoodsDrawer, { OrderListRes } from '../../../../components/GoodsDrawer';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import { addBillSchema } from './schema';
import { createEffects } from './effects';
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-17 17:22:07
* @LastEditTime: 2020-12-09 17:14:37
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -17,6 +17,10 @@ import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import {
RETURN_INNER_STATUS_CONSUMER_NOT_ADDED_LOGISTICS,
RETURN_INNER_STATUS_CONSUMER_UNCONFIRMED_LOGISTICS,
} from '@/constants';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
......@@ -100,18 +104,28 @@ const ReturnPrAddLogistics: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => {}}
>
查看物流单
</Button>
{record.innerStatus === RETURN_INNER_STATUS_CONSUMER_NOT_ADDED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${6}&shipmentOrderCode=${record.returnDeliveryNo}&relevanceOrderId=${record.returnId}&relevanceType=${4}`)
}
>
新增
</Button>
)}
{record.innerStatus === RETURN_INNER_STATUS_CONSUMER_UNCONFIRMED_LOGISTICS && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${record.returnDeliveryId}`)
}
>
查看物流单
</Button>
)}
</>
),
},
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-08 13:48:59
* @LastEditTime: 2020-12-09 16:18:45
* @Description: 联动逻辑相关
*/
import { FormEffectHooks, FormPath } from '@formily/antd';
......@@ -48,4 +48,29 @@ export const useBusinessEffects = (context, actions) => {
break
};
});
// 校验退货数量
onFieldInputChange$('returnGoodsList.*.returnCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已退货数量
const replacedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `returnGoodsList.${$1}.returnedCount`
}),
state => state.value,
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `returnGoodsList.${$1}.returnCount`
}),
state => {
if (+value > replacedCountValue) {
state.errors = '填写值已超过最大可退货数量,请重新填写';
} else {
state.errors = '';
}
}
);
});
}
\ No newline at end of file
......@@ -15,7 +15,8 @@ import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm';
import GoodsDrawer, { OrderListRes } from '../../../../components/GoodsDrawer';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import ReturnInfoDrawer, { OrderInfo } from '../../../../components/ReturnInfoDrawer';
import { addBillSchema } from './schema';
......@@ -471,12 +472,13 @@ const ReturnForm: React.FC<BillsFormProps> = ({
purchasePrice: item.price,
purchaseCount: item.purchaseCount,
purchaseAmount: +(item.price * item.purchaseCount).toFixed(2),
returnedCount: item.returnCount || item.purchaseCount || 0, // 已退货数量
returnCount: '',
returnAmount: '',
extraData: {
id: item.id,
returnReason: '',
payList: [],
payList: item.payList,
},
};
value.push(atom);
......@@ -492,32 +494,12 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const { getFieldValue } = addSchemaAction;
const returnGoodsListValue = getFieldValue('returnGoodsList');
const item = returnGoodsListValue[index];
if (!item.extraData.payList.length) {
const res = await PublicApi.getOrderProcurementOrderDetails({
id: item.orderId,
});
if (res.code !== 1000) {
return;
}
setOrderInfo({
index,
...item,
payList: res.data.paymentInformationResponses.map(item => {
return {
...item,
payAmount: item.payPrice,
};
}),
});
} else {
setOrderInfo({
index,
...item,
payList: item.extraData.payList,
});
}
setOrderInfo({
index,
...item,
payList: item.extraData.payList,
});
setVisibleReturnInfoDrawer(true)
};
......
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