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
linweijiong
jinfa-platform
Commits
bc901a26
Commit
bc901a26
authored
Aug 26, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接售后支付信息相关
parent
813a0f37
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
112 deletions
+155
-112
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+0
-4
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+137
-89
index.ts
.../afterService/components/ReturnInfoDrawer/schema/index.ts
+2
-1
index.tsx
...Service/returnApplication/components/DetailInfo/index.tsx
+5
-4
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+6
-10
index.tsx
...afterService/returnManage/components/DetailInfo/index.tsx
+5
-4
No files found.
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
bc901a26
...
...
@@ -9,16 +9,12 @@ import React from 'react';
import
{
Drawer
,
Button
,
Pagination
,
message
}
from
'antd'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
moment
from
'moment'
;
import
BigNumber
from
'bignumber.js'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
PAYWAY
,
PAY_CHANNEL
,
}
from
'@/constants/payment'
;
import
{
PayOutWorkState
,
}
from
'@/constants/order'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
goodItem
,
OrderListRes
}
from
'./interface'
;
...
...
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
bc901a26
...
...
@@ -2,13 +2,14 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-2
5 15:47:51
* @LastEditTime: 2021-08-2
6 15:34:25
* @Description: 查看退货数量与退款金额 抽屉
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Drawer
,
Button
,
Spin
}
from
'antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createAsyncFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
BigNumber
from
'bignumber.js'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
ORDER_TYPE_INQUIRY_CONTRACT
,
...
...
@@ -20,118 +21,148 @@ import { createEffects } from './effects';
import
Stamp
from
'../Stamp'
;
import
SteamerTicket
from
'./components/SteamerTicket'
;
import
styles
from
'./index.less'
;
import
moment
from
'moment'
;
const
schemaAction
=
createAsyncFormActions
();
const
{
onFormMount$
,
}
=
FormEffectHooks
;
export
interface
PayListItem
{
export
type
PayListItem
=
{
/**
* 支付id
*/
payId
:
number
,
/**
* 支付次数
*/
payCount
:
number
,
payCount
:
number
,
/**
* 支付环节
*/
payNode
:
string
,
payNode
:
string
,
/**
* 支付比例
*/
payRatio
:
number
,
payRatio
:
number
,
/**
* 支付金额
*/
payAmount
:
number
,
payAmount
:
number
,
/**
* 支付方式
*/
payWay
:
string
,
payWay
:
number
,
/**
* 支付方式名称
*/
payWayName
:
string
,
/**
* 支付渠道
*/
channel
:
string
,
channel
:
number
,
/**
* 支付
时间
* 支付
渠道名称
*/
payTime
:
string
,
channelName
:
string
,
/**
* 退款金额
*/
refundAmount
:
number
,
};
refundAmount
:
number
,
/**
* 支付时间
*/
payTime
:
string
,
/**
* 支付配置:1.平台代收2.会员直接到账
*/
payRuleId
:
number
,
/**
* 支付外部状态
* 这个字段现在没用了,支付信息返回的都是 确认到账 的数据,后台说写死
*/
externalState
:
number
,
/**
* 第三方支付成功返回的code
*/
transactionPayId
:
string
,
}
export
interface
Order
Info
{
export
interface
ReturnApply
Info
{
/**
* 列表索引
*/
index
?:
number
;
/**
* 订单号
*/
orderNo
:
string
;
/**
* 订单id
*/
orderId
:
number
;
orderId
:
number
,
/**
* 订单
类型
* 订单
号
*/
order
Type
:
number
;
order
No
:
string
,
/**
* 商品名称
*/
productName
:
string
;
productName
:
string
,
/**
* 品类
*/
category
:
string
;
category
:
string
,
/**
* 品
牌
* 品
类
*/
brand
:
string
;
brand
:
string
,
/**
* 单位
*/
unit
:
string
;
unit
:
string
,
/**
* 采购数量
*/
purchaseCount
:
string
;
purchaseCount
:
number
,
/**
* 采购单价
*/
purchasePrice
:
string
;
purchasePrice
:
number
,
/**
* 采购金额
*/
purchaseAmount
:
string
;
purchaseAmount
:
number
,
/**
* 退货数量
*/
returnCount
:
number
,
/**
* 剩余可退数量
*/
remaining
?:
number
,
/**
*
支付记录
*
订单类型
*/
payList
:
PayListItem
[];
orderType
?:
number
,
/**
*
剩余可退货数量
*
支付信息
*/
remaining
?:
number
;
payList
?:
PayListItem
[],
/**
*
退款数量
*
总的退款金额
*/
re
turnCount
?:
number
|
string
;
re
fundAmount
?:
number
,
/**
* 退款理由
*/
returnReason
?:
string
;
};
returnReason
?:
string
,
}
interface
ReturnInfoDrawerProps
{
/**
* 是否可见
*/
visible
:
boolean
;
/**
*
订单
信息
*
申请
信息
*/
orderInfo
:
Order
Info
;
applyInfo
:
ReturnApply
Info
;
/**
* 关闭触发事件
*/
...
...
@@ -147,66 +178,83 @@ interface ReturnInfoDrawerProps {
};
const
ReturnInfoDrawer
:
React
.
FC
<
ReturnInfoDrawerProps
>
=
({
visible
=
false
,
orderInfo
,
onClose
,
onSubmit
,
isEdit
=
false
,
visible
=
false
,
applyInfo
,
onClose
,
onSubmit
,
isEdit
=
false
,
})
=>
{
const
[
innerApplyInfo
,
setInnerApplyInfo
]
=
useState
<
ReturnApplyInfo
|
null
>
(
null
);
const
[
payInfoLoading
,
setPayInfoLoading
]
=
useState
(
false
);
console
.
log
(
'orderInfo'
,
orderInfo
);
const
{
orderType
}
=
(
innerApplyInfo
||
{});
const
isMateriel
=
(
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
const
getPayInfo
=
()
=>
{
if
(
!
orderInfo
||
!
order
Info
.
orderId
)
{
const
getPayInfo
=
async
()
=>
{
if
(
!
applyInfo
||
!
apply
Info
.
orderId
)
{
return
;
}
let
payList
=
applyInfo
.
payList
||
[];
setPayInfoLoading
(
true
);
PublicApi
.
getOrderCommonAfterSalePaymentFind
({
orderId
:
`
${
orderInfo
.
orderId
}
`
,
}).
then
((
res
)
=>
{
console
.
log
(
'res'
,
res
);
}).
finally
(()
=>
{
setPayInfoLoading
(
false
);
try
{
// 编辑状态才请求支付信息,否则默认取申请信息里边的支付信息
if
(
isEdit
)
{
const
res
=
await
PublicApi
.
getOrderCommonAfterSalePaymentFind
({
orderId
:
`
${
applyInfo
.
orderId
}
`
,
});
if
(
res
.
code
===
1000
)
{
payList
=
res
.
data
.
map
((
item
)
=>
({
payId
:
item
.
paymentId
,
payCount
:
item
.
batchNo
,
payNode
:
item
.
payNode
,
payRatio
:
item
.
payRate
*
100
,
payAmount
:
item
.
payAmount
,
payWay
:
item
.
payType
,
payWayName
:
item
.
payTypeName
,
channel
:
item
.
payChannel
,
channelName
:
item
.
payChannelName
,
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
,
transactionPayId
:
'123'
,
// 微信 或 其他第三方支付返回的 code,原路退款需要
}));
}
}
}
catch
(
error
)
{
console
.
warn
(
error
);
}
setPayInfoLoading
(
false
);
if
(
payList
.
length
)
{
schemaAction
.
setFieldState
(
'REPOSIT_TABS'
,
state
=>
{
state
.
props
[
'x-component-props'
].
hiddenKeys
=
[];
});
}
setInnerApplyInfo
({
...
applyInfo
,
payList
,
returnCount
:
applyInfo
.
returnCount
||
applyInfo
.
remaining
,
// 默认赋值
});
};
useEffect
(()
=>
{
getPayInfo
();
},
[
orderInfo
]);
useEffect
(()
=>
{
const
{
setFieldState
}
=
schemaAction
;
const
{
orderType
}
=
(
orderInfo
||
{});
const
isMateriel
=
(
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
if
(
(
orderInfo
&&
(
!
orderInfo
.
payList
||
!
orderInfo
.
payList
.
length
)
)
||
isMateriel
)
{
setFieldState
(
'REPOSIT_TABS'
,
state
=>
{
state
.
props
[
'x-component-props'
].
hiddenKeys
=
[
'tab-2'
];
});
if
(
!
isMateriel
)
{
getPayInfo
();
}
},
[
order
Info
]);
},
[
apply
Info
]);
const
handleClose
=
()
=>
{
if
(
onClose
)
{
onClose
();
}
};
const
handleSubmit
=
values
=>
{
const
handleSubmit
=
(
values
:
ReturnApplyInfo
)
=>
{
if
(
onSubmit
)
{
const
{
remaining
,
orderType
,
...
rest
}
=
values
;
onSubmit
(
rest
);
...
...
@@ -229,15 +277,15 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
textAlign
:
'right'
,
}
}
>
<
Button
onClick=
{
handleClose
}
<
Button
onClick=
{
handleClose
}
style=
{
{
marginRight
:
8
}
}
>
{
onSubmit
?
'取消'
:
'关闭'
}
</
Button
>
{
onSubmit
&&
(
<
Button
onClick=
{
()
=>
schemaAction
.
submit
()
}
<
Button
onClick=
{
()
=>
schemaAction
.
submit
()
}
type=
"primary"
>
确定
...
...
@@ -248,12 +296,12 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
destroyOnClose
>
<
Spin
spinning=
{
payInfoLoading
}
>
<
NiceForm
initialValues=
{
order
Info
}
<
NiceForm
value=
{
innerApply
Info
}
previewPlaceholder=
" "
components=
{
{
Stamp
,
SteamerTicket
,
Stamp
,
SteamerTicket
,
}
}
editable=
{
isEdit
}
effects=
{
(
$
,
actions
)
=>
{
...
...
src/pages/afterService/components/ReturnInfoDrawer/schema/index.ts
View file @
bc901a26
...
...
@@ -15,7 +15,8 @@ const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'tab'
,
'x-component-props'
:
{
tabPosition
:
'left'
,
tabPosition
:
'left'
,
hiddenKeys
:
[
'tab-2'
],
},
properties
:
{
'tab-1'
:
{
...
...
src/pages/afterService/returnApplication/components/DetailInfo/index.tsx
View file @
bc901a26
...
...
@@ -34,7 +34,7 @@ import StatusTag from '@/components/StatusTag';
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
DescProgress
from
'@/components/DescProgress'
;
import
AuditProcess
from
'@/components/AuditProcess'
;
import
ReturnInfoDrawer
,
{
Order
Info
}
from
'../../../components/ReturnInfoDrawer'
;
import
ReturnInfoDrawer
,
{
ReturnApply
Info
}
from
'../../../components/ReturnInfoDrawer'
;
import
{
OuterHistoryData
,
InnerHistoryData
}
from
'../../../components/FlowRecords'
;
import
{
RETURN_OUTER_STATUS_TAG_MAP
,
...
...
@@ -98,10 +98,11 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const
[
returnGoodsLoading
,
setReturnGoodsLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
visibleOrderDetial
,
setVisibleReturnInfo
]
=
useState
<
boolean
>
(
false
);
const
[
orderInfo
,
setOrderInfo
]
=
useState
<
Order
Info
>
(
null
);
const
[
applyInfo
,
setApplyInfo
]
=
useState
<
ReturnApply
Info
>
(
null
);
const
handleCheckOrderDetial
=
record
=>
{
setOrderInfo
({
setApplyInfo
({
orderId
:
record
.
orderId
,
orderNo
:
record
.
orderNo
,
productName
:
record
.
productName
,
category
:
record
.
category
,
...
...
@@ -663,7 +664,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
ReturnInfoDrawer
visible=
{
visibleOrderDetial
}
orderInfo=
{
order
Info
}
applyInfo=
{
apply
Info
}
onClose=
{
()
=>
setVisibleReturnInfo
(
false
)
}
/>
</
AnchorPage
>
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
bc901a26
...
...
@@ -21,7 +21,7 @@ import NiceForm from '@/components/NiceForm';
import
GoodsDrawer
from
'../../../../components/GoodsDrawer'
;
import
{
OrderListRes
}
from
'../../../../components/GoodsDrawer/interface'
;
import
AddressFormItem
from
'../../../../components/AddressFormItem'
;
import
ReturnInfoDrawer
,
{
Order
Info
}
from
'../../../../components/ReturnInfoDrawer'
;
import
ReturnInfoDrawer
,
{
ReturnApply
Info
}
from
'../../../../components/ReturnInfoDrawer'
;
import
{
addSchema
}
from
'./schema'
;
import
{
createEffects
}
from
'./effects'
;
import
{
...
...
@@ -190,7 +190,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
orderInfo
,
setOrderInfo
]
=
useState
<
Order
Info
>
(
null
);
const
[
applyInfo
,
setApplyInfo
]
=
useState
<
ReturnApply
Info
>
(
null
);
const
[
visibleGoodsDrawer
,
setVisibleGoodsDrawer
]
=
useState
(
false
);
const
[
visibleReturnInfoDrawer
,
setVisibleReturnInfoDrawer
]
=
useState
(
false
);
const
[
goodsValue
,
setGoodsValue
]
=
useState
([]);
...
...
@@ -410,7 +410,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
remaining
:
item
.
purchaseCount
||
0
,
// 可退货数量,这里取 采购数量判断即可
extraData
:
{
returnReason
:
item
.
returnReason
,
payList
:
(
item
.
payList
||
[]).
map
(({
payId
,
...
rest
})
=>
({
...
rest
,
id
:
payId
}))
,
payList
:
item
.
payList
||
[]
,
id
:
item
.
orderRecordId
,
taskTypeKey
,
orderId
:
item
.
orderId
,
...
...
@@ -599,13 +599,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({
channelName
,
payTime
,
payWayName
,
id
,
...
payItemRest
}
=
item
;
return
{
...
payItemRest
,
payTime
:
+
new
Date
(
payTime
),
payId
:
id
,
};
}),
})),
...
...
@@ -672,8 +670,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
preValues
=
addSchemaAction
.
getFieldValue
(
'returnGoodsList'
);
const
value
=
[];
console
.
log
(
'values'
,
values
)
values
.
forEach
(
item
=>
{
const
atom
=
{
id
:
item
.
id
,
...
...
@@ -731,7 +727,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
returnGoodsListValue
=
getFieldValue
(
'returnGoodsList'
);
const
item
=
returnGoodsListValue
[
index
];
set
Order
Info
({
set
Apply
Info
({
index
,
...
item
,
payList
:
item
.
extraData
.
payList
,
...
...
@@ -744,7 +740,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
handleReturnInfoSubmit
=
values
=>
{
const
{
getFieldValue
,
setFieldValue
,
setFieldState
}
=
addSchemaAction
;
const
{
index
}
=
order
Info
;
const
{
index
}
=
apply
Info
;
const
newData
=
[...
getFieldValue
(
'returnGoodsList'
)];
newData
.
splice
(
index
,
1
,
{
...
newData
[
index
],
...
...
@@ -873,7 +869,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
<
ReturnInfoDrawer
visible=
{
visibleReturnInfoDrawer
}
orderInfo=
{
order
Info
}
applyInfo=
{
apply
Info
}
onClose=
{
()
=>
setVisibleReturnInfoDrawer
(
false
)
}
onSubmit=
{
handleReturnInfoSubmit
}
isEdit
...
...
src/pages/afterService/returnManage/components/DetailInfo/index.tsx
View file @
bc901a26
...
...
@@ -37,7 +37,7 @@ import AuditProcess from '@/components/AuditProcess';
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
DescProgress
from
'@/components/DescProgress'
;
import
{
Values
as
ReturnAddressValues
}
from
'../../../components/ReturnAddressInfo'
;
import
ReturnInfoDrawer
,
{
Order
Info
}
from
'../../../components/ReturnInfoDrawer'
;
import
ReturnInfoDrawer
,
{
ReturnApply
Info
}
from
'../../../components/ReturnInfoDrawer'
;
import
{
OuterHistoryData
,
InnerHistoryData
}
from
'../../../components/FlowRecords'
;
import
{
RETURN_OUTER_STATUS_TAG_MAP
,
...
...
@@ -103,10 +103,11 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
visibleOrderDetial
,
setVisibleReturnInfo
]
=
useState
<
boolean
>
(
false
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
const
[
orderInfo
,
setOrderInfo
]
=
useState
<
Order
Info
>
(
null
);
const
[
applyInfo
,
setApplyInfo
]
=
useState
<
ReturnApply
Info
>
(
null
);
const
handleCheckOrderDetial
=
record
=>
{
setOrderInfo
({
setApplyInfo
({
orderId
:
record
.
orderId
,
orderNo
:
record
.
orderNo
,
productName
:
record
.
productName
,
category
:
record
.
category
,
...
...
@@ -699,7 +700,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
ReturnInfoDrawer
visible=
{
visibleOrderDetial
}
orderInfo=
{
order
Info
}
applyInfo=
{
apply
Info
}
onClose=
{
()
=>
setVisibleReturnInfo
(
false
)
}
/>
</
AnchorPage
>
...
...
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