Commit 656c87fa authored by 赵茹林's avatar 赵茹林

update

parent e66a89fa
......@@ -225,8 +225,8 @@
limit: this.limit
}
getVisitedApi(json).then(res => {
this.list = res;
this.total = res.total || 0; // todo 后台没给分页
this.list = res.page_data;
this.total = res.total;
this.loading = false;
})
},
......
......@@ -53,7 +53,8 @@
{{t.replace(/:00/g, "")}}
</template>
<template slot-scope="scope">
<span class="cell-link" @click="dialogToggle(scope.row)">{{scope.row[`valid_count${index}`]}}</span>
<!--<span class="cell-link" @click="dialogToggle(scope.row)">{{scope.row[`valid_count${index}`]}}</span>-->
{{scope.row[`valid_count${index}`]}}
</template>
</el-table-column>
</el-table>
......
<template>
<el-dialog :title="title" append-to-body :visible.sync="show" top="5vh" width="1200px">
<div v-loading="loading">
<table class="custom-table el-table" style="margin-bottom: 20px;">
<thead>
<tr>
<th v-for="th in table.th">{{ th.replace(/:00/g, "") }}</th>
</tr>
</thead>
<tbody>
<tr v-if="table.td1.length != 0">
<td v-for="(td, index) in table.td1">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle()">{{ td }}</span>
</td>
</tr>
<tr v-if="table.td2.length != 0">
<td v-for="(td, index) in table.td2">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle()">{{ td }}</span>
</td>
</tr>
<tr v-if="table.td3.length != 0">
<td v-for="(td, index) in table.td3">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle()">{{ td }}</span>
</td>
</tr>
<tr v-if="table.td4.length != 0">
<td v-for="(td, index) in table.td4">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle()">{{ td }}</span>
</td>
</tr>
</tbody>
</table>
<div>
<!--回访 开始-->
<el-table :data="list" border size="small">
<!--<el-table-column label="序号" prop="staff_name"></el-table-column>-->
<el-table-column label="老师" prop="teacher_name"></el-table-column>
<el-table-column label="UID" prop="user_id"></el-table-column>
<el-table-column label="客户微信昵称">
<template slot-scope="scope">{{scope.row.nick || '-'}}</template>
</el-table-column>
<el-table-column label="聊天条数">
<template slot-scope="scope">{{scope.row.chat_count}}</template>
</el-table-column>
<el-table-column label="电话号码">
<template slot-scope="scope">{{scope.row.mobile || '-'}}</template>
</el-table-column>
<el-table-column label="呼出时间" width="92px">
<template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template>
</el-table-column>
<el-table-column label="通话时间">
<template slot-scope="scope">{{scope.row.phone_duration + 's' || '-'}}</template>
</el-table-column>
<el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template>
</el-table-column>
<el-table-column label="下次回访时间">
<template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<span class="cell-link">聊天记录</span>
<span class="cell-link">录音</span>
</template>
</el-table-column>
</el-table>
<!--回访 结束-->
<el-dialog :title="title" append-to-body :visible.sync="show" top="5vh" width="1200px">
<div v-loading="loading">
<page :current-page="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<table class="custom-table el-table" style="margin-bottom: 20px;">
<thead>
<tr>
<th v-for="th in table.th">{{ th.replace(/:00/g, "") }}</th>
</tr>
</thead>
<tbody>
<!--微信有效沟通-->
<tr v-if="table.td1.length != 0">
<td>微信有效沟通</td>
<td v-for="(td, index) in table.td1">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle(td)">{{ td.content }}</span>
</td>
</tr>
<!--沟通>10-->
<tr v-if="table.td2.length != 0">
<td>沟通>10</td>
<td v-for="(td, index) in table.td2">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle(td)">{{ td.content }}</span>
</td>
</tr>
<!--有效通次-->
<tr v-if="table.td3.length != 0">
<td>有效通次</td>
<td v-for="(td, index) in table.td3">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle(td)">{{ td.content }}</span>
</td>
</tr>
<!-->3分钟-->
<tr v-if="table.td4.length != 0">
<td>>3分钟</td>
<td v-for="(td, index) in table.td4">
<span class="cell" :class="index>0 ? 'cell-link' : ''" @click="dialogToggle(td)">{{ td.content }}</span>
</td>
</tr>
</tbody>
</table>
</div>
</el-dialog>
<!--回访 开始-->
<el-table :data="list" border size="small">
<!--<el-table-column label="序号" prop="staff_name"></el-table-column>-->
<el-table-column label="老师" prop="teacher_name"></el-table-column>
<el-table-column label="UID" prop="user_id"></el-table-column>
<el-table-column label="客户微信昵称">
<template slot-scope="scope">{{scope.row.nick || '-'}}</template>
</el-table-column>
<el-table-column label="聊天条数">
<template slot-scope="scope">{{scope.row.chat_count}}</template>
</el-table-column>
<el-table-column label="电话号码">
<template slot-scope="scope">{{scope.row.mobile || '-'}}</template>
</el-table-column>
<el-table-column label="呼出时间" width="92px">
<template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template>
</el-table-column>
<el-table-column label="通话时间">
<template slot-scope="scope">{{scope.row.phone_duration ? scope.row.phone_duration + 's' : '-'}}</template>
</el-table-column>
<!--todo 转义-->
<el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template>
</el-table-column>
<el-table-column label="下次回访时间">
<template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<span class="cell-link">聊天记录</span>
<span class="cell-link">录音</span>
</template>
</el-table-column>
</el-table>
<!--回访 结束-->
<page :current-page="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</el-dialog>
<el-dialog
top="5vh" width="1200px" append-to-body
:title="dialog.title" :visible.sync="dialog.show">
<div v-loading="dialog.loading">
<el-table :data="dialog.list" border size="small">
<!--<el-table-column label="序号" prop="staff_name"></el-table-column>-->
<el-table-column label="老师" prop="teacher_name"></el-table-column>
<el-table-column label="UID" prop="user_id"></el-table-column>
<el-table-column label="客户微信昵称">
<template slot-scope="scope">{{scope.row.nick || '-'}}</template>
</el-table-column>
<el-table-column v-if="dialog.search.type == '0'" label="聊天条数">
<template slot-scope="scope">{{scope.row.chat_count}}</template>
</el-table-column>
<el-table-column label="电话号码">
<template slot-scope="scope">{{scope.row.mobile || '-'}}</template>
</el-table-column>
<el-table-column v-if="dialog.search.type == '1'" label="呼出时间" width="92px">
<template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template>
</el-table-column>
<el-table-column v-if="dialog.search.type == '1'" label="通话时间">
<template slot-scope="scope">{{scope.row.phone_duration ? scope.row.phone_duration + 's' : '-'}}</template>
</el-table-column>
<el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template>
</el-table-column>
<el-table-column label="下次回访时间">
<template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<span v-if="dialog.search.type == '0'" class="cell-link">聊天记录</span>
<span v-if="dialog.search.type == '1'" class="cell-link">录音</span>
</template>
</el-table-column>
</el-table>
<page :current-page="dialog.nowPage" :total="dialog.total" :limit="dialog.limit" @pageChange="onPageChangeDialog" @sizeChange="onSizeChange"/>
</div>
</el-dialog>
</div>
</template>
......@@ -91,6 +150,22 @@
},
data() {
return {
dialog: {
search: {
wechat_number: '',
is_type: '',
key: '',
start_at: '',
type: '1', // 1 点击有效沟通、>10条下方的数字 2 通次、>3分钟,下方的数字
},
loading: false,
show: false,
title: '',
list: [],
total: 0,
nowPage: 1,
limit: 10,
},
show: false,
loading: true,
table: {
......@@ -105,9 +180,6 @@
total: 0,
nowPage: 1,
limit: 10,
dialogObj2: {
}
}
},
mounted() {
......@@ -115,24 +187,22 @@
},
methods: {
initDialog() {
// console.log(this.dialogObj)
if (this.dialogObj) {
this.show = this.dialogObj.show;
this.getData();
}
},
dialogToggle(row, type) {
this.dialogObj2 = {
alias: row.alias, // 老师微信号
squad: (String(row.squad).indexOf(',') > -1 && row.isTotal) ? '' : `${row.squad}`,
show: true,
isTotal: row.isTotal,
type: type,
user_id: row.user_id,
teacher_id: row.teacher_id,
start_at: this.search.start_at,
staff_name: row.staff_name.indexOf(',') > -1 ? row.staff_name.split(',').join(',') : row.staff_name
dialogToggle(td) {
this.dialog.show = !this.dialog.show;
if (this.dialog.show) {
this.dialog.loading = true;
this.dialog.search.wechat_number = td.wechat_number;
this.dialog.search.type = td.type;
this.dialog.search.is_type = td.is_type;
this.dialog.search.key = td.key;
this.dialog.search.start_at = td.start_at;
this.getDataDialog(td)
}
},
......@@ -142,11 +212,9 @@
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit,
// type:
}
getHourSingleApi(json).then(res => {
console.log(111, res)
// console.log(111, res)
if (res && res.list && res.list.page_data) {
this.list = res.list.page_data;
this.total = res.list.total
......@@ -155,42 +223,108 @@
this.total = 0
}
if (res && res.time && res.time.length) {
res.time.unshift(' ');
res.time.push('合计');
this.table.th = res.time;
let arr = [...res.time];
arr.unshift(' ');
arr.push('合计');
this.table.th = arr;
res.time.push('total'); // 循环用
} else {
this.table.th = []
}
if (res && res.count && res.count.valid_chat_count) {
res.count.valid_chat_count.unshift('微信有效沟通');
this.table.td1 = res.count.valid_chat_count
if (res && res.count && res.count.valid_chat_count && res.count.valid_chat_count.length) {
let count = res.count.valid_chat_count, arr = [];
res.time.forEach((val, idx) => { // 用时间来循环
arr.push({
content: count[idx],
wechat_number: this.dialogObj.alias,
type: '0',
is_type: 'valid1',
key: (idx == res.time.length - 1) ? 'total' : idx,
start_at: this.dialogObj.start_at,
})
})
this.table.td1 = arr
} else {
this.table.td1 = []
}
if (res && res.count && res.count.chat_count10) {
res.count.chat_count10.unshift('沟通>10');
this.table.td2 = res.count.chat_count10
if (res && res.count && res.count.chat_count10 && res.count.chat_count10.length) {
let count = res.count.chat_count10, arr = [];
res.time.forEach((val, idx) => { // 用时间来循环
arr.push({
content: count[idx],
wechat_number: this.dialogObj.alias,
type: '0',
is_type: 'valid10',
key: (idx == res.time.length - 1) ? 'total' : idx,
start_at: this.dialogObj.start_at,
})
})
this.table.td2 = arr
} else {
this.table.td2 = []
}
if (res && res.count && res.count.valid_phone_count) {
res.count.valid_phone_count.unshift('有效通次');
this.table.td3 = res.count.valid_phone_count
if (res && res.count && res.count.valid_phone_count && res.count.valid_phone_count.length) {
let count = res.count.valid_phone_count, arr = [];
res.time.forEach((val, idx) => { // 用时间来循环
arr.push({
content: count[idx],
wechat_number: this.dialogObj.alias,
type: '1',
is_type: 'min1',
key: (idx == res.time.length - 1) ? 'total' : idx,
start_at: this.dialogObj.start_at,
})
})
this.table.td3 = arr
} else {
this.table.td3 = []
}
if (res && res.count && res.count.three_min_count) {
res.count.three_min_count.unshift('>3分钟');
this.table.td4 = res.count.three_min_count
let count = res.count.three_min_count, arr = [];
res.time.forEach((val, idx) => { // 用时间来循环
arr.push({
content: count[idx],
wechat_number: this.dialogObj.alias,
type: '1',
is_type: 'min3',
key: (idx == res.time.length - 1) ? 'total' : idx,
start_at: this.dialogObj.start_at,
})
})
this.table.td4 = arr
} else {
this.table.td4 = []
}
this.loading = false
})
/*getHourTimeApi(json).then(res => {
console.log(222,res)
})*/
},
getDataDialog() {
let json = {
wechat_number: this.dialog.search.wechat_number,
type: this.dialog.search.type,
is_type: this.dialog.search.is_type,
key: this.dialog.search.key,
start_at: this.dialog.search.start_at,
page: this.dialog.nowPage,
limit: this.dialog.limit,
}
getHourTimeApi(json).then(res => {
// console.log(333, res)
if (res && res.page_data && res.page_data.length) {
this.dialog.list = res.page_data;
this.dialog.total = res.total
} else {
this.dialog.list = [];
this.dialog.total = 0
}
this.dialog.loading = false;
})
},
getVisited() { // 已回访
......@@ -237,6 +371,15 @@
this.nowPage = 1;
this.getData()
},
onPageChangeDialog(val) {
this.dialog.nowPage = val;
this.getDataDialog()
},
onSizeChangeDialog(val) {
this.dialog.limit = val;
this.dialog.nowPage = 1;
this.getDataDialog()
},
},
watch: {
dialogObj: {
......@@ -249,6 +392,9 @@
show(value) {
this.nowPage = 1; // 重置
this.$emit("changeShow", value);
},
'dialog.show'(value) {
this.dialog.nowPage = 1; // 重置
}
}
}
......
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