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 99d24539
authored
Nov 14, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增/编辑联动,联调
1 parent
385ab76d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
212 additions
and
93 deletions
src/api/modules/commodity.js
src/views/commodity/commodityDetail.vue
src/views/commodity/constant/data.js
src/views/commodity/editCommodity.vue
src/views/commodity/index.vue
src/api/modules/commodity.js
View file @
99d2453
...
@@ -30,6 +30,29 @@ const getGoodsSeries = params => {
...
@@ -30,6 +30,29 @@ const getGoodsSeries = params => {
})
})
}
}
// 自建商品类列表
const
getGoodsCategory
=
params
=>
{
params
.
method
=
'scrm.api.partner.goods.goodsCategoryConfiguration.page'
return
http
({
url
:
'rop-scrm-partner/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 获取商品部位
const
getGoodsPosList
=
params
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
'dj.api.smartcarlife.goodsPosition.list'
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
updateGoods
=
params
=>
{
const
updateGoods
=
params
=>
{
params
.
method
=
'scrm.api.partner.goods.insertOrUpdate'
params
.
method
=
'scrm.api.partner.goods.insertOrUpdate'
return
http
({
return
http
({
...
@@ -73,4 +96,4 @@ const exportGoods = params => {
...
@@ -73,4 +96,4 @@ const exportGoods = params => {
})
})
}
}
export
default
{
getListApi
,
getSimpleMerchantList
,
getGoodsSeries
,
updateGoods
,
getGoodsDetail
,
deleteGoods
,
exportGoods
}
export
default
{
getListApi
,
getSimpleMerchantList
,
getGoodsSeries
,
getGoodsCategory
,
getGoodsPosList
,
updateGoods
,
getGoodsDetail
,
deleteGoods
,
exportGoods
}
src/views/commodity/commodityDetail.vue
View file @
99d2453
...
@@ -7,13 +7,12 @@
...
@@ -7,13 +7,12 @@
<el-form
label-width=
"120px"
:inline=
"true"
class=
"context-wrap"
>
<el-form
label-width=
"120px"
:inline=
"true"
class=
"context-wrap"
>
<el-row
v-for=
"(item, index) in detailFormDataRow"
:key=
"index"
>
<el-row
v-for=
"(item, index) in detailFormDataRow"
:key=
"index"
>
<span
v-for=
"(subItem, subIndex) in item.rowList"
:key=
"subIndex"
>
<span
v-for=
"(subItem, subIndex) in item.rowList"
:key=
"subIndex"
>
<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
]
?
detailForm
[
subItem
.
name
]
+
(
subItem
.
suffix
||
''
)
:
subItem
.
isNum
?
'0'
+
(
subItem
.
suffix
||
''
)
:
'-'
}}
</span>
<span
class=
"detail-txt ellipsis-1"
:title=
"detailForm[subItem.name]"
>
{{
detailForm
[
subItem
.
name
]
?
detailForm
[
subItem
.
name
]
+
(
subItem
.
suffix
||
''
)
:
subItem
.
isNum
?
'0'
+
(
subItem
.
suffix
||
''
)
:
'-'
}}
</span>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</span>
</span>
</el-row>
</el-row>
</el-form>
</el-form>
</div>
</div>
...
@@ -54,8 +53,8 @@ export default {
...
@@ -54,8 +53,8 @@ export default {
name
:
'type'
name
:
'type'
},
},
{
{
label
:
'所属
系列
'
,
label
:
'所属
分类
'
,
name
:
'goods
Cod
eName'
name
:
'goods
Typ
eName'
},
},
{
{
label
:
'品牌方'
,
label
:
'品牌方'
,
...
@@ -66,13 +65,21 @@ export default {
...
@@ -66,13 +65,21 @@ export default {
name
:
'supplierName'
name
:
'supplierName'
},
},
{
{
label
:
'适用部位'
,
name
:
'posTxt'
},
{
label
:
'比例换算'
,
name
:
'convertedValue'
},
{
label
:
'扣减标准'
,
name
:
'deductionStandard'
},
{
label
:
'产品类型'
,
label
:
'产品类型'
,
name
:
'typeTxt'
name
:
'typeTxt'
},
},
// {
// label: '所属系列',
// name: 'goodsCode'
// },
{
{
label
:
'售价/元'
,
label
:
'售价/元'
,
name
:
'sellPrice'
,
name
:
'sellPrice'
,
...
@@ -94,6 +101,11 @@ export default {
...
@@ -94,6 +101,11 @@ export default {
isNum
:
true
isNum
:
true
},
},
{
{
label
:
'质保年限/年'
,
name
:
'warrantyPeriod'
,
isNum
:
true
},
{
label
:
'库存下限预警'
,
label
:
'库存下限预警'
,
name
:
'warningValue'
,
name
:
'warningValue'
,
isNum
:
true
isNum
:
true
...
@@ -102,11 +114,6 @@ export default {
...
@@ -102,11 +114,6 @@ export default {
label
:
'库存预警上限'
,
label
:
'库存预警上限'
,
name
:
'warningValueMax'
,
name
:
'warningValueMax'
,
isNum
:
true
isNum
:
true
},
{
label
:
'质保年限'
,
name
:
'warrantyPeriod'
,
isNum
:
true
}
}
],
],
// 门店表格
// 门店表格
...
@@ -152,6 +159,13 @@ export default {
...
@@ -152,6 +159,13 @@ export default {
}
}
console
.
log
(
this
.
detailFormDataRow
,
'detailFormDataRow---'
)
console
.
log
(
this
.
detailFormDataRow
,
'detailFormDataRow---'
)
},
},
getGoodsPosList
()
{
this
.
$apis
.
commodity
.
getGoodsPosList
({}).
then
(
res
=>
{
this
.
goodsPosList
=
res
let
obj
=
this
.
detailForm
.
posList
.
find
(
item
=>
item
.
positionValue
==
this
.
detailForm
.
position
)
this
.
detailForm
.
posTxt
=
obj
?
obj
.
positionName
:
'-'
})
},
getInfo
()
{
getInfo
()
{
this
.
$apis
.
commodity
.
getGoodsDetail
({
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
}).
then
(
res
=>
{
this
.
$apis
.
commodity
.
getGoodsDetail
({
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
}).
then
(
res
=>
{
this
.
detailForm
=
res
this
.
detailForm
=
res
...
@@ -170,6 +184,7 @@ export default {
...
@@ -170,6 +184,7 @@ export default {
}
else
{
}
else
{
this
.
detailForm
.
warrantyPeriod
=
(
this
.
detailForm
.
warrantyPeriod
||
0
)
+
'年'
this
.
detailForm
.
warrantyPeriod
=
(
this
.
detailForm
.
warrantyPeriod
||
0
)
+
'年'
}
}
this
.
getGoodsPosList
()
})
})
},
},
handleCancel
()
{
handleCancel
()
{
...
...
src/views/commodity/constant/data.js
View file @
99d2453
...
@@ -29,6 +29,15 @@ const commodityObj = {
...
@@ -29,6 +29,15 @@ const commodityObj = {
maxlength
:
20
maxlength
:
20
},
},
{
{
label
:
'产品类型'
,
name
:
'proType'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'confId'
,
optionLabel
:
'confValue'
,
optionsName
:
'typeList'
},
{
label
:
'使用门店'
,
label
:
'使用门店'
,
name
:
'merchantIdList'
,
name
:
'merchantIdList'
,
type
:
'select'
,
type
:
'select'
,
...
@@ -38,29 +47,24 @@ const commodityObj = {
...
@@ -38,29 +47,24 @@ const commodityObj = {
optionsName
:
'merchantList'
optionsName
:
'merchantList'
},
},
{
{
label
:
'所属系列'
,
label
:
'所属分类'
,
name
:
'goodsCode'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'goodsCode'
,
optionLabel
:
'goodsName'
,
optionsName
:
'goodsSeriesList'
},
{
label
:
'产品类型'
,
name
:
'goodsType'
,
name
:
'goodsType'
,
type
:
'select'
,
type
:
'select'
,
optionList
:
[],
optionList
:
[],
optionId
:
'c
onfId
'
,
optionId
:
'c
ategoryType
'
,
optionLabel
:
'c
onfValu
e'
,
optionLabel
:
'c
ategoryNam
e'
,
optionsName
:
'
type
List'
optionsName
:
'
goodsCategory
List'
}
}
]
]
}
}
const
editCommodityObj
=
{
const
editCommodityObj
=
{
editRule
:
{
editRule
:
{
goodsName
:
[{
required
:
true
,
message
:
'请输入商品名称'
,
trigger
:
'change'
}],
goodsName
:
[{
required
:
true
,
message
:
'请输入商品名称'
,
trigger
:
'change'
}],
goodsCode
:
[{
required
:
true
,
message
:
'请选择所属系列'
,
trigger
:
'change'
}],
// goodsCode: [{ required: true, message: '请选择所属系列', trigger: 'change' }],
goodsType
:
[{
required
:
true
,
message
:
'请选择所属分类'
,
trigger
:
'change'
}],
position
:
[{
required
:
true
,
message
:
'请选择适用部位'
,
trigger
:
'change'
}],
convertedValue
:
[{
required
:
true
,
message
:
'请输入比例换算'
,
trigger
:
'change'
}],
deductionStandard
:
[{
required
:
true
,
message
:
'请输入扣减标准'
,
trigger
:
'change'
}],
sellPrice
:
[{
required
:
true
,
message
:
'请输入售价'
,
trigger
:
'change'
}],
sellPrice
:
[{
required
:
true
,
message
:
'请输入售价'
,
trigger
:
'change'
}],
minSellPrice
:
[{
required
:
true
,
message
:
'请输入最低售价'
,
trigger
:
'change'
}],
minSellPrice
:
[{
required
:
true
,
message
:
'请输入最低售价'
,
trigger
:
'change'
}],
giftCost
:
[{
required
:
true
,
message
:
'请输入赠送成本'
,
trigger
:
'change'
}],
giftCost
:
[{
required
:
true
,
message
:
'请输入赠送成本'
,
trigger
:
'change'
}],
...
@@ -84,23 +88,30 @@ const editCommodityObj = {
...
@@ -84,23 +88,30 @@ const editCommodityObj = {
maxlength
:
50
maxlength
:
50
},
},
{
{
label
:
'所属
系列
'
,
label
:
'所属
分类
'
,
name
:
'goods
Cod
e'
,
name
:
'goods
Typ
e'
,
type
:
'select'
,
type
:
'select'
,
optionList
:
[],
optionList
:
[],
optionId
:
'
goodsCod
e'
,
optionId
:
'
categoryTyp
e'
,
optionLabel
:
'
goods
Name'
,
optionLabel
:
'
category
Name'
,
optionsName
:
'goods
Series
List'
,
optionsName
:
'goods
Category
List'
,
changeAttr
:
function
(
val
,
targetItem
,
that
)
{
changeAttr
:
function
(
val
,
targetItem
,
that
)
{
let
labeList
=
[
'产品类型'
,
'质保年限'
]
let
labelList
=
[
'适用部位'
,
'扣减标准'
,
'产品类型'
,
'质保年限'
]
let
txt
=
targetItem
.
optionList
.
find
(
k
=>
k
.
goodsCode
==
val
)?.
goodsName
||
''
let
jpLabelList
=
[
'比例换算'
]
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
labeList
,
txt
!=
'太阳膜'
)
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
if
(
val
!=
'1'
)
{
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
that
.
editForm
.
baseProductFlag
=
'N'
let
txt
=
targetItem
.
optionList
.
find
(
k
=>
k
.
categoryType
==
val
)?.
categoryName
||
''
that
.
editForm
.
upgradeProductFlag
=
'Y'
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
labelList
,
txt
!=
'自建商品-太阳膜'
)
that
.
handleCheckChange
(
'Y'
,
'upgradeProductFlag'
)
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
jpLabelList
,
txt
==
'自建商品-精品'
)
that
.
handleCheckChange
(
'N'
,
'baseProductFlag'
)
that
.
changeFormAttr
(
'editFormData'
,
'append'
,
baseLabelList
,
txt
==
'自建商品-精品'
?
'元/件'
:
'元/车'
)
that
.
changeFormAttr
(
'editFormData'
,
'append'
,
unitLabelList
,
txt
==
'自建商品-精品'
?
'件'
:
'米'
)
if
(
txt
!=
'自建商品-太阳膜'
)
{
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
baseLabelList
,
!
(
txt
!=
'自建商品-太阳膜'
))
}
}
that
.
editForm
.
baseProductFlag
=
'N'
that
.
editForm
.
upgradeProductFlag
=
'Y'
that
.
handleCheckChange
(
'Y'
,
'upgradeProductFlag'
)
that
.
handleCheckChange
(
'N'
,
'baseProductFlag'
)
}
}
},
},
{
{
...
@@ -116,6 +127,31 @@ const editCommodityObj = {
...
@@ -116,6 +127,31 @@ const editCommodityObj = {
maxlength
:
20
maxlength
:
20
},
},
{
{
label
:
'适用部位'
,
name
:
'position'
,
type
:
'select'
,
isHide
:
true
,
optionList
:
[],
optionId
:
'positionValue'
,
optionLabel
:
'positionName'
,
optionsName
:
'goodsPosList'
},
{
label
:
'比例换算'
,
name
:
'convertedValue'
,
type
:
'slot'
,
addHtml
:
'convertedValue'
,
isHide
:
true
},
{
label
:
'扣减标准'
,
name
:
'deductionStandard'
,
type
:
'slot'
,
addHtml
:
'deductionStandard'
,
placeholder
:
'请输入米数'
,
isHide
:
true
},
{
label
:
'产品类型'
,
label
:
'产品类型'
,
name
:
''
,
name
:
''
,
type
:
'slot'
,
type
:
'slot'
,
...
@@ -124,38 +160,44 @@ const editCommodityObj = {
...
@@ -124,38 +160,44 @@ const editCommodityObj = {
tips
:
'说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
tips
:
'说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
},
},
{
{
label
:
'售价
/元
'
,
label
:
'售价'
,
name
:
'sellPrice'
,
name
:
'sellPrice'
,
type
:
'input'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
},
{
{
label
:
'最低售价
/元
'
,
label
:
'最低售价'
,
name
:
'minSellPrice'
,
name
:
'minSellPrice'
,
type
:
'input'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
},
{
{
label
:
'赠送成本
/元
'
,
label
:
'赠送成本'
,
name
:
'giftCost'
,
name
:
'giftCost'
,
type
:
'input'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/车'
},
},
{
{
label
:
'产品成本
/元
'
,
label
:
'产品成本'
,
name
:
'productCost'
,
name
:
'productCost'
,
type
:
'input'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
},
{
{
label
:
'库存下限预警
/件
'
,
label
:
'库存下限预警'
,
name
:
'warningValue'
,
name
:
'warningValue'
,
type
:
'input'
type
:
'input'
,
append
:
'米'
},
},
{
{
label
:
'库存上限预警
/件
'
,
label
:
'库存上限预警'
,
name
:
'warningValueMax'
,
name
:
'warningValueMax'
,
type
:
'input'
type
:
'input'
,
append
:
'米'
},
},
{
{
label
:
'质保年限'
,
label
:
'质保年限'
,
...
...
src/views/commodity/editCommodity.vue
View file @
99d2453
...
@@ -4,6 +4,15 @@
...
@@ -4,6 +4,15 @@
<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"
>
<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>
<span>
米
</span>
</div>
<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>
<span>
米/车,1卷膜预估可适用
{{
editForm
.
deductionStandard
?
Math
.
floor
(
editForm
.
convertedValue
/
editForm
.
deductionStandard
)
:
'--'
}}
车
</span>
</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=
"基础产品"
@
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>
<el-checkbox
v-model=
"editForm.upgradeProductFlag"
true-label=
"Y"
false-label=
"N"
label=
"升级产品"
@
change=
"val => handleCheckChange(val, 'upgradeProductFlag')"
></el-checkbox>
...
@@ -63,7 +72,8 @@ export default {
...
@@ -63,7 +72,8 @@ export default {
editForm
:
{
editForm
:
{
baseProductFlag
:
'N'
,
baseProductFlag
:
'N'
,
upgradeProductFlag
:
'N'
,
upgradeProductFlag
:
'N'
,
merchantList
:
[]
merchantList
:
[],
goodsType
:
''
},
},
isEdit
:
true
,
isEdit
:
true
,
editRule
:
constData
.
editCommodityObj
.
editRule
,
editRule
:
constData
.
editCommodityObj
.
editRule
,
...
@@ -95,7 +105,9 @@ export default {
...
@@ -95,7 +105,9 @@ export default {
]
]
},
},
baseData
:
{
baseData
:
{
goodsSeriesList
:
[]
goodsCategoryList
:
[],
goodsPosList
:
[]
// goodsSeriesList: []
}
}
}
}
},
},
...
@@ -142,13 +154,15 @@ export default {
...
@@ -142,13 +154,15 @@ export default {
this
.
routeInfo
=
this
.
$route
.
query
this
.
routeInfo
=
this
.
$route
.
query
this
.
routeInfo
.
editType
!=
'add'
?
this
.
getInfo
()
:
''
this
.
routeInfo
.
editType
!=
'add'
?
this
.
getInfo
()
:
''
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
)
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
)
this
.
getGoodsSeries
()
this
.
getGoodsCategory
()
this
.
getGoodsPosList
()
// this.getGoodsSeries()
// this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
// this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
},
},
methods
:
{
methods
:
{
keyDown
()
{
keyDown
()
{
document
.
onkeydown
=
function
()
{
document
.
onkeydown
=
function
()
{
var
evt
=
window
.
event
||
arguments
[
0
]
var
evt
=
window
.
event
||
arguments
[
0
]
if
(
evt
&&
evt
.
keyCode
==
13
)
{
if
(
evt
&&
evt
.
keyCode
==
13
)
{
if
(
typeof
evt
.
cancelBubble
!=
'undefined'
)
evt
.
cancelBubble
=
true
if
(
typeof
evt
.
cancelBubble
!=
'undefined'
)
evt
.
cancelBubble
=
true
...
@@ -163,7 +177,7 @@ export default {
...
@@ -163,7 +177,7 @@ export default {
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
}
}
this
.
$apis
.
commodity
.
getGoodsDetail
(
params
).
then
(
res
=>
{
this
.
$apis
.
commodity
.
getGoodsDetail
(
params
).
then
(
res
=>
{
let
changeProduct
=
this
.
validateProduct
(
res
.
goods
Cod
eName
)
let
changeProduct
=
this
.
validateProduct
(
res
.
goods
Typ
eName
)
if
(
changeProduct
)
{
if
(
changeProduct
)
{
this
.
handleCheckChange
(
res
.
baseProductFlag
,
'baseProductFlag'
)
this
.
handleCheckChange
(
res
.
baseProductFlag
,
'baseProductFlag'
)
this
.
handleCheckChange
(
res
.
upgradeProductFlag
,
'upgradeProductFlag'
)
this
.
handleCheckChange
(
res
.
upgradeProductFlag
,
'upgradeProductFlag'
)
...
@@ -175,9 +189,11 @@ export default {
...
@@ -175,9 +189,11 @@ export default {
})
})
})
})
},
},
validateProduct
(
goodsCodeName
)
{
validateProduct
(
goodsTypeName
)
{
let
isFlag
=
goodsCodeName
!=
'太阳膜'
let
isFlag
=
goodsTypeName
!=
'自建商品-太阳膜'
let
AttrList
=
isFlag
?
[
'售价/元'
,
'最低售价/元'
,
'产品成本/元'
]
:
[
'产品类型'
,
'质保年限'
]
// let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限']
let
AttrList
=
isFlag
?
[
'售价'
,
'最低售价'
,
'产品成本'
]
:
[
'适用部位'
,
'比例换算'
,
'扣减标准'
,
'产品类型'
,
'质保年限'
]
goodsTypeName
!=
'自建商品-精品'
&&
AttrList
.
push
(
'比例换算'
)
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
AttrList
,
false
)
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
AttrList
,
false
)
if
(
!
isFlag
)
if
(
!
isFlag
)
return
(
val
,
attr
)
=>
{
return
(
val
,
attr
)
=>
{
...
@@ -188,16 +204,28 @@ export default {
...
@@ -188,16 +204,28 @@ export default {
// seriesClear() {
// seriesClear() {
// this.editForm
// this.editForm
// },
// },
getGoodsSeries
()
{
// getGoodsSeries() {
this
.
$apis
.
commodity
.
getGoodsSeries
({}).
then
(
res
=>
{
// this.$apis.commodity.getGoodsSeries({}).then(res => {
this
.
baseData
.
goodsSeriesList
=
res
// this.baseData.goodsSeriesList = res
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
,
'goodsCode'
)
// this.$utils.getOptionsList(this, 'editFormData', false, 'goodsCode')
// })
// },
getGoodsCategory
()
{
this
.
$apis
.
commodity
.
getGoodsCategory
({}).
then
(
res
=>
{
this
.
baseData
.
goodsCategoryList
=
res
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
,
'goodsType'
)
})
},
getGoodsPosList
()
{
this
.
$apis
.
commodity
.
getGoodsPosList
({}).
then
(
res
=>
{
this
.
baseData
.
goodsPosList
=
res
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
,
'position'
)
})
})
},
},
// 产品类型改变
// 产品类型改变
handleCheckChange
(
val
,
attr
)
{
handleCheckChange
(
val
,
attr
)
{
let
baseAttrList
=
[
'赠送成本
/元
'
]
let
baseAttrList
=
[
'赠送成本'
]
let
upAttrList
=
[
'售价
/元'
,
'最低售价/元'
,
'产品成本/元
'
]
let
upAttrList
=
[
'售价
'
,
'最低售价'
,
'产品成本
'
]
switch
(
attr
)
{
switch
(
attr
)
{
case
'baseProductFlag'
:
case
'baseProductFlag'
:
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
baseAttrList
,
val
!=
'Y'
)
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
baseAttrList
,
val
!=
'Y'
)
...
@@ -261,10 +289,12 @@ export default {
...
@@ -261,10 +289,12 @@ export default {
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
params
.
merchantIdList
=
[]
params
.
merchantIdList
=
[]
params
.
merchantIdList
=
params
.
merchantList
.
map
(
item
=>
item
.
merchantId
)
params
.
merchantIdList
=
params
.
merchantList
.
map
(
item
=>
item
.
merchantId
)
params
.
goodsTypeName
=
this
.
baseData
.
goodsCategoryList
.
find
(
item
=>
item
.
categoryType
==
params
.
goodsType
).
categoryName
delete
params
.
merchantList
delete
params
.
merchantList
if
(
this
.
routeInfo
.
editType
==
'edit'
)
{
if
(
this
.
routeInfo
.
editType
==
'edit'
)
{
params
.
upgradeGoodsId
=
this
.
routeInfo
.
info
.
upgradeGoodsId
params
.
upgradeGoodsId
=
this
.
routeInfo
.
info
.
upgradeGoodsId
}
}
console
.
log
(
params
,
'00000'
)
this
.
$apis
.
commodity
.
updateGoods
(
params
).
then
(
res
=>
{
this
.
$apis
.
commodity
.
updateGoods
(
params
).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
...
@@ -292,7 +322,7 @@ export default {
...
@@ -292,7 +322,7 @@ export default {
.
then
(()
=>
{
.
then
(()
=>
{
this
.
cancelJump
()
this
.
cancelJump
()
})
})
.
catch
(()
=>
{})
.
catch
(()
=>
{
})
}
else
{
}
else
{
this
.
cancelJump
()
this
.
cancelJump
()
}
}
...
...
src/views/commodity/index.vue
View file @
99d2453
...
@@ -17,9 +17,8 @@
...
@@ -17,9 +17,8 @@
<div
slot=
"content"
>
<div
slot=
"content"
>
<div
class=
"text-3 font-12 weight-6"
style=
"line-height:24px"
>
上家门店
</div>
<div
class=
"text-3 font-12 weight-6"
style=
"line-height:24px"
>
上家门店
</div>
<div
class=
"merchant-wrap"
>
<div
class=
"merchant-wrap"
>
<div
class=
"text-6 font-12"
style=
"line-height:24px"
v-for=
"item in scope.scope.merchantList"
:key=
"item"
>
{{
item
.
merchantName
}}
</div>
<div
class=
"text-6 font-12"
style=
"line-height:24px"
v-for=
"item in scope.scope.merchantList"
:key=
"item"
>
{{
item
.
merchantName
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"use-store"
>
<div
class=
"use-store"
>
<img
src=
"@/assets/store.png"
/>
<img
src=
"@/assets/store.png"
/>
...
@@ -53,6 +52,7 @@ export default {
...
@@ -53,6 +52,7 @@ export default {
goodsCode
:
''
,
goodsCode
:
''
,
merchantIdList
:
[],
merchantIdList
:
[],
type
:
''
,
type
:
''
,
proType
:
''
,
goodsType
:
''
goodsType
:
''
},
},
tableSearchForm
:
{},
tableSearchForm
:
{},
...
@@ -79,9 +79,9 @@ export default {
...
@@ -79,9 +79,9 @@ export default {
line
:
1
line
:
1
},
},
{
{
label
:
'所属
系列
'
,
label
:
'所属
分类
'
,
prop
:
'goods
Cod
eName'
,
prop
:
'goods
Typ
eName'
,
width
:
'1
0
0'
width
:
'1
5
0'
},
},
{
{
label
:
'品牌方'
,
label
:
'品牌方'
,
...
@@ -189,7 +189,8 @@ export default {
...
@@ -189,7 +189,8 @@ export default {
merchantList
:
[],
merchantList
:
[],
brandList
:
[],
brandList
:
[],
typeList
:
baseList
.
typeList
,
typeList
:
baseList
.
typeList
,
goodsSeriesList
:
[]
goodsSeriesList
:
[],
goodsCategoryList
:
[]
},
},
imgVisible
:
false
,
imgVisible
:
false
,
previewImgUrl
:
''
previewImgUrl
:
''
...
@@ -199,12 +200,13 @@ export default {
...
@@ -199,12 +200,13 @@ export default {
mounted
()
{
mounted
()
{
this
.
getGoodsSeries
()
this
.
getGoodsSeries
()
this
.
getMerchantList
()
this
.
getMerchantList
()
this
.
getGoodsCategory
()
this
.
$utils
.
getOptionsList
(
this
,
'searchFormData'
)
this
.
$utils
.
getOptionsList
(
this
,
'searchFormData'
)
},
},
methods
:
{
methods
:
{
getParams
()
{
getParams
()
{
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
switch
(
params
.
goods
Type
)
{
switch
(
params
.
pro
Type
)
{
case
1
:
case
1
:
params
.
baseProductFlag
=
'Y'
params
.
baseProductFlag
=
'Y'
break
break
...
@@ -259,6 +261,12 @@ export default {
...
@@ -259,6 +261,12 @@ export default {
})
})
},
},
getGoodsCategory
()
{
this
.
$apis
.
commodity
.
getGoodsCategory
({}).
then
(
res
=>
{
this
.
baseData
.
goodsCategoryList
=
res
this
.
$utils
.
getOptionsList
(
this
,
'searchFormData'
,
true
,
'goodsType'
)
})
},
// 删除
// 删除
handleDelete
(
info
)
{
handleDelete
(
info
)
{
this
.
$utils
.
secondConfirm
(
this
,
'删除提示'
,
'删除后不可恢复,是否确定删除?'
,
'commodity'
,
'deleteGoods'
,
{
upgradeGoodsId
:
info
.
upgradeGoodsId
})
this
.
$utils
.
secondConfirm
(
this
,
'删除提示'
,
'删除后不可恢复,是否确定删除?'
,
'commodity'
,
'deleteGoods'
,
{
upgradeGoodsId
:
info
.
upgradeGoodsId
})
...
@@ -282,6 +290,7 @@ export default {
...
@@ -282,6 +290,7 @@ export default {
goodsCode
:
''
,
goodsCode
:
''
,
merchantIdList
:
[],
merchantIdList
:
[],
type
:
''
,
type
:
''
,
proType
:
''
,
goodsType
:
''
goodsType
:
''
}
}
this
.
handleSearch
()
this
.
handleSearch
()
...
@@ -290,8 +299,8 @@ export default {
...
@@ -290,8 +299,8 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.container
{
.container
{
padding
:
20px
;
padding
:
20px
;
}
}
.use-store
{
.use-store
{
display
:
flex
;
display
:
flex
;
...
@@ -305,19 +314,19 @@ export default {
...
@@ -305,19 +314,19 @@ export default {
}
}
}
}
.table-header
{
.table-header
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
margin-top
:
20px
;
margin-top
:
20px
;
h2
{
h2
{
font-weight
:
600
;
font-weight
:
600
;
font-size
:
16px
;
font-size
:
16px
;
color
:
#333
;
color
:
#333
;
}
}
}
}
.merchant-wrap
{
.merchant-wrap
{
max-height
:
200px
;
max-height
:
200px
;
overflow
:
scroll
;
overflow
:
scroll
;
}
}
</
style
>
</
style
>
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