config.js
6.53 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
export default {
data() {
return {
journeyStatus: 0,
statusList: [],
noConfig: false,
activityType: {
1: [
{
describe: '步骤一:关联营销活动',
icon: 'el-icon-warning',
isDisabled: false,
status: [1],
with: 165,
btnName: '去关联',
clickFun: () => {
this.handleConcat()
}
},
{
describe: '步骤二:启用客户旅程',
icon: 'el-icon-warning',
isDisabled: true,
with: 165,
status: [1],
btnName: '去开启',
clickFun: () => {
this.haneldOpen()
}
},
{
describe: '步骤一:已关联营销活动',
icon: 'el-icon-success',
isDisabled: false,
status: [2],
with: 165,
btnName: '去查看',
clickFun: () => {
this.concatActivity()
}
},
{
describe: '步骤二:启用客户旅程',
icon: 'el-icon-warning',
isDisabled: false,
with: 165,
status: [2],
btnName: '去开启',
clickFun: () => {
this.haneldOpen()
}
},
{
describe: '步骤一:已关联营销活动',
icon: 'el-icon-success',
isDisabled: false,
with: 165,
status: [3],
btnName: '去查看',
clickFun: () => {
this.concatActivity()
}
},
{
describe: '步骤二:已启用客户旅程',
icon: 'el-icon-success',
with: 165,
isDisabled: false,
status: [3],
btnName: '去停用',
clickFun: () => {
this.handleClose(-1)
}
},
{
describe: '步骤一:已关联营销活动',
icon: 'el-icon-success',
isDisabled: false,
with: 165,
status: [4],
btnName: '去查看',
clickFun: () => {
this.concatActivity()
}
},
{
describe: '步骤二:已停用客户旅程',
icon: 'el-icon-success',
with: 165,
isDisabled: true,
status: [4],
btnName: '已停用'
}
],
2: [
{
describe: '客户旅程 未开启',
icon: 'el-icon-warning',
isDisabled: false,
with: 115,
status: [1, 2],
btnName: '去启用',
clickFun: () => {
this.haneldOpenQY()
}
},
{
describe: '客户旅程 已开启',
icon: 'el-icon-success',
isDisabled: false,
status: [3],
with: 115,
btnName: '去停用',
clickFun: () => {
this.handleClose(-1)
}
},
{
describe: '客户旅程 已停用',
icon: 'el-icon-warning',
isDisabled: true,
with: 115,
status: [4],
btnName: '已停用'
}
]
}
}
},
mounted() {
this.statusList = this.activityType[2]
const query = this.$route.query
this.query = query
this.getDetail()
},
methods: {
getDetail(order) {
this.$apis.journeyConfig.getInstIdDetail({ instId: this.query.instId }).then(res => {
console.log(res,'res')
const instParam = JSON.parse(res.instParam)
this.dataTypeCode = instParam.dataTypeCode
this.noConfig = false
//xbpzj 关联续保膨胀金
if (this.dataTypeCode == 'xbpzj') {
this.statusList = this.activityType[1]
} else {
this.statusList = this.activityType[2]
}
const stages = instParam.stages
const instStatus = res.instStatus
this.activityInfo = instParam.customData
const activityId = this.activityInfo.activityId
if (instStatus == 0 && !activityId) {
this.journeyStatus = 1
}
if (instStatus == 0 && activityId) {
this.journeyStatus = 2
}
if (instStatus == 1) {
this.journeyStatus = 3
}
if (instStatus == -1) {
this.journeyStatus = 4
}
const nodes = res.nodes.filter(item=>item.nodeSkip!=1)
const configList = []
for (let k in stages) {
let list = []
for (let v of nodes) {
if (v.nodeParam && JSON.parse(v.nodeParam).stage == stages[k].value) {
list.push({ ...JSON.parse(v.nodeParam), nodeId: v.instNodeId, nodeProtoId: v.nodeProtoId })
}
}
list = list.filter(item => item.day)
list.sort((a, b) => {
return a.day - b.day
})
list.forEach(i => {
if ([5, 7, 8, 9, 10].includes(i.taskType) && !i.taskParam) {
this.noConfig = true
}
})
if (stages[k].conditions && this.dataTypeCode == 'xbpzj') {
stages[k].conditions.forEach(con => {
const condition = con.conditions.filter(i => i.isHide)
if (condition.length && condition.length == 1) {
if (!condition[0].operators[0].value) {
this.noConfig = true
}
}
})
}
const sopList = this.groupBy(list, 'day')
configList.push({
order: k,
label: stages[k].value,
isExpaned: order == k ? true : false,
editable: stages[k].editable,
conditionsList: stages[k].conditions || [],
sopList,
instStatus
})
}
this.configList = configList
})
},
async openAllConfig() {
const supMerchantNo = await this.$apis.journeyConfig.authorizeMerchant({ merchantId: this.$globalState.session.merchantId })
await this.$apis.journeyConfig.concatActivity({ instId: this.query.instId, data: { supMerchantNo } })
this.setSopInsts(1)
},
async haneldOpenQY() {
if (this.noConfig) {
this.handleConfirm('开启提示', '确定', '请完善进入条件及SOP任务后,再启动客户旅程。', '', () => {
// this.openAllConfig()
})
} else {
this.openAllConfig()
}
}
}
}