Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-commodity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2ab4a28c
authored
May 25, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
8aaa0027
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
src/common/constant.js
src/views/commodity/constant/data.js
src/views/commodity/editCommodity.vue
src/common/constant.js
View file @
2ab4a28
...
@@ -27,7 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
...
@@ -27,7 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
}
return
newValue
return
newValue
}
else
{
}
else
{
return
newValue
?
oldValue
:
''
return
newValue
?
oldValue
:
newValue
}
}
}
}
...
...
src/views/commodity/constant/data.js
View file @
2ab4a28
...
@@ -51,8 +51,8 @@ const editCommodityObj = {
...
@@ -51,8 +51,8 @@ const editCommodityObj = {
minSellPrice
:
[{
required
:
true
,
message
:
'请输入最低售价'
,
trigger
:
'change'
}],
minSellPrice
:
[{
required
:
true
,
message
:
'请输入最低售价'
,
trigger
:
'change'
}],
giftCost
:
[{
required
:
true
,
message
:
'请输入赠送成本'
,
trigger
:
'change'
}],
giftCost
:
[{
required
:
true
,
message
:
'请输入赠送成本'
,
trigger
:
'change'
}],
productCost
:
[{
required
:
true
,
message
:
'请输入产品成本'
,
trigger
:
'change'
}],
productCost
:
[{
required
:
true
,
message
:
'请输入产品成本'
,
trigger
:
'change'
}],
warningValue
:
[{
required
:
true
,
message
:
'请输入库存预警下限'
,
trigger
:
'change'
}],
//
warningValue: [{ required: true, message: '请输入库存预警下限', trigger: 'change' }],
warningValueMax
:
[{
required
:
true
,
message
:
'请输入库存预警上限'
,
trigger
:
'change'
}],
//
warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
merchantList
:
[{
required
:
true
,
message
:
'请选择门店'
,
trigger
:
'change'
}],
merchantList
:
[{
required
:
true
,
message
:
'请选择门店'
,
trigger
:
'change'
}],
warrantyPeriod
:
[{
required
:
true
,
message
:
'请输入质保年限'
,
trigger
:
'change'
}]
warrantyPeriod
:
[{
required
:
true
,
message
:
'请输入质保年限'
,
trigger
:
'change'
}]
},
},
...
@@ -127,7 +127,7 @@ const editCommodityObj = {
...
@@ -127,7 +127,7 @@ const editCommodityObj = {
type
:
'input'
type
:
'input'
},
},
{
{
label
:
'库存
预警上限
/件'
,
label
:
'库存
上限预警
/件'
,
name
:
'warningValueMax'
,
name
:
'warningValueMax'
,
type
:
'input'
type
:
'input'
},
},
...
...
src/views/commodity/editCommodity.vue
View file @
2ab4a28
...
@@ -117,7 +117,7 @@ export default {
...
@@ -117,7 +117,7 @@ export default {
},
},
// 赠送成本
// 赠送成本
'editForm.giftCost'
(
newValue
,
oldValue
)
{
'editForm.giftCost'
(
newValue
,
oldValue
)
{
this
.
editForm
.
giftCost
=
limitPrice
(
newValue
,
oldValue
,
6
,
2
)
this
.
editForm
.
giftCost
=
limitPrice
(
newValue
,
oldValue
,
6
,
2
)
?
limitPrice
(
newValue
,
oldValue
,
6
,
2
):
this
.
editForm
.
giftCost
},
},
// 产品成本
// 产品成本
'editForm.productCost'
(
newValue
,
oldValue
)
{
'editForm.productCost'
(
newValue
,
oldValue
)
{
...
@@ -168,6 +168,7 @@ export default {
...
@@ -168,6 +168,7 @@ export default {
this
.
handleCheckChange
(
res
.
baseProductFlag
,
'baseProductFlag'
)
this
.
handleCheckChange
(
res
.
baseProductFlag
,
'baseProductFlag'
)
this
.
handleCheckChange
(
res
.
upgradeProductFlag
,
'upgradeProductFlag'
)
this
.
handleCheckChange
(
res
.
upgradeProductFlag
,
'upgradeProductFlag'
)
}
}
this
.
editForm
=
res
this
.
editForm
=
res
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
this
.
editStatus
=
false
...
@@ -195,7 +196,6 @@ export default {
...
@@ -195,7 +196,6 @@ export default {
},
},
// 产品类型改变
// 产品类型改变
handleCheckChange
(
val
,
attr
)
{
handleCheckChange
(
val
,
attr
)
{
console
.
log
(
val
,
attr
)
let
baseAttrList
=
[
'赠送成本/元'
,]
let
baseAttrList
=
[
'赠送成本/元'
,]
let
upAttrList
=
[
'售价/元'
,
'最低售价/元'
,
'产品成本/元'
]
let
upAttrList
=
[
'售价/元'
,
'最低售价/元'
,
'产品成本/元'
]
switch
(
attr
)
{
switch
(
attr
)
{
...
@@ -222,9 +222,7 @@ export default {
...
@@ -222,9 +222,7 @@ export default {
},
},
changeFormAttr
(
formName
,
attrName
,
labelList
,
attrValue
)
{
changeFormAttr
(
formName
,
attrName
,
labelList
,
attrValue
)
{
labelList
.
forEach
(
item
=>
{
labelList
.
forEach
(
item
=>
{
console
.
log
(
item
)
let
idx
=
this
[
formName
]?.
findIndex
(
k
=>
{
let
idx
=
this
[
formName
]?.
findIndex
(
k
=>
{
console
.
log
(
k
)
return
k
.
label
==
item
return
k
.
label
==
item
})
})
this
[
formName
][
idx
][
attrName
]
=
attrValue
this
[
formName
][
idx
][
attrName
]
=
attrValue
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment