Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 500e4fd9
authored
Mar 18, 2022
by
wuwx
Committed by
杨北旺
Mar 19, 2022
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
弹窗
1 parent
954b834b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
874 additions
and
13 deletions
src/api/modules/sop.js
src/views/sop/editSop/components/materialModel.vue
src/views/sop/editSop/components/nicknameModel.vue
src/views/sop/editSop/editEvent.vue
src/api/modules/sop.js
View file @
500e4fd
...
...
@@ -147,4 +147,26 @@ const getSopInfoDetailApi = params => {
})
}
export
default
{
getCustomerByTagListApi
,
getSopInfoListApi
,
getSopBaseInfoApi
,
getEventListApi
,
getSopCustomerStatisticsListApi
,
getSopStaffTaskListApi
,
parseEventCountApi
,
deleteSopEventApi
,
endSopEventApi
,
batchEditSopEventApi
,
insertOrUpdateSopApi
,
getSopInfoDetailApi
}
// 获取素材组列表
const
getGroupListApi
=
params
=>
{
params
.
method
=
'marketing.api.material.group.list'
return
http
({
url
:
'rop-scrm-marketing/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 获取素材列表
const
getMaterialListApi
=
params
=>
{
params
.
method
=
'marketing.api.material.page'
return
http
({
url
:
'rop-scrm-marketing/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getCustomerByTagListApi
,
getSopInfoListApi
,
getSopBaseInfoApi
,
getEventListApi
,
getSopCustomerStatisticsListApi
,
getSopStaffTaskListApi
,
parseEventCountApi
,
deleteSopEventApi
,
endSopEventApi
,
batchEditSopEventApi
,
insertOrUpdateSopApi
,
getSopInfoDetailApi
,
getGroupListApi
,
getMaterialListApi
}
src/views/sop/editSop/components/materialModel.vue
0 → 100644
View file @
500e4fd
<!-- 素材弹窗 -->
<
template
>
<glsx-dialog
title=
"选择素材"
:isVisible
.
sync=
"isMaterialVisible"
width=
"70%"
@
confirmDialog=
"handleMaterialConfirm"
@
closeDialog=
"handleMaterialClose"
class=
"relateStore"
>
<glsx-combi-form
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData"
>
<span
slot=
"footer"
>
<el-button
:size=
"size"
type=
"default"
@
click=
"handleReset"
>
重置
</el-button>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</span>
</glsx-combi-form>
<div
class=
"model-panel"
>
<!--
<div
class=
"model-panel-tab"
>
<label>
活动类型:
</label>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
type=
"card"
>
<el-tab-pane
label=
"单图文"
name=
"3"
></el-tab-pane>
<el-tab-pane
label=
"多图文"
name=
"4"
></el-tab-pane>
<el-tab-pane
label=
"文字+视频"
name=
"2"
></el-tab-pane>
<el-tab-pane
label=
"文字"
name=
"5"
></el-tab-pane>
</el-tabs>
</div>
-->
<div
class=
"model-item-panel"
v-if=
"modelList.length > 0"
v-loading=
"loading"
>
<div
class=
"model-item"
:class=
"
{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<img
:src=
"item.groupName"
/>
<!--
<div
class=
"model-item-title"
:title=
"item.equityName"
v-show=
"activeName == 3"
>
{{
item
.
equityName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.couponName"
v-show=
"activeName == 2"
>
{{
item
.
couponName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.couponName"
v-show=
"activeName == 6"
>
{{
item
.
equityName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.packageName"
v-show=
"activeName == 4"
>
{{
item
.
packageName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.activityName"
v-show=
"activeName == 5"
>
{{
item
.
activityName
}}
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 3"
>
领取方式:免费领用
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 4"
>
领取方式:付费购买
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 6"
>
有效期:
{{
item
.
effectiveDays
}}
天
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 3"
>
有效期:无限制
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 2"
>
有效期:
{{
item
.
effectiveStartTime
?
item
.
effectiveStartTime
.
split
(
' '
)[
0
]
:
''
}}
~
{{
item
.
effectiveEndTime
?
item
.
effectiveEndTime
.
split
(
' '
)[
0
]
:
''
}}
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 6"
>
获取方式:需先购买无忧服务套餐
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 6"
>
获取限制:每个服务套餐限领一次
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 3"
></div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 3"
>
试用天数:
<span>
{{
item
.
freeDay
}}
天
</span>
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2"
>
使用途径:
{{
item
.
useChannel
==
1
?
'线上商品'
:
'到店核销'
}}
</div>
<div
class=
"model-item-content model-item-weight"
v-show=
"activeName == 6"
>
赠送天数:
<span>
{{
item
.
effectiveType
==
2
?
item
.
effectivedDay
+
'天'
:
'永久有效'
}}
</span>
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 4 || activeName == 5"
></div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 4"
>
销售价格:
<span>
{{
item
.
packagePrice
}}
元
</span>
</div>
<div
class=
"model-item-content"
v-if=
"activeName == 5"
>
开始时间:
{{
item
.
startTime
}}
</div>
<div
class=
"model-item-content"
v-if=
"activeName == 5"
>
结束时间:
{{
item
.
endTime
}}
</div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 2"
>
数量:
<span>
{{
item
.
residueAmount
}}
</span>
</div>
-->
</div>
</div>
<div
class=
"model-item-empty"
v-else
v-loading=
"loading"
>
<img
src=
"@/assets/empty.png"
/>
<div
class=
"empty-item"
>
暂无数据
</div>
</div>
<el-pagination
v-if=
"activeName != 3"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[12, 24, 36, 48]"
:page-size=
"pageSize"
:total=
"tableTotal"
layout=
"total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
</glsx-dialog>
</
template
>
<
script
>
import
glsxDialog
from
'@/components/glsx-dialog'
export
default
{
name
:
'materialModel'
,
data
()
{
return
{
searchForm
:
{
groupId
:
''
,
businessType
:
''
},
searchFormData
:
[
{
label
:
'素材分组'
,
name
:
'groupId'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'id'
,
optionLabel
:
'materialGroupName'
,
optionsName
:
'groupList'
},
{
label
:
'素材类型'
,
name
:
'businessType'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'confId'
,
optionLabel
:
'confName'
,
optionsName
:
'businessTypeList'
}
],
// selectedData: [],
// selectingData: [],
// needTip: ['editProduct'],
modelList
:
[],
selectItem
:
{
id
:
''
},
// 分页
pageNum
:
1
,
pageSize
:
12
,
tableTotal
:
0
,
baseData
:
{
groupList
:
[],
businessTypeList
:
[
{
confId
:
1
,
confName
:
'PDF'
},
{
confId
:
2
,
confName
:
'自定义链接'
},
{
confId
:
3
,
confName
:
'图文'
}
]
}
}
},
props
:
{
isMaterialVisible
:
{
type
:
Boolean
,
default
:
false
}
// storeApi: {
// type: Function,
// default: () => {}
// },
// storeSelected: {
// type: Array,
// default: () => []
// }
// storeSearchForm: {
// type: Object,
// default: () => {}
// }
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components
:
{
glsxDialog
},
created
()
{
this
.
getBaseData
()
},
mounted
()
{
// this.selectedData = this.storeSelected
// this.selectedData.forEach(item => {
// item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo
// })
// this.getSelectingList()
this
.
getList
()
},
methods
:
{
getBaseData
()
{
this
.
$apis
.
sop
.
getGroupListApi
({}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
baseData
.
groupList
=
res
this
.
getOptionsList
(
'searchFormData'
)
})
},
getList
()
{
var
params
=
{
...
this
.
searchForm
,
pageNum
:
this
.
pageNum
,
pageSize
:
this
.
pageSize
}
this
.
$apis
.
sop
.
getMaterialListApi
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
modelList
=
res
.
data
this
.
tableTotal
=
res
.
count
})
},
getOptionsList
(
formName
,
hasAll
=
true
,
refreshSigle
)
{
if
(
refreshSigle
)
{
var
item
=
this
[
formName
].
find
(
k
=>
k
.
name
==
refreshSigle
)
var
index
=
this
[
formName
].
findIndex
(
k
=>
k
.
name
==
refreshSigle
)
this
.
$set
(
this
[
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
[
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
[
formName
][
index
].
optionId
]
=
''
temp
[
this
[
formName
][
index
].
optionLabel
]
=
'全部'
this
[
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
else
{
this
[
formName
].
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
'select'
&&
this
.
baseData
[
item
.
optionsName
].
length
)
{
this
.
$set
(
this
[
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
[
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
[
formName
][
index
].
optionId
]
=
''
temp
[
this
[
formName
][
index
].
optionLabel
]
=
'全部'
this
[
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
})
}
},
// selectable(row, index) {
// var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// return isSelect
// },
// recoverySelection() {
// var exitIds = this.selectedData.map(item => item.merchantNo + '')
// this.selectingData.forEach(item => {
// if (exitIds.includes(item.merchantNo + '')) {
// this.$refs.seletingTable.toggleRowSelection(item, true)
// } else {
// this.$refs.seletingTable.toggleRowSelection(item, false)
// }
// })
// },
// getSelectingList() {
// this.storeApi({
// ...this.storeSearchForm,
// pageNum: this.pageNum,
// currentPage: this.pageNum,
// pageSize: this.pageSize
// }).then(res => {
// this.selectingData = res.list
// this.total = res.total
// this.$nextTick(() => {
// this.recoverySelection()
// })
// })
// },
// handleChange(selection, row) {
// var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
// addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
// },
// handleAll(selection) {
// this.selectingData.forEach(item => {
// var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
// if (selection.length && isExit === -1 && !isServed) {
// this.selectedData.push(item)
// } else if (!selection.length && isExit !== -1) {
// this.selectedData.splice(isExit, 1)
// }
// })
// },
// handleDelete(row) {
// this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
// this.recoverySelection()
// },
handleCurrentChange
(
val
)
{
this
.
pageNum
=
val
// this.getSelectingList()
},
handleMaterialConfirm
()
{
this
.
$emit
(
'handleMaterialConfirm'
,
this
.
selectedData
)
},
handleMaterialClose
()
{
this
.
$emit
(
'handleMaterialClose'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.model-panel
{
.model-panel-tab
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
18px
;
label
{
font-size
:
16px
;
font-weight
:
400
;
color
:
#000000
;
line-height
:
24px
;
}
/
deep
/
{
.
el-checkbox
:
last-of-type
{
margin-right
:
8px
;
}
.el-tabs__nav
{
border
:
0
;
}
.el-tabs__header
{
border
:
0
;
background-color
:
#f4f6fc
;
margin
:
0px
;
}
.el-tabs__item
{
border
:
none
;
width
:
180px
;
height
:
32px
;
line-height
:
32px
;
margin
:
2px
;
text-align
:
center
;
}
.el-tabs__item.is-active
{
background-color
:
#fff
;
border-radius
:
4px
;
font-weight
:
600
;
}
}
}
.model-item-empty
{
>
img
{
display
:
block
;
margin
:
50px
auto
0px
;
width
:
60px
;
height
:
auto
;
}
.empty-item
{
text-align
:
center
;
font-size
:
14px
;
font-weight
:
400
;
color
:
#000000
;
line-height
:
22px
;
margin-bottom
:
30px
;
}
}
.model-item-panel
{
//
display
:
grid
;
//
grid-template-columns
:
repeat
(
4
,
25%
);
//
grid-row-gap
:
10px
;
max-height
:
38vh
;
overflow
:
auto
;
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
stretch
;
flex-direction
:
row
;
.model-item
{
width
:
240px
;
margin-right
:
24px
;
margin-bottom
:
24px
;
padding
:
12px
16px
;
position
:
relative
;
height
:
128px
;
background
:
#ffffff
;
border-radius
:
4px
;
border
:
1px
solid
#e6e6e6
;
padding
:
14px
24px
;
box-sizing
:
border-box
;
&:nth-child(4n)
{
margin-right
:
0px
;
}
&
.checked
{
background
:
rgba
(
88
,
80
,
255
,
0.1
);
border
:
1px
solid
#5850ff
;
}
&
-qrcode
{
position
:
absolute
;
right
:
10px
;
bottom
:
10px
;
width
:
60px
;
height
:
60px
;
border
:
1px
solid
#979797
;
}
&
-title
{
font-size
:
18px
;
font-weight
:
600
;
color
:
#333333
;
line-height
:
25px
;
margin-bottom
:
5px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
}
&
-content
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
16px
;
height
:
16px
;
margin-top
:
6px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
&.model-item-weight
{
line-height
:
20px
;
height
:
20px
;
}
span
{
color
:
#5850ff
;
font-size
:
20px
;
}
}
&
-contents
{
line-height
:
22px
;
height
:
22px
;
}
}
}
}
</
style
>
src/views/sop/editSop/components/nicknameModel.vue
0 → 100644
View file @
500e4fd
<!-- 朋友圈模板弹窗 -->
<
template
>
<glsx-dialog
title=
"选择朋友圈模板"
:isVisible
.
sync=
"isNicknameVisible"
width=
"70%"
@
confirmDialog=
"handleNicknameConfirm"
@
closeDialog=
"handleNicknameClose"
class=
"relateStore"
>
<div
class=
"model-panel"
>
<div
class=
"model-panel-tab"
>
<label>
活动类型:
</label>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
type=
"card"
>
<el-tab-pane
label=
"单图文"
name=
"3"
></el-tab-pane>
<el-tab-pane
label=
"多图文"
name=
"4"
></el-tab-pane>
<el-tab-pane
label=
"文字+视频"
name=
"2"
></el-tab-pane>
<el-tab-pane
label=
"文字"
name=
"5"
></el-tab-pane>
</el-tabs>
</div>
<div
class=
"model-item-panel"
v-if=
"modelList.length > 0"
v-loading=
"loading"
>
<div
class=
"model-item"
:class=
"
{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div
class=
"model-item-title"
:title=
"item.equityName"
v-show=
"activeName == 3"
>
{{
item
.
equityName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.couponName"
v-show=
"activeName == 2"
>
{{
item
.
couponName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.couponName"
v-show=
"activeName == 6"
>
{{
item
.
equityName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.packageName"
v-show=
"activeName == 4"
>
{{
item
.
packageName
}}
</div>
<div
class=
"model-item-title"
:title=
"item.activityName"
v-show=
"activeName == 5"
>
{{
item
.
activityName
}}
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 3"
>
领取方式:免费领用
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 4"
>
领取方式:付费购买
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 6"
>
有效期:
{{
item
.
effectiveDays
}}
天
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 3"
>
有效期:无限制
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2 && item.effectiveType == 2"
>
有效期:
{{
item
.
effectiveStartTime
?
item
.
effectiveStartTime
.
split
(
' '
)[
0
]
:
''
}}
~
{{
item
.
effectiveEndTime
?
item
.
effectiveEndTime
.
split
(
' '
)[
0
]
:
''
}}
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 6"
>
获取方式:需先购买无忧服务套餐
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 6"
>
获取限制:每个服务套餐限领一次
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 3"
></div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 3"
>
试用天数:
<span>
{{
item
.
freeDay
}}
天
</span>
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 2"
>
使用途径:
{{
item
.
useChannel
==
1
?
'线上商品'
:
'到店核销'
}}
</div>
<div
class=
"model-item-content model-item-weight"
v-show=
"activeName == 6"
>
赠送天数:
<span>
{{
item
.
effectiveType
==
2
?
item
.
effectivedDay
+
'天'
:
'永久有效'
}}
</span>
</div>
<div
class=
"model-item-content"
v-show=
"activeName == 4 || activeName == 5"
></div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 4"
>
销售价格:
<span>
{{
item
.
packagePrice
}}
元
</span>
</div>
<div
class=
"model-item-content"
v-if=
"activeName == 5"
>
开始时间:
{{
item
.
startTime
}}
</div>
<div
class=
"model-item-content"
v-if=
"activeName == 5"
>
结束时间:
{{
item
.
endTime
}}
</div>
<div
class=
"model-item-content model-item-contents"
v-show=
"activeName == 2"
>
数量:
<span>
{{
item
.
residueAmount
}}
</span>
</div>
</div>
</div>
<div
class=
"model-item-empty"
v-else
v-loading=
"loading"
>
<img
src=
"@/assets/empty.png"
/>
<div
class=
"empty-item"
>
暂无数据
</div>
</div>
<el-pagination
v-if=
"activeName != 3"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[12, 24, 36, 48]"
:page-size=
"pageSize"
:total=
"tableTotal"
layout=
"total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
</glsx-dialog>
</
template
>
<
script
>
import
glsxDialog
from
'@/components/glsx-dialog'
export
default
{
name
:
'nicknameModel'
,
data
()
{
return
{
// searchForm: {
// groupId: '',
// businessType: ''
// },
// searchFormData: [
// {
// label: '素材分组',
// name: 'groupId',
// type: 'select',
// optionList: [],
// optionId: 'id',
// optionLabel: 'NicknameGroupName',
// optionsName: 'groupList'
// },
// {
// label: '素材类型',
// name: 'businessType',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'businessTypeList'
// }
// ],
// selectedData: [],
// selectingData: [],
// needTip: ['editProduct'],
// 分页
total
:
0
,
pageNum
:
1
,
pageSize
:
20
,
baseData
:
{
groupList
:
[],
businessTypeList
:
[
{
confId
:
1
,
confName
:
'PDF'
},
{
confId
:
2
,
confName
:
'自定义链接'
},
{
confId
:
3
,
confName
:
'图文'
}
]
}
}
},
props
:
{
isNicknameVisible
:
{
type
:
Boolean
,
default
:
false
}
// storeApi: {
// type: Function,
// default: () => {}
// },
// storeSelected: {
// type: Array,
// default: () => []
// }
// storeSearchForm: {
// type: Object,
// default: () => {}
// }
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components
:
{
glsxDialog
},
created
()
{
this
.
getBaseData
()
},
mounted
()
{
// this.selectedData = this.storeSelected
// this.selectedData.forEach(item => {
// item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo
// })
// this.getSelectingList()
},
methods
:
{
getBaseData
()
{
this
.
$apis
.
sop
.
getGroupListApi
({}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
baseData
.
groupList
=
res
this
.
getOptionsList
(
'searchFormData'
)
})
},
getOptionsList
(
formName
,
hasAll
=
true
,
refreshSigle
)
{
if
(
refreshSigle
)
{
var
item
=
this
[
formName
].
find
(
k
=>
k
.
name
==
refreshSigle
)
var
index
=
this
[
formName
].
findIndex
(
k
=>
k
.
name
==
refreshSigle
)
this
.
$set
(
this
[
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
[
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
[
formName
][
index
].
optionId
]
=
''
temp
[
this
[
formName
][
index
].
optionLabel
]
=
'全部'
this
[
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
else
{
this
[
formName
].
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
'select'
&&
this
.
baseData
[
item
.
optionsName
].
length
)
{
this
.
$set
(
this
[
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
[
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
[
formName
][
index
].
optionId
]
=
''
temp
[
this
[
formName
][
index
].
optionLabel
]
=
'全部'
this
[
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
})
}
},
// selectable(row, index) {
// var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// return isSelect
// },
// recoverySelection() {
// var exitIds = this.selectedData.map(item => item.merchantNo + '')
// this.selectingData.forEach(item => {
// if (exitIds.includes(item.merchantNo + '')) {
// this.$refs.seletingTable.toggleRowSelection(item, true)
// } else {
// this.$refs.seletingTable.toggleRowSelection(item, false)
// }
// })
// },
// getSelectingList() {
// this.storeApi({
// ...this.storeSearchForm,
// pageNum: this.pageNum,
// currentPage: this.pageNum,
// pageSize: this.pageSize
// }).then(res => {
// this.selectingData = res.list
// this.total = res.total
// this.$nextTick(() => {
// this.recoverySelection()
// })
// })
// },
// handleChange(selection, row) {
// var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
// addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
// },
// handleAll(selection) {
// this.selectingData.forEach(item => {
// var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
// if (selection.length && isExit === -1 && !isServed) {
// this.selectedData.push(item)
// } else if (!selection.length && isExit !== -1) {
// this.selectedData.splice(isExit, 1)
// }
// })
// },
// handleDelete(row) {
// this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
// this.recoverySelection()
// },
handleCurrentChange
(
val
)
{
this
.
pageNum
=
val
// this.getSelectingList()
},
handleNicknameConfirm
()
{
this
.
$emit
(
'handleNicknameConfirm'
,
this
.
selectedData
)
},
handleNicknameClose
()
{
this
.
$emit
(
'handleNicknameClose'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.model-panel
{
.model-panel-tab
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
18px
;
label
{
font-size
:
16px
;
font-weight
:
400
;
color
:
#000000
;
line-height
:
24px
;
}
/
deep
/
{
.
el-checkbox
:
last-of-type
{
margin-right
:
8px
;
}
.el-tabs__nav
{
border
:
0
;
}
.el-tabs__header
{
border
:
0
;
background-color
:
#f4f6fc
;
margin
:
0px
;
}
.el-tabs__item
{
border
:
none
;
width
:
180px
;
height
:
32px
;
line-height
:
32px
;
margin
:
2px
;
text-align
:
center
;
}
.el-tabs__item.is-active
{
background-color
:
#fff
;
border-radius
:
4px
;
font-weight
:
600
;
}
}
}
.model-item-empty
{
>
img
{
display
:
block
;
margin
:
50px
auto
0px
;
width
:
60px
;
height
:
auto
;
}
.empty-item
{
text-align
:
center
;
font-size
:
14px
;
font-weight
:
400
;
color
:
#000000
;
line-height
:
22px
;
margin-bottom
:
30px
;
}
}
.model-item-panel
{
//
display
:
grid
;
//
grid-template-columns
:
repeat
(
4
,
25%
);
//
grid-row-gap
:
10px
;
max-height
:
38vh
;
overflow
:
auto
;
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
stretch
;
flex-direction
:
row
;
.model-item
{
width
:
240px
;
margin-right
:
24px
;
margin-bottom
:
24px
;
padding
:
12px
16px
;
position
:
relative
;
height
:
128px
;
background
:
#ffffff
;
border-radius
:
4px
;
border
:
1px
solid
#e6e6e6
;
padding
:
14px
24px
;
box-sizing
:
border-box
;
&:nth-child(4n)
{
margin-right
:
0px
;
}
&
.checked
{
background
:
rgba
(
88
,
80
,
255
,
0.1
);
border
:
1px
solid
#5850ff
;
}
&
-qrcode
{
position
:
absolute
;
right
:
10px
;
bottom
:
10px
;
width
:
60px
;
height
:
60px
;
border
:
1px
solid
#979797
;
}
&
-title
{
font-size
:
18px
;
font-weight
:
600
;
color
:
#333333
;
line-height
:
25px
;
margin-bottom
:
5px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
}
&
-content
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
16px
;
height
:
16px
;
margin-top
:
6px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
&.model-item-weight
{
line-height
:
20px
;
height
:
20px
;
}
span
{
color
:
#5850ff
;
font-size
:
20px
;
}
}
&
-contents
{
line-height
:
22px
;
height
:
22px
;
}
}
}
}
</
style
>
src/views/sop/editSop/editEvent.vue
View file @
500e4fd
...
...
@@ -45,16 +45,15 @@
<el-input
type=
"textarea"
:rows=
"9"
maxlength=
"280"
show-word-limit
v-model=
"editForm.eventContent"
@
input=
"textInput"
style=
"-webkit-user-modify: read-write-plaintext-only !important; width: 656px;"
placeholder=
"请输入营销文案"
></el-input>
<div
v-for=
"(itm, index) in previewList"
:key=
"itm.id"
>
<div
class=
"welcome-file"
v-if=
"itm.attType != 1"
>
<template
v-if=
"itm.attType == 2"
>
<
!--
<
template
v-if=
"itm.attType == 2"
>
<i
v-show=
"index == previewList.length - 1 && loading"
class=
"el-icon-loading"
></i>
<!--
<img
v-show=
"!loading"
src=
"@/assets/sop/icon-img.png"
alt
/>
-->
<span
:title=
"itm.attContent"
>
{{
itm
.
attContent
}}
</span>
</
template
>
</
template
>
-->
<!-- <template v-else-if="itm.attType == 3">
<img src="@/assets/sop/icon-img.png" alt />
<span :title="itm.attContent">{{ itm.attContent }}</span>
</template> -->
<
template
v-
else-
if=
"itm.attType == 7"
>
<
template
v-if=
"itm.attType == 7"
>
<img
src=
"@/assets/sop/icon-applet.png"
alt
/>
<span
:title=
"itm.attContent.objectName"
>
{{
itm
.
attContent
.
objectName
}}
</span>
</
template
>
...
...
@@ -73,7 +72,7 @@
<span>
{{ item.name }}
</span>
<!-- <input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" /> -->
<el-link
v-if=
"item.type == 'nickname' || item.type == 'activity' || item.type == 'coupon'"
style=
"opacity: 0"
@
click=
"handleFun(item.funName)"
>
{{ item.name }}
</el-link>
<el-link
style=
"opacity: 0"
@
click=
"handleFun(item.funName)"
>
{{ item.name }}
</el-link>
</div>
</div>
</div>
...
...
@@ -90,6 +89,8 @@
<el-button
type=
"default"
@
click=
"handleCancel"
>
取消
</el-button>
</div>
<ActivityModel
ref=
"activity"
@
selectActivity=
"selectActivity"
></ActivityModel>
<material-model
v-if=
"isMaterialVisible"
:isMaterialVisible
.
sync=
"isMaterialVisible"
@
handleMaterialConfirm=
"handleMaterialConfirm"
@
handleMaterialClose=
"handleMaterialClose"
></material-model>
<nickname-model
v-if=
"isNicknameVisible"
:isNicknameVisible
.
sync=
"isNicknameVisible"
@
handleNicknameConfirm=
"handleNicknameConfirm"
@
handleNicknameClose=
"handleNicknameClose"
></nickname-model>
<!-- <MessageModel ref="message" @selectItem="selectMessage"></MessageModel> -->
</div>
</template>
...
...
@@ -105,6 +106,8 @@ const ATT_TYPE = {
ACTIVITY
:
7
}
import
ActivityModel
from
'./components/activityModel'
import
materialModel
from
'./components/materialModel'
import
nicknameModel
from
'./components/nicknameModel'
import
*
as
moment
from
'moment'
export
default
{
name
:
'editGift'
,
...
...
@@ -114,6 +117,8 @@ export default {
footerLeft
:
'0'
,
footerWidth
:
'0'
,
editChildRef
:
'editChildRef'
,
isMaterialVisible
:
false
,
isNicknameVisible
:
false
,
// routeInfo: {
// // add-新增;edit-编辑;look-查看
// addOrEdit: 'add',
...
...
@@ -153,6 +158,12 @@ export default {
// limitSize: 10
// },
{
id
:
1
,
name
:
'素材'
,
type
:
'material'
,
funName
:
'material'
},
{
id
:
3
,
name
:
'活动'
,
type
:
'activity'
,
...
...
@@ -163,13 +174,13 @@ export default {
name
:
'优惠券'
,
type
:
'coupon'
,
funName
:
'coupon'
},
{
id
:
5
,
name
:
'朋友圈模板'
,
type
:
'nickname'
,
funName
:
'nickname'
}
// {
// id: 5,
// name: '模板',
// type: 'nickname',
// funName: 'message'
// }
],
editRule
:
{
sopName
:
[{
required
:
true
,
message
:
'请输入sop名字'
,
trigger
:
'change'
}],
...
...
@@ -368,7 +379,9 @@ export default {
},
components
:
{
ActivityModel
ActivityModel
,
materialModel
,
nicknameModel
},
watch
:
{
...
...
@@ -450,14 +463,38 @@ export default {
this
.
recoveryEndTime
()
},
// 素材
handleMaterialConfirm
()
{
this
.
handleMaterialClose
()
},
handleMaterialClose
()
{
this
.
isMaterialVisible
=
!
this
.
isMaterialVisible
},
// 朋友圈模板
handleNicknameConfirm
()
{
this
.
handleMaterialClose
()
},
handleNicknameClose
()
{
this
.
isNicknameVisible
=
!
this
.
isNicknameVisible
},
// 营销内容
handleFun
(
name
)
{
// if (name == 'nickname') {
// this.$refs.textContent.addTag('@昵称')
// } else
if
(
name
==
'material'
)
{
this
.
handleMaterialClose
()
}
if
(
name
==
'activity'
||
name
==
'coupon'
)
{
this
.
$refs
.
activity
.
init
(
name
==
'coupon'
?
'2'
:
'3'
)
}
if
(
name
==
'nickname'
)
{
this
.
handleNicknameClose
()
}
// else if (name == 'message') {
// this.$refs.message.init()
// }
...
...
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