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
67212c07
Commit
67212c07
authored
Nov 05, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增采购订单,销售订单批量归档逻辑
parent
a604c3c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
index.tsx
src/pages/transaction/purchaseOrder/readyFileOrder/index.tsx
+42
-4
index.ts
.../transaction/purchaseOrder/readyFileOrder/schema/index.ts
+2
-2
index.tsx
...pages/transaction/saleOrder/readyReturnDocument/index.tsx
+1
-1
No files found.
src/pages/transaction/purchaseOrder/readyFileOrder/index.tsx
View file @
67212c07
import
React
from
'react'
import
React
,
{
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
}
from
'antd'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
,
message
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
...
...
@@ -12,6 +12,9 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
DatePicker
}
from
'@formily/antd-components'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
PurchaseOrderInsideWorkState
,
SaleOrderInsideWorkState
}
from
'@/constants'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
// 待归档订单
...
...
@@ -25,15 +28,38 @@ const fetchTableData = async (params) => {
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
columns
,
ref
,
rowSelection
,
rowSelectionCtl
}
=
useSelfTable
()
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderFiledOrderAddAll
)
const
handleSubmitBatch
=
async
()
=>
{
if
(
rowSelectionCtl
.
selectRow
.
length
===
0
)
{
message
.
error
(
'请先勾选订单'
)
return
;
}
const
canBitch
=
!
rowSelectionCtl
.
selectRow
.
some
(
v
=>
v
.
purchaseOrderInteriorState
!==
PurchaseOrderInsideWorkState
.
FILLING_ORDER
)
if
(
canBitch
)
{
const
{
code
}
=
await
run
({
ids
:
rowSelectionCtl
.
selectedRowKeys
})
if
(
code
===
1000
)
{
rowSelectionCtl
.
setSelectRow
([])
rowSelectionCtl
.
setSelectedRowKeys
([])
ref
.
current
.
reload
()
}
}
else
{
message
.
error
(
'只能批量提交内部状态为待确认归档的订单'
)
}
}
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
rowSelection=
{
rowSelection
}
columns=
{
columns
}
rowKey=
{
'orderNo'
}
currentRef=
{
ref
}
rowKey=
{
'id'
}
formilyLayouts=
{
{
justify
:
'space-between'
}
}
...
...
@@ -53,6 +79,18 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
DateRangePicker
:
DatePicker
.
RangePicker
,
Submit
}
},
layouts
:
{
order
:
2
,
span
:
16
}
}
}
formilyChilds=
{
{
children
:
<
Space
>
<
Button
onClick=
{
handleSubmitBatch
}
loading=
{
loading
}
>
批量提交审核
</
Button
>
</
Space
>,
layouts
:
{
span
:
8
}
}
}
/>
...
...
src/pages/transaction/purchaseOrder/readyFileOrder/schema/index.ts
View file @
67212c07
...
...
@@ -12,7 +12,7 @@ export const tableListSchema: ISchema = {
"x-component"
:
'SearchFilter'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
'flex-
start
'
,
align
:
'flex-
end
'
,
},
},
[
FORM_FILTER_PATH
]:
{
...
...
@@ -21,7 +21,7 @@ export const tableListSchema: ISchema = {
'x-component-props'
:
{
inline
:
true
,
colStyle
:
{
margin
Righ
t
:
20
margin
Lef
t
:
20
}
},
properties
:
{
...
...
src/pages/transaction/saleOrder/readyReturnDocument/index.tsx
View file @
67212c07
...
...
@@ -33,7 +33,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelection
,
rowSelectionCtl
}
=
useSelfTable
()
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrder
SubmittedReviewOrderOne
All
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrder
OfOrdersToBeFiled
All
)
const
handleSubmitBatch
=
async
()
=>
{
if
(
rowSelectionCtl
.
selectRow
.
length
===
0
)
{
...
...
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