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
1e8221b6
Commit
1e8221b6
authored
Sep 21, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug
parent
06131bf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
22 deletions
+33
-22
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+33
-22
No files found.
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
1e8221b6
...
...
@@ -25,30 +25,41 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
getWarehouseInfo
=
async
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseWarehouseDetails
({
id
,
});
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
if
(
id
)
{
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseWarehouseDetails
({
id
,
});
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
}
else
{
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
}
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
};
useEffect
(()
=>
{
...
...
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