Commit 41aab400 by crushh

udpate: dist

parent 8ec20f6a
......@@ -12,10 +12,28 @@ export default {
meta: {}
},
{
path: 'form',
name: '活动详情',
path: 'add/:scene',
name: '新增活动详情',
component: () => import('../../views/ai/form.vue'),
meta: {}
meta: {
type: 'add'
}
},
{
path: 'edit/:id',
name: '编辑活动详情',
component: () => import('../../views/ai/form.vue'),
meta: {
type: 'edit'
}
},
{
path: 'info/:id',
name: '活动详情',
component: () => import('../../views/ai/info.vue'),
meta: {
type: 'info'
}
}
]
};
......@@ -23,3 +23,6 @@ export const stopActivityPlan = params => requests(PREFIX + 'stop-activity-plan'
//重新开启活动计划
export const startActivityPlan = params => requests(PREFIX + 'start-activity-plan', params, true, false, 'get');
//查看计划详情
export const getActivityDetail = params => requests(PREFIX + 'get-activity-detail', params, true, false, 'get');
......@@ -51,10 +51,10 @@ function popRequest(config) {
*/
function handlerErr(code, message = '请求错误', alertError = true) {
switch (code) {
case 404:
message = '404,错误请求';
router.push('/404');
break;
// case 404:
// message = '404,错误请求';
// router.push('/404');
// break;
case 401:
if (!_isDev) {
window.location.href = config.api + 'gic-web/';
......@@ -95,7 +95,6 @@ const pendingRequest = new Map();
*/
const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false, method = 'POST', alertError = true) => {
let _opts = { method, url };
const _query = {};
let _timer = null;
// 如果用户没有开启权限 从参数中删除showSelfFlag
if (!store.state.marketing.openFlag) {
......@@ -136,7 +135,6 @@ const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false,
popRequest(_random);
if (res.data.errorCode !== 0 && res.data.code != 0) {
reject(res);
// handlerErr(res.data.errorCode, res.data.message, alertError);
if (res.data.message.indexOf('抱歉') >= 0) {
Vue.prototype.$alert(res.data.message, '提示');
} else {
......
<template>
<el-form :model="form" ref="form" label-width="100px" :rules="rules">
<el-form-item label="外呼时段" required>
<el-radio v-model="form.callFlag" :label="0">默认时段</el-radio>
<el-radio v-model="form.callFlag" :label="1">自定义时段</el-radio>
<div v-show="form.callFlag == 0" style="line-height: 20px;">
每天 09:00-20:00
</div>
<defineTime v-show="form.callFlag == 1" ref="defineTime" :data="form.callTime" />
</el-form-item>
<el-form-item label="活动有效期" required>
<el-date-picker value-format="timestamp" format="MM-dd" v-model="form.activeTime" @change="handleDateChange" type="daterange" placeholder="请选择生日范围" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
</el-form-item>
</el-form>
</template>
<script>
import defineTime from './defineTime.vue';
import { formatDateTimeByType } from '@/utils/index';
export default {
data() {
return {
formatDateTimeByType,
form: {
activeTime: '', //有效时间
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
},
rules: {}
};
},
props: {
data: {
type: Object,
default: () => {}
}
},
watch: {
data(val) {
if (val) {
this.form = JSON.parse(JSON.stringify(val));
}
}
},
computed: {
activeTime() {
let str = '';
return str;
}
},
components: {
defineTime
},
methods: {
submit() {
return new Promise(async resolve => {
const res = await this.$refs.defineTime.submit();
let arr = [];
if (!res) return;
res.timeRangeList.forEach(item => {
if (Object.keys(item).length) {
arr.push(`${item.startTime}-${item.endTime}`);
}
});
this.$refs.form.validate(val => {
if (val) {
const { callFlag, callTime, activeTime } = this.form;
const obj = {
startDate: activeTime[0],
endDate: activeTime[1],
callFlag,
callTime
};
if (arr.length) {
obj.callTime = arr;
}
resolve(obj);
} else {
resolve(false);
}
});
});
}
}
};
</script>
<style></style>
<template>
<el-form :model="form" ref="form" label-width="100px" :rules="rules">
<el-form-item label="外呼时间" required>
<el-radio v-model="form.birth_type" :label="1" @change="onChangeEffectType">生日当天</el-radio>
<el-radio v-model="form.birth_type" :label="2" @change="onChangeEffectType">生日当月</el-radio>
<el-radio v-model="form.birth_type" :label="3" @change="onChangeEffectType"
<el-radio v-model="form.birth_type" :label="1">生日当天</el-radio>
<el-radio v-model="form.birth_type" :label="2">生日当月</el-radio>
<el-radio v-model="form.birth_type" :label="3"
>生日前
<el-form-item prop="birth_days" style="display: inline-block;">
<el-input-number class="w100" style="margin:0 5px;" v-model="form.birth_days" controls-position="right" :max="30" :min="1" size="small" />
......@@ -18,12 +18,12 @@
<el-date-picker type="monthrange" value-format="timestamp" format="MM月" v-model="form.birthDate2" @change="handleDateMonthChange" :picker-options="pickerOptionsMonth" placeholder="请选择生日范围" range-separator="~" start-placeholder="开始月份" end-placeholder="结束月份"> </el-date-picker>
</el-form-item>
<el-form-item label="外呼时段" required>
<el-radio v-model="form.call_flag" :label="0" @change="onChangeEffectType">默认时段</el-radio>
<el-radio v-model="form.call_flag" :label="1" @change="onChangeEffectType">自定义时段</el-radio>
<div v-show="form.call_flag == 0" style="line-height: 20px;">
<el-radio v-model="form.callFlag" :label="0">默认时段</el-radio>
<el-radio v-model="form.callFlag" :label="1">自定义时段</el-radio>
<div v-show="form.callFlag == 0" style="line-height: 20px;">
每天 09:00-20:00
</div>
<defineTime v-show="form.call_flag == 1" ref="defineTime" />
<defineTime v-show="form.callFlag == 1" ref="defineTime" :data="form.callTime" />
</el-form-item>
<el-form-item label="活动有效期" required>
<span v-if="!activeTime" class="tips" style="font-size: 14px;margin:0">设置【生日范围】和【外呼时间】后自动生成</span>
......@@ -62,7 +62,8 @@ export default {
birthDate1: '', //生日范围 当天
birthDate2: '', //生日范围 当月
birth_type: 1, //外呼时间 1当天 2当月 3生日前
call_flag: 0 //外呼时段 0 默认 1 自定义
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
},
rules: {
birthDate1: { validator: birthDateValidtor },
......@@ -107,6 +108,19 @@ export default {
}
};
},
props: {
data: {
type: Object,
default: () => {}
}
},
watch: {
data(val) {
if (val) {
this.form = JSON.parse(JSON.stringify(val));
}
}
},
computed: {
activeTime() {
let str = '';
......@@ -138,11 +152,11 @@ export default {
});
this.$refs.form.validate(val => {
if (val) {
const { birth_type, call_flag, birthDate1, birthDate2, callTime, birth_days } = this.form;
const { birth_type, callFlag, birthDate1, birthDate2, callTime, birth_days } = this.form;
const obj = {
startDate: birth_type == 2 ? birthDate2[0] : birthDate1[0],
endDate: birth_type == 2 ? birthDate2[1] : birthDate1[1],
call_flag,
callFlag,
birth_type,
callTime,
birth_days
......
......@@ -54,6 +54,24 @@ export default {
}
};
},
props: {
data: {
type: Array,
default: () => [{}]
}
},
watch: {
data(val) {
if (val.length) {
let data = typeof val == 'object' ? val : JSON.parse(val);
let arr = [];
data.forEach(item => {
arr.push({ startTime: item.split('-')[0], endTime: item.split('-')[1] });
});
this.form.timeRangeList = arr;
}
}
},
methods: {
// 删除兑换时段
delTimeRange(index) {
......
<template>
<el-form :model="form" ref="form" label-width="100px" :rules="rules">
<el-form-item label="外呼时间" prop="holiday_day" required>
节日前
<el-input-number class="w100" style="margin:0 5px;" v-model="form.holiday_day" controls-position="right" :max="30" :min="1" size="small" />
天内外呼完成
<span class="tips">由于外呼线路有限,为保证外呼触达率,建议外呼时间周期不小于5</span>
</el-form-item>
<el-form-item label="外呼时段" required>
<el-radio v-model="form.callFlag" :label="0">默认时段</el-radio>
<el-radio v-model="form.callFlag" :label="1">自定义时段</el-radio>
<div v-show="form.callFlag == 0" style="line-height: 20px;">
每天 09:00-20:00
</div>
<defineTime v-show="form.callFlag == 1" ref="defineTime" :data="form.callTime" />
</el-form-item>
<el-form-item label="活动有效期" required>
<span v-if="!activeTime" class="tips" style="font-size: 14px;margin:0">设置【节日日期】和【外呼时间】后自动生成</span>
<span v-else>{{ activeTime }}</span>
</el-form-item>
</el-form>
</template>
<script>
import defineTime from './defineTime.vue';
import { formatDateTimeByType } from '@/utils/index';
export default {
data() {
return {
formatDateTimeByType,
form: {
holiday_day: '', // 节日时间
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
},
rules: {}
};
},
props: {
data: {
type: Object,
default: () => {}
}
},
watch: {
data(val) {
if (val) {
this.form = JSON.parse(JSON.stringify(val));
}
}
},
computed: {
activeTime() {
let str = '';
return str;
}
},
components: {
defineTime
},
methods: {
submit() {
return new Promise(async resolve => {
const res = await this.$refs.defineTime.submit();
let arr = [];
if (!res) return;
res.timeRangeList.forEach(item => {
if (Object.keys(item).length) {
arr.push(`${item.startTime}-${item.endTime}`);
}
});
this.$refs.form.validate(val => {
if (val) {
const { callFlag, callTime } = this.form;
const obj = {
callFlag,
callTime
};
if (arr.length) {
obj.callTime = arr;
}
resolve(obj);
} else {
resolve(false);
}
});
});
}
}
};
</script>
<style></style>
<template>
<div class="detail">
<dm-sub-title line>基本信息</dm-sub-title>
<div class="section">
<el-descriptions>
<el-descriptions-item label="活动场景"> {{ form.scene | sceneFilter }}</el-descriptions-item>
<el-descriptions-item label="活动名称">{{ form.activityName }}</el-descriptions-item>
<el-descriptions-item label="话术">{{ form.aiTemplateId }}</el-descriptions-item>
</el-descriptions>
</div>
<dm-sub-title line>活动时间</dm-sub-title>
<div class="section">
<el-descriptions>
<el-descriptions-item label="外呼时间"> {{ activeTimeData.birth_type }}</el-descriptions-item>
<el-descriptions-item label="外呼时段">{{ activeTimeData.callTime }}</el-descriptions-item>
<el-descriptions-item label="生日有效期">{{ activeTimeData.birthDate1 }}</el-descriptions-item>
</el-descriptions>
</div>
<dm-sub-title line>人群规则</dm-sub-title>
<div class="section">
<el-descriptions-item label="参与人群"> {{ form.filterJson }}</el-descriptions-item>
<el-descriptions>
<el-descriptions-item label="预计覆盖人数">{{ form.planMemberCount }}</el-descriptions-item>
</el-descriptions>
</div>
<dm-sub-title line>外呼规则配置</dm-sub-title>
<div class="section">
<!--根据客户意向打标标签-->
<div class="card">
<div class="title">根据客户意向打标标签:开启</div>
<div class="content">
<table>
<thead>
<tr>
<th class="tableHead">意向等级</th>
<th class="tableHead">标签名称</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tagMatchList" :key="index">
<td class="cell" style="width:50%;">
{{ item.options }}
</td>
<td class="cell" style="width:50%;">
<el-tag type="mini">{{ item.name }}</el-tag>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--根据客户意向发送挂机短信:-->
<div class="card">
<div class="title">根据客户意向发送挂机短信:开启</div>
<div class="content">
<table>
<thead>
<tr>
<th class="tableHead">意向等级</th>
<th class="tableHead">短信模板</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in smsList" :key="index">
<td class="cell" style="width:50%;">
{{ item.options }}
</td>
<td class="cell" style="width:50%;">
<el-tag type="mini">{{ item.title }}</el-tag> <el-button type="text">查看短信内容</el-button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--根据客户意向自动重拨:-->
<div class="card">
<div class="title">根据客户意向自动重拨:开启</div>
<div class="content">
<table>
<thead>
<tr>
<th class="tableHead">通话状态</th>
<th class="tableHead">重拨次数</th>
<th class="tableHead">重拨间隔</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in recallList" :key="index">
<td class="cell">
{{ item.options }}
</td>
<td class="cell">
{{ item.times }}
</td>
<td class="cell">
{{ item.interval }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<dm-sub-title line>活动分析设置</dm-sub-title>
<div class="section">
<el-descriptions>
<el-descriptions-item label="活动分析"> {{ form.analyseFlag }}</el-descriptions-item>
<el-descriptions-item label="分析天数">{{ form.analyseDays }}</el-descriptions-item>
<el-descriptions-item label="活动目标">{{ form.analyseAmount }}</el-descriptions-item>
</el-descriptions>
</div>
</div>
</template>
<script>
import filterAvater from '@/mixins/filterAvater.js';
import { getActivityDetail } from '@/service/api/aiApi.js';
export default {
mixins: [filterAvater],
data() {
return {
form: {
activityName: '', //活动名称
activityId: '', //活动id
scene: '', //活动场景 「1 客户生日」、「2 节日活动邀约」、「3 加企微好友」、「4 客户复购」、「5 其它场景」
aiTemplateId: '', //话术模板id
memberType: 0, // 会员类型(0:会员筛选,1:会员分组)
filterJson: '{"list":[{"type":"or","list":[{"type":"data","data":{"key":"city","compute":"in","value":"330100"}}]},{"type":"or","list":[{"type":"data","data":{"key":"mainStoreId","compute":"in","value":"e8fdc210a59411ecb9cb9f7ed8d63716","dealKey":"storeWidget"}}]}],"type":"and"}',
analyseFlag: 1, //活动分析
labelFlag: 0, //是否根据客户意向打标签
smsFlag: 0, //是否根据客户意向发送挂机短信
recallFlag: 0, //是否根据未接通状态设置重拨
planMemberCount: '23,098', //覆盖人数
analyseDays: '', //分析天数
analyseAmount: '' //销售额
},
activeTimeData: {
// 活动时间的回显
birth_days: ' ', // 生日前xx天
birthDate1: '', //生日范围 当天
birthDate2: '', //生日范围 当月
birth_type: 1, //外呼时间 1当天 2当月 3生日前
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
},
tagMatchList: [
// 打标签列表
{
options: 'A级(有明确意向)、B级(可能有意向)',
id: 'fd6b44967aa647bcadfad10706244c56',
name: '3.8活动邀约标签-高意向'
}
],
smsList: [
{
options: 'A级(有明确意向)、B级(可能有意向)',
template: 'ff8080817f012035017f012193240000',
title: '虎年促销通知'
}
],
recallList: [
// 重播列表
{
options: '关机、占线',
times: 2,
interval: 5
}
]
};
},
mounted() {
this.getActivityDetail(this.$route.params.id);
},
methods: {
async getActivityDetail(activityId) {
this.loading = true;
const { result } = await getActivityDetail({ activityId });
console.log(result);
if (result) {
const { activityId, activityName, activityPlanList, analyseAmount, analyseDays, analyseFlag, endDate, scene } = result;
const { activityEventList, beginDate, filterJson, memberType, planId, planMemberCount, planName, sceneJson } = activityPlanList[0];
const { aiEventId, aiTemplateId, callFlag, callTime, eventId, labelFlag, recallFlag, smsFlag } = activityEventList[0];
const { birth_type, birth_days } = JSON.parse(sceneJson);
this.form = {
activityName, //活动名称
activityId, //活动id
scene, //活动场景 「1 客户生日」、「2 节日活动邀约」、「3 加企微好友」、「4 客户复购」、「5 其它场景」
aiTemplateId, //话术模板id
memberType, // 会员类型(0:会员筛选,1:会员分组)
filterJson,
analyseFlag, //活动分析
labelFlag, //是否根据客户意向打标签
smsFlag, //是否根据客户意向发送挂机短信
recallFlag, //是否根据未接通状态设置重拨
planMemberCount, //覆盖人数
analyseDays, //分析天数
analyseAmount, //销售额
planId,
planName,
aiEventId,
eventId
};
this.activeTimeData = {
birth_days, // 生日前xx天
birthDate1: [beginDate, endDate], //生日范围 当天
birthDate2: [beginDate, endDate], //生日范围 当月
birth_type, //外呼时间 1当天 2当月 3生日前
callFlag, //外呼时段 0 默认 1 自定义
callTime: callFlag == 1 ? callTime : [] // 自定义时段
};
}
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
.detail {
margin: 10px 20px;
}
.section {
padding: 20px 0 40px 0;
}
.card {
margin-top: 20px;
&:first-child {
margin-top: 0;
}
.content {
width: 100%;
height: 114px;
background: #f7f8fa;
border-radius: 4px;
margin-top: 10px;
box-sizing: border-box;
padding: 0 16px;
table {
width: 100%;
}
.tableHead {
text-align: left;
font-weight: bold;
line-height: 20px;
color: #303133;
font-size: 14px;
height: 52px;
line-height: 52px;
}
.cell {
padding: 0 30px 12px 0;
}
}
}
</style>
......@@ -89,7 +89,7 @@
</template>
<script>
import { pageStatistics, page, rechargeCenter, stopActivityPlan, startActivityPlan } from '@/service/api/aiApi.js';
import { page, rechargeCenter, stopActivityPlan, startActivityPlan } from '@/service/api/aiApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import filterAvater from '@/mixins/filterAvater.js';
import dmDropdown from '@/components/dm-drop-down/dm-drop-down';
......@@ -115,9 +115,7 @@ export default {
props: {
limitCode: ''
},
handler: row => {
console.log('查看');
}
handler: row => this.$router.push('/ai/info/' + row.activityId)
},
{
text: '编辑',
......@@ -127,9 +125,7 @@ export default {
visible: row => {
return row.activityPlanStatus === 0 || row.activityPlanStatus == 1;
},
handler: row => {
console.log('编辑');
}
handler: row => this.editPlan(row)
},
{
text: '终止',
......@@ -314,7 +310,7 @@ export default {
this.recharge();
});
} else {
this.$router.push({ path: '/ai/form', query: { scene } });
this.$router.push('/ai/add/' + scene);
}
},
recharge() {
......@@ -324,7 +320,6 @@ export default {
async getRechargeCenter() {
const { result } = await rechargeCenter();
this.money = result.account.balance;
console.log(result);
},
search() {
this.form.pageNum = 1;
......@@ -348,10 +343,6 @@ export default {
this.total = result.total;
console.log(this.tableData);
},
async getStatistics(para) {
const { result } = await pageStatistics([1, 2, 3]).finally(() => (this.loading = false));
console.log(result);
},
stopTask(row) {
this.$confirm('任务终止后未外呼的客户将停止外呼任务,终止后不可重新启用任务,是否继续终止任务?', '提示', {
confirmButtonText: '终止',
......@@ -373,6 +364,9 @@ export default {
this.getTableData();
});
});
},
editPlan(row) {
this.$router.push('/ai/edit/' + row.activityId);
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment