Commit 6e21b722 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 9d340044 4e57c28a
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-09 18:02:56
* @LastEditTime: 2021-02-19 20:33:36
* @Description: 换货收货地址
*/
import React, { useEffect } from 'react';
......@@ -76,21 +76,6 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
useEffect(() => {
const { setFieldState } = modalFormActions;
// if (isEdit) {
// setFieldState('*(shippingAddress,pickupAddress)', state => {
// state.visible = true;
// });
// setFieldState('shippingAddressShow', state => {
// state.visible = false;
// });
// } else {
// setFieldState('*(shippingAddress,pickupAddress)', state => {
// state.visible = false;
// });
// setFieldState('shippingAddressShow', state => {
// state.visible = true;
// });
// }
switch (shippingAddress.deliveryType) {
// 物流
case 1: {
......@@ -257,9 +242,9 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
}
});
onFieldInputChange$('*(shippingAddress,pickupAddress)').subscribe(fieldState => {
onFieldInputChange$('*(shippingAddress,pickupAddress)').subscribe(async fieldState => {
const { value, originAsyncData = [] } = fieldState;
const deliveryTypeValue = getFieldValue('deliveryType');
const deliveryTypeValue = await getFieldValue('deliveryType');
const fullData = originAsyncData.find(item => item.id === value);
if (onSubmit) {
......
......@@ -19,6 +19,8 @@ import {
import {
EXCHANGE_OUTER_STATUS_FINISHED,
EXCHANGE_INNER_STATUS_UNCOMMITTED,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
......@@ -76,6 +78,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [replaceGoodsLoading, setExchangeGoodsLoading] = useState(false);
const [infoLoading, setInfoloading] = useState(false);
const isPointsOrder = detailInfo?.orderType === ORDER_TYPE2_POINTS || detailInfo?.orderType === ORDER_TYPE2_CHANNEL_POINTS;
const productColumns: EditableColumns[] = [
{
title: '订单号',
......@@ -114,17 +117,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
align: 'center',
},
{
title: '采购数量',
title: !isPointsOrder ? '采购数量' : '兑换数量',
dataIndex: 'purchaseCount',
align: 'center',
},
{
title: '采购单价',
title: !isPointsOrder ? '采购单价' : '所需积分',
dataIndex: 'purchasePrice',
align: 'center',
},
{
title: '采购金额',
title: !isPointsOrder ? '采购金额' : '所需积分小计',
dataIndex: 'purchaseAmount',
align: 'center',
},
......
......@@ -134,7 +134,7 @@ const ExchangePrAddLogistics: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit?id=${record.replaceId}`)
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit?id=${record.returnLogisticsId}`)
}
>
编辑
......
......@@ -188,6 +188,19 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
];
};
const setColumnsTitle = (orderType: number) => {
const isPointsOrder = orderType === ORDER_TYPE2_POINTS || orderType === ORDER_TYPE2_CHANNEL_POINTS;
// addSchemaAction.setFieldState('replaceGoodsList.*.purchasePrice', state => {
// state.title = !isPointsOrder ? '采购单价' : '所需积分';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseCount', state => {
// state.title = !isPointsOrder ? '采购数量' : '兑换数量';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseAmount', state => {
// state.title = !isPointsOrder ? '采购金额' : '所需积分小计';
// });
};
// 根据供应会员获取订单列表
const getOrderList = (params): Promise<OrderListRes> => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
......@@ -295,6 +308,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
...rest,
});
setGoodsValue(goodsDetailList.map(item => item.orderRecordId));
setColumnsTitle(orderType);
}
}).finally(() => {
setInfoLoading(false);
......@@ -514,6 +528,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const handleGoodsConfirm = values => {
const preValues = addSchemaAction.getFieldValue('replaceGoodsList');
const value = [];
const first = values.length ? values[0] : {};
values.forEach(item => {
const atom = {
......@@ -541,6 +556,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
if (preValues.length) {
newData.reverse();
}
setColumnsTitle(first.orderType);
addSchemaAction.setFieldValue('replaceGoodsList', newData);
};
......
......@@ -47,6 +47,10 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
onOk() {
return PublicApi.postAsReplaceGoodsContinueReplaceDeliveryGoods({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
......@@ -64,6 +68,10 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
onOk() {
return PublicApi.postAsReplaceGoodsContinueReplaceDeliveryGoods({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
},
});
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-29 15:50:05
* @LastEditTime: 2021-02-19 20:34:16
* @Description:
*/
import React, { useState } from 'react';
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 18:36:23
* @LastEditTime: 2021-02-19 16:47:29
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -139,7 +139,7 @@ const ReturnPrAddLogistics: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit?id=${record.returnId}`)
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit?id=${record.returnLogisticsId}`)
}
>
编辑
......
......@@ -55,13 +55,12 @@
}
.commodityList {
display: flex;
flex-wrap: wrap;
padding: 0 5px 50px 0;
overflow-y: auto;
height: 100vh;
.commodityItem {
display: inline-block;
width: 50%;
.commodityItemBody {
......
......@@ -149,7 +149,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
if(isMemberPrice) {
parameter = await getMemberCredit(item.commodityUnitPrice.commodity.memberId, item.commodityUnitPrice.commodity.memberRoleId)
}
Object.keys(unitPrice).forEach(key => {
unitPrice && Object.keys(unitPrice).forEach(key => {
const keyArr = key.split('-')
const min = keyArr[0]
const max = keyArr[1]
......@@ -225,6 +225,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
const index = checkedList.indexOf(id)
checkedList.splice(index, 1)
setCheckedList(checkedList)
if(checkedList.length === 0) {
setIndeterminate(false)
}
}
}
......@@ -319,7 +322,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
if (isEmpty(priceItem)) {
priceItem = getMaxCountRange(priceRange, count)
}
return parseFloat(priceItem.price) * count
return (priceItem && priceItem.price) ? parseFloat(priceItem.price) * count : 0
}
}
......
......@@ -2,10 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-26 19:31:37
* @LastEditTime: 2021-02-19 20:24:47
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { Modal, message } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
......@@ -530,6 +530,31 @@ export const useBusinessEffects = (context, actions) => {
const { name, originAsyncData, value } = fieldState;
const current = originAsyncData.find(item => item.id === value);
const invoicesTypeIdVal = getFieldValue('invoicesTypeId');
const invoicesDetailsRequestsValue = getFieldValue('invoicesDetailsRequests');
const itemNoValue = getFieldValue(FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.itemNo`
}));
// 这里判断是否货品 跟 商品 都已经选择过了,不可重复选择
const sameGood = invoicesDetailsRequestsValue.find(item => item.itemNo === itemNoValue);
if (
invoicesDetailsRequestsValue.length > 1 &&
sameGood &&
sameGood.product === value
) {
message.warning('存在相同货号+商品的组合,请重新选择');
setTimeout(() => {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.product`
}),
state => {
state.value = undefined;
}
);
}, 0);
return;
}
// 取消选择
if (!value) {
......@@ -767,7 +792,6 @@ export const useBusinessEffects = (context, actions) => {
};
}
);
});
// 关联明细 商品数量 联动计算商品金额
......
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