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
黄庭坚
jinfa-platform
Commits
99c74b95
Commit
99c74b95
authored
Nov 18, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 修改transaction/components接口引入方式
parent
c6ffce3f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
336 additions
and
342 deletions
+336
-342
checkDetail.tsx
...dSettle/amountAccountManage/checkWithdraw/checkDetail.tsx
+1
-2
accountDetail.tsx
...yandSettle/capitalAccounts/accountLists/accountDetail.tsx
+8
-9
applyWithdraw.tsx
...yandSettle/capitalAccounts/accountLists/applyWithdraw.tsx
+8
-8
index.tsx
...pages/payandSettle/capitalAccounts/accountLists/index.tsx
+4
-6
useBillDetail.tsx
src/pages/transaction/_public/bill/effects/useBillDetail.tsx
+4
-4
useOrderDetail.tsx
...ages/transaction/_public/order/effects/useOrderDetail.tsx
+9
-9
statusList.ts
src/pages/transaction/common/statusList.ts
+0
-0
tableStatusList.tsx
src/pages/transaction/common/tableStatusList.tsx
+0
-0
index.tsx
src/pages/transaction/components/contractList/index.tsx
+69
-71
index.tsx
...ages/transaction/components/createElectronModal/index.tsx
+5
-4
index.tsx
...pages/transaction/components/detailLayout/modal/index.tsx
+3
-3
index.tsx
src/pages/transaction/components/orderDeleveRecord/index.tsx
+17
-17
index.tsx
...pages/transaction/components/orderElectronModal/index.tsx
+31
-32
index.tsx
src/pages/transaction/components/orderHandDeleved/index.tsx
+6
-5
index.tsx
...s/transaction/components/orderHandReceivedModal/index.tsx
+70
-72
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+8
-7
index.tsx
...ages/transaction/components/orderPayResultModal/index.tsx
+2
-2
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+2
-2
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+1
-1
index.tsx
src/pages/transaction/components/orderSaleRecord/index.tsx
+69
-72
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+8
-6
index.tsx
src/pages/transaction/effect/index.tsx
+11
-10
No files found.
src/pages/payandSettle/amountAccountManage/checkWithdraw/checkDetail.tsx
View file @
99c74b95
...
...
@@ -11,7 +11,7 @@ import { ColumnType } from 'antd/lib/table/interface'
import
{
memberStatusMap
,
operationMap
,
statusMap
}
from
'../../constant'
import
{
CheckSquareOutlined
}
from
'@ant-design/icons'
import
{
StandardTable
}
from
'god'
import
{
getPayMemberAssetAccountGetCashOutRecordList
,
getPayMemberAssetAccountGetMemberAssetAccount
}
from
'@/services/PayV2Api'
import
{
getPayMemberAssetAccountGetCashOutRecordList
,
getPayMemberAssetAccountGetMemberAssetAccount
,
postPayMemberAssetAccountCheck
}
from
'@/services/PayV2Api'
import
{
getSettleAccountsGetMemberAccountConfig
}
from
'@/services/SettleV2Api'
const
{
Step
}
=
Steps
;
...
...
@@ -100,7 +100,6 @@ const CheckDetail: React.FC<{}> = () => {
const
handleOK
=
()
=>
{
checkForm
.
validateFields
().
then
(
values
=>
{
setConfirmLoading
(
true
)
// @ts-ignore
postPayMemberAssetAccountCheck
({
id
:
urlParams
.
tradeId
,...
values
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setDisableCheck
(
true
)
...
...
src/pages/payandSettle/capitalAccounts/accountLists/accountDetail.tsx
View file @
99c74b95
import
React
,
{
useState
,
useEffect
,
useRef
,
ReactNode
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Space
,
Row
,
Col
,
Button
,
Table
,
Modal
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
...
...
@@ -12,10 +12,10 @@ import ModalForm from '@/components/ModalForm'
import
{
createFormActions
}
from
'@formily/antd'
import
{
rechargeSchema
}
from
'./schema'
import
{
memberStatusMap
,
moveStatusMap
,
operationMap
,
statusMap
}
from
'../../constant'
import
{
PublicApi
}
from
'@/services/api'
import
{
StandardTable
}
from
'god'
import
QRCode
from
'qrcode'
;
import
{
ScanOutlined
}
from
'@ant-design/icons'
import
{
getPayAssetAccountGetAccountStatusRecord
,
getPayAssetAccountGetAccountTradeRecord
,
getPayAssetAccountGetAssetAccount
,
getPayAssetAccountGetRechargeResult
,
postPayAssetAccountRecharge
}
from
'@/services/PayV2Api'
interface
rechargeItem
{
codeUrl
:
string
;
...
...
@@ -62,10 +62,10 @@ const AccountDetail: React.FC<{}> = () => {
const
getAccountInfo
=
async
()
=>
{
const
{
id
}
=
history
.
location
.
query
setPageId
(
id
)
let
res
=
await
PublicApi
.
getPayAssetAccountGetAssetAccount
({
id
})
let
res
=
await
getPayAssetAccountGetAssetAccount
({
id
})
const
{
code
,
data
}
=
res
setDetails
(
data
)
PublicApi
.
getPayAssetAccountGetAccountStatusRecord
({
memberAssetAccountId
:
id
+
''
}).
then
(
res
=>
{
getPayAssetAccountGetAccountStatusRecord
({
memberAssetAccountId
:
id
+
''
}).
then
(
res
=>
{
const
{
data
}
=
res
setMoveData
(
data
)
})
...
...
@@ -75,7 +75,7 @@ const AccountDetail: React.FC<{}> = () => {
// 获取交易记录
const
fetchTradeData
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getPayAssetAccountGetAccountTradeRecord
({
memberAssetAccountId
:
history
.
location
.
query
.
id
+
''
,
...
params
}).
then
(
res
=>
{
getPayAssetAccountGetAccountTradeRecord
({
memberAssetAccountId
:
history
.
location
.
query
.
id
+
''
,
...
params
}).
then
(
res
=>
{
const
{
data
}
=
res
resolve
(
data
)
})
...
...
@@ -96,8 +96,7 @@ const AccountDetail: React.FC<{}> = () => {
const
pollPayResult
=
()
=>
{
if
(
renderCodeCharacter
?.
tradeRecordId
)
{
// @ts-ignore
PublicApi
.
getPayAssetAccountGetRechargeResult
({
tradeRecordId
:
renderCodeCharacter
.
tradeRecordId
}).
then
(
res
=>
{
getPayAssetAccountGetRechargeResult
({
tradeRecordId
:
renderCodeCharacter
.
tradeRecordId
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
===
1000
)
{
if
(
res
.
data
)
{
...
...
@@ -208,7 +207,7 @@ const AccountDetail: React.FC<{}> = () => {
money
:
Number
(
value
.
money
),
type
:
value
[
'type'
][
0
]
}
PublicApi
.
postPayAssetAccountRecharge
(
parasm
).
then
(
res
=>
{
postPayAssetAccountRecharge
(
parasm
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
){
modalRef
.
current
.
setVisible
(
false
)
...
...
@@ -390,7 +389,7 @@ const AccountDetail: React.FC<{}> = () => {
}
}
// effects={($, {setFieldState}) => {
// $('onFieldInit', 'type').subscribe(parentState => {
//
PublicApi.
getPayMemberPayList({memberId: details.memberId, memberType: details.memberLevelType}).then(res => {
// getPayMemberPayList({memberId: details.memberId, memberType: details.memberLevelType}).then(res => {
// console.log(res, 'res')
// })
// setFieldState('type', state => {
...
...
src/pages/payandSettle/capitalAccounts/accountLists/applyWithdraw.tsx
View file @
99c74b95
import
React
,
{
useState
,
useEffect
,
useRef
,
ReactNode
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Space
,
Steps
,
Row
,
Col
,
Button
,
InputNumber
,
Table
,
message
}
from
'antd'
import
{
Card
,
Space
,
Steps
,
Row
,
Col
,
Button
,
InputNumber
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
ReutrnEle
from
'@/components/ReturnEle'
import
styles
from
'./index.less'
...
...
@@ -9,9 +9,9 @@ import cx from 'classnames'
import
moment
from
'moment'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
memberStatusMap
,
operationMap
,
statusMap
}
from
'../../constant'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetSettleAccountsCorporateAccountConfigResponse
}
from
'@/services/SettleApi'
import
{
StandardTable
}
from
'god'
import
{
getPayAssetAccountGetAccountTradeRecord
,
getPayAssetAccountGetAssetAccount
,
postPayAssetAccountCashOut
}
from
'@/services/PayV2Api'
import
{
getSettleAccountsGetMemberAccountConfig
}
from
'@/services/SettleV2Api'
const
{
Step
}
=
Steps
;
...
...
@@ -28,11 +28,11 @@ const AccountDetail: React.FC<{}> = () => {
const
getAccountInfo
=
async
()
=>
{
const
{
id
}
=
history
.
location
.
query
let
res
=
await
PublicApi
.
getPayAssetAccountGetAssetAccount
({
id
})
let
res
=
await
getPayAssetAccountGetAssetAccount
({
id
})
const
{
code
,
data
}
=
res
setDetails
(
data
)
if
(
code
===
1000
)
{
let
bankRes
=
await
PublicApi
.
getSettleAccountsGetMemberAccountConfig
({
memberId
:
data
.
memberId
+
''
,
roleId
:
data
.
memberRoleId
+
''
})
let
bankRes
=
await
getSettleAccountsGetMemberAccountConfig
({
memberId
:
data
.
memberId
+
''
,
roleId
:
data
.
memberRoleId
+
''
})
if
(
bankRes
.
code
===
1000
)
{
setBankDetail
(
bankRes
.
data
)
}
...
...
@@ -41,7 +41,7 @@ const AccountDetail: React.FC<{}> = () => {
const
fetchTradeData
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getPayAssetAccountGetAccountTradeRecord
({
memberAssetAccountId
:
history
.
location
.
query
.
id
+
''
,
...
params
}).
then
(
res
=>
{
getPayAssetAccountGetAccountTradeRecord
({
memberAssetAccountId
:
history
.
location
.
query
.
id
+
''
,
...
params
}).
then
(
res
=>
{
const
{
data
}
=
res
resolve
(
data
)
})
...
...
@@ -102,7 +102,7 @@ const AccountDetail: React.FC<{}> = () => {
bankAccount
:
bankDetail
.
bankAccount
,
bankName
:
bankDetail
.
bankDeposit
}
PublicApi
.
postPayAssetAccountCashOut
(
params
).
then
(
res
=>
{
postPayAssetAccountCashOut
(
params
).
then
(
res
=>
{
setBtnLoading
(
false
)
getAccountInfo
()
setWidthdrawAmount
(
0
)
...
...
src/pages/payandSettle/capitalAccounts/accountLists/index.tsx
View file @
99c74b95
import
React
,
{
use
State
,
useEffect
,
use
Ref
}
from
'react'
import
React
,
{
useRef
}
from
'react'
import
{
Card
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
PublicApi
}
from
'@/services/api'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
createFormActions
}
from
'@formily/antd'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
searchSchema
}
from
'./schema'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
EyePreview
from
'@/components/EyePreview'
import
{
DatePicker
}
from
'@formily/antd-components'
import
StatusTag
from
'@/components/StatusTag'
import
{
accountStatusMap
,
memberStatusMap
,
memberLevelTypeMap
,
accountMemberType
}
from
'../../constant'
import
LevelBrand
from
'@/components/LevelBrand'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
import
{
getPayAssetAccountGetAssetAccountList
}
from
'@/services/PayV2Api'
const
formActions
=
createFormActions
();
...
...
@@ -92,7 +90,7 @@ const AccountLists: React.FC<{}> = () => {
console
.
log
(
params
)
return
new
Promise
((
resolve
,
reject
)
=>
{
let
obj
=
{
...
params
}
PublicApi
.
getPayAssetAccountGetAssetAccountList
(
obj
).
then
(
res
=>
{
getPayAssetAccountGetAssetAccountList
(
obj
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
src/pages/transaction/_public/bill/effects/useBillDetail.tsx
View file @
99c74b95
import
{
useCallback
,
useState
,
useEffect
}
from
'react'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
import
{
message
}
from
'antd'
import
{
history
}
from
'umi'
import
{
getPurchaseRequisitionDetail
,
getPurchaseRequisitionTransferPurchaseDetail
}
from
'@/services/PurchaseV2Api'
/**
...
...
@@ -32,12 +32,12 @@ export const useBillDetail = (options: BillDetailHookProps) => {
let
api
=
null
;
switch
(
type
)
{
case
'requestBill'
:
api
=
PublicApi
.
getPurchaseRequisitionDetail
;
case
'requestBill'
:
api
=
getPurchaseRequisitionDetail
;
break
;
case
'transformBill'
:
api
=
PublicApi
.
getPurchaseRequisitionTransferPurchaseDetail
case
'transformBill'
:
api
=
getPurchaseRequisitionTransferPurchaseDetail
break
;
default
:
api
=
PublicApi
.
getPurchaseRequisitionDetail
;
api
=
getPurchaseRequisitionDetail
;
}
return
api
;
}
...
...
src/pages/transaction/_public/order/effects/useOrderDetail.tsx
View file @
99c74b95
import
React
,
{
useRef
}
from
'react'
import
{
useCallback
,
useState
,
useEffect
}
from
'react'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
import
{
Link
}
from
'umi'
import
{
formatTimeString
}
from
'@/utils'
import
StatusColors
from
'../../../components/statusColors'
import
{
message
}
from
'antd'
import
{
history
}
from
'umi'
import
{
OrderKindType
}
from
'@/constants/order'
import
{
getOrderBuyerDetail
,
getOrderBuyerValidatePayDetail
,
getOrderBuyerValidatePayType
,
getOrderBuyerValidateReceiveDetail
,
getOrderVendorDetail
,
getOrderVendorValidateDeliveryDetail
,
getOrderVendorValidatePayConfirmDetail
}
from
'@/services/OrderNewV2Api'
interface
OrderDetailHookProps
{
/** 采购、销售、待收货、待确认发货、待支付、待确认支付 */
...
...
@@ -70,19 +70,19 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const
getDetailsApi
=
(
type
)
=>
{
let
api
=
null
;
switch
(
type
)
{
case
'purchaseOrder'
:
api
=
PublicApi
.
getOrderBuyerDetail
;
case
'purchaseOrder'
:
api
=
getOrderBuyerDetail
;
break
;
case
'saleOrder'
:
api
=
PublicApi
.
getOrderVendorDetail
;
case
'saleOrder'
:
api
=
getOrderVendorDetail
;
break
;
case
'p_readyReceiveOrder'
:
api
=
PublicApi
.
getOrderBuyerValidateReceiveDetail
;
case
'p_readyReceiveOrder'
:
api
=
getOrderBuyerValidateReceiveDetail
;
break
;
case
's_readyConfirmDelevedOrder'
:
api
=
PublicApi
.
getOrderVendorValidateDeliveryDetail
;
case
's_readyConfirmDelevedOrder'
:
api
=
getOrderVendorValidateDeliveryDetail
;
break
;
case
'p_readyPayOrder'
:
api
=
PublicApi
.
getOrderBuyerValidatePayDetail
;
case
'p_readyPayOrder'
:
api
=
getOrderBuyerValidatePayDetail
;
break
;
case
's_readyPayResult'
:
api
=
PublicApi
.
getOrderVendorValidatePayConfirmDetail
;
case
's_readyPayResult'
:
api
=
getOrderVendorValidatePayConfirmDetail
;
default
:
api
=
PublicApi
.
getOrderBuyerDetail
;
api
=
getOrderBuyerDetail
;
}
return
api
;
}
...
...
@@ -112,7 +112,7 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
},
[
id
])
const
reloadPayList
=
(
orderId
)
=>
{
PublicApi
.
getOrderBuyerValidatePayType
({
orderId
}).
then
(
res
=>
{
getOrderBuyerValidatePayType
({
orderId
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setPaylist
(
data
)
...
...
src/pages/transaction/common/statusList.ts
View file @
99c74b95
This diff is collapsed.
Click to expand it.
src/pages/transaction/common/tableStatusList.tsx
View file @
99c74b95
This diff is collapsed.
Click to expand it.
src/pages/transaction/components/contractList/index.tsx
View file @
99c74b95
import
React
from
'react'
;
import
{
FilePdfFilled
,
FileWordFilled
,
FileFilled
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./index.less'
;
interface
ContractItem
{
electronicContractUrl
?:
string
;
electronicContractName
?:
string
;
};
interface
ContractList
{
dataSource
:
ContractItem
[];
};
const
IconMap
=
{
'.pdf'
:
<
FilePdfFilled
/>
,
'.doc'
:
<
FileWordFilled
/>
,
'.doxc'
:
<
FileWordFilled
/>
,
};
const
ContractItem
:
React
.
FC
<
ContractItem
>
=
({
electronicContractUrl
,
electronicContractName
,
})
=>
{
const
index1
=
electronicContractUrl
.
lastIndexOf
(
'.'
);
const
suffix
=
electronicContractUrl
.
slice
(
index1
);
const
index2
=
electronicContractUrl
.
lastIndexOf
(
'/'
);
// 如果没有文件名,但是有链接就从链接截取文件名
const
fileName
=
electronicContractName
?
electronicContractName
:
electronicContractUrl
.
slice
(
index2
+
1
);
const
handleDownload
=
(
name
,
url
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
name
}
&contractUrl=
${
url
}
`
;
};
return
(
<
li
className=
{
styles
[
'contractList-item'
]
}
onClick=
{
()
=>
handleDownload
(
fileName
,
electronicContractUrl
)
}
>
<
a
>
<
div
className=
{
styles
[
'contractList-item-icon'
]
}
>
{
IconMap
[
suffix
]
||
<
FileFilled
/>
}
</
div
>
<
div
className=
{
styles
[
'contractList-item-name'
]
}
title=
{
fileName
}
>
{
fileName
}
</
div
>
</
a
>
</
li
>
);
};
const
ContractList
:
React
.
FC
<
ContractList
>
=
({
dataSource
})
=>
{
if
(
!
Array
.
isArray
(
dataSource
))
{
return
<
div
className=
{
styles
.
noData
}
>
没有相关数据~
</
div
>;
}
return
(
<
ul
className=
{
styles
.
contractList
}
>
{
dataSource
.
map
((
item
,
index
)
=>
(
<
ContractItem
key=
{
index
}
electronicContractUrl=
{
item
.
electronicContractUrl
}
electronicContractName=
{
item
.
electronicContractName
}
/>
))
}
</
ul
>
);
};
export
default
ContractList
;
\ No newline at end of file
import
React
from
'react'
;
import
{
FilePdfFilled
,
FileWordFilled
,
FileFilled
}
from
'@ant-design/icons'
;
import
styles
from
'./index.less'
;
interface
ContractItem
{
electronicContractUrl
?:
string
;
electronicContractName
?:
string
;
};
interface
ContractList
{
dataSource
:
ContractItem
[];
};
const
IconMap
=
{
'.pdf'
:
<
FilePdfFilled
/>
,
'.doc'
:
<
FileWordFilled
/>
,
'.doxc'
:
<
FileWordFilled
/>
,
};
const
ContractItem
:
React
.
FC
<
ContractItem
>
=
({
electronicContractUrl
,
electronicContractName
,
})
=>
{
const
index1
=
electronicContractUrl
.
lastIndexOf
(
'.'
);
const
suffix
=
electronicContractUrl
.
slice
(
index1
);
const
index2
=
electronicContractUrl
.
lastIndexOf
(
'/'
);
// 如果没有文件名,但是有链接就从链接截取文件名
const
fileName
=
electronicContractName
?
electronicContractName
:
electronicContractUrl
.
slice
(
index2
+
1
);
const
handleDownload
=
(
name
,
url
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
name
}
&contractUrl=
${
url
}
`
;
};
return
(
<
li
className=
{
styles
[
'contractList-item'
]
}
onClick=
{
()
=>
handleDownload
(
fileName
,
electronicContractUrl
)
}
>
<
a
>
<
div
className=
{
styles
[
'contractList-item-icon'
]
}
>
{
IconMap
[
suffix
]
||
<
FileFilled
/>
}
</
div
>
<
div
className=
{
styles
[
'contractList-item-name'
]
}
title=
{
fileName
}
>
{
fileName
}
</
div
>
</
a
>
</
li
>
);
};
const
ContractList
:
React
.
FC
<
ContractList
>
=
({
dataSource
})
=>
{
if
(
!
Array
.
isArray
(
dataSource
))
{
return
<
div
className=
{
styles
.
noData
}
>
没有相关数据~
</
div
>;
}
return
(
<
ul
className=
{
styles
.
contractList
}
>
{
dataSource
.
map
((
item
,
index
)
=>
(
<
ContractItem
key=
{
index
}
electronicContractUrl=
{
item
.
electronicContractUrl
}
electronicContractName=
{
item
.
electronicContractName
}
/>
))
}
</
ul
>
);
};
export
default
ContractList
;
src/pages/transaction/components/createElectronModal/index.tsx
View file @
99c74b95
...
...
@@ -3,9 +3,10 @@ import { Button, message } from 'antd'
import
{
createFormActions
,
ISchema
}
from
'@formily/antd'
import
ModalForm
from
'@/components/ModalForm'
import
{
history
}
from
'umi'
import
{
PublicApi
}
from
'@/services/api'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
getContractSelectListContractTemplate
,
postContractContractSignSaleSignContractCreate
}
from
'@/services/ContractV2Api'
import
{
postOrderVendorValidateSubmit
}
from
'@/services/OrderNewV2Api'
export
interface
OrderElectronModalProps
{
currentRef
:
any
...
...
@@ -124,8 +125,8 @@ const schema: ISchema = {
const
CreateOrderElectronModal
:
React
.
FC
<
OrderElectronModalProps
>
=
(
props
)
=>
{
const
formRef
=
useRef
<
any
>
({})
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postContractContractSignSaleSignContractCreate
,
{
ctlType
:
'none'
})
const
{
run
:
submitRun
,
loading
:
submitLoading
}
=
useHttpRequest
(
PublicApi
.
postOrderVendorValidateSubmit
)
const
{
run
,
loading
}
=
useHttpRequest
(
postContractContractSignSaleSignContractCreate
,
{
ctlType
:
'none'
})
const
{
run
:
submitRun
,
loading
:
submitLoading
}
=
useHttpRequest
(
postOrderVendorValidateSubmit
)
const
createElectron
=
async
()
=>
{
const
contractTemplateId
=
schemaActions
.
getFieldValue
(
'contractTemplateId'
)
if
(
data
.
isElectronicContract
===
1
&&
!
contractTemplateId
)
{
...
...
@@ -186,7 +187,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
effects=
{
(
$
,
actions
)
=>
{
$
(
'onFormInit'
).
subscribe
(
async
()
=>
{
if
(
data
.
isElectronicContract
===
1
)
{
const
res
=
await
PublicApi
.
getContractSelectListContractTemplate
()
const
res
=
await
getContractSelectListContractTemplate
()
let
options
=
res
.
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
...
...
src/pages/transaction/components/detailLayout/modal/index.tsx
View file @
99c74b95
...
...
@@ -10,9 +10,9 @@ import {
import
{
UploadOutlined
,
LinkOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
style
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
BidDetailContext
}
from
'../components/context'
;
import
{
isEmpty
,
sumBy
}
from
'lodash'
;
import
{
sumBy
}
from
'lodash'
;
import
{
postPurchaseConfirmQuotedPriceSubmitContrastPrice
}
from
'@/services/PurchaseV2Api'
;
const
{
TextArea
}
=
Input
;
...
...
@@ -123,7 +123,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
return
}
}
PublicApi
.
postPurchaseConfirmQuotedPriceSubmitContrastPrice
(
params
).
then
(
res
=>
{
postPurchaseConfirmQuotedPriceSubmitContrastPrice
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
handleConfirm
();
}
...
...
src/pages/transaction/components/orderDeleveRecord/index.tsx
View file @
99c74b95
...
...
@@ -5,20 +5,20 @@ import { OrderDetailContext } from '../../_public/order/context'
import
MellowCard
from
'@/components/MellowCard'
import
NestTable
from
'@/components/NestTable'
import
{
OrderKindType
}
from
'@/constants/order'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
ModalForm
from
'@/components/ModalForm'
import
{
createFormActions
}
from
'@formily/antd'
import
{
getAuth
}
from
'@/utils/auth'
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
OverflowText
from
'@/components/OverflowText'
import
{
postOrderBuyerValidateReceiveConfirm
}
from
'@/services/OrderNewV2Api'
export
interface
OrderDeleveRecordProps
{}
const
receiveActions
=
createFormActions
()
// 订单发货记录
const
OrderDeleveRecord
:
React
.
FC
<
OrderDeleveRecordProps
>
=
(
props
)
=>
{
const
OrderDeleveRecord
:
React
.
FC
<
OrderDeleveRecordProps
>
=
()
=>
{
const
pathname
=
history
.
location
.
pathname
const
isPreview
=
pathname
.
lastIndexOf
(
'/preview'
)
!==
-
1
...
...
@@ -422,7 +422,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
// batchNo: record.batchNo
// }
setDisabled
(
true
)
// const { code } = await
PublicApi.
postOrderBuyerValidateReceiveConfirm(params)
// const { code } = await postOrderBuyerValidateReceiveConfirm(params)
// if (code === 1000) {
// dataRef.current.push(record.id)
// reloadFormData && reloadFormData()
...
...
@@ -451,7 +451,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
values
.
batchNo
=
receiveParams
.
current
.
batchNo
}
console
.
log
(
values
,
'values'
)
const
result
=
await
PublicApi
.
postOrderBuyerValidateReceiveConfirm
(
values
)
const
result
=
await
postOrderBuyerValidateReceiveConfirm
(
values
)
if
(
result
.
code
===
1000
)
{
receiveActions
.
reset
()
setLoading
(
false
)
...
...
@@ -469,19 +469,19 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
// 确认回单
const
handleReturn
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
setDisabled
(
true
)
const
{
code
}
=
await
PublicApi
.
postOrderReceiptOrderConfirmed
(
params
)
if
(
code
===
1000
)
{
dataRef
.
current
.
push
(
record
.
id
)
reloadFormData
&&
reloadFormData
()
setDisabled
(
false
)
}
else
{
setDisabled
(
false
)
}
//
const params = {
//
orderId: record.orderId,
//
id: record.id
//
}
//
setDisabled(true)
// const { code } = await
postOrderReceiptOrderConfirmed(params)
//
if (code === 1000) {
//
dataRef.current.push(record.id)
//
reloadFormData && reloadFormData()
//
setDisabled(false)
//
} else {
//
setDisabled(false)
//
}
}
return
(
...
...
src/pages/transaction/components/orderElectronModal/index.tsx
View file @
99c74b95
import
React
,
{
useEffect
,
useState
,
useContext
}
from
'react'
import
{
message
,
Modal
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
...
...
@@ -18,8 +17,8 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
// @ts-ignore
// 采购过来确认先调用 ContractContractSignProcurementSign 在执行 postContractElectronicContractsAffirm
// 销售过来确认先调用 ContractContractSignSaleSign 在执行 postOrderConfirmedOrder
// const { run, loading } = useHttpRequest(type === 'saleOrder' ?
PublicApi.ContractContractSignSaleSign : PublicApi.
postContractElectronicContractsAffirm)
const
{
run
,
loading
}
=
useHttpRequest
(
type
===
'saleOrder'
?
PublicApi
.
postContractContractSignSaleSign
:
PublicApi
.
postContractContractSignProcurementSign
)
// const { run, loading } = useHttpRequest(type === 'saleOrder' ?
ContractContractSignSaleSign :
postContractElectronicContractsAffirm)
// const { run, loading } = useHttpRequest(type === 'saleOrder' ? postContractContractSignSaleSign :
postContractContractSignProcurementSign)
const
[
visible
,
setVisible
]
=
useState
(
false
)
useEffect
(()
=>
{
currentRef
.
current
=
{
...
...
@@ -38,40 +37,40 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
params
.
signatureLogId
=
data
.
signatureLogId
// params.id = parseInt(data.id)
}
const
res
=
await
run
(
params
)
if
(
res
.
code
===
1000
)
{
setVisible
(
false
)
if
(
type
===
'saleOrder'
)
{
handleConfirmOrder
({
id
:
Number
(
data
.
id
),
state
:
ctx
.
getFieldValue
(
'state'
),
signatureLogId
:
res
.
data
.
signatureLogId
})
}
else
{
// history.goBack()
handleContractsAffirm
({
id
:
Number
(
data
.
id
),
})
}
}
//
const res = await run(params)
//
if (res.code === 1000) {
//
setVisible(false)
//
if(type === 'saleOrder') {
//
handleConfirmOrder({
//
id: Number(data.id),
//
state: ctx.getFieldValue('state'),
//
signatureLogId: res.data.signatureLogId
//
})
//
} else {
//
// history.goBack()
//
handleContractsAffirm({
//
id: Number(data.id),
//
})
//
}
//
}
}
const
handleConfirmOrder
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
postOrderConfirmedOrder
(
params
,
{
ctlType
:
'none'
})
if
(
res
.
code
===
1000
)
{
history
.
goBack
()
}
else
{
message
.
error
(
res
.
message
)
}
// const res = await
postOrderConfirmedOrder(params, { ctlType: 'none' })
//
if(res.code === 1000) {
//
history.goBack()
//
} else {
//
message.error(res.message)
//
}
}
const
handleContractsAffirm
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
postContractElectronicContractsAffirm
(
params
,
{
ctlType
:
'none'
})
if
(
res
.
code
===
1000
)
{
history
.
goBack
()
}
else
{
message
.
error
(
res
.
message
)
}
// const res = await
postContractElectronicContractsAffirm(params, { ctlType: 'none' })
//
if(res.code === 1000) {
//
history.goBack()
//
} else {
//
message.error(res.message)
//
}
}
return
(
...
...
@@ -83,7 +82,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
cancelText=
'不签署'
visible=
{
visible
}
onOk=
{
handleSubmit
}
confirmLoading=
{
loading
}
//
confirmLoading={loading}
onCancel=
{
()
=>
setVisible
(
false
)
}
>
{
...
...
src/pages/transaction/components/orderHandDeleved/index.tsx
View file @
99c74b95
...
...
@@ -4,12 +4,13 @@ import NiceForm from '@/components/NiceForm'
import
{
createFormActions
}
from
'@formily/antd'
import
{
history
}
from
'umi'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
PublicApi
}
from
'@/services/api'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
moment
from
'moment'
import
{
useProductTable
}
from
'./model/useProductTable'
import
{
OrderKindType
}
from
'@/constants/order'
import
{
schema
}
from
'./constant'
import
{
getOrderVendorValidateDeliveryProduct
,
postOrderVendorValidateDeliveryConfirm
}
from
'@/services/OrderNewV2Api'
import
{
getLogisticsSelectListCompany
,
getLogisticsSelectListShipperAddress
}
from
'@/services/LogisticsV2Api'
export
interface
OrderHandDeleveModalProps
{
currentRef
:
any
...
...
@@ -39,7 +40,7 @@ const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
useEffect
(()
=>
{
if
(
visible
)
{
const
{
orderId
}
=
data
PublicApi
.
getOrderVendorValidateDeliveryProduct
({
orderId
,
deliveryNo
:
null
}).
then
(
res
=>
{
getOrderVendorValidateDeliveryProduct
({
orderId
,
deliveryNo
:
null
}).
then
(
res
=>
{
const
{
code
,
data
}:
any
=
res
if
(
code
===
1000
)
{
schemaActions
.
setFieldValue
(
'products'
,
data
.
map
(
item
=>
({
...
item
,
deliveryCount
:
item
[
'leftCount'
]
})))
...
...
@@ -56,7 +57,7 @@ const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
deliveryTime
:
moment
(
value
.
deliveryTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
const
{
code
}
=
await
PublicApi
.
postOrderVendorValidateDeliveryConfirm
(
params
)
const
{
code
}
=
await
postOrderVendorValidateDeliveryConfirm
(
params
)
if
(
code
===
1000
)
{
history
.
goBack
()
}
else
{
...
...
@@ -104,8 +105,8 @@ const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
deliveryTime
:
moment
().
format
(
'YYYY-MM-DD'
)
}
}
effects=
{
(
$
,
actions
)
=>
{
useAsyncSelect
(
'addresId'
,
async
()
=>
(
await
PublicApi
.
getLogisticsSelectListShipperAddress
()).
data
,
[
'fullAddress'
,
'id'
])
useAsyncSelect
(
'logisticsCompanyId'
,
async
()
=>
(
await
PublicApi
.
getLogisticsSelectListCompany
({
cooperateType
:
'2'
})).
data
,
[
'name'
,
'id'
])
useAsyncSelect
(
'addresId'
,
async
()
=>
(
await
getLogisticsSelectListShipperAddress
()).
data
,
[
'fullAddress'
,
'id'
])
useAsyncSelect
(
'logisticsCompanyId'
,
async
()
=>
(
await
getLogisticsSelectListCompany
({
cooperateType
:
'2'
})).
data
,
[
'name'
,
'id'
])
// 获取联动的select后续事件, 为了设置对应的name值
$
(
'requestAsyncSelect'
).
subscribe
(({
name
,
payload
})
=>
{
if
(
name
===
'addresId'
)
{
...
...
src/pages/transaction/components/orderHandReceivedModal/index.tsx
View file @
99c74b95
import
React
,
{
useContext
,
useState
,
useEffect
}
from
'react'
import
{
Modal
,
Row
,
Col
}
from
'antd'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
PublicApi
}
from
'@/services/api'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
history
}
from
'umi'
import
moment
from
'moment'
export
interface
OrderHandReceivedModalProps
{
currentRef
:
any
}
const
OrderHandReceivedModal
:
React
.
FC
<
OrderHandReceivedModalProps
>
=
({
currentRef
})
=>
{
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
const
formData
=
data
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderManualConfirmReceipt
)
const
handleConfirm
=
async
()
=>
{
const
{
code
}
=
await
run
({
orderId
:
formData
.
id
})
if
(
code
===
1000
)
{
history
.
goBack
()
}
}
useEffect
(()
=>
{
if
(
currentRef
)
{
currentRef
.
current
=
{
visible
:
confirmVisible
,
setVisible
:
setConfirmVisible
}
}
},
[])
return
<
Modal
title=
'收货信息'
onOk=
{
handleConfirm
}
onCancel=
{
()
=>
setConfirmVisible
(
false
)
}
visible=
{
confirmVisible
}
confirmLoading=
{
loading
}
>
{
formData
&&
<>
<
Row
>
<
Col
span=
{
6
}
><
p
>
发货地址:
</
p
></
Col
>
<
Col
><
p
>
{
formData
.
name
}
</
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
发货时间:
</
p
></
Col
>
<
Col
><
p
>
{
moment
(
formData
.
deliverTime
).
format
(
'YYYY-MM-DD'
)
}
</
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
物流单号:
</
p
></
Col
>
<
Col
><
p
><
a
href=
{
`https://www.kuaidi100.com/chaxun?nu=${formData.deliverNo}`
}
target=
"_blank"
>
{
formData
.
deliverNo
}
</
a
></
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
物流公司:
</
p
></
Col
>
<
Col
><
p
>
{
formData
.
logisticsCompany
}
</
p
></
Col
>
</
Row
>
</>
}
</
Modal
>
}
OrderHandReceivedModal
.
defaultProps
=
{}
export
default
OrderHandReceivedModal
\ No newline at end of file
import
React
,
{
useContext
,
useState
,
useEffect
}
from
'react'
import
{
Modal
,
Row
,
Col
}
from
'antd'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
history
}
from
'umi'
import
moment
from
'moment'
export
interface
OrderHandReceivedModalProps
{
currentRef
:
any
}
const
OrderHandReceivedModal
:
React
.
FC
<
OrderHandReceivedModalProps
>
=
({
currentRef
})
=>
{
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
const
formData
=
data
||
{}
// const { run, loading } = useHttpRequest(postOrderManualConfirmReceipt)
const
handleConfirm
=
async
()
=>
{
// const { code } = await run({
// orderId: formData.id
// })
// if (code === 1000) {
// history.goBack()
// }
}
useEffect
(()
=>
{
if
(
currentRef
)
{
currentRef
.
current
=
{
visible
:
confirmVisible
,
setVisible
:
setConfirmVisible
}
}
},
[])
return
<
Modal
title=
'收货信息'
onOk=
{
handleConfirm
}
onCancel=
{
()
=>
setConfirmVisible
(
false
)
}
visible=
{
confirmVisible
}
// confirmLoading={loading}
>
{
formData
&&
<>
<
Row
>
<
Col
span=
{
6
}
><
p
>
发货地址:
</
p
></
Col
>
<
Col
><
p
>
{
formData
.
name
}
</
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
发货时间:
</
p
></
Col
>
<
Col
><
p
>
{
moment
(
formData
.
deliverTime
).
format
(
'YYYY-MM-DD'
)
}
</
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
物流单号:
</
p
></
Col
>
<
Col
><
p
><
a
href=
{
`https://www.kuaidi100.com/chaxun?nu=${formData.deliverNo}`
}
target=
"_blank"
>
{
formData
.
deliverNo
}
</
a
></
p
></
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
><
p
>
物流公司:
</
p
></
Col
>
<
Col
><
p
>
{
formData
.
logisticsCompany
}
</
p
></
Col
>
</
Row
>
</>
}
</
Modal
>
}
OrderHandReceivedModal
.
defaultProps
=
{}
export
default
OrderHandReceivedModal
src/pages/transaction/components/orderPayModal/index.tsx
View file @
99c74b95
...
...
@@ -6,11 +6,13 @@ import cx from 'classnames'
import
{
ScanOutlined
,
UploadOutlined
}
from
'@ant-design/icons'
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
encryptedByAES
}
from
'@/utils/cryptoAes'
import
QRCode
from
'qrcode'
import
{
getOrderBuyerValidatePayResult
,
postOrderBuyerValidatePay
}
from
'@/services/OrderNewV2Api'
import
{
getSettleAccountsCommonCorporateAccountDetail
}
from
'@/services/SettleV2Api'
import
{
getPayAssetAccountBalance
,
getPayCreditGetCredit
}
from
'@/services/PayV2Api'
export
interface
OrderPayModalProps
{
currentRef
:
any
,
...
...
@@ -48,7 +50,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
[
balanceInfo
,
setBalanceInfo
]
=
useState
<
any
>
()
const
[
currentPaymentInfo
,
setCurrentPaymentInfo
]
=
useState
<
any
>
()
// 当前支付信息
const
[
blankAccountInfo
,
setBlankAccountInfo
]
=
useState
<
any
>
()
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerValidatePay
)
const
{
run
,
loading
}
=
useHttpRequest
(
postOrderBuyerValidatePay
)
const
[
settleAccountsError
,
setSettleAccountsError
]
=
useState
<
boolean
>
(
true
)
const
[
paymentAmount
,
setPaymentAmount
]
=
useState
<
string
>
()
const
[
tradeNo
,
setTradeNo
]
=
useState
<
string
>
()
// 需要轮询支付结果的交易号
...
...
@@ -116,8 +118,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
pollPayResult
=
()
=>
{
if
(
qrCodeInfo
.
qrUrl
||
qrCodeIframe
)
{
// @ts-ignore
PublicApi
.
getOrderBuyerValidatePayResult
({
orderId
:
id
,
batchNo
:
currentPaymentInfo
.
batchNo
,
tradeNo
}).
then
(
res
=>
{
getOrderBuyerValidatePayResult
({
orderId
:
id
,
batchNo
:
currentPaymentInfo
.
batchNo
,
tradeNo
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
if
(
data
&&
data
.
paySuccess
)
{
...
...
@@ -147,7 +148,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setCurrent
(
1
)
setPayStep
(
1
)
// 获取对公账户信息
PublicApi
.
getSettleAccountsCommonCorporateAccountDetail
({
memberId
:
data
.
vendorMemberId
,
roleId
:
data
.
vendorRoleId
,
type
:
checked
.
fundMode
}).
then
(
res
=>
{
getSettleAccountsCommonCorporateAccountDetail
({
memberId
:
data
.
vendorMemberId
,
roleId
:
data
.
vendorRoleId
,
type
:
checked
.
fundMode
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setBlankAccountInfo
(
res
.
data
)
setSettleAccountsError
(
true
)
...
...
@@ -159,7 +160,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
console
.
log
(
'选择了授信支付'
)
mobilePayFlag
.
current
=
0
setIsSpin
(
true
)
PublicApi
.
getPayCreditGetCredit
({
getPayCreditGetCredit
({
parentMemberId
:
data
.
vendorMemberId
,
parentMemberRoleId
:
data
.
vendorRoleId
}).
then
(
res
=>
{
...
...
@@ -174,7 +175,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
console
.
log
(
'选择了余额支付'
)
mobilePayFlag
.
current
=
0
setIsSpin
(
true
)
PublicApi
.
getPayAssetAccountBalance
({
getPayAssetAccountBalance
({
fundMode
:
checked
.
fundMode
,
vendorMemberId
:
data
.
vendorMemberId
,
vendorRoleId
:
data
.
vendorRoleId
,
...
...
src/pages/transaction/components/orderPayResultModal/index.tsx
View file @
99c74b95
...
...
@@ -2,11 +2,11 @@ import React, { useState, useEffect, useContext, useRef } from 'react'
import
{
Modal
,
List
,
Button
,
Space
}
from
'antd'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
OverflowText
from
'@/components/OverflowText'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
ImagePreview
from
'@/components/ImagePreview'
import
{
postOrderVendorValidatePayConfirm
}
from
'@/services/OrderNewV2Api'
export
interface
OrderPayResultModalProps
{
type
:
'default'
|
'preview'
,
...
...
@@ -19,7 +19,7 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
const
{
id
}
=
usePageStatus
()
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
canCtlData
=
data
?.
payments
.
find
(
v
=>
v
.
showConfirm
)
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderVendorValidatePayConfirm
)
const
{
run
,
loading
}
=
useHttpRequest
(
postOrderVendorValidatePayConfirm
)
const
transData
=
canCtlData
.
vouchers
?.
length
?
canCtlData
.
vouchers
:
[]
useEffect
(()
=>
{
if
(
currentRef
)
{
...
...
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
99c74b95
...
...
@@ -5,7 +5,7 @@ import { OrderDetailContext } from '../../_public/order/context'
import
MellowCard
from
'@/components/MellowCard'
import
OverflowText
from
'@/components/OverflowText'
import
{
EditOutlined
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/a
pi'
import
{
postOrderVendorValidateSubmitPaymentUpdate
}
from
'@/services/OrderNewV2A
pi'
// table编辑控件
const
EditableContext
=
React
.
createContext
<
any
>
({});
...
...
@@ -144,7 +144,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
...
row
,
});
// 执行修改订单价格
PublicApi
.
postOrderVendorValidateSubmitPaymentUpdate
({
postOrderVendorValidateSubmitPaymentUpdate
({
orderId
:
data
.
orderId
,
payRates
:
newData
.
map
(
item
=>
({
batchNo
:
item
.
batchNo
,
payRate
:
item
.
payRate
}))
}).
then
(
res
=>
{
...
...
src/pages/transaction/components/orderProductTable/index.tsx
View file @
99c74b95
...
...
@@ -185,7 +185,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
// const asyncGetMemberPrice = async (asyncData: any[]) => {
// return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
// console.log(v, 'v')
// const {code, data} = await
PublicApi.
getMemberManageUpperCreditParamGet({
// const {code, data} = await getMemberManageUpperCreditParamGet({
// parentMemberId: v.vendorMemberId,
// parentMemberRoleId: v.vendorRoleId
// }, {ttl: 60 * 1000, useCache: true})
...
...
src/pages/transaction/components/orderSaleRecord/index.tsx
View file @
99c74b95
...
...
@@ -5,7 +5,6 @@ import { OrderDetailContext } from '../../_public/order/context'
import
MellowCard
from
'@/components/MellowCard'
import
NestTable
from
'@/components/NestTable'
import
{
OrderKindType
}
from
'@/constants/order'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
...
...
@@ -406,7 +405,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
},
]
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderReceiptOrderConfirmedAll
)
// const { run, loading } = useHttpRequest(
postOrderReceiptOrderConfirmedAll)
const
handlePreviewReturn
=
(
record
)
=>
{
if
(
record
?.
receiveBill
)
{
...
...
@@ -417,93 +416,91 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 确认全部回单
const
handleSubmit
=
useCallback
(
async
()
=>
{
const
params
=
{
id
:
Number
(
data
.
id
),
state
:
1
}
const
result
=
await
run
(
params
)
//
const params = {
//
id: Number(data.id),
//
state: 1
//
}
//
const result = await run(params)
if
(
result
.
code
===
1000
)
{
history
.
goBack
()
}
//
if (result.code === 1000) {
//
history.goBack()
//
}
},
[])
// 确认发货
const
handleConfirm
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
setDisabled
(
true
)
const
{
code
}
=
await
PublicApi
.
postOrderConfirmShipmentOrder
(
params
)
if
(
code
===
1000
)
{
dataRef
.
current
.
push
(
record
.
id
)
reloadFormData
&&
reloadFormData
()
setDisabled
(
false
)
}
else
{
setDisabled
(
false
)
}
//
const params = {
//
orderId: record.orderId,
//
id: record.id
//
}
//
setDisabled(true)
// const { code } = await
postOrderConfirmShipmentOrder(params)
//
if (code === 1000) {
//
dataRef.current.push(record.id)
//
reloadFormData && reloadFormData()
//
setDisabled(false)
//
} else {
//
setDisabled(false)
//
}
}
// 确认回单
const
handleReturn
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
setDisabled
(
true
)
const
{
code
}
=
await
PublicApi
.
postOrderReceiptOrderConfirmed
(
params
)
if
(
code
===
1000
)
{
dataRef
.
current
.
push
(
record
.
id
)
reloadFormData
&&
reloadFormData
()
setDisabled
(
false
)
}
else
{
setDisabled
(
false
)
}
//
const params = {
//
orderId: record.orderId,
//
id: record.id
//
}
//
setDisabled(true)
// const { code } = await
postOrderReceiptOrderConfirmed(params)
//
if (code === 1000) {
//
dataRef.current.push(record.id)
//
reloadFormData && reloadFormData()
//
setDisabled(false)
//
} else {
//
setDisabled(false)
//
}
}
// 确认全部发货单已收到回单
const
handelReciveReturnOrder
=
async
()
=>
{
// @ts-ignore
const
res
=
await
PublicApi
.
getOrderIsDeliveryCompleted
({
id
:
data
.
id
},
{
ctlType
:
"none"
})
let
tip
=
''
if
(
res
.
data
)
tip
=
'是否确认本单全部发货单已收到回单?'
else
tip
=
'您还有未发货的商品,是否确认全部发货都已完成?'
confirm
({
title
:
'提示'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
tip
,
onOk
()
{
handleSubmit
()
},
});
// const res = await getOrderIsDeliveryCompleted({id: data.id}, {ctlType: "none"})
// let tip = ''
// if(res.data)
// tip = '是否确认本单全部发货单已收到回单?'
// else
// tip = '您还有未发货的商品,是否确认全部发货都已完成?'
// confirm({
// title: '提示',
// icon: <ExclamationCircleOutlined />,
// content: tip,
// onOk() {
// handleSubmit()
// },
// });
}
// 继续发货
const
handleContinueDeliver
=
async
()
=>
{
// @ts-ignore
const
res
=
await
PublicApi
.
getOrderIsDeliveryCompleted
({
id
:
data
.
id
},
{
ctlType
:
'none'
})
let
tip
=
''
if
(
res
.
data
)
tip
=
'您商品都已发货.是否确认还需要继续发货?'
else
tip
=
'是否继续发货?'
confirm
({
title
:
'提示'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
tip
,
onOk
()
{
PublicApi
.
postOrderReceiptOrderContinueShipping
({
orderId
:
data
.
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
})
},
});
// const res = await getOrderIsDeliveryCompleted({id: data.id}, {ctlType: 'none'})
// let tip = ''
// if(res.data)
// tip = '您商品都已发货.是否确认还需要继续发货?'
// else
// tip = '是否继续发货?'
// confirm({
// title: '提示',
// icon: <ExclamationCircleOutlined />,
// content: tip,
// onOk() {
// postOrderReceiptOrderContinueShipping({orderId: data.id}).then(res => {
// if(res.code === 1000) {
// setTimeout(() => {
// history.goBack()
// }, 1000)
// }
// })
// },
// });
}
return
(
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
99c74b95
...
...
@@ -2,7 +2,6 @@ import React, { useContext, useState, useRef, useEffect, useCallback } from 'rea
import
{
Table
,
Form
,
Input
,
Row
,
Col
,
Button
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
EditOutlined
,
SettingOutlined
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/api'
import
styled
from
'styled-components'
import
ModalForm
from
'@/components/ModalForm'
import
{
createFormActions
}
from
'@formily/antd'
...
...
@@ -13,6 +12,9 @@ import {
OrderKindType
,
}
from
'@/constants/order'
import
{
AddressPop
}
from
'../addressPop'
import
{
postOrderVendorValidateSubmitFreightUpdate
}
from
'@/services/OrderNewV2Api'
import
{
postLogisticsFreightTemplateCalFreightPrice
}
from
'@/services/LogisticsV2Api'
import
{
getProductPositionDeductionRecordList
}
from
'@/services/ProductV2Api'
export
interface
OrderProductTableProps
{}
...
...
@@ -188,7 +190,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
let
free
=
modalPriceActions
.
getFieldValue
(
'freePrice'
)
setFreePrice
(
Number
(
free
||
0
))
// 执行修改订单运费
PublicApi
.
postOrderVendorValidateSubmitFreightUpdate
({
orderId
:
dataSource
.
orderId
,
freight
:
free
}).
then
(
res
=>
{
postOrderVendorValidateSubmitFreightUpdate
({
orderId
:
dataSource
.
orderId
,
freight
:
free
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
modelRef
.
current
.
setVisible
(
false
)
reloadFormData
()
...
...
@@ -202,7 +204,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
// 筛选配送方式为物流的商品并且使用了运费模板
const
logsiticsDataMaps
=
products
.
filter
(
v
=>
v
.
logistics
&&
v
.
logistics
.
useTemplate
&&
v
.
logistics
.
deliveryType
===
1
)
if
(
logsiticsDataMaps
.
length
>
0
)
{
PublicApi
.
postLogisticsFreightTemplateCalFreightPrice
({
postLogisticsFreightTemplateCalFreightPrice
({
orderProductList
:
logsiticsDataMaps
.
map
(
v
=>
({
templateId
:
v
.
templateId
,
weight
:
v
.
weight
...
...
@@ -406,7 +408,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
// const asyncGetMemberPrice = async (asyncData: any[]) => {
// return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
// const {code, data} = await
PublicApi.
getMemberManageUpperCreditParamGet({
// const {code, data} = await getMemberManageUpperCreditParamGet({
// parentMemberId: v.memberId,
// parentMemberRoleId: v.memberRoleId
// }, {ttl: 60 * 1000, useCache: true})
...
...
@@ -446,7 +448,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
...
row
,
});
// 执行修改订单价格
PublicApi
.
postOrderVendorValidateSubmitFreightUpdate
({
orderId
:
data
.
orderId
,
prices
:
[{
orderProductId
:
row
.
orderProductId
,
price
:
row
.
price
}]}).
then
(
res
=>
{
postOrderVendorValidateSubmitFreightUpdate
({
orderId
:
data
.
orderId
,
prices
:
[{
orderProductId
:
row
.
orderProductId
,
price
:
row
.
price
}]}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
reloadFormData
()
}
...
...
@@ -659,7 +661,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
]
const
fetchWarehouseData
=
useCallback
(
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getProductPositionDeductionRecordList
({...
params
,
productId
:
String
(
checkProduct
?.
skuId
),
stockId
:
checkProduct
?.
stockId
})
const
{
data
}
=
await
getProductPositionDeductionRecordList
({...
params
,
productId
:
String
(
checkProduct
?.
skuId
),
stockId
:
checkProduct
?.
stockId
})
return
data
},
[
checkProduct
])
...
...
src/pages/transaction/effect/index.tsx
View file @
99c74b95
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetOrderBuyerPageItemsResponse
}
from
'@/services/OrderV2Api'
;
import
{
getOrderBuyerCreatePageItems
,
getOrderBuyerPageItems
,
GetOrderBuyerPageItemsResponse
,
getOrderBuyerValidatePageItems
,
getOrderVendorPageItems
,
getOrderVendorValidatePageItems
}
from
'@/services/OrderNewV2Api'
import
{
getProductSelectGetSelectCategory
}
from
'@/services/ProductV2Api'
import
{
getPurchaseRequisitionFindInnerStatusEnum
}
from
'@/services/PurchaseV2Api'
import
{
useEffect
,
useState
}
from
'react'
// 高级筛选schema中用于输入搜索需求发布品类的Effect
export
const
searchSelectGetSelectCategoryOptionEffect
=
(
context
:
any
,
fieldName
:
string
)
=>
{
context
.
getFieldState
(
fieldName
,
state
=>
{
PublicApi
.
getProductSelectGetSelectCategory
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
getProductSelectGetSelectCategory
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
})
...
...
@@ -27,7 +28,7 @@ export const getPurchaseOrderSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
GetOrderBuyerPageItemsResponse
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderBuyerPageItems
({}).
then
(
res
=>
{
getOrderBuyerPageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
@@ -43,7 +44,7 @@ export const getSaleOrderSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderVendorPageItems
({}).
then
(
res
=>
{
getOrderVendorPageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
@@ -59,7 +60,7 @@ export const getPurchaseOrderAuditPageSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderBuyerValidatePageItems
({}).
then
(
res
=>
{
getOrderBuyerValidatePageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
@@ -76,7 +77,7 @@ export const getSaleOrderAuditPageSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderVendorValidatePageItems
({}).
then
(
res
=>
{
getOrderVendorValidatePageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
@@ -92,7 +93,7 @@ export const getPurchaseOrderReadyAddPageSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderBuyerCreatePageItems
({}).
then
(
res
=>
{
getOrderBuyerCreatePageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
@@ -108,7 +109,7 @@ export const getPurchaseRequisitionOrderPageSelectOption = () => {
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getPurchaseRequisitionFindInnerStatusEnum
({}).
then
(
res
=>
{
getPurchaseRequisitionFindInnerStatusEnum
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
...
...
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