Commit ff9ac3d3 by crushh

Merge branch 'feature/3月迭代' into dev

parents 4f9d61c1 33e70c2e
......@@ -34,6 +34,11 @@ export default {
meta: {
type: 'info'
}
},
{
path: 'logs/:id',
name: '提交日志',
component: () => import('../../views/ai/logs.vue')
}
]
};
......@@ -36,3 +36,6 @@ export const listAllHolidays = params => requests('/api-marketing/list-all-holid
//获取活动计划预估人数
export const getMemberCount = params => requests(PREFIX + '/get-member-count', params, true, false, 'get');
// 获取提交并执行日志、提交未执行日志
export const getLogs = params => requests('/api-marketing/page-activity-event-exec-log', params, true, false, 'get');
<template>
<!--根据客户意向打标签 -->
<div class="card">
<div class="tagHead">
<div class="left">
<div class="title">{{ text.title }}</div>
<el-switch v-model="form.labelFlag" />
<div class="tips" v-show="text.tips">{{ text.tips }}</div>
</div>
<el-button type="text">{{ text.explanation }}</el-button>
</div>
<div v-show="form.labelFlag">
<div class="tagBody">
<table>
<thead>
<tr>
<th class="tableHead" v-for="(item, index) in tableColumn" :key="index">{{ item.text }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableData" :key="index">
<td class="tagSelectCell" style="width:420px">
<el-select filterable v-model="item.options" placeholder="请选择意向等级(多选)" @change="effectActionChange">
<el-option v-for="item in options" :key="item.aiTemplateId" :label="item.name" :value="item.aiTemplateId"></el-option>
</el-select>
</td>
<td class="tagSelectCell" style="width:170px">
<el-button type="text" v-if="!Object.keys(item.labels).length" @click="openTagsDialog(index)">选择标签</el-button>
<el-tag type="mini" v-else closable @close="handleTagClose(item.id)">{{ item.labels.name }}</el-tag>
</td>
<td class="tagSelectCell">
<div class="delIcon" type="text" @click="delTagList(index)">
<i class="iconfont icon-Delete"></i>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tagFooter">
<el-button type="text" @click="addGrade"> <i class="iconfont icon-Plus"></i> {{ text.addText }} </el-button>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
tableData: {
type: Array,
default: () => []
},
options: {
type: Array,
default: () => []
},
text: {
type: Object,
default: () => {
return {
title: '客户意向等级',
tips: '开启后,可提高接通率',
explanation: '意向等级说明',
addText: '添加等级'
};
}
},
tableColumn: {
type: Array,
default: () => [
{
text: '客户意向等级',
prop: 'options'
},
{
text: '选择标签',
prop: 'select'
},
{
text: '操作',
prop: 'operate'
}
]
}
}
};
</script>
<style lang="scss" scoped>
.card {
width: 730px;
background: #f7f8fa;
border-radius: 4px;
box-sizing: border-box;
margin-top: 20px;
&:first-child {
margin-top: 0;
}
.tagHead {
width: 100%;
height: 60px;
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding: 0 20px;
.left {
display: flex;
align-items: center;
.title {
width: 173px;
margin-right: 15px;
}
}
}
.tagBody {
border-top: 1px solid #e4e7ed;
box-sizing: border-box;
padding: 0 20px;
table {
width: 100%;
}
.tagSelectCell {
padding: 0 30px 12px 0;
}
}
.tagFooter {
padding: 0 20px 17px 20px;
}
.tableHead {
text-align: left;
font-weight: bold;
line-height: 20px;
color: #303133;
font-size: 14px;
height: 52px;
line-height: 52px;
}
}
</style>
......@@ -343,6 +343,7 @@ export default {
loading: false,
currentIndex: 0,
selectedGroup: [], // 被选中的客户分组
selectedGroupIds: '', // 被选中的客户分组id
memberCrowdWidgetId: '', // 被选的规则id
echoData: false
};
......@@ -407,7 +408,6 @@ export default {
this.memberCrowdWidgetId = filterJson;
} else if (memberType == 1) {
this.selectedGroup = memberTagGroupList;
console.log(this.selectedGroup);
}
if (scene == 1) {
// 不同场景的活动时间回显
......@@ -497,7 +497,7 @@ export default {
activityId,
planName,
memberType,
filterJson: memberType == 0 ? this.memberCrowdWidgetId : this.selectedGroup,
filterJson: memberType == 0 ? this.memberCrowdWidgetId : this.selectedGroupIds,
planMemberCount,
beginDate: startDate,
endDate: endDate,
......@@ -580,6 +580,7 @@ export default {
/**客户分组 */
confirmGroupDialog(arr, idStr) {
this.selectedGroup = arr;
this.selectedGroupIds = idStr;
console.log(arr);
console.log(idStr);
},
......
<template>
<div class="logs">
<div class="search-bar">
<el-date-picker @change="handleCurrentChange(1)" class="search-date" v-model="search.dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-select @change="handleCurrentChange(1)" v-model="search.status" clearable class="search-select">
<el-option v-for="(item, key) in statusMap" :key="key" :value="key" :label="item"></el-option>
</el-select>
</div>
<el-table :data="tableData" v-loading="loading" tooltipEffect="light">
<el-table-column label="活动名称" prop="activityName" min-width="273px" show-overflow-tooltip></el-table-column>
<el-table-column label="营销人数" prop="totalCount" min-width="116px" :formatter="(row, col, val) => val || 0"></el-table-column>
<el-table-column label="已外呼数" prop="successCount" min-width="116px" :formatter="(row, col, val) => val || 0"></el-table-column>
<el-table-column label="接通数" prop="backSuccessCount" min-width="102px" :formatter="(row, col, val) => val || 0"></el-table-column>
<el-table-column label="接通率" prop="connectionRate" min-width="102px" :formatter="(row, col, val) => val || '0.00%'"></el-table-column>
<el-table-column label="接通意向率" prop="connectionPurposeRate" min-width="130px" :formatter="(row, col, val) => val || '0.00%'"></el-table-column>
<el-table-column label="执行状态" prop="execStatus" min-width="116px">
<template slot-scope="{ row }">
<span>
<i
:class="{
'dm-status--info': row.status == 1,
'dm-status--primary--flash': row.status == 2,
'dm-status--error': row.status == 3,
'dm-status--success': row.status == 4,
'dm-status--warning': row.status == 5
}"
></i>
{{ statusMap[row.status] }}
</span>
</template>
</el-table-column>
<el-table-column label="批次时间" prop="createTime" min-width="190px" :formatter="(row, col, val) => (val ? formatDateTimeByType(val) : '--')"></el-table-column>
</el-table>
<dm-pagination v-show="total > 0" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="search.pageNum" :page-size="search.pageSize" :total="total" :page-sizes="[20, 40, 60, 80]" layout="total, sizes, prev, pager, next"> </dm-pagination>
</div>
</template>
<script>
import { getLogs } from '@/service/api/aiApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
export default {
name: 'LogsRuned',
data() {
return {
formatDateTimeByType,
statusMap: {
1: '未开始执行',
2: '执行中',
3: '已终止',
4: '已完成',
5: '欠费暂停'
},
search: {
activityId: '', // 活动ID
dateRange: [],
status: '', // 状态1未开始执行2执行中3已终止4已完成5欠费暂停
type: 1, // 1:提交执行 2:未执行
pageNum: 1,
pageSize: 20
},
loading: false,
total: 0,
tableData: []
};
},
created() {
const { startTime, endTime } = this.$route.query;
this.search.activityId = this.$route.params.id;
this.search.dateRange = [this.formatDateTimeByType(Number(startTime), 'yyyy-MM-dd'), this.formatDateTimeByType(Number(endTime), 'yyyy-MM-dd')];
this.getData();
},
methods: {
getData() {
const { activityId, dateRange, status, type, pageNum, pageSize } = this.search;
const params = { activityId, status, type, pageNum, pageSize };
params.startTime = '';
params.endTime = '';
if (Array.isArray(dateRange)) {
params.startTime = dateRange[0] || '';
params.endTime = dateRange[1] || '';
}
this.loading = true;
getLogs(params)
.then(res => {
const { result, totalCount } = res.result;
this.tableData = result;
this.total = totalCount;
})
.finally(() => (this.loading = false));
},
handleCurrentChange(currentPage) {
this.search.pageNum = currentPage;
this.getData();
},
handleSizeChange(pageSize) {
this.search.pageSize = pageSize;
this.handleCurrentChange(1);
}
}
};
</script>
<style lang="scss" scoped>
.logs {
padding: 0 20px 20px;
.search-bar {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 20px;
.search-date {
margin-right: 10px;
width: 256px;
}
.search-select {
width: 160px;
}
}
}
</style>
<template>
<div class="logs">
<div class="search-bar">
<el-date-picker @change="handleCurrentChange(1)" class="search-date" v-model="search.dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-button type="primary" :disabled="total == 0" @click="handleExportData"><i class="iconfont icon-xiazai" style="margin-right: 10px"></i>批量导出</el-button>
</div>
<el-table :data="tableData" v-loading="loading" tooltipEffect="light" @selection-change="handleSelectionChange">
<el-table-column type="selection"></el-table-column>
<el-table-column label="活动名称" prop="activityName" min-width="330px" show-overflow-tooltip></el-table-column>
<el-table-column label="未执行人" prop="totalCount" min-width="240px" :formatter="(row, col, val) => val || 0"></el-table-column>
<el-table-column label="未执行原因" prop="execRemark" min-width="260px" show-overflow-tooltip :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="批次时间" prop="createTime" min-width="240px" :formatter="(row, col, val) => (val ? formatDateTimeByType(val) : '--')"></el-table-column>
</el-table>
<dm-pagination v-show="total > 0" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="search.pageNum" :page-size="search.pageSize" :total="total" :page-sizes="[20, 40, 60, 80]" layout="total, sizes, prev, pager, next"> </dm-pagination>
<vue-gic-export-excel :dialogVisible.sync="dialogVisible" :dataArr="tableData" :params="exportData" type="2" excelUrl="/api-marketing/export-ai-member-log" projectName="marketing"></vue-gic-export-excel>
</div>
</template>
<script>
import { getLogs } from '@/service/api/aiApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
export default {
name: 'LogsUnrun',
data() {
return {
formatDateTimeByType,
search: {
activityId: '', // 活动ID
dateRange: [],
type: 2, // 1:提交执行 2:未执行
pageNum: 1,
pageSize: 20
},
loading: false,
total: 0,
tableData: [],
dialogVisible: false,
exportData: {
activityName: '', // 营销活动名称
startTime: '', // 开始时间
endTime: '', // 结束时间
dataType: '', // 1:脱敏 2:完整
logIdList: []
}
};
},
created() {
const { activityName, startTime, endTime } = this.$route.query;
this.search.activityId = this.$route.params.id;
this.search.dateRange = [this.formatDateTimeByType(Number(startTime), 'yyyy-MM-dd'), this.formatDateTimeByType(Number(endTime), 'yyyy-MM-dd')];
this.exportData.activityName = activityName;
this.getData();
},
methods: {
getData() {
const { activityId, dateRange, type, pageNum, pageSize } = this.search;
const params = { activityId, type, pageNum, pageSize };
params.startTime = '';
params.endTime = '';
if (Array.isArray(dateRange)) {
params.startTime = dateRange[0] || '';
params.endTime = dateRange[1] || '';
}
this.loading = true;
getLogs(params)
.then(res => {
const { result, totalCount } = res.result;
this.tableData = result;
this.total = totalCount;
})
.finally(() => (this.loading = false));
},
handleCurrentChange(currentPage) {
this.search.pageNum = currentPage;
this.getData();
},
handleSizeChange(pageSize) {
this.search.pageSize = pageSize;
this.handleCurrentChange(1);
},
handleExportData() {
if (this.exportData.logIdList.length == 0) {
return this.$message.warning('请选择要导出的数据');
}
this.dialogVisible = true;
if (Array.isArray(this.search.dateRange)) {
this.exportData.startTime = this.search.dateRange[0];
this.exportData.endTime = this.search.dateRange[1];
}
},
handleSelectionChange(val) {
this.exportData.logIdList = val.map(v => v.planId).join(',');
}
}
};
</script>
<style lang="scss" scoped>
.logs {
padding: 0 20px 20px;
}
.search-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.search-date {
width: 256px;
}
}
</style>
<template>
<el-tabs v-model="activeName">
<el-tab-pane label="提交并执行" name="first">
<logs-runed></logs-runed>
</el-tab-pane>
<el-tab-pane label="提交未执行" name="second">
<logs-unrun></logs-unrun>
</el-tab-pane>
</el-tabs>
</template>
<script>
import LogsRuned from './logs-runed.vue';
import LogsUnrun from './logs-unrun.vue';
export default {
name: 'Logs',
components: { LogsRuned, LogsUnrun },
data() {
return {
activeName: 'first'
};
}
};
</script>
......@@ -164,9 +164,15 @@ export default {
visible: row => {
return row.log_flag === 1;
},
handler: row => {
console.log('提交日志');
}
handler: row =>
this.$router.push({
path: '/ai/logs/' + row.activityId,
query: {
activityName: row.activityName,
startTime: row.beginDate,
endTime: row.endDate
}
})
},
{
text: '数据统计',
......
......@@ -284,7 +284,7 @@
</template>
<el-table-column label="费用归属部门" prop="accountDepartName" min-width="120" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="时间(秒)" prop="aiDurationSec" min-width="90" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="消费金额(元))" prop="aiFeeYuan" min-width="90" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="消费金额(元)" prop="aiFeeYuan" min-width="90" :formatter="(row, col, val) => val || '--'"></el-table-column>
</el-table>
<!-- 视频资费 -->
<!-- <el-table tooltipEffect="light" :data="tableList" style="width:100%" v-if="$route.params.type === 'video'">
......
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