Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 7c231a91
authored
Dec 12, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
服务门店;商品编辑
1 parent
061e922d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
349 additions
and
248 deletions
src/components/d2-form/index.vue
src/views/goods/commodity.vue
src/views/goods/editCommodity.vue
src/views/goods/editProduct.vue
src/views/systemConfig/serviceStore.vue
src/components/d2-form/index.vue
View file @
7c231a9
...
@@ -7,6 +7,29 @@
...
@@ -7,6 +7,29 @@
:ref=
"formRef + 'd2FormRuleForm'"
:ref=
"formRef + 'd2FormRuleForm'"
v-loading=
"$store.state.d2admin.loading.value"
v-loading=
"$store.state.d2admin.loading.value"
>
>
<div>
<el-form-item
id=
"yqMerchantId"
label=
"园区店:"
prop=
"yqMerchantId"
v-show=
"userInfo.beSuper"
>
<el-select
v-model=
"formData.yqMerchantId"
:disabled=
"merchantDisable"
placeholder=
"请选择"
class=
"el_select itd"
@
change=
"handleMerchantChange"
>
<el-option
v-for=
"x in parkServiceList"
:key=
"x.merchantId"
:value=
"x.merchantId"
:label=
"x.merchantName"
></el-option>
</el-select>
</el-form-item>
</div>
<div
<div
v-for=
"(i, idx) in formList"
v-for=
"(i, idx) in formList"
:key=
"idx"
:key=
"idx"
...
@@ -126,28 +149,6 @@
...
@@ -126,28 +149,6 @@
>
{{
item
.
btnTxt
}}
</el-button>
>
{{
item
.
btnTxt
}}
</el-button>
<span>
已为该商品组合分配
<span
class=
"relate-btn-txt"
>
{{
formData
[
item
.
name
]
?
formData
[
item
.
name
].
length
:
0
}}
</span>
家可见店铺
</span>
<span>
已为该商品组合分配
<span
class=
"relate-btn-txt"
>
{{
formData
[
item
.
name
]
?
formData
[
item
.
name
].
length
:
0
}}
</span>
家可见店铺
</span>
</div>
</div>
<div>
<el-form-item
id=
"yqMerchantId"
label=
"服务门店:"
prop=
"yqMerchantId"
v-show=
"userInfo.beSuper"
>
<el-select
v-model=
"formData.yqMerchantId"
placeholder=
"请选择"
class=
"el_select itd"
@
change=
"handleMerchantChange"
>
<el-option
v-for=
"x in parkServiceList"
:key=
"x.merchantId"
:value=
"x.merchantId"
:label=
"x.merchantName"
></el-option>
</el-select>
</el-form-item>
</div>
<el-table
<el-table
:data=
"formData[item.name]"
:data=
"formData[item.name]"
style=
"width: 690px"
style=
"width: 690px"
...
@@ -199,6 +200,7 @@
...
@@ -199,6 +200,7 @@
<div
class=
"add-btns"
>
<div
class=
"add-btns"
>
<el-button
<el-button
type=
"primary"
type=
"primary"
:disabled=
"!formData.yqMerchantId"
@
click=
"handleAddPro(item)"
@
click=
"handleAddPro(item)"
>
添加绑定
</el-button>
>
添加绑定
</el-button>
<span>
已将基础商品绑定
<span
class=
"relate-btn-txt"
>
{{
formData
[
item
.
name
]
?
formData
[
item
.
name
].
length
:
0
}}
</span>
件升级商品
</span>
<span>
已将基础商品绑定
<span
class=
"relate-btn-txt"
>
{{
formData
[
item
.
name
]
?
formData
[
item
.
name
].
length
:
0
}}
</span>
件升级商品
</span>
...
@@ -526,6 +528,7 @@ export default {
...
@@ -526,6 +528,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
merchantDisable
:
true
,
// 关联商品弹窗
// 关联商品弹窗
relateProVisible
:
false
,
relateProVisible
:
false
,
relateStoreVisible
:
false
,
relateStoreVisible
:
false
,
...
@@ -587,6 +590,10 @@ export default {
...
@@ -587,6 +590,10 @@ export default {
storeApi
:
{
storeApi
:
{
type
:
Function
,
type
:
Function
,
default
:
()
=>
{
}
default
:
()
=>
{
}
},
formName
:
{
type
:
String
,
default
:
()
=>
{
}
}
}
},
},
...
@@ -597,22 +604,25 @@ export default {
...
@@ -597,22 +604,25 @@ export default {
mounted
()
{
mounted
()
{
this
.
formData
=
_
.
cloneDeep
(
this
.
originData
)
this
.
formData
=
_
.
cloneDeep
(
this
.
originData
)
this
.
merchantDisable
=
this
.
addOrEdit
===
'edit'
if
(
this
.
userInfo
.
beSuper
)
{
if
(
this
.
userInfo
.
beSuper
)
{
getParkStore
({}).
then
(
res
=>
{
getParkStore
({}).
then
(
res
=>
{
// console.log(res)
this
.
parkServiceList
=
res
this
.
parkServiceList
=
res
})
})
}
}
if
(
this
.
formData
.
hasOwnProperty
(
'upgradeGoods'
))
{
if
(
this
.
formData
.
hasOwnProperty
(
'upgradeGoods'
))
{
this
.
profitOldVal
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
profitValue
)
this
.
profitOldVal
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
profitValue
)
this
.
getGoodsList
()
//
this.getGoodsList()
}
}
},
},
methods
:
{
methods
:
{
getGoodsList
()
{
getGoodsList
(
merchantId
)
{
getGoodsList
({}).
then
(
res
=>
{
return
new
Promise
(
resolve
=>
{
this
.
proList
=
res
getGoodsList
({
yqMerchantId
:
merchantId
}).
then
(
res
=>
{
this
.
proList
=
res
resolve
()
})
})
})
},
},
// 选择框-添加其他属性
// 选择框-添加其他属性
...
@@ -628,44 +638,50 @@ export default {
...
@@ -628,44 +638,50 @@ export default {
// }
// }
},
},
handleAddPro
(
targetItem
)
{
handleAddPro
(
targetItem
)
{
if
(
!
this
.
formData
[
targetItem
.
relateAttr
])
{
// formData.yqMerchantId
// this.notice.warningTips('请选择基础商品')
this
.
getGoodsList
(
this
.
formData
.
yqMerchantId
).
then
(
res
=>
{
this
.
$message
({
if
(
!
this
.
formData
[
targetItem
.
relateAttr
])
{
message
:
'请选择基础商品'
,
// this.notice.warningTips('请选择基础商品')
type
:
'warning'
,
this
.
$message
({
showClose
:
true
message
:
'请选择基础商品'
,
type
:
'warning'
,
showClose
:
true
})
this
.
jumpScroll
(
targetItem
.
relateAttr
)
return
true
}
this
.
markTarget
=
targetItem
console
.
log
(
this
.
markTarget
)
var
proSelectedIds
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
goodsCode
)
proSelectedIds
.
push
(
this
.
formData
[
targetItem
.
relateAttr
])
this
.
proList
.
forEach
(
item
=>
{
item
.
disabled
=
proSelectedIds
.
includes
(
item
.
goodsCode
)
})
})
this
.
jumpScroll
(
targetItem
.
relateAttr
)
this
.
relateProVisible
=
true
return
true
}
this
.
markTarget
=
targetItem
console
.
log
(
this
.
markTarget
)
var
proSelectedIds
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
goodsCode
)
proSelectedIds
.
push
(
this
.
formData
[
targetItem
.
relateAttr
])
this
.
proList
.
forEach
(
item
=>
{
item
.
disabled
=
proSelectedIds
.
includes
(
item
.
goodsCode
)
})
})
this
.
relateProVisible
=
true
},
},
handleProChange
(
item
,
targetItem
,
targetIndex
)
{
handleProChange
(
item
,
targetItem
,
targetIndex
)
{
console
.
log
(
targetItem
)
console
.
log
(
targetItem
)
var
proSelectedIds
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
goodsCode
)
this
.
getGoodsList
(
this
.
formData
.
yqMerchantId
).
then
(
res
=>
{
proSelectedIds
.
push
(
this
.
formData
[
item
.
relateAttr
])
var
proSelectedIds
=
this
.
formData
.
upgradeGoods
.
map
(
item
=>
item
.
goodsCode
)
this
.
proList
.
forEach
(
item
=>
{
proSelectedIds
.
push
(
this
.
formData
[
item
.
relateAttr
])
if
(
proSelectedIds
.
includes
(
item
.
goodsCode
)
&&
(
item
.
goodsCode
!==
targetItem
.
goodsCode
))
{
this
.
proList
.
forEach
(
item
=>
{
item
.
disabled
=
true
if
(
proSelectedIds
.
includes
(
item
.
goodsCode
)
&&
(
item
.
goodsCode
!==
targetItem
.
goodsCode
))
{
}
else
{
item
.
disabled
=
true
item
.
disabled
=
false
}
else
{
}
item
.
disabled
=
false
}
})
this
.
proIndex
=
targetIndex
this
.
originProInfo
=
targetItem
this
.
relateProVisible
=
true
})
})
this
.
proIndex
=
targetIndex
this
.
originProInfo
=
targetItem
this
.
relateProVisible
=
true
},
},
judgeIsDisable
()
{
judgeIsDisable
()
{
// console.log(this.markTarget)
// console.log(this.markTarget)
if
(
this
.
addOrEdit
===
'add'
)
{
if
(
this
.
addOrEdit
===
'add'
)
{
this
.
formList
[
0
].
formBlock
[
0
].
isDisabled
=
this
.
formData
[
this
.
markTarget
.
name
].
length
this
.
formList
[
0
].
formBlock
[
0
].
isDisabled
=
this
.
formData
[
this
.
markTarget
.
name
].
length
this
.
merchantDisable
=
this
.
formData
[
this
.
markTarget
.
name
].
length
}
}
},
},
handleRelateProConfirm
(
proInfo
)
{
handleRelateProConfirm
(
proInfo
)
{
...
@@ -775,8 +791,14 @@ export default {
...
@@ -775,8 +791,14 @@ export default {
this
.
imageUrl
=
src
this
.
imageUrl
=
src
},
},
// 服务门店更改
// 服务门店更改
handleMerchantChange
()
{
handleMerchantChange
(
value
)
{
this
.
formData
.
linkMerchantIds
=
[]
// console.log(value)
if
(
this
.
formName
===
'commodity'
)
{
this
.
$emit
(
'ydMerchantChange'
,
value
)
this
.
formData
.
goodsCode
=
''
this
.
formData
.
upgradeGoods
=
[]
this
.
formData
.
linkMerchantIds
=
[]
}
},
},
// 验证分账比例
// 验证分账比例
handleProfitInput
(
value
,
index
)
{
handleProfitInput
(
value
,
index
)
{
...
...
src/views/goods/commodity.vue
View file @
7c231a9
...
@@ -179,7 +179,6 @@ export default {
...
@@ -179,7 +179,6 @@ export default {
0
:
'已下架'
,
0
:
'已下架'
,
1
:
'上架'
1
:
'上架'
}[
cellValue
.
status
]
}[
cellValue
.
status
]
// return '上架'
}
}
},
{
},
{
label
:
'创建时间'
,
label
:
'创建时间'
,
...
...
src/views/goods/editCommodity.vue
View file @
7c231a9
...
@@ -7,11 +7,13 @@
...
@@ -7,11 +7,13 @@
ref=
"d2Form"
ref=
"d2Form"
:formItemWidth=
"formItemWidth"
:formItemWidth=
"formItemWidth"
:storeApi=
"commodityAddSeviceMerchant"
:storeApi=
"commodityAddSeviceMerchant"
formName=
"commodity"
:rules=
"rules"
:rules=
"rules"
:addOrEdit=
"addOrEdit"
:addOrEdit=
"addOrEdit"
:originData=
"editData"
:originData=
"editData"
:formList=
"editForm"
:formList=
"editForm"
:formRef=
"comFormRef"
:formRef=
"comFormRef"
@
ydMerchantChange=
"getGoodsList"
@
handleAddConfirm=
"handleAddConfirm"
@
handleAddConfirm=
"handleAddConfirm"
@
handleClose=
"handleAddClose"
@
handleClose=
"handleAddClose"
></d2-form>
></d2-form>
...
@@ -57,112 +59,129 @@ export default {
...
@@ -57,112 +59,129 @@ export default {
// attr: 'thumbUrl'
// attr: 'thumbUrl'
// },
// },
comFormRef
:
'com'
,
comFormRef
:
'com'
,
editForm
:
[{
editForm
:
[
title
:
'基础商品信息'
,
// {
width
:
'50%'
,
// title: '',
headImg
:
{
// formBlock: [{
attr
:
'thumbUrl'
// name: 'yqMerchantId',
// label: '园区店',
// isRequired: true,
// type: 'select',
// isHide: true,
// // tips: '选择基础商品',
// isClear: false,
// optionList: [],
// isDisabled: true,
// optionId: 'merchantId',
// optionLabel: 'merchantName'
// }]
// },
{
title
:
'基础商品信息'
,
width
:
'50%'
,
headImg
:
{
attr
:
'thumbUrl'
},
formBlock
:
[{
name
:
'goodsCode'
,
label
:
'产品名称'
,
isRequired
:
true
,
type
:
'select'
,
// tips: '选择基础商品',
isClear
:
false
,
optionList
:
[],
isDisabled
:
true
,
optionId
:
'goodsCode'
,
optionLabel
:
'goodsName'
},
{
name
:
'goodsTypeName'
,
label
:
'分类'
,
type
:
'input'
,
isDisabled
:
true
},
{
name
:
''
,
label
:
''
,
type
:
'span'
},
{
name
:
'sapCode'
,
label
:
'编号'
,
type
:
'input'
,
isDisabled
:
true
},
{
name
:
'shopPrice'
,
label
:
'到店价格'
,
type
:
'input'
,
unit
:
'元'
,
// tips: '(商品最终交易价格)',
handleInput
:
(
newVal
)
=>
{
this
.
$refs
.
d2Form
.
formData
.
shopPrice
=
limitPrice
(
newVal
,
this
.
markOldVal
.
shopPrice
,
6
,
2
)
this
.
markOldVal
.
shopPrice
=
this
.
$refs
.
d2Form
.
formData
.
shopPrice
}
},
{
name
:
'retailPrice'
,
label
:
'零售价格'
,
type
:
'input'
,
unit
:
'元'
,
// tips: '(前端展示给车主)',
handleInput
:
(
newVal
)
=>
{
this
.
$refs
.
d2Form
.
formData
.
retailPrice
=
limitPrice
(
newVal
,
this
.
markOldVal
.
retailPrice
,
6
,
2
)
this
.
markOldVal
.
retailPrice
=
this
.
$refs
.
d2Form
.
formData
.
retailPrice
}
}]
},
},
formBlock
:
[{
// {
name
:
'goodsCode'
,
// title: '价格信息',
label
:
'产品名称'
,
// formBlock: [{
isRequired
:
true
,
// name: 'retailPrice',
type
:
'select'
,
// label: '商品零售价',
// tips: '选择基础商品',
// type: 'input',
isClear
:
false
,
// unit: '元',
optionList
:
[],
// tips: '(前端展示给车主)',
isDisabled
:
true
,
// handleInput: (newVal) => {
optionId
:
'goodsCode'
,
// this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
optionLabel
:
'goodsName'
// this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
// }
// }, {
// name: 'shopPrice',
// label: '到店价',
// type: 'input',
// unit: '元',
// tips: '(商品最终交易价格)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
// this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
// }
// }, {
// name: 'maxRetailDiscount',
// label: '到店零售折扣',
// type: 'input',
// unit: '折',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.maxRetailDiscount = limitPrice(newVal, this.markOldVal.maxRetailDiscount, 1, 1, 1)
// this.markOldVal.maxRetailDiscount = this.$refs.d2Form.formData.maxRetailDiscount
// }
// }]
// },
{
title
:
'绑定升级商品'
,
formBlock
:
[{
name
:
'upgradeGoods'
,
label
:
''
,
type
:
'relatePro'
,
optionValue
:
'goodsCode'
,
relateAttr
:
'goodsCode'
}]
},
{
},
{
name
:
'goodsTypeName'
,
title
:
'分配可见门店'
,
label
:
'分类'
,
formBlock
:
[{
type
:
'input'
,
name
:
'linkMerchantIds'
,
isDisabled
:
true
label
:
''
,
},
{
btnTxt
:
'添加绑定'
,
name
:
''
,
type
:
'button'
,
label
:
''
,
handleName
:
'relateStore'
,
type
:
'span'
optionValue
:
'merchantId'
},
{
}]
name
:
'sapCode'
,
label
:
'编号'
,
type
:
'input'
,
isDisabled
:
true
},
{
name
:
'shopPrice'
,
label
:
'到店价格'
,
type
:
'input'
,
unit
:
'元'
,
// tips: '(商品最终交易价格)',
handleInput
:
(
newVal
)
=>
{
this
.
$refs
.
d2Form
.
formData
.
shopPrice
=
limitPrice
(
newVal
,
this
.
markOldVal
.
shopPrice
,
6
,
2
)
this
.
markOldVal
.
shopPrice
=
this
.
$refs
.
d2Form
.
formData
.
shopPrice
}
},
{
name
:
'retailPrice'
,
label
:
'零售价格'
,
type
:
'input'
,
unit
:
'元'
,
// tips: '(前端展示给车主)',
handleInput
:
(
newVal
)
=>
{
this
.
$refs
.
d2Form
.
formData
.
retailPrice
=
limitPrice
(
newVal
,
this
.
markOldVal
.
retailPrice
,
6
,
2
)
this
.
markOldVal
.
retailPrice
=
this
.
$refs
.
d2Form
.
formData
.
retailPrice
}
}]
},
// {
// title: '价格信息',
// formBlock: [{
// name: 'retailPrice',
// label: '商品零售价',
// type: 'input',
// unit: '元',
// tips: '(前端展示给车主)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
// this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
// }
// }, {
// name: 'shopPrice',
// label: '到店价',
// type: 'input',
// unit: '元',
// tips: '(商品最终交易价格)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
// this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
// }
// }, {
// name: 'maxRetailDiscount',
// label: '到店零售折扣',
// type: 'input',
// unit: '折',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.maxRetailDiscount = limitPrice(newVal, this.markOldVal.maxRetailDiscount, 1, 1, 1)
// this.markOldVal.maxRetailDiscount = this.$refs.d2Form.formData.maxRetailDiscount
// }
// }]
// },
{
title
:
'绑定升级商品'
,
formBlock
:
[{
name
:
'upgradeGoods'
,
label
:
''
,
type
:
'relatePro'
,
optionValue
:
'goodsCode'
,
relateAttr
:
'goodsCode'
}]
},
{
title
:
'分配可见门店'
,
formBlock
:
[{
name
:
'linkMerchantIds'
,
label
:
''
,
btnTxt
:
'添加绑定'
,
type
:
'button'
,
handleName
:
'relateStore'
,
optionValue
:
'merchantId'
}]
}]
}]
}
}
},
},
...
@@ -172,11 +191,15 @@ export default {
...
@@ -172,11 +191,15 @@ export default {
// console.log(this.editData)
// console.log(this.editData)
// add - 新增;edit - 编辑
// add - 新增;edit - 编辑
this
.
addOrEdit
=
this
.
$route
.
params
.
addOrEdit
this
.
addOrEdit
=
this
.
$route
.
params
.
addOrEdit
this
.
getGoodsList
()
// !this.userInfo.beSuper && (this.editForm.splice(0, 1)) && this.getGoodsList(this.userInfo.detail.merchantId)
!
this
.
userInfo
.
beSuper
&&
this
.
getGoodsList
(
this
.
userInfo
.
detail
.
merchantId
)
console
.
log
(
this
.
editForm
)
if
(
this
.
addOrEdit
===
'edit'
)
{
if
(
this
.
addOrEdit
===
'edit'
)
{
getGoodsInfoById
({
id
:
this
.
$route
.
params
.
row
.
id
}).
then
(
res
=>
{
getGoodsInfoById
({
id
:
this
.
$route
.
params
.
row
.
id
}).
then
(
res
=>
{
// console.log(res)
// console.log(res)
this
.
editForm
[
0
].
formBlock
[
0
].
isDisabled
=
true
var
tempIndex
=
this
.
editForm
.
findIndex
(
i
=>
i
.
title
===
'基础商品信息'
)
console
.
log
(
tempIndex
)
this
.
editForm
[
tempIndex
].
formBlock
[
0
].
isDisabled
=
true
this
.
editData
=
{
this
.
editData
=
{
yqMerchantId
:
this
.
userInfo
.
beSuper
?
''
:
this
.
userInfo
.
detail
.
merchantId
,
yqMerchantId
:
this
.
userInfo
.
beSuper
?
''
:
this
.
userInfo
.
detail
.
merchantId
,
id
:
res
.
id
,
id
:
res
.
id
,
...
@@ -215,9 +238,9 @@ export default {
...
@@ -215,9 +238,9 @@ export default {
methods
:
{
methods
:
{
...
mapActions
({
close
:
'd2admin/page/close'
}),
...
mapActions
({
close
:
'd2admin/page/close'
}),
// ...mapActions('d2admin/page', ['close']),
// ...mapActions('d2admin/page', ['close']),
getGoodsList
()
{
getGoodsList
(
merchantId
)
{
// var params = this.addOrEdit === 'edit' ? {} : { exceptBase: true }
// var params = this.addOrEdit === 'edit' ? {} : { exceptBase: true }
getGoodsList
({}).
then
(
res
=>
{
getGoodsList
({
yqMerchantId
:
merchantId
}).
then
(
res
=>
{
// console.log(res)
// console.log(res)
this
.
editForm
[
0
].
formBlock
[
0
].
optionList
=
res
this
.
editForm
[
0
].
formBlock
[
0
].
optionList
=
res
})
})
...
...
src/views/goods/editProduct.vue
View file @
7c231a9
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
ref=
"d2ProductForm"
ref=
"d2ProductForm"
:formItemWidth=
"formItemWidth"
:formItemWidth=
"formItemWidth"
:rules=
"rules"
:rules=
"rules"
addOrEdit=
"add"
:addOrEdit=
"addOrEdit"
formName=
"product"
:originData=
"editData"
:originData=
"editData"
:formList=
"editForm"
:formList=
"editForm"
:formRef=
"proFormRef"
:formRef=
"proFormRef"
...
@@ -56,58 +57,60 @@ export default {
...
@@ -56,58 +57,60 @@ export default {
proFormRef
:
'pro'
,
proFormRef
:
'pro'
,
editForm
:
[{
editForm
:
[{
title
:
'素材基本信息'
,
title
:
'素材基本信息'
,
formBlock
:
[{
formBlock
:
[
name
:
'yqMerchantId'
,
// {
label
:
'园区店'
,
// name: 'yqMerchantId',
type
:
'select'
// label: '园区店',
},
{
// type: 'select'
name
:
'goodsName'
,
// },
label
:
'素材名称'
,
{
type
:
'input'
,
name
:
'goodsName'
,
maxlength
:
32
label
:
'素材名称'
,
},
{
type
:
'input'
,
name
:
'goodsType'
,
maxlength
:
32
label
:
'分类'
,
},
{
isRequired
:
true
,
name
:
'goodsType'
,
type
:
'select'
,
label
:
'分类'
,
// tips: '选择产品分类',
isRequired
:
true
,
isClear
:
false
,
type
:
'select'
,
optionList
:
[],
// tips: '选择产品分类',
optionId
:
'goodsType'
,
isClear
:
false
,
optionLabel
:
'goodsTypeName'
optionList
:
[],
},
{
optionId
:
'goodsType'
,
name
:
'sapCode'
,
optionLabel
:
'goodsTypeName'
label
:
'编号'
,
},
{
type
:
'input'
,
name
:
'sapCode'
,
maxlength
:
32
label
:
'编号'
,
},
{
type
:
'input'
,
name
:
'brandMerchantCode'
,
maxlength
:
32
label
:
'品牌商'
,
},
{
isRequired
:
true
,
name
:
'brandMerchantCode'
,
type
:
'select'
,
label
:
'品牌商'
,
// tips: '选择品牌商',
isRequired
:
true
,
isClear
:
true
,
type
:
'select'
,
optionList
:
[],
// tips: '选择品牌商',
optionId
:
'confId'
,
isClear
:
true
,
optionLabel
:
'confValue'
optionList
:
[],
},
{
optionId
:
'confId'
,
name
:
'thumbUrlList'
,
optionLabel
:
'confValue'
label
:
'缩略图'
,
},
{
type
:
'photo'
,
name
:
'thumbUrlList'
,
tips
:
[
'注:用于小程序主页商品列表配图展示'
,
'请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'
],
label
:
'缩略图'
,
maxPhotoNum
:
1
type
:
'photo'
,
},
{
tips
:
[
'注:用于小程序主页商品列表配图展示'
,
'请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'
],
name
:
'goodsImgList'
,
maxPhotoNum
:
1
label
:
'产品主图'
,
},
{
type
:
'photo'
,
name
:
'goodsImgList'
,
tips
:
[
'注:用于在小程序商品详情页的顶部展示'
,
'请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'
],
label
:
'产品主图'
,
maxPhotoNum
:
10
type
:
'photo'
,
},
{
tips
:
[
'注:用于在小程序商品详情页的顶部展示'
,
'请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'
],
name
:
'goodsDescList'
,
maxPhotoNum
:
10
label
:
'详情描述'
,
},
{
type
:
'descList'
,
name
:
'goodsDescList'
,
maxlength
:
256
label
:
'详情描述'
,
}]
type
:
'descList'
,
maxlength
:
256
}]
}],
}],
baseData
:
{
baseData
:
{
productType
:
[]
productType
:
[]
...
...
src/views/systemConfig/serviceStore.vue
View file @
7c231a9
...
@@ -53,19 +53,46 @@
...
@@ -53,19 +53,46 @@
@
handleRelateStoreClose=
"handleRelateStoreClose"
@
handleRelateStoreClose=
"handleRelateStoreClose"
>
>
<el-row
slot
>
<el-row
slot
>
<el-col
<el-form
class=
"service-search"
:model=
"storeSearchForm"
:span=
"6"
:rules=
"rules"
ref=
"relate"
>
>
<el-select
v-model=
"storeSearchForm.channelType"
>
<el-col>
<el-option
<el-form-item
v-for=
"item in baseData.channelType"
id=
"yqMerchantId"
:key=
"item.value"
label=
"园区店:"
:label=
"item.name"
prop=
"yqMerchantId"
:value=
"item.value"
v-show=
"userInfo.beSuper"
></el-option>
>
</el-select>
<el-select
</el-col>
v-model=
"storeSearchForm.yqMerchantId"
placeholder=
"请选择"
class=
"el_select itd"
>
<el-option
v-for=
"x in parkServiceList"
:key=
"x.merchantId"
:value=
"x.merchantId"
:label=
"x.merchantName"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
class=
"service-search"
:span=
"6"
>
<el-select
v-model=
"storeSearchForm.channelType"
>
<el-option
v-for=
"item in baseData.channelType"
:key=
"item.value"
:label=
"item.name"
:value=
"item.value"
></el-option>
</el-select>
</el-col>
</el-form>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-input
<el-input
v-model=
"storeSearchForm.merchantIdName"
v-model=
"storeSearchForm.merchantIdName"
...
@@ -84,6 +111,7 @@
...
@@ -84,6 +111,7 @@
<
script
>
<
script
>
import
{
Util
}
from
'@/common/util'
import
{
Util
}
from
'@/common/util'
import
{
getParkStore
}
from
'@api/editCustomer'
import
{
getList
,
deleteMerchant
,
serviceGetMerchantList
,
addServiceMerchant
}
from
'@api/serviceStore'
import
{
getList
,
deleteMerchant
,
serviceGetMerchantList
,
addServiceMerchant
}
from
'@api/serviceStore'
import
{
mapActions
}
from
'vuex'
import
{
mapActions
}
from
'vuex'
import
{
BaseData
,
userType
,
ghUserType
}
from
'@/common/constants.js'
import
{
BaseData
,
userType
,
ghUserType
}
from
'@/common/constants.js'
...
@@ -91,9 +119,13 @@ export default {
...
@@ -91,9 +119,13 @@ export default {
name
:
'serviceStore'
,
name
:
'serviceStore'
,
data
()
{
data
()
{
return
{
return
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
searchForm
:
{
searchForm
:
{
merchantName
:
''
merchantName
:
''
},
},
rules
:
{
yqMerchantId
:
[{
required
:
true
,
message
:
'请选择园区店'
,
trigger
:
'change'
}]
},
showFormData
:
[{
showFormData
:
[{
label
:
'商户名称'
,
label
:
'商户名称'
,
name
:
'merchantName'
,
name
:
'merchantName'
,
...
@@ -177,7 +209,14 @@ export default {
...
@@ -177,7 +209,14 @@ export default {
this
.
getBaseData
()
this
.
getBaseData
()
},
},
mounted
()
{
},
mounted
()
{
// if (this.userInfo.beSuper) {
!
this
.
userInfo
.
beSuper
&&
(
this
.
storeSearchForm
.
yqMerchantId
=
this
.
userInfo
.
detail
.
merchantId
)
getParkStore
({}).
then
(
res
=>
{
this
.
parkServiceList
=
res
})
// }
},
methods
:
{
methods
:
{
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
...
@@ -187,6 +226,7 @@ export default {
...
@@ -187,6 +226,7 @@ export default {
resolve
()
resolve
()
})
})
},
},
async
getBaseData
()
{
async
getBaseData
()
{
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
channelType
)
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
channelType
)
},
},
...
@@ -208,24 +248,34 @@ export default {
...
@@ -208,24 +248,34 @@ export default {
},
},
handleRelateStoreConfirm
(
selectedData
)
{
handleRelateStoreConfirm
(
selectedData
)
{
// console.log(selectedData)
// console.log(selectedData)
if
(
!
selectedData
.
length
)
{
this
.
$refs
.
relate
.
validate
(
valid
=>
{
// this.notice.warningTips('请选择关联门店')
console
.
log
(
valid
)
this
.
$message
({
if
(
valid
)
{
message
:
'请选择关联门店'
,
if
(
!
selectedData
.
length
)
{
type
:
'warning'
,
// this.notice.warningTips('请选择关联门店')
showClose
:
true
this
.
$message
({
})
message
:
'请选择关联门店'
,
return
true
type
:
'warning'
,
}
showClose
:
true
if
(
selectedData
.
length
>
this
.
maxLength
)
{
})
this
.
$message
.
error
(
`一次只能选择
${
this
.
maxLength
}
个门店`
)
return
true
return
true
}
}
if
(
selectedData
.
length
>
this
.
maxLength
)
{
addServiceMerchant
({
list
:
selectedData
}).
then
(
res
=>
{
this
.
$message
.
error
(
`一次只能选择
${
this
.
maxLength
}
个门店`
)
this
.
relateStoreVisible
=
false
return
true
this
.
$refs
.
serviceStoreTable
.
refreshTable
()
}
this
.
notice
.
okTips
()
var
merchantName
=
this
.
parkServiceList
.
find
(
item
=>
item
.
merchantId
===
this
.
storeSearchForm
.
yqMerchantId
).
merchantName
this
.
relateCloseReset
()
selectedData
.
forEach
(
item
=>
{
item
.
yqMerchantId
=
this
.
storeSearchForm
.
yqMerchantId
item
.
yqMerchantName
=
merchantName
})
addServiceMerchant
({
list
:
selectedData
}).
then
(
res
=>
{
this
.
relateStoreVisible
=
false
this
.
$refs
.
serviceStoreTable
.
refreshTable
()
this
.
notice
.
okTips
()
this
.
relateCloseReset
()
})
}
})
})
},
},
handleRelateStoreClose
()
{
handleRelateStoreClose
()
{
...
@@ -235,6 +285,10 @@ export default {
...
@@ -235,6 +285,10 @@ export default {
handleSearchStore
()
{
handleSearchStore
()
{
this
.
$refs
.
relateStore
.
getSelectingList
()
this
.
$refs
.
relateStore
.
getSelectingList
()
},
},
// handleMerchantChange(value) {
// this.storeSearchForm.yqMerchantId = value
// this.$refs.relateStore.getSelectingList()
// },
handleDelete
(
row
)
{
handleDelete
(
row
)
{
// console.log(row)
// console.log(row)
this
.
$confirm
(
'是否要进行删除操作?'
,
'提示'
,
{
this
.
$confirm
(
'是否要进行删除操作?'
,
'提示'
,
{
...
...
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