Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
ebd0821e
Commit
ebd0821e
authored
Oct 20, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:销售订单-提交审核
parent
bed1cdf6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
50 deletions
+65
-50
constant.ts
src/pages/transaction/_public/order/constant.ts
+19
-2
useOrderDetail.tsx
...ages/transaction/_public/order/effects/useOrderDetail.tsx
+8
-7
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+5
-3
index.tsx
...pages/transaction/components/orderElectronModal/index.tsx
+10
-4
index.less
...s/transaction/components/saleOrderProductTable/index.less
+12
-0
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+0
-0
index.tsx
...transaction/saleOrder/readyApprovedOrder/detail/index.tsx
+10
-29
index.tsx
src/pages/transaction/saleOrder/readyApprovedOrder/index.tsx
+1
-5
No files found.
src/pages/transaction/_public/order/constant.ts
View file @
ebd0821e
...
...
@@ -8,4 +8,21 @@ export const orderTypeLabel = ['',
'渠道直采'
,
'渠道现货'
,
'渠道现货'
,
]
\ No newline at end of file
]
/**
* 销售订单状态枚举
*/
export
enum
SALE_ORDER_STATUS
{
PREVIEW_ORDER
=
-
1
,
READY_APPROVED_ORDER
,
ONE_LEVEL_APPROVED_ORDER
,
TWO_LEVEL_APPROVED_ORDER
,
CONFIRM_ORDER
,
CONFIRM_PAY_RESULT_ORDER
,
ADD_SALE_ORDER
,
ADD_LOG_ORDER
,
CONFIRM_DELIVE_GOODS_ORDER
,
CONFIRM_RETURN_ORDER
,
RETURN_DOCUMENT_ORDER
}
\ No newline at end of file
src/pages/transaction/_public/order/effects/useOrderDetail.tsx
View file @
ebd0821e
import
React
from
'react'
import
React
,
{
useRef
}
from
'react'
import
{
useCallback
,
useState
,
useEffect
}
from
'react'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
...
...
@@ -17,22 +17,22 @@ interface OrderDetailHookProps {
export
const
useOrderDetail
=
(
options
:
OrderDetailHookProps
)
=>
{
// 订单详情内容
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
// 支付信息列表
const
[
payList
,
setPaylist
]
=
useState
<
any
[]
>
([])
const
{
id
}
=
usePageStatus
()
const
{
type
}
=
options
const
detailList
=
[
const
dataRef
=
useRef
<
any
>
([
{
label
:
'对应报价单号'
,
name
:
'quotationNo'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'orderThe'
,
span
:
8
},
{
label
:
'供应会员'
,
name
:
'supplyMembersName'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderModel'
,
span
:
8
,
render
:
text
=>
GlobalConfig
.
web
.
orderMode
.
find
(
v
=>
v
.
value
===
text
)?.
label
||
''
},
{
label
:
'订单类型'
,
name
:
'type'
,
span
:
8
,
render
:
text
=>
orderTypeLabel
[
text
]
},
{
label
:
'下单时间'
,
name
:
'createTime'
,
span
:
8
,
render
:
text
=>
formatTimeString
(
text
)
},
{
label
:
'外部状态'
,
name
:
'externalState'
,
span
:
8
,
render
:
text
=>
<
StatusColors
type=
'out'
status=
{
text
}
/>
},
{
label
:
'内部状态'
,
name
:
'interiorState'
,
span
:
8
,
render
:
text
=>
<
StatusColors
type=
'inside'
status=
{
text
}
/>
},
]
{
label
:
'外部状态'
,
name
:
'externalState'
,
span
:
8
,
render
:
text
=>
<
StatusColors
type=
'out'
status=
{
text
}
/>
},
{
label
:
'内部状态'
,
name
:
type
===
'saleOrder'
?
'purchaseOrderInteriorState'
:
'interiorState'
,
span
:
8
,
render
:
text
=>
<
StatusColors
type=
{
type
===
'saleOrder'
?
'saleInside'
:
'inside'
}
status=
{
text
}
/>
},
]
)
useEffect
(()
=>
{
reloadFormData
()
...
...
@@ -76,6 +76,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
return
{
formContext
,
id
,
detailList
detailList
:
dataRef
.
current
}
}
\ No newline at end of file
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
ebd0821e
...
...
@@ -2,16 +2,18 @@ import React from 'react'
import
AuditProcess
from
'@/components/AuditProcess'
import
{
findLastIndexFlowState
}
from
'../../_public/order/utils'
import
OrderProductTable
from
'../../components/orderProductTable'
import
SaleOrderProductTable
from
'../../components/saleOrderProductTable'
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
formContext
:
any
,
type
?:
'purchaseOrder'
|
'saleOrder'
}
const
OrderDetailSection
:
React
.
FC
<
OrderDetailSectionProps
>
=
({
formContext
})
=>
{
const
OrderDetailSection
:
React
.
FC
<
OrderDetailSectionProps
>
=
({
formContext
,
type
=
'purchaseOrder'
})
=>
{
return
(
formContext
.
data
&&
<
div
className=
'gray-wrap'
>
<
AuditProcess
...
...
@@ -23,7 +25,7 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext}) =>
innerVerifySteps=
{
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
||
[]
}
></
AuditProcess
>
<
OrderProductTable
editable
/>
{
type
===
'saleOrder'
?
<
SaleOrderProductTable
/>
:
<
OrderProductTable
editable
/>
}
<
OrderPayTabs
/>
...
...
src/pages/transaction/components/orderElectronModal/index.tsx
View file @
ebd0821e
...
...
@@ -3,6 +3,7 @@ import { Modal } from 'antd'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
export
interface
OrderElectronModalProps
{
currentRef
:
any
,
...
...
@@ -12,6 +13,7 @@ export interface OrderElectronModalProps {
const
OrderElectronModal
:
React
.
FC
<
OrderElectronModalProps
>
=
(
props
)
=>
{
const
{
currentRef
}
=
props
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderElectronicContractsAffirm
)
const
[
visible
,
setVisible
]
=
useState
(
false
)
useEffect
(()
=>
{
currentRef
.
current
=
{
...
...
@@ -24,7 +26,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const
params
=
{
id
:
parseInt
(
data
.
id
),
}
const
{
code
}
=
await
PublicApi
.
postOrderElectronicContractsAffirm
(
params
)
const
{
code
}
=
await
run
(
params
)
if
(
code
===
1000
)
{
setVisible
(
false
)
history
.
goBack
()
...
...
@@ -39,11 +41,15 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
cancelText=
'不签署'
visible=
{
visible
}
onOk=
{
handleSubmit
}
confirmLoading=
{
loading
}
onCancel=
{
()
=>
setVisible
(
false
)
}
>
<
div
style=
{
{
height
:
600
,
position
:
'relative'
}
}
>
<
iframe
src=
{
data
.
electronicContractUrl
}
style=
{
{
position
:
'absolute'
,
left
:
0
,
top
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'block'
}
}
/>
</
div
>
{
data
&&
<
div
style=
{
{
height
:
600
,
position
:
'relative'
}
}
>
<
iframe
src=
{
data
.
electronicContractUrl
}
style=
{
{
position
:
'absolute'
,
left
:
0
,
top
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'block'
}
}
/>
</
div
>
}
</
Modal
>
)
}
...
...
src/pages/transaction/components/saleOrderProductTable/index.less
0 → 100644
View file @
ebd0821e
.cancel {
color: #909399;
font-size: 12px;
cursor: pointer;
margin: 0 4px;
}
.confirm {
color: #00B37A;
font-size: 12px;
cursor: pointer;
}
\ No newline at end of file
src/pages/transaction/components/saleOrderProductTable/index.tsx
0 → 100644
View file @
ebd0821e
This diff is collapsed.
Click to expand it.
src/pages/transaction/saleOrder/readyApprovedOrder/detail/index.tsx
View file @
ebd0821e
...
...
@@ -6,34 +6,17 @@ 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'
;
import
OrderElectronModal
from
'@/pages/transaction/components/orderElectronModal'
;
const
FirstApprovedOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'purchaseOrder'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderProcurementOrderReviewed
)
const
approvedRef
=
useRef
<
any
>
({})
const
ReadyApprovedOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
const
electronRef
=
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
()
}
})
electronRef
.
current
.
setVisible
(
true
)
},
[])
return
(
...
...
@@ -47,19 +30,17 @@ const FirstApprovedOrderDetail: React.FC = () => {
<
OrderDetailWrapper
>
<
PreLoading
loading=
{
!
formContext
.
data
}
active
paragraph=
{
{
rows
:
6
}
}
>
<
OrderDetailSection
formContext=
{
formContext
}
/>
<
OrderDetailSection
formContext=
{
formContext
}
type=
'saleOrder'
/>
</
PreLoading
>
</
OrderDetailWrapper
>
{
/* 提交时触发的弹窗集合 */
}
<
ApprovedOrderModal
currentRef=
{
approvedRef
}
onConfirm=
{
handleSubmit
}
loading=
{
loading
}
<
OrderElectronModal
currentRef=
{
electronRef
}
/>
</
OrderDetailContext
.
Provider
>
</
div
>
);
};
export
default
FirstApprovedOrderDetail
;
\ No newline at end of file
export
default
ReadyApprovedOrderDetail
;
\ No newline at end of file
src/pages/transaction/saleOrder/readyApprovedOrder/index.tsx
View file @
ebd0821e
import
React
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
,
message
}
from
'antd'
import
{
Card
,
Button
,
Space
,
message
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
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'
...
...
@@ -13,7 +10,6 @@ import Submit from '@/components/NiceForm/components/Submit'
import
{
DatePicker
}
from
'@formily/antd-components'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
PurchaseOrderInsideWorkState
}
from
'@/constants'
// 待提交审核订单
...
...
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