Commit 65dbaa73 by crushh

update: dist

parent 8143305d
......@@ -54,7 +54,7 @@ export const platformHomePageV2 = params => requests('/gic-member-tag-web/member
export const getActivityInfo = params => requests('/api-marketing/statistics/get-activity-info', params, true, false, 'get');
// 获取短信模板内容
export const getSmsTemplateEcho = params => requests('/api-marketing/get-sms-template-echo', params, true, false, 'get');
export const getSmsTemplateEcho = params => requests('/api-marketing/get-sms-template-echo', params, true);
// 是否可以新建
export const aiAccountCheck = params => requests('/api-marketing/ai/ai-account-check', params, true, false, 'get');
......
<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>
<el-radio-group v-model="form.callFlag" @change="handleChangeType">
<el-radio v-model="form.callFlag" :label="0">默认时段</el-radio>
<el-radio v-model="form.callFlag" :label="1">自定义时段</el-radio>
</el-radio-group>
<div v-show="form.callFlag == 0" style="line-height: 20px;">
每天 09:00-20:00
</div>
......@@ -67,6 +69,9 @@ export default {
if (val) {
this.form = JSON.parse(JSON.stringify(val));
}
},
form(val) {
this.$emit('change');
}
},
computed: {
......@@ -111,10 +116,14 @@ export default {
});
});
},
handleChangeType() {
this.form = Object.assign({}, this.form);
},
handleDateChange(val) {
if (!val) {
minTime = maxTime = null;
}
this.form = Object.assign({}, this.form);
}
}
};
......
<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">生日当天</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" @change="hanldeBirthDaysChange" controls-position="right" :max="30" :min="1" size="small" />
</el-form-item>
</el-radio>
<el-radio-group v-model="form.birth_type" @change="handleChangeType">
<el-radio :label="1">生日当天</el-radio>
<el-radio :label="2">生日当月</el-radio>
<el-radio :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" @change="hanldeBirthDaysChange" controls-position="right" :max="30" :min="1" size="small" />
</el-form-item>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="生日范围" prop="birthDate1" v-if="form.birth_type == 1 || form.birth_type == 3" required>
<el-date-picker value-format="timestamp" format="MM-dd" v-model="form.birthDate1" @change="handleDateChange" @blur="minTime = maxTime = null" :picker-options="pickerOptions" type="daterange" placeholder="请选择生日范围" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
......@@ -135,8 +137,7 @@ export default {
}
},
form(val) {
console.log(val);
this.$emit('change', val);
this.$emit('change');
}
},
computed: {
......@@ -146,7 +147,7 @@ export default {
if (birth_type == 1 && birthDate1 && birthDate1.length) {
str = formatDateTimeByType(birthDate1[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(birthDate1[1], 'yyyy-MM-dd');
} else if (birth_type == 2 && birthDate2 && birthDate2.length) {
str = formatDateTimeByType(new Date(birthDate2[0]).getMonth() + 1 == new Date().getMonth() + 1 ? this.currentTime : birthDate2[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(birthDate2[1], 'yyyy-MM-dd');
str = formatDateTimeByType(birthDate2[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(birthDate2[1], 'yyyy-MM-dd');
} else if (birth_type == 3 && birthDate1 && birthDate1.length) {
let start = birthDate1[0] - birth_days * 24 * 60 * 60 * 1000;
let end = birthDate1[1] - birth_days * 24 * 60 * 60 * 1000;
......@@ -185,7 +186,7 @@ export default {
obj.startDate = birthDate1[0] - birth_days * 24 * 60 * 60 * 1000;
obj.endDate = birthDate1[1] - birth_days * 24 * 60 * 60 * 1000;
} else if (birth_type == 2) {
obj.startDate = new Date(birthDate2[0]).getMonth() + 1 == new Date().getMonth() + 1 ? this.currentTime : birthDate2[0];
obj.startDate = birthDate2[0];
obj.endDate = birthDate2[1];
} else {
obj.startDate = birthDate1[0];
......@@ -218,17 +219,28 @@ export default {
}
console.log(this.form.birth_days);
},
handleChangeType() {
this.form = Object.assign({}, this.form);
},
handleDateChange(val) {
console.log(val);
if (!val) {
minTime = maxTime = null;
}
this.form = Object.assign({}, this.form);
},
handleDateMonthChange(val) {
console.log(val);
if (!val) {
minTimeMonth = maxTimeMonth = null;
} else {
let year = new Date(val[1]).getFullYear();
let month = new Date(val[1]).getMonth() + 2;
this.form.birthDate2[0] = new Date(val[0]).getMonth() + 1 == new Date().getMonth() + 1 ? this.currentTime : val[0];
this.form.birthDate2[1] = new Date(year + '/' + month).getTime() - 1;
console.log(this.form.birthDate2);
}
this.form = Object.assign({}, this.form);
}
}
};
......
<template>
<el-form :model="form" ref="form" label-width="100px" :rules="rules">
<el-form-item label="节日名称" prop="holiday_type" required>
<el-radio v-model="form.holiday_type" :label="1">推荐节日</el-radio>
<el-radio v-model="form.holiday_type" :label="2">自定义节日</el-radio>
<el-radio-group v-model="form.holiday_type" @change="handleChangeType">
<el-radio v-model="form.holiday_type" :label="1">推荐节日</el-radio>
<el-radio v-model="form.holiday_type" :label="2">自定义节日</el-radio>
</el-radio-group>
<span class="tips">为保证触达率,节日活动需要提前创建,不支持创建节日日期为活动创建日的活动</span>
<div v-if="form.holiday_type == 1">
<el-tag type="mini" v-if="form.holiday_name1">{{ form.holiday_name1 }}</el-tag>
......@@ -19,7 +21,7 @@
<span v-else>{{ form.holiday_date1 }}</span>
</el-form-item>
<el-form-item label="节日日期" prop="holiday_date2" v-show="form.holiday_type == 2">
<el-date-picker v-model="form.holiday_date2" value-format="yyyy-MM-dd" :picker-options="pickerOptions" type="date" placeholder="选择日期"> </el-date-picker>
<el-date-picker v-model="form.holiday_date2" value-format="yyyy-MM-dd" :picker-options="pickerOptions" @change="handleDateChange" type="date" placeholder="选择日期"> </el-date-picker>
</el-form-item>
<el-form-item label="外呼时间" prop="holiday_day" required>
节日前
......@@ -195,6 +197,9 @@ export default {
this.form[`holiday_name${this.form.holiday_type}`] = this.form.holiday_name;
this.handleHolidayDay();
}
},
form(val) {
this.$emit('change');
}
},
computed: {
......@@ -229,6 +234,7 @@ export default {
this.$message.warning('节日日期 - 节日前X天不能早于当前日期');
}
}
this.form = Object.assign({}, this.form);
},
async getListAllHolidays() {
const { result } = await listAllHolidays();
......@@ -253,8 +259,15 @@ export default {
this.form.holiday_name1 = name;
this.form.holiday_date1 = date;
this.$refs.form.clearValidate('holiday_date1');
this.form = Object.assign({}, this.form);
this.close();
},
handleChangeType() {
this.form = Object.assign({}, this.form);
},
handleDateChange() {
this.form = Object.assign({}, this.form);
},
close() {
this.selectedData = '';
this.visible = false;
......
......@@ -20,15 +20,17 @@
</div>
<dm-sub-title line>活动时间<span class="tips">每天16:00之后不支持创建当天开始的活动</span></dm-sub-title>
<div class="section">
<birthSense ref="activeTime1" :data="birthTimeData" v-show="form.scene == 1" />
<holidaySense ref="activeTime2" :data="holidayTimeData" v-show="form.scene == 2" />
<activeTime ref="activeTime" :data="activeTimeData" v-show="form.scene == 3 || form.scene == 4 || form.scene == 0" :scene="scene" />
<birthSense ref="activeTime1" :data="birthTimeData" v-show="form.scene == 1" @change="getMemberCount" />
<holidaySense ref="activeTime2" :data="holidayTimeData" v-show="form.scene == 2" @change="getMemberCount" />
<activeTime ref="activeTime" :data="activeTimeData" v-show="form.scene == 3 || form.scene == 4 || form.scene == 0" :scene="scene" @change="getMemberCount" />
</div>
<dm-sub-title line>人群规则<span class="tips">针对选择的客户仅会执行一次外呼任务。</span></dm-sub-title>
<div class="section">
<el-form-item label="参与人群" prop="memberType" required>
<el-radio v-model="form.memberType" :label="0">客户筛选</el-radio>
<el-radio v-model="form.memberType" :label="1">客户分组</el-radio>
<el-radio-group v-model="form.memberType" @change="getMemberCount">
<el-radio :label="0">客户筛选</el-radio>
<el-radio :label="1">客户分组</el-radio>
</el-radio-group>
<div>
<div class="tips" style="margin:0 0 12px 0; " v-if="form.memberType == 0">{{ this.form.sence == 3 ? '默认为全部未添加企微好友的客户' : '默认为权限范围内的全部客户' }}</div>
<el-button v-if="form.memberType == 0 && !memberCrowdWidgetId && form.scene != 4" size="small" @click="ruleVisible = true">添加其他条件</el-button>
......@@ -36,7 +38,10 @@
<el-button v-if="form.memberType == 1 && !selectedGroupIds" size="small" @click="groupVisible = true">添加分组</el-button>
</div>
</el-form-item>
<gic-new-member-group v-show="form.memberType == 1" :visiable.sync="groupVisible" :selectedIds="selectedGroupIds" @change="confirmGroupDialog" />
<el-form-item>
<gic-new-member-group v-show="form.memberType == 1" :visiable.sync="groupVisible" :selectedIds="selectedGroupIds" @change="confirmGroupDialog" />
</el-form-item>
<el-form-item label="消费条件" v-if="form.scene == 4 && form.memberType == 0">
<div class="consumeLine">
<el-checkbox v-model="form.consume_days_flag0" :true-label="1" :false-label="0" :disabled="disabledCheck" @change="handleLastconsume('days')">最近消费间隔</el-checkbox>
......@@ -285,7 +290,6 @@ export default {
mixins: [filterAvater],
data() {
const memberType = (rule, value, callback) => {
console.log(this.selectedGroupIds);
if (this.form.memberType == 1 && !this.selectedGroupIds) {
return callback(new Error('客户分组不能为空'));
}
......@@ -689,11 +693,9 @@ export default {
}
});
},
async getMemberCount(val) {
// console.log(val);
// return;
async getMemberCount() {
const activeTimeData = await this.$refs[`activeTime${[1, 2].includes(this.form.scene) ? this.form.scene : ''}`].submit();
if (!activeTimeData) return;
const { startDate, endDate, birth_type, birth_days, holiday_date, holiday_type, holiday_name } = activeTimeData;
const { scene, memberType } = this.form;
let sceneJson = {};
......@@ -733,7 +735,7 @@ export default {
filterJson
};
const { result } = await getMemberCount(data);
this.form.planMemberCount = result;
this.form.planMemberCount = result == -1 ? 0 : result;
},
openTutorial() {
window.open('https://www.yuque.com/exnmlu/hpbb1c/wnud7g');
......@@ -751,10 +753,13 @@ export default {
handleRuleFilterSave(id, data) {
this.memberCrowdWidgetId = id;
this.filterFrontShow = data ? JSON.parse(data.filterFrontShow) : [];
this.getMemberCount();
},
/**客户分组 */
confirmGroupDialog(arr, idStr) {
this.selectedGroupIds = idStr;
this.$refs.form.clearValidate('memberType');
this.getMemberCount();
},
/** 根据客户意向发送挂机短信 */
delSmslist(index) {
......
......@@ -2,7 +2,7 @@
<div class="detail" v-loading="loading">
<dm-sub-title line>基本信息</dm-sub-title>
<div class="section">
<el-descriptions>
<el-descriptions column="4">
<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 && templateObject[form.aiTemplateId].name }}</el-descriptions-item>
......@@ -12,29 +12,32 @@
</div>
<dm-sub-title line>活动时间</dm-sub-title>
<div class="section" v-if="form.scene == 1">
<el-descriptions>
<el-descriptions column="4">
<el-descriptions-item label="外呼时间" v-if="birthTimeData.birth_type == 3"> 生日前{{ birthTimeData.birth_days }}</el-descriptions-item>
<el-descriptions-item label="外呼时间" v-else>{{ birthTimeData.birth_type | birthTypeFilter }}</el-descriptions-item>
<el-descriptions-item label="外呼时段">{{ birthTimeData.callTime }}</el-descriptions-item>
<el-descriptions-item label="生日有效期" v-if="birthTimeData.birth_type != 2">{{ birthTimeData.birthDate1 }}</el-descriptions-item>
<el-descriptions-item label="生日有效期" v-else>{{ birthTimeData.birthDate2 }}</el-descriptions-item>
<el-descriptions-item label="生日范围" v-if="birthTimeData.birth_type == 1">{{ birthTimeData.birthDate1 }}</el-descriptions-item>
<el-descriptions-item label="生日范围" v-if="birthTimeData.birth_type == 2">{{ birthTimeData.birthDate2 }}</el-descriptions-item>
<el-descriptions-item label="生日范围" v-if="birthTimeData.birth_type == 3">{{ birthTimeData.birthDate3 }}</el-descriptions-item>
<el-descriptions-item label="活动有效期">{{ birthTimeData.activeTime }}</el-descriptions-item>
</el-descriptions>
</div>
<div class="section" v-if="form.scene == 2">
<el-descriptions>
<el-descriptions column="4">
<el-descriptions-item label="外呼时间">节日前{{ holidayTimeData.holiday_day }}天内外呼完成</el-descriptions-item>
<el-descriptions-item label="外呼时段">{{ holidayTimeData.callTime }}</el-descriptions-item>
<el-descriptions-item label="活动有效期">{{ holidayTimeData.activeTime }}</el-descriptions-item>
</el-descriptions>
</div>
<div class="section" v-if="form.scene == 3 || form.scene == 4 || form.scene == 0">
<el-descriptions>
<el-descriptions column="4">
<el-descriptions-item label="外呼时段"> {{ activeTimeData.callTime }}</el-descriptions-item>
<el-descriptions-item label="活动有效期">{{ activeTimeData.activeTime }}</el-descriptions-item>
</el-descriptions>
</div>
<dm-sub-title line>人群规则</dm-sub-title>
<div class="section">
<el-descriptions>
<el-descriptions column="4">
<el-descriptions-item label="参与人群">{{ form.memberType == 0 && !memberCrowdWidgetId ? '全部客户' : '' }} </el-descriptions-item>
<el-descriptions-item label="预计覆盖人数">{{ form.planMemberCount }}</el-descriptions-item>
</el-descriptions>
......@@ -152,14 +155,17 @@ export default {
birth_days: ' ', // 生日前xx天
birthDate1: '', //生日范围 当天
birthDate2: '', //生日范围 当月
birthDate3: '', //生日前几天
birth_type: 1, //外呼时间 1当天 2当月 3生日前
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
callTime: [{}], // 自定义时段
activeTime: ''
},
holidayTimeData: {
// 节假日场景 活动时间
holiday_day: '', // 节日时间
callFlag: 0, //外呼时段 0 默认 1 自定义
activeTime: '',
callTime: [{}] // 自定义时段
},
activeTimeData: {
......@@ -266,19 +272,22 @@ export default {
let endDateStr = formatDateTimeByType(endDate, 'yyyy-MM-dd');
if (scene == 1) {
// 不同场景的活动时间回显
if (birth_type == 2) {
startDateStr = formatDateTimeByType(startDate, 'yyyy-MM');
endDateStr = formatDateTimeByType(endDate, 'yyyy-MM');
}
this.birthTimeData = {
//客户生日
birth_days, // 生日前xx天
birthDate1: [startDateStr, endDateStr].join(','), //生日范围 当天
birthDate2: [startDateStr, endDateStr].join(','), //生日范围 当月
activeTime: [startDateStr, endDateStr].join('~'),
birth_type, //外呼时间 1当天 2当月 3生日前
callFlag, //外呼时段 0 默认 1 自定义
callTime: JSON.parse(callTime).join(',') // 自定义时段
};
if (birth_type == 1) {
this.birthTimeData.birthDate1 = [startDateStr, endDateStr].join('~');
} else if (birth_type == 2) {
this.birthTimeData.birthDate2 = [formatDateTimeByType(startDate, 'yyyy-MM'), formatDateTimeByType(endDate, 'yyyy-MM')].join('~');
} else if (birth_type == 3) {
this.birthTimeData.birthDate3 = [formatDateTimeByType(startDate + birth_days * 86400000, 'yyyy-MM-dd'), formatDateTimeByType(endDate + birth_days * 86400000, 'yyyy-MM-dd')].join('~');
}
} else if (scene == 2) {
this.holidayTimeData = {
// 节假日场景 活动时间
......@@ -289,6 +298,7 @@ export default {
callFlag, //外呼时段 0 默认 1 自定义
callTime: JSON.parse(callTime).join(','), // 自定义时段
startDate: startDateStr, //有效时间
activeTime: [startDateStr, endDateStr].join('~'),
endDate: endDateStr //有效时间
};
console.log(new Date(`${holiday_date} 00:00:00`).getTime());
......@@ -297,7 +307,7 @@ export default {
} else {
// 加企微好友||客服复购||其他场景
this.activeTimeData = {
activeTime: [startDateStr, endDateStr].join(''), //有效时间
activeTime: [startDateStr, endDateStr].join('~'), //有效时间
callFlag, //外呼时段 0 默认 1 自定义
callTime: JSON.parse(callTime).join(',') // 自定义时段
};
......@@ -364,8 +374,8 @@ export default {
});
}
},
async getSmsTemplateEcho(ids) {
const { result } = await getSmsTemplateEcho({ id: ids.join(',') });
async getSmsTemplateEcho(id) {
const { result } = await getSmsTemplateEcho({ ids: id.join(',') });
if (!result) return;
let obj = {};
result.length &&
......@@ -376,6 +386,7 @@ export default {
if (obj[item.template]) {
item.smsContent = obj[item.template].smsContent;
}
this.smsList = this.smsList.splice(0);
});
}
}
......
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