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
1bab887c
Commit
1bab887c
authored
Dec 16, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理订单积分支付跳转和生成微信二维码扫码支付
parent
42b124cb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
377 additions
and
280 deletions
+377
-280
DateRangePickerUnix.tsx
src/components/NiceForm/components/DateRangePickerUnix.tsx
+6
-5
NumberRange.tsx
src/components/NiceForm/components/NumberRange.tsx
+6
-4
index.ts
src/constants/index.ts
+18
-19
selectProduct.tsx
...pages/commodity/products/addChannelItem/selectProduct.tsx
+7
-8
index.tsx
src/pages/commodity/products/index.tsx
+0
-0
constant.ts
src/pages/payandSettle/constant.ts
+49
-50
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+82
-25
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+130
-99
index.tsx
.../transaction/purchaseOrder/readyPayOrder/detail/index.tsx
+14
-4
useSelfTable.tsx
...action/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
+0
-0
index.tsx
...ges/transaction/purchaseOrder/readyReceiveOrder/index.tsx
+65
-66
No files found.
src/components/NiceForm/components/DateRangePickerUnix.tsx
View file @
1bab887c
...
...
@@ -9,22 +9,24 @@ import moment from 'moment';
const
{
RangePicker
}
=
DatePicker
;
const
DateRangePickerUnix
=
(
props
)
=>
{
const
{
value
,
mutators
}
=
props
const
{
value
,
mutators
}
=
props
const
{
placeholder
,
dataSource
,
...
rest
}
=
props
.
props
[
"x-component-props"
]
||
{}
const
handleChange
=
(
dates
,
dateString
)
=>
{
if
(
dateString
.
length
===
2
)
{
mutators
.
change
([
moment
(
dateString
[
0
]).
format
(
'x'
),
moment
(
dateString
[
1
]).
format
(
'x'
)
]);
mutators
.
change
([
dateString
[
0
]
?
moment
(
dateString
[
0
]).
format
(
'x'
)
:
null
,
dateString
[
1
]
?
moment
(
dateString
[
1
]).
format
(
'x'
)
:
null
]);
}
}
return
(
<
RangePicker
showTime=
{
true
}
style=
{
{
minWidth
:
160
}
}
placeholder=
{
placeholder
}
onChange=
{
handleChange
}
format=
"YYYY-MM-DD HH:mm:ss"
{
...
rest
}
/>
)
...
...
@@ -34,4 +36,4 @@ DateRangePickerUnix.defaultProps = {}
DateRangePickerUnix
.
isFieldComponent
=
true
;
export
default
DateRangePickerUnix
\ No newline at end of file
export
default
DateRangePickerUnix
src/components/NiceForm/components/NumberRange.tsx
View file @
1bab887c
...
...
@@ -38,9 +38,9 @@ const NumberRange = (props) => {
const
[
rangeValue
,
setrangeValue
]
=
useState
([])
useEffect
(()
=>
{
if
(
rangeValue
.
length
)
{
//
if(rangeValue.length) {
mutators
.
change
(
rangeValue
);
}
//
}
},
[
rangeValue
])
const
loseBlur
=
(
e
,
index
)
=>
{
...
...
@@ -60,7 +60,8 @@ const NumberRange = (props) => {
textAlign
:
'center'
}
}
placeholder=
{
placeholder
[
0
]
||
'最小值'
}
onBlur=
{
(
e
)
=>
loseBlur
(
e
,
0
)
}
onChange=
{
(
e
)
=>
loseBlur
(
e
,
0
)
}
value=
{
value
[
0
]
||
null
}
/>
<
Input
className=
"site-input-split"
...
...
@@ -81,7 +82,8 @@ const NumberRange = (props) => {
textAlign
:
'center'
,
}
}
placeholder=
{
placeholder
[
1
]
||
'最大值'
}
onBlur=
{
(
e
)
=>
loseBlur
(
e
,
1
)
}
onChange=
{
(
e
)
=>
loseBlur
(
e
,
1
)
}
value=
{
value
[
1
]
||
null
}
/>
</
Input
.
Group
>
</
RowStyleLayout
>
...
...
src/constants/index.ts
View file @
1bab887c
...
...
@@ -919,7 +919,7 @@ export enum SaleOrderInsideWorkState {
READY_DELEVED_APPROVED
,
/**
* 待
审核
物流单(新增物流单成功)
* 待
确认
物流单(新增物流单成功)
*/
DELIVERY_APPROVED_SUCCESS
,
...
...
@@ -1038,7 +1038,7 @@ export const SaleOrderInsideWorkStateTexts = {
23
:
'待确认回单'
,
24
:
'订单归档'
,
25
:
'待审核发货单'
,
26
:
'待
审核
物流单'
,
26
:
'待
确认
物流单'
,
27
:
'待手工发货'
}
...
...
@@ -1772,7 +1772,7 @@ export const RETURN_OUTER_STATUS = {
/**
* 线上支付
*/
export
const
PAY_WAY_ONLINE
=
1
;
export
const
PAY_WAY_ONLINE
=
1
;
/**
* 线下支付
*/
...
...
@@ -1780,19 +1780,19 @@ export const PAY_WAY_OFFLINE = 2;
/**
* 授信支付
*/
export
const
PAY_WAY_CREDIT
=
3
;
export
const
PAY_WAY_CREDIT
=
3
;
/**
* 货到付款
*/
export
const
PAY_WAY_COD
=
4
;
export
const
PAY_WAY_COD
=
4
;
/**
* 支付方式对应中文
*/
export
const
PAYWAY
=
{
[
PAY_WAY_ONLINE
]:
'线上支付'
,
[
PAY_WAY_OFFLINE
]:
'线下支付'
,
[
PAY_WAY_CREDIT
]:
'授信支付'
,
[
PAY_WAY_COD
]:
'货到付款'
,
[
PAY_WAY_ONLINE
]:
'线上支付'
,
[
PAY_WAY_OFFLINE
]:
'线下支付'
,
[
PAY_WAY_CREDIT
]:
'授信支付'
,
[
PAY_WAY_COD
]:
'货到付款'
,
};
...
...
@@ -1833,12 +1833,12 @@ export const PAY_CHANNEL_COD = 7;
* 支付渠道对应中文
*/
export
const
PAY_CHANNEL
=
{
[
PAY_CHANNEL_INTEGRAL
]:
'积分支付'
,
[
PAY_CHANNEL_ALI
]:
'支付宝'
,
[
PAY_CHANNEL_WECHAT
]:
'微信'
,
[
PAY_CHANNEL_UNION
]:
'银联'
,
[
PAY_CHANNEL_BALANCE
]:
'余额'
,
[
PAY_CHANNEL_OFFLINE
]:
'线下支付'
,
[
PAY_CHANNEL_CREDIT
]:
'授信'
,
[
PAY_CHANNEL_COD
]:
'货到付款'
,
};
\ No newline at end of file
[
PAY_CHANNEL_INTEGRAL
]:
'积分支付'
,
[
PAY_CHANNEL_ALI
]:
'支付宝'
,
[
PAY_CHANNEL_WECHAT
]:
'微信'
,
[
PAY_CHANNEL_UNION
]:
'银联'
,
[
PAY_CHANNEL_BALANCE
]:
'余额'
,
[
PAY_CHANNEL_OFFLINE
]:
'线下支付'
,
[
PAY_CHANNEL_CREDIT
]:
'授信'
,
[
PAY_CHANNEL_COD
]:
'货到付款'
,
};
src/pages/commodity/products/addChannelItem/selectProduct.tsx
View file @
1bab887c
...
...
@@ -120,7 +120,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
useEffect
(()
=>
{
onRef
(
formProduct
)
formProduct
.
setFieldsValue
({
source
:
source
})
formProduct
.
setFieldsValue
({
source
:
source
})
// 获取会员角色列表
PublicApi
.
getMemberManageChannelLowerRoleList
().
then
(
res
=>
{
const
{
data
}
=
res
...
...
@@ -148,7 +148,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
state
.
visible
=
source
===
1
?
true
:
false
})
},
[
visibleAddTabs
])
// 获取渠道商品
const
fetchProductData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
@@ -192,7 +192,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
{
...
layout
}
form=
{
formProduct
}
ref=
{
productFormRef
}
name=
"add-channel-origin"
name=
"add-channel-origin"
labelAlign=
"left"
colon=
{
false
}
>
...
...
@@ -220,12 +220,12 @@ const SelectProduct:React.FC<IProps> = (props) => {
confirm=
{
handleOkAddTabs
}
cancel=
{
handleCancelAddTabs
}
visible=
{
visibleAddTabs
}
resetModal=
{
{
destroyOnClose
:
true
,
forceRender
:
true
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
columns=
{
productColumns
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchProductData
(
params
)
}
currentRef=
{
productRef
}
forceRender=
{
tru
e
}
forceRender=
{
fals
e
}
tableProps=
{
{
rowKey
:
'id'
,
onRow
:
(
record
)
=>
({
...
...
@@ -237,7 +237,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
}
}
formilyProps=
{
{
ctx
:
{
ctx
:
{
schema
:
addChannelSchema
,
actions
:
productFormActions
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
...
...
@@ -260,4 +260,4 @@ const SelectProduct:React.FC<IProps> = (props) => {
</>)
}
export
default
observer
(
SelectProduct
)
\ No newline at end of file
export
default
observer
(
SelectProduct
)
src/pages/commodity/products/index.tsx
View file @
1bab887c
This diff is collapsed.
Click to expand it.
src/pages/payandSettle/constant.ts
View file @
1bab887c
...
...
@@ -3,45 +3,45 @@
* @Date: 2020-10-15 15:41:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-28 14:49:44
* @Description:
* @Description:
*/
import
{
MEMBER_STATUS_NORMAL
,
MEMBER_STATUS_FROZEN
,
CREDIT_REPAYMENT_STATUS_OUTSTANDING
,
CREDIT_REPAYMENT_STATUS_UNCONFIRMED
,
CREDIT_REPAYMENT_STATUS_PAID
,
CREDIT_REPAYMENT_STATUS_OVERDUE
,
CREDIT_OUTER_STATUS_UNCOMMITTED
,
CREDIT_OUTER_STATUS_UNCONFIRMED
,
CREDIT_OUTER_STATUS_SUCCESS
,
CREDIT_OUTER_STATUS_FAILED
,
CREDIT_INNER_STATUS_UNCOMMITTED
,
CREDIT_INNER_STATUS_COMMITTED
,
CREDIT_INNER_STATUS_SUCCESS_1
,
CREDIT_INNER_STATUS_SUCCESS_2
,
CREDIT_INNER_STATUS_SUCCESS_3
,
CREDIT_INNER_STATUS_FAILED
,
CREDIT_INNER_STATUS_CONFIRM_SUCCESS
,
CREDIT_INNER_STATUS_CONFIRM_FAILED
,
CREDIT_STATUS_NOT_APPLIED
,
CREDIT_STATUS_APPLYING
,
CREDIT_STATUS_NORMAL
,
CREDIT_STATUS_FROZEN
,
MEMBER_STATUS_NORMAL
,
MEMBER_STATUS_FROZEN
,
CREDIT_REPAYMENT_STATUS_OUTSTANDING
,
CREDIT_REPAYMENT_STATUS_UNCONFIRMED
,
CREDIT_REPAYMENT_STATUS_PAID
,
CREDIT_REPAYMENT_STATUS_OVERDUE
,
CREDIT_OUTER_STATUS_UNCOMMITTED
,
CREDIT_OUTER_STATUS_UNCONFIRMED
,
CREDIT_OUTER_STATUS_SUCCESS
,
CREDIT_OUTER_STATUS_FAILED
,
CREDIT_INNER_STATUS_UNCOMMITTED
,
CREDIT_INNER_STATUS_COMMITTED
,
CREDIT_INNER_STATUS_SUCCESS_1
,
CREDIT_INNER_STATUS_SUCCESS_2
,
CREDIT_INNER_STATUS_SUCCESS_3
,
CREDIT_INNER_STATUS_FAILED
,
CREDIT_INNER_STATUS_CONFIRM_SUCCESS
,
CREDIT_INNER_STATUS_CONFIRM_FAILED
,
CREDIT_STATUS_NOT_APPLIED
,
CREDIT_STATUS_APPLYING
,
CREDIT_STATUS_NORMAL
,
CREDIT_STATUS_FROZEN
,
}
from
'@/constants'
;
// 授信状态 Badge map
// 账单交易状态
export
const
BILL_TRADE_STATUS_UNCONFIRMED
=
1
;
// 待确认还款结果
export
const
BILL_TRADE_STATUS_OUTSTANDIND
=
2
;
// 确认未到账
export
const
BILL_TRADE_STATUS_RECEIVED
=
3
;
// 确认到账
export
const
BILL_TRADE_STATUS_UNCONFIRMED
=
1
;
// 待确认还款结果
export
const
BILL_TRADE_STATUS_OUTSTANDIND
=
2
;
// 确认未到账
export
const
BILL_TRADE_STATUS_RECEIVED
=
3
;
// 确认到账
// 账单状态 StatusTag map
export
const
BILL_TRADE_STATUS_TAB_MAP
=
{
[
BILL_TRADE_STATUS_UNCONFIRMED
]:
'primary'
,
[
BILL_TRADE_STATUS_OUTSTANDIND
]:
'danger'
,
[
BILL_TRADE_STATUS_RECEIVED
]:
'success'
,
[
BILL_TRADE_STATUS_UNCONFIRMED
]:
'primary'
,
[
BILL_TRADE_STATUS_OUTSTANDIND
]:
'danger'
,
[
BILL_TRADE_STATUS_RECEIVED
]:
'success'
,
};
// 还款状态 StatusTag map
...
...
@@ -49,43 +49,43 @@ export const CREDIT_REPAYMENT_STATUS_TAG_MAP = {
[
CREDIT_REPAYMENT_STATUS_OUTSTANDING
]:
'default'
,
[
CREDIT_REPAYMENT_STATUS_UNCONFIRMED
]:
'primary'
,
[
CREDIT_REPAYMENT_STATUS_PAID
]:
'success'
,
[
CREDIT_REPAYMENT_STATUS_OVERDUE
]:
'danger'
,
[
CREDIT_REPAYMENT_STATUS_OVERDUE
]:
'danger'
,
};
// 授信状态 Badge map
export
const
CREDIT_STATUS_BADGE_MAP
=
{
[
CREDIT_STATUS_NOT_APPLIED
]:
'#FF991F'
,
[
CREDIT_STATUS_APPLYING
]:
'#00B37A'
,
[
CREDIT_STATUS_NOT_APPLIED
]:
'#FF991F'
,
[
CREDIT_STATUS_APPLYING
]:
'#00B37A'
,
[
CREDIT_STATUS_NORMAL
]:
'#00B37A'
,
[
CREDIT_STATUS_FROZEN
]:
'#E63F3B'
,
};
// 授信状态 StatusTag map
export
const
CREDIT_STATUS_TAG_MAP
=
{
[
CREDIT_STATUS_NOT_APPLIED
]:
'warning'
,
[
CREDIT_STATUS_APPLYING
]:
'success'
,
[
CREDIT_STATUS_NOT_APPLIED
]:
'warning'
,
[
CREDIT_STATUS_APPLYING
]:
'success'
,
[
CREDIT_STATUS_NORMAL
]:
'success'
,
[
CREDIT_STATUS_FROZEN
]:
'danger'
,
};
// 授信外部状态
export
const
CREDIT_OUTER_STATUS_TAG_MAP
=
{
[
CREDIT_OUTER_STATUS_UNCOMMITTED
]:
'default'
,
[
CREDIT_OUTER_STATUS_UNCONFIRMED
]:
'primary'
,
[
CREDIT_OUTER_STATUS_SUCCESS
]:
'success'
,
[
CREDIT_OUTER_STATUS_FAILED
]:
'danger'
,
[
CREDIT_OUTER_STATUS_UNCOMMITTED
]:
'default'
,
[
CREDIT_OUTER_STATUS_UNCONFIRMED
]:
'primary'
,
[
CREDIT_OUTER_STATUS_SUCCESS
]:
'success'
,
[
CREDIT_OUTER_STATUS_FAILED
]:
'danger'
,
};
// 授信内部部状态 Badge map
export
const
CREDIT_INNER_STATUS_BADGE_MAP
=
{
[
CREDIT_INNER_STATUS_UNCOMMITTED
]:
'#669EDE'
,
[
CREDIT_INNER_STATUS_COMMITTED
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_1
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_2
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_3
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_FAILED
]:
'#EF6260'
,
[
CREDIT_INNER_STATUS_CONFIRM_SUCCESS
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_CONFIRM_FAILED
]:
'#EF6260'
,
[
CREDIT_INNER_STATUS_UNCOMMITTED
]:
'#669EDE'
,
[
CREDIT_INNER_STATUS_COMMITTED
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_1
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_2
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_SUCCESS_3
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_FAILED
]:
'#EF6260'
,
[
CREDIT_INNER_STATUS_CONFIRM_SUCCESS
]:
'#41CC9E'
,
[
CREDIT_INNER_STATUS_CONFIRM_FAILED
]:
'#EF6260'
,
};
...
...
@@ -108,8 +108,8 @@ export const CREDIT_INNER_STATUS_BADGE_MAP = {
// 流转状态
export
const
moveStatusMap
=
{
'
1
'
:
{
title
:
'冻结'
,
type
:
'danger'
},
'
2
'
:
{
title
:
'解冻'
,
type
:
'success'
},
'
2
'
:
{
title
:
'冻结'
,
type
:
'danger'
},
'
1
'
:
{
title
:
'解冻'
,
type
:
'success'
},
}
// 会员状态
...
...
@@ -146,4 +146,4 @@ export const accountMemberType = {
'2'
:
'企业个人会员'
,
'3'
:
'渠道会员'
,
'4'
:
'渠道个人会员'
,
}
\ No newline at end of file
}
src/pages/transaction/components/orderPayModal/index.tsx
View file @
1bab887c
...
...
@@ -11,6 +11,7 @@ import { history } from 'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
encryptedByAES
}
from
'@/utils/cryptoAes'
import
QRCode
from
'qrcode'
import
{
cond
}
from
'lodash'
export
interface
OrderPayModalProps
{
currentRef
:
any
,
...
...
@@ -68,19 +69,20 @@ const payTextList = ["",
'货到付款'
]
let
timeChange
;
// Tiemr
const
OrderPayModal
:
React
.
FC
<
OrderPayModalProps
>
=
(
props
)
=>
{
const
formRef
=
useRef
<
any
>
({})
const
{
id
}
=
usePageStatus
()
const
{
data
,
payList
,
currentPayInfoId
}
=
useContext
(
OrderDetailContext
)
// const transformPayList: any = data ? transformPayData(data.paymentInformationResponses, payList) : []
const
transformPayList
:
any
=
data
?
formatting
(
payList
,
"payType"
)
:
[]
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderPendingOrderPay
)
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
checked
,
setChecked
]
=
useState
<
any
>
({})
const
[
current
,
setCurrent
]
=
useState
(
0
)
// 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 1000清除
const
[
current
,
setCurrent
]
=
useState
(
0
)
// 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款
6支付宝
1000清除
const
[
payStep
,
setPayStep
]
=
useState
(
0
)
// 支付模态框的步骤 0选方式 1下一步的具体操作 2输入支付密码
const
mobilePayFlag
=
useRef
(
0
)
// 用于判断移动支付类型 4微信
const
mobilePayFlag
=
useRef
(
0
)
// 用于判断移动支付类型 4微信6支付宝
const
[
qrLoading
,
setQrLoading
]
=
useState
(
false
)
const
[
code
,
setCode
]
=
useState
(
''
)
const
[
qrCodeInfo
,
setQrCodeInfo
]
=
useState
({
generateCharacter
:
''
,
qrUrl
:
''
})
const
[
number
,
setNumber
]
=
useState
([
0
,
1
,
2
,
3
,
4
,
5
])
...
...
@@ -89,6 +91,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
[
creditInfo
,
setCreditInfo
]
=
useState
<
any
>
()
const
[
balanceInfo
,
setBalanceInfo
]
=
useState
<
any
>
()
const
[
payOnReceived
,
setPayOnReceived
]
=
useState
<
boolean
>
(
false
)
// 是否要禁用到付方式
const
[
blankAccountInfo
,
setBlankAccountInfo
]
=
useState
<
any
>
()
useEffect
(()
=>
{
if
(
currentRef
)
{
...
...
@@ -99,6 +102,17 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
},
[])
//timer start
const
[
openTimer
,
setOpenTimer
]
=
useState
(
0
);
// timer
useEffect
(()
=>
{
if
(
openTimer
===
1
)
runTimerJump
()
else
clearInterval
(
timeChange
)
},
[
openTimer
])
const
runTimerJump
=
()
=>
{
timeChange
=
setInterval
(()
=>
pollPayResult
(),
3000
)
}
//timer ending
useEffect
(()
=>
{
if
(
!
visible
)
{
setCurrent
(
0
)
...
...
@@ -128,13 +142,33 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
QRCode
.
toDataURL
(
qrCodeInfo
.
generateCharacter
).
then
((
url
:
any
)
=>
{
setQrCodeInfo
({...
qrCodeInfo
,
qrUrl
:
url
})
// 轮询支付结果
//
setOpenTimer(1)
setOpenTimer
(
1
)
})
.
catch
((
err
:
any
)
=>
{
console
.
error
(
err
)
})
}
const
pollPayResult
=
()
=>
{
if
(
qrCodeInfo
.
qrUrl
)
{
// @ts-ignore
PublicApi
.
getOrderPayResultsl
({
id
,
paymentInformationId
:
currentPayInfoId
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
===
1000
)
{
if
(
res
.
data
)
{
setOpenTimer
(
0
)
message
.
success
(
'支付成功'
)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
}
else
{
message
.
error
(
res
.
message
)
}
})
}
}
const
handleConfirm
=
()
=>
{
console
.
log
(
data
,
'data'
)
if
(
current
===
0
)
{
...
...
@@ -142,6 +176,12 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if
(
checked
.
id
===
5
)
{
// 线下支付
setCurrent
(
1
)
setPayStep
(
1
)
// 获取账户信息
PublicApi
.
getSettleAccountsCorporateAccountConfig
({
memberId
:
data
.
supplyMembersId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setBlankAccountInfo
(
res
.
data
)
}
})
}
else
if
(
checked
.
id
===
6
)
{
// 授信额度支付
console
.
log
(
'选择了授信支付'
)
setIsSpin
(
true
)
...
...
@@ -181,15 +221,24 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setPayStep
(
1
)
}
else
if
(
checked
.
id
===
2
)
{
console
.
log
(
'选择了微信支付'
)
//
跳转
扫码支付
history
.
push
(
`/pay?orderId=
${
btoa
(
JSON
.
stringify
({
orderId
:
id
,
memberId
:
data
.
supplyMembersId
,
memberRoleId
:
data
.
supplyMembersRoleId
}))}
`
)
// mobilePayFlag.current = 4
// setCurrent(4
)
// setPayStep(1
)
//
handleSubmitPay()
//
生成微信
扫码支付
mobilePayFlag
.
current
=
4
setCurrent
(
4
)
setPayStep
(
1
)
setQrLoading
(
true
)
handleSubmitPay
()
}
// else if(checked.id === 1) {
// console.log('选择了支付宝支付')
// // 生成支付宝扫码支付
// mobilePayFlag.current = 6
// setCurrent(6)
// setPayStep(1)
// setQrLoading(true)
// handleSubmitPay()
// }
else
{
message
.
error
(
'暂只支持线下支付、授信额度支付、余额支付
方式、货到付款
'
)
message
.
error
(
'暂只支持线下支付、授信额度支付、余额支付
、货到付款、微信支付方式
'
)
}
}
else
{
message
.
error
(
'请先选择支付方式'
)
...
...
@@ -243,6 +292,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
else
{
setCurrent
(
0
)
setPayStep
(
0
)
setOpenTimer
(
0
)
}
}
...
...
@@ -269,11 +319,11 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
res
=
await
run
(
params
)
if
(
res
.
code
===
1000
)
{
if
(
mobilePayFlag
.
current
!==
4
)
{
if
(
mobilePayFlag
.
current
!==
4
)
{
// 非微信
history
.
goBack
()
}
else
{
console
.
log
(
res
,
'二维码信息'
)
setQrCodeInfo
({
...
qrCodeInfo
,
generateCharacter
:
res
.
data
})
setQrLoading
(
false
)
}
}
}
...
...
@@ -287,6 +337,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
handleBack
=
()
=>
{
setCurrent
(
0
)
setPayStep
(
0
)
setOpenTimer
(
0
)
}
const
handleOk
=
()
=>
{
...
...
@@ -341,9 +392,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
footer=
{
renderModalFooter
()
}
destroyOnClose=
{
true
}
maskClosable=
{
false
}
// cancelText={current === 0 ? '取消' : '上一步'}
// okText={current === 0 ? '下一步' : '确认'}
// confirmLoading={loading}
>
{
current
===
0
&&
transformPayList
&&
Object
.
entries
(
transformPayList
).
map
(([
key
,
value
])
=>
<
Row
key=
{
key
}
style=
{
{
marginBottom
:
24
}
}
>
...
...
@@ -352,7 +400,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
<
div
className=
{
style
.
radioBox
}
>
{
(
value
as
any
[]).
map
(
v
=>
{
if
(
payOnReceived
&&
v
.
value
===
7
)
{
// 到付
if
(
payOnReceived
&&
v
.
value
===
7
)
{
//
过滤
到付
return
null
}
else
{
return
<
div
key=
{
v
.
value
}
className=
{
cx
(
style
.
payRadio
,
(
checked
&&
v
.
value
===
checked
.
id
)
?
style
.
active
:
''
)
}
onClick=
{
()
=>
setChecked
({
id
:
v
.
value
,
channel
:
v
.
channel
})
}
>
{
v
.
label
}
</
div
>
...
...
@@ -367,6 +415,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
{
current
===
1
&&
<
div
>
<
p
>
账号名称:
{
blankAccountInfo
?.
name
}
</
p
>
<
p
>
银行账号:
{
blankAccountInfo
?.
bankAccount
}
</
p
>
<
p
>
开 户 行:
{
blankAccountInfo
?.
bankDeposit
}
</
p
>
<
p
style=
{
{
fontWeight
:
"bold"
}
}
>
上传支付凭证
</
p
>
<
Upload
name=
'file'
...
...
@@ -471,15 +522,21 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
{
/* 微信扫码支付 */
}
{
current
===
4
&&
(
current
===
4
||
current
===
6
)
&&
<
div
>
<
div
className=
{
style
.
qrCodeImage
}
>
<
img
src=
{
qrCodeInfo
.
qrUrl
}
alt=
""
/>
<
div
className=
{
style
.
scanTips
}
>
<
ScanOutlined
className=
{
style
.
scanIcon
}
/>
<
span
>
打开
{
mobilePayFlag
.
current
===
4
?
'微信'
:
'支付宝'
}
App
<
br
/>
扫码完成支付
</
span
>
<
Spin
spinning=
{
qrLoading
}
>
<
div
className=
{
style
.
qrCodeImage
}
>
{
qrCodeInfo
.
qrUrl
&&
<>
<
img
src=
{
qrCodeInfo
.
qrUrl
}
alt=
"扫码支付"
/>
<
div
className=
{
style
.
scanTips
}
>
<
ScanOutlined
className=
{
style
.
scanIcon
}
/>
<
span
>
打开
{
mobilePayFlag
.
current
===
4
?
'微信'
:
'支付宝'
}
App
<
br
/>
扫码完成支付
</
span
>
</
div
>
</>
}
</
div
>
</
div
>
</
Spin
>
</
div
>
}
{
/* 输入支付密码 payStep===2 */
}
...
...
src/pages/transaction/purchaseOrder/index.tsx
View file @
1bab887c
import
React
,
{
useState
}
from
'react'
import
{
Card
,
Button
,
Modal
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
baseOrderListColumns
}
from
'./constant'
import
{
PurchaseOrderOutWorkState
}
from
'@/constants'
import
{
history
}
from
'umi'
import
{
tableListSchema
}
from
'../_public/order/constant'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
DatePicker
}
from
'@formily/antd-components'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
// 订单查询
export
interface
PurchaseOrderProps
{
}
const
fetchTableData
=
async
(
params
)
=>
{
console
.
log
(
params
,
'params'
)
const
{
data
}
=
await
PublicApi
.
getOrderProcurementOrderList
(
params
)
return
data
}
// 最后一步开始调试 TODO
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderProps
>
=
(
props
)
=>
{
const
[
saleVisible
,
setSaleVisible
]
=
useState
<
any
>
(
false
)
// 售后唤起弹窗 @todo
const
handleSaleAfter
=
(
id
)
=>
{
}
const
handleEvaluate
=
(
id
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaserEvaluation/unevaluated`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
record
.
externalState
===
PurchaseOrderOutWorkState
.
FINISH_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleEvaluate
(
record
.
id
)
}
>
评价
</
Button
>
}
{
/* todo */
}
{
/* <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button> */
}
</>
}
])
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
secondColumns
}
rowKey=
{
'orderNo'
}
formilyLayouts=
{
{
justify
:
'space-between'
}
}
formilyChilds=
{
{
layouts
:
{
order
:
2
},
children
:
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
}
}
formilyProps=
{
{
layouts
:
{
order
:
3
},
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
,
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
},
components
:
{
DateRangePickerUnix
,
Submit
}
}
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
}
PurchaseOrder
.
defaultProps
=
{}
export
default
PurchaseOrder
\ No newline at end of file
import
React
,
{
useState
,
useRef
}
from
'react'
import
{
Card
,
Button
,
Modal
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
baseOrderListColumns
}
from
'./constant'
import
{
PurchaseOrderOutWorkState
}
from
'@/constants'
import
{
history
}
from
'umi'
import
{
tableListSchema
}
from
'../_public/order/constant'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
DatePicker
}
from
'@formily/antd-components'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
}
from
'@formily/antd'
// 订单查询
export
interface
PurchaseOrderProps
{
}
const
fetchTableData
=
async
(
params
)
=>
{
console
.
log
(
params
,
'params'
)
const
{
data
}
=
await
PublicApi
.
getOrderProcurementOrderList
(
params
)
return
data
}
const
formActions
=
createFormActions
();
// 最后一步开始调试 TODO
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderProps
>
=
(
props
)
=>
{
const
[
saleVisible
,
setSaleVisible
]
=
useState
<
any
>
(
false
)
const
ref
=
useRef
<
any
>
({})
// 售后唤起弹窗 @todo
const
handleSaleAfter
=
(
id
)
=>
{
}
const
handleEvaluate
=
(
id
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaserEvaluation/unevaluated`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
record
.
externalState
===
PurchaseOrderOutWorkState
.
FINISH_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleEvaluate
(
record
.
id
)
}
>
评价
</
Button
>
}
{
/* todo */
}
{
/* <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button> */
}
</>
}
])
const
controllerBtns
=
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
secondColumns
}
currentRef=
{
ref
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
expressionScope=
{
{
controllerBtns
,
}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
)
}
}
schema=
{
tableListSchema
}
components=
{
{
DateRangePickerUnix
,
Submit
}
}
/>
}
tableProps=
{
{
rowKey
:
'orderNo'
,
}
}
// rowKey={'orderNo'}
// formilyLayouts={{
// justify: 'space-between'
// }}
// formilyChilds={{
// layouts: {
// order: 2
// },
// children: <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
// }}
// formilyProps={{
// layouts: {
// order: 3
// },
// ctx: {
// inline: false,
// schema: tableListSchema,
// effects: ($, actions) => {
// useStateFilterSearchLinkageEffect(
// $,
// actions,
// 'orderNo',
// FORM_FILTER_PATH,
// );
// },
// components: {
// DateRangePickerUnix,
// Submit
// }
// }
// }}
/>
</
Card
>
</
PageHeaderWrapper
>
}
PurchaseOrder
.
defaultProps
=
{}
export
default
PurchaseOrder
src/pages/transaction/purchaseOrder/readyPayOrder/detail/index.tsx
View file @
1bab887c
import
React
,
{
useState
,
useCallback
,
useRef
,
useContext
,
useEffect
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
history
}
from
'umi'
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
...
...
@@ -11,14 +11,24 @@ import OrderPayModal from '@/pages/transaction/components/orderPayModal';
const
ReadyConfirmContract
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
const
{
data
,
currentPayInfoId
}
=
formContext
const
payRef
=
useRef
<
any
>
({})
const
handleClick
=
useCallback
(()
=>
{
payRef
.
current
.
setVisible
(
true
)
},
[])
// 处理积分支付跳转
if
(
data
&&
currentPayInfoId
){
if
(
data
.
paymentInformationResponses
.
length
>
0
){
let
obj
=
data
.
paymentInformationResponses
.
filter
(
item
=>
item
.
id
===
Number
(
currentPayInfoId
))[
0
]
if
(
obj
.
channel
===
0
)
{
history
.
push
(
`/pay?orderId=
${
btoa
(
JSON
.
stringify
({
orderId
:
id
,
memberId
:
data
.
supplyMembersId
,
memberRoleId
:
data
.
supplyMembersRoleId
}))}
`
)
}
else
{
payRef
.
current
.
setVisible
(
true
)
}
}
}
},
[
data
,
currentPayInfoId
])
const
renderPayPrice
=
()
=>
{
const
{
data
,
currentPayInfoId
}
=
formContext
if
(
data
){
if
(
data
.
paymentInformationResponses
.
length
>
0
){
let
obj
=
data
.
paymentInformationResponses
.
filter
(
item
=>
item
.
id
===
Number
(
currentPayInfoId
))[
0
]
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
View file @
1bab887c
This diff is collapsed.
Click to expand it.
src/pages/transaction/purchaseOrder/readyReceiveOrder/index.tsx
View file @
1bab887c
import
React
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
PlusCircleOutlined
,
DownOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
import
DropDeleteDown
from
'@/components/DropDeleteDown'
import
{
tableListSchema
}
from
'./schema'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
// 待确认收货单
export
interface
FirstApprovedOrderProps
{}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrderReceivingGoodsPendingOrderList
(
params
)
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
}
=
useSelfTable
()
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
columns
}
rowKey=
{
'orderNo'
}
formilyLayouts=
{
{
justify
:
'space-between'
}
}
formilyProps=
{
{
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
,
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
},
components
:
{
DateRangePickerUnix
,
Submit
}
}
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
}
FirstApprovedOrder
.
defaultProps
=
{}
export
default
FirstApprovedOrder
\ No newline at end of file
import
React
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
PlusCircleOutlined
,
DownOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
import
DropDeleteDown
from
'@/components/DropDeleteDown'
import
{
tableListSchema
}
from
'./schema'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
// 待确认收货单
export
interface
FirstApprovedOrderProps
{}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrderReceivingGoodsPendingOrderList
(
params
)
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
}
=
useSelfTable
()
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
columns
}
rowKey=
{
'orderNo'
}
formilyLayouts=
{
{
justify
:
'space-between'
}
}
formilyProps=
{
{
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
,
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'orderNo'
,
FORM_FILTER_PATH
,
);
},
components
:
{
DateRangePickerUnix
,
Submit
}
}
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
}
FirstApprovedOrder
.
defaultProps
=
{}
export
default
FirstApprovedOrder
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