Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
7baddbc9
Commit
7baddbc9
authored
Jun 15, 2022
by
crushh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix/营销事件' into master
parents
40ef44e1
fb1ef652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
10 deletions
+59
-10
form.js
src/views/ecm/form.js
+5
-0
api.js
src/views/ecm/marketing-event/assets/api.js
+3
-2
index.vue
src/views/ecm/marketing-event/index.vue
+51
-8
No files found.
src/views/ecm/form.js
View file @
7baddbc9
...
...
@@ -1076,6 +1076,11 @@ export default {
params
.
forecastMemberCount
=
count
;
}
this
.
loading
=
true
;
const
res
=
await
this
.
$refs
.
marketingEvent
.
delAllApi
();
if
(
!
res
)
{
this
.
loading
=
false
;
return
;
}
saveEcmInfo
(
params
)
.
then
(
res
=>
{
if
(
res
.
errorCode
===
0
)
{
...
...
src/views/ecm/marketing-event/assets/api.js
View file @
7baddbc9
import
qs
from
'qs'
;
import
axios
from
'axios'
;
import
Vue
from
'vue'
;
const
host
=
window
.
location
.
origin
;
const
PREFIX
=
'/api-marketing/'
;
const
PLUG_PREFIX
=
'/api-plug/'
;
...
...
@@ -80,7 +81,7 @@ function handlerErr(code, message = '请求错误') {
message
=
'网关错误'
;
break
;
}
this
.
$message
({
type
:
'warning'
,
message
:
message
});
Vue
.
prototype
.
$tips
({
type
:
'warning'
,
message
:
message
});
}
/**
...
...
@@ -123,7 +124,7 @@ const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false,
clearTimeout
(
_timer
);
popRequest
(
_random
);
if
(
res
)
{
handlerErr
(
res
.
response
.
status
,
'接口异常'
);
handlerErr
(
res
.
response
?
res
.
response
.
status
:
408
,
'接口异常'
);
}
reject
(
res
);
});
...
...
src/views/ecm/marketing-event/index.vue
View file @
7baddbc9
...
...
@@ -19,7 +19,7 @@
<template
v-if=
"!readOnly"
>
<i
class=
"el-icon-edit dm-marketing__opt--icon"
v-if=
"showEdit(v) && (v.comName === 'item-teltask' || v.comName === 'item-text' || v.comName === 'item-wxa' || v.comName === 'item-integral' || v.comName === 'item-qywx' || v.comName === 'item-qfxx')"
@
click=
"editItem(v)"
></i>
<i
v-else-if=
"v.comName == 'item-qywx' || v.comName == 'item-qfxx'"
class=
"el-icon-view dm-marketing__opt--icon"
@
click=
"editItem(v, true)"
></i>
<dm-delete
:tips=
"showDeleteTooltip ? '是否确定删除该营销事件?删除后,该计划营销分析数据可能会不准确。' : '是否删除?'"
@
confirm=
"delItem(v)"
>
<dm-delete
:tips=
"showDeleteTooltip ? '是否确定删除该营销事件?删除后,该计划营销分析数据可能会不准确。' : '是否删除?'"
@
confirm=
"delItem(v
, i
)"
>
<i
class=
"el-icon-delete dm-marketing__opt--icon"
></i>
</dm-delete>
</
template
>
...
...
@@ -166,6 +166,7 @@ export default {
return
{
showView
:
false
,
list
:
[],
delList
:
[],
dialogShow
:
false
,
dialogCom
:
''
,
options
:
[],
...
...
@@ -254,25 +255,25 @@ export default {
// 单次切换触点或者重复切换触点,清空已选择的图文;
// 0:触点 1:重复 2:单次
if
(
oldType
==
0
||
newType
==
0
)
{
this
.
list
.
forEach
(
el
=>
{
this
.
list
.
forEach
(
(
el
,
index
)
=>
{
if
(
el
.
comName
==
'item-teletext'
)
{
this
.
del
Item
(
el
);
this
.
del
Api
(
el
);
}
});
}
// 单次切换成触点或者重复切换成触点,清空已选择的群发营销事件;
// 单次和重复之间切换,不需要清空操作;
if
(
newType
==
0
)
{
this
.
list
.
forEach
(
el
=>
{
this
.
list
.
forEach
(
(
el
,
index
)
=>
{
if
(
el
.
comName
==
'item-qfxx'
)
{
this
.
del
Item
(
el
);
this
.
del
Api
(
el
);
}
});
}
},
consumType
(
val
)
{
this
.
list
.
forEach
(
el
=>
{
this
.
del
Item
(
el
);
this
.
del
Api
(
el
);
});
},
list
()
{
...
...
@@ -381,6 +382,8 @@ export default {
break
;
}
});
let
arr
=
this
.
delList
.
map
(
item
=>
item
.
ecmMarketingTypeRelationId
);
this
.
list
=
this
.
list
.
filter
(
item
=>
!
arr
.
includes
(
item
.
item
.
ecmMarketingTypeRelationId
));
this
.
hasReturnCard
();
}
});
...
...
@@ -504,8 +507,11 @@ export default {
this
.
dialogShow
=
true
;
},
// 删除操作
delItem
(
item
)
{
console
.
log
(
item
);
delItem
(
item
,
index
)
{
this
.
list
.
splice
(
index
,
1
);
this
.
delList
.
push
(
item
.
item
);
},
delApi
(
item
)
{
deleteMarketingType
({
ecmMarketingTypeRelationId
:
item
.
item
.
ecmMarketingTypeRelationId
,
ecmPlanId
:
this
.
ecmPlanId
,
type
:
this
.
scence
})
.
then
(
res
=>
{
if
(
res
.
errorCode
===
0
)
{
...
...
@@ -528,6 +534,43 @@ export default {
});
this
.
showView
=
!!
showView
;
},
delAllApi
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
this
.
delList
.
length
)
{
resolve
(
true
);
return
;
}
let
arr
=
this
.
delList
.
map
(
item
=>
item
.
ecmMarketingTypeRelationId
);
arr
=
[...
new
Set
(
arr
)];
Promise
.
all
(
arr
.
map
(
item
=>
deleteMarketingType
({
ecmMarketingTypeRelationId
:
item
,
ecmPlanId
:
this
.
ecmPlanId
,
type
:
this
.
scence
})))
.
then
(
res
=>
{
console
.
log
(
res
);
resolve
(
true
);
})
.
catch
(
err
=>
{
console
.
log
(
err
);
resolve
(
false
);
});
});
console
.
log
(
this
.
delList
);
let
arr
=
this
.
delList
.
map
(
item
=>
item
.
ecmMarketingTypeRelationId
);
arr
=
new
Set
(
arr
);
Promise
.
all
(
arr
.
map
(
item
=>
deleteMarketingType
({
ecmMarketingTypeRelationId
:
item
,
ecmPlanId
:
this
.
ecmPlanId
,
type
:
this
.
scence
}))).
then
(
res
=>
{
console
.
log
(
res
);
});
// deleteMarketingType({ ecmMarketingTypeRelationId: item.item.ecmMarketingTypeRelationId, ecmPlanId: this.ecmPlanId, type: this.scence })
// .then(res => {
// if (res.errorCode === 0) {
// this.getMarketingList();
// } else {
// this.$message({ message: res.message, type: 'error' });
// }
// })
// .catch(err => {
// this.$message({ message: err.data.message, type: 'error' });
// });
},
/*------------------辅助方法--------------*/
// 账户状态判断
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment