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 b28b4126
authored
Mar 11, 2022
by
chenwq
Committed by
杨北旺
Mar 19, 2022
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
编辑sop-编辑/删除事件
1 parent
acb1b244
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 @
b28b412
...
@@ -199,6 +199,10 @@ html {
...
@@ -199,6 +199,10 @@ html {
margin-bottom
:
60px
;
margin-bottom
:
60px
;
}
}
.marketing
.m-r-10
{
margin-right
:
10px
;
}
.marketing
.m-r-20
{
.marketing
.m-r-20
{
margin-right
:
20px
;
margin-right
:
20px
;
}
}
...
@@ -229,6 +233,10 @@ html {
...
@@ -229,6 +233,10 @@ html {
background-color
:
#999999
;
background-color
:
#999999
;
}
}
.marketing
.txt-blue
{
color
:
#5850ff
;
}
.marketing
.txt-grey
{
.marketing
.txt-grey
{
color
:
#999999
;
color
:
#999999
;
}
}
...
...
src/views/sop/editSop.vue
View file @
b28b412
<
template
>
<
template
>
<div>
<div>
<base-info
v-show=
"activeName == 'baseInfo'"
:routeInfo=
"routeInfo"
@
handleTabChange=
"jumpEvent"
></base-info>
<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"
></edit-event>
<edit-event
v-if=
"activeName == 'editEvent'"
:eventObj=
"eventObj"
:condLimitObj=
"condLimitObj"
@
handleTabChange=
"jumpBaseInfo"
@
handleInfoConfirm=
"handleInfoConfirm"
></edit-event>
</div>
</div>
</
template
>
</
template
>
...
@@ -13,17 +13,19 @@ export default {
...
@@ -13,17 +13,19 @@ export default {
data
()
{
data
()
{
return
{
return
{
//
activeName: 'baseInfo',
activeName
:
'baseInfo'
,
activeName
:
'editEvent'
,
//
activeName: 'editEvent',
routeInfo
:
{
routeInfo
:
{
// add-新增;edit-编辑;look-查看
// add-新增;edit-编辑;look-查看
addOrEdit
:
'add'
,
addOrEdit
:
'add'
,
id
:
''
id
:
''
},
},
// 编辑-标记idx
eventIndex
:
''
,
condLimitObj
:
{
condLimitObj
:
{
// 1-有;0-无
// 1-有;0-无
hasPhone
:
0
,
hasPhone
:
0
,
hasQw
:
0
hasQw
:
1
},
},
eventObj
:
{
eventObj
:
{
addOrEdit
:
'add'
,
addOrEdit
:
'add'
,
...
@@ -45,9 +47,18 @@ export default {
...
@@ -45,9 +47,18 @@ export default {
jumpBaseInfo
(
obj
)
{
jumpBaseInfo
(
obj
)
{
this
.
activeName
=
obj
.
activeName
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
)
{
jumpEvent
(
obj
)
{
this
.
$set
(
this
.
eventObj
,
'addOrEdit'
,
obj
.
addOrEdit
)
this
.
$set
(
this
.
eventObj
,
'addOrEdit'
,
obj
.
addOrEdit
)
this
.
$set
(
this
.
eventObj
,
'info'
,
obj
.
info
)
this
.
$set
(
this
.
eventObj
,
'info'
,
obj
.
info
)
this
.
eventIndex
=
obj
.
eventIndex
this
.
$set
(
this
.
condLimitObj
,
'hasPhone'
,
obj
.
condLimitObj
.
hasPhone
)
this
.
$set
(
this
.
condLimitObj
,
'hasPhone'
,
obj
.
condLimitObj
.
hasPhone
)
this
.
$set
(
this
.
condLimitObj
,
'hasQw'
,
obj
.
condLimitObj
.
hasQw
)
this
.
$set
(
this
.
condLimitObj
,
'hasQw'
,
obj
.
condLimitObj
.
hasQw
)
this
.
activeName
=
obj
.
activeName
this
.
activeName
=
obj
.
activeName
...
...
src/views/sop/editSop/baseInfo.vue
View file @
b28b412
...
@@ -33,7 +33,22 @@
...
@@ -33,7 +33,22 @@
<img
class=
"empty-img"
:src=
"url"
/>
<img
class=
"empty-img"
:src=
"url"
/>
<p
class=
"empty-txt"
>
暂无营销事件
</p>
<p
class=
"empty-txt"
>
暂无营销事件
</p>
</div>
</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>
</div>
<div
class=
"footer"
:style=
"
{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<div
class=
"footer"
:style=
"
{ left: footerLeft + 'px', width: footerWidth + 'px' }">
...
@@ -102,7 +117,23 @@ export default {
...
@@ -102,7 +117,23 @@ export default {
name
:
'customerList'
,
name
:
'customerList'
,
addHtml
:
'customerList'
addHtml
:
'customerList'
}
}
]
],
baseData
:
{
channelTypeList
:
[
{
confId
:
'1'
,
confName
:
'企业微信'
},
{
confId
:
'2'
,
confName
:
'短信'
},
{
confId
:
'3'
,
confName
:
'微信朋友圈'
}
]
}
}
}
},
},
...
@@ -191,10 +222,23 @@ export default {
...
@@ -191,10 +222,23 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validateField
(
'customerList'
)
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(row)
// console.log(this.editForm.sopName)
// 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
()
{
handleConfirm
()
{
...
@@ -290,5 +334,34 @@ export default {
...
@@ -290,5 +334,34 @@ export default {
opacity
:
0.65
;
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
>
</
style
>
src/views/sop/editSop/editEvent.vue
View file @
b28b412
...
@@ -10,7 +10,7 @@
...
@@ -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>
<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>
<div
slot=
"eventTime"
slot-scope=
"scope"
>
<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>
</div>
</glsx-combi-form>
</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>
<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 = {
...
@@ -104,6 +104,7 @@ const ATT_TYPE = {
FILE
:
6
,
FILE
:
6
,
ACTIVITY
:
7
ACTIVITY
:
7
}
}
import
*
as
moment
from
'moment'
import
ActivityModel
from
'./components/activityModel'
import
ActivityModel
from
'./components/activityModel'
export
default
{
export
default
{
name
:
'editGift'
,
name
:
'editGift'
,
...
@@ -131,7 +132,8 @@ export default {
...
@@ -131,7 +132,8 @@ export default {
eventEndDate
:
''
,
eventEndDate
:
''
,
pushChannelType
:
''
,
pushChannelType
:
''
,
// 营销内容
// 营销内容
eventContent
:
''
eventContent
:
''
,
eventCount
:
''
},
},
// 营销内容
// 营销内容
previewList
:
[],
previewList
:
[],
...
@@ -171,10 +173,12 @@ export default {
...
@@ -171,10 +173,12 @@ export default {
],
],
editRule
:
{
editRule
:
{
sopName
:
[{
required
:
true
,
message
:
'请输入sop名字'
,
trigger
:
'change'
}],
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'
}],
eventTime
:
[{
required
:
true
,
message
:
'请选择营销时间'
,
trigger
:
'change'
}],
eventEndDate
:
[{
required
:
true
,
message
:
'请选择营销结束日期'
,
trigger
:
'change'
}],
eventContent
:
[{
required
:
true
,
message
:
'请输入营销内容'
,
trigger
:
'change'
}],
repeatFlag
:
[{
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
,
isEdit
:
true
,
sopNameFormData
:
[
sopNameFormData
:
[
...
@@ -414,16 +418,34 @@ export default {
...
@@ -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
()
{
getInfo
()
{
// this.$apis.zoneList.getZoneInfoApi({ id: this.eventObj.id }).then(res => {
this
.
recoveryRepeat
()
// this.editForm.merchantList = res.merchantRefList
this
.
recoveryEndTime
()
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
},
},
// 营销内容
// 营销内容
...
@@ -445,6 +467,7 @@ export default {
...
@@ -445,6 +467,7 @@ export default {
},
},
selectActivity
(
val
)
{
selectActivity
(
val
)
{
console
.
log
(
val
)
let
idx
let
idx
const
hasActivity
=
this
.
previewList
.
some
((
item
,
index
)
=>
{
const
hasActivity
=
this
.
previewList
.
some
((
item
,
index
)
=>
{
if
(
item
.
attType
==
7
)
{
if
(
item
.
attType
==
7
)
{
...
@@ -468,24 +491,72 @@ export default {
...
@@ -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
()
{
handleConfirm
()
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
console
.
log
(
this
.
editForm
)
if
(
valid
)
{
this
.
dealRepeatEventTotal
()
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
this
.
submit
)
{
if
(
this
.
eventObj
.
addOrEdit
==
'edit'
)
{
return
true
params
.
id
=
this
.
eventObj
.
id
}
}
this
.
submit
=
true
// this.$apis.zoneList.insertZoneApi(params).then(res => {
var
list
=
[
'Date'
,
'Time'
,
'Content'
,
'Channel'
]
// this.$message({
var
flag
=
true
// message: res.code == '0' ? '操作成功' : '操作失败',
var
errorObjList
=
[]
// type: res.code == '0' ? 'success' : 'error'
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
// })
if
(
this
.
$refs
[
'editFormRef'
+
list
[
i
]])
{
// if (res.code == '0') {
var
pRef
=
this
.
$refs
[
'editFormRef'
+
list
[
i
]]
// this.cancelJump()
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
()
{
cancelJump
()
{
// this.$router.push({
// this.$router.push({
...
...
vue.config.js
View file @
b28b412
...
@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
...
@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const
CDN_DOMAIN
=
'https://img02.glsx.com.cn/'
const
CDN_DOMAIN
=
'https://img02.glsx.com.cn/'
const
cdn
=
{
const
cdn
=
{
css
:
[
`
${
CDN_DOMAIN
}
ajax/libs/element-ui/2.11.1/theme-chalk/index.css`
],
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
=
{
module
.
exports
=
{
outputDir
:
`../dist/
${
packageName
}
`
,
outputDir
:
`../dist/
${
packageName
}
`
,
...
@@ -33,7 +33,8 @@ module.exports = {
...
@@ -33,7 +33,8 @@ module.exports = {
'vue-router'
:
'VueRouter'
,
'vue-router'
:
'VueRouter'
,
vuex
:
'Vuex'
,
vuex
:
'Vuex'
,
axios
:
'axios'
,
axios
:
'axios'
,
echarts
:
'echarts'
echarts
:
'echarts'
,
moment
:
'moment'
}
}
},
},
devServer
:
{
devServer
:
{
...
@@ -67,4 +68,4 @@ module.exports = {
...
@@ -67,4 +68,4 @@ module.exports = {
})
})
.
end
()
.
end
()
}
}
}
\ No newline at end of file
\ 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