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
bed1cdf6
Commit
bed1cdf6
authored
Oct 20, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:抽离订单共用部分
parent
4e914a28
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
101 additions
and
38 deletions
+101
-38
constant.ts
src/pages/transaction/_public/order/constant.ts
+12
-0
context.ts
src/pages/transaction/_public/order/context.ts
+0
-0
useOrderDetail.tsx
...ages/transaction/_public/order/effects/useOrderDetail.tsx
+2
-2
index.ts
src/pages/transaction/_public/order/utils/index.ts
+0
-0
index.tsx
...pages/transaction/components/approvedOrderModal/index.tsx
+0
-0
index.tsx
src/pages/transaction/components/orderDeleveRecord/index.tsx
+1
-1
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+6
-6
index.less
...ages/transaction/components/orderElectronModal/index.less
+0
-0
index.tsx
...pages/transaction/components/orderElectronModal/index.tsx
+1
-1
index.less
src/pages/transaction/components/orderMergeInfo/index.less
+0
-0
index.tsx
src/pages/transaction/components/orderMergeInfo/index.tsx
+3
-4
index.less
src/pages/transaction/components/orderPayModal/index.less
+0
-0
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+1
-1
index.less
src/pages/transaction/components/orderPayTabs/index.less
+0
-0
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+2
-3
index.less
...pages/transaction/components/orderProductTable/index.less
+0
-0
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+1
-1
index.tsx
...ges/transaction/components/orderTransformRecord/index.tsx
+2
-2
index.tsx
...saction/purchaseOrder/firstApprovedOrder/detail/index.tsx
+4
-4
index.tsx
...ansaction/purchaseOrder/readySubmitOrder/detail/index.tsx
+3
-4
index.tsx
...action/purchaseOrder/secondApprovedOrder/detail/index.tsx
+4
-4
index.tsx
...transaction/saleOrder/readyApprovedOrder/detail/index.tsx
+59
-5
No files found.
src/pages/transaction/_public/order/constant.ts
View file @
bed1cdf6
export
const
orderTypeLabel
=
[
''
,
'现货采购'
,
'现货采购'
,
'询价采购'
,
'需求采购'
,
'集采'
,
'渠道直采'
,
'渠道直采'
,
'渠道现货'
,
'渠道现货'
,
]
\ No newline at end of file
src/pages/transaction/
purchaseOrder/public/context/index
.ts
→
src/pages/transaction/
_public/order/context
.ts
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public
/effects/useOrderDetail.tsx
→
src/pages/transaction/
_public/order
/effects/useOrderDetail.tsx
View file @
bed1cdf6
...
...
@@ -4,9 +4,9 @@ import { usePageStatus } from '@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
import
{
Link
}
from
'umi'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
orderTypeLabel
}
from
'../
../orderCollect/
constant'
import
{
orderTypeLabel
}
from
'../constant'
import
{
formatTimeString
}
from
'@/utils'
import
StatusColors
from
'../../components/StatusColors'
import
StatusColors
from
'../../
../
components/StatusColors'
interface
OrderDetailHookProps
{
// 采购、销售
...
...
src/pages/transaction/
purchaseO
rder/utils/index.ts
→
src/pages/transaction/
_public/o
rder/utils/index.ts
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/approvedOrderModal/index.tsx
→
src/pages/transaction/components/approvedOrderModal/index.tsx
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderDeleveRecord/index.tsx
→
src/pages/transaction/components/orderDeleveRecord/index.tsx
View file @
bed1cdf6
...
...
@@ -2,7 +2,7 @@ import React, { useContext } from 'react'
import
{
Tabs
,
Table
,
Button
}
from
'antd'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
formatTimeString
}
from
'@/utils'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
MellowCard
from
'@/components/MellowCard'
import
NestTable
from
'@/components/NestTable'
import
{
SaleOrderInsideWorkState
,
DeliverySideState
}
from
'@/constants'
...
...
src/pages/transaction/
purchaseOrder/
components/orderDetailSection/index.tsx
→
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
bed1cdf6
import
React
from
'react'
import
AuditProcess
from
'@/components/AuditProcess'
import
{
findLastIndexFlowState
}
from
'../../utils'
import
OrderProductTable
from
'../../
public/
components/orderProductTable'
import
OrderPayTabs
from
'../../
public/
components/OrderPayTabs'
import
OrderMergeInfo
from
'../../
public/
components/OrderMergeInfo'
import
OrderDeleveRecord
from
'../../
public/
components/OrderDeleveRecord'
import
OrderTransformRecord
from
'../../
public/
components/OrderTransformRecord'
import
{
findLastIndexFlowState
}
from
'../../
_public/order/
utils'
import
OrderProductTable
from
'../../components/orderProductTable'
import
OrderPayTabs
from
'../../components/OrderPayTabs'
import
OrderMergeInfo
from
'../../components/OrderMergeInfo'
import
OrderDeleveRecord
from
'../../components/OrderDeleveRecord'
import
OrderTransformRecord
from
'../../components/OrderTransformRecord'
export
interface
OrderDetailSectionProps
{
formContext
:
any
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderElectronModal/index.less
→
src/pages/transaction/components/orderElectronModal/index.less
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderElectronModal/index.tsx
→
src/pages/transaction/components/orderElectronModal/index.tsx
View file @
bed1cdf6
import
React
,
{
useEffect
,
useState
,
useContext
}
from
'react'
import
{
Modal
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderMergeInfo/index.less
→
src/pages/transaction/components/orderMergeInfo/index.less
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderMergeInfo/index.tsx
→
src/pages/transaction/components/orderMergeInfo/index.tsx
View file @
bed1cdf6
import
React
,
{
useContext
,
useEffect
,
useState
,
useMemo
}
from
'react'
import
React
,
{
useContext
}
from
'react'
import
{
Row
,
Col
,
Tag
}
from
'antd'
import
MellowCard
from
'@/components/MellowCard'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
{
formatTimeString
}
from
'@/utils'
import
{
DELIVERY_TYPE
}
from
'@/constants'
import
style
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
import
ContractList
from
'../../../../components/ContractList'
import
ContractList
from
'../ContractList'
import
cx
from
'classnames'
export
interface
OrderMergeInfoProps
{
}
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderPayModal/index.less
→
src/pages/transaction/components/orderPayModal/index.less
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderPayModal/index.tsx
→
src/pages/transaction/components/orderPayModal/index.tsx
View file @
bed1cdf6
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
}
from
'react'
import
{
Modal
,
Steps
,
Row
,
Col
,
Radio
,
message
,
Upload
,
Button
}
from
'antd'
import
style
from
'./index.less'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
cx
from
'classnames'
import
{
UploadOutlined
}
from
'@ant-design/icons'
import
{
UPLOAD_TYPE
}
from
'@/constants'
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderPayTabs/index.less
→
src/pages/transaction/components/orderPayTabs/index.less
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderPayTabs/index.tsx
→
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
bed1cdf6
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
import
style
from
'./index.less'
import
{
Tabs
,
Row
,
Col
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
MellowCard
from
'@/components/MellowCard'
import
StatusColors
from
'../../../components/StatusColors'
import
{
PublicApi
}
from
'@/services/api'
import
StatusColors
from
'../StatusColors'
export
interface
OrderPayTabsProps
{}
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderProductTable/index.less
→
src/pages/transaction/components/orderProductTable/index.less
View file @
bed1cdf6
File moved
src/pages/transaction/
purchaseOrder/public/
components/orderProductTable/index.tsx
→
src/pages/transaction/components/orderProductTable/index.tsx
View file @
bed1cdf6
import
React
,
{
useContext
,
useState
,
useRef
,
useEffect
}
from
'react'
import
{
StandardTable
}
from
'god'
import
{
Card
,
Table
,
Form
,
Input
,
Row
,
Col
,
Button
,
Modal
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
{
EditOutlined
,
SettingOutlined
}
from
'@ant-design/icons'
import
style
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
...
...
src/pages/transaction/
purchaseOrder/public/
components/orderTransformRecord/index.tsx
→
src/pages/transaction/components/orderTransformRecord/index.tsx
View file @
bed1cdf6
import
React
,
{
useContext
}
from
'react'
import
{
Tabs
,
Table
}
from
'antd'
import
StatusColors
from
'../
../../components/
StatusColors'
import
StatusColors
from
'../StatusColors'
import
{
formatTimeString
}
from
'@/utils'
import
{
OrderDetailContext
}
from
'../../context'
import
{
OrderDetailContext
}
from
'../../
_public/order/
context'
import
MellowCard
from
'@/components/MellowCard'
export
interface
OrderTransformRecordProps
{}
...
...
src/pages/transaction/purchaseOrder/firstApprovedOrder/detail/index.tsx
View file @
bed1cdf6
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../
public
/context'
;
import
{
OrderDetailContext
}
from
'../../
../_public/order
/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../
public
/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../
public
/components/approvedOrderModal'
;
import
{
useOrderDetail
}
from
'../../
../_public/order
/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../
..
/components/approvedOrderModal'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../components/orderDetailSection'
;
import
OrderDetailSection
from
'../../
../
components/orderDetailSection'
;
const
FirstApprovedOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
...
...
src/pages/transaction/purchaseOrder/readySubmitOrder/detail/index.tsx
View file @
bed1cdf6
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../
public
/context'
;
import
{
OrderDetailContext
}
from
'../../
../_public/order
/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../public/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../public/components/approvedOrderModal'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../components/orderDetailSection'
;
import
OrderDetailSection
from
'../../
../
components/orderDetailSection'
;
const
ReadySubmitOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
...
...
src/pages/transaction/purchaseOrder/secondApprovedOrder/detail/index.tsx
View file @
bed1cdf6
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../
public
/context'
;
import
{
OrderDetailContext
}
from
'../../
../_public/order
/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../
public
/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../
public
/components/approvedOrderModal'
;
import
{
useOrderDetail
}
from
'../../
../_public/order
/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../
..
/components/approvedOrderModal'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../components/orderDetailSection'
;
import
OrderDetailSection
from
'../../
../
components/orderDetailSection'
;
const
SecondApprovedOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
...
...
src/pages/transaction/saleOrder/readyApprovedOrder/detail/index.tsx
View file @
bed1cdf6
import
React
from
'react'
;
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../../components/approvedOrderModal'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
const
FirstApprovedOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderProcurementOrderReviewed
)
const
approvedRef
=
useRef
<
any
>
({})
const
handleClick
=
useCallback
(()
=>
{
approvedRef
.
current
.
setVisible
(
true
)
},
[])
// 提交表单
const
handleSubmit
=
useCallback
(()
=>
{
approvedRef
.
current
.
actions
.
submit
().
then
(
async
({
values
})
=>
{
const
params
=
{
id
:
Number
(
id
),
...
values
}
const
result
=
await
run
(
params
)
if
(
result
.
code
===
1000
)
{
approvedRef
.
current
.
setVisible
(
false
)
history
.
goBack
()
}
})
},
[])
const
ReadyApprovedOrderDetail
:
React
.
FC
=
()
=>
{
return
(
<
div
>
待审核订单详情
<
OrderDetailContext
.
Provider
value=
{
formContext
}
>
<
OrderDetailHeader
detailList=
{
detailList
}
detailData=
{
formContext
.
data
}
extraRight=
{
<
Button
type=
'primary'
onClick=
{
handleClick
}
>
提交审核
</
Button
>
}
/>
<
OrderDetailWrapper
>
<
PreLoading
loading=
{
!
formContext
.
data
}
active
paragraph=
{
{
rows
:
6
}
}
>
<
OrderDetailSection
formContext=
{
formContext
}
/>
</
PreLoading
>
</
OrderDetailWrapper
>
{
/* 提交时触发的弹窗集合 */
}
<
ApprovedOrderModal
currentRef=
{
approvedRef
}
onConfirm=
{
handleSubmit
}
loading=
{
loading
}
/>
</
OrderDetailContext
.
Provider
>
</
div
>
);
};
export
default
ReadyApprovedOrderDetail
;
\ No newline at end of file
export
default
FirstApprovedOrderDetail
;
\ No newline at end of file
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