Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
0a4815c5
Commit
0a4815c5
authored
Jan 29, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 备货数量和备货单价添加不能为0的校验
parent
fef856a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
src/views/supply/stockingOrder/AddStockingOrderDialog.vue
+5
-1
No files found.
src/views/supply/stockingOrder/AddStockingOrderDialog.vue
View file @
0a4815c5
...
@@ -323,6 +323,7 @@ const validateField = (
...
@@ -323,6 +323,7 @@ const validateField = (
)
=>
{
)
=>
{
const
value
=
row
[
field
]
const
value
=
row
[
field
]
const
strValue
=
value
===
0
||
value
===
'0'
?
'0'
:
String
(
value
??
''
)
const
strValue
=
value
===
0
||
value
===
'0'
?
'0'
:
String
(
value
??
''
)
const
fieldLabel
=
field
===
'buyAmount'
?
'备货数量'
:
'备货单价'
if
(
!
strValue
)
{
if
(
!
strValue
)
{
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
'必填项'
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
'必填项'
...
@@ -330,6 +331,9 @@ const validateField = (
...
@@ -330,6 +331,9 @@ const validateField = (
}
else
if
(
!
/^
\d
+
(\.\d
+
)?
$/
.
test
(
strValue
))
{
}
else
if
(
!
/^
\d
+
(\.\d
+
)?
$/
.
test
(
strValue
))
{
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
'请输入有效数字'
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
'请输入有效数字'
else
row
.
_priceError
=
'请输入有效数字'
else
row
.
_priceError
=
'请输入有效数字'
}
else
if
(
Number
(
strValue
)
===
0
)
{
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
`
${
fieldLabel
}
不能为0`
else
row
.
_priceError
=
`
${
fieldLabel
}
不能为0`
}
else
{
}
else
{
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
''
if
(
field
===
'buyAmount'
)
row
.
_buyAmountError
=
''
else
row
.
_priceError
=
''
else
row
.
_priceError
=
''
...
@@ -487,7 +491,7 @@ const handleAddSingleProduct = (row: StockingOrderProduct) => {
...
@@ -487,7 +491,7 @@ const handleAddSingleProduct = (row: StockingOrderProduct) => {
formData
.
value
.
currencyCode
&&
formData
.
value
.
currencyCode
&&
row
.
currencyCode
!==
formData
.
value
.
currencyCode
row
.
currencyCode
!==
formData
.
value
.
currencyCode
)
{
)
{
ElMessage
.
warning
(
`只能添加币种为
${
formData
.
value
.
currencyCode
}
的商品`
)
ElMessage
.
warning
(
'商品币种与主单币种不一致,添加失败!'
)
return
return
}
}
...
...
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