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
801355f2
Commit
801355f2
authored
Jul 12, 2022
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '0518' into 'jinfa-0518'
fix: [25603] 新增请购单中的查看库存,有返回数据但是页面未展示 See merge request project/jinfa-platform!168 (cherry picked from commit
a2a4e23f
)
5199619a
fix: [25603] 新增请购单中的查看库存,有返回数据但是页面未展示
parent
f5d1b74f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
index.tsx
...on/increaseRequisition/components/viewInventory/index.tsx
+20
-10
No files found.
src/pages/transaction/purchaseRequisition/increaseRequisition/components/viewInventory/index.tsx
View file @
801355f2
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
;
import
{
useIntl
}
from
'umi'
import
{
Button
,
Tabs
,
Drawer
}
from
'antd'
;
import
{
Button
,
Drawer
,
Table
}
from
'antd'
;
import
{
ISchemaFormActions
,
ISchemaFormAsyncActions
}
from
'@formily/antd'
;
import
TableLayout
from
'./table'
;
import
{
fetchOrderApi
}
from
'../../apis'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
moment
from
'moment'
;
import
{
getProductStockGetStock
}
from
'@/services/ProductV2Api'
;
export
interface
MemberModalTableProps
{
schemaAction
?:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
...
...
@@ -37,7 +36,7 @@ const ViewInventory: React.FC<MemberModalTableProps> = (props: MemberModalTableP
const
{
schemaAction
,
currentRef
,
confirmModal
,
productRef
,
setLik
,
record
}
=
props
;
const
ref
=
useRef
<
any
>
({})
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
dataSource
,
setDataSource
]
=
useState
<
any
[]
>
([])
const
format
=
(
text
,
fmt
?:
string
)
=>
{
return
<>
{
moment
(
text
).
format
(
fmt
||
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
...
...
@@ -151,6 +150,21 @@ const ViewInventory: React.FC<MemberModalTableProps> = (props: MemberModalTableP
},
]
const
fetchData
=
()
=>
{
getProductStockGetStock
({
matnr
:
record
?.
code
||
record
?.
productNo
,
werks
:
record
?.
factory
,
productGlobalId
:
record
?.
globalMQID
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
setDataSource
(
res
.
data
)
})
}
useEffect
(()
=>
{
if
(
visible
)
{
fetchData
()
}
},
[
visible
])
return
(
<
Drawer
destroyOnClose
...
...
@@ -160,16 +174,12 @@ const ViewInventory: React.FC<MemberModalTableProps> = (props: MemberModalTableP
onClose=
{
()
=>
setVisible
(
false
)
}
width=
{
900
}
>
<
TableLayout
currRef=
{
ref
}
customKey=
'memberId'
effects=
'name'
<
Table
columns=
{
columns
}
schema=
{
{}
}
dataSource=
{
dataSource
}
scroll=
{
{
x
:
'100vw'
}
}
fetchdata=
{
(
params
)
=>
fetchOrderApi
.
getProductStock
({
...
params
,
matnr
:
record
?.
code
||
record
?.
productNo
,
werks
:
record
?.
factory
,
productGlobalId
:
record
?.
globalMQID
})
}
/>
</
Drawer
>
)
...
...
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