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 a69b60fc
authored
Mar 11, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
编辑sop-编辑/删除事件
1 parent
7bf085a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
205 additions
and
41 deletions
src/assets/css/public.scss
src/views/sop/editSop.vue
src/views/sop/editSop/baseInfo.vue
src/views/sop/editSop/editEvent.vue
vue.config.js
src/assets/css/public.scss
View file @
a69b60f
...
...
@@ -196,6 +196,10 @@ html {
margin-bottom
:
60px
;
}
.marketing
.m-r-10
{
margin-right
:
10px
;
}
.marketing
.m-r-20
{
margin-right
:
20px
;
}
...
...
@@ -226,6 +230,10 @@ html {
background-color
:
#999999
;
}
.marketing
.txt-blue
{
color
:
#5850ff
;
}
.marketing
.txt-grey
{
color
:
#999999
;
}
...
...
src/views/sop/editSop.vue
View file @
a69b60f
<
template
>
<div>
<base-info
v-show=
"activeName == 'baseInfo'"
:routeInfo=
"routeInfo"
@
handleTabChange=
"jumpEvent"
></base-info>
<edit-event
v-if=
"activeName == 'editEvent'"
:eventObj=
"eventObj"
:condLimitObj=
"condLimitObj"
@
handleTabChange=
"jumpBaseInfo"
></edit-event>
<base-info
v-show=
"activeName == 'baseInfo'"
ref=
"baseInfoRef"
:routeInfo=
"routeInfo"
@
handleTabChange=
"jumpEvent"
></base-info>
<edit-event
v-if=
"activeName == 'editEvent'"
:eventObj=
"eventObj"
:condLimitObj=
"condLimitObj"
@
handleTabChange=
"jumpBaseInfo"
@
handleInfoConfirm=
"handleInfoConfirm"
></edit-event>
</div>
</
template
>
...
...
@@ -13,17 +13,19 @@ export default {
data
()
{
return
{
//
activeName: 'baseInfo',
activeName
:
'editEvent'
,
activeName
:
'baseInfo'
,
//
activeName: 'editEvent',
routeInfo
:
{
// add-新增;edit-编辑;look-查看
addOrEdit
:
'add'
,
id
:
''
},
// 编辑-标记idx
eventIndex
:
''
,
condLimitObj
:
{
// 1-有;0-无
hasPhone
:
0
,
hasQw
:
0
hasQw
:
1
},
eventObj
:
{
addOrEdit
:
'add'
,
...
...
@@ -45,9 +47,18 @@ export default {
jumpBaseInfo
(
obj
)
{
this
.
activeName
=
obj
.
activeName
},
handleInfoConfirm
(
info
)
{
// console.log(info)
// console.log(this.$refs.baseInfoRef.editForm.eventList)
this
.
eventObj
.
addOrEdit
==
'add'
?
this
.
$refs
.
baseInfoRef
.
editForm
.
eventList
.
push
(
info
.
baseInfo
)
:
this
.
$set
(
this
.
$refs
.
baseInfoRef
.
editForm
.
eventList
,
this
.
eventIndex
,
info
.
baseInfo
)
console
.
log
(
this
.
$refs
.
baseInfoRef
.
editForm
)
this
.
jumpBaseInfo
({
activeName
:
'baseInfo'
})
},
jumpEvent
(
obj
)
{
this
.
$set
(
this
.
eventObj
,
'addOrEdit'
,
obj
.
addOrEdit
)
this
.
$set
(
this
.
eventObj
,
'info'
,
obj
.
info
)
this
.
eventIndex
=
obj
.
eventIndex
this
.
$set
(
this
.
condLimitObj
,
'hasPhone'
,
obj
.
condLimitObj
.
hasPhone
)
this
.
$set
(
this
.
condLimitObj
,
'hasQw'
,
obj
.
condLimitObj
.
hasQw
)
this
.
activeName
=
obj
.
activeName
...
...
src/views/sop/editSop/baseInfo.vue
View file @
a69b60f
...
...
@@ -33,7 +33,22 @@
<img
class=
"empty-img"
:src=
"url"
/>
<p
class=
"empty-txt"
>
暂无营销事件
</p>
</div>
<div
v-show=
"editForm.eventList.length"
></div>
<div
v-show=
"editForm.eventList.length"
class=
"event-box"
>
<div
class=
"event-item"
v-for=
"(item, index) in editForm.eventList"
:key=
"index"
>
<div
class=
"flex-default event-title"
>
<p
class=
"m-r-10"
>
{{
item
.
eventStartDate
}}
</p>
<p
class=
"m-r-20"
>
{{
item
.
eventTime
}}
</p>
<p
class=
"m-r-20"
>
{{
item
.
eventEndDate
}}
</p>
<p
class=
"m-r-20 txt-blue"
>
{{
baseData
.
channelTypeList
.
find
(
k
=>
k
.
confId
==
item
.
pushChannelType
).
confName
}}
</p>
</div>
<div
class=
"event-content"
>
{{
item
.
eventContent
}}
</div>
<div
class=
"event-link"
>
图+字
</div>
<div
class=
"event-btns"
>
<el-button
class=
"default"
:size=
"size"
@
click=
"handleEventDelete(index)"
>
删除
</el-button>
<el-button
class=
"default-blue-btn"
:size=
"size"
@
click=
"handleEventEdit('edit', item, index)"
>
编辑
</el-button>
</div>
</div>
</div>
</div>
</div>
<div
class=
"footer"
:style=
"
{ left: footerLeft + 'px', width: footerWidth + 'px' }">
...
...
@@ -102,7 +117,23 @@ export default {
name
:
'customerList'
,
addHtml
:
'customerList'
}
]
],
baseData
:
{
channelTypeList
:
[
{
confId
:
'1'
,
confName
:
'企业微信'
},
{
confId
:
'2'
,
confName
:
'短信'
},
{
confId
:
'3'
,
confName
:
'微信朋友圈'
}
]
}
}
},
...
...
@@ -191,10 +222,23 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validateField
(
'customerList'
)
},
handleEventEdit
(
addOrEdit
,
row
)
{
handleEventDelete
(
idx
)
{
this
.
$confirm
(
'是否删除该条营销事件'
,
'删除'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
callback
:
action
=>
{
if
(
action
==
'confirm'
)
{
this
.
editForm
.
eventList
.
splice
(
idx
,
1
)
}
}
})
},
handleEventEdit
(
addOrEdit
,
row
,
idx
)
{
// console.log(row)
// console.log(this.editForm.sopName)
this
.
$emit
(
'handleTabChange'
,
{
activeName
:
'editEvent'
,
addOrEdit
:
addOrEdit
,
condLimitObj
:
this
.
condLimitObj
,
info
:
{
...
row
,
sopName
:
this
.
editForm
.
sopName
}
})
this
.
$emit
(
'handleTabChange'
,
{
activeName
:
'editEvent'
,
addOrEdit
:
addOrEdit
,
eventIndex
:
addOrEdit
==
'add'
?
'-1'
:
idx
,
condLimitObj
:
this
.
condLimitObj
,
info
:
{
...
row
,
sopName
:
this
.
editForm
.
sopName
}
})
},
handleConfirm
()
{
...
...
@@ -290,5 +334,34 @@ export default {
opacity
:
0.65
;
}
}
.event-box
{
padding
:
32px
20px
;
.event-item
{
position
:
relative
;
padding
:
16px
;
background
:
#f7f7f7
;
border
:
1px
solid
rgba
(
220
,
223
,
230
,
1
);
margin-bottom
:
20px
;
.event-title
{
height
:
32px
;
line-height
:
32px
;
margin-bottom
:
12px
;
}
.event-link
{
margin-top
:
12px
;
}
.event-content
{
line-height
:
24px
;
}
.event-btns
{
position
:
absolute
;
top
:
16px
;
right
:
16px
;
}
}
.event-item
:last-child
{
margin-bottom
:
0
;
}
}
}
</
style
>
src/views/sop/editSop/editEvent.vue
View file @
a69b60f
...
...
@@ -10,7 +10,7 @@
<el-date-picker
class=
"m-r-20"
v-model=
"editForm[scope.scope.name]"
:placeholder=
"scope.scope.placeholder"
:value-format=
"scope.scope.valueFormat"
:clearable=
"scope.scope.isClear"
:picker-options=
"scope.scope.customPickerOptions"
@
change=
"scope.scope.change"
></el-date-picker>
</div>
<div
slot=
"eventTime"
slot-scope=
"scope"
>
<el-time-picker
v-model=
"editForm[scope.scope.name]"
:placeholder=
"scope.scope.placeholder"
></el-time-picker>
<el-time-picker
v-model=
"editForm[scope.scope.name]"
value-format=
"HH:mm:ss"
:placeholder=
"scope.scope.placeholder"
></el-time-picker>
</div>
</glsx-combi-form>
<glsx-combi-form
ref=
"editFormRefRepeat"
:isEdit=
"isEdit"
:labelWidth=
"labelWidth"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormDataRepeat"
:formRules=
"editRule"
></glsx-combi-form>
...
...
@@ -104,6 +104,7 @@ const ATT_TYPE = {
FILE
:
6
,
ACTIVITY
:
7
}
import
*
as
moment
from
'moment'
import
ActivityModel
from
'./components/activityModel'
export
default
{
name
:
'editGift'
,
...
...
@@ -131,7 +132,8 @@ export default {
eventEndDate
:
''
,
pushChannelType
:
''
,
// 营销内容
eventContent
:
''
eventContent
:
''
,
eventCount
:
''
},
// 营销内容
previewList
:
[],
...
...
@@ -171,10 +173,12 @@ export default {
],
editRule
:
{
sopName
:
[{
required
:
true
,
message
:
'请输入sop名字'
,
trigger
:
'change'
}],
eventStartDate
:
[{
required
:
true
,
message
:
'请选择营销日期'
,
trigger
:
'change'
}],
eventStartDate
:
[{
required
:
true
,
message
:
'请选择营销
开始
日期'
,
trigger
:
'change'
}],
eventTime
:
[{
required
:
true
,
message
:
'请选择营销时间'
,
trigger
:
'change'
}],
eventEndDate
:
[{
required
:
true
,
message
:
'请选择营销结束日期'
,
trigger
:
'change'
}],
eventContent
:
[{
required
:
true
,
message
:
'请输入营销内容'
,
trigger
:
'change'
}],
repeatFlag
:
[{
required
:
true
,
message
:
'请选择是否重复'
,
trigger
:
'change'
}],
pushChannelType
:
[{
required
:
true
,
message
:
'请选择营销渠道'
,
trigger
:
'change'
}]
,
pushChannelType
:
[{
required
:
true
,
message
:
'请选择营销渠道'
,
trigger
:
'change'
}]
},
isEdit
:
true
,
sopNameFormData
:
[
...
...
@@ -414,16 +418,34 @@ export default {
})
}
},
recoveryRepeat
()
{
var
idx
=
this
.
editFormDataRepeat
.
findIndex
(
item
=>
item
.
name
==
'repeatMode'
)
this
.
editFormDataRepeat
[
idx
].
isHide
=
this
.
editForm
.
repeatFlag
==
'N'
var
temp
=
[
'repeatTime'
,
'eventEndDate'
]
temp
.
forEach
(
item
=>
{
let
index
=
this
.
editFormDataTime
.
findIndex
(
k
=>
k
.
name
==
item
)
this
.
editFormDataTime
[
index
].
isHide
=
this
.
editForm
.
repeatFlag
==
'N'
})
},
recoveryEndTime
()
{
var
idx
=
this
.
editFormDataTime
.
findIndex
(
item
=>
item
.
name
==
'eventEndDate'
)
var
startTime
=
new
Date
(
this
.
editForm
.
eventStartDate
)
this
.
editFormDataTime
[
idx
].
customPickerOptions
=
{
disabledDate
(
date
)
{
const
startDate
=
startTime
if
(
date
<
startDate
)
{
return
true
}
return
false
}
}
},
getInfo
()
{
// this.$apis.zoneList.getZoneInfoApi({ id: this.eventObj.id }).then(res => {
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
this
.
recoveryRepeat
()
this
.
recoveryEndTime
()
},
// 营销内容
...
...
@@ -445,6 +467,7 @@ export default {
},
selectActivity
(
val
)
{
console
.
log
(
val
)
let
idx
const
hasActivity
=
this
.
previewList
.
some
((
item
,
index
)
=>
{
if
(
item
.
attType
==
7
)
{
...
...
@@ -468,24 +491,72 @@ export default {
},
// 营销内容
// 跳转
whereToGo
(
id
)
{
document
.
getElementById
(
id
).
scrollIntoView
()
},
// 计算事件重复次数
dealRepeatEventTotal
()
{
console
.
log
(
moment
(
this
.
editForm
.
eventStartDate
).
weeksInYear
())
if
(
this
.
editForm
.
repeatFlag
==
'Y'
)
{
switch
(
this
.
editForm
.
repeatMode
)
{
// 按天
case
'1'
:
this
.
editForm
.
eventCount
=
(
new
Date
(
this
.
editForm
.
eventEndDate
)
-
new
Date
(
this
.
editForm
.
eventStartDate
))
/
(
24
*
60
*
60
*
1000
)
+
1
break
// 按周
case
'2'
:
break
case
'3'
:
break
}
}
console
.
log
(
this
.
editForm
.
eventCount
)
},
handleConfirm
()
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
this
.
eventObj
.
addOrEdit
==
'edit'
)
{
params
.
id
=
this
.
eventObj
.
id
}
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.cancelJump()
// }
// })
console
.
log
(
this
.
editForm
)
this
.
dealRepeatEventTotal
()
if
(
this
.
submit
)
{
return
true
}
this
.
submit
=
true
var
list
=
[
'Date'
,
'Time'
,
'Content'
,
'Channel'
]
var
flag
=
true
var
errorObjList
=
[]
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
this
.
$refs
[
'editFormRef'
+
list
[
i
]])
{
var
pRef
=
this
.
$refs
[
'editFormRef'
+
list
[
i
]]
pRef
.
$refs
.
editChildRef
.
validate
((
valid
,
errorObj
)
=>
{
!
valid
&&
errorObjList
.
push
(
errorObj
)
flag
&&
(
flag
=
valid
)
})
}
})
}
if
(
!
flag
)
{
this
.
whereToGo
(
Object
.
keys
(
errorObjList
[
0
])[
0
])
this
.
submit
=
false
return
true
}
this
.
$emit
(
'handleInfoConfirm'
,
{
baseInfo
:
this
.
editForm
})
// this.$refs.editFormRefDate.$refs[this.editChildRef].validate(valid => {
// if (valid) {
// var params = this.$common.utils.deepClone(this.editForm)
// if (this.eventObj.addOrEdit == 'edit') {
// params.id = this.eventObj.id
// }
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.cancelJump()
// }
// })
// }
// })
},
cancelJump
()
{
// this.$router.push({
...
...
vue.config.js
View file @
a69b60f
...
...
@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const
CDN_DOMAIN
=
'https://img02.glsx.com.cn/'
const
cdn
=
{
css
:
[
`
${
CDN_DOMAIN
}
ajax/libs/element-ui/2.11.1/theme-chalk/index.css`
],
js
:
[
`
${
CDN_DOMAIN
}
ajax/libs/vue/2.6.11/vue.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/vue-router/3.2.0/vue-router.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/element-ui/2.11.1/index.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/vuex/3.6.2/vuex.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/echarts/5.1.2/echarts.min.js`
]
js
:
[
`
${
CDN_DOMAIN
}
ajax/libs/vue/2.6.11/vue.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/vue-router/3.2.0/vue-router.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/element-ui/2.11.1/index.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/vuex/3.6.2/vuex.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/echarts/5.1.2/echarts.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/moment/2.24.0/moment.js`
]
}
module
.
exports
=
{
outputDir
:
`../dist/
${
packageName
}
`
,
...
...
@@ -33,7 +33,8 @@ module.exports = {
'vue-router'
:
'VueRouter'
,
vuex
:
'Vuex'
,
axios
:
'axios'
,
echarts
:
'echarts'
echarts
:
'echarts'
,
moment
:
'moment'
}
},
devServer
:
{
...
...
@@ -67,4 +68,4 @@ module.exports = {
})
.
end
()
}
}
\ No newline at end of file
}
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