Commit b869cb89 by 李伟康

commit 提交

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