Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
cdebb511
Commit
cdebb511
authored
Apr 04, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改校验问题他
parent
2208b4ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
StockModal.jsx
src/pages/GoodsManage/Takeaway/components/StockModal.jsx
+6
-2
No files found.
src/pages/GoodsManage/Takeaway/components/StockModal.jsx
View file @
cdebb511
...
@@ -3,6 +3,7 @@ import { Modal, Form, InputNumber, Checkbox, Switch } from 'antd';
...
@@ -3,6 +3,7 @@ import { Modal, Form, InputNumber, Checkbox, Switch } from 'antd';
import
{
deepClone
}
from
'
@/utils/utils
'
;
import
{
deepClone
}
from
'
@/utils/utils
'
;
import
styles
from
'
../../style.less
'
;
import
styles
from
'
../../style.less
'
;
import
{
apiProductStock
}
from
'
../../service
'
;
import
{
apiProductStock
}
from
'
../../service
'
;
import
{
isIntegerNotZero
}
from
'
@/utils/validator
'
;
const
StockModal
=
options
=>
{
const
StockModal
=
options
=>
{
const
[
stockType
,
setStockType
]
=
useState
(
0
);
const
[
stockType
,
setStockType
]
=
useState
(
0
);
...
@@ -81,7 +82,7 @@ const StockModal = options => {
...
@@ -81,7 +82,7 @@ const StockModal = options => {
}
}
},
[
options
.
visible
]);
},
[
options
.
visible
]);
const
maxStockRule
=
[];
const
maxStockRule
=
[
{
validator
:
isIntegerNotZero
,
message
:
'
请输入大于0的整数
'
}
];
if
(
isChecked
)
{
if
(
isChecked
)
{
maxStockRule
.
push
({
required
:
true
,
message
:
'
请输入最大库存!
'
});
maxStockRule
.
push
({
required
:
true
,
message
:
'
请输入最大库存!
'
});
}
}
...
@@ -111,7 +112,10 @@ const StockModal = options => {
...
@@ -111,7 +112,10 @@ const StockModal = options => {
name=
"productStock"
name=
"productStock"
labelCol=
{
{
span
:
6
}
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
8
}
}
wrapperCol=
{
{
span
:
8
}
}
rules=
{
[{
required
:
true
,
message
:
'
请输入剩余库存!
'
}]
}
rules=
{
[
{
required
:
true
,
message
:
'
请输入剩余库存!
'
},
{
validator
:
isIntegerNotZero
,
message
:
'
请输入大于0的整数
'
},
]
}
>
>
<
InputNumber
<
InputNumber
min=
{
0
}
min=
{
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