Commit b869cb89 by 李伟康

commit 提交

1 parent e02b5fb9
...@@ -106,8 +106,16 @@ const syncBadge=(params = {}) =>{ ...@@ -106,8 +106,16 @@ const syncBadge=(params = {}) =>{
}) })
} }
/**导出 */
const exportReclistList = (params = {}) =>{
params.method = 'scrm.api.mindworkplate.badge.employeeBadgeReclistExport'
return http({
url: 'rop-scrm-partner/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getReclistWithPage, getReclistWithPage,
...@@ -117,5 +125,6 @@ export default { ...@@ -117,5 +125,6 @@ export default {
getPointCategory, getPointCategory,
conversationCheckList, conversationCheckList,
conversationDetailPage, conversationDetailPage,
syncBadge syncBadge,
exportReclistList
} }

2.2 KB | W: | H:

5.12 KB | W: | H:

src/assets/role-one.png
src/assets/role-one.png
src/assets/role-one.png
src/assets/role-one.png
  • 2-up
  • Swipe
  • Onion skin

2.16 KB | W: | H:

5.06 KB | W: | H:

src/assets/role-two.png
src/assets/role-two.png
src/assets/role-two.png
src/assets/role-two.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<div class="dialogue"> <div class="dialogue">
<div class="record-box">
<div class="record"> <div class="record">
<audio id="audio1"> <audio id="audio1">
<!-- <source src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/file.mp3" type="audio/mpeg" /> --> <!-- <source src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/file.mp3" type="audio/mpeg" /> -->
<source :src="detailObj.fileUrl" type="audio/mpeg" /> <source
<source :src="detailObj.fileUrl" type="audio/ogg" /> :src="detailObj.fileUrl"
type="audio/mpeg"
/>
<source
:src="detailObj.fileUrl"
type="audio/ogg"
/>
您的浏览器不支持 audio 标签。 您的浏览器不支持 audio 标签。
</audio> </audio>
<div class="play" v-if="isPlay" @click="handleAudio"> <div
class="play"
v-if="isPlay"
@click="handleAudio"
>
<img src="@/assets/play.png" /> <img src="@/assets/play.png" />
</div> </div>
<div class="play" v-else @click="handleAudio"> <div
class="play"
v-else
@click="handleAudio"
>
<img src="@/assets/pause.png" /> <img src="@/assets/pause.png" />
</div> </div>
<div class="times">{{ currentTime }}/{{ totalTime }}</div> <div class="times">{{ currentTime }}/{{ totalTime }}</div>
<div id="progressBar" @mousemove="isCircle = true" @mouseout="isCircle = false"> <div
id="progressBar"
@mousemove="isCircle = true"
@mouseout="isCircle = false"
>
<div id="progress"> <div id="progress">
<div class="circle" @mousemove="isCircle = true" draggable="true" v-if="isCircle"></div> <div
class="circle"
@mousemove="isCircle = true"
draggable="true"
v-if="isCircle"
></div>
</div> </div>
</div> </div>
<div class="trumpet" @click="handleMute"> <div
<img src="@/assets/trumpet.png" v-if="isMuted" /> class="trumpet"
<img src="@/assets/mute.png" v-if="!isMuted" /> @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> </div>
</div> </div>
<div class="record-info"> <div class="record-info">
<el-tabs
v-model="activeName"
>
<el-tab-pane
label="对话详情"
name="dialog"
>
<div class="dialog"> <div class="dialog">
<template v-for="item in dialogList"> <template v-for="item in dialogList">
<div :class="{ 'dialog-detail': true, 'nth-child': item.role % 2 === 1 }" :key="item.id"> <div
:class="{ 'dialog-detail': true, 'nth-child': item.role % 2 === 1 }"
:key="item.id"
>
<div class="name"> <div class="name">
<img class="role" src="@/assets/role-one.png" v-if="item.role % 2 === 0" /> <img
class="role"
src="@/assets/role-one.png"
v-if="item.role % 2 === 0"
/>
{{item.role % 2 === 0?'车主':'销售'}} {{item.role % 2 === 0?'车主':'销售'}}
<img class="role" src="@/assets/role-two.png" v-if="item.role % 2 === 1" /> <img
class="role two"
src="@/assets/role-two.png"
v-if="item.role % 2 === 1"
/>
</div> </div>
<div class="dig-content" @click="currentDialog(item)"> <div
class="dig-content"
@click="currentDialog(item)"
>
{{ item.content }} {{ item.content }}
</div> </div>
</div> </div>
</template> </template>
</div> </div>
<div class="abstract"> </el-tab-pane>
<div class="title"> <el-tab-pane
<img class="robot" src="@/assets/robot.png" /> label="对话摘要"
AI对话摘要 name="abstract"
</div> >
<div class="abText" v-html="formatSrt(detailObj.digest)"> <div
</div> class="abstract"
v-html="formatSrt(detailObj.digest)"
>
</div> </div>
</el-tab-pane>
</el-tabs>
</div> </div>
</div> </div>
</template> </template>
...@@ -56,41 +125,41 @@ export default { ...@@ -56,41 +125,41 @@ export default {
props: { props: {
detailObj: { detailObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
data() { data () {
return { return {
myAud: '', myAud: '',
isPlay: true, isPlay: true,
isMuted:true, isMuted: true,
dialogList: [], dialogList: [],
totalTime: '0:00', totalTime: '0:00',
currentTime: '0:00', currentTime: '0:00',
isCircle: false isCircle: false,
activeName: 'dialog'
} }
}, },
mounted() { mounted () {
this.myAud = document.getElementById('audio1') this.myAud = document.getElementById('audio1')
this.handleprogress() this.handleprogress()
this.conversationDetailPage() this.conversationDetailPage()
}, },
methods: { methods: {
formatSrt(str) { formatSrt (str) {
return str.replace(/\n/g, "<br/>") return str?.replace(/\n/g, "<br/>") || ''
}, },
currentDialog(data) { currentDialog (data) {
this.myAud.currentTime = data.mergedOffset this.myAud.currentTime = data.mergedOffset
}, },
toMinutesAndSeconds(seconds) { toMinutesAndSeconds (seconds) {
let minutes = Math.floor(seconds / 60) let minutes = Math.floor(seconds / 60)
let remainingSeconds = parseInt(seconds % 60) let remainingSeconds = parseInt(seconds % 60)
minutes = minutes > 10 ? minutes : `0${minutes}` minutes = minutes > 10 ? minutes : `0${minutes}`
remainingSeconds = remainingSeconds > 10 ? remainingSeconds : `0${remainingSeconds}` remainingSeconds = remainingSeconds > 10 ? remainingSeconds : `0${remainingSeconds}`
return `${minutes}:${remainingSeconds}` return `${minutes}:${remainingSeconds}`
}, },
handleprogress() { handleprogress () {
const progress = document.getElementById('progress') const progress = document.getElementById('progress')
const progressBar = document.getElementById('progressBar') const progressBar = document.getElementById('progressBar')
this.myAud.addEventListener('canplay', () => { this.myAud.addEventListener('canplay', () => {
...@@ -128,7 +197,7 @@ export default { ...@@ -128,7 +197,7 @@ export default {
false false
) )
}, },
handleAudio() { handleAudio () {
this.isPlay = !this.isPlay this.isPlay = !this.isPlay
if (!this.isPlay) { if (!this.isPlay) {
this.myAud.play() this.myAud.play()
...@@ -136,12 +205,11 @@ export default { ...@@ -136,12 +205,11 @@ export default {
this.myAud.pause() this.myAud.pause()
} }
}, },
handleMute() { handleMute () {
this.isMuted = !this.isMuted this.isMuted = !this.isMuted
console.log(this.isMuted) this.myAud.muted = !this.isMuted
this.myAud.muted=!this.isMuted
}, },
conversationDetailPage() { conversationDetailPage () {
this.$apis.quality this.$apis.quality
.conversationDetailPage({ .conversationDetailPage({
batchId: this.detailObj.id, batchId: this.detailObj.id,
...@@ -151,22 +219,76 @@ export default { ...@@ -151,22 +219,76 @@ export default {
.then(res => { .then(res => {
this.dialogList = res.list this.dialogList = res.list
}) })
},
copyText () {
const { detailObj } = this,
receptionStatus = {
1: '成交',
0: '战败'
}[detailObj.receptionStatus],
{ customerName, startTime, duration, fileUrl } = detailObj
// 客户姓名 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址
let text = [customerName, startTime, this.formatTime(duration), receptionStatus, fileUrl].join(' - ')
var textarea = document.createElement('textarea');
textarea.style.position = 'fixed';
textarea.style.opacity = 0;
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
this.$message.success('已复制到剪切板')
},
formatTime (seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
} }
},
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.dialogue { .dialogue {
margin: auto; background-color: #fff;
padding: 20px;
height: 100%;
box-sizing: border-box;
.record-box {
display: flex;
align-items: center;
margin-bottom: 10px;
.copy-btn {
margin-left: auto;
font-size: 14px;
color: #5850ff;
display: flex;
align-items: center;
cursor: pointer;
.icon {
width: 16px;
height: 16px;
}
}
}
.record { .record {
width: 600px; width: 73.7%;
margin: 5px auto 0px; height: 48px;
height: 56px;
background: #f7f9fa; background: #f7f9fa;
border-radius: 32px; border-radius: 32px;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box;
padding: 0 16px;
audio { audio {
width: 600px; width: 600px;
height: 56px; height: 56px;
...@@ -177,7 +299,8 @@ export default { ...@@ -177,7 +299,8 @@ export default {
.play { .play {
width: 24px; width: 24px;
height: 24px; height: 24px;
margin: 0 20px 0 24px; margin-right: 12px;
flex-shrink: 0;
img { img {
width: 100%; width: 100%;
} }
...@@ -185,7 +308,7 @@ export default { ...@@ -185,7 +308,7 @@ export default {
.trumpet { .trumpet {
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-left: 24px; margin-left: auto;
img { img {
width: 100%; width: 100%;
} }
...@@ -195,12 +318,12 @@ export default { ...@@ -195,12 +318,12 @@ export default {
color: #666666; color: #666666;
min-width: 80px; min-width: 80px;
text-align: center; text-align: center;
margin-right: 19px; margin-right: 8px;
} }
#progressBar { #progressBar {
// position: absolute; // position: absolute;
height: 6px; height: 6px;
width: 370px; width: calc(100% - 170px);
background-color: #e7e7e7; /* 进度条背景颜色 */ background-color: #e7e7e7; /* 进度条背景颜色 */
border-radius: 6px; border-radius: 6px;
} }
...@@ -226,22 +349,27 @@ export default { ...@@ -226,22 +349,27 @@ export default {
} }
.record-info { .record-info {
width: 100%; width: 100%;
float: left; height: calc(100% - 58px);
position: relative; position: relative;
padding-right: 354px;
box-sizing: border-box; box-sizing: border-box;
height: 544px;
margin: 20px 0;
// display: flex; // display: flex;
// align-items: center; // align-items: center;
.el-tabs {
height: 100%;
/deep/.el-tabs__content {
height: calc(100% - 55px);
}
.el-tab-pane {
height: 100%;
}
}
.dialog { .dialog {
width: 100%; width: 100%;
min-width: 588px; height: 100%;
height: 544px;
background: #f7f9fa; background: #f7f9fa;
border-radius: 4px; border-radius: 4px;
overflow-y: scroll; overflow-y: scroll;
padding: 20px; padding: 12px 8px 12px 16px;
box-sizing: border-box; box-sizing: border-box;
.dialog-detail { .dialog-detail {
margin-bottom: 8px; margin-bottom: 8px;
...@@ -252,14 +380,18 @@ export default { ...@@ -252,14 +380,18 @@ export default {
letter-spacing: 0; letter-spacing: 0;
line-height: 16px; line-height: 16px;
.role { .role {
width: 40px; width: 32px;
height: 40px; height: 32px;
vertical-align: top; vertical-align: top;
margin-right: 10px; margin-right: 10px;
} }
.two {
margin-right: 0;
}
} }
.dig-content { .dig-content {
width: 404px; width: fit-content;
max-width: 70%;
background: #EBEBFF; background: #EBEBFF;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
...@@ -267,8 +399,7 @@ export default { ...@@ -267,8 +399,7 @@ export default {
padding: 10px 12px; padding: 10px 12px;
white-space: pre-wrap; white-space: pre-wrap;
text-align: left; text-align: left;
margin-left: 50px; margin: -14px 0 0 40px;
margin-top: -20px;
line-height: 20px; line-height: 20px;
} }
} }
...@@ -276,45 +407,24 @@ export default { ...@@ -276,45 +407,24 @@ export default {
text-align: right; text-align: right;
.dig-content { .dig-content {
display: inline-block; display: inline-block;
background: #FFFFFF; background: #ffffff;
margin-right: 58px; margin-right: 38px;
line-height: 22px;
} }
} }
} }
.abstract { .abstract {
width: 334px; width: 100%;
height: 544px; height: 100%;
padding: 12px 20px; padding: 12px 8px 12px 16px;
position: absolute; background: #f8f7ff;
right: 0; border-radius: 0 4px 4px 4px;
top: 0;
background-image: linear-gradient(180deg, #f6f4ff 0%, #f0f3ff 100%);
border: 1px solid #5850ff80;
border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
.title { font-size: 14px;
font-weight: 700;
font-size: 16px;
color: #333333; color: #333333;
.robot { letter-spacing: 0;
width: 28px; line-height: 24px;
height: 28px; overflow-y: scroll;
margin-right: 8px;
display: inline-block;
vertical-align: middle;
}
}
.abText {
margin-top: 14px;
width: 294px;
height: 472px;
padding: 12px;
box-sizing: border-box;
background: #ffffff;
border-radius: 4px;
overflow: scroll;
line-height: 20px;
}
} }
} }
} }
......
<template> <template>
<div class="quality-control"> <div class="quality-control">
<div class="header">
<div class="item" v-for="(i, index) in infoList" :key="index">
<div class="icon">
<img :src="require(`@/assets/${i.icon}.png`)" />
</div>
<div class="info">
<div>
{{ i.text }}
<el-tooltip effect="dark" :content="i.tooltip" placement="top" v-if="i.tooltip">
<img class="mark" src="@/assets/mark.png" />
</el-tooltip>
</div>
<div class="time" v-html="i.formatter && i.formatter(statistics)"></div>
</div>
</div>
</div>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" class="show-search" labelWidth="110px" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm
<div slot="searchdate"> ref="showSearch"
<el-date-picker v-model="searchForm.searchdate" type="date" placeholder="选择日期" :picker-options="rangePickerOptions"></el-date-picker> class="show-search"
</div> labelWidth="110px"
:formObj="searchForm"
:formData="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<!-- 质检评分 --> <!-- 质检评分 -->
<div slot="score"> <div slot="score">
<el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.qualityTestScore"></el-input-range> <el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:displayValue="searchForm.qualityTestScore"
></el-input-range>
</div> </div>
<!-- 当日到店量 --> <!-- 当日到店量 -->
<!-- <div slot="toStoreCount"> <!-- <div slot="toStoreCount">
<el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.toStoreCount"></el-input-range> <el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.toStoreCount"></el-input-range>
</div> --> </div> -->
<div slot="AbnormalProportion"> <div slot="AbnormalProportion">
<el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.AbnormalProportion" infinity></el-input-range> <el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:displayValue="searchForm.AbnormalProportion"
infinity
></el-input-range>
</div> </div>
</GLCombiForm> </GLCombiForm>
<div class="table-box">
<GLTable ref="qualityTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" :noDataImg="url" @setTableFinishFun="setTableFinishFun"> <div class="title">
<div slot="store" slot-scope="scope"> 质检列表
<el-button
class="btn"
@click="exportTable"
size="small"
>
导出
</el-button>
</div>
<GLTable
ref="qualityTable"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf"
:noDataImg="url"
@setTableFinishFun="setTableFinishFun"
:border="true"
:hasNum="false"
:span-method="arraySpanMethod"
:tableData="tableList"
:tableTotal="tableTotal"
@refreshTable="jumpPage"
>
<div
slot="store"
slot-scope="scope"
>
<template v-if="scope.scope.storeList && scope.scope.storeList.length > 1"> <template v-if="scope.scope.storeList && scope.scope.storeList.length > 1">
<span>{{ scope.scope.storeList.slice(0, 1).join('') }}</span> <span>{{ scope.scope.storeList.slice(0, 1).join('') }}</span>
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div :class="{ scrollHeight: scope.scope.storeList.length >= 10 }"> <div :class="{ scrollHeight: scope.scope.storeList.length >= 10 }">
<div v-for="(item, index) in scope.scope.storeList" :key="index">{{ item }}</div> <div
v-for="(item, index) in scope.scope.storeList"
:key="index"
>{{ item }}</div>
</div> </div>
<span class="more-info" slot="reference">...({{ scope.scope.storeList.length }})</span> <span
class="more-info"
slot="reference"
>...({{ scope.scope.storeList.length }})</span>
</el-popover> </el-popover>
</template> </template>
<template v-else> <template v-else>
...@@ -50,20 +85,36 @@ ...@@ -50,20 +85,36 @@
<span v-else>{{ scope.scope.storeList.join('') }}</span> <span v-else>{{ scope.scope.storeList.join('') }}</span>
</template> </template>
</div> </div>
<div slot="seconds" slot-scope="scope"> <div
slot="seconds"
slot-scope="scope"
>
<template v-if="scope.scope.seconds"> <template v-if="scope.scope.seconds">
{{ toMinutesAndSeconds(scope.scope.seconds) }} {{ toMinutesAndSeconds(scope.scope.seconds) }}
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<div slot="service" slot-scope="scope"> <div
slot="service"
slot-scope="scope"
>
<template v-if="scope.scope.serviceList && scope.scope.serviceList.length > 1"> <template v-if="scope.scope.serviceList && scope.scope.serviceList.length > 1">
<span>{{ scope.scope.serviceList.slice(0, 1).join('') }}</span> <span>{{ scope.scope.serviceList.slice(0, 1).join('') }}</span>
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover
<div v-for="(item, index) in scope.scope.serviceList" :key="index"> placement="top"
width="fit-content"
trigger="hover"
>
<div
v-for="(item, index) in scope.scope.serviceList"
:key="index"
>
{{ item }} {{ item }}
</div> </div>
<span class="more-info" slot="reference">...({{ scope.scope.serviceList.length }})</span> <span
class="more-info"
slot="reference"
>...({{ scope.scope.serviceList.length }})</span>
</el-popover> </el-popover>
</template> </template>
<template v-else> <template v-else>
...@@ -71,7 +122,10 @@ ...@@ -71,7 +122,10 @@
<span v-else>{{ scope.scope.serviceList.join('') }}</span> <span v-else>{{ scope.scope.serviceList.join('') }}</span>
</template> </template>
</div> </div>
<div slot="abnormalProportionHtml" slot-scope="scope"> <div
slot="abnormalProportionHtml"
slot-scope="scope"
>
<template v-if="scope.scope.abnormalProportion"> <template v-if="scope.scope.abnormalProportion">
{{ scope.scope.abnormalProportion + '%' }} {{ scope.scope.abnormalProportion + '%' }}
</template> </template>
...@@ -80,77 +134,60 @@ ...@@ -80,77 +134,60 @@
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<div slot="scoreHtml" slot-scope="scope"> <div
slot="scoreHtml"
slot-scope="scope"
>
<template v-if="scope.scope.score || scope.scope.score === 0"> <template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }} {{ scope.scope.score }}
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<el-button type="text" @click="recepDetail(scope.scope)" v-if="scope.scope.score || scope.scope.score == 0" >接待明细</el-button> <el-button
<span v-else class="dis-class" @click="recepDetail()">接待明细</span> type="text"
@click="recepDetail(scope.scope)"
>接待明细</el-button>
</div> </div>
</GLTable> </GLTable>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import ElInputRange from './el-input-range' import ElInputRange from './el-input-range'
import { rangePickerOptions } from '@/common/format'
export default { export default {
components: { components: {
ElInputRange ElInputRange
}, },
data() { data () {
return { return {
url: url, url: url,
rangePickerOptions: rangePickerOptions,
infoList: [
{
icon: 'record',
text: '录音时长',
value: 'totalRecordingDuration',
formatter: data => {
return `<span style="font-weight:700;font-size:26px;">${data.totalRecordingDuration ? this.toMinutesAndSeconds(data.totalRecordingDuration) : '--'}</span>`
}
// formatter: data => {
// let strHtml = this.toMinutesAndSeconds(data.totalRecordingDuration).h
// ? `<span style="font-weight:700;font-size:26px">${this.toMinutesAndSeconds(data.totalRecordingDuration).h}</span>小时
// <span style="font-weight:700;font-size:26px;">${this.toMinutesAndSeconds(data.totalRecordingDuration).m}</span>分钟
// `
// : ` <span style="font-weight:700;font-size:26px;">${this.toMinutesAndSeconds(data.totalRecordingDuration).m}</span>分钟`
// return strHtml
// }
},
{
icon: 'facility',
text: '上传录音设备占比',
formatter: data => {
return `<span style="font-weight:700;font-size:26px;">${data.uploadBadgeCount}</span>/${data.totalBadgeCount}`
}
},
{
icon: 'score',
text: '话术平均质检评分',
formatter: data => {
let strHtml = data.averageQualityTestScore || data.averageQualityTestScore == 0 ? `<span style="font-weight:700;font-size:26px;">${data.averageQualityTestScore}</span>分` : `<span style="font-weight:700;font-size:22px;">统计中</span>`
return strHtml
},
tooltip: '统计当日所有员工的质检平均分,分值越高整体表现越好'
}
],
statistics: { statistics: {
totalBadgeCount: '', totalBadgeCount: '',
uploadBadgeCount: '' uploadBadgeCount: ''
}, },
tableList: [],
tableTotal: 0,
page: {
pageSize: 10,
currentPage: 1
},
showFormData: [ showFormData: [
{ {
label: '质检日期', label: '质检日期',
name: 'searchdate', name: 'searchdate',
addHtml: 'searchdate' // addHtml: 'searchdate'
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}, },
{ {
label: '质检评分', label: '质检评分',
...@@ -204,7 +241,7 @@ export default { ...@@ -204,7 +241,7 @@ export default {
// } // }
], ],
searchForm: { searchForm: {
searchdate: '', searchdate: [new Date(), new Date()],
serviceMerchantNo: '', serviceMerchantNo: '',
storeMerchantNo: '', storeMerchantNo: '',
employeeName: '', employeeName: '',
...@@ -214,12 +251,18 @@ export default { ...@@ -214,12 +251,18 @@ export default {
AbnormalProportion: [] AbnormalProportion: []
}, },
searchFormSearch: {}, searchFormSearch: {},
getListApi: this.$apis.quality.getReclistWithPage,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: {
width:'100px'
},
tableColumns: [ tableColumns: [
{ {
label: "序号",
prop: "num",
width: "50px"
},
{
label: '录音日期', label: '录音日期',
prop: 'searchdate', prop: 'searchdate',
width: '120px' width: '120px'
...@@ -227,8 +270,8 @@ export default { ...@@ -227,8 +270,8 @@ export default {
{ {
label: '员工', label: '员工',
prop: 'employeeName', prop: 'employeeName',
width:150, width: 150,
line:1 line: 1
}, },
{ {
label: '手机号', label: '手机号',
...@@ -237,8 +280,7 @@ export default { ...@@ -237,8 +280,7 @@ export default {
}, },
{ {
label: '归属门店', label: '归属门店',
prop: 'storeMerchantNo', prop: 'merchantName',
addHtml: 'store',
width: '180px' width: '180px'
}, },
{ {
...@@ -253,7 +295,7 @@ export default { ...@@ -253,7 +295,7 @@ export default {
width: '200px' width: '200px'
}, },
{ {
label: '录音时长', label: '接待时长',
prop: 'seconds', prop: 'seconds',
addHtml: 'seconds', addHtml: 'seconds',
width: '150px' width: '150px'
...@@ -314,7 +356,7 @@ export default { ...@@ -314,7 +356,7 @@ export default {
{ {
attrs: { attrs: {
effect: 'dark', effect: 'dark',
content: '异常占比= (预计接待批次 - 当日到店量)/ 预计接待批次数,建议重点关注异常占比超过20%的员工', content: '异常占比= (当日到店量 - 预计接待批次)/ 当日到店量,建议重点关注异常占比超过20%的员工',
placement: 'top' placement: 'top'
} }
}, },
...@@ -344,6 +386,11 @@ export default { ...@@ -344,6 +386,11 @@ export default {
) )
]) ])
} }
},
{
label: "真实接待数量",
prop: "realRecCount",
width: "140px"
} }
] ]
}, },
...@@ -351,23 +398,41 @@ export default { ...@@ -351,23 +398,41 @@ export default {
baseData: { baseData: {
parkServiceList: [], //服务商 parkServiceList: [], //服务商
storeIdList: [] storeIdList: []
} },
spanArr1: [],
spanIndex1: 0,
spanArr2: [],
spanIndex2: 0,
spanArr3: [],
spanIndex3: 0,
spanArr4: [],
spanIndex4: 0,
} }
}, },
created() { created () {
this.searchForm.searchdate = new Date().getTime() - 3600 * 1000 * 24 this.getList()
}, },
watch: { watch: {
'searchForm.searchdate'(newVal) { 'searchForm.searchdate' (newVal) {
this.statisticsEmployeeBadge(newVal) this.statisticsEmployeeBadge(newVal)
this.$refs.qualityTable.refreshTable(true, true) this.getList()
} }
}, },
mounted() { mounted () {
this.getServiceStore() this.getServiceStore()
}, },
methods: { methods: {
getServiceStore() { async getList () {
await this.beforeSearchFn()
const { total, list } = await this.$apis.quality.getReclistWithPage({
...this.page,
...this.searchFormSearch
})
this.restructureData(list)
this.tableTotal = total
},
getServiceStore () {
this.$apis.quality this.$apis.quality
.listShop4sByRef({ .listShop4sByRef({
currentPage: 1, currentPage: 1,
...@@ -379,7 +444,7 @@ export default { ...@@ -379,7 +444,7 @@ export default {
this.getOptionsList() this.getOptionsList()
}) })
}, },
statisticsEmployeeBadge(val) { statisticsEmployeeBadge (val) {
let searchdate = Util.dateFormate(val, 'YYYY-MM-DD') let searchdate = Util.dateFormate(val, 'YYYY-MM-DD')
this.$apis.quality this.$apis.quality
.statisticsEmployeeBadge({ .statisticsEmployeeBadge({
...@@ -390,31 +455,13 @@ export default { ...@@ -390,31 +455,13 @@ export default {
this.statistics = res this.statistics = res
}) })
}, },
recepDetail(row) { recepDetail (row) {
if (!row) { let data = {}
this.$confirm('质检分析中,请耐心等待', '提示', { if (row) data = encodeURIComponent(JSON.stringify(row))
type: 'warning', // window.open(`${window.location.origin}/quality/qualityManage/recepDetail?data=${data}`)
showCancelButton:false, window.open(`${window.location.origin}/activityCenter122/qualityManage/recepDetail?data=${data}`)
showConfirmButton:false
})
return
}
this.$router.push({
path: '/qualityManage/recepDetail',
query: {
data: JSON.stringify(row)
}
})
}, },
// toMinutesAndSeconds(time) { toMinutesAndSeconds (seconds) {
// const h = Math.floor(time / 3600)
// const m = parseInt((time % 3600) / 60)
// return {
// h,
// m
// }
// },
toMinutesAndSeconds(seconds) {
// seconds = Math.floor(seconds / 1000) // seconds = Math.floor(seconds / 1000)
let formattedTime = '' let formattedTime = ''
if (seconds < 60) return seconds + '秒' if (seconds < 60) return seconds + '秒'
...@@ -434,18 +481,28 @@ export default { ...@@ -434,18 +481,28 @@ export default {
return formattedTime return formattedTime
} }
}, },
setTableFinishFun(data) { setTableFinishFun (data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
data[i].serviceMerchantNo = this.$globalState.session.merchantName data[i].serviceMerchantNo = this.$globalState.session.merchantName
} }
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
if (this.searchForm.searchdate) { if (this.searchForm.searchdate.length) {
this.searchFormSearch.searchdate = Util.dateFormate(this.searchForm.searchdate, 'YYYY-MM-DD') let [searchStartDate, searchEndDate] = this.searchForm.searchdate
this.searchFormSearch.searchStartDate = '2024-02-22'
// Util.dateFormate(
// searchStartDate,
// "YYYY-MM-DD"
// )
this.searchFormSearch.searchEndDate = Util.dateFormate(
searchEndDate,
"YYYY-MM-DD"
)
} }
this.searchFormSearch.serviceMerchantNo = this.$globalState.session.merchantId delete this.searchFormSearch.searchdate
// this.searchFormSearch.serviceMerchantNo = this.$globalState.session.merchantId
if (this.searchFormSearch.qualityTestScore) { if (this.searchFormSearch.qualityTestScore) {
this.searchFormSearch.qualityTestScoreBegin = this.searchFormSearch.qualityTestScore[0] this.searchFormSearch.qualityTestScoreBegin = this.searchFormSearch.qualityTestScore[0]
this.searchFormSearch.qualityTestScoreEnd = this.searchFormSearch.qualityTestScore[1] this.searchFormSearch.qualityTestScoreEnd = this.searchFormSearch.qualityTestScore[1]
...@@ -465,7 +522,7 @@ export default { ...@@ -465,7 +522,7 @@ export default {
resolve() resolve()
}) })
}, },
getOptionsList() { getOptionsList () {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if (this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
...@@ -478,27 +535,150 @@ export default { ...@@ -478,27 +535,150 @@ export default {
} }
}) })
}, },
handleSearch() { handleSearch () {
if (this.searchForm.phoneNumber && this.searchForm.phoneNumber.length < 4) { if (this.searchForm.phoneNumber && this.searchForm.phoneNumber.length < 4) {
return return
} }
this.$refs.qualityTable.refreshTable(true, true) this.getList()
// this.stockMonthReportCount()
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = this.$options.data.call(this).searchForm
searchdate: '', this.getList()
serviceMerchantNo: '', },
storeMerchantNo: '', jumpPage (page) {
employeeName: '', this.page = page
phoneNumber: '', this.getList()
// toStoreCount: [], },
qualityTestScore: [], restructureData (data) {
AbnormalProportion: [] this.tableList = []
let dataList = data
if (dataList && dataList.length > 0) {
dataList = dataList.map((item, index) => {
item.num = index + 1
return item
})
this.tableList = dataList.reduce((prev, cur, index, arr) => {
const merchantDTOList = cur.merchantDTOList
delete cur.merchantDTOList
if (merchantDTOList && merchantDTOList.length > 0) {
merchantDTOList.map((item) => {
prev.push({
...item,
...cur
})
})
} else {
prev.push(cur)
}
return prev
}, [])
this.merge(this.tableList)
}
},
// 初始化合并行数组
mergeInit () {
this.spanArr1 = [] // 合并序列
this.spanIndex1 = 0 //
this.spanArr2 = [] // 合并日期
this.spanIndex2 = 0 //
this.spanArr3 = [] // 合并员工
this.spanIndex3 = 0 //
this.spanArr4 = [] // 合并手机号
this.spanIndex4 = 0 // 合并渠道索引
},
// 合并表格
merge (data) {
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
// 第一行必须存在,以第一行为基准
this.spanArr1.push(1) // 合并序列
this.spanIndex1 = 0
this.spanArr2.push(1) // 合并日期
this.spanIndex2 = 0
this.spanArr3.push(1) // 合并员工
this.spanIndex3 = 0
this.spanArr4.push(1) // 合并手机号
this.spanIndex4 = 0
} else {
if (data[i].phoneNumber == data[i - 1].phoneNumber && data[i].searchdate == data[i - 1].searchdate) {
this.spanArr1[this.spanIndex1] += 1
this.spanArr1.push(0)
this.spanArr2[this.spanIndex2] += 1
this.spanArr2.push(0)
this.spanArr3[this.spanIndex3] += 1
this.spanArr3.push(0)
this.spanArr4[this.spanIndex4] += 1
this.spanArr4.push(0)
} else {
this.spanArr1.push(1)
this.spanIndex1 = i
this.spanArr2.push(1)
this.spanIndex2 = i
this.spanArr3.push(1)
this.spanIndex3 = i
this.spanArr4.push(1)
this.spanIndex4 = i
}
}
}
}
},
// 合并单元格
arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
const len = this.tableList.length
// const t = this.columns.length
if (columnIndex === 1) {
// 第一列
const _row_1 = this.spanArr1[rowIndex]
const _col_1 = _row_1 > 0 ? 1 : 0
return {
rowspan: _row_1,
colspan: _col_1
}
} else if (columnIndex === 2) {
// 第二列
const _row_2 = this.spanArr2[rowIndex]
const _col_2 = _row_2 > 0 ? 1 : 0
return {
rowspan: _row_2,
colspan: _col_2
}
// 第三列
} else if (columnIndex === 3) {
const _row_3 = this.spanArr3[rowIndex]
const _col_3 = _row_3 > 0 ? 1 : 0
return {
rowspan: _row_3,
colspan: _col_3
}
// 第四列
} else if (columnIndex === 4) {
const _row_4 = this.spanArr4[rowIndex]
const _col_4 = _row_4 > 0 ? 1 : 0
return {
rowspan: _row_4,
colspan: _col_4
}
}
else if (rowIndex === len) {
return {
rowspan: 1,
colspan: 1
} }
this.searchForm.searchdate = new Date().getTime() - 3600 * 1000 * 24 }
this.$refs.qualityTable.refreshTable() },
// this.stockMonthReportCount() async exportTable () {
await this.beforeSearchFn()
const res = await this.$apis.quality.exportReclistList({
...this.page,
...this.searchFormSearch
})
if (res) window.open(res)
} }
} }
} }
...@@ -562,7 +742,20 @@ export default { ...@@ -562,7 +742,20 @@ export default {
width: 100%; width: 100%;
} }
} }
.table-box {
.title {
font-weight: 500;
font-size: 16px;
color: #333333;
line-height: 16px;
display: flex;
align-items: center;
margin-bottom: 8px;
.btn {
margin-left: auto;
}
}
}
.el-range-input { .el-range-input {
appearance: none; appearance: none;
border: none; border: none;
...@@ -582,8 +775,8 @@ export default { ...@@ -582,8 +775,8 @@ export default {
color: #5850ff; color: #5850ff;
cursor: pointer; cursor: pointer;
} }
.dis-class{ .dis-class {
color:#666; color: #666;
cursor: pointer; cursor: pointer;
} }
} }
......
<template> <template>
<div class="analyse"> <div class="analyse">
<div class="statistics"> <GLCombiForm
<div class="s-item" v-for="(item, index) in sList" :key="index"> ref="showSearch"
<div class="title">{{ item.text }}</div> class="show-search"
<div class="content" v-html="item.formatter && item.formatter(detailObj)"></div> :formObj="searchForm"
</div> :form-data="showFormData"
</div> @handleOk="handleSearch"
<GLCombiForm ref="showSearch" class="show-search" :formObj="searchForm" :form-data="showFormData" @handleOk="handleSearch" @handleRest="handleReset"> @handleRest="handleReset"
>
<div slot="firstClassify"> <div slot="firstClassify">
<el-select v-model="searchForm.firstClassify" clearable placeholder="请选择" @change="changeClassify"> <el-select
<el-option v-for="item in baseData.firstClassifyList" :key="item" :label="item" :value="item"></el-option> v-model="searchForm.firstClassify"
clearable
placeholder="请选择"
@change="changeClassify"
>
<el-option
v-for="item in baseData.firstClassifyList"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select> </el-select>
</div> </div>
<div slot="secondClassify"> <div slot="secondClassify">
<el-select v-model="searchForm.secondClassify" clearable placeholder="请选择"> <el-select
<el-option v-for="item in baseData.secondClassifyList" :key="item" :label="item" :value="item"></el-option> v-model="searchForm.secondClassify"
clearable
placeholder="请选择"
>
<el-option
v-for="item in baseData.secondClassifyList"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select> </el-select>
</div> </div>
<template slot="score"> <template slot="score">
<el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.qualityTestScore"></el-input-range> <el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:displayValue="searchForm.qualityTestScore"
></el-input-range>
</template> </template>
</GLCombiForm> </GLCombiForm>
<div class="theader"> <div class="theader">
<div class="title">话术列表</div> <div class="title">话术列表</div>
<el-radio-group v-model="searchForm.hitResult"> <el-radio-group
v-model="searchForm.hitResult"
size="small"
>
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">命中</el-radio-button> <el-radio-button label="1">命中</el-radio-button>
<el-radio-button label="0">未命中</el-radio-button> <el-radio-button label="0">未命中</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<GLTable ref="analyseTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn" :pageConf="pageConf" :hasPage="false" :noDataImg="url"> <GLTable
<div slot="scoreHtml" slot-scope="scope"> ref="analyseTable"
:hasNum="false"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:pageConf="pageConf"
:hasPage="false"
:noDataImg="url"
:span-method="arraySpanMethod"
:tableData="analyseList"
:border="true"
>
<div
slot="scoreHtml"
slot-scope="scope"
>
<template v-if="scope.scope.score || scope.scope.score === 0"> <template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }} {{ scope.scope.score }}
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<template slot="suggestions" slot-scope="scope"> <template
<div v-if="scope.scope.suggestions" v-html="formatSrt(scope.scope.suggestions)"></div> slot="suggestions"
slot-scope="scope"
>
<el-tooltip
v-if="scope.scope.suggestions"
effect="light"
placement="bottom"
>
<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> <div v-else>--</div>
<!-- <div v-html="formatSrt(scope.scope.suggestions)"></div> -->
</template> </template>
<template slot="hitText" slot-scope="scope"> <template
slot="hitText"
slot-scope="scope"
>
<div v-if="!scope.scope.score">--</div> <div v-if="!scope.scope.score">--</div>
<template v-else> <template v-else>
<div v-if="scope.scope.hitText" v-html="formatSrt(scope.scope.hitText)"></div> <el-tooltip
v-if="scope.scope.hitText"
effect="light"
placement="bottom"
>
<div
slot="content"
v-html="scope.scope.hitText"
></div>
<div
class="two-line"
v-html="scope.scope.hitText"
></div>
</el-tooltip>
<div v-else>--</div> <div v-else>--</div>
</template> </template>
</template> </template>
<template slot="hitResult" slot-scope="scope"> <template
slot="hitResult"
slot-scope="scope"
>
<div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']"> <div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']">
{{ scope.scope.hitResult == 1 ? '是' : '否' }} {{ scope.scope.hitResult == 1 ? '是' : '否' }}
</div> </div>
...@@ -67,48 +144,15 @@ export default { ...@@ -67,48 +144,15 @@ export default {
props: { props: {
detailObj: { detailObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
data() { data () {
return { return {
analyseList: [],
url: url, url: url,
sList: [ spanArr1: [],
{ spanIndex1: 0,
text: '话术评分',
formatter: data => {
return `<span style="font-weight:700;font-size:20px;">${data.score ? data.score : '0'}</span>分`
}
},
{
text: '预计营销结果',
formatter: data => {
let classStr = data.estimatedResult == '成交' ? (data.estimatedResult == '战败' ? 'redStr' : 'greenStr') : 'grayStr'
return `<span class="${classStr}" style="font-weight:700;font-size:20px;">${data.estimatedResult ? data.estimatedResult : '--'}</span>`
}
},
{
text: '开始录音时间',
formatter: data => {
return `<span style="font-weight:700;font-size:20px;">${data.startTime ? data.startTime : '--'}</span>`
}
},
{
text: '对话时长',
formatter: data => {
return `<span style="font-weight:700;font-size:20px;">${data.duration ? this.toMinutesAndSeconds(data.duration) : '--'}</span>`
}
// formatter: data => {
// let strHtml = this.toMinutesAndSeconds(data.duration).h
// ? `<span style="font-weight:700;font-size:20px">${this.toMinutesAndSeconds(data.duration).h}</span>小时
// <span style="font-weight:700;font-size:20px;">${this.toMinutesAndSeconds(data.duration).m}</span>分钟
// `
// : ` <span style="font-weight:700;font-size:20px;">${this.toMinutesAndSeconds(data.duration).m}</span>分钟`
// return strHtml
// }
}
],
searchForm: { searchForm: {
// firstClassify: '', // firstClassify: '',
// secondClassify: '', // secondClassify: '',
...@@ -130,11 +174,11 @@ export default { ...@@ -130,11 +174,11 @@ export default {
{ {
label: '质检评分', label: '质检评分',
name: 'qualityTestScore', name: 'qualityTestScore',
addHtml: 'score' addHtml: 'score',
style: 'width:300px !important'
} }
], ],
select: '全部', select: '全部',
getListApi: this.$apis.quality.conversationCheckList,
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'list',
...@@ -143,12 +187,12 @@ export default { ...@@ -143,12 +187,12 @@ export default {
{ {
label: '一级分类', label: '一级分类',
prop: 'firstClassify', prop: 'firstClassify',
width: '120px' width: '100px'
}, },
{ {
label: '二级分类', label: '二级分类',
prop: 'secondClassify', prop: 'secondClassify',
width: '140px' width: '100px'
}, },
{ {
label: '质检得分', label: '质检得分',
...@@ -165,12 +209,14 @@ export default { ...@@ -165,12 +209,14 @@ export default {
{ {
label: '命中文本', label: '命中文本',
prop: 'hitText', prop: 'hitText',
addHtml: 'hitText' addHtml: 'hitText',
minWidth: '120px'
}, },
{ {
label: '话术建议', label: '话术建议',
prop: 'suggestions', prop: 'suggestions',
addHtml: 'suggestions' addHtml: 'suggestions',
minWidth: '120px'
} }
] ]
}, },
...@@ -182,47 +228,35 @@ export default { ...@@ -182,47 +228,35 @@ export default {
} }
}, },
watch: { watch: {
'searchForm.hitResult'() { 'searchForm.hitResult' () {
this.$refs.analyseTable.refreshTable(true, true) this.getList()
} }
}, },
mounted() { mounted () {
this.$refs.analyseTable.tableHeightValues = '100%'
// this.getPointCategory() // this.getPointCategory()
this.getList()
}, },
methods: { methods: {
formatSrt(str) { async getList () {
return str.replace(/\n/g, '<br/>') await this.beforeSearchFn()
const { list } = await this.$apis.quality.conversationCheckList(this.searchFormSearch)
let titleList = Array.from(new Set([...list.map(e => e.firstClassify)])),
arr = []
titleList.map(i => {
list.map(e => {
e.suggestions = this.formatSrt(e.suggestions)
e.hitText = this.formatSrt(e.hitText)
if (i == e.firstClassify) arr.push(e)
})
})
this.analyseList = arr
this.merge(arr)
}, },
toMinutesAndSeconds(seconds) { formatSrt (str) {
seconds = Math.floor(seconds / 1000) return str?.replace(/\n/g, '<br/>') || ''
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else if (seconds > 3600) {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
return formattedTime
} else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
}, },
// toMinutesAndSeconds(time) { getPointCategory () {
// time = time / 1000
// const h = Math.floor(time / 3600)
// const m = parseInt((time % 3600) / 60)
// return {
// h,
// m
// }
// },
getPointCategory() {
this.classifyMap = new Map() this.classifyMap = new Map()
this.$apis.quality.getPointCategory().then(res => { this.$apis.quality.getPointCategory().then(res => {
// console.log(res) // console.log(res)
...@@ -232,11 +266,11 @@ export default { ...@@ -232,11 +266,11 @@ export default {
} }
}) })
}, },
changeClassify() { changeClassify () {
this.searchForm.secondClassify = '' this.searchForm.secondClassify = ''
this.baseData.secondClassifyList = this.classifyMap.get(this.searchForm.firstClassify) this.baseData.secondClassifyList = this.classifyMap.get(this.searchForm.firstClassify)
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.batchId = this.detailObj.id this.searchFormSearch.batchId = this.detailObj.id
...@@ -250,10 +284,10 @@ export default { ...@@ -250,10 +284,10 @@ export default {
resolve() resolve()
}) })
}, },
handleSearch() { handleSearch () {
this.$refs.analyseTable.refreshTable(true, true) this.getList()
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = {
// firstClassify: '', // firstClassify: '',
// secondClassify: '', // secondClassify: '',
...@@ -261,48 +295,75 @@ export default { ...@@ -261,48 +295,75 @@ export default {
hitResult: '' hitResult: ''
} }
this.baseData.secondClassifyList = [] this.baseData.secondClassifyList = []
this.$refs.analyseTable.refreshTable() this.handleSearch()
},
// 初始化合并行数组
mergeInit () {
this.spanArr1 = [] //
this.spanIndex1 = 0 //
},
// 合并表格
merge (data) {
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
// 第一行必须存在,以第一行为基准
this.spanArr1.push(1)
this.spanIndex1 = 0
} else {
if (data[i].firstClassify == data[i - 1].firstClassify) {
this.spanArr1[this.spanIndex1] += 1
this.spanArr1.push(0)
} else {
this.spanArr1.push(1)
this.spanIndex1 = i
} }
} }
}
}
},
// 合并单元格
arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
const len = this.analyseList.length
if (columnIndex === 1) {
// 第一列
const _row_1 = this.spanArr1[rowIndex]
const _col_1 = _row_1 > 0 ? 1 : 0
return {
rowspan: _row_1,
colspan: _col_1
}
}
else if (rowIndex === len) {
return {
rowspan: 1,
colspan: 1
}
}
},
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.analyse { .analyse {
.statistics { background-color: #fff;
display: flex; padding: 20px;
align-items: center; height: 100%;
justify-content: space-between;
margin-bottom: 20px;
.s-item {
flex: 1;
// min-width: 248px;
background: #f7f9fa;
border-radius: 4px;
padding: 12px 20px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 16px; /deep/.gl-search{
.title { height: auto !important;
font-size: 14px;
color: #333333;
margin-bottom: 8px;
}
.content {
color: #333333;
line-height: 32px;
}
.greenStr {
color: #2cca74;
}
.redStr {
color: #eb4e4e;
} }
.grayStr { /deep/.el-form-item {
color: #999999; width: 280px !important;
.name {
width: 80px;
text-align: left;
} }
} }
} .glsx-table {
.show-search { height: calc(100% - 97px);
margin-bottom: -68px;
} }
.theader { .theader {
width: 100%; width: 100%;
...@@ -335,15 +396,14 @@ export default { ...@@ -335,15 +396,14 @@ export default {
background: #fdeded; background: #fdeded;
} }
} }
</style>
<style> /deep/.two-line {
.redStr { display: -webkit-box;
color: #eb4e4e; -webkit-box-orient: vertical;
} word-break: break-all;
.greenStr { overflow: hidden;
color: #2cca74; text-overflow: ellipsis;
} -webkit-line-clamp: 2;
.grayStr { -webkit-box-orient: vertical;
color: #999999;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 关联活动订单弹窗 --> <!-- 关联活动订单弹窗 -->
<template> <template>
<GLDialog big-title="质检详情" mode="big" :visible.sync="isQualityVisible" class="qualityDailog" width="80%" :close-on-click-modal="false" @onOk="handleClose" @onCancel="handleClose" @close="handleClose" > <div class="quality-box">
<div> <template v-if="qualityDetailList.length">
<el-tabs v-model="activeName" @tab-click="handleReset"> <div class="overview">
<el-tab-pane label="质检分析" name="analyse"> <template v-for="(i,index) in overviewObject">
<quality-analyse v-if="activeName == 'analyse'" v-bind="$attrs" ref="analyseList" /> <div
</el-tab-pane> :key="index"
<el-tab-pane label="对话详情" name="dialogue"> class="overview-item"
<dialogue-detail v-if="activeName == 'dialogue'" ref="dialogueDetail" v-bind="$attrs" /> >
</el-tab-pane> <div class="label">{{i.label}}</div>
</el-tabs> <div class="value">
</div> <template v-if="i.formatter">
</GLDialog> <div v-html="i.formatter(qualityDetailList[currentNum])">
</div>
</template>
<template v-else>
{{qualityDetailList[currentNum][i.key] || '-'}}
</template>
</div>
</div>
</template>
</div>
<div class="content" :key="currentNum">
<div class="dialogue-box">
<dialogue-detail :detailObj="qualityDetailList[currentNum]" />
</div>
<div class="analyse-box">
<quality-analyse :detailObj="qualityDetailList[currentNum]" />
</div>
</div>
</template>
<div class="footer-box">
<el-button
size="small"
:class="{opacity:currentNum == 0}"
@click="jump(-1)"
>上一条</el-button>
<div class="text">{{currentNum + 1}}/{{qualityDetailList.length}}</div>
<el-button
type="primary"
size="small"
:class="{opacity:currentNum == qualityDetailList.length - 1}"
@click="jump(1)"
>下一条</el-button>
</div>
</div>
</template> </template>
<script> <script>
import QualityAnalyse from './qualityAnalyse' import QualityAnalyse from './qualityAnalyse'
import DialogueDetail from './dialogueDetail' import DialogueDetail from './dialogueDetail'
const toMinutesAndSeconds = (seconds) => {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) {
return seconds + '<span class="unit">秒</span>'
} else if (seconds > 3600) {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '<span class="unit">小时</span>'
if (minutes > 0 || hours > 0) formattedTime += minutes + '<span class="unit">分钟</span>'
return formattedTime
} else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '<span class="unit">小时</span>'
if (minutes > 0 || hours > 0) formattedTime += minutes + '<span class="unit">分钟</span>'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '<span class="unit">秒</span>'
return formattedTime
}
}
export default { export default {
name: 'RelatActivityOrderDialog', name: '',
components: { components: {
QualityAnalyse, QualityAnalyse,
DialogueDetail DialogueDetail
}, },
data() { data () {
return { return {
activeName: 'analyse', overviewObject: [
{
label: '客户姓名',
key: 'customerName',
},
{
label: '车型',
key: 'carModel',
},
{
label: 'APP接待结果',
formatter (row) {
const val = {
1: '成交',
0: '战败'
}[row.receptionStatus],
color = {
1: '#2CCA74',
0: '#EB4E4E'
}[row.receptionStatus]
return `<span style="font-size:22px;color:${color}">${val || '-'}</span>`
} }
}, },
{
props: { label: '预计营销结果',
isQualityVisible: { formatter (row) {
type: Boolean, const color = {
default: false '成交': '#2CCA74',
'战败': '#EB4E4E'
}[row.estimatedResult] || '#999999'
return `<span style="font-size:22px;color:${color}">${row.estimatedResult}</span>`
}
},
{
label: '话术评分',
formatter (row) {
return `<div class="num">${row.score}<span class="unit">分</span></div>`
}
},
{
label: '接待时长',
formatter (row) {
return `<div class="num">${toMinutesAndSeconds(row.duration)}</div>`
}
}
],
activeName: 'analyse',
currentNum: 0,
qualityDetailList: []
} }
}, },
computed: {},
mounted() {
mounted () {
const quality_detail_object = JSON.parse(localStorage.getItem('quality_detail_object') || {})
this.currentNum = quality_detail_object.currentNum || 0
this.qualityDetailList = quality_detail_object.list || []
}, },
methods: { methods: {
handleReset() {}, jump (num) {
handleClose() { try {
this.$emit('closeDialog', false) const { qualityDetailList, currentNum } = this,
max = qualityDetailList.length - 1
if ((currentNum == 0 && num == -1) || (currentNum == max && num == 1)) throw '无更多接待记录'
this.currentNum += num
} catch (error) {
if(error) this.$message.error(error)
}
} }
} }
} }
</script> </script>
<style scoped> <style scoped lang='scss'>
.el-tabs{ .quality-box {
margin-top:-10px; .overview {
display: flex;
align-items: center;
background: #ffffff;
padding: 20px;
justify-content: space-between;
&-item {
width: calc((100% - 40px) / 6);
background: #f7f9fa;
border-radius: 4px;
box-sizing: border-box;
height: 92px;
padding: 16px;
font-size: 14px;
color: #333333;
.label {
line-height: 20px;
}
.value {
font-weight: 600;
font-size: 20px;
color: #333333;
margin-top: 8px;
line-height: 32px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/deep/.num {
font-weight: 700;
font-size: 26px;
.unit {
font-weight: 400;
font-size: 14px;
color: #333333;
}
}
}
}
} }
.content {
display: flex;
margin-top: 16px;
height: calc(100vh - 276px);
overflow: hidden;
.dialogue-box {
width: 40%;
}
.analyse-box {
width: calc(60% - 16px);
margin-left: auto;
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 64px;
font-size: 14px;
color: #666666;
display: flex;
align-items: center;
justify-content: center;
.text {
margin: 0 16px;
}
.opacity{
opacity: .5;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -5,21 +5,20 @@ ...@@ -5,21 +5,20 @@
<div class="info-wrap"> <div class="info-wrap">
<div class="info-item flex"> <div class="info-item flex">
<label>员工:</label> <label>员工:</label>
<span>{{ queryData.employeeName }}</span> <span>{{ queryData.employeeName }} {{queryData.phoneNumber || ''}}</span>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>门店:</label> <label>门店:</label>
<template v-if="queryData.storeList"> <span>{{queryData.merchantName || '-'}}</span>
<el-tooltip effect="dark" :content="queryData.storeList.join('、')" placement="top-start">
<span>{{ queryData.storeList.join('、') }}</span>
</el-tooltip>
</template>
<span v-else>-</span>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>服务商:</label> <label>服务商:</label>
<template v-if="queryData.serviceList"> <template v-if="queryData.serviceList">
<el-tooltip effect="dark" :content="queryData.serviceList.join('、')" placement="top-start"> <el-tooltip
effect="dark"
:content="queryData.serviceList.join('、')"
placement="top-start"
>
<span>{{ queryData.serviceList.join('、') }}</span> <span>{{ queryData.serviceList.join('、') }}</span>
</el-tooltip> </el-tooltip>
</template> </template>
...@@ -36,44 +35,82 @@ ...@@ -36,44 +35,82 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<GLCombiForm ref="showSearch" class="show-search" labelWidth="110px" :formObj="searchForm" :form-data="showFormData" @handleOk="handleSearch" @handleRest="handleReset"> <h2>接待列表</h2>
<div class="content-box">
<GLCombiForm
ref="showSearch"
class="show-search"
labelWidth="110px"
:formObj="searchForm"
:form-data="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<template slot="score"> <template slot="score">
<el-input-range start-placeholder="请输入" end-placeholder="请输入" :displayValue="searchForm.qualityTestScore"></el-input-range> <el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:displayValue="searchForm.qualityTestScore"
></el-input-range>
</template> </template>
</GLCombiForm> </GLCombiForm>
<GLTable ref="recepDetail" :get-list-api="getListApi" :hasNum="false" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" :pageConf="pageConf"> <GLTable
<div slot="durationHtml" slot-scope="scope"> ref="recepDetail"
:get-list-api="getListApi"
:hasNum="false"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:pageConf="pageConf"
>
<div
slot="durationHtml"
slot-scope="scope"
>
<template v-if="scope.scope.duration"> <template v-if="scope.scope.duration">
{{ toMinutesAndSeconds(scope.scope.duration) }} {{ toMinutesAndSeconds(scope.scope.duration) }}
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<div slot="scoreHtml" slot-scope="scope"> <div
slot="scoreHtml"
slot-scope="scope"
>
<template v-if="scope.scope.score || scope.scope.score === 0"> <template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }} {{ scope.scope.score }}
</template> </template>
<template v-else>--</template> <template v-else>--</template>
</div> </div>
<div slot="estimatedResult" slot-scope="scope" :class="['tag', scope.scope.estimatedResult == '成交' ? (scope.scope.estimatedResult == '战败' ? 'redBg' : 'greenBg') : 'grayBg']"> <div
slot="estimatedResult"
slot-scope="scope"
:class="['tag', scope.scope.estimatedResult == '成交' ? (scope.scope.estimatedResult == '战败' ? 'redBg' : 'greenBg') : 'grayBg']"
>
{{ scope.scope.estimatedResult }} {{ scope.scope.estimatedResult }}
</div> </div>
<template slot="auth-button" slot-scope="scope"> <template
<el-button type="text" @click="qualitDetail(scope.scope)">质检详情</el-button> slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
@click="qualitDetail(scope.scope)"
>质检详情</el-button>
</template> </template>
</GLTable> </GLTable>
</div> </div>
<quality-detail :isQualityVisible="isQualityVisible" v-if="isQualityVisible" :detailObj="detailObj" @closeDialog="closeDialog"></quality-detail> </div>
</div> </div>
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import ElInputRange from './el-input-range' import ElInputRange from './el-input-range'
import QualityDetail from './qualityDetail.vue' let viewStorage = null
export default { export default {
data() { data () {
return { return {
queryData: JSON.parse(this.$route.query.data), queryData: {},
isQualityVisible: false,
searchForm: { searchForm: {
recepTime: [], recepTime: [],
qualityTestScore: [], qualityTestScore: [],
...@@ -116,17 +153,21 @@ export default { ...@@ -116,17 +153,21 @@ export default {
prop: 'key' prop: 'key'
}, },
{ {
label: '开始接待时间', label: "客户姓名",
prop: 'startTime' prop: "customerName"
}, },
{ {
label: '结束接待时间', label: "车型",
prop: 'endTime' prop: "carModel"
}, },
{ {
label: '录音时长', label: "APP接待结果",
prop: 'duration', formatter (row) {
addHtml: 'durationHtml' return row.receptionStatus != null ? {
1: '成交',
0: '战败'
}[row.receptionStatus] : '--'
}
}, },
{ {
label: '预计营销结果', label: '预计营销结果',
...@@ -137,7 +178,22 @@ export default { ...@@ -137,7 +178,22 @@ export default {
label: '话术质检评分/分', label: '话术质检评分/分',
prop: 'score', prop: 'score',
addHtml: 'scoreHtml' addHtml: 'scoreHtml'
} },
{
label: '接待时长',
prop: 'duration',
addHtml: 'durationHtml'
},
{
label: '开始接待时间',
prop: 'startTime'
},
{
label: '结束接待时间',
prop: 'endTime'
},
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
...@@ -160,14 +216,24 @@ export default { ...@@ -160,14 +216,24 @@ export default {
} }
}, },
components: { components: {
ElInputRange, ElInputRange
QualityDetail
}, },
mounted() { mounted () {
this.setQuery()
this.getOptionsList() this.getOptionsList()
}, },
methods: { methods: {
toMinutesAndSeconds(seconds) { setQuery () {
const query = this.$route?.query?.data ? JSON.parse(this.$route.query.data) : ''
if (viewStorage) this.queryData = viewStorage
if (query) {
this.queryData = query
viewStorage = query
}
let [url] = window.location.href.split('?')
window.history.replaceState('', '', `${url}?data=${encodeURIComponent(JSON.stringify(viewStorage))}`)
},
toMinutesAndSeconds (seconds) {
seconds = Math.floor(seconds / 1000) seconds = Math.floor(seconds / 1000)
let formattedTime = '' let formattedTime = ''
if (seconds < 60) { if (seconds < 60) {
...@@ -188,10 +254,10 @@ export default { ...@@ -188,10 +254,10 @@ export default {
return formattedTime return formattedTime
} }
}, },
handleSearch() { handleSearch () {
this.$refs.recepDetail.refreshTable(true, true) this.$refs.recepDetail.refreshTable(true, true)
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = {
recepTime: [], recepTime: [],
qualityTestScore: [], qualityTestScore: [],
...@@ -199,20 +265,24 @@ export default { ...@@ -199,20 +265,24 @@ export default {
} }
this.$refs.recepDetail.refreshTable() this.$refs.recepDetail.refreshTable()
}, },
closeDialog() { qualitDetail (row) {
console.log(this.isQualityVisible) const list = this.$refs.recepDetail.data,
this.isQualityVisible = false currentNum = list.findIndex(e => e.id == row.id)
}, localStorage.setItem('quality_detail_object', JSON.stringify({
qualitDetail(row) { list,
console.log(row) currentNum
this.detailObj = row }))
this.isQualityVisible = true this.$router.push({
path: '/qualityManage/qualityDetail'
})
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.setQuery()
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.conversationDateId = this.queryData.id this.searchFormSearch.conversationDateId = this.queryData.id
this.searchFormSearch.pageNum = this.searchFormSearch.currentPage this.searchFormSearch.pageNum = this.searchFormSearch.currentPage
this.searchFormSearch.merchantNo = this.queryData.merchantNo
if (this.searchFormSearch.qualityTestScore) { if (this.searchFormSearch.qualityTestScore) {
this.searchFormSearch.qualityTestScoreBegin = this.searchFormSearch.qualityTestScore[0] this.searchFormSearch.qualityTestScoreBegin = this.searchFormSearch.qualityTestScore[0]
this.searchFormSearch.qualityTestScoreEnd = this.searchFormSearch.qualityTestScore[1] this.searchFormSearch.qualityTestScoreEnd = this.searchFormSearch.qualityTestScore[1]
...@@ -233,12 +303,12 @@ export default { ...@@ -233,12 +303,12 @@ export default {
resolve() resolve()
}) })
}, },
setTableFinishFun(data) { setTableFinishFun (data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
data[i].key = i + 1 data[i].key = i + 1
} }
}, },
getOptionsList() { getOptionsList () {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
...@@ -257,11 +327,6 @@ export default { ...@@ -257,11 +327,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.recep-wrap { .recep-wrap {
margin: 0 16px; margin: 0 16px;
.header {
width: 100%;
background: #ffffff;
h2 { h2 {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
...@@ -274,6 +339,10 @@ export default { ...@@ -274,6 +339,10 @@ export default {
box-sizing: border-box; box-sizing: border-box;
} }
.header {
width: 100%;
background: #ffffff;
.info-wrap { .info-wrap {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -309,16 +378,18 @@ export default { ...@@ -309,16 +378,18 @@ export default {
} }
} }
} }
.show-search{ .show-search {
margin-bottom:-52px; margin-bottom: -52px;
} }
.content { .content {
background: #ffffff; background: #ffffff;
padding: 20px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 16px; margin-top: 16px;
width: 100%; width: 100%;
height: auto; height: auto;
&-box {
padding: 20px;
}
} }
.tag { .tag {
padding: 0 8px; padding: 0 8px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!