Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
d1076053
Commit
d1076053
authored
Feb 19, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复确认退款全部到账按钮未在特定条件显示的问题
parent
9cdcfbc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
29 deletions
+50
-29
index.tsx
...Service/returnApplication/components/DetailInfo/index.tsx
+5
-5
verify.tsx
...ervice/returnApplication/returnPrConfirmResult/verify.tsx
+45
-24
No files found.
src/pages/afterService/returnApplication/components/DetailInfo/index.tsx
View file @
d1076053
...
@@ -48,6 +48,9 @@ const ReturnAddressInfo = React.lazy(() => import('../../../components/ReturnAdd
...
@@ -48,6 +48,9 @@ const ReturnAddressInfo = React.lazy(() => import('../../../components/ReturnAdd
const
Score
=
React
.
lazy
(()
=>
import
(
'../../../components/Score'
));
const
Score
=
React
.
lazy
(()
=>
import
(
'../../../components/Score'
));
const
FlowRecords
=
React
.
lazy
(()
=>
import
(
'../../../components/FlowRecords'
));
const
FlowRecords
=
React
.
lazy
(()
=>
import
(
'../../../components/FlowRecords'
));
export
interface
DetailInfoData
extends
GetAsReturnGoodsGetDetailByConsumerResponse
{
fileList
:
FileData
[];
};
interface
DetailInfoProps
{
interface
DetailInfoProps
{
/**
/**
* 记录id
* 记录id
...
@@ -64,10 +67,7 @@ interface DetailInfoProps {
...
@@ -64,10 +67,7 @@ interface DetailInfoProps {
/**
/**
* 头部右侧拓展
* 头部右侧拓展
*/
*/
headExtra
?:
(
info
:
DetailInfo
)
=>
React
.
ReactNode
;
headExtra
?:
(
info
:
DetailInfoData
)
=>
React
.
ReactNode
;
};
interface
DetailInfo
extends
GetAsReturnGoodsGetDetailByConsumerResponse
{
fileList
:
FileData
[];
};
};
const
DetailInfo
:
React
.
FC
<
DetailInfoProps
>
=
({
const
DetailInfo
:
React
.
FC
<
DetailInfoProps
>
=
({
...
@@ -76,7 +76,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -76,7 +76,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
target
,
target
,
headExtra
=
null
,
headExtra
=
null
,
})
=>
{
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
Data
>
(
null
);
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
returnGoodsLoading
,
setReturnGoodsLoading
]
=
useState
(
false
);
const
[
returnGoodsLoading
,
setReturnGoodsLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
...
...
src/pages/afterService/returnApplication/returnPrConfirmResult/verify.tsx
View file @
d1076053
import
React
,
{
useState
}
from
'react'
;
/*
import
{
Button
}
from
'antd'
;
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-19 11:21:59
* @Description:
*/
import
React
from
'react'
;
import
{
Button
,
Modal
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
FormOutlined
,
ExclamationCircleOutlined
}
from
'@ant-design/icons'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
DetailInfo
from
'../components/DetailInfo'
;
import
{
REFUND_OUTER_STATUS_RECEIVED
}
from
'../../constants'
;
import
DetailInfo
,
{
DetailInfoData
}
from
'../components/DetailInfo'
;
const
{
confirm
}
=
Modal
;
const
ReturnPrConfirmResultVerify
:
React
.
FC
=
()
=>
{
const
ReturnPrConfirmResultVerify
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
{
id
}
=
usePageStatus
();
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
handleSubmit
=
values
=>
{
const
handleSubmit
=
values
=>
{
if
(
!
id
)
{
if
(
!
id
)
{
return
;
return
;
}
}
setSubmitLoading
(
true
);
confirm
({
PublicApi
.
postAsReturnGoodsConfirmAllRefund
({
title
:
'提示'
,
dataId
:
id
,
icon
:
<
ExclamationCircleOutlined
/>,
}).
then
(
res
=>
{
content
:
`是否本单所有退款确认到账?`
,
if
(
res
.
code
===
1000
)
{
onOk
()
{
history
.
goBack
();
return
PublicApi
.
postAsReturnGoodsConfirmAllRefund
({
}
dataId
:
id
,
}).
finally
(()
=>
{
}).
then
(
res
=>
{
setSubmitLoading
(
false
);
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
},
});
});
};
};
...
@@ -30,16 +43,24 @@ const ReturnPrConfirmResultVerify: React.FC = () => {
...
@@ -30,16 +43,24 @@ const ReturnPrConfirmResultVerify: React.FC = () => {
<>
<>
<
DetailInfo
<
DetailInfo
id=
{
id
}
id=
{
id
}
headExtra=
{
()
=>
(
headExtra=
{
(
info
:
DetailInfoData
)
=>
{
<
Button
const
{
refundList
=
[]
}
=
info
||
{};
type=
"primary"
// 是否全部已退款,只有当退款明细中所有退款金额大于0的记录的状态都为确认退款到账时本按钮才可点击
icon=
{
<
FormOutlined
/>
}
const
isAllRefunded
=
refundList
.
every
((
item
)
=>
item
.
detailList
.
every
((
detail
)
=>
detail
.
refundAmount
>
0
&&
detail
.
outerStatus
===
REFUND_OUTER_STATUS_RECEIVED
));
loading=
{
submitLoading
}
onClick=
{
handleSubmit
}
return
[
>
isAllRefunded
?
(
确认本单所有退款到账
<
Button
</
Button
>
type=
"primary"
)
}
icon=
{
<
FormOutlined
/>
}
onClick=
{
handleSubmit
}
key=
"confirmAllRefunded"
>
确认本单所有退款到账
</
Button
>
)
:
null
,
]
}
}
target=
"/memberCenter/afterService/returnApplication/returnPrConfirmResult"
target=
"/memberCenter/afterService/returnApplication/returnPrConfirmResult"
isEdit
isEdit
/>
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment