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 fc07efbf
authored
Dec 26, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品最低价格校验功能开发
1 parent
bcc366d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
23 deletions
src/views/commodity/commodityDetail.vue
src/views/commodity/constant/data.js
src/views/commodity/editCommodity.vue
yarn.lock
src/views/commodity/commodityDetail.vue
View file @
fc07efb
...
@@ -5,10 +5,13 @@
...
@@ -5,10 +5,13 @@
<div
class=
"m-b-20 bgf"
>
<div
class=
"m-b-20 bgf"
>
<p
class=
"edit-title"
>
基础信息
</p>
<p
class=
"edit-title"
>
基础信息
</p>
<el-form
label-width=
"120px"
:inline=
"true"
class=
"context-wrap content"
v-if=
"isShow"
>
<el-form
label-width=
"120px"
:inline=
"true"
class=
"context-wrap content"
v-if=
"isShow"
>
<div
v-for=
"(subItem, index) in detailFormData"
:key=
"index"
:class=
"[detailForm[subItem.name] != '-' ? 'w-30' : '']"
>
<div
v-for=
"(subItem, index) in detailFormData"
:key=
"index"
:class=
"[detailForm[subItem.name] != '-' ? 'w-30' : '']"
>
<template
v-if=
"detailForm[subItem.name] != '-'"
>
<template
v-if=
"detailForm[subItem.name] != '-'"
>
<el-form-item
:label=
"subItem.label + ':'"
class=
"row-item"
>
<el-form-item
:label=
"subItem.label + ':'"
class=
"row-item"
>
<span
class=
"detail-txt ellipsis-1"
:title=
"detailForm[subItem.name]"
>
{{
detailForm
[
subItem
.
name
]
===
null
?
'-'
:
detailForm
[
subItem
.
name
]
?
detailForm
[
subItem
.
name
]
+
(
subItem
.
suffix
||
''
)
:
subItem
.
isNum
?
'0'
+
(
subItem
.
suffix
||
''
)
:
'-'
}}
</span>
<span
class=
"detail-txt ellipsis-1"
:title=
"detailForm[subItem.name]"
>
{{
detailForm
[
subItem
.
name
]
===
null
?
'-'
:
detailForm
[
subItem
.
name
]
?
detailForm
[
subItem
.
name
]
+
(
subItem
.
suffix
||
''
)
:
subItem
.
isNum
?
'0'
+
(
subItem
.
suffix
||
''
)
:
'-'
}}
</span>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</div>
</div>
...
@@ -16,7 +19,8 @@
...
@@ -16,7 +19,8 @@
</div>
</div>
<div
class=
"edit-container bgf"
>
<div
class=
"edit-container bgf"
>
<p
class=
"edit-title"
>
使用门店
</p>
<p
class=
"edit-title"
>
使用门店
</p>
<GLTable
ref=
"warehousListRef"
class=
"context-wrap"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"detailForm.merchantList"
></GLTable>
<GLTable
ref=
"warehousListRef"
class=
"context-wrap"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"detailForm.merchantList"
></GLTable>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -89,6 +93,12 @@ export default {
...
@@ -89,6 +93,12 @@ export default {
suffix
:
'元/件'
suffix
:
'元/件'
},
},
{
{
label
:
'校验最低价'
,
name
:
'validMinSellPrice'
// isNum: true,
// suffix: '元/件'
},
{
label
:
'赠送成本'
,
label
:
'赠送成本'
,
name
:
'giftCost'
,
name
:
'giftCost'
,
isNum
:
true
,
isNum
:
true
,
...
@@ -167,6 +177,8 @@ export default {
...
@@ -167,6 +177,8 @@ export default {
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
this
.
detailForm
.
baseProductFlag
==
'Y'
?
list
.
push
(
'基础产品'
)
:
''
this
.
detailForm
.
baseProductFlag
==
'Y'
?
list
.
push
(
'基础产品'
)
:
''
// 添加判断商品是否检验
this
.
detailForm
.
validMinSellPrice
=
this
.
detailForm
.
validMinSellPrice
==
'Y'
?
'是'
:
'否'
this
.
detailForm
.
upgradeProductFlag
==
'Y'
?
list
.
push
(
'升级产品'
)
:
''
this
.
detailForm
.
upgradeProductFlag
==
'Y'
?
list
.
push
(
'升级产品'
)
:
''
this
.
detailForm
.
typeTxt
=
list
.
join
(
','
)
this
.
detailForm
.
typeTxt
=
list
.
join
(
','
)
this
.
changeFormAttr
(
'detailFormData'
,
'suffix'
,
baseLabelList
,
this
.
detailForm
.
goodsTypeName
==
'自建商品-精品'
?
'元/件'
:
'元/车'
)
this
.
changeFormAttr
(
'detailFormData'
,
'suffix'
,
baseLabelList
,
this
.
detailForm
.
goodsTypeName
==
'自建商品-精品'
?
'元/件'
:
'元/车'
)
...
@@ -205,41 +217,52 @@ export default {
...
@@ -205,41 +217,52 @@ export default {
.marketing.order-detail
.el-form--inline
.el-form-item
{
.marketing.order-detail
.el-form--inline
.el-form-item
{
margin
:
0
;
margin
:
0
;
}
}
.marketing.order-detail
.el-form--inline
.el-form-item__content
{
.marketing.order-detail
.el-form--inline
.el-form-item__content
{
height
:
30px
;
height
:
30px
;
}
}
.marketing.order-detail
.form-img
.el-form--inline
.el-form-item__content
{
.marketing.order-detail
.form-img
.el-form--inline
.el-form-item__content
{
height
:
auto
!important
;
height
:
auto
!important
;
}
}
.marketing.order-detail
.flex
{
.marketing.order-detail
.flex
{
justify-content
:
flex-start
;
justify-content
:
flex-start
;
}
}
.order-detail
.content
{
.order-detail
.content
{
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
}
}
.order-detail
.w-30
{
.order-detail
.w-30
{
width
:
33%
;
width
:
33%
;
}
}
.marketing.order-detail
.row-item
{
.marketing.order-detail
.row-item
{
display
:
inline-block
;
display
:
inline-block
;
/* width: 33%; */
/* width: 33%; */
}
}
.detail-txt
{
.detail-txt
{
display
:
inline-block
;
display
:
inline-block
;
width
:
220px
;
width
:
220px
;
}
}
.marketing.order-detail
.show-table
>
tbody
>
tr
>
td
{
.marketing.order-detail
.show-table
>
tbody
>
tr
>
td
{
text-align
:
center
;
text-align
:
center
;
vertical-align
:
middle
;
vertical-align
:
middle
;
}
}
.marketing.order-detail
.show-table
td
{
.marketing.order-detail
.show-table
td
{
padding-right
:
20px
;
padding-right
:
20px
;
}
}
.order-detail
.comment-img
{
.order-detail
.comment-img
{
margin-top
:
10px
;
margin-top
:
10px
;
margin-right
:
20px
;
margin-right
:
20px
;
}
}
.edit-title
{
.edit-title
{
height
:
56px
;
height
:
56px
;
background
:
#ffffff
;
background
:
#ffffff
;
...
@@ -247,10 +270,11 @@ export default {
...
@@ -247,10 +270,11 @@ export default {
border-bottom
:
1px
solid
#f0f1f7
;
border-bottom
:
1px
solid
#f0f1f7
;
padding-left
:
20px
;
padding-left
:
20px
;
}
}
.bgf
{
.bgf
{
background
:
#ffffff
;
background
:
#ffffff
;
}
}
.context-wrap
{
.context-wrap
{
padding
:
20px
;
padding
:
20px
;
}
}
</
style
>
</
style
>
src/views/commodity/constant/data.js
View file @
fc07efb
...
@@ -169,9 +169,12 @@ const editCommodityObj = {
...
@@ -169,9 +169,12 @@ const editCommodityObj = {
{
{
label
:
'最低售价'
,
label
:
'最低售价'
,
name
:
'minSellPrice'
,
name
:
'minSellPrice'
,
type
:
'input'
,
// type: 'input',
isHide
:
true
,
type
:
'slot'
,
append
:
'元/件'
addHtml
:
'minSellPrice'
,
// placeholder: '请输入最低售价',
isHide
:
true
// append: '元/件'
},
},
{
{
label
:
'赠送成本'
,
label
:
'赠送成本'
,
...
...
src/views/commodity/editCommodity.vue
View file @
fc07efb
...
@@ -3,29 +3,54 @@
...
@@ -3,29 +3,54 @@
<div
class=
"edit-commodity commodity edit-box"
>
<div
class=
"edit-commodity commodity edit-box"
>
<div
class=
"container edit-container"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
基础信息
</p>
<p
class=
"edit-title"
>
基础信息
</p>
<glsx-combi-form
class=
"edit-form-container m-r-20"
ref=
"editFormRef"
:isEdit=
"isEdit"
:pageThat=
"this"
:labelWidth=
"defaultLabelWidth"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container m-r-20"
ref=
"editFormRef"
:isEdit=
"isEdit"
:pageThat=
"this"
:labelWidth=
"defaultLabelWidth"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<div
slot=
"convertedValue"
slot-scope=
"scope"
>
<div
slot=
"convertedValue"
slot-scope=
"scope"
>
<span>
一卷等于
</span>
<span>
一卷等于
</span>
<el-input
style=
"width: 136px; margin: 0 8px;"
:placeholder=
"scope.scope.placeholder || '请输入' + scope.scope.label"
v-bind=
"scope.scope.attrs ? scope.scope.attrs :
{}" v-model.trim="editForm[scope.scope.name]" :maxlength="scope.scope.maxlength">
</el-input>
<el-input
style=
"width: 136px; margin: 0 8px;"
:placeholder=
"scope.scope.placeholder || '请输入' + scope.scope.label"
v-bind=
"scope.scope.attrs ? scope.scope.attrs :
{}" v-model.trim="editForm[scope.scope.name]"
:maxlength="scope.scope.maxlength">
</el-input>
<span>
米
</span>
<span>
米
</span>
</div>
</div>
<div
slot=
"deductionStandard"
slot-scope=
"scope"
>
<div
slot=
"deductionStandard"
slot-scope=
"scope"
>
<el-input
style=
"width: 136px; margin-right: 8px;"
:placeholder=
"scope.scope.placeholder || '请输入' + scope.scope.label"
v-bind=
"scope.scope.attrs ? scope.scope.attrs :
{}" v-model.trim="editForm[scope.scope.name]" :maxlength="scope.scope.maxlength">
</el-input>
<el-input
style=
"width: 136px; margin-right: 8px;"
<span>
米/车,1卷膜预估可适用
{{
editForm
.
deductionStandard
?
Math
.
floor
(
editForm
.
convertedValue
/
editForm
.
deductionStandard
)
:
'--'
}}
车
</span>
:placeholder=
"scope.scope.placeholder || '请输入' + scope.scope.label"
v-bind=
"scope.scope.attrs ? scope.scope.attrs :
{}" v-model.trim="editForm[scope.scope.name]"
:maxlength="scope.scope.maxlength">
</el-input>
<span>
米/车,1卷膜预估可适用
{{
editForm
.
deductionStandard
?
Math
.
floor
(
editForm
.
convertedValue
/
editForm
.
deductionStandard
)
:
'--'
}}
车
</span>
</div>
</div>
<div
slot=
"productFlag"
>
<div
slot=
"productFlag"
>
<el-checkbox
v-model=
"editForm.baseProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"基础产品"
@
change=
"val => handleCheckChange(val, 'baseProductFlag')"
></el-checkbox>
<el-checkbox
v-model=
"editForm.baseProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"基础产品"
<el-checkbox
v-model=
"editForm.upgradeProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"升级产品"
@
change=
"val => handleCheckChange(val, 'upgradeProductFlag')"
></el-checkbox>
@
change=
"val => handleCheckChange(val, 'baseProductFlag')"
></el-checkbox>
<el-checkbox
v-model=
"editForm.upgradeProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"升级产品"
@
change=
"val => handleCheckChange(val, 'upgradeProductFlag')"
></el-checkbox>
</div>
<div
slot=
"minSellPrice"
slot-scope=
"scope"
>
<el-input
style=
"width: 136px; margin: 0 8px;"
:placeholder=
"scope.scope.placeholder || '请输入' + scope.scope.label"
v-bind=
"scope.scope.attrs ? scope.scope.attrs :
{}" v-model.trim="editForm[scope.scope.name]"
:maxlength="scope.scope.maxlength">
</el-input>
<el-checkbox
class=
"check-min-price"
v-model=
"editForm.validMinSellPriceFlag"
true-label=
"Y"
false-label=
"N"
label=
""
></el-checkbox>
<span
class=
"tips-text"
>
勾选时提单校验最低价
</span>
<!-- @change="val => handleCheckChange(val, 'baseProductFlag')" -->
<!--
<el-checkbox
v-model=
"editForm.upgradeProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"升级产品"
@
change=
"val => handleCheckChange(val, 'upgradeProductFlag')"
></el-checkbox>
-->
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
</div>
</div>
<div
class=
"container edit-container"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
使用门店
</p>
<p
class=
"edit-title"
>
使用门店
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormMerchantRef"
:isEdit=
"isEdit"
:labelWidth=
"defaultLabelWidth"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"merchantEditFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormMerchantRef"
:isEdit=
"isEdit"
:labelWidth=
"defaultLabelWidth"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"merchantEditFormData"
:formRules=
"editRule"
>
<div
slot=
"merchantTable"
:style=
"
{ width: `calc(100% - ${defaultLabelWidth} )` }">
<div
slot=
"merchantTable"
:style=
"
{ width: `calc(100% - ${defaultLabelWidth} )` }">
<div
class=
"table-title"
>
<div
class=
"table-title"
>
使用门店列表
使用门店列表
<el-button
type=
"primary"
plain
@
click=
"handleRelateStoreClose(scope)"
>
{{
editForm
.
merchantList
.
length
?
'更换门店'
:
'选择门店'
}}
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleRelateStoreClose(scope)"
>
{{
editForm
.
merchantList
.
length
?
'更换门店'
:
'选择门店'
}}
</el-button>
</div>
</div>
<GLTable
ref=
"warehousListRef"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.merchantList"
>
<GLTable
ref=
"warehousListRef"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.merchantList"
>
<span
slot=
"customBtn"
slot-scope=
"scope"
>
<span
slot=
"customBtn"
slot-scope=
"scope"
>
...
@@ -40,7 +65,9 @@
...
@@ -40,7 +65,9 @@
<el-button
type=
"primary"
@
click=
"handleConfirm"
size=
"medium"
:loading=
"loading"
>
提交
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
size=
"medium"
:loading=
"loading"
>
提交
</el-button>
</GLFooter>
</GLFooter>
<!-- 门店弹窗 -->
<!-- 门店弹窗 -->
<relate-store-dialog
v-if=
"relateStoreVisible"
ref=
"relateStore"
:relateStoreVisible=
"relateStoreVisible"
:storeApi=
"storeApi"
:storeSearchForm=
"storeSearchForm"
:storeSelected=
"selectedList"
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
>
<relate-store-dialog
v-if=
"relateStoreVisible"
ref=
"relateStore"
:relateStoreVisible=
"relateStoreVisible"
:storeApi=
"storeApi"
:storeSearchForm=
"storeSearchForm"
:storeSelected=
"selectedList"
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
>
<el-row
slot
>
<el-row
slot
>
<el-form
:model=
"storeSearchForm"
ref=
"relate"
:inline=
"true"
label-width=
"90px"
>
<el-form
:model=
"storeSearchForm"
ref=
"relate"
:inline=
"true"
label-width=
"90px"
>
<el-form-item
label=
"门店名称:"
prop=
"merchantName"
>
<el-form-item
label=
"门店名称:"
prop=
"merchantName"
>
...
@@ -73,7 +100,8 @@ export default {
...
@@ -73,7 +100,8 @@ export default {
baseProductFlag
:
'N'
,
baseProductFlag
:
'N'
,
upgradeProductFlag
:
'N'
,
upgradeProductFlag
:
'N'
,
merchantList
:
[],
merchantList
:
[],
goodsType
:
''
goodsType
:
''
,
validMinSellPriceFlag
:
'Y'
},
},
isEdit
:
true
,
isEdit
:
true
,
editRule
:
constData
.
editCommodityObj
.
editRule
,
editRule
:
constData
.
editCommodityObj
.
editRule
,
...
@@ -351,12 +379,19 @@ export default {
...
@@ -351,12 +379,19 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.commodity.edit-commodity
.select-merchant
{
.commodity.edit-commodity
.select-merchant
{
/* width: calc(98% - 140px); */
/* width: calc(98% - 140px); */
width
:
98%
;
width
:
98%
;
}
}
.check-min-price
{
margin
:
0
6px
0
15px
;
}
.tips-text
{
color
:
#999999
;
}
.merchant-table
{
.merchant-table
{
margin
:
0
20px
;
margin
:
0
20px
;
}
}
</
style
>
</
style
>
yarn.lock
0 → 100644
View file @
fc07efb
This diff could not be displayed because it is too large.
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