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
eeebce7f
Commit
eeebce7f
authored
Jun 18, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改金额小数点
parent
b223161e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
18 deletions
+30
-18
src/components/SelectMaterial/index.vue
+2
-2
src/views/goods/goods/components/Form.vue
+25
-13
src/views/goods/spec/index.vue
+2
-2
src/views/order/order/index.vue
+1
-1
No files found.
src/components/SelectMaterial/index.vue
View file @
eeebce7f
...
...
@@ -106,9 +106,9 @@ export default {
subTag
=
false
;
return
;
}
else
{
const
regular
=
/
(
^
[
+
]{0,1}([
1-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
1-9
][
0
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1,2}
$
)
/
;
//正数(包括小数)
const
regular
=
/
^
([
0-9
]
*
)
+
(
.
[
0-9
]{1,2})?
$
/
;
//正数(包括小数)
if
(
!
regular
.
test
(
item
.
quantity
))
{
this
.
$message
.
error
(
''
+
item
.
name
+
"原料名称的原料数量不是大于0的数字,最多保留2位小数!"
)
this
.
$message
.
error
(
''
+
item
.
name
+
"原料名称的原料数量不是大于
等于
0的数字,最多保留2位小数!"
)
subTag
=
false
;
return
;
}
...
...
src/views/goods/goods/components/Form.vue
View file @
eeebce7f
...
...
@@ -104,7 +104,7 @@
<el-row
:gutter=
"10"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"描述"
prop=
"desc"
>
<el-input
v-model=
"form.desc"
type=
"textarea"
placeholder=
"请输入内容"
/>
<el-input
v-model=
"form.desc"
type=
"textarea"
placeholder=
"请输入内容"
maxlength=
"18"
show-word-limit
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
...
...
@@ -161,14 +161,14 @@ export default {
}
};
var
validateDiscount
=
(
rule
,
value
,
callback
)
=>
{
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1
,2
}
$
)
/
;
//正数(保留2位小数)
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1}
$
)
/
;
//正数(保留2位小数)
if
(
value
==
undefined
||
value
===
''
)
{
callback
(
new
Error
(
'不能为空'
));
}
else
if
(
!
regular
.
test
(
value
)){
callback
(
new
Error
(
'请输入大于0的正数,最多保留
2
位小数'
));
callback
(
new
Error
(
'请输入大于0的正数,最多保留
1
位小数'
));
}
else
if
(
this
.
form
.
price
){
if
(
value
>
=
this
.
form
.
price
){
callback
(
new
Error
(
'折扣价不能大于
等于
原价'
));
if
(
value
>
this
.
form
.
price
){
callback
(
new
Error
(
'折扣价不能大于原价'
));
}
else
{
callback
();
}
...
...
@@ -178,14 +178,14 @@ export default {
};
var
validatePrice
=
(
rule
,
value
,
callback
)
=>
{
//let regular = /(^[+]{0,1}([1-9]+)$)|(^[+]{0,1}(\d+\.\d{1,2})$)/ //正数(保留2位小数)
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1
,2
}
$
)
/
;
//正数 ,小数可有可无,最多2位
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1}
$
)
/
;
//正数 ,小数可有可无,最多2位
if
(
value
==
undefined
||
value
===
''
)
{
callback
(
new
Error
(
'不能为空'
));
}
else
if
(
!
regular
.
test
(
value
)){
callback
(
new
Error
(
'请输入大于0的正数,最多保留
2
位小数'
));
callback
(
new
Error
(
'请输入大于0的正数,最多保留
1
位小数'
));
}
else
if
(
this
.
form
.
discount
){
if
(
value
<
=
this
.
form
.
discount
){
callback
(
new
Error
(
'原价不能小于
等于
折扣价'
));
if
(
value
<
this
.
form
.
discount
){
callback
(
new
Error
(
'原价不能小于折扣价'
));
}
else
{
callback
();
}
...
...
@@ -216,6 +216,7 @@ export default {
detailImages
:[{
required
:
true
,
validator
:
validateDetailImages
,
trigger
:
"blur"
}],
},
tagValues
:
""
,
goodsTagList
:
[],
inputVisible
:
false
,
inputValue
:
''
...
...
@@ -232,10 +233,20 @@ export default {
});
},
handleInputConfirm
()
{
let
inputValue
=
this
.
inputValue
;
if
(
inputValue
)
{
if
(
this
.
goodsTagList
.
indexOf
(
inputValue
)
==-
1
){
this
.
goodsTagList
.
push
(
inputValue
);
let
inputValues
=
this
.
inputValue
;
if
(
inputValues
)
{
if
(
this
.
goodsTagList
.
indexOf
(
inputValues
)
==-
1
){
if
(
this
.
goodsTagList
.
length
>=
3
){
this
.
$message
(
'标签个数最多添加三个!'
);
}
else
{
this
.
tagValues
=
this
.
tagValues
+
inputValues
;
if
(
this
.
tagValues
.
length
>
16
){
this
.
$message
(
'标签总字符数量最大16!'
);
this
.
tagValues
=
this
.
tagValues
.
replace
(
inputValues
,
""
);
}
else
{
this
.
goodsTagList
.
push
(
inputValues
);
}
}
}
else
{
this
.
$message
(
'请重新添加标签,该标签已存在!'
);
}
...
...
@@ -265,6 +276,7 @@ export default {
},
// 表单重置
reset
()
{
this
.
tagValues
=
""
;
this
.
goodsTagList
=
[];
this
.
form
=
{
pics
:
{},
...
...
src/views/goods/spec/index.vue
View file @
eeebce7f
...
...
@@ -242,7 +242,7 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
let
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1
,2
}
$
)
/
;
//正数 ,小数可有可无,最多2位
let
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
|
(
^
[
+
]{0,1}([
0-9
]
+
)[\.]{1}[
0-9
]{1}
$
)
/
;
//正数 ,小数可有可无,最多2位
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
specsSelectList
=
this
.
$refs
.
specsSelect
.
list
;
...
...
@@ -253,7 +253,7 @@ export default {
return
;
}
if
(
!
regular
.
test
(
specsSelectList
[
i
].
amount
)){
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不是大于等于0的数字,最多保留
两
位小数'
);
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不是大于等于0的数字,最多保留
1
位小数'
);
return
;
}
if
(
!
specsSelectList
[
i
].
isRecommend
){
...
...
src/views/order/order/index.vue
View file @
eeebce7f
...
...
@@ -65,7 +65,7 @@
</el-table-column>
<el-table-column
width=
"200"
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
v-if=
"authBtn(['
3','4','5','6
','13'], scope.row.state)"
<el-button
size=
"mini"
type=
"text"
v-if=
"authBtn(['
2','3','4','5','6','7
','13'], scope.row.state)"
@
click=
"refundClick(scope.row)"
v-hasPermi=
"['system:order:refund']"
>
退款
</el-button>
</
template
>
</el-table-column>
...
...
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