Commit 75049b75 authored by XieZhiXiong's avatar XieZhiXiong

完善业务逻辑

parent 43e6adb6
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-25 11:22:40
* @LastEditTime: 2020-12-10 17:56:20
* @Description: 维修商品抽屉组件
*/
import React, { useState, useEffect } from 'react';
......@@ -392,6 +392,13 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
}) :
[]
,
// 计算已支付金额,采购单价 * 支付比例 累加
payAmount:
item.payInfoList ?
item.payInfoList.reduce((prev, now) => {
return +((product.price * product.purchaseCount * (now.payRatio / 100)).toFixed(2)) + prev;
}, 0) :
0
});
}
});
......
......@@ -473,6 +473,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
purchaseCount: item.purchaseCount,
purchaseAmount: +(item.price * item.purchaseCount).toFixed(2),
returnedCount: item.returnCount || item.purchaseCount || 0, // 已退货数量
payAmount: item.payAmount,
returnCount: '',
returnAmount: '',
extraData: {
......
......@@ -270,7 +270,7 @@ export const addBillSchema: ISchema = {
title: '采购金额',
'x-component': 'Text',
},
costPrice4: {
payAmount: {
type: 'string',
title: '已支付金额',
'x-component': 'Text',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 15:30:56
* @LastEditTime: 2020-12-10 18:28:29
* @Description:
*/
import React, { useState } from 'react';
......@@ -14,24 +14,24 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const ReturnPrReturnVerify: React.FC = () => {
const { id, creditId } = usePageStatus();
const { id } = usePageStatus();
const [visible, setVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = values => {
const handleSubmit = () => {
if (!id) {
return;
}
// setSubmitLoading(true);
// PublicApi.postAsReturnGoodsConfirmAllRefund({
// dataId: id,
// }).then(res => {
// if (res.code === 1000) {
// history.goBack();
// }
// }).finally(() => {
// setSubmitLoading(false);
// });
setSubmitLoading(true);
PublicApi.postAsReturnGoodsCompleteRefund({
dataId: id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
}).finally(() => {
setSubmitLoading(false);
});
};
return (
......@@ -44,6 +44,7 @@ const ReturnPrReturnVerify: React.FC = () => {
type="primary"
icon={<FormOutlined />}
loading={submitLoading}
onClick={handleSubmit}
>
确认本单已完成所有退款
</Button>
......
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