Commit 837f7d9b authored by 赵茹林's avatar 赵茹林

团队概况、小时动态 优化 意向度、通话时间转换

parent 097ea963
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<template slot-scope="scope">{{scope.row.mobile || '-'}}</template> <template slot-scope="scope">{{scope.row.mobile || '-'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="意向度"> <el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template> <template slot-scope="scope">{{transIntention(scope.row.intention)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="最近备注时间"> <el-table-column label="最近备注时间">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<template slot-scope="scope">{{scope.row.mobile || '-'}}</template> <template slot-scope="scope">{{scope.row.mobile || '-'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="意向度"> <el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template> <template slot-scope="scope">{{transIntention(scope.row.intention)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="最近备注时间"> <el-table-column label="最近备注时间">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<template slot-scope="scope">{{scope.row.contact_phone || '-'}}</template> <template slot-scope="scope">{{scope.row.contact_phone || '-'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="意向度"> <el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template> <template slot-scope="scope">{{transIntention(scope.row.intention)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="最近备注时间"> <el-table-column label="最近备注时间">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
<script> <script>
import {getVisitedApi, getClassOpenedApi, getAchievementApi, getPhoneRecordApi, getValidchatApi} from "@service/api"; import {getVisitedApi, getClassOpenedApi, getAchievementApi, getPhoneRecordApi, getValidchatApi} from "@service/api";
import {CALLBACK_INTENTION} from "@/util/wordbook";
import page from '@framework/page' import page from '@framework/page'
export default { export default {
...@@ -210,6 +211,18 @@ ...@@ -210,6 +211,18 @@
} }
}, },
transIntention(string) {
var result;
if (string) {
result = CALLBACK_INTENTION.find(i => {
return i.value == string
}).label
} else {
result = '-'
}
return result
},
periodName(val) { periodName(val) {
let str = ''; let str = '';
if (val.goods_id) { if (val.goods_id) {
......
...@@ -69,11 +69,11 @@ ...@@ -69,11 +69,11 @@
<template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template> <template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="通话时间"> <el-table-column label="通话时间">
<template slot-scope="scope">{{scope.row.phone_duration ? scope.row.phone_duration + 's' : '-'}}</template> <template slot-scope="scope">{{transTime(scope.row.phone_duration)}}</template>
</el-table-column> </el-table-column>
<!--todo 转义--> <!--todo 转义-->
<el-table-column label="意向度"> <el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template> <template slot-scope="scope">{{transIntention(scope.row.intention)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="下次回访时间"> <el-table-column label="下次回访时间">
<template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template> <template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template>
...@@ -128,14 +128,14 @@ ...@@ -128,14 +128,14 @@
</el-table-column> </el-table-column>
<el-table-column v-if="dialog.search.type == '1'" label="呼出时间" width="92px"> <el-table-column v-if="dialog.search.type == '1'" label="呼出时间" width="92px">
<template slot-scope="scope">{{scope.row.phone_start_time || '-'}}</template> <template slot-scope="scope">{{scope.row.start_time || '-'}}</template>
</el-table-column> </el-table-column>
<el-table-column v-if="dialog.search.type == '1'" label="通话时间"> <el-table-column v-if="dialog.search.type == '1'" label="通话时间">
<template slot-scope="scope">{{scope.row.phone_duration ? scope.row.phone_duration + 's' : '-'}}</template> <template slot-scope="scope">{{transTime(scope.row.duration)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="意向度"> <el-table-column label="意向度">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template> <template slot-scope="scope">{{transIntention(scope.row.intention)}}</template>
</el-table-column> </el-table-column>
<el-table-column label="下次回访时间"> <el-table-column label="下次回访时间">
<template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template> <template slot-scope="scope">{{scope.row.next_visit_at || '-'}}</template>
...@@ -167,6 +167,8 @@ ...@@ -167,6 +167,8 @@
import PhoneRecord from '@framework/PhoneRecord' import PhoneRecord from '@framework/PhoneRecord'
import ChatRecord from '@framework/ChatRecord' import ChatRecord from '@framework/ChatRecord'
import page from '@framework/page' import page from '@framework/page'
import CommonJs from '@util/common';
import {CALLBACK_INTENTION} from "@/util/wordbook";
export default { export default {
name: "HourDialog", name: "HourDialog",
...@@ -217,6 +219,21 @@ ...@@ -217,6 +219,21 @@
this.initDialog() this.initDialog()
}, },
methods: { methods: {
transTime(time) {
return CommonJs.secondFmt(time) || '-'
},
transIntention(string) {
var result;
if (string) {
result = CALLBACK_INTENTION.find(i => {
return i.value == string
}).label
} else {
result = '-'
}
return result
},
initDialog() { initDialog() {
if (this.dialogObj) { if (this.dialogObj) {
this.show = this.dialogObj.show; this.show = this.dialogObj.show;
......
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
</span> </span>
</el-tooltip> </el-tooltip>
</template> </template>
<template slot-scope="scope">{{transTime(scope.row.phone_total_time)}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="lately_class_num"> <el-table-column prop="lately_class_num">
...@@ -191,10 +192,11 @@ ...@@ -191,10 +192,11 @@
</template> </template>
<script> <script>
import page from '@framework/page' import page from '@framework/page';
import TeamDialog from './dialog' import TeamDialog from './dialog';
import {getTeamApi} from '@service/api'; import {getTeamApi} from '@service/api';
import {TIP_TEAM} from '@util/tipArr'; import {TIP_TEAM} from '@util/tipArr';
import CommonJs from '@util/common';
function getNowFormatDate() { function getNowFormatDate() {
var date = new Date(); var date = new Date();
...@@ -286,7 +288,9 @@ ...@@ -286,7 +288,9 @@
} }
return ''; return '';
}, },
transTime(time) {
return CommonJs.secondFmt(time) || '-'
},
dialogToggle(row, type) { dialogToggle(row, type) {
this.dialogObj = { this.dialogObj = {
alias: row.alias, // 老师微信号 alias: row.alias, // 老师微信号
......
import md5 from 'js-md5'; import md5 from 'js-md5';
export default{
dateFmt:function(date,format) { export default {
var o = { secondFmt: function (second) { // second 2 hms
"M+" : date.getMonth()+1, //month var h, m, s;
"d+" : date.getDate(), //day h = Math.floor(second / 60 / 60);
"h+" : date.getHours(), //hour m = Math.floor(second / 60 % 60);
"m+" : date.getMinutes(), //minute s = Math.floor(second % 60);
"s+" : date.getSeconds(), //second return `${h > 0 ? h + 'h ' : ''}${m > 0 ? m + 'm ' : ''}${s > 0 ? s + 's' : ''}`
"q+" : Math.floor((date.getMonth()+3)/3), //quarter },
"S" : date.getMilliseconds() //millisecond dateFmt: function (date, format) {
} var o = {
if(/(y+)/.test(format)) format=format.replace(RegExp.$1, "M+": date.getMonth() + 1, //month
(date.getFullYear()+"").substr(4 - RegExp.$1.length)); "d+": date.getDate(), //day
for(var k in o)if(new RegExp("("+ k +")").test(format)) "h+": date.getHours(), //hour
format = format.replace(RegExp.$1, "m+": date.getMinutes(), //minute
RegExp.$1.length==1 ? o[k] : "s+": date.getSeconds(), //second
("00"+ o[k]).substr((""+ o[k]).length)); "q+": Math.floor((date.getMonth() + 3) / 3), //quarter
return format; "S": date.getMilliseconds() //millisecond
}, }
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) if (new RegExp("(" + k + ")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length == 1 ? o[k] :
("00" + o[k]).substr(("" + o[k]).length));
return format;
},
// 将匹配结果替换表情图片 // 将匹配结果替换表情图片
emotion (res) { emotion(res) {
let word = res.replace(/\#|\;/gi,'') let word = res.replace(/\#|\;/gi, '')
const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', 'NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极'] const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', 'NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极']
let index = list.indexOf(word) let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif" align="middle">` return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif" align="middle">`
}, },
tipFilter(h,column,tipArr){ tipFilter(h, column, tipArr) {
// console.log(column) // console.log(column)
// console.log(h) // console.log(h)
return h("span", [ return h("span", [
h("span", column.label), h("span", column.label),
h( h(
"el-tooltip", "el-tooltip",
{ {
props: { props: {
effect: "dark", effect: "dark",
content: tipArr[column.label], content: tipArr[column.label],
placement: "top" placement: "top"
} }
}, },
[ [
h("i", { h("i", {
class: "el-icon-question", class: "el-icon-question",
style: "color:#409eff;display:block;" style: "color:#409eff;display:block;"
}) })
] ]
) )
]); ]);
}, },
md5Code(){ md5Code() {
return md5(JSON.stringify({file:md5('file_'+this.dateFmt(new Date(),"yyyy-MM-dd")),sing: "singsingenglish21000"})) return md5(JSON.stringify({
file: md5('file_' + this.dateFmt(new Date(), "yyyy-MM-dd")),
sing: "singsingenglish21000"
}))
} }
} }
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