config.vue
6.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-16 17:12:02
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="journey-main">
<div class="bg-fff pb20 journey-config">
<template v-for="(item, index) in statusList">
<div class="journey-step-config" v-if="item.status.includes(journeyStatus)" :key="index">
<i :class="`${item.icon}`"></i>
<span :style="{'width':item.with+'px'}">{{ item.describe }}</span>
<el-button :type="item.isDisabled ? 'info' : 'primary'" :size="size" @click="item.clickFun" :disabled="item.isDisabled" :plain="item.plain">{{ item.btnName }}</el-button>
</div>
</template>
</div>
<div class="journey-step bg-fff pb20">
<div class="journey-step-title border-title">客户旅程阶段</div>
<div class="journey-step-body">
<div class="journey-step-info" v-for="(val, k) in configList" :key="k">
<collapse-item :stepItem="val" :activityInfo="activityInfo"></collapse-item>
</div>
</div>
</div>
<related-activity ref="activityForm" @setProcess="setProcess" :journeyStatus="journeyStatus"></related-activity>
</div>
</template>
<script>
import CollapseItem from './components/CollapseItem'
import relatedActivity from './components/relatedActivity'
import config from '@/mixins/config'
export default {
components: { CollapseItem, relatedActivity },
mixins: [config],
data() {
return {
activityInfo: {},
configList: [],
configList2: [
{
label: '可报价',
isExpaned: false,
taskList: [
{
status: [1, 2],
name: '进入条件',
desc: '描述用户触发何种条件后,将自动变更为该旅程阶',
progressList: [
{
name: '33'
},
{
name: '33'
},
{
name: '33'
}
]
}
]
},
{
label: '有意向',
isExpaned: false,
taskList: [
{
status: [1, 2],
name: '进入条件',
desc: '描述用户触发何种条件后,将自动变更为该旅程阶',
progressList: [
{
name: '33'
}
],
sopList: [
{
day: '第一天',
times: [
{
time: '7:00',
process: 1
},
{
time: '8:00',
process: 2
},
{
time: '9:00',
process: 3
}
]
},
{
day: '第二天',
times: [
{
time: '7:00',
process: 1
},
{
time: '8:00',
process: 2
}
]
},
{
day: '第三天'
},
{
day: '第四天'
},
{
day: '第五天'
}
]
}
]
}
]
}
},
mounted() {},
methods: {
groupBy(list, name) {
const m = new Map()
list.map(item => {
m.set(item[name], [...(m.get(item[name]) || ''), item])
})
return [...m.values()]
},
//关闭
handleClose() {
this.handleConfirm('关闭提示', '确定关闭', '旅程关闭后将禁用无法重新开启', '', () => {
this.setSopInsts(-1)
})
},
setSopInsts(status) {
this.$apis.journeyConfig.setSopInsts({ instId: this.query.instId, status }).then(res => {
this.getDetail()
})
},
//关联活动成功
setProcess(data) {
this.$apis.journeyConfig.concatActivity({ instId: this.query.instId, data }).then(res => {
this.getDetail()
})
},
handleConfirm(title, btnName, content, customClass, callback) {
this.$confirm(content, title, {
confirmButtonText: btnName,
cancelButtonText: '取消',
customClass,
type: 'warning'
})
.then(() => {
callback()
})
.catch(() => {})
},
//开启
haneldOpen() {
if(this.noConfig) {
this.handleConfirm('开启提示', '确定', 'SOP内容未配置完整', '', () => {
})
return
}
this.handleConfirm('开启提示', '确定开启', '旅程开启后将无法修改关联的活动链接', '', () => {
this.setSopInsts(1)
})
},
//关联活动
handleConcat() {
this.handleConfirm('关联提示', '前往关联', '当前旅程尚未关联活动链接,请关联后再尝试开启', 'concat-color', this.concatActivity)
},
//打开活动
concatActivity() {
this.$refs.activityForm.init(this.activityInfo)
}
}
}
</script>
<style lang="scss" scoped>
.concat-color {
/deep/ .el-icon-warning {
color: #5850ff;
}
}
.journey-main {
.journey-config {
margin-bottom: 16px;
padding: 20px;
}
.journey-step-config {
&:not(:first-child) {
margin-top: 20px;
}
i {
font-size: 14px;
&.el-icon-warning {
color: #fdb757;
}
&.el-icon-success {
color: #2cca74;
}
}
span {
font-size: 14px;
color: #666666;
margin-left: 5px;
display: inline-block;
width: 156px;
}
}
.journey-step-body {
border: 1px solid #e5e5e5;
margin: 32px 20px;
}
}
</style>
<style lang="scss">
.concat-color {
.el-icon-warning {
color: #5850ff;
}
}
</style>