Commit 6d0d26a7 by 李伟康

commit 质检埋点

1 parent aeb3e8b8
......@@ -38,7 +38,8 @@ const request = (
scrm: "axios2",
merchants: "axios3",
reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common"
"glsx.accounts.biz.common.pictureUpload": "common",
clue:'axios5'
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
......@@ -70,7 +71,8 @@ const request = (
dj: "sha1",
scrm: "sha1",
glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5"
"glsx.accounts.biz.common.pictureUpload": "md5",
clue:'sha1'
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
......
......@@ -118,3 +118,9 @@ export function defenceDetail(data) {
data.method = "dj.api.smartcarlife.inspection.defence.detail"
return request(data, "post")
}
/** 质检埋点*/
export function reportTrack(data) {
data.method = "clue.api.burial.point.record.batch.insert"
return request(data, "post")
}
......@@ -13,6 +13,7 @@
:tree-props="{ children: 'upgradeGoodsList' }"
:span-method="arraySpanMethod"
v-bind="$attrs"
v-scroll="scroll"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
......@@ -194,6 +195,16 @@
<script>
import TableHeadSearch from "./TableHeadSearch"
export default {
directives: {
scroll: {
bind: function (el, binding) {
const ele = el.querySelector('.el-table__body-wrapper');
ele.addEventListener('scroll', function(e){
binding.value(e)
})
}
}
},
name: "D2Table",
data () {
return {
......@@ -488,6 +499,7 @@ export default {
this.getListApi
? this.refreshTable(false)
: this.$emit("refreshTable", this.page)
this.$emit('pageChange', this.page)
},
// 页码
......@@ -496,6 +508,7 @@ export default {
this.getListApi
? this.refreshTable(false)
: this.$emit("refreshTable", this.page)
this.$emit('pageChange', this.page)
},
// 重置请求
resetRefreshTable () {
......@@ -507,6 +520,9 @@ export default {
pageSize: 10,
currentPage: 1
}
},
scroll(e){
this.$emit('scroll',e)
}
}
}
......
import { Util } from "@/common/util"
export default {
data () {
return {
prePagePath: '',
track_timerFlag: false,
track_batchId: null,
track_page_view_flag: false,
track_timer_out: null
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.prePagePath = from.path
})
},
computed: {
loginAccount () {
return this.$store.state.d2admin.user.info.loginAccount
}
},
methods: {
setReportTrackData (eventType, eventCode = '', businessParam = '', batchId = '') {
let recordList = localStorage.getItem('recordList'),
route = this.$route,
{ loginAccout, uuid, userType } = this.loginAccount,
{ prePagePath } = this,
item = {
loginAccount: loginAccout,
uuid,
userType,
systemSource: 1,
eventTime: Util.dateFormate(Date.now(), "YYYY-MM-DD HH:mm:ss"),
eventType,
prePagePath: prePagePath || '/',
pagePath: route.path,
}
if (batchId) item.batchId = batchId
if (eventCode) item.eventCode = eventCode
if (businessParam) item.businessParam = JSON.stringify(businessParam)
if (!recordList) recordList = [item]
else {
recordList = JSON.parse(recordList)
recordList.push(item)
}
localStorage.setItem('recordList', JSON.stringify(recordList))
},
getRandomString (length = 30) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
},
onPageShow () {
if (this.track_page_view_flag) return
if (!this.track_batchId) this.track_batchId = `DJ_${this.getRandomString()}_${Date.now()}`
this.track_timerFlag = true
this.track_page_view_flag = true
this.setBrowseTrackData()
},
onPageHide () {
this.track_timerFlag = false
this.track_batchId = null
this.track_page_view_flag = false
clearTimeout(this.track_timer_out)
this.track_timer_out = null
},
setBrowseTrackData () {
try {
if (!this.track_timerFlag) return
else this.track_timer_out = setTimeout(() => {
this.setBrowseTrackData()
}, 10e3)
this.setReportTrackData(2, this.track_event_code, this[this.track_businessParam_key], this.track_batchId)
} catch (error) {
console.log(error)
}
},
}
}
\ No newline at end of file
import { reportTrack } from "@api/resident"
import reportTrackFunMixin from './reportTrackFunMixin'
function getRandomString (length = 10) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
export default {
mixins: [reportTrackFunMixin],
data () {
return {
timerFlag: false,
track_set_timer: null
}
},
beforeDestroy () {
window.removeEventListener('click', this.getTrackData)
this.timerFlag = false
clearTimeout(this.this.track_set_timer)
this.this.track_set_timer = null
},
mounted () {
window.addEventListener('click', this.getTrackData)
this.timerFlag = true
this.intervalRepoet()
},
methods: {
getTrackData (e) {
setTimeout(() => {
if (e.id == 'app') return
let target = e.target || e
if (target.dataset && Object.keys(target.dataset).length && target.dataset.eventCode) this.setReportTrackData(0, target.dataset.eventCode, JSON.parse(target.dataset.track))
else this.getTrackData(target.parentElement)
}, 100)
},
intervalRepoet () {
if (!this.timerFlag) return
this.track_set_timer = setTimeout(() => {
let recordList = localStorage.getItem('recordList')
if (recordList) {
reportTrack({
recordList: JSON.parse(recordList)
}).then(res => {
if (res) localStorage.removeItem('recordList')
})
}
if (this.timerFlag) this.intervalRepoet()
}, 60 * 1e3)
},
getRandomString: getRandomString
}
}
\ No newline at end of file
import reportTrackFunMixin from './reportTrackFunMixin'
export default {
mixins: [reportTrackFunMixin],
methods: {
watchScrollTrack: _.throttle(function (e, eventCode) {
const {
id
} = this.detailObj
this.setReportTrackData(1, eventCode, {
batchId: id
})
}, 1e3)
}
}
\ No newline at end of file
......@@ -130,8 +130,9 @@ import { getMerchantEmployeeList, updateRecordings, getAliOSSToken } from "@api/
import OSS from 'ali-oss'
import * as dayjs from 'dayjs'
import { rangePickerOptions } from "@/common/format"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default {
mixins: [reportTrackFunMixin],
name: 'VoiceDialog',
props: {
visible: Boolean
......@@ -260,6 +261,7 @@ export default {
e.badgeId = badgeId
e.recordingStartTime = dayjs(e.recordingStartTime).format('YYYY-MM-DD HH:mm:ss')
})
this.setReportTrackData(0,'upload_audio',{recordings})
console.log(recordings)
const res = await updateRecordings({ recordings })
console.log(res)
......
......@@ -11,7 +11,7 @@
<div class="value">{{ item.value(defenceDetail) }}</div>
</div>
</div>
<div class="dialog-box">
<div class="dialog-box" @scroll="watchScrollTrack($event,'offense_and_defense_detail')">
<div
class="dialog-item"
v-for="(item, index) in defenceDetail.detailList"
......@@ -111,7 +111,9 @@
<script>
import { defenceDetail } from "@api/resident"
import watchScrollTrackMixin from '@/mixins/watchScrollTrackMixin'
export default {
mixins: [watchScrollTrackMixin],
props: {
detailObj: {
type: Object,
......
......@@ -3,14 +3,36 @@
<div class="record-box">
<div class="record">
<audio id="audio1">
<source :src="detailObj.fileUrl" type="audio/mpeg" />
<source :src="detailObj.fileUrl" type="audio/ogg" />
<source
:src="detailObj.fileUrl"
type="audio/mpeg"
/>
<source
:src="detailObj.fileUrl"
type="audio/ogg"
/>
您的浏览器不支持 audio 标签。
</audio>
<div class="play" v-if="isPlay" @click="handleAudio">
<div
class="play"
v-if="isPlay"
@click="handleAudio"
:data-track="JSON.stringify({
batchId:detailObj.id
})"
data-event-code="pause_audio"
>
<img src="@/assets/play.png" />
</div>
<div class="play" v-else @click="handleAudio">
<div
class="play"
v-else
@click="handleAudio"
:data-track="JSON.stringify({
batchId:detailObj.id
})"
data-event-code="play_audio"
>
<img src="@/assets/pause.png" />
</div>
<div class="times">{{ currentTime }}/{{ totalTime }}</div>
......@@ -18,6 +40,11 @@
id="progressBar"
@mousemove="isCircle = true"
@mouseout="isCircle = false"
:data-track="JSON.stringify({
batchId:detailObj.id,
mergedOffset:myAud.currentTime
})"
data-event-code="audio_progress_bar"
>
<div id="progress">
<div
......@@ -28,22 +55,55 @@
></div>
</div>
</div>
<div class="trumpet" @click="handleMute">
<img src="@/assets/trumpet.png" v-if="isMuted" />
<img src="@/assets/mute.png" v-if="!isMuted" />
<div
class="trumpet"
@click="handleMute"
>
<img
src="@/assets/trumpet.png"
v-if="isMuted"
/>
<img
src="@/assets/mute.png"
v-if="!isMuted"
/>
</div>
</div>
<div class="copy-btn" @click="copyText">
<img class="icon" src="@/assets/copy.png" />
<div
class="copy-btn"
@click="copyText"
:data-track="JSON.stringify(copyTrack)"
data-event-code="audio_link"
>
<img
class="icon"
src="@/assets/copy.png"
/>
音频链接
</div>
</div>
<div class="record-info" v-loading="loading">
<el-tabs v-model="activeName">
<el-tab-pane label="对话详情" name="dialog">
<div
class="record-info"
v-loading="loading"
>
<el-tabs
v-model="activeName"
@tab-click="tabClick"
:data-track="JSON.stringify({
batchId:detailObj.id
})"
:data-event-code="tabsEventCode"
>
<el-tab-pane
label="对话详情"
name="dialog"
>
<template v-if="!loading">
<template v-if="dialogList.length">
<div class="dialog">
<div
class="dialog"
@scroll="watchScrollTrack($event,'dialogue_detail')"
>
<template v-for="item in dialogList">
<div
:class="{
......@@ -51,6 +111,11 @@
'nth-child': item.role % 2 === 1
}"
:key="item.id"
:data-track="JSON.stringify({
batchId:detailObj.id,
mergedOffset:item.mergedOffset
})"
data-event-code="dialogue_detail_statement"
>
<div class="name">
<img
......@@ -80,9 +145,15 @@
</template>
</template>
</el-tab-pane>
<el-tab-pane label="对话摘要" name="abstract">
<el-tab-pane
label="对话摘要"
name="abstract"
>
<template v-if="detailObj.digest">
<div class="abstract" v-html="formatSrt(detailObj.digest)"></div>
<div
class="abstract"
v-html="formatSrt(detailObj.digest)"
></div>
</template>
<template v-else>
<empty />
......@@ -96,7 +167,9 @@
<script>
import { conversationDetailPage, getPointCategory } from "@api/resident"
import Empty from "./Empty"
import watchScrollTrackMixin from '@/mixins/watchScrollTrackMixin'
export default {
mixins: [watchScrollTrackMixin],
components: { Empty },
props: {
detailObj: {
......@@ -104,7 +177,7 @@ export default {
default: {}
}
},
data() {
data () {
return {
myAud: "",
isPlay: true,
......@@ -114,10 +187,12 @@ export default {
currentTime: "00:00",
isCircle: false,
activeName: "dialog",
loading: true
loading: true,
copyTrack: {},
tabsEventCode: ''
}
},
mounted() {
mounted () {
this.conversationDetailPage()
this.myAud = document.getElementById("audio1")
......@@ -128,13 +203,13 @@ export default {
})
},
methods: {
formatSrt(str) {
formatSrt (str) {
return str?.replace(/\n/g, "<br/>") || ""
},
currentDialog(time) {
currentDialog (time) {
this.myAud.currentTime = time
},
toMinutesAndSeconds(seconds) {
toMinutesAndSeconds (seconds) {
let minutes = Math.floor(seconds / 60)
let remainingSeconds = parseInt(seconds % 60)
minutes = minutes > 9 ? minutes : `0${minutes}`
......@@ -142,7 +217,7 @@ export default {
remainingSeconds > 9 ? remainingSeconds : `0${remainingSeconds}`
return `${minutes}:${remainingSeconds}`
},
handleprogress() {
handleprogress () {
const progress = document.getElementById("progress")
const progressBar = document.getElementById("progressBar")
this.myAud.addEventListener("canplay", () => {
......@@ -183,7 +258,7 @@ export default {
false
)
},
handleAudio() {
handleAudio () {
this.isPlay = !this.isPlay
if (!this.isPlay) {
this.myAud.play()
......@@ -191,11 +266,11 @@ export default {
this.myAud.pause()
}
},
handleMute() {
handleMute () {
this.isMuted = !this.isMuted
this.myAud.muted = !this.isMuted
},
async conversationDetailPage() {
async conversationDetailPage () {
try {
this.loading = true
const res = await conversationDetailPage({
......@@ -209,13 +284,13 @@ export default {
this.loading = false
}
},
copyText() {
copyText () {
const { detailObj } = this,
receptionStatus = {
1: "成交",
0: "战败"
}[detailObj.receptionStatus],
{ customerName, startTime, duration, fileUrl } = detailObj
{ customerName, startTime, duration, fileUrl, id } = detailObj
// 客户姓名 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址
let text = [
customerName,
......@@ -224,6 +299,10 @@ export default {
receptionStatus,
fileUrl
].join(" - ")
this.copyTrack = {
context: text,
batchId: id
}
var textarea = document.createElement("textarea")
textarea.style.position = "fixed"
textarea.style.opacity = 0
......@@ -234,7 +313,7 @@ export default {
document.body.removeChild(textarea)
this.$message.success("已复制到剪切板")
},
formatTime(seconds) {
formatTime (seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ""
if (seconds < 60) return seconds + "秒"
......@@ -247,6 +326,10 @@ export default {
if (remainingSeconds > 0) formattedTime += remainingSeconds + "秒"
return formattedTime
}
},
tabClick (e) {
let { index } = e
this.tabsEventCode = ['dialogue_detail', 'dialogue_digest'][index]
}
}
}
......
<template>
<div class="analyse" v-loading="loading">
<el-tabs v-model="activeName">
<el-tab-pane label="质检明细" name="first"></el-tab-pane>
<el-tab-pane label="攻防明细" name="second"></el-tab-pane>
<el-tab-pane label="开口明细" name="third"></el-tab-pane>
<div
class="analyse"
v-loading="loading"
>
<el-tabs
v-model="activeName"
@tab-click="tabClick"
:data-track="JSON.stringify({
batchId:detailObj.id
})"
:data-event-code="tabsEventCode"
>
<el-tab-pane
label="质检明细"
name="first"
></el-tab-pane>
<el-tab-pane
label="攻防明细"
name="second"
></el-tab-pane>
<el-tab-pane
label="开口明细"
name="third"
></el-tab-pane>
</el-tabs>
<template v-if="activeName === 'first'">
<d2-search
......@@ -50,16 +69,31 @@
></el-input-range>
</template>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
<el-button
@click="handleSearch"
size="small"
type="primary"
:data-track="JSON.stringify(searchForm)"
data-event-code="quality_inspection_search"
>
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
<el-button
size="small"
@click="handleReset"
:data-track="JSON.stringify(searchForm)"
data-event-code="quality_inspection_search"
> 重置 </el-button>
</div>
</d2-search>
<div class="theader">
<div class="title">话术列表</div>
<el-radio-group v-model="searchForm.hitResult" size="small">
<el-radio-group
v-model="searchForm.hitResult"
size="small"
@input="radioReport"
>
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">命中</el-radio-button>
<el-radio-button label="0">未命中</el-radio-button>
......@@ -78,25 +112,41 @@
noDataText="数据分析中,请稍等…"
:noDataImg="noDataImg"
height="100%"
@scroll="watchScrollTrack($event,'verbal_trick_list')"
>
<div slot="scoreHtml" slot-scope="scope">
<div
slot="scoreHtml"
slot-scope="scope"
>
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
</template>
<template v-else>--</template>
</div>
<template slot="suggestions" slot-scope="scope">
<template
slot="suggestions"
slot-scope="scope"
>
<el-tooltip
v-if="scope.scope.suggestions"
effect="light"
placement="top"
>
<div slot="content" v-html="scope.scope.suggestions"></div>
<div class="two-line" v-html="scope.scope.suggestions"></div>
<div
slot="content"
v-html="scope.scope.suggestions"
></div>
<div
class="two-line"
v-html="scope.scope.suggestions"
></div>
</el-tooltip>
<div v-else>--</div>
</template>
<template slot="hitText" slot-scope="scope">
<template
slot="hitText"
slot-scope="scope"
>
<div v-if="!scope.scope.score">--</div>
<template v-else>
<el-tooltip
......@@ -104,14 +154,23 @@
effect="light"
placement="top"
>
<div slot="content" v-html="scope.scope.hitText"></div>
<div
slot="content"
v-html="scope.scope.hitText"
></div>
<div class="two-line" v-html="scope.scope.hitText"></div>
<div
class="two-line"
v-html="scope.scope.hitText"
></div>
</el-tooltip>
<div v-else>--</div>
</template>
</template>
<template slot="hitResult" slot-scope="scope">
<template
slot="hitResult"
slot-scope="scope"
>
<div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']">
{{ scope.scope.hitResult == 1 ? "是" : "否" }}
</div>
......@@ -141,7 +200,10 @@
{{ scope.scope.mentionedTime }}
<img src="@/assets/open-time.png" />
</div>
<template slot="mentionedContext" slot-scope="scope">
<template
slot="mentionedContext"
slot-scope="scope"
>
<el-tooltip
v-if="scope.scope.mentionedContext"
effect="light"
......@@ -166,7 +228,9 @@ import {
} from "@api/resident"
import noDataImg from "@/assets/empty-2.png"
import AttackDetail from "./attackDetail"
import watchScrollTrackMixin from '@/mixins/watchScrollTrackMixin'
export default {
mixins: [watchScrollTrackMixin],
components: {
ElInputRange,
AttackDetail
......@@ -177,7 +241,7 @@ export default {
default: {}
}
},
data() {
data () {
return {
activeName: "first",
noDataImg,
......@@ -274,27 +338,28 @@ export default {
firstClassifyList: [],
secondClassifyList: []
},
loading: true
loading: true,
tabsEventCode: ''
}
},
watch: {
"searchForm.hitResult"() {
"searchForm.hitResult" () {
this.getList()
}
},
mounted() {
mounted () {
this.$refs.analyseTable.tableHeightValues = "100%"
// this.getPointCategory()
this.getList()
this.findAxbByBatchId()
},
methods: {
setAudioTime(val) {
setAudioTime (val) {
const time = this.formatTime(val)
console.log(time)
this.$EventBus.$emit("setAudioTime", time)
},
formatTime(time) {
formatTime (time) {
const arr = time.split(":")
let second =
arr.length == 3
......@@ -302,19 +367,19 @@ export default {
: arr[0] * 60 + arr[1] * 1
return second
},
findAxbByBatchId() {
findAxbByBatchId () {
findAxbByBatchId({ batchId: this.detailObj.id }).then((res) => {
this.analyseOpen = res || []
})
},
async getList() {
async getList () {
this.loading = true
try {
await this.beforeSearchFn()
const { list } = await conversationCheckList(this.searchFormSearch)
let titleList = Array.from(
new Set([...list.map((e) => e.firstClassify)])
),
new Set([...list.map((e) => e.firstClassify)])
),
arr = []
titleList.map((i) => {
list.map((e) => {
......@@ -332,10 +397,10 @@ export default {
this.loading = false
}
},
formatSrt(str) {
formatSrt (str) {
return str?.replace(/\n/g, "<br/>") || ""
},
getPointCategory() {
getPointCategory () {
this.classifyMap = new Map()
getPointCategory().then((res) => {
console.log(res)
......@@ -345,13 +410,13 @@ export default {
}
})
},
changeClassify() {
changeClassify () {
this.searchForm.secondClassify = ""
this.baseData.secondClassifyList = this.classifyMap.get(
this.searchForm.firstClassify
)
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.batchId = this.detailObj.id
......@@ -367,10 +432,10 @@ export default {
resolve()
})
},
handleSearch() {
handleSearch () {
this.getList()
},
handleReset() {
handleReset () {
this.searchForm = {
// firstClassify: "",
// secondClassify: "",
......@@ -381,12 +446,12 @@ export default {
this.getList()
},
// 初始化合并行数组
mergeInit() {
mergeInit () {
this.spanArr1 = [] //
this.spanIndex1 = 0 //
},
// 合并表格
merge(data) {
merge (data) {
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
......@@ -407,7 +472,7 @@ export default {
}
},
// 合并单元格
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
const len = this.analyseList.length
if (columnIndex === 0) {
......@@ -424,6 +489,19 @@ export default {
colspan: 1
}
}
},
tabClick (e) {
let { index } = e
this.tabsEventCode = ['quality_inspection_detail', 'offense_and_defense_detail', 'safety_bag'][index]
},
radioReport (e) {
console.log(e)
if (e > -1) this.setReportTrackData(0, {
1: 'hit',
0: 'miss'
}[e], JSON.stringify({
batchId: this.detailObj.id
}))
}
}
}
......
......@@ -14,13 +14,14 @@
<template v-if="qualityDetailList.length">
<div class="overview">
<template v-for="(i, index) in overviewObject">
<div :key="index" class="overview-item">
<div
:key="index"
class="overview-item"
>
<div class="label">{{ i.label }}</div>
<div class="value">
<template v-if="i.formatter">
<div
v-html="i.formatter(qualityDetailList[currentNum])"
></div>
<div v-html="i.formatter(qualityDetailList[currentNum])"></div>
</template>
<template v-else>
{{ qualityDetailList[currentNum][i.key] || "-" }}
......@@ -30,7 +31,10 @@
</template>
</div>
<div class="content" :key="currentNum">
<div
class="content"
:key="currentNum"
>
<div class="dialogue-box">
<dialogue-detail :detailObj="qualityDetailList[currentNum]" />
</div>
......@@ -44,8 +48,11 @@
size="small"
:class="{ opacity: currentNum == 0 }"
@click="jump(-1)"
>上一条</el-button
>
:data-track="JSON.stringify({
batchId:qualityDetailList[currentNum].id
})"
data-event-code="previous"
>上一条</el-button>
<div class="text">
{{ currentNum + 1 }}/{{ qualityDetailList.length }}
</div>
......@@ -54,8 +61,11 @@
size="small"
:class="{ opacity: currentNum == qualityDetailList.length - 1 }"
@click="jump(1)"
>下一条</el-button
>
:data-track="JSON.stringify({
batchId:qualityDetailList[currentNum].id
})"
data-event-code="next"
>下一条</el-button>
</div>
</div>
</d2-dialog>
......@@ -90,13 +100,15 @@ const toMinutesAndSeconds = (seconds) => {
return formattedTime
}
}
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default {
mixins: [reportTrackFunMixin],
name: "RelatActivityOrderDialog",
components: {
QualityAnalyse,
DialogueDetail
},
data() {
data () {
return {
overviewObject: [
{
......@@ -110,45 +122,43 @@ export default {
{
label: "业务场景",
key: "bussinessType",
formatter(row) {
formatter (row) {
let result = { 1: "会员权益/升级", 2: "轻改" }[row.bussinessType]
return result || "-"
}
},
{
label: "APP接待结果",
formatter(row) {
formatter (row) {
// if (row.bussinessType == 2) return "-"
const val = {
1: "成交",
0: "战败"
}[row.receptionStatus],
1: "成交",
0: "战败"
}[row.receptionStatus],
color = {
1: "#2CCA74",
0: "#EB4E4E"
}[row.receptionStatus]
return `<span style="font-size:20px;color:${color}">${
val || "-"
}</span>`
return `<span style="font-size:20px;color:${color}">${val || "-"
}</span>`
}
},
{
label: "预计营销结果",
formatter(row) {
formatter (row) {
if (row.bussinessType == 2) return "-"
const color =
{
成交: "#2CCA74",
战败: "#EB4E4E"
}[row.estimatedResult] || "#999999"
return `<span style="font-size:20px;color:${color}">${
row.estimatedResult || "分析中"
}</span>`
return `<span style="font-size:20px;color:${color}">${row.estimatedResult || "分析中"
}</span>`
}
},
{
label: "质检得分",
formatter(row) {
formatter (row) {
if (row.bussinessType == 2) return "-"
return row.score != null
? `<div class="num">${row.score}<span class="unit">分</span></div>`
......@@ -157,18 +167,23 @@ export default {
},
{
label: "攻防得分",
formatter(row) {
formatter (row) {
return row.defence === 2
? `<div class="num">${row.defencePoint}<span class="unit">分</span></div>`
: row.defence === 1||row.defence === 0||row.defence === 4
? `<span style="font-size:22px;color:#999">分析中</span>`
: row.defence === 3
? `<span style="font-size:22px;color:#999">未发现攻防</span>`
: `<span style="font-size:22px;color:#999">-</span>`
: row.defence === 1 || row.defence === 0 || row.defence === 4
? `<span style="font-size:22px;color:#999">分析中</span>`
: row.defence === 3
? `<span style="font-size:22px;color:#999">未发现攻防</span>`
: `<span style="font-size:22px;color:#999">-</span>`
}
}
],
activeName: "analyse"
activeName: "analyse",
track_event_code: 'reception_detail',
track_businessParam_key: 'searchForm',
searchForm: {
batchId: ""
}
}
},
......@@ -186,20 +201,32 @@ export default {
default: () => []
}
},
watch: {
currentNum: {
handler (val) {
this.searchForm.batchId = this.qualityDetailList[val].id
this.onPageShow()
},
immediate: true
}
},
computed: {},
mounted() {},
mounted () {
console.log(this.qualityDetailList[this.currentNum])
},
methods: {
handleClose() {
handleClose () {
this.$emit("closeDialog", false)
this.onPageHide()
},
jump(num) {
jump (num) {
try {
const { qualityDetailList, currentNum } = this,
max = qualityDetailList.length - 1
if ((currentNum == 0 && num == -1) || (currentNum == max && num == 1))
throw "无更多接待记录"
this.onPageHide()
this.currentNum += num
} catch (error) {
if (error) this.$message.error(error)
......
......@@ -6,10 +6,8 @@
<div class="info-wrap">
<div class="info-item flex">
<label>员工:</label>
<span
>{{ queryData.employeeName || "-" }}
{{ queryData.phoneNumber || "" }}</span
>
<span>{{ queryData.employeeName || "-" }}
{{ queryData.phoneNumber || "" }}</span>
</div>
<div class="info-item flex">
<label>门店:</label>
......@@ -67,10 +65,21 @@
</template>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
<el-button
@click="handleSearch"
size="small"
type="primary"
:data-track="JSON.stringify(searchForm)"
data-event-code="reception_list_search"
>
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
<el-button
size="small"
@click="handleReset"
:data-track="JSON.stringify(searchForm)"
data-event-code="reception_list_search"
> 重置 </el-button>
</div>
<div class="content-table">
<d2-table
......@@ -81,14 +90,21 @@
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
@pageChange="pageChange"
>
<div slot="durationHtml" slot-scope="scope">
<div
slot="durationHtml"
slot-scope="scope"
>
<template v-if="scope.scope.duration">
{{ toMinutesAndSeconds(scope.scope.duration) }}
</template>
<template v-else>--</template>
</div>
<div slot="scoreHtml" slot-scope="scope">
<div
slot="scoreHtml"
slot-scope="scope"
>
<template v-if="scope.scope.bussinessType != 2">
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
......@@ -97,7 +113,10 @@
</template>
<template v-else>-</template>
</div>
<div slot="estimatedResult" slot-scope="scope">
<div
slot="estimatedResult"
slot-scope="scope"
>
<div
v-if="scope.scope.bussinessType != 2"
:class="['tag', setTagColor(scope.scope.estimatedResult)]"
......@@ -106,42 +125,48 @@
</div>
<div v-else></div>
</div>
<div slot="defencePoint" slot-scope="scope">
<div
slot="defencePoint"
slot-scope="scope"
>
<template v-if="scope.scope.defence === 2">{{
scope.scope.defencePoint ? scope.scope.defencePoint : "-"
}}</template>
<template
v-else-if="
<template v-else-if="
scope.scope.defence === 1 ||
scope.scope.defence === 0 ||
scope.scope.defence === 4
"
>分析中</template
>
<template v-else-if="scope.scope.defence === 3"
>未发现攻防</template
>
">分析中</template>
<template v-else-if="scope.scope.defence === 3">未发现攻防</template>
<template v-else>-</template>
</div>
<div slot="customerTypeName" slot-scope="scope">
<div
slot="customerTypeName"
slot-scope="scope"
>
<template v-if="scope.scope.defence === 2">{{
scope.scope.customerTypeName
? scope.scope.customerTypeName
: "-"
}}</template>
<template
v-else-if="
<template v-else-if="
scope.scope.defence === 1 ||
scope.scope.defence === 0 ||
scope.scope.defence === 4
"
>分析中</template
>
">分析中</template>
<template v-else-if="scope.scope.defence === 3">未知</template>
<template v-else>-</template>
</div>
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="qualitDetail(scope.scope)">
<template
slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
@click="qualitDetail(scope.scope)"
:data-track="JSON.stringify(scope.scope)"
data-event-code="reception_detail"
>
接待详情
</el-button>
</template>
......@@ -163,11 +188,14 @@ import { Util, deepClone } from "@/common/util"
import ElInputRange from "../el-input-range"
import QualityDetail from "./qualityDetail.vue"
import { conversationPage } from "@api/resident"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default {
mixins: [reportTrackFunMixin],
props: {
queryData: Object
queryData: Object,
show: Boolean
},
data() {
data () {
return {
isQualityVisible: false,
searchForm: {
......@@ -220,14 +248,14 @@ export default {
{
label: "业务场景",
prop: "bussinessType",
formatter(row) {
formatter (row) {
let result = { 1: "会员权益/升级", 2: "轻改" }[row.bussinessType]
return result || "-"
}
},
{
label: "APP接待结果",
formatter(row) {
formatter (row) {
let result = {
1: "成交",
0: "战败"
......@@ -264,7 +292,7 @@ export default {
label: "安心包是否开口",
prop: "axbOpenFlag",
width: 130,
formatter(row) {
formatter (row) {
return row.axbOpenFlag ? "是" : "否"
}
},
......@@ -272,7 +300,7 @@ export default {
label: "安心包是否成交",
prop: "isFinishFlag",
width: 130,
formatter(row) {
formatter (row) {
return row.finishFlag ? "是" : "否"
}
},
......@@ -304,14 +332,25 @@ export default {
},
qualityDetailList: [],
currentNum: 0,
batchNum: null
batchNum: null,
track_event_code: 'reception_detail_list',
track_businessParam_key: 'searchForm'
}
},
components: {
ElInputRange,
QualityDetail
},
mounted() {
watch: {
show: {
handler (val) {
if (val) this.onPageShow()
else this.onPageHide()
},
immediate: true
}
},
mounted () {
this.getOptionsList()
let timer = setInterval(() => {
if (timer && this.batchNum != null) {
......@@ -323,7 +362,7 @@ export default {
}, 1e3)
},
methods: {
toMinutesAndSeconds(seconds) {
toMinutesAndSeconds (seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ""
if (seconds < 60) {
......@@ -344,10 +383,10 @@ export default {
return formattedTime
}
},
handleSearch() {
handleSearch () {
this.$refs.recepDetail.refreshTable(true, true)
},
handleReset() {
handleReset () {
this.searchForm = {
recepTime: [],
qualityTestScore: [],
......@@ -355,17 +394,19 @@ export default {
}
this.$refs.recepDetail.refreshTable()
},
closeDialog() {
closeDialog () {
this.isQualityVisible = false
this.onPageShow()
},
qualitDetail(row) {
qualitDetail (row) {
const list = this.$refs.recepDetail.data,
currentNum = list.findIndex((e) => e.id == row.id)
this.currentNum = currentNum
this.qualityDetailList = list
this.isQualityVisible = true
this.onPageHide()
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise((resolve) => {
const { queryData } = this
if (!this.searchForm.recepTime.length)
......@@ -408,19 +449,19 @@ export default {
resolve()
})
},
setTableFinishFun(data) {
setTableFinishFun (data) {
let { page } = this.$refs.recepDetail
for (let i = 0; i < data.length; i++) {
data[i].key = i + 1 + page.pageSize * (page.currentPage - 1)
}
},
getOptionsList() {
getOptionsList () {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
......@@ -436,7 +477,7 @@ export default {
}
})
},
setTagColor(estimatedResult) {
setTagColor (estimatedResult) {
switch (estimatedResult) {
case "成交":
return "greenBg"
......@@ -445,6 +486,13 @@ export default {
default:
return "grayBg"
}
},
pageChange (page) {
let { searchForm } = this
this.setReportTrackData(0, 'reception_list_page', {
...searchForm,
...page
})
}
}
}
......
......@@ -21,7 +21,7 @@
{{ i.text }}
<div
class="close"
@click.stop="close(index)"
@click.stop="close(index, i.id)"
>
<i class="el-icon-close"></i>
</div>
......@@ -64,6 +64,7 @@
<quality-index
v-show="windowId == -1"
@openWindow="openWindow"
:show="windowId == -1"
/>
<template v-for="i in [...tab, ...dropdownList]">
<recep-detail
......@@ -71,6 +72,7 @@
:key="i.id"
v-show="windowId == i.id"
:queryData="i.data"
:show="windowId == i.id"
/>
</template>
</div>
......@@ -80,7 +82,9 @@
<script type='text/ecmascript-6'>
import qualityIndex from "./components/qualityIndex"
import recepDetail from "./components/recepDetail.vue"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
mixins: [reportTrackPageMixin],
name: "",
components: {
qualityIndex,
......@@ -91,9 +95,10 @@ export default {
tab: [],
dropdownList: [],
windowId: -1,
tabboxWidth: 0
tabboxWidth: 0,
}
},
// 在beforeDestroy钩子中移除事件监听
beforeDestroy () {
window.removeEventListener('popstate', this.preventBack)
......@@ -114,7 +119,7 @@ export default {
} else this.$router.go(-1)
},
openWindow (data) {
let id = `${data.searchdate}_${data.phoneNumber}_${data.merchantNo}`,
let id = `${data.searchdate}_${data.phoneNumber}_${data.merchantNo}}`,
windowList = [...this.tab, ...this.dropdownList],
windowItem = windowList.find((e) => e.id == id)
if (windowItem) return this.windowId = id
......@@ -131,7 +136,8 @@ export default {
}
this.windowId = id
},
close (index) {
close (index, id) {
this.$refs[`recep-${id}`][0].onPageHide()
this.tab.splice(index, 1)
if (this.dropdownList.length) {
this.tab.push(this.dropdownList[0])
......@@ -146,6 +152,7 @@ export default {
checkEl () {
let { tab, tabboxWidth } = this,
len = tab.length - 1
if (len == -1) return
this.$nextTick(() => {
let [el] = this.$refs[`tab-${len}`]
if (el) {
......@@ -156,7 +163,8 @@ export default {
}
}
})
}
},
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!