Commit 703132b6 by 王志慧

攻防话术

1 parent 0ce9b24b
......@@ -3508,27 +3508,6 @@
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
......@@ -3918,6 +3897,27 @@
"lodash": "^4.17.4"
}
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/vue2-jest": {
"version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......@@ -17080,7 +17080,7 @@
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
......
......@@ -102,3 +102,9 @@ export function exportReclistList(data) {
data.method = "dj.api.mindworkplate.badge.employeeBadgeReclistExport"
return request(data, "post")
}
/** 攻防明细*/
export function defenceDetail(data) {
data.method = "dj.api.smartcarlife.inspection.defence.detail"
return request(data, "post")
}
<template>
<div v-loading="loading" class="container">
<div class="attack-detail" v-if="defenceDetail">
<div class="statistics-box">
<div
class="statistics-item"
v-for="(item, index) in statisticsObj"
:key="index"
>
<div class="text">{{ item.text }}</div>
<div class="value">{{ item.value(defenceDetail) }}</div>
</div>
</div>
<div class="dialog-box">
<div
class="dialog-item"
v-for="(item, index) in defenceDetail.detailList"
:key="item.is"
>
<div class="dialog-head">
<img
class="attack-score"
src="../../../assets/attack-score.png"
alt=""
/>
<div class="text">攻防得分</div>
<div class="score">{{ item.defScore? item.defScore:'-'}}</div>
<div class="text">对话开始时间</div>
<div class="time">{{ item.conStartTime?item.conStartTime:'-' }}</div>
<div class="attack-index">攻防回合{{ index + 1 }}</div>
<img
class="index-logo"
src="../../../assets/index-logo.png"
alt=""
/>
</div>
<div class="dialog">
<div
:class="{
'dialog-detail': true
}"
:key="item.id"
>
<div class="name">
<img class="role" src="@/assets/role-one.png" />
客户
</div>
<div class="dig-content" @click="currentDialog(item)">
{{ item.question }}
</div>
</div>
<div class="dialog-detail nth-child" :key="item.id">
<div class="name">
销售
<img class="role two" src="@/assets/role-two.png" />
</div>
<div class="dig-content" @click="currentDialog(item)">
{{ item.answer }}
</div>
<div class="suggest">
<div class="improve">
<img src="@/assets/improve.png" class="improve-img" />
改进建议
</div>
<div
class="improve-text"
v-html="
regText(item.highlight, item.suggestionsForImprovement)
"
></div>
<div class="line"></div>
<div class="improve">
<img src="@/assets/polish.png" class="improve-img" />
润色表达
</div>
<div class="improve-text" v-html="regText(item.highlight, item.refineTheExpression)">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<template v-else>
<div class="empty-box">
<div class="icon">
<img src="@/assets/empty-2.png" />
</div>
<div class="text">
{{ detailObj.defence === 1 ? "数据分析中,请稍等" : "未发现攻防" }}
</div>
</div>
</template>
</div>
</template>
<script>
import { defenceDetail } from "@api/resident"
export default {
props: {
detailObj: {
type: Object,
default: {}
}
},
data() {
return {
statisticsObj: [
{
text: "攻防次数",
value: (data) => {
return data.defenceCount + "次"
}
},
{
text: "攻防平均得分",
value: (data) => {
return data.avgDefence + "分"
}
},
{
text: "客户类型",
value: (data) => {
return data.customerType ? data.customerType : "未知"
}
}
],
defenceDetail: "",
loading: true,
isFlag: false
}
},
created() {
this.getDefenceDetail()
},
methods: {
getDefenceDetail() {
let params = {
batchId: this.detailObj.id
}
defenceDetail(params).then((res) => {
console.log(res, "9999")
this.defenceDetail = res
this.loading = false
})
},
regText(highlight, value) {
highlight=highlight&&JSON.parse(highlight)
let replacedText =value
if (value) {
highlight.forEach((item) => {
replacedText = replacedText.replace(item, function (match) {
return '<span style="color: #FE9220;">' + match + "</span>"
})
})
}
return replacedText
}
}
}
</script>
<style scoped lang="scss">
.container {
height: 100%;
}
.attack-detail {
height: calc(100% - 55px);
overflow: hidden;
.statistics-box {
display: flex;
align-items: center;
margin-bottom: 12px;
.statistics-item {
max-width: 216px;
flex: 1;
padding: 12px 16px;
background: #f7f9fa;
color: #333333;
height: 20px;
display: flex;
justify-content: space-between;
align-items: center;
margin-right: 8px;
.value {
font-weight: 600;
}
}
}
.dialog-box {
height: calc(100% - 68px);
overflow-y: scroll;
.dialog-item {
width: 100%;
background: #f7f9fa;
margin-bottom: 12px;
.dialog-head {
padding: 12px 16px;
height: 24px;
position: relative;
line-height: 24px;
display: flex;
align-items: center;
border-bottom: 1px solid #e5e5e5;
.attack-score {
width: 24px;
height: 24px;
margin-right: 8px;
}
.text {
font-weight: 400;
font-size: 14px;
color: #666666;
}
.score {
font-weight: 500;
font-size: 15px;
color: #fe9220;
margin: 0 24px 0 6px;
}
.time {
font-weight: 400;
font-size: 14px;
color: #5850ff;
margin-left: 6px;
}
.index-logo {
width: 86px;
height: 32px;
position: absolute;
right: 0;
}
.attack-index {
font-weight: 400;
font-size: 14px;
color: #ffffff;
position: absolute;
right: 12px;
z-index: 999;
}
}
.dialog {
width: 100%;
height: 100%;
background: #f7f9fa;
border-radius: 4px;
overflow-y: scroll;
padding: 12px 8px 12px 16px;
box-sizing: border-box;
.dialog-detail {
margin-bottom: 8px;
text-align: left;
.name {
font-size: 12px;
color: #666666;
letter-spacing: 0;
line-height: 16px;
.role {
width: 32px;
height: 32px;
vertical-align: top;
margin-right: 10px;
}
.two {
margin-right: 0;
}
}
.dig-content {
width: fit-content;
max-width: 70%;
background: #e4ecf7;
border-radius: 4px;
font-size: 14px;
color: #333333;
padding: 10px 12px;
white-space: pre-wrap;
text-align: left;
margin: -14px 0 0 40px;
line-height: 20px;
}
.suggest {
width: fit-content;
max-width: 70%;
background: #fff;
border-radius: 4px;
font-size: 14px;
color: #333333;
padding: 10px 12px;
white-space: pre-wrap;
text-align: left;
line-height: 20px;
margin-top: 12px;
margin-right: 40px;
display: inline-block;
.improve {
width: 94px;
height: 28px;
background: #f2f7fc;
border-radius: 4px;
padding: 4px 8px;
display: flex;
align-items: center;
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 6px;
box-sizing: border-box;
white-space: nowrap;
.improve-img {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
.improve-text {
margin: 0 8px;
}
.line {
width: 100%;
height: 1px;
margin: 12px 8px;
background-color: #ebedff;
}
}
}
.nth-child {
text-align: right;
.dig-content {
display: inline-block;
background: #ffffff;
margin-right: 38px;
line-height: 22px;
}
}
}
}
}
}
.empty-box {
display: flex;
flex-direction: column;
font-size: 12px;
color: #999999;
padding-top: 184px;
text-align: center;
width: 100%;
height: 100%;
box-sizing: border-box;
border-radius: 0 4px 4px 4px;
.icon {
width: 270px;
height: 120px;
margin: 0 auto 8px;
img {
width: 100%;
height: 100%;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="analyse" v-loading="loading">
<d2-search
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
>
<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-tabs v-model="activeName" >
<el-tab-pane label="质检明细" name="first"></el-tab-pane>
<el-tab-pane label="攻防明细" name="second"></el-tab-pane>
</el-tabs>
<template v-if="activeName === 'first'">
<d2-search
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
>
<div slot="firstClassify">
<el-select
v-model="searchForm.firstClassify"
clearable
placeholder="请选择"
@change="changeClassify"
>
</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
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>
</el-select>
</div>
<template slot="score">
<el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:display-value="searchForm.qualityTestScore"
></el-input-range>
</template>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</d2-search>
<div class="theader">
<div class="title">话术列表</div>
<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>
<d2-table
ref="analyseTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:hasPage="false"
:has-num="false"
:table-data="analyseList"
:array-span-method="arraySpanMethod"
noDataText="数据分析中,请稍等…"
:noDataImg="noDataImg"
height="100%"
>
<div slot="scoreHtml" slot-scope="scope">
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
<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="请输入"
:display-value="searchForm.qualityTestScore"
></el-input-range>
</template>
<template v-else>--</template>
</div>
<template slot="suggestions" slot-scope="scope">
<el-tooltip
v-if="scope.scope.suggestions"
effect="light"
placement="top"
>
<div slot="content" v-html="scope.scope.suggestions"></div>
<div class="two-line" v-html="scope.scope.suggestions"></div>
</el-tooltip>
<div v-else>--</div>
</template>
<template slot="hitText" slot-scope="scope">
<div v-if="!scope.scope.score">--</div>
<template v-else>
<el-tooltip v-if="scope.scope.hitText" effect="light" placement="top">
<div slot="content" v-html="scope.scope.hitText"></div>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</d2-search>
<div class="two-line" v-html="scope.scope.hitText"></div>
<div class="theader">
<div class="title">话术列表</div>
<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>
<d2-table
ref="analyseTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:hasPage="false"
:has-num="false"
:table-data="analyseList"
:array-span-method="arraySpanMethod"
noDataText="数据分析中,请稍等…"
:noDataImg="noDataImg"
height="100%"
>
<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">
<el-tooltip
v-if="scope.scope.suggestions"
effect="light"
placement="top"
>
<div slot="content" v-html="scope.scope.suggestions"></div>
<div class="two-line" v-html="scope.scope.suggestions"></div>
</el-tooltip>
<div v-else>--</div>
</template>
</template>
<template slot="hitResult" slot-scope="scope">
<div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']">
{{ scope.scope.hitResult == 1 ? "是" : "否" }}
</div>
</template>
</d2-table>
<template slot="hitText" slot-scope="scope">
<div v-if="!scope.scope.score">--</div>
<template v-else>
<el-tooltip
v-if="scope.scope.hitText"
effect="light"
placement="top"
>
<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">
<div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']">
{{ scope.scope.hitResult == 1 ? "是" : "否" }}
</div>
</template>
</d2-table>
</template>
<template v-else>
<attack-detail :detailObj="detailObj" />
</template>
</div>
</template>
<script>
......@@ -113,9 +126,11 @@ import ElInputRange from "../el-input-range"
import { Util, deepClone } from "@/common/util"
import { conversationCheckList, getPointCategory } from "@api/resident"
import noDataImg from "@/assets/empty-2.png"
import AttackDetail from "./attackDetail"
export default {
components: {
ElInputRange
ElInputRange,
AttackDetail
},
props: {
detailObj: {
......@@ -125,6 +140,7 @@ export default {
},
data() {
return {
activeName: "first",
noDataImg,
analyseList: [],
spanArr1: [],
......@@ -239,7 +255,7 @@ export default {
}
},
formatSrt(str) {
return str?.replace(/\n/g, "<br/>") || ''
return str?.replace(/\n/g, "<br/>") || ""
},
getPointCategory() {
this.classifyMap = new Map()
......
......@@ -13,29 +13,24 @@
<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>
<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>
<div
v-html="i.formatter(qualityDetailList[currentNum])"
></div>
</template>
<template v-else>
{{qualityDetailList[currentNum][i.key] || '-'}}
{{ qualityDetailList[currentNum][i.key] || "-" }}
</template>
</div>
</div>
</template>
</div>
<div
class="content"
:key="currentNum"
>
<div class="content" :key="currentNum">
<div class="dialogue-box">
<dialogue-detail :detailObj="qualityDetailList[currentNum]" />
</div>
......@@ -47,16 +42,20 @@
<div class="footer-box">
<el-button
size="small"
:class="{opacity:currentNum == 0}"
:class="{ opacity: currentNum == 0 }"
@click="jump(-1)"
>上一条</el-button>
<div class="text">{{currentNum + 1}}/{{qualityDetailList.length}}</div>
>上一条</el-button
>
<div class="text">
{{ currentNum + 1 }}/{{ qualityDetailList.length }}
</div>
<el-button
type="primary"
size="small"
:class="{opacity:currentNum == qualityDetailList.length - 1}"
:class="{ opacity: currentNum == qualityDetailList.length - 1 }"
@click="jump(1)"
>下一条</el-button>
>下一条</el-button
>
</div>
</div>
</d2-dialog>
......@@ -69,22 +68,25 @@ import QualityAnalyse from "./qualityAnalyse"
import DialogueDetail from "./dialogueDetail"
const toMinutesAndSeconds = (seconds) => {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
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>'
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>'
if (minutes > 0 || hours > 0)
formattedTime += minutes + '<span class="unit">分钟</span>'
if (remainingSeconds > 0)
formattedTime += remainingSeconds + '<span class="unit">秒</span>'
return formattedTime
}
}
......@@ -94,57 +96,68 @@ export default {
QualityAnalyse,
DialogueDetail
},
data () {
data() {
return {
overviewObject: [
{
label: '客户姓名',
key: 'customerName',
label: "客户姓名",
key: "customerName"
},
{
label: '车型',
key: 'carModel',
label: "车型",
key: "carModel"
},
{
label: 'APP接待结果',
formatter (row) {
label: "APP接待结果",
formatter(row) {
const val = {
1: '成交',
0: '战败'
}[row.receptionStatus],
1: "成交",
0: "战败"
}[row.receptionStatus],
color = {
1: '#2CCA74',
0: '#EB4E4E'
1: "#2CCA74",
0: "#EB4E4E"
}[row.receptionStatus]
return `<span style="font-size:22px;color:${color}">${val || '-'}</span>`
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) {
const color =
{
成交: "#2CCA74",
战败: "#EB4E4E"
}[row.estimatedResult] || "#999999"
return `<span style="font-size:22px;color:${color}">${
row.estimatedResult || "分析中"
}</span>`
}
},
{
label: '话术评分',
formatter (row) {
return row.score != null
? `<div class="num">${row.score}<span class="unit">分</span></div>`
: `<span style="font-size:22px;color:#999">分析中</span>`
label: "质检得分",
formatter(row) {
return row.score != null
? `<div class="num">${row.score}<span class="unit">分</span></div>`
: `<span style="font-size:22px;color:#999">分析中</span>`
}
},
{
label: '接待时长',
formatter (row) {
return `<div class="num">${row.duration ? toMinutesAndSeconds(row.duration) : '-'}</div>`
label: "攻防得分",
formatter(row) {
return row.defence === 0
? `<div class="num">${row.defencePoint}<span class="unit">分</span></div>`
: row.defence === 1
? `<span style="font-size:22px;color:#999">分析中</span>`
: row.defence === 2
? `<span style="font-size:22px;color:#999">未发现攻防</span>`
: `<span style="font-size:22px;color:#999">-</span>`
}
}
],
activeName: 'analyse',
activeName: "analyse"
}
},
......@@ -164,18 +177,18 @@ export default {
},
computed: {},
mounted () {
},
mounted() {},
methods: {
handleClose () {
handleClose() {
this.$emit("closeDialog", false)
},
jump (num) {
jump(num) {
try {
const { qualityDetailList, currentNum } = this,
max = qualityDetailList.length - 1
if ((currentNum == 0 && num == -1) || (currentNum == max && num == 1)) throw '无更多接待记录'
if ((currentNum == 0 && num == -1) || (currentNum == max && num == 1))
throw "无更多接待记录"
this.currentNum += num
} catch (error) {
if (error) this.$message.error(error)
......
......@@ -315,11 +315,11 @@ export default {
width: "180px",
prop: "serviceMerchantNo"
},
{
label: "工牌编号",
prop: "badgeId",
width: "140px"
},
// {
// label: "工牌编号",
// prop: "badgeId",
// width: "140px"
// },
{
label: "接待时长",
prop: "seconds",
......
......@@ -6,11 +6,14 @@
<div class="info-wrap">
<div class="info-item flex">
<label>员工:</label>
<span>{{ queryData.employeeName || '-' }} {{queryData.phoneNumber || ''}}</span>
<span
>{{ queryData.employeeName || "-" }}
{{ queryData.phoneNumber || "" }}</span
>
</div>
<div class="info-item flex">
<label>门店:</label>
<span>{{queryData.merchantName}}</span>
<span>{{ queryData.merchantName }}</span>
</div>
<div class="info-item flex">
<label>服务商:</label>
......@@ -25,7 +28,7 @@
</template>
</div>
<div class="info-item flex">
<label>质检日期:</label>
<label>接待日期:</label>
<span>{{ queryData.searchdate }}</span>
</div>
<div class="info-item flex">
......@@ -64,17 +67,10 @@
</template>
</d2-search>
<div class="up-btns">
<el-button
@click="handleSearch"
size="small"
type="primary"
>
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
> 重置 </el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
<div class="content-table">
<d2-table
......@@ -86,19 +82,13 @@
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="durationHtml"
slot-scope="scope"
>
<div slot="durationHtml" slot-scope="scope">
<template v-if="scope.scope.duration">
{{ toMinutesAndSeconds(scope.scope.duration) }}
</template>
<template v-else>--</template>
</div>
<div
slot="scoreHtml"
slot-scope="scope"
>
<div slot="scoreHtml" slot-scope="scope">
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
</template>
......@@ -107,18 +97,37 @@
<div
slot="estimatedResult"
slot-scope="scope"
:class="['tag', scope.scope.estimatedResult == '成交' ? (scope.scope.estimatedResult == '战败' ? 'redBg' : 'greenBg') : 'grayBg']"
: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)"
<div slot="defencePoint" slot-scope="scope">
<template v-if="scope.scope.defence === 0">{{
scope.scope.defencePoint
}}</template>
<template v-else-if="scope.scope.defence === 1">分析中</template>
<template v-else-if="scope.scope.defence === 2"
>未发现攻防</template
>
<template v-else>-</template>
</div>
<div slot="customerTypeName" slot-scope="scope">
<template v-if="scope.scope.defence === 0">{{
scope.scope.customerTypeName
}}</template>
<template v-else-if="scope.scope.defence === 1">分析中</template>
<template v-else-if="scope.scope.defence === 2">未知</template>
<template v-else>-</template>
</div>
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="qualitDetail(scope.scope)">
接待详情
</el-button>
</template>
......@@ -144,7 +153,7 @@ export default {
props: {
queryData: Object
},
data () {
data() {
return {
isQualityVisible: false,
searchForm: {
......@@ -158,7 +167,7 @@ export default {
{
label: "接待时间",
name: "recepTime",
addHtml: 'recepTime',
addHtml: "recepTime"
// isClear: true,
// pickerOptions: "rangePickerOptions"
},
......@@ -196,27 +205,37 @@ export default {
},
{
label: "APP接待结果",
formatter (row) {
formatter(row) {
return {
1: '成交',
0: '战败'
1: "成交",
0: "战败"
}[row.receptionStatus]
}
},
{
label: "预计营销结果",
prop: "estimatedResult",
addHtml: 'estimatedResult'
addHtml: "estimatedResult"
},
{
label: "话术质检评分/分",
label: "质检得分/分",
prop: "score",
addHtml: 'scoreHtml'
addHtml: "scoreHtml"
},
{
label: "攻防得分/分",
prop: "defencePoint",
addHtml: "defencePoint"
},
{
label: "客户类型识别",
prop: "customerTypeName,",
addHtml: "customerTypeName,"
},
{
label: "接待时长",
prop: "duration",
addHtml: 'durationHtml'
addHtml: "durationHtml"
},
{
label: "开始接待时间",
......@@ -225,7 +244,7 @@ export default {
{
label: "结束接待时间",
prop: "endTime"
},
}
]
},
baseData: {
......@@ -253,7 +272,7 @@ export default {
ElInputRange,
QualityDetail
},
mounted () {
mounted() {
this.getOptionsList()
let timer = setInterval(() => {
if (timer && this.batchNum != null) {
......@@ -265,31 +284,31 @@ export default {
}, 1e3)
},
methods: {
toMinutesAndSeconds (seconds) {
toMinutesAndSeconds(seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
let formattedTime = ""
if (seconds < 60) {
return seconds + '秒'
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 + '分'
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 + '秒'
if (hours > 0) formattedTime += hours + "小时"
if (minutes > 0 || hours > 0) formattedTime += minutes + "分"
if (remainingSeconds > 0) formattedTime += remainingSeconds + "秒"
return formattedTime
}
},
handleSearch () {
handleSearch() {
this.$refs.recepDetail.refreshTable(true, true)
},
handleReset () {
handleReset() {
this.searchForm = {
recepTime: [],
qualityTestScore: [],
......@@ -297,20 +316,24 @@ export default {
}
this.$refs.recepDetail.refreshTable()
},
closeDialog () {
closeDialog() {
this.isQualityVisible = false
},
qualitDetail (row) {
qualitDetail(row) {
const list = this.$refs.recepDetail.data,
currentNum = list.findIndex(e => e.id == row.id)
currentNum = list.findIndex((e) => e.id == row.id)
this.currentNum = currentNum
this.qualityDetailList = list
this.isQualityVisible = true
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise((resolve) => {
const { queryData } = this
if (!this.searchForm.recepTime.length) this.searchForm.recepTime = [new Date(`${queryData.searchdate} 00:00:00`), new Date(`${queryData.searchdate} 23:59:59`)]
if (!this.searchForm.recepTime.length)
this.searchForm.recepTime = [
new Date(`${queryData.searchdate} 00:00:00`),
new Date(`${queryData.searchdate} 23:59:59`)
]
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.conversationDateId = queryData.id
this.searchFormSearch.pageNum = this.searchFormSearch.currentPage
......@@ -322,8 +345,14 @@ export default {
this.searchFormSearch.qualityTestScore[1]
}
if (this.searchFormSearch.recepTime.length > 0) {
this.searchFormSearch.startTime = Util.dateFormate(this.searchFormSearch.recepTime[0], 'YYYY-MM-DD HH:mm:ss')
this.searchFormSearch.endTime = Util.dateFormate(this.searchFormSearch.recepTime[1], 'YYYY-MM-DD HH:mm:ss')
this.searchFormSearch.startTime = Util.dateFormate(
this.searchFormSearch.recepTime[0],
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.endTime = Util.dateFormate(
this.searchFormSearch.recepTime[1],
"YYYY-MM-DD HH:mm:ss"
)
}
if (this.searchFormSearch.estimatedResultId) {
......@@ -340,18 +369,18 @@ 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
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!