Commit 3ffa4bf2 by 杨明

fixed

1 parent ac6c1403
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-22 19:44:09 * @Date: 2023-12-22 19:44:09
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 16:24:11 * @LastEditTime: 2024-01-02 19:04:29
* @FilePath: \scrm-micro-peregrination\src\api\modules\journeyModel.js * @FilePath: \scrm-micro-peregrination\src\api\modules\journeyModel.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -29,7 +29,7 @@ const sopTplsList = params => { ...@@ -29,7 +29,7 @@ const sopTplsList = params => {
//活动列表 //活动列表
const getInstIdDetail = params => { const getInstIdDetail = params => {
return http({ return http({
url: 'process/sop/api/sopInsts/' + params.instId, url: '/process/sop/api/sopTpls/' + params.instId,
method: 'get', method: 'get',
// data: params, // data: params,
sign: false sign: false
...@@ -40,7 +40,7 @@ const SopTplNodeProtosList = params => { ...@@ -40,7 +40,7 @@ const SopTplNodeProtosList = params => {
return http({ return http({
url: '/process/sop/api/SopTplNodeProtos/list', url: '/process/sop/api/SopTplNodeProtos/list',
method: 'get', method: 'get',
// data: params, data: params,
sign: false sign: false
}) })
} }
...@@ -50,7 +50,8 @@ const sopTplsSave = params => { ...@@ -50,7 +50,8 @@ const sopTplsSave = params => {
url: '/process/sop/api/sopTpls', url: '/process/sop/api/sopTpls',
method: 'post', method: 'post',
data: params, data: params,
sign: false sign: false,
noSessionId:true
}) })
} }
//圈人方式全部列表 //圈人方式全部列表
...@@ -61,5 +62,14 @@ const sopDataTypesList = params => { ...@@ -61,5 +62,14 @@ const sopDataTypesList = params => {
sign: false sign: false
}) })
} }
//圈人方式全部列表
const sopConditionList = params => {
return http({
url: '/process/sop/api/sopData/condition/list',
method: 'get',
data: params,
sign: false
})
}
export default { byGroupIdSop, sopTplsList, getInstIdDetail, SopTplNodeProtosList, sopTplsSave, sopDataTypesList } export default { byGroupIdSop, sopTplsList, getInstIdDetail, SopTplNodeProtosList, sopTplsSave, sopDataTypesList, sopConditionList }
import { mapActions, mapState } from 'vuex'
export default {
data() {
return {
...mapActions('model', ['setModelList'])
}
},
computed: {
...mapState('model', ['modelList'])
},
mounted() {
if (!this.modelList) {
this.setModelList()
}
},
methods: {
...mapActions('model', ['setModelList'])
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49 * @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-05 16:08:47 * @LastEditTime: 2024-01-03 10:01:50
* @FilePath: \live\src\setup\qiankun.js * @FilePath: \live\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
......
...@@ -2,23 +2,27 @@ ...@@ -2,23 +2,27 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-27 16:50:15 * @Date: 2023-12-27 16:50:15
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 17:11:10 * @LastEditTime: 2023-12-28 20:29:30
* @FilePath: \scrm-micro-peregrination\src\store\modules\model.js * @FilePath: \scrm-micro-peregrination\src\store\modules\model.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import api from '@/api'
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
model: '', modelList: null
STEP: ''
}, },
mutations: { mutations: {
// 设置模块阶段 // 设置模块阶段
SET_MODEL(state, data) { SET_MODEL(state, data) {
state.model = data state.modelList = data
}, }
SET_STEP(state, data) { },
state.STEP = data actions: {
// 设置分页大小
async setModelList({ commit }, data) {
const res = await api.journeyModel.SopTplNodeProtosList({})
commit('SET_MODEL', res)
} }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08 * @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-23 15:28:49 * @LastEditTime: 2024-01-03 12:33:37
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue * @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
<div class="progress-item-content bg-fff"> <div class="progress-item-content bg-fff">
<div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k"> <div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k">
<span>条件{{ k + 1 }}</span> <span>条件{{ k + 1 }}</span>
<span>{{ v.split("-")[0] }}</span> <span>{{ spiltString(v) }}</span>
<img v-show="v.split('-').length > 1" src="@/assets/config/arrow.png"/>
<span>{{ v.split("-")[1] }}</span>
</div> </div>
</div> </div>
</template> </template>
...@@ -72,9 +70,7 @@ ...@@ -72,9 +70,7 @@
<div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center"> <div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
<div style="width: 100%"> <div style="width: 100%">
<div class="step-item-desc"> <div class="step-item-desc">
<span>[{{ stage_time[value.taskType] }}]发送 | {{ stage[value.taskType] }} |{{ <span>[{{ value.time }}]发送 | {{ stageInfo([value.taskType]).nodeName }} |{{ stageInfo([value.taskType]).desc }}</span>
des[value.taskType]
}}</span>
</div> </div>
<div class="step-item-name" v-if="value.taskType">{{ activity_name[value.taskType]}}</div> <div class="step-item-name" v-if="value.taskType">{{ activity_name[value.taskType]}}</div>
...@@ -108,14 +104,14 @@ ...@@ -108,14 +104,14 @@
<el-popover placement="top-start" width="100" trigger="click"> <el-popover placement="top-start" width="100" trigger="click">
<div class="popover-panel" v-for="(t, pkey) in v" :key="pkey"> <div class="popover-panel" v-for="(t, pkey) in v" :key="pkey">
<div class="flex-column-center"> <div class="flex-column-center">
<span>{{ stage_time[t.taskType] }} </span> <span>{{ value.time }} </span>
<div :class="['stage-icon', `stage-${t.taskType}`]"></div> <div :class="['stage-icon', `stage-${t.taskType}`]"></div>
</div> </div>
<div class="stage-desc">{{ stage[t.taskType] }}</div> <div class="stage-desc">{{ stageInfo([t.taskType]).nodeName }}</div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length <= 2"> <div slot="reference" class="flex-column-center" v-if="v.length <= 2">
<span>{{ stage_time[value.taskType] }}</span> <span>{{ value.time }} </span>
<!-- 1 => 门店助手--> <!-- 1 => 门店助手-->
<!-- 2 => AI外呼--> <!-- 2 => AI外呼-->
<!-- 3 => 短信--> <!-- 3 => 短信-->
...@@ -206,8 +202,9 @@ const STAGE_PREFIX = Object.freeze({ ...@@ -206,8 +202,9 @@ const STAGE_PREFIX = Object.freeze({
}, },
6: '查询内容:' 6: '查询内容:'
}) })
// import empDetail from './empDetail' import model from '@/mixins/model'
export default { export default {
mixins: [model],
components: { components: {
// empDetail // empDetail
}, },
...@@ -260,6 +257,22 @@ export default { ...@@ -260,6 +257,22 @@ export default {
created() { created() {
}, },
methods: { methods: {
//获取sop映射字段
stageInfo(i) {
if (this.modelList) {
return this.modelList.find(item => item.id == i)
} else {
return {
nodeName: '',
desc: ''
}
}
},
spiltString(val, n) {
const title = JSON.parse(val.paramRemark).title
return title
// return (title.split('-')[n] || '').replace('文字备注:', '')
},
//查看详情 //查看详情
getEmpDetail() { getEmpDetail() {
this.empVisible = true this.empVisible = true
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08 * @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-23 15:28:49 * @LastEditTime: 2024-01-03 13:37:45
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue * @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<div class="border-content"> <div class="border-content">
<div class="journey-step-info" v-for="(stepItem, k) in configList" :key="k"> <div class="journey-step-info" v-for="(stepItem, k) in configList" :key="k">
<!-- v-if="stepItem.sopList.flat(Initify).length>0"--> <!-- v-if="stepItem.sopList.flat(Initify).length>0"-->
<div > <div>
<div :class="{ 'collapse-item': true, 'is-active': stepItem.isExpaned }"> <div :class="{ 'collapse-item': true, 'is-active': stepItem.isExpaned }">
<div class="collapse-item-tab flex-column-center pl20"> <div class="collapse-item-tab flex-column-center pl20">
<i class="el-icon-caret-bottom" v-show="stepItem.isExpaned" @click="handleExpand(stepItem)"></i> <i class="el-icon-caret-bottom" v-show="stepItem.isExpaned" @click="handleExpand(stepItem)"></i>
...@@ -18,17 +18,14 @@ ...@@ -18,17 +18,14 @@
<div class="tab-label"> <div class="tab-label">
{{ stepItem.label }} {{ stepItem.label }}
</div> </div>
<div v-if="!isDisabled" class="count-num">已启用数量/全部sop数量:{{ <div v-if="!isDisabled" class="count-num">已启用数量/全部sop数量:{{ computedSopSet[k].flat(Inifity).filter(item => item.nodeSkip !== '1').length }}/{{ stepItem.sopList.flat(Inifity).length }}</div>
computedSopSet[k].flat(Inifity).filter(item => item.nodeSkip !== "1").length
}}/{{ stepItem.sopList.flat(Inifity).length }}
</div>
</div> </div>
<div class="collapse-item-panel" :style="{ display: stepItem.isExpaned ? 'block' : 'none' }"> <div class="collapse-item-panel" :style="{ display: stepItem.isExpaned ? 'block' : 'none' }">
<div class="task-item"> <div class="task-item">
<template v-if="stepItem.conditionsList.length > 0"> <template v-if="stepItem.conditionsList.length > 0">
<div class="task-item-head flex-column-center"> <div class="task-item-head flex-column-center">
<div class="task-item-icon"> <div class="task-item-icon">
<img src="@/assets/config/log.png"/> <img src="@/assets/config/log.png" />
</div> </div>
<div class="task-item-name">进入条件</div> <div class="task-item-name">进入条件</div>
<div class="task-item-desc">(描述用户触发何种条件后,将自动变更为该旅程阶段)</div> <div class="task-item-desc">(描述用户触发何种条件后,将自动变更为该旅程阶段)</div>
...@@ -36,15 +33,13 @@ ...@@ -36,15 +33,13 @@
<div class="progress-item-content bg-fff"> <div class="progress-item-content bg-fff">
<div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k"> <div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k">
<span>条件{{ k + 1 }}</span> <span>条件{{ k + 1 }}</span>
<span>{{ v.split("-")[0] }}</span> <span>{{ spiltString(v) }}</span>
<img v-show="v.split('-').length > 1" src="@/assets/config/arrow.png"/>
<span>{{ v.split("-")[1] }}</span>
</div> </div>
</div> </div>
</template> </template>
<template v-if="stepItem.conditionsList.length == 0"> <template v-if="stepItem.conditionsList.length == 0">
<div class="empty-task"> <div class="empty-task">
<img src="@/assets/config/empty-sop.png"/> <img src="@/assets/config/empty-sop.png" />
<div class="empty-text">暂无进入条件</div> <div class="empty-text">暂无进入条件</div>
</div> </div>
</template> </template>
...@@ -54,7 +49,7 @@ ...@@ -54,7 +49,7 @@
<div class="task-sop-l"> <div class="task-sop-l">
<div class="task-item-head flex-column-center"> <div class="task-item-head flex-column-center">
<div class="task-item-icon"> <div class="task-item-icon">
<img src="@/assets/config/sop.png"/> <img src="@/assets/config/sop.png" />
</div> </div>
<div class="task-item-name">SOP任务</div> <div class="task-item-name">SOP任务</div>
<div class="task-item-desc">(系统面向当前旅程阶段客户的营销计划)</div> <div class="task-item-desc">(系统面向当前旅程阶段客户的营销计划)</div>
...@@ -62,29 +57,17 @@ ...@@ -62,29 +57,17 @@
<div class="task-item-content bg-fff"> <div class="task-item-content bg-fff">
<div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k"> <div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k">
<div class="step-item-day" v-if="v.length > 0"> <div class="step-item-day" v-if="v.length > 0">
<img src="@/assets/config/step-border.png"/> <img src="@/assets/config/step-border.png" />
<span v-if="v[0].day">第{{ v[0].day.defaultValue }}天</span> <span v-if="v[0].day">第{{ v[0].day.defaultValue }}天</span>
</div> </div>
<div class="step-item-content"> <div class="step-item-content">
<div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center"> <div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
<div style="width: 100%"> <div style="width: 100%">
<div class="step-item-desc" v-if="value.taskType"> <div class="step-item-desc" v-if="value.taskType">
<span>[ {{stage_time[value.taskType.defaultValue]}} ]发送 | {{ stage[value.taskType.defaultValue] }} |{{ <span>{{ value.time.defaultValue }}发送 | {{ stageInfo([value.taskType.defaultValue]).nodeName }} |{{ stageInfo([value.taskType.defaultValue]).desc }}</span>
des[value.taskType.defaultValue] <el-switch v-model="value.nodeSkip" active-color="#5850FF" inactive-color="#c6c6c6" active-text="开" inactive-text="关" active-value="0" inactive-value="1" :disabled="value.nodeSkipable == 0"></el-switch>
}}</span>
<el-switch
v-model="value.nodeSkip"
active-color="#5850FF"
inactive-color="#c6c6c6"
active-text="开"
inactive-text="关"
active-value="0"
inactive-value="1"
:disabled="value.nodeSkipable == 0"
>
</el-switch>
</div> </div>
<div class="step-item-name" v-if="value.taskType.defaultValue">{{activity_name[value.taskType.defaultValue]}}</div> <div class="step-item-name" v-if="value.taskType.defaultValue">{{ activity_name[value.taskType.defaultValue] }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -94,7 +77,7 @@ ...@@ -94,7 +77,7 @@
<div class="task-sop-calendar"> <div class="task-sop-calendar">
<div class="task-item-head flex-column-center"> <div class="task-item-head flex-column-center">
<div class="task-item-icon"> <div class="task-item-icon">
<img src="@/assets/config/calendar.png"/> <img src="@/assets/config/calendar.png" />
</div> </div>
<div class="task-item-name">SOP日历</div> <div class="task-item-name">SOP日历</div>
</div> </div>
...@@ -106,20 +89,18 @@ ...@@ -106,20 +89,18 @@
<el-popover placement="top-start" width="100" trigger="click"> <el-popover placement="top-start" width="100" trigger="click">
<div class="popover-panel" v-for="(t, pkey) in v" :key="pkey"> <div class="popover-panel" v-for="(t, pkey) in v" :key="pkey">
<div class="flex-column-center" v-if="t.nodeSkip == '0'"> <div class="flex-column-center" v-if="t.nodeSkip == '0'">
<span>{{ stage_time[value.taskType.defaultValue] }}</span> <span>{{ value.time.defaultValue }}</span>
<div :class="['stage-icon', `stage-${t.taskType.defaultValue}`]"></div> <div :class="['stage-icon', `stage-${t.taskType.defaultValue}`]"></div>
</div> </div>
<div class="stage-desc"> <!-- <div class="stage-desc">{{ stageInfo([t.taskType]).nodeName }}</div> -->
{{ stage[t.taskType.defaultValue] }}
</div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length <= 2 && value.nodeSkip =='0'"> <div slot="reference" class="flex-column-center" v-if="v.length <= 2 && value.nodeSkip == '0'">
<span>{{ stage_time[value.taskType.defaultValue] }}</span> <span>{{ value.time.defaultValue }}</span>
<div :class="['stage-icon', `stage-${value.taskType.defaultValue}`]"></div> <div :class="['stage-icon', `stage-${value.taskType.defaultValue}`]"></div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0"> <div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0">
<span>{{v.filter(item => item.nodeSkip == '0').length}}个任务</span> <span>{{ v.filter(item => item.nodeSkip == '0').length }}个任务</span>
</div> </div>
</el-popover> </el-popover>
</div> </div>
...@@ -131,11 +112,10 @@ ...@@ -131,11 +112,10 @@
</template> </template>
<div v-if="stepItem.sopList.length == 0"> <div v-if="stepItem.sopList.length == 0">
<div class="empty-sop"> <div class="empty-sop">
<img src="@/assets/config/empty-sop.png"/> <img src="@/assets/config/empty-sop.png" />
<div class="empty-text">暂无sop任务</div> <div class="empty-text">暂无sop任务</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- <emp-detail v-if="empVisible" :empVisible="empVisible"></emp-detail> --> <!-- <emp-detail v-if="empVisible" :empVisible="empVisible"></emp-detail> -->
...@@ -143,7 +123,6 @@ ...@@ -143,7 +123,6 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
const STAGE_TIME = Object.freeze({ const STAGE_TIME = Object.freeze({
...@@ -162,7 +141,7 @@ const STAGE = { ...@@ -162,7 +141,7 @@ const STAGE = {
5: '跟进提醒', 5: '跟进提醒',
6: '客户信息查询' 6: '客户信息查询'
} }
const ACTIVITY_NAME ={ const ACTIVITY_NAME = {
4: '活动链接', 4: '活动链接',
3: '活动链接', 3: '活动链接',
1: '短信模版', 1: '短信模版',
...@@ -199,8 +178,9 @@ const STAGE_PREFIX = Object.freeze({ ...@@ -199,8 +178,9 @@ const STAGE_PREFIX = Object.freeze({
}, },
6: '查询内容:' 6: '查询内容:'
}) })
// import empDetail from './empDetail' import model from '@/mixins/model'
export default { export default {
mixins: [model],
components: { components: {
// empDetail // empDetail
}, },
...@@ -224,15 +204,10 @@ export default { ...@@ -224,15 +204,10 @@ export default {
configList: { configList: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
console.log(newValue) console.log(newValue)
let sopList = Array.from(newValue, item => let sopList = Array.from(newValue, item => Array.from(item.sopList, sub => Array.from(sub, subItem => ({ nodeId: subItem.nodeId, nodeSkip: subItem.nodeSkip }))))
Array.from(item.sopList, sub =>
Array.from(sub, subItem => ({nodeId: subItem.nodeId, nodeSkip: subItem.nodeSkip}))
)
)
;
this.computedSopSet = JSON.parse(JSON.stringify(sopList)) this.computedSopSet = JSON.parse(JSON.stringify(sopList))
sopList = sopList.flat(Infinity) sopList = sopList.flat(Infinity)
this.$bus.$emit('sopListSet', {sopList}) this.$bus.$emit('sopListSet', { sopList })
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -244,16 +219,34 @@ export default { ...@@ -244,16 +219,34 @@ export default {
des: DES, des: DES,
stage_prefix: STAGE_PREFIX, stage_prefix: STAGE_PREFIX,
stage_time: STAGE_TIME, stage_time: STAGE_TIME,
activity_name:ACTIVITY_NAME, activity_name: ACTIVITY_NAME,
empVisible: false, empVisible: false,
nodes: null, nodes: null,
sopList: [], sopList: [],
computedSopSet: [] computedSopSet: []
} }
}, },
created() { created() {},
},
methods: { methods: {
stageMap(val) {
console.log(val)
},
//获取sop映射字段
stageInfo(i) {
if (this.modelList) {
return this.modelList.find(item => item.id == i)
} else {
return {
nodeName: '',
desc: ''
}
}
},
spiltString(val, n) {
const title = JSON.parse(val.paramRemark).title
return title
// return (title.split('-')[n] || '').replace('文字备注:', '')
},
//查看详情 //查看详情
getEmpDetail() { getEmpDetail() {
this.empVisible = true this.empVisible = true
...@@ -266,8 +259,7 @@ export default { ...@@ -266,8 +259,7 @@ export default {
this.$emit('changeNode', this.nodes) this.$emit('changeNode', this.nodes)
} }
}, },
mounted() { mounted() {}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -593,23 +585,23 @@ export default { ...@@ -593,23 +585,23 @@ export default {
.el-switch .el-switch__label { .el-switch .el-switch__label {
width: 70px; width: 70px;
} }
.empty-sop{ .empty-sop {
background: #F9FAFE; background: #f9fafe;
text-align: center; text-align: center;
padding: 16px 0; padding: 16px 0;
margin-bottom: 10px; margin-bottom: 10px;
.empty-text{ .empty-text {
color: #666666; color: #666666;
font-size: 12px; font-size: 12px;
} }
} }
.empty-task{ .empty-task {
background: #FFFFFF; background: #ffffff;
text-align: center; text-align: center;
padding: 20px 0; padding: 20px 0;
margin-bottom: 10px; margin-bottom: 10px;
.empty-text{ .empty-text {
color: #666666; color: #666666;
font-size: 12px; font-size: 12px;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08 * @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 20:38:17 * @LastEditTime: 2024-01-03 12:27:30
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue * @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
<el-input v-model="addForm.name"></el-input> <el-input v-model="addForm.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="圈化人群的方式:" :size="size"> <el-form-item label="圈化人群的方式:" :size="size">
<el-select v-model="addForm.region" placeholder="请选择"> <el-select v-model="addForm.region" placeholder="请选择" @change="handleSelectType" :disabled="query.title">
<el-option :label="item.name" :value="item.code" :key="item.code" v-for="item in sopDataTypes"></el-option> <el-option :label="item.name" :value="item.code" :key="item.code" v-for="item in sopDataTypes"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="journey-step bg-fff pb20"> <div class="journey-step bg-fff pb20" v-if="addForm.region">
<div class="journey-step-title border-title"> <div class="journey-step-title border-title">
客户旅程阶段配置 客户旅程阶段配置
</div> </div>
...@@ -31,15 +31,15 @@ ...@@ -31,15 +31,15 @@
</div> </div>
<div class="journey-step-info" v-for="(val, k) in configList" :key="k"> <div class="journey-step-info" v-for="(val, k) in configList" :key="k">
<template v-if="val.label"> <template v-if="val.label">
<collapse-item :stepItem="val" :activityInfo="activityInfo" @openDrawer="openDrawer" @openCondition="openCondition"> <collapse-item :stepItem="val" :activityInfo="activityInfo" :key="k" :ref="`collapse_${k}`">
<el-button type="text" @click.stop="openCondition()">新增</el-button> <el-button type="text" @click.stop="openCondition(k)">新增</el-button>
<el-button type="text" @click.stop="handleEditJ(k)">编辑</el-button> <el-button type="text" @click.stop="handleEditJ(k)">编辑</el-button>
<el-button type="text" @click.stop="handleDelete(k)">删除</el-button> <el-button type="text" @click.stop="handleDelete(k)">删除</el-button>
</collapse-item> </collapse-item>
</template> </template>
<div class="journey-add-panel" v-if="addStatus && k == addNo"> <div class="journey-add-panel" v-if="addStatus && k == addNo">
<div class="flex-column-center "> <div class="flex-column-center ">
<el-input v-model="modelInput.label"></el-input> <el-input v-model.trim="modelInput.label"></el-input>
<div class="mark-item"> <div class="mark-item">
<label>手动标记:</label> <label>手动标记:</label>
<el-radio-group v-model="modelInput.editable"> <el-radio-group v-model="modelInput.editable">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</div> </div>
<div class="mark-operate"> <div class="mark-operate">
<el-button type="text" @click.stop="saveStep">保存</el-button> <el-button type="text" @click.stop="saveStep">保存</el-button>
<el-button type="text" @click.stop="addStatus = false">取消</el-button> <el-button type="text" @click.stop="cancelStep">取消</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -64,23 +64,20 @@ ...@@ -64,23 +64,20 @@
<el-button size="small" type="primary" @click.stop="cancelModel">取消</el-button> <el-button size="small" type="primary" @click.stop="cancelModel">取消</el-button>
<el-button size="small" type="primary" @click.stop="saveModel">确认</el-button> <el-button size="small" type="primary" @click.stop="saveModel">确认</el-button>
</div> </div>
<concatActivity :activityVisible="activityVisible" v-if="activityVisible" @closeActivity="closeActivity"></concatActivity>
<sop-item :drawerVisible="drawerVisible" @closeDrawer="closeDrawer"></sop-item>
</div> </div>
</template> </template>
<script> <script>
import CollapseItem from './components/CollapseItem' import CollapseItem from './components/CollapseItem'
import concatActivity from './components/concatActivity'
import sopItem from './components/sopItem'
export default { export default {
components: { components: {
CollapseItem, CollapseItem
concatActivity, // concatActivity
sopItem // sopItem
}, },
data() { data() {
return { return {
drawerVisible: false, drawerVisible: false,
dataTypeCode: '',
sopDataTypes: [], sopDataTypes: [],
activityVisible: false, activityVisible: false,
addStatus: false, addStatus: false,
...@@ -88,46 +85,77 @@ export default { ...@@ -88,46 +85,77 @@ export default {
activityInfo: {}, activityInfo: {},
configList: [], configList: [],
modelInput: {}, modelInput: {},
query: {},
addForm: { addForm: {
name: '' name: '',
region: ''
}, },
rules: { rules: {
name: [{ required: true, message: '请输入旅程名称', trigger: 'blur' }] name: [{ required: true, message: '请输入旅程名称', trigger: 'blur' }]
} }
} }
}, },
provide() {
return {
stepList: this.stepList,
app: this
}
},
mounted() { mounted() {
const query = this.$route.query this.query = this.$route.query || {}
this.query = query if (this.query.title) {
this.addForm.name = query.title this.addForm.name = this.query.title
if (this.query.instId) this.getDetail() this.getDetail()
}
this.sopDataTypesList() this.sopDataTypesList()
}, },
watch: {
'addForm.region'(val) {
this.dataTypeCode = val
this.$apis.journeyModel.sopConditionList({ dataTypeCode: val }).then(res => {
this.stepList = res
})
}
},
computed: {
journeyList() {
return this.configList.map(i => i.label)
}
},
methods: { methods: {
openDrawer() { showError(message) {
this.drawerVisible = true this.$message({
}, type: 'error',
closeDrawer(val) { message
if (val) { })
const time = new Date(val.time).toLocaleTimeString()
}
this.drawerVisible = false
}, },
closeActivity() { closeActivity() {
this.activityVisible = false this.activityVisible = false
}, },
openCondition() { openCondition(k) {
console.log(888) this.$refs[`collapse_${k}`][0].activityVisible = true
this.activityVisible = true
}, },
//保存模板
saveModel() { saveModel() {
const stage = this.configList.map((item, k) => { if (!this.addForm.name) {
return { return this.showError('请输入旅程旅程名称!')
['stage' + (k + 1)]: { }
editable: item.editable, if (!this.addForm.region) {
conditions: [], return this.showError('请选择圈化人群的方式')
value: '' }
} if (this.configList.length == 0) {
return this.showError('请配置客户旅程阶段')
}
if (!this.configList[0].label) {
return this.showError('请配置客户旅程阶段')
}
let stage = {}
this.configList.forEach((item, k) => {
stage['stage' + (k + 1)] = {
editable: item.editable,
conditions: item.conditionsList,
value: item.label
} }
}) })
const nodes = [] const nodes = []
...@@ -136,12 +164,10 @@ export default { ...@@ -136,12 +164,10 @@ export default {
days.forEach(k => { days.forEach(k => {
nodes.push({ nodes.push({
nodeParamDef: JSON.stringify({ nodeParamDef: JSON.stringify({
stage: { stage: { defaultValue: k.stage },
defaultValue: k.stage, day: { defaultValue: k.day },
day: { defaultValue: k.day }, time: {
time: { defaultValue: k.time
defaultValue: k.time
}
} }
}), }),
nodeProtoId: k.taskType nodeProtoId: k.taskType
...@@ -150,7 +176,7 @@ export default { ...@@ -150,7 +176,7 @@ export default {
}) })
}) })
const dataTypeCode = { const dataTypeCode = {
defaultValue: this.addForm.region, dataTypeCode: { defaultValue: this.addForm.region },
stages: { stages: {
defaultValue: stage defaultValue: stage
} }
...@@ -158,16 +184,21 @@ export default { ...@@ -158,16 +184,21 @@ export default {
let params = { let params = {
tplId: this.query.instId, tplId: this.query.instId,
tplIame: this.addForm.name, tplName: this.addForm.name,
tplParamDef: JSON.stringify(dataTypeCode), tplParamDef: JSON.stringify(dataTypeCode),
nodes nodes
} }
console.log(params) console.log(params)
this.$apis.journeyModel.sopTplsSave(params).then(res => { this.$apis.journeyModel.sopTplsSave(params).then(res => {
console.log(res) if (res) {
this.$router.go(-1)
}
}) })
}, },
cancelStep() {
this.$router.go(-1)
},
handleDelete(k) { handleDelete(k) {
this.$confirm('是否确定提交?', '提示', { this.$confirm('是否确定提交?', '提示', {
confirmButtonText: '是', confirmButtonText: '是',
...@@ -183,9 +214,17 @@ export default { ...@@ -183,9 +214,17 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
//保存客户旅程阶段配置
saveStep() { saveStep() {
const len = this.addNo, const len = this.addNo,
{ label, editable } = this.modelInput { label, editable } = this.modelInput
if (!label) {
this.$message({
type: 'error',
message: '请输入旅程阶段名称!'
})
return
}
Object.assign(this.configList[len], { label, editable }) Object.assign(this.configList[len], { label, editable })
this.addStatus = false this.addStatus = false
}, },
...@@ -197,6 +236,7 @@ export default { ...@@ -197,6 +236,7 @@ export default {
editable: this.configList[i].editable editable: this.configList[i].editable
} }
}, },
//添加客户旅程阶段配置
addStep() { addStep() {
this.addStatus = true this.addStatus = true
this.modelInput = { this.modelInput = {
...@@ -211,55 +251,77 @@ export default { ...@@ -211,55 +251,77 @@ export default {
}) })
this.addNo = this.configList.length - 1 this.addNo = this.configList.length - 1
}, },
//获取圈化人群的方式
sopDataTypesList() { sopDataTypesList() {
this.$apis.journeyModel.sopDataTypesList({}).then(res => { this.$apis.journeyModel.sopDataTypesList({}).then(res => {
this.sopDataTypes = res this.sopDataTypes = res
}) })
}, },
//获取详情
getDetail() { getDetail() {
this.$apis.journeyModel.getInstIdDetail({ instId: 'xblc7' }).then(res => { this.$apis.journeyModel.getInstIdDetail({ instId: this.query.instId }).then(res => {
const instParam = JSON.parse(res.instParam) const instParam = JSON.parse(res.tplParamDef)
const stages = instParam.stages this.addForm.region = instParam.dataTypeCode.defaultValue
const instStatus = res.instStatus const stages = Object.values(instParam.stages.defaultValue)
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 && activityId) {
this.journeyStatus = 3
}
if (instStatus == -1 && activityId) {
this.journeyStatus = 4
}
const nodes = res.nodes const nodes = res.nodes
const configList = [] const configList = []
for (let k in stages) { for (let i = 0; i < stages.length; i++) {
const s = stages[i]
if (!s) continue
let list = [] let list = []
for (let v of nodes) { for (let v of nodes) {
if (v.nodeParam && JSON.parse(v.nodeParam).stage == stages[k].value) { console.log(v.nodeParamDef && JSON.parse(v.nodeParamDef).stage, 'v.nodeParamDef && JSON.parse(v.nodeParamDef).stage')
list.push(JSON.parse(v.nodeParam)) if (v.nodeParamDef && JSON.parse(v.nodeParamDef).stage.defaultValue == s.value) {
const nodeParamDef = JSON.parse(v.nodeParamDef)
list.push({
day: nodeParamDef.day?.defaultValue,
stage: nodeParamDef.stage?.defaultValue,
taskType: v.nodeProtoId,
stageid: nodeParamDef.stageid?.defaultValue,
time: nodeParamDef.time?.defaultValue
})
} }
} }
list = list.filter(item => item.day) list = list.filter(item => item.day)
list.sort((a, b) => { list.sort((a, b) => {
return a.day - b.day return a.day - b.day
}) })
console.log(list, 'list')
const sopList = this.groupBy(list, 'day') const sopList = this.groupBy(list, 'day')
configList.push({ configList.push({
label: stages[k].value, label: s.value,
isExpaned: false, isExpaned: false,
editable: stages[k].value, editable: s.editable,
conditionsList: stages[k].conditions || [], conditionsList: s.conditions || [],
sopList sopList
}) })
} }
this.configList = configList this.configList = configList
}) })
}, },
//清空sop任务
clearSop() {
this.configList.forEach(item => {
item.conditionsList = []
item.sopList = []
})
},
//修改圈化人群的方式
handleSelectType(e) {
const code = this.dataTypeCode
if (!code) return
this.$confirm('该操作将清空进入条件及SOP任务,是否确认修改?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.clearSop()
})
.catch(() => {
this.addForm.region = code
})
},
groupBy(list, name) { groupBy(list, name) {
const m = new Map() const m = new Map()
list.map(item => { list.map(item => {
......
<!-- <!--
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-22 20:36:05
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-03 12:32:18
* @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\CollapseItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08 * @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 20:33:10 * @LastEditTime: 2024-01-03 10:53:58
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue * @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -28,12 +36,15 @@ ...@@ -28,12 +36,15 @@
</div> </div>
<div class="progress-item-content bg-fff" v-if="stepItem.conditionsList.length"> <div class="progress-item-content bg-fff" v-if="stepItem.conditionsList.length">
<div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k"> <div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k">
<span>条件{{ k + 1 }}</span> <div class="progress-item-num">
<span>{{ spiltString(v, 0) }}</span> <span>条件{{ k + 1 }}</span>
<img src="@/assets/config/arrow.png" v-if="spiltString(v, 1)" /> <span>{{ spiltString(v) }}</span>
<span>{{ spiltString(v, 1) }}</span> </div>
<div class="progress-edit">
<el-button type="text" @click.stop="showEditCondition(v, k)">编辑</el-button>
<el-button type="text" @click.stop="handleDeleteCondition(k)">删除</el-button>
</div>
</div> </div>
<div class="progress-edit" @click.stop="showEdit">编辑</div>
</div> </div>
<div class="empty-panel" v-else> <div class="empty-panel" v-else>
<div class="empty-img"> <div class="empty-img">
...@@ -59,18 +70,21 @@ ...@@ -59,18 +70,21 @@
</div> </div>
<div class="task-item-content bg-fff" v-if="stepItem.sopList.length"> <div class="task-item-content bg-fff" v-if="stepItem.sopList.length">
<div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k"> <div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k">
<div class="step-item-day"> <div class="step-item-day" v-if="v.length">
<img src="@/assets/config/step-border.png" /> <img src="@/assets/config/step-border.png" />
<span v-if="v.length">第{{ v[0].day }}天</span> <span>第{{ v[0].day }}天</span>
</div> </div>
<div class="step-item-content"> <div class="step-item-content" v-if="v.length">
<div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center"> <div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
<div> <div>
<div class="step-item-desc"> <div class="step-item-desc flex-column-center">
<span>[{{ stage_time[value.taskType] }}]发送 | {{ stage[value.taskType] }} |{{ stage_info[value.taskType] }}</span> <div class="step-item_node">
</div> <span>[{{ value.time }}]发送 | {{ stageInfo([value.taskType]).nodeName }} |{{ stageInfo([value.taskType]).desc }}</span>
<div class="step-item-name flex-column-center " v-if="value.taskType"> </div>
<div class="task-type">{{ stage_prefix[value.taskType].key ? activityInfo[stage_prefix[value.taskType].key] : remind(stage_prefix[value.taskType], k) }}</div> <div class="step-item_btn">
<el-button type="text" @click.stop="handleEdit(value, v, key)">编辑</el-button>
<el-button type="text" @click.stop="handleDelete(v, key)">删除</el-button>
</div>
</div> </div>
</div> </div>
<!-- <div class="step-detail-btn" @click="getEmpDetail">详情</div> --> <!-- <div class="step-detail-btn" @click="getEmpDetail">详情</div> -->
...@@ -102,14 +116,14 @@ ...@@ -102,14 +116,14 @@
<el-popover placement="top-start" width="100" trigger="click"> <el-popover placement="top-start" width="100" trigger="click">
<div class="popover-panel" v-for="(t, pkey) in v" :key="pkey"> <div class="popover-panel" v-for="(t, pkey) in v" :key="pkey">
<div class="flex-column-center"> <div class="flex-column-center">
<span>{{ stage_time[t.taskType] }}</span> <span>{{ value.time }}</span>
<div :class="['stage-icon', `stage-${stage_icon[t.taskType]}`]"></div> <div :class="['stage-icon', `stage-${stage_icon[t.taskType]}`]"></div>
</div> </div>
<div class="stage-desc">{{ stage[t.taskType] }}</div> <div class="stage-desc">{{ stageInfo([t.taskType]).nodeName }}</div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length <= 2"> <div slot="reference" class="flex-column-center" v-if="v.length <= 2">
<span>{{ stage_time[value.taskType] }}</span> <span>{{ value.time }}</span>
<div :class="['stage-icon', `stage-${stage_icon[value.taskType]}`]"></div> <div :class="['stage-icon', `stage-${stage_icon[value.taskType]}`]"></div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0"> <div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0">
...@@ -126,6 +140,8 @@ ...@@ -126,6 +140,8 @@
</div> </div>
</div> </div>
<stat-dialog v-if="statVisible" :statVisible="statVisible"></stat-dialog> <stat-dialog v-if="statVisible" :statVisible="statVisible"></stat-dialog>
<sop-item :drawerVisible="drawerVisible" @closeDrawer="closeDrawer" ref="sopForm"></sop-item>
<concatActivity :activityVisible="activityVisible" v-if="activityVisible" @closeActivity="closeActivity" ref="activityForm"></concatActivity>
</div> </div>
</template> </template>
<script> <script>
...@@ -184,11 +200,15 @@ const STAGE_PREFIX = Object.freeze({ ...@@ -184,11 +200,15 @@ const STAGE_PREFIX = Object.freeze({
}) })
// import editCondition from './editCondition' // import editCondition from './editCondition'
import { mapMutations, mapState } from 'vuex'
import sopItem from './sopItem'
import concatActivity from './concatActivity'
import model from '@/mixins/model'
export default { export default {
mixins: [model],
components: { components: {
// sopItem sopItem,
// statDialog, concatActivity
// editCondition // editCondition
}, },
props: { props: {
...@@ -203,6 +223,7 @@ export default { ...@@ -203,6 +223,7 @@ export default {
}, },
data() { data() {
return { return {
sopIndex: [],
stage: STAGE, stage: STAGE,
stage_icon: ICON, stage_icon: ICON,
stage_info: STAGE_INFO, stage_info: STAGE_INFO,
...@@ -211,62 +232,109 @@ export default { ...@@ -211,62 +232,109 @@ export default {
empVisible: false, empVisible: false,
statVisible: false, statVisible: false,
conditionVisible: false, conditionVisible: false,
activityVisible: false,
drawerVisible: false drawerVisible: false
} }
}, },
created() {},
computed: {
...mapState('model', ['STEP', 'model'])
},
watch: {
STEP: {
handler(val) {
if (this.model == this.stepItem.label) {
this.addSopList(val)
}
},
deep: true
}
},
methods: { methods: {
...mapMutations('model', ['SET_MODEL']), //获取sop映射字段
stageInfo(i) {
if (this.modelList) {
return this.modelList.find(item => item.id == i)
} else {
return {
nodeName: '',
desc: ''
}
}
},
//删除sop任务
handleDelete(val, k) {
val.splice(k, 1)
},
//新增条件
closeActivity(val) {
if (!val) {
this.activityVisible = false
return
}
const idx = val.condition_i
if (idx === null) {
this.stepItem.conditionsList.push(val.conditionList)
} else {
this.stepItem.conditionsList[idx] = val.conditionList
}
this.activityVisible = false
},
closeDrawer(val) {
if (val) this.addSopList(val)
this.drawerVisible = false
},
handleEdit(val, k1, k2) {
this.sopIndex = [k1, k2]
this.drawerVisible = true
this.$refs.sopForm.setForm(val)
},
//显示sop弹框
addSop() { addSop() {
this.SET_MODEL(this.stepItem.label) this.sopIndex = []
this.$emit('openDrawer') this.drawerVisible = true
// this.SET_MODEL(this.stepItem.label)
// this.$emit('openDrawer')
}, },
//显示sop任务
addSopList(val) { addSopList(val) {
console.log(val, this.stepItem, '33333') if (this.sopIndex.length) {
const [i, j] = this.sopIndex
i.splice(j, 1)
}
const i = this.stepItem.sopList.findIndex(i => { const i = this.stepItem.sopList.findIndex(i => {
console.log(i, 'i')
if (i && i[0]) return i[0].day == val.day if (i && i[0]) return i[0].day == val.day
}), }),
model = { model = {
day: val.day, day: val.day,
stage: this.model, stage: this.stepItem.label,
time: val.time,
taskType: val.nodeProtoId taskType: val.nodeProtoId
} }
if (i > -1) { if (i > -1) {
this.stepItem.sopList[i].push(model) this.stepItem.sopList[i].push(model)
} else { } else {
this.stepItem.sopList.push([model]) this.stepItem.sopList.push([model])
} }
this.stepItem.sopList = this.stepItem.sopList.filter(i => i[0])
this.stepItem.sopList.sort((a, b) => a[0].day - b[0].day)
}, },
showEdit() { showEditCondition(val, index) {
this.$emit('openCondition') this.activityVisible = true
this.$nextTick(() => {
this.$refs.activityForm.$refs.conditionForm.setCondition(val, index)
})
},
handleDeleteCondition(k) {
this.$confirm('是否确定提交?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.stepItem.conditionsList.splice(k, 1)
this.$message({
type: 'success',
message: '删除成功!'
})
})
.catch(() => {})
}, },
showStat() { showStat() {
this.statVisible = true this.statVisible = true
}, },
remind(v, k) { spiltString(val, n) {
if (typeof v == 'string') return v const title = JSON.parse(val.paramRemark).title
if (this.stepItem.label == '保费报价') { return title
return v[this.stepItem.label][k] // return (title.split('-')[n] || '').replace('文字备注:', '')
} else {
return v[this.stepItem.label]
}
},
spiltString(str, n) {
return (str.split('-')[n] || '').replace('文字备注:', '')
}, },
//查看详情 //查看详情
getEmpDetail() { getEmpDetail() {
...@@ -291,6 +359,10 @@ export default { ...@@ -291,6 +359,10 @@ export default {
width: 48px; width: 48px;
height: 30px; height: 30px;
margin: 10px auto 4px; margin: 10px auto 4px;
img {
width: 100%;
height: 100%;
}
} }
} }
.collapse-item { .collapse-item {
...@@ -360,9 +432,6 @@ export default { ...@@ -360,9 +432,6 @@ export default {
.progress-item-content { .progress-item-content {
padding: 16px; padding: 16px;
margin: 10px 0px; margin: 10px 0px;
display: grid;
grid-template-columns: 50% 50%;
row-gap: 20px;
position: relative; position: relative;
.progress-edit { .progress-edit {
position: absolute; position: absolute;
...@@ -376,10 +445,12 @@ export default { ...@@ -376,10 +445,12 @@ export default {
.progress-item { .progress-item {
position: relative; position: relative;
padding-left: 20px; padding-left: 20px;
min-width: 50%;
height: 32px; height: 32px;
display: flex; display: flex;
align-items: center; align-items: center;
&-num {
flex: 1;
}
img { img {
width: 32px; width: 32px;
height: 4px; height: 4px;
...@@ -392,7 +463,6 @@ export default { ...@@ -392,7 +463,6 @@ export default {
width: 48px; width: 48px;
} }
&:last-child { &:last-child {
width: 80px;
} }
} }
&::before { &::before {
...@@ -426,8 +496,12 @@ export default { ...@@ -426,8 +496,12 @@ export default {
.step-item { .step-item {
.step-time-item { .step-time-item {
width: 100%;
padding: 12px 16px; padding: 12px 16px;
background: #f9fafe; background: #f9fafe;
> div {
width: 100%;
}
.step-detail-btn { .step-detail-btn {
margin-left: auto; margin-left: auto;
font-size: 14px; font-size: 14px;
...@@ -452,6 +526,13 @@ export default { ...@@ -452,6 +526,13 @@ export default {
.step-item-desc { .step-item-desc {
font-size: 14px; font-size: 14px;
color: #c6c6c6; color: #c6c6c6;
width: 100%;
.step-item_node {
width: calc(100% - 100px);
}
.step-item_btn {
width: 100px;
}
} }
.step-item-name { .step-item-name {
font-size: 14px; font-size: 14px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-27 11:29:17 * @Date: 2023-09-27 11:29:17
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 20:44:45 * @LastEditTime: 2024-01-03 10:23:21
* @FilePath: \scrm-micro-scene\src\views\journeyConfig\components\relatedActivity.vue * @FilePath: \scrm-micro-scene\src\views\journeyConfig\components\relatedActivity.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -17,9 +17,13 @@ ...@@ -17,9 +17,13 @@
<label>旅程阶段:</label> <label>旅程阶段:</label>
<span>意向客户</span> <span>意向客户</span>
</div> </div>
<condition></condition>
<div class="condition-item flex"> <div class="condition-item flex">
<label>进入条件:</label> <label>进入条件:</label>
<condition ref="conditionForm"></condition>
</div>
<!-- <div class="condition-item flex">
<label>进入条件:</label>
<div class="condition-panel" v-if="status == 1"> <div class="condition-panel" v-if="status == 1">
<el-select v-model="value" placeholder="请选择" :size="size"> <el-select v-model="value" placeholder="请选择" :size="size">
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
...@@ -63,7 +67,7 @@ ...@@ -63,7 +67,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</GLDialog> </GLDialog>
</template> </template>
...@@ -78,6 +82,7 @@ export default { ...@@ -78,6 +82,7 @@ export default {
}, },
data() { data() {
return { return {
conditionInfo: '',
status: 1, status: 1,
typeOptions: [ typeOptions: [
{ {
...@@ -128,22 +133,9 @@ export default { ...@@ -128,22 +133,9 @@ export default {
id: this.conditionList.length id: this.conditionList.length
}) })
}, },
// 成员弹窗 handleSure() {
handleConfirm() { const { conditionList, condition_i } = this.$refs.conditionForm;
console.log(this.$refs.membersForm.innerTags) this.$emit('closeActivity', { conditionList, condition_i })
if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList
this.openMembers()
this.isUpdate = true
this.editStatus = true
} else {
this.$message({
type: 'error',
message: '请选择成员'
})
}
}, },
handleAddEmp() { handleAddEmp() {
this.membersVisible = true this.membersVisible = true
......
...@@ -2,75 +2,179 @@ ...@@ -2,75 +2,179 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 13:34:43 * @Date: 2023-12-25 13:34:43
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-25 15:12:16 * @LastEditTime: 2024-01-03 10:19:09
* @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\condition.vue * @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\condition.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template>
<div>
<div class="condition-select flex">
<el-select v-model="step" placeholder="请选择" :size="size" @change="selectStep">
<el-option v-for="item in stepList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<div class="flex">
<el-select v-model="conditionIndex" placeholder="请选择" :size="size" class="m-r-10" v-if="this.conditionList.conditions && this.conditionList.conditions.length > 1">
<el-option v-for="(item, index) in this.conditionList.conditions" :key="index" :label="item.name" :value="index"></el-option>
</el-select>
<template v-if="condition && condition.operators && condition.operators.length">
<el-select v-model="operators" @change="condition.operators[operators].value = ''" placeholder="请选择" :size="size" class="m-r-10">
<el-option v-for="(item, index) in condition.operators" :key="index" :label="item.name" :value="index"></el-option>
</el-select>
<div class="condition-input" v-if="condition.operators[operators]">
<el-input v-model="condition.operators[operators].value"></el-input>
</div>
<span>天&nbsp;&nbsp;切换到此旅程阶段</span>
</template>
</div>
</div>
<div class="condition-more" v-if="condition && condition.subConditions">
<div>
<template>
<div class="flex-column-center m-t-10" v-for="(item, k) in condition.subConditions" :key="item.id">
<label>并且满足</label>
<el-select v-model="item.name" placeholder="请选择" :size="size" class="condition-1" v-if="item.operators">
<el-option v-for="itm in [item.name]" :key="itm" :label="itm" :value="itm"></el-option>
</el-select>
<el-select v-model="item.value" @change="item.operators[item.value].value = ''" placeholder="请选择" :size="size" class="condition-1" v-if="item.operators">
<el-option v-for="(itm, i) in item.operators" :key="i" :label="itm.name" :value="i"></el-option>
</el-select>
<div class="condition-input" v-if="item.operators[item.value].style == 'input'">
<el-input v-model="item.operators[item.value].value"></el-input>
</div>
<el-select v-model="item.operators[item.value].value" placeholder="请选择" :size="size" class="condition-2" v-if="item.operators[item.value].style == 'select'">
<el-option v-for="i in journeyList" :key="i" :label="i" :value="i"></el-option>
</el-select>
<i class="el-icon-delete" @click="delCondition(condition.subConditions, k)"></i>
</div>
<div class="condition-add" @click="addCondition(condition.subConditions)">
<i class="el-icon-circle-plus-outline"></i>
添加条件
</div>
</template>
</div>
</div>
</div>
</template>
<script> <script>
export default { export default {
data() { data() {
return { return {
conditionList: [ step: '',
{ condition_i: null,
conditions: [ conditionIndex: 0,
{ conditionList: [],
actionId: 5, condition: '',
id: 1, journeyList: [],
name: '进入旅程', stepList: [],
operators: [ operators: 0
{ id: 1, name: '等于', value: '=' },
{ id: 2, name: '不等于', value: '<>' }
]
},
{ actionId: 5, id: 2, name: '排除以下旅程阶段的客户', operators: [{ id: 8, name: '不包含', value: 'nin' }] }
],
id: 5,
name: '进入旅程',
type: 1
},
{
conditions: [
{ actionId: 6, id: 3, name: '进入旅程', value:'',operators: [{ id: 1, name: '等于', value: '=' }] },
{ actionId: 6, id: 4, name: '排除以下旅程阶段的客户', operators: [{ id: 8, name: '不包含', value: 'nin' }] }
],
id: 6,
name: '进入旅程',
type: 2
},
{ conditions: [{ actionId: 8, id: 5, name: '成功续保导入系统的客户', operators: [] }], id: 8, name: '基于国任业务', type: 2 },
{
conditions: [
{
type: 'select',
value: 7,
operators: [
{ actionId: 9, id: 6, name: '页面停留', operators: [] },
{ actionId: 9, id: 7, name: '页面点击', conditions: [{ type: 'input', unit: '秒', value: 1 },{ type: 'input', unit: '秒', value: 2 }] }
]
}
],
id: 9,
name: '基于页面行为',
type: 2
},
{ conditions: [], id: 1, name: '在膨胀金活动种导入的客户', type: 1 },
{ conditions: [], id: 2, name: '在膨胀金活动中下订的客户', type: 1 },
{ conditions: [], id: 3, name: '在膨胀金关联的AI电话中回复高意向的客户', type: 1 },
{ conditions: [], id: 4, name: '查看膨胀金活动的客户', type: 1 },
{ conditions: [], id: 7, name: '添加企微好友', type: 2 }
],
type:1
} }
}, },
render() { inject: ['stepList', 'app'],
const conditionType = ( mounted() {
<el-select v-model={this.type} placeholder="请选择" size="small" class="condition-1"> const stepList = this.app.stepList || []
{this.conditionList.map(item => { stepList.forEach(item => {
return <el-option key={item.id} label={item.name} value={item.id}></el-option> item.conditions.forEach(i => {
})} if (i.subConditions)
</el-select> i.subConditions.forEach(j => {
) j.value = 0
return <div class="condition-panel">{conditionType}</div> })
})
})
this.stepList = stepList
this.journeyList = this.app.journeyList
},
watch: {
conditionIndex(i) {
this.condition = this.conditionList.conditions[i]
}
},
methods: {
setCondition(val,index) {
this.step = val.id
this.conditionList = this.$common.utils.deepClone(val)
this.condition_i = index
this.condition = this.conditionList.conditions && this.conditionList.conditions[0]
},
delCondition(val, k) {
val.splice(k, 1)
},
addCondition(val) {
const l = val.length,
prop = this.$common.utils.deepClone(val[l - 1])
prop.id++
val.push(prop)
},
selectStep(e) {
const conditions = this.stepList.find(item => {
return item.id == e
})
this.conditionList = this.$common.utils.deepClone(conditions)
this.condition = this.conditionList.conditions[0]
}
} }
} }
</script> </script>
<style lang="scss" scoped>
.dialog-body {
padding: 0px 50px;
}
.require {
color: red;
}
.condition-item {
line-height: 30px;
font-size: 14px;
color: #666666;
.condition-more {
background: #f9f9f9;
padding: 20px;
margin-top: 10px;
.condition-1 {
width: 136px;
margin: 0 10px;
}
.condition-2 {
width: 136px;
}
i {
color: #999999;
margin-left: 10px;
cursor: pointer;
}
.condition-add {
display: flex;
align-items: center;
margin-top: 10px;
cursor: pointer;
i {
font-size: 20px;
margin-right: 6px;
color: #5850ff;
}
font-size: 12px;
color: #5850ff;
}
}
.condition-input {
a {
color: #5850ff;
}
/deep/ {
.el-input {
width: 136px;
margin: 0px 4px;
}
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
span {
color: #333333;
}
}
</style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 14:31:26 * @Date: 2023-12-25 14:31:26
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-12-27 17:00:33 * @LastEditTime: 2024-01-02 17:59:48
* @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\sopItem.vue * @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\sopItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEVid * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEVid
--> -->
...@@ -21,10 +21,9 @@ ...@@ -21,10 +21,9 @@
<label>*</label> <label>*</label>
<span>请选择触达方式:</span> <span>请选择触达方式:</span>
<div class="select-panel"> <div class="select-panel">
<div class="select-item" v-for="item in list" :key="item.id"> <div class="select-item" v-for="item in modelList" :key="item.id">
<div class="select-value"> <div class="select-value">
<el-radio v-model="nodeKey" :label="item.id"></el-radio> <el-radio v-model="nodeKey" :label="item.id">{{ item.nodeName }}</el-radio>
<span>{{ item.nodeName }}</span>
</div> </div>
<div class="select-desc"> <div class="select-desc">
{{ item.desc }} {{ item.desc }}
...@@ -40,32 +39,49 @@ ...@@ -40,32 +39,49 @@
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import { mapMutations } from 'vuex'
export default { export default {
props: { props: {
drawerVisible: Boolean drawerVisible: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
nodeKey: '', nodeKey: '',
day: 0, day: 0,
time: '', time: '',
list: [] list: [],
modelList: []
} }
}, },
mounted() { inject: ['app'],
this.SopTplNodeProtosList() watch:{
drawerVisible(val) {
if(val) {
this.getModelList()
}
}
}, },
methods: { methods: {
...mapMutations('model', ['SET_STEP']), getModelList() {
this.$apis.journeyModel.SopTplNodeProtosList({ dataTypeCode: this.app.dataTypeCode }).then(res => {
this.modelList = res
})
},
saveForm() { saveForm() {
const model = { const model = {
time: this.time, time: new Date(this.time).toLocaleTimeString().substring(0, 5),
day: this.day, day: this.day,
nodeProtoId: this.nodeKey nodeProtoId: this.nodeKey
} }
this.$emit('closeDrawer', model) this.$emit('closeDrawer', model)
this.SET_STEP(model) },
setForm(val) {
const { day, time, taskType } = val
this.day = day
this.time = time
this.nodeKey = taskType
}, },
handleClose() { handleClose() {
this.$emit('closeDrawer') this.$emit('closeDrawer')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!