Commit eb614a7e by crushh

update: dist

parent 45d93adf
......@@ -26,5 +26,10 @@ export const startActivityPlan = params => requests(PREFIX + 'start-activity-pla
//查看计划详情
export const getActivityDetail = params => requests(PREFIX + 'get-activity-detail', params, true, false, 'get');
export const tempPageStatistics = params => requests('/api-marketing/template/page-statistics', params, true, false, 'post');
export const tempDetail = params => requests('/api-marketing/template/query', params, true, false, 'get');
//节日分类信息
export const listAllHolidays = params => requests('/api-marketing/list-all-holidays', params, true, false, 'get');
......@@ -116,6 +116,7 @@ export default {
},
watch: {
data(val) {
console.log('--->data');
if (val) {
this.form = JSON.parse(JSON.stringify(val));
}
......@@ -190,4 +191,12 @@ export default {
};
</script>
<style></style>
<style scoped>
.tips {
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 17px;
margin-left: 20px;
}
</style>
<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>
<span class="tips">为保证触达率,节日活动需要提前创建,不支持创建节日日期为活动创建日的活动</span>
<div>
<el-tag type="mini">{{ form.holiday_name }}</el-tag>
<el-button type="text" v-show="form.holiday_type == 1" @click="visible = true">选择节日</el-button>
</div>
</el-form-item>
<el-form-item label="节日日期" prop="holiday_date" required>
<span class="tips" v-if="!form.holiday_date">未选择节日</span>
<span v-else>{{ form.holiday_date }}</span>
</el-form-item>
<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" />
......@@ -18,23 +31,29 @@
<span v-if="!activeTime" class="tips" style="font-size: 14px;margin:0">设置【节日日期】和【外呼时间】后自动生成</span>
<span v-else>{{ activeTime }}</span>
</el-form-item>
<holiday-pop :show.sync="visible" @sendItem="handleSendItem" />
</el-form>
</template>
<script>
import defineTime from './defineTime.vue';
import { formatDateTimeByType } from '@/utils/index';
import { formatDateTimeByType, getTimesByReq } from '@/utils/index';
import holidayPop from './holidayPop.vue';
export default {
data() {
return {
formatDateTimeByType,
getTimesByReq,
form: {
holiday_day: '', // 节日时间
holiday_type: 1, // 节日活动场景特有值 节日类型 1推荐 2自定义
holiday_name: '妇女节', // 节日活动场景特有值 节日名称
holiday_date: '2022-03-08', //节日活动场景特有值 节日日期
holiday_day: '', // 外呼时间
callFlag: 0, //外呼时段 0 默认 1 自定义
callTime: [{}] // 自定义时段
},
rules: {}
rules: {},
visible: false
};
},
props: {
......@@ -47,19 +66,33 @@ export default {
data(val) {
if (val) {
this.form = JSON.parse(JSON.stringify(val));
this.handleHolidayDay();
}
}
},
computed: {
activeTime() {
let str = '';
if (this.form.holiday_date && this.form.holiday_day) {
let startTimestamp = getTimesByReq(this.form.holiday_date) - this.form.holiday_day * 24 * 60 * 60 * 1000;
let endTimestamp = getTimesByReq(this.form.holiday_date) - 24 * 60 * 60 * 1000;
str = formatDateTimeByType(startTimestamp, 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(endTimestamp, 'yyyy-MM-dd');
}
return str;
}
},
components: {
defineTime
defineTime,
holidayPop
},
methods: {
handleHolidayDay() {
// 回显时 根据活动有效期和节日日期 算出外呼时间
this.form.holiday_day = ((getTimesByReq(this.form.holiday_date) - this.form.startDate) / 24) * 60 * 60 * 1000;
},
handleSendItem(item) {
console.log(item);
},
submit() {
return new Promise(async resolve => {
const res = await this.$refs.defineTime.submit();
......@@ -72,11 +105,17 @@ export default {
});
this.$refs.form.validate(val => {
if (val) {
const { callFlag, callTime } = this.form;
const { callFlag, callTime, holiday_date, holiday_type, holiday_name, holiday_day } = this.form;
const obj = {
startDate: getTimesByReq(holiday_date) - holiday_day * 24 * 60 * 60 * 1000,
endDate: getTimesByReq(holiday_date) - 24 * 60 * 60 * 1000,
callFlag,
callTime
callTime,
holiday_date,
holiday_type,
holiday_name
};
console.log(obj);
if (arr.length) {
obj.callTime = arr;
}
......@@ -91,4 +130,12 @@ export default {
};
</script>
<style></style>
<style scoped>
.tips {
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 17px;
margin-left: 20px;
}
</style>
<template>
<el-dialog title="选择节日" :visible.sync="show" width="700px" :before-close="close">
<div class="tips">
仅支持选择节日日期为最近1-60天内的节日
</div>
<div class="holiday" v-for="item in holidayData" :key="item.id">
<dm-sub-title>{{ item.id }}</dm-sub-title>
<div class="section">
<el-radio v-model="selectedData" :label="val" v-for="val in item.holidaysList" :key="val.id">{{ val.name }}</el-radio>
</div>
</div>
<span slot="footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="addItem">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { listAllHolidays } from '@/service/api/aiApi.js';
export default {
props: {
show: {
type: Boolean,
default: false
}
},
data() {
return {
holidayData: [
{
id: 'S', //节日分类ID
name: '', //节日分类名称
holidaysList: [
{
id: '1', // 节日配置ID
name: '妇女节', //节日配置名称
date: '2020-03-08' //节日配置日期
},
{
id: '2', // 节日配置ID
name: '618', //节日配置名称
date: '2020-06-18' //节日配置日期
},
{
id: '3', // 节日配置ID
name: '端午节端午节端午', //节日配置名称
date: '2020-10-01' //节日配置日期
}
]
},
{
id: 'A', //节日分类ID
name: '', //节日分类名称
holidaysList: [
{
id: '4', // 节日配置ID
name: '端午节', //节日配置名称
date: '2020-05-05' //节日配置日期
},
{
id: '5', // 节日配置ID
name: '中秋节', //节日配置名称
date: '2020-07-15' //节日配置日期
},
{
id: '6', // 节日配置ID
name: '愚人节', //节日配置名称
date: '2020-04-01' //节日配置日期
}
]
},
{
id: 'B', //节日分类ID
name: '', //节日分类名称
holidaysList: [
{
id: '7', // 节日配置ID
name: '元宵节', //节日配置名称
date: '2020-01-01' //节日配置日期
}
]
}
],
selectedData: {}
};
},
mounted() {
this.getListAllHolidays();
},
methods: {
async getListAllHolidays() {
const { result } = await listAllHolidays();
console.log(result);
if (result) {
// this.holidayData = result;
}
},
addItem() {
this.$emit('sendItem', this.selectedData);
},
close() {
this.$emit('update:show', false);
}
}
};
</script>
<style lang="scss" scoped>
.section {
padding: 12px 0 24px 0;
display: flex;
flex-wrap: wrap;
gap: 15px;
.tips {
font-size: 12px;
font-weight: 400;
color: #606266;
line-height: 17px;
margin-bottom: 20px;
}
.el-radio {
margin: 0;
}
}
</style>
<template>
<el-dialog title="" :visible.sync="show" width="800px" :before-close="close">
<el-dialog title="" :visible.sync="show" width="900px" :before-close="close">
<span slot="title">
<span class="el-dialog__title">选择短信</span>
<span class="pl10 fz13 gray"><i class="el-icon-info pr10"></i>短信运营商限制:为避免骚扰用户,营销短信只允许在8点到22点发送</span>
<span class="pl10 fz13 gray" v-if="useByEcm"><i class="el-icon-info pr10"></i>短信运营商限制:为避免骚扰用户,营销短信只允许在8点到22点发送</span>
<span class="pl10 fz13 gray" v-else>仅展示审核通过的短信模板</span>
</span>
<div class="pb22 clearfix">
<div class="fl">
<span class="pr10">{{ total }}</span><el-input clearable v-model="listParams.search" class="w200" placeholder="请输入标题/作者" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
</div>
<div class="fr">
<div class="fr" v-if="useByEcm">
<el-button type="primary" @click="add">新建短信</el-button>
<el-button @click="refresh">刷新列表</el-button>
</div>
</div>
<el-table tooltipEffect="light" :data="smsTempList" height="400" style="width: 100%" row-class-name="cursor-pointer" v-loading="loading" @row-click="rowClick">
<el-table tooltipEffect="light" :data="smsTempList" height="420" style="width: 100%" row-class-name="cursor-pointer" v-loading="loading" @row-click="rowClick">
<el-table-column :show-overflow-tooltip="false" :width="60" align="center" prop="smsTemplateId">
<template slot-scope="scope">
<div class="label-hidden">
......@@ -21,19 +22,19 @@
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="200" :min-width="200" align="left" prop="title" label="模板名称"></el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="200" :min-width="200" align="left" prop="content" label="模板类型">
<el-table-column :show-overflow-tooltip="false" :width="180" align="left" prop="title" label="模板名称"></el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="120" align="left" prop="content" label="模板类型">
<template slot-scope="scope">
<div>{{ scope.row.type === 0 ? '普通短信' : scope.row.type === 1 ? '营销短信' : '验证码' }}</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" :min-width="200" align="left" prop="content" label="模板内容">
<template slot-scope="scope">
<div class="ellipsis-l3">{{ scope.row.content }}</div>
<div class="ellipsis-l2">{{ scope.row.content }}</div>
</template>
</el-table-column>
</el-table>
<dm-pagination v-show="smsTempList.length" class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="prev, pager, next" :total="total"></dm-pagination>
<dm-pagination v-show="smsTempList.length" class="dm-pagination" style="margin-top: 12px" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="prev, pager, next" :total="total"></dm-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
......@@ -49,6 +50,10 @@ export default {
show: {
type: Boolean,
default: false
},
useByEcm: {
type: Boolean,
default: true
}
},
data() {
......
......@@ -121,7 +121,7 @@
<script>
import { getEntepriseList } from '../assets/api';
import MaterialItem from './material-item.vue';
import LibMessage from './lib-Message.vue';
import LibMessage from './lib-message.vue';
import LibTeltask from './lib-teltask.vue';
export default {
......
......@@ -50,7 +50,7 @@ import itemWxa from './components/item-wxa.vue';
import itemCard from './components/item-card.vue';
import itemText from './components/item-text.vue';
import itemImage from './components/item-image.vue';
import itemMessage from './components/item-Message.vue';
import itemMessage from './components/item-message.vue';
import itemTeltask from './components/item-teltask.vue';
import itemIntegral from './components/item-integral.vue';
import itemGrade from './components/item-grade';
......@@ -58,7 +58,7 @@ import itemQywx from './components/item-qywx';
import itemQfxx from './components/item-qfxx';
//弹窗组件
import libTeletext from './components/lib-teletext.vue';
import libMessage from './components/lib-Message.vue';
import libMessage from './components/lib-message.vue';
import libCard from './components/lib-card.vue';
import libText from './components/lib-text.vue';
import libWxa from './components/lib-wxa.vue';
......
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