Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
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
hooloo
web
soss
Commits
97f09c13
Commit
97f09c13
authored
May 26, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改规格
parent
6c5feb09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/components/SelectMaterial/index.vue
+2
-2
src/views/goods/spec/index.vue
+2
-3
No files found.
src/components/SelectMaterial/index.vue
View file @
97f09c13
...
...
@@ -106,9 +106,9 @@ export default {
subTag
=
false
;
return
;
}
else
{
const
regular
=
/^
[
+
]{0,1}([
1-9
]
+
)
$|^
[
+
]{0,1}(\d
+
\.\d
+
)
$/
//正数(包括小数)
const
regular
=
/^
[
+
]{0,1}([
1-9
]
[
0
]
+
)
$|^
[
+
]{0,1}(\d
+
\.\d{1,2}
)
$/
//正数(包括小数)
if
(
!
regular
.
test
(
item
.
quantity
))
{
this
.
$message
.
error
(
''
+
item
.
name
+
"原料名称的原料数量不是大于0的数字!"
)
this
.
$message
.
error
(
''
+
item
.
name
+
"原料名称的原料数量不是大于0的数字
,最多保留2位小数
!"
)
subTag
=
false
;
return
;
}
...
...
src/views/goods/spec/index.vue
View file @
97f09c13
...
...
@@ -244,8 +244,7 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
let
regular
=
/^
[
+
]{0,1}([
0-9
]
+
)
$|^
[
+
]{0,1}(\d
+
\.\d{2})
$/
//正数(保留2位小数)
let
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1,2}
$
)
/
;
//正数 ,小数可有可无,最多2位
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
specsSelectList
=
this
.
$refs
.
specsSelect
.
list
;
...
...
@@ -256,7 +255,7 @@ export default {
return
;
}
if
(
!
regular
.
test
(
specsSelectList
[
i
].
amount
)){
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不是大于等于0的两位小数'
);
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不是大于等于0的
数字,最多保留
两位小数'
);
return
;
}
if
(
!
specsSelectList
[
i
].
isRecommend
){
...
...
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