Commit bfd52cba by 杨明

bug修复

1 parent 30076dbf
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2024-01-03 12:23:36
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-09 15:35:11
* @FilePath: \scrm-micro-peregrination\src\mixins\model.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapActions, mapState } from 'vuex'
export default {
data() {
......@@ -14,6 +22,46 @@ export default {
}
},
methods: {
...mapActions('model', ['setModelList'])
...mapActions('model', ['setModelList']),
spiltString(data, n) {
let title = ''
try {
title += JSON.parse(data.paramRemark).title
} catch (error) {
console.log(error)
}
if (!data.flag) {
return data.name
}
const val = data.conditions.find(i => i.id == data.flag)
try {
title += JSON.parse(val.paramRemark).title
let day = ''
if (val.operators && val.operators.length) {
val.operators.forEach(item => {
if (item.value) {
day = [item.name, item.value]
}
})
}
console.log(val.operators, day, 'dat')
if (/\[.*\]/.test(title) && day.length == 2) {
title = title.replace(/\[.*?\]/, day[0]).replace(/\[.*?\]/, day[1])
}
} catch (error) {
console.log(error)
}
val &&
val.subConditions &&
val.subConditions.length &&
val.subConditions.forEach(i => {
i.operators.forEach(o => {
if (o.value) {
title += `并且满足${i.name}${o.name}${o.value}`
}
})
})
return title
}
}
}
......@@ -12,8 +12,7 @@
<div v-if="currentIndex == '1'">
<!-- <div class="journey-step-info" v-for="(val, k) in configList" :key="k">-->
<!-- configList-->
<collapse-item-tpl ref="collapseRef" :configList="configList"
:isDisabled="isDisabled"></collapse-item-tpl>
<collapse-item-tpl ref="collapseRef" :configList="configList" :isDisabled="isDisabled"></collapse-item-tpl>
<!-- </div>-->
</div>
<DistributionStore v-if="currentIndex == '2'"></DistributionStore>
......@@ -22,15 +21,14 @@
</template>
</step-bar>
</div>
</div>
</template>
<script>
import StepBar from './components/StepBar.vue'
import CollapseItemTpl from './components/CollapseItemTpl'
import SelJourneyTemplate from "./components/selJourneyTemplate";
import DistributionStore from "./components/DistributionStore";
import SelJourneyTemplate from './components/selJourneyTemplate'
import DistributionStore from './components/DistributionStore'
export default {
components: {
......@@ -39,7 +37,7 @@ export default {
CollapseItemTpl,
DistributionStore
},
name: "add",
name: 'add',
data() {
return {
ruleForm: {
......@@ -47,9 +45,7 @@ export default {
region: ''
},
rules: {
region: [
{required: true, message: '请选择活动区域', trigger: 'change'}
],
region: [{ required: true, message: '请选择活动区域', trigger: 'change' }]
},
titleConfig: {
'0': '旅程模板',
......@@ -144,18 +140,17 @@ export default {
},
mounted() {
// this.$bus.$off('whetherToProceedNext')
this.$bus.$on('whetherToProceedNext', (data) => {
this.$bus.$on('whetherToProceedNext', data => {
const query = data.tplId
this.getDetail(query)
})
},
methods: {
changeIndex(currentInex) {
this.currentIndex = currentInex
},
getDetail(val) {
this.$apis.journeyConfig.getSOPDetailsApi({tplId: val}).then(res => {
this.$apis.journeyConfig.getSOPDetailsApi({ tplId: val }).then(res => {
const tplParamDef = JSON.parse(res.tplParamDef)
const stages = tplParamDef.stages.defaultValue
const customData = tplParamDef.customData.defaultValue
......@@ -168,9 +163,10 @@ export default {
list.push({
...JSON.parse(v.nodeParamDef),
nodeSkipable: v.nodeSkipable,
nodeProtoId: v.nodeProtoId,
nodeId: v.nodeId,
nodeSkip: '0',
nodeVisible: v.nodeVisible,// nodeVisible 0 节点不可见 1 可见
nodeVisible: v.nodeVisible, // nodeVisible 0 节点不可见 1 可见
customData
})
}
......@@ -180,12 +176,12 @@ export default {
return a.day.defaultValue - b.day.defaultValue
})
let sopList = this.groupBy(list, 'day.defaultValue')
sopList = sopList.map(function (arr) {
return arr.filter(function (obj) {
sopList = sopList.map(function(arr) {
return arr.filter(function(obj) {
// nodeVisible 0 节点不可见 1 可见
return obj.nodeVisible == 1;
});
});
return obj.nodeVisible == 1
})
})
configList.push({
label: stages[k].value,
isExpaned: true,
......@@ -195,7 +191,6 @@ export default {
}
console.log(configList, 'configList')
this.configList = configList
})
},
groupBy(list, name) {
......@@ -222,11 +217,10 @@ export default {
customClass,
type: 'warning'
})
.then(() => {
callback()
})
.catch(() => {
})
.then(() => {
callback()
})
.catch(() => {})
},
//开启
haneldOpen() {
......@@ -245,8 +239,7 @@ export default {
changeNode(val) {
console.log(val)
}
},
}
}
</script>
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-08 13:55:46
* @LastEditTime: 2024-01-09 15:34:19
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -258,29 +258,6 @@ export default {
}
}
},
spiltString(data, n) {
if (!data.flag) {
return data.name
}
const val = data.conditions.find(i => i.id == data.flag)
let title = ''
try {
title += JSON.parse(val.paramRemark).title
} catch (error) {
console.log(error)
}
val &&
val.subConditions &&
val.subConditions.length &&
val.subConditions.forEach(i => {
i.operators.forEach(o => {
if (o.value) {
title += `并且满足${i.name}${o.name}${o.value}`
}
})
})
return title
},
//查看详情
getEmpDetail() {
this.empVisible = true
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-08 13:55:00
* @LastEditTime: 2024-01-08 17:59:32
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -64,7 +64,7 @@
<div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
<div style="width: 100%">
<div class="step-item-desc" v-if="value.taskType">
<span>{{ value.time.defaultValue }}发送 | {{ stageInfo([value.taskType.defaultValue]).nodeName }} |{{ stageInfo([value.taskType.defaultValue]).desc }}</span>
<span>{{ value.time.defaultValue }}发送 | {{ stageInfo([value.nodeProtoId]).nodeName }} |{{ stageInfo([value.nodeProtoId]).desc }}</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 class="step-item-name" v-if="value.taskType.defaultValue">{{ activity_name[value.taskType.defaultValue] }}</div>
......@@ -242,30 +242,6 @@ export default {
}
}
},
spiltString(data, n) {
console.log(data, 8)
if (!data.flag) {
return data.name
}
const val = data.conditions.find(i => i.id == data.flag)
let title = ''
try {
title += JSON.parse(val.paramRemark).title
} catch (error) {
console.log(error)
}
val &&
val.subConditions &&
val.subConditions.length &&
val.subConditions.forEach(i => {
i.operators.forEach(o => {
if (o.value) {
title += `并且满足${i.name}${o.name}${o.value}`
}
})
})
return title
},
//查看详情
getEmpDetail() {
this.empVisible = true
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:24:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-03 14:47:20
* @LastEditTime: 2024-01-09 14:02:39
* @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -31,15 +31,15 @@
</div>
<div class="journey-step-info" v-for="(val, k) in configList" :key="k">
<template v-if="val.label">
<collapse-item :stepItem="val" :activityInfo="activityInfo" :key="k" :ref="`collapse_${k}`">
<el-button type="text" @click.stop="openCondition(k)">新增条件</el-button>
<collapse-item :stepItem="val" :activityName="addForm.name" :key="k" :ref="`collapse_${k}`">
<el-button type="text" @click.stop="openCondition(k, val)">新增条件</el-button>
<el-button type="text" @click.stop="handleEditJ(k)">编辑名称</el-button>
<el-button type="text" @click.stop="handleDelete(k)">删除阶段</el-button>
</collapse-item>
</template>
<div class="journey-add-panel" v-if="addStatus && k == addNo">
<div class="flex-column-center ">
<el-input v-model.trim="modelInput.label"></el-input>
<el-input v-model.trim="modelInput.label" maxLength="20"></el-input>
<div class="mark-item">
<label>手动标记:</label>
<el-radio-group v-model="modelInput.editable">
......@@ -76,6 +76,7 @@ export default {
},
data() {
return {
isEdit: false,
drawerVisible: false,
dataTypeCode: '',
sopDataTypes: [],
......@@ -133,8 +134,9 @@ export default {
closeActivity() {
this.activityVisible = false
},
openCondition(k) {
openCondition(k, val) {
this.$refs[`collapse_${k}`][0].activityVisible = true
this.$refs[`collapse_${k}`][0].activityConfig = { ...val, name: this.addForm.name }
},
//保存模板
saveModel() {
......@@ -144,12 +146,6 @@ export default {
if (!this.addForm.region) {
return this.showError('请选择圈化人群的方式')
}
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)] = {
......@@ -175,6 +171,7 @@ export default {
})
})
})
const dataTypeCode = {
dataTypeCode: { defaultValue: this.addForm.region },
stages: {
......@@ -188,8 +185,7 @@ export default {
tplParamDef: JSON.stringify(dataTypeCode),
nodes
}
console.log(params)
console.log(params, 7)
this.$apis.journeyModel.sopTplsSave(params).then(res => {
if (res) {
this.$router.go(-1)
......@@ -197,10 +193,18 @@ export default {
})
},
cancelModel() {
this.$router.go(-1)
this.$confirm('内容尚未保存,是否确认返回到列表', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.$router.go(-1)
})
.catch(() => {})
},
handleDelete(k) {
this.$confirm('是否确定提交?', '提示', {
this.$confirm('删除旅程阶段不影响已经下发的旅程实例?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
......@@ -230,10 +234,12 @@ export default {
},
cancelStep() {
this.addStatus = false
if (this.isEdit) return
this.configList.splice(this.addNo, 1)
},
handleEditJ(i) {
this.addNo = i
this.isEdit = true
this.addStatus = true
this.modelInput = {
label: this.configList[i].label,
......@@ -242,10 +248,11 @@ export default {
},
//添加客户旅程阶段配置
addStep() {
this.isEdit = false
this.addStatus = true
this.modelInput = {
label: '',
editable: false
editable: true
}
this.configList.push({
label: '',
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-22 20:36:05
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-08 13:47:39
* @LastEditTime: 2024-01-09 14:50:35
* @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
-->
......@@ -33,6 +33,7 @@
</div>
<div class="task-item-name">进入条件</div>
<div class="task-item-desc">(描述用户触发何种条件后,将自动变更为该旅程阶段)</div>
<div class="task-item-mark" v-if="stepItem.editable">该旅程阶段支持手动标记</div>
</div>
<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">
......@@ -141,7 +142,7 @@
</div>
<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>
<concatActivity :activityVisible="activityVisible" :activityConfig="activityConfig" v-if="activityVisible" @closeActivity="closeActivity" ref="activityForm"></concatActivity>
</div>
</template>
<script>
......@@ -216,13 +217,11 @@ export default {
type: Object,
default: () => {}
},
activityInfo: {
type: Object,
default: () => {}
}
activityName: String
},
data() {
return {
activityConfig: {},
sopIndex: [],
stage: STAGE,
stage_icon: ICON,
......@@ -307,6 +306,10 @@ export default {
this.stepItem.sopList.sort((a, b) => a[0].day - b[0].day)
},
showEditCondition(val, index) {
this.activityConfig = {
label: this.stepItem.label,
name: this.activityName
}
this.activityVisible = true
this.$nextTick(() => {
this.$refs.activityForm.$refs.conditionForm.setCondition(val, index)
......@@ -331,29 +334,7 @@ export default {
showStat() {
this.statVisible = true
},
spiltString(data, n) {
if (!data.flag) {
return data.name
}
const val = data.conditions.find(i => i.id == data.flag)
let title = ''
try {
title += JSON.parse(val.paramRemark).title
} catch (error) {
console.log(error)
}
val &&
val.subConditions &&
val.subConditions.length &&
val.subConditions.forEach(i => {
i.operators.forEach(o => {
if (o.value) {
title += `并且满足${i.name}${o.name}${o.value}`
}
})
})
return title
},
//查看详情
getEmpDetail() {
this.empVisible = true
......@@ -435,6 +416,11 @@ export default {
color: #999999;
font-size: 12px;
}
.task-item-mark {
color: #999999;
font-size: 12px;
margin-left: auto;
}
.task-item-add {
margin-left: auto;
}
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-27 11:29:17
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-08 12:27:57
* @LastEditTime: 2024-01-09 13:39:49
* @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
-->
......@@ -11,11 +11,11 @@
<div class="dialog-body">
<div class="condition-item">
<label>客户旅程:</label>
<span>续保招揽旅程</span>
<span>{{ activityConfig.name }}</span>
</div>
<div class="condition-item">
<label>旅程阶段:</label>
<span>意向客户</span>
<span>{{ activityConfig.label }}</span>
</div>
<div class="condition-item flex">
<label>进入条件:</label>
......@@ -78,7 +78,12 @@ export default {
condition
},
props: {
activityVisible: Boolean
activityVisible: Boolean,
activityConfig: {
type: Object,
default: () => {}
}
},
data() {
return {
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 13:34:43
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-08 13:33:38
* @LastEditTime: 2024-01-09 14:29:18
* @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
-->
......@@ -22,7 +22,7 @@
<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>
<el-input v-model="condition.operators[operators].value" maxLength="3" onKeypress="return(/^[0-9]*$/.test(String.fromCharCode(event.keyCode)))"></el-input>
</div>
<span>天&nbsp;&nbsp;切换到此旅程阶段</span>
</template>
......@@ -45,6 +45,7 @@
<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>
<span>{{ item.operators[item.value].unit }}</span>
<i class="el-icon-delete" @click="delCondition(condition.subConditions, k)"></i>
</div>
<div class="condition-add" @click="addCondition(condition.subConditions)">
......@@ -62,6 +63,7 @@ export default {
data() {
return {
step: '',
addInfo: {},
condition_i: null,
conditionIndex: 0,
operators: 0,
......@@ -129,12 +131,18 @@ export default {
this.condition_i = index
this.condition = this.conditionList.conditions && this.conditionList.conditions[0]
},
// 保存最后一项用于新增
delCondition(val, k) {
if (val.length == 1) {
this.addInfo = this.$common.utils.deepClone(val[0])
}
val.splice(k, 1)
},
// 新增条件
addCondition(val) {
const l = val.length,
let l = val.length,
prop = this.$common.utils.deepClone(val[l - 1])
if (!prop) prop = this.addInfo
prop.id++
val.push(prop)
},
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 14:31:26
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-04 10:57:42
* @LastEditTime: 2024-01-09 15:19:18
* @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
-->
......@@ -69,7 +69,22 @@ export default {
this.modelList = res
})
},
showError(message) {
this.$message({
type: 'error',
message
})
},
saveForm() {
if (!this.day) {
return this.showError('请设置营销时间')
}
if (!this.time) {
return this.showError('请设置营销时间')
}
if (!this.nodeKey) {
return this.showError('请选择触达方式')
}
const model = {
time: this.time,
day: this.day,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!