Commit 2a658b80 authored by XieZhiXiong's avatar XieZhiXiong

chore: 添加获取支付信息的逻辑中

parent 41c871d8
......@@ -420,13 +420,6 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
}) :
[]
,
// 计算已支付金额,采购单价 * 支付比例 累加
payAmount:
product.payInfoList
? product.payInfoList.reduce((prev, now) => {
return now.externalState === PayOutWorkState.CONFIRM_ACCOUNT ? +(new BigNumber(+product.purchaseCount).multipliedBy(product.price).multipliedBy(new BigNumber(now.payRatio).dividedBy(100))).toFixed(2) + prev : prev;
}, 0)
: product.paidAmount,
});
}
});
......
......@@ -2,13 +2,14 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-11 09:46:59
* @LastEditTime: 2021-08-25 15:47:51
* @Description: 查看退货数量与退款金额 抽屉
*/
import React, { useEffect } from 'react';
import { Drawer, Button } from 'antd';
import React, { useEffect, useState } from 'react';
import { Drawer, Button, Spin } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
......@@ -69,6 +70,10 @@ export interface OrderInfo {
*/
orderNo: string;
/**
* 订单id
*/
orderId: number;
/**
* 订单类型
*/
orderType: number;
......@@ -148,6 +153,27 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
onSubmit,
isEdit = false,
}) => {
const [payInfoLoading, setPayInfoLoading] = useState(false);
console.log('orderInfo', orderInfo);
const getPayInfo = () => {
if (!orderInfo || !orderInfo.orderId) {
return;
}
setPayInfoLoading(true);
PublicApi.getOrderCommonAfterSalePaymentFind({
orderId: `${orderInfo.orderId}`,
}).then((res) => {
console.log('res', res);
}).finally(() => {
setPayInfoLoading(false);
});
};
useEffect(() => {
getPayInfo();
}, [orderInfo]);
useEffect(() => {
const { setFieldState } = schemaAction;
......@@ -221,22 +247,24 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
}
destroyOnClose
>
<NiceForm
initialValues={orderInfo}
previewPlaceholder=" "
components={{
Stamp,
SteamerTicket,
}}
editable={isEdit}
effects={($, actions) => {
createEffects($, actions);
}}
onSubmit={handleSubmit}
actions={schemaAction}
schema={schema}
colon
/>
<Spin spinning={payInfoLoading}>
<NiceForm
initialValues={orderInfo}
previewPlaceholder=" "
components={{
Stamp,
SteamerTicket,
}}
editable={isEdit}
effects={($, actions) => {
createEffects($, actions);
}}
onSubmit={handleSubmit}
actions={schemaAction}
schema={schema}
colon
/>
</Spin>
</Drawer>
);
};
......
......@@ -289,6 +289,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
{
title: !isPointsOrder ? '采购金额' : '所需积分小计',
dataIndex: 'paidAmount',
render: (text, record) => +text ? ${text}` : record.amount,
},
{
title: '已换货数量',
......
......@@ -672,6 +672,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const preValues = addSchemaAction.getFieldValue('returnGoodsList');
const value = [];
console.log('values', values)
values.forEach(item => {
const atom = {
id: item.id,
......
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