Commit 5c246af7 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复线下退款id传错的问题

parent bb664d91
......@@ -66,10 +66,6 @@ export type ValueType = {
export type SubmitValueType = {
/**
* 账户id
*/
id: number,
/**
* 支付凭证 ,PayProveBO
*/
payProve?: {
......@@ -122,6 +118,10 @@ interface IProps {
* 采购商角色id
*/
purchaserRoleId: number,
/**
* 弹窗提交 loading
*/
submitLoading: boolean;
}
const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
......@@ -131,6 +131,7 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
onSubmit,
purchaserId,
purchaserRoleId,
submitLoading,
} = props;
const [bankAccount, setBankAccount] = useState<BankAccount>({
name: '',
......@@ -140,7 +141,6 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
});
const [loading, setLoading] = useState(false);
const [refundDisabled, setRefundDisabled] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
// 获取对公账户信息
const getSettleAccountsGetMemberAccountConfig = () => {
......@@ -194,13 +194,12 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
return;
}
onSubmit({
id,
payProve: {
...rest,
fileList: fileList.map(item => item.status === 'done' && ({
name: item.name,
proveUrl: item.url,
})).filter(Boolean),
})).filter(Boolean) as any,
},
});
}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 18:02:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-04-19 17:20:33
* @LastEditTime: 2021-08-30 19:37:43
* @Description: 退款明细
*/
import React, { useState } from 'react';
......@@ -281,7 +281,11 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
const handlePaymentVoucherSubmit = (value) => {
if (onRefund) {
return onRefund(value);
setSubmitLoading(true);
return onRefund({ ...value, id: refundModalValue.id }).finally(() => {
setSubmitLoading(false);
setPaymentVoucherVisible(false);
});
}
return Promise.reject();
};
......@@ -450,6 +454,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
onSubmit={handlePaymentVoucherSubmit}
purchaserId={refundModalValue.purchaserId as number}
purchaserRoleId={refundModalValue.purchaserRoleId as number}
submitLoading={submitLoading}
/>
</MellowCard>
);
......
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