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 bcc366d0
authored
Dec 04, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v4.32.0_1130' into 'master'
Dev v4.32.0 1130 See merge request
!4
2 parents
385ab76d
806cc51e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
285 additions
and
131 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 @
bcc366d
...
...
@@ -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
=>
{
params
.
method
=
'scrm.api.partner.goods.insertOrUpdate'
return
http
({
...
...
@@ -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 @
bcc366d
...
...
@@ -4,17 +4,14 @@
<div
class=
"edit-box "
>
<div
class=
"m-b-20 bgf"
>
<p
class=
"edit-title"
>
基础信息
</p>
<el-form
label-width=
"120px"
:inline=
"true"
class=
"context-wrap"
>
<el-row
v-for=
"(item, index) in detailFormDataRow"
:key=
"index"
>
<span
v-for=
"(subItem, subIndex) in item.rowList"
:key=
"subIndex"
>
<template
v-if=
"detailForm[subItem.name] != '-'"
>
<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>
<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' : '']"
>
<template
v-if=
"detailForm[subItem.name] != '-'"
>
<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>
</el-form-item>
</
template
>
</span>
</el-row>
</div>
</el-form>
</div>
<div
class=
"edit-container bgf"
>
...
...
@@ -22,9 +19,6 @@
<GLTable
ref=
"warehousListRef"
class=
"context-wrap"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"detailForm.merchantList"
></GLTable>
</div>
</div>
<!-- <GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
</GLFooter> -->
</div>
</template>
...
...
@@ -36,6 +30,7 @@ export default {
size
:
'small'
,
title
:
'查看商品'
,
editChildRef
:
'editChildRef'
,
isShow
:
false
,
routeInfo
:
{
orderCode
:
''
},
...
...
@@ -43,7 +38,6 @@ export default {
orderRefund
:
null
,
orderGoods
:
[],
// 订单信息
detailFormDataRow
:
[],
detailFormData
:
[
{
label
:
'商品名称'
,
...
...
@@ -54,8 +48,8 @@ export default {
name
:
'type'
},
{
label
:
'所属
系列
'
,
name
:
'goods
Cod
eName'
label
:
'所属
分类
'
,
name
:
'goods
Typ
eName'
},
{
label
:
'品牌方'
,
...
...
@@ -66,47 +60,62 @@ export default {
name
:
'supplierName'
},
{
label
:
'适用部位'
,
name
:
'posTxt'
},
{
label
:
'比例换算'
,
name
:
'convertedValueTxt'
},
{
label
:
'扣减标准'
,
name
:
'deductionStandard'
,
suffix
:
'米/车'
},
{
label
:
'产品类型'
,
name
:
'typeTxt'
},
// {
// label: '所属系列',
// name: 'goodsCode'
// },
{
label
:
'售价
/元
'
,
label
:
'售价'
,
name
:
'sellPrice'
,
isNum
:
true
isNum
:
true
,
suffix
:
'元/件'
},
{
label
:
'最低售价
/元
'
,
label
:
'最低售价'
,
name
:
'minSellPrice'
,
isNum
:
true
isNum
:
true
,
suffix
:
'元/件'
},
{
label
:
'赠送成本
/元
'
,
label
:
'赠送成本'
,
name
:
'giftCost'
,
isNum
:
true
isNum
:
true
,
suffix
:
'元/车'
},
{
label
:
'产品成本
/元
'
,
label
:
'产品成本'
,
name
:
'productCost'
,
isNum
:
true
,
suffix
:
'元/件'
},
{
label
:
'质保年限/年'
,
name
:
'warrantyPeriod'
,
isNum
:
true
},
{
label
:
'库存下限预警'
,
name
:
'warningValue'
,
isNum
:
true
isNum
:
true
,
suffix
:
'米'
},
{
label
:
'库存
预警上限
'
,
label
:
'库存
上限预警
'
,
name
:
'warningValueMax'
,
isNum
:
true
},
{
label
:
'质保年限'
,
name
:
'warrantyPeriod'
,
isNum
:
true
isNum
:
true
,
suffix
:
'米'
}
],
// 门店表格
...
...
@@ -125,10 +134,6 @@ export default {
}
},
created
()
{
this
.
formToRow
(
'detailFormData'
)
},
mounted
()
{
this
.
setMinHeight
(
'.edit-box'
)
this
.
routeInfo
=
this
.
$route
.
query
...
...
@@ -136,40 +141,56 @@ export default {
},
methods
:
{
formToRow
(
formName
,
numOfRow
=
3
)
{
var
rowNum
=
Math
.
ceil
(
this
[
formName
].
length
/
numOfRow
)
for
(
var
i
=
0
;
i
<
rowNum
;
i
++
)
{
for
(
var
j
=
0
;
j
<
numOfRow
;
j
++
)
{
if
(
j
==
0
)
{
this
[
formName
+
'Row'
][
i
]
=
{
rowList
:
[]
}
}
if
(
i
*
numOfRow
+
j
<
this
[
formName
].
length
)
{
this
[
formName
+
'Row'
][
i
].
rowList
.
push
(
this
[
formName
][
i
*
numOfRow
+
j
])
getGoodsPosList
()
{
this
.
$apis
.
commodity
.
getGoodsPosList
({}).
then
(
res
=>
{
this
.
goodsPosList
=
res
let
obj
=
this
.
goodsPosList
.
find
(
item
=>
item
.
positionValue
==
this
.
detailForm
.
position
)
this
.
detailForm
.
posTxt
=
obj
?
obj
.
positionName
:
'-'
})
},
changeFormAttr
(
formName
,
attrName
,
labelList
,
attrValue
)
{
labelList
.
forEach
(
item
=>
{
this
[
formName
].
forEach
(
k
=>
{
if
(
k
.
label
==
item
)
{
k
[
attrName
]
=
attrValue
}
}
}
console
.
log
(
this
.
detailFormDataRow
,
'detailFormDataRow---'
)
})
})
},
getInfo
()
{
this
.
$apis
.
commodity
.
getGoodsDetail
({
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
}).
then
(
res
=>
{
this
.
detailForm
=
res
this
.
detailForm
=
{
...
res
,
posTxt
:
''
}
let
list
=
[]
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
this
.
detailForm
.
baseProductFlag
==
'Y'
?
list
.
push
(
'基础产品'
)
:
''
this
.
detailForm
.
upgradeProductFlag
==
'Y'
?
list
.
push
(
'升级产品'
)
:
''
this
.
detailForm
.
typeTxt
=
list
.
join
(
','
)
this
.
changeFormAttr
(
'detailFormData'
,
'suffix'
,
baseLabelList
,
this
.
detailForm
.
goodsTypeName
==
'自建商品-精品'
?
'元/件'
:
'元/车'
)
this
.
changeFormAttr
(
'detailFormData'
,
'suffix'
,
unitLabelList
,
this
.
detailForm
.
goodsTypeName
==
'自建商品-精品'
?
'件'
:
'米'
)
this
.
detailForm
.
convertedValueTxt
=
this
.
detailForm
.
convertedValue
?
'1卷='
+
this
.
detailForm
.
convertedValue
+
'米'
:
'-'
this
.
getGoodsPosList
()
if
(
list
.
length
!=
2
&&
this
.
detailForm
.
baseProductFlag
==
'Y'
)
{
this
.
detailForm
.
sellPrice
=
'-'
this
.
detailForm
.
minSellPrice
=
'-'
this
.
detailForm
.
productCost
=
'-'
}
if
(
this
.
detailForm
.
goodsCodeName
!=
'太阳膜'
)
{
if
(
list
.
length
!=
2
&&
this
.
detailForm
.
upgradeProductFlag
==
'Y'
)
{
this
.
detailForm
.
giftCost
=
'-'
}
if
(
this
.
detailForm
.
goodsTypeName
!=
'自建商品-太阳膜'
)
{
this
.
detailForm
.
warrantyPeriod
=
'-'
this
.
detailForm
.
giftCost
=
'-'
this
.
detailForm
.
deductionStandard
=
'-'
this
.
detailForm
.
typeTxt
=
'-'
}
else
{
this
.
detailForm
.
warrantyPeriod
=
(
this
.
detailForm
.
warrantyPeriod
||
0
)
+
'年'
}
// console.log(this.detailForm, '000')
this
.
isShow
=
true
})
},
handleCancel
()
{
...
...
@@ -193,9 +214,17 @@ export default {
.marketing.order-detail
.flex
{
justify-content
:
flex-start
;
}
.marketing.order-detail
.row-item
{
.order-detail
.content
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.order-detail
.w-30
{
width
:
33%
;
}
.marketing.order-detail
.row-item
{
display
:
inline-block
;
/* width: 33%; */
}
.detail-txt
{
display
:
inline-block
;
width
:
220px
;
...
...
src/views/commodity/constant/data.js
View file @
bcc366d
...
...
@@ -29,6 +29,15 @@ const commodityObj = {
maxlength
:
20
},
{
label
:
'产品类型'
,
name
:
'proType'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'confId'
,
optionLabel
:
'confValue'
,
optionsName
:
'typeList'
},
{
label
:
'使用门店'
,
name
:
'merchantIdList'
,
type
:
'select'
,
...
...
@@ -38,29 +47,24 @@ const commodityObj = {
optionsName
:
'merchantList'
},
{
label
:
'所属系列'
,
name
:
'goodsCode'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'goodsCode'
,
optionLabel
:
'goodsName'
,
optionsName
:
'goodsSeriesList'
},
{
label
:
'产品类型'
,
label
:
'所属分类'
,
name
:
'goodsType'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'c
onfId
'
,
optionLabel
:
'c
onfValu
e'
,
optionsName
:
'
type
List'
optionId
:
'c
ategoryType
'
,
optionLabel
:
'c
ategoryNam
e'
,
optionsName
:
'
goodsCategory
List'
}
]
}
const
editCommodityObj
=
{
editRule
:
{
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'
}],
minSellPrice
:
[{
required
:
true
,
message
:
'请输入最低售价'
,
trigger
:
'change'
}],
giftCost
:
[{
required
:
true
,
message
:
'请输入赠送成本'
,
trigger
:
'change'
}],
...
...
@@ -84,23 +88,30 @@ const editCommodityObj = {
maxlength
:
50
},
{
label
:
'所属
系列
'
,
name
:
'goods
Cod
e'
,
label
:
'所属
分类
'
,
name
:
'goods
Typ
e'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'
goodsCod
e'
,
optionLabel
:
'
goods
Name'
,
optionsName
:
'goods
Series
List'
,
optionId
:
'
categoryTyp
e'
,
optionLabel
:
'
category
Name'
,
optionsName
:
'goods
Category
List'
,
changeAttr
:
function
(
val
,
targetItem
,
that
)
{
let
labeList
=
[
'产品类型'
,
'质保年限'
]
let
txt
=
targetItem
.
optionList
.
find
(
k
=>
k
.
goodsCode
==
val
)?.
goodsName
||
''
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
labeList
,
txt
!=
'太阳膜'
)
if
(
val
!=
'1'
)
{
that
.
editForm
.
baseProductFlag
=
'N'
that
.
editForm
.
upgradeProductFlag
=
'Y'
that
.
handleCheckChange
(
'Y'
,
'upgradeProductFlag'
)
that
.
handleCheckChange
(
'N'
,
'baseProductFlag'
)
let
labelList
=
[
'适用部位'
,
'扣减标准'
,
'产品类型'
,
'质保年限'
]
let
jpLabelList
=
[
'比例换算'
]
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
let
txt
=
targetItem
.
optionList
.
find
(
k
=>
k
.
categoryType
==
val
)?.
categoryName
||
''
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
labelList
,
txt
!=
'自建商品-太阳膜'
)
that
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
jpLabelList
,
txt
==
'自建商品-精品'
)
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 = {
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
:
'产品类型'
,
name
:
''
,
type
:
'slot'
,
...
...
@@ -124,38 +160,44 @@ const editCommodityObj = {
tips
:
'说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
},
{
label
:
'售价
/元
'
,
label
:
'售价'
,
name
:
'sellPrice'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
{
label
:
'最低售价
/元
'
,
label
:
'最低售价'
,
name
:
'minSellPrice'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
{
label
:
'赠送成本
/元
'
,
label
:
'赠送成本'
,
name
:
'giftCost'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/车'
},
{
label
:
'产品成本
/元
'
,
label
:
'产品成本'
,
name
:
'productCost'
,
type
:
'input'
,
isHide
:
true
isHide
:
true
,
append
:
'元/件'
},
{
label
:
'库存下限预警
/件
'
,
label
:
'库存下限预警'
,
name
:
'warningValue'
,
type
:
'input'
type
:
'input'
,
append
:
'米'
},
{
label
:
'库存上限预警
/件
'
,
label
:
'库存上限预警'
,
name
:
'warningValueMax'
,
type
:
'input'
type
:
'input'
,
append
:
'米'
},
{
label
:
'质保年限'
,
...
...
src/views/commodity/editCommodity.vue
View file @
bcc366d
...
...
@@ -4,6 +4,15 @@
<div
class=
"container edit-container"
>
<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"
>
<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"
>
<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>
...
...
@@ -63,7 +72,8 @@ export default {
editForm
:
{
baseProductFlag
:
'N'
,
upgradeProductFlag
:
'N'
,
merchantList
:
[]
merchantList
:
[],
goodsType
:
''
},
isEdit
:
true
,
editRule
:
constData
.
editCommodityObj
.
editRule
,
...
...
@@ -95,7 +105,9 @@ export default {
]
},
baseData
:
{
goodsSeriesList
:
[]
goodsCategoryList
:
[],
goodsPosList
:
[]
// goodsSeriesList: []
}
}
},
...
...
@@ -142,13 +154,15 @@ export default {
this
.
routeInfo
=
this
.
$route
.
query
this
.
routeInfo
.
editType
!=
'add'
?
this
.
getInfo
()
:
''
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
)
this
.
getGoodsSeries
()
this
.
getGoodsCategory
()
this
.
getGoodsPosList
()
// this.getGoodsSeries()
// this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
},
methods
:
{
keyDown
()
{
document
.
onkeydown
=
function
()
{
document
.
onkeydown
=
function
()
{
var
evt
=
window
.
event
||
arguments
[
0
]
if
(
evt
&&
evt
.
keyCode
==
13
)
{
if
(
typeof
evt
.
cancelBubble
!=
'undefined'
)
evt
.
cancelBubble
=
true
...
...
@@ -163,21 +177,27 @@ export default {
upgradeGoodsId
:
this
.
routeInfo
.
info
.
upgradeGoodsId
}
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
)
{
this
.
handleCheckChange
(
res
.
baseProductFlag
,
'baseProductFlag'
)
this
.
handleCheckChange
(
res
.
upgradeProductFlag
,
'upgradeProductFlag'
)
}
let
baseLabelList
=
[
'售价'
,
'最低售价'
,
'产品成本'
]
let
unitLabelList
=
[
'库存下限预警'
,
'库存上限预警'
]
this
.
changeFormAttr
(
'editFormData'
,
'append'
,
baseLabelList
,
res
.
goodsTypeName
==
'自建商品-精品'
?
'元/件'
:
'元/车'
)
this
.
changeFormAttr
(
'editFormData'
,
'append'
,
unitLabelList
,
res
.
goodsTypeName
==
'自建商品-精品'
?
'件'
:
'米'
)
this
.
editForm
=
res
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
})
})
},
validateProduct
(
goodsCodeName
)
{
let
isFlag
=
goodsCodeName
!=
'太阳膜'
let
AttrList
=
isFlag
?
[
'售价/元'
,
'最低售价/元'
,
'产品成本/元'
]
:
[
'产品类型'
,
'质保年限'
]
validateProduct
(
goodsTypeName
)
{
let
isFlag
=
goodsTypeName
!=
'自建商品-太阳膜'
// let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限']
let
AttrList
=
isFlag
?
[
'售价'
,
'最低售价'
,
'产品成本'
]
:
[
'适用部位'
,
'比例换算'
,
'扣减标准'
,
'产品类型'
,
'质保年限'
]
goodsTypeName
!=
'自建商品-精品'
&&
AttrList
.
push
(
'比例换算'
)
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
AttrList
,
false
)
if
(
!
isFlag
)
return
(
val
,
attr
)
=>
{
...
...
@@ -188,16 +208,28 @@ export default {
// seriesClear() {
// this.editForm
// },
getGoodsSeries
()
{
this
.
$apis
.
commodity
.
getGoodsSeries
({}).
then
(
res
=>
{
this
.
baseData
.
goodsSeriesList
=
res
this
.
$utils
.
getOptionsList
(
this
,
'editFormData'
,
false
,
'goodsCode'
)
// getGoodsSeries() {
// this.$apis.commodity.getGoodsSeries({}).then(res => {
// this.baseData.goodsSeriesList = res
// 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
)
{
let
baseAttrList
=
[
'赠送成本
/元
'
]
let
upAttrList
=
[
'售价
/元'
,
'最低售价/元'
,
'产品成本/元
'
]
let
baseAttrList
=
[
'赠送成本'
]
let
upAttrList
=
[
'售价
'
,
'最低售价'
,
'产品成本
'
]
switch
(
attr
)
{
case
'baseProductFlag'
:
this
.
changeFormAttr
(
'editFormData'
,
'isHide'
,
baseAttrList
,
val
!=
'Y'
)
...
...
@@ -261,10 +293,29 @@ export default {
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
params
.
merchantIdList
=
[]
params
.
merchantIdList
=
params
.
merchantList
.
map
(
item
=>
item
.
merchantId
)
params
.
goodsTypeName
=
this
.
baseData
.
goodsCategoryList
.
find
(
item
=>
item
.
categoryType
==
params
.
goodsType
).
categoryName
delete
params
.
merchantList
if
(
this
.
routeInfo
.
editType
==
'edit'
)
{
params
.
upgradeGoodsId
=
this
.
routeInfo
.
info
.
upgradeGoodsId
}
if
(
params
.
goodsTypeName
!=
'自建商品-太阳膜'
)
{
params
.
baseProductFlag
=
'N'
params
.
upgradeProductFlag
=
'N'
params
.
position
=
''
params
.
deductionStandard
=
''
params
.
giftCost
=
''
params
.
warrantyPeriod
=
''
}
else
if
(
params
.
upgradeProductFlag
==
'N'
)
{
params
.
sellPrice
=
''
params
.
minSellPrice
=
''
params
.
productCost
=
''
}
else
if
(
params
.
baseProductFlag
==
'N'
)
{
params
.
giftCost
=
''
}
if
(
params
.
goodsTypeName
==
'自建商品-精品'
)
{
params
.
convertedValue
=
''
}
console
.
log
(
params
,
'00000'
)
this
.
$apis
.
commodity
.
updateGoods
(
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
...
...
@@ -292,7 +343,7 @@ export default {
.
then
(()
=>
{
this
.
cancelJump
()
})
.
catch
(()
=>
{})
.
catch
(()
=>
{
})
}
else
{
this
.
cancelJump
()
}
...
...
src/views/commodity/index.vue
View file @
bcc366d
...
...
@@ -17,9 +17,8 @@
<div
slot=
"content"
>
<div
class=
"text-3 font-12 weight-6"
style=
"line-height:24px"
>
上家门店
</div>
<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
class=
"use-store"
>
<img
src=
"@/assets/store.png"
/>
...
...
@@ -53,6 +52,7 @@ export default {
goodsCode
:
''
,
merchantIdList
:
[],
type
:
''
,
proType
:
''
,
goodsType
:
''
},
tableSearchForm
:
{},
...
...
@@ -79,9 +79,9 @@ export default {
line
:
1
},
{
label
:
'所属
系列
'
,
prop
:
'goods
Cod
eName'
,
width
:
'1
0
0'
label
:
'所属
分类
'
,
prop
:
'goods
Typ
eName'
,
width
:
'1
5
0'
},
{
label
:
'品牌方'
,
...
...
@@ -189,7 +189,8 @@ export default {
merchantList
:
[],
brandList
:
[],
typeList
:
baseList
.
typeList
,
goodsSeriesList
:
[]
goodsSeriesList
:
[],
goodsCategoryList
:
[]
},
imgVisible
:
false
,
previewImgUrl
:
''
...
...
@@ -199,12 +200,13 @@ export default {
mounted
()
{
this
.
getGoodsSeries
()
this
.
getMerchantList
()
this
.
getGoodsCategory
()
this
.
$utils
.
getOptionsList
(
this
,
'searchFormData'
)
},
methods
:
{
getParams
()
{
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
switch
(
params
.
goods
Type
)
{
switch
(
params
.
pro
Type
)
{
case
1
:
params
.
baseProductFlag
=
'Y'
break
...
...
@@ -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
)
{
this
.
$utils
.
secondConfirm
(
this
,
'删除提示'
,
'删除后不可恢复,是否确定删除?'
,
'commodity'
,
'deleteGoods'
,
{
upgradeGoodsId
:
info
.
upgradeGoodsId
})
...
...
@@ -282,6 +290,7 @@ export default {
goodsCode
:
''
,
merchantIdList
:
[],
type
:
''
,
proType
:
''
,
goodsType
:
''
}
this
.
handleSearch
()
...
...
@@ -290,8 +299,8 @@ export default {
}
</
script
>
<
style
scoped
lang=
"scss"
>
.container
{
padding
:
20px
;
.container
{
padding
:
20px
;
}
.use-store
{
display
:
flex
;
...
...
@@ -305,19 +314,19 @@ export default {
}
}
.table-header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
10px
;
margin-top
:
20px
;
h2
{
font-weight
:
600
;
font-size
:
16px
;
color
:
#333
;
}
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
10px
;
margin-top
:
20px
;
h2
{
font-weight
:
600
;
font-size
:
16px
;
color
:
#333
;
}
}
.merchant-wrap
{
max-height
:
200px
;
.merchant-wrap
{
max-height
:
200px
;
overflow
:
scroll
;
}
</
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