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
74d819f7
Commit
74d819f7
authored
Aug 31, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 完善联动逻辑
parent
e6bb5ed2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
26 deletions
+24
-26
index.tsx
src/pages/afterService/components/ReturnDetailInfo/index.tsx
+2
-2
useBusinessEffects.ts
...components/ReturnInfoDrawer/effects/useBusinessEffects.ts
+13
-11
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+3
-5
useBusinessEffects.ts
...mit/components/ExchangeForm/effects/useBusinessEffects.ts
+2
-2
useBusinessEffects.ts
...ubmit/components/ReturnForm/effects/useBusinessEffects.ts
+4
-6
No files found.
src/pages/afterService/components/ReturnDetailInfo/index.tsx
View file @
74d819f7
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 18:02:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-
27 16:09:15
* @LastEditTime: 2021-08-
30 19:38:32
* @Description: 退款明细
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -318,7 +318,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
const
handlePaymentVoucherSubmit
=
(
value
)
=>
{
if
(
onRefund
)
{
setSubmitLoading
(
true
);
return
onRefund
({
...
value
,
id
:
refundModalValue
.
id
}).
finally
(()
=>
{
return
onRefund
({
...
value
,
id
:
refundModalValue
.
id
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
setPaymentVoucherVisible
(
false
);
});
...
...
src/pages/afterService/components/ReturnInfoDrawer/effects/useBusinessEffects.ts
View file @
74d819f7
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
5-13 11:43:00
* @LastEditTime: 2021-0
8-31 10:34:04
* @Description: 联动逻辑相关
*/
import
BigNumber
from
'bignumber.js'
;
...
...
@@ -37,7 +37,7 @@ export const useBusinessEffects = (context, actions) => {
const
{
value
}
=
fieldState
;
const
purchasePriceValue
=
await
getFieldValue
(
'purchasePrice'
);
const
orderTypeValue
=
await
getFieldValue
(
'orderType'
);
const
payListValue
=
await
getFieldValue
(
'payList'
);
const
payListValue
=
await
getFieldValue
(
'payList'
)
||
[]
;
const
isMateriel
=
(
orderTypeValue
===
ORDER_TYPE_INQUIRY_CONTRACT
...
...
@@ -45,14 +45,16 @@ export const useBusinessEffects = (context, actions) => {
||
orderTypeValue
===
ORDER_TYPE_TENDER_CONTRACT
);
const
newData
=
[...
payListValue
].
map
(
item
=>
{
const
refundAmount
=
item
.
payTime
?
+
(
new
BigNumber
(
+
value
).
multipliedBy
(
purchasePriceValue
).
multipliedBy
(
new
BigNumber
(
item
.
payRatio
).
dividedBy
(
100
))).
toFixed
(
2
)
:
0
;
return
{
...
item
,
refundAmount
,
};
});
setFieldValue
(
'payList'
,
newData
);
if
(
!
isMateriel
)
{
const
newData
=
[...
payListValue
].
map
(
item
=>
{
const
refundAmount
=
item
.
payTime
?
+
(
new
BigNumber
(
+
value
).
multipliedBy
(
purchasePriceValue
).
multipliedBy
(
new
BigNumber
(
item
.
payRatio
).
dividedBy
(
100
))).
toFixed
(
2
)
:
0
;
return
{
...
item
,
refundAmount
,
};
});
setFieldValue
(
'payList'
,
newData
);
}
if
(
isMateriel
)
{
const
refundAmount
=
+
(
new
BigNumber
(
+
value
).
multipliedBy
(
purchasePriceValue
).
toFixed
(
2
));
...
...
@@ -62,7 +64,7 @@ export const useBusinessEffects = (context, actions) => {
// 校验退货数量
onFieldInputChange$
(
'returnCount'
).
subscribe
(
async
(
fieldState
)
=>
{
const
{
name
,
value
}
=
fieldState
;
const
{
value
}
=
fieldState
;
// 剩余数量
const
remainingValue
=
await
getFieldValue
(
'remaining'
);
...
...
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
74d819f7
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-
26 19:54:01
* @LastEditTime: 2021-08-
31 10:33:36
* @Description: 查看退货数量与退款金额 抽屉
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
...
...
@@ -22,9 +22,6 @@ import Stamp from '../Stamp';
import
SteamerTicket
from
'./components/SteamerTicket'
;
const
schemaAction
=
createAsyncFormActions
();
const
{
onFormMount$
,
}
=
FormEffectHooks
;
export
type
PayListItem
=
{
/**
...
...
@@ -219,7 +216,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
refundAmount
:
+
(
new
BigNumber
(
+
applyInfo
.
remaining
).
multipliedBy
(
applyInfo
.
purchasePrice
).
multipliedBy
(
new
BigNumber
(
item
.
payRate
*
100
).
dividedBy
(
100
))).
toFixed
(
2
),
payTime
:
item
.
payTime
,
payRuleId
:
item
.
fundMode
,
externalState
:
3
,
externalState
:
3
,
// 这个状态写死了,因为现在只有付款了才会出现这条支付信息
transactionPayId
:
item
.
tradeNo
,
// 微信 或 其他第三方支付返回的 code,原路退款需要
}));
}
...
...
@@ -237,6 +234,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
...
applyInfo
,
payList
,
returnCount
:
applyInfo
.
returnCount
||
applyInfo
.
remaining
,
// 默认赋值
refundAmount
:
applyInfo
.
refundAmount
||
+
(
new
BigNumber
(
+
applyInfo
.
remaining
).
multipliedBy
(
applyInfo
.
purchasePrice
)),
// 默认赋值
});
};
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/effects/useBusinessEffects.ts
View file @
74d819f7
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-21 16:26:34
* @LastEditTime: 2021-0
8-31 10:42:22
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -77,7 +77,7 @@ export const useBusinessEffects = (context, actions) => {
});
// 供应会员联动 单据明细
onFieldInputChange$
(
'
supplierMember
'
).
subscribe
(
fieldState
=>
{
onFieldInputChange$
(
'
*(supplierMember,orderType)
'
).
subscribe
(
fieldState
=>
{
const
replaceGoodsListValue
=
getFieldValue
(
'replaceGoodsList'
);
if
(
replaceGoodsListValue
&&
replaceGoodsListValue
.
length
)
{
setFieldValue
(
'replaceGoodsList'
,
[]);
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/effects/useBusinessEffects.ts
View file @
74d819f7
...
...
@@ -2,10 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-05 11:40:35
* @LastEditTime: 2021-0
8-31 10:32:33
* @Description: 联动逻辑相关
*/
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
FormEffectHooks
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
const
{
...
...
@@ -17,8 +17,6 @@ export const useBusinessEffects = (context, actions) => {
const
{
getFieldValue
,
setFieldValue
,
getFieldState
,
setFieldState
,
}
=
actions
;
const
linkage
=
useLinkageUtils
();
...
...
@@ -49,8 +47,8 @@ export const useBusinessEffects = (context, actions) => {
};
});
// 供应会员联动 单据明细
onFieldInputChange$
(
'
supplierMember
'
).
subscribe
(
fieldState
=>
{
// 供应会员
、售后订单类型
联动 单据明细
onFieldInputChange$
(
'
*(supplierMember,orderType)
'
).
subscribe
(
fieldState
=>
{
const
replaceGoodsListValue
=
getFieldValue
(
'returnGoodsList'
);
if
(
replaceGoodsListValue
&&
replaceGoodsListValue
.
length
)
{
setFieldValue
(
'returnGoodsList'
,
[]);
...
...
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