Commit 703132b6 by 王志慧

攻防话术

1 parent 0ce9b24b
...@@ -3508,27 +3508,6 @@ ...@@ -3508,27 +3508,6 @@
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
}, },
"dependencies": { "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": { "acorn-walk": {
"version": "8.2.0", "version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz", "resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
...@@ -3918,6 +3897,27 @@ ...@@ -3918,6 +3897,27 @@
"lodash": "^4.17.4" "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": { "@vue/vue2-jest": {
"version": "27.0.0", "version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
...@@ -17080,7 +17080,7 @@ ...@@ -17080,7 +17080,7 @@
}, },
"vue-hot-reload-api": { "vue-hot-reload-api": {
"version": "2.3.4", "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==", "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true "dev": true
}, },
......
...@@ -102,3 +102,9 @@ export function exportReclistList(data) { ...@@ -102,3 +102,9 @@ export function exportReclistList(data) {
data.method = "dj.api.mindworkplate.badge.employeeBadgeReclistExport" data.method = "dj.api.mindworkplate.badge.employeeBadgeReclistExport"
return request(data, "post") 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 \ No newline at end of file
<template> <template>
<div class="analyse" v-loading="loading"> <div class="analyse" v-loading="loading">
<el-tabs v-model="activeName" >
<el-tab-pane label="质检明细" name="first"></el-tab-pane>
<el-tab-pane label="攻防明细" name="second"></el-tab-pane>
</el-tabs>
<template v-if="activeName === 'first'">
<d2-search <d2-search
ref="showSearch" ref="showSearch"
:search-form="searchForm" :search-form="searchForm"
...@@ -92,7 +97,11 @@ ...@@ -92,7 +97,11 @@
<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>
<el-tooltip v-if="scope.scope.hitText" effect="light" placement="top"> <el-tooltip
v-if="scope.scope.hitText"
effect="light"
placement="top"
>
<div slot="content" v-html="scope.scope.hitText"></div> <div slot="content" v-html="scope.scope.hitText"></div>
<div class="two-line" v-html="scope.scope.hitText"></div> <div class="two-line" v-html="scope.scope.hitText"></div>
...@@ -106,6 +115,10 @@ ...@@ -106,6 +115,10 @@
</div> </div>
</template> </template>
</d2-table> </d2-table>
</template>
<template v-else>
<attack-detail :detailObj="detailObj" />
</template>
</div> </div>
</template> </template>
<script> <script>
...@@ -113,9 +126,11 @@ import ElInputRange from "../el-input-range" ...@@ -113,9 +126,11 @@ import ElInputRange from "../el-input-range"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import { conversationCheckList, getPointCategory } from "@api/resident" import { conversationCheckList, getPointCategory } from "@api/resident"
import noDataImg from "@/assets/empty-2.png" import noDataImg from "@/assets/empty-2.png"
import AttackDetail from "./attackDetail"
export default { export default {
components: { components: {
ElInputRange ElInputRange,
AttackDetail
}, },
props: { props: {
detailObj: { detailObj: {
...@@ -125,6 +140,7 @@ export default { ...@@ -125,6 +140,7 @@ export default {
}, },
data() { data() {
return { return {
activeName: "first",
noDataImg, noDataImg,
analyseList: [], analyseList: [],
spanArr1: [], spanArr1: [],
...@@ -239,7 +255,7 @@ export default { ...@@ -239,7 +255,7 @@ export default {
} }
}, },
formatSrt(str) { formatSrt(str) {
return str?.replace(/\n/g, "<br/>") || '' return str?.replace(/\n/g, "<br/>") || ""
}, },
getPointCategory() { getPointCategory() {
this.classifyMap = new Map() this.classifyMap = new Map()
......
...@@ -13,29 +13,24 @@ ...@@ -13,29 +13,24 @@
<div class="quality-box"> <div class="quality-box">
<template v-if="qualityDetailList.length"> <template v-if="qualityDetailList.length">
<div class="overview"> <div class="overview">
<template v-for="(i,index) in overviewObject"> <template v-for="(i, index) in overviewObject">
<div <div :key="index" class="overview-item">
:key="index" <div class="label">{{ i.label }}</div>
class="overview-item"
>
<div class="label">{{i.label}}</div>
<div class="value"> <div class="value">
<template v-if="i.formatter"> <template v-if="i.formatter">
<div v-html="i.formatter(qualityDetailList[currentNum])"> <div
</div> v-html="i.formatter(qualityDetailList[currentNum])"
></div>
</template> </template>
<template v-else> <template v-else>
{{qualityDetailList[currentNum][i.key] || '-'}} {{ qualityDetailList[currentNum][i.key] || "-" }}
</template> </template>
</div> </div>
</div> </div>
</template> </template>
</div> </div>
<div <div class="content" :key="currentNum">
class="content"
:key="currentNum"
>
<div class="dialogue-box"> <div class="dialogue-box">
<dialogue-detail :detailObj="qualityDetailList[currentNum]" /> <dialogue-detail :detailObj="qualityDetailList[currentNum]" />
</div> </div>
...@@ -47,16 +42,20 @@ ...@@ -47,16 +42,20 @@
<div class="footer-box"> <div class="footer-box">
<el-button <el-button
size="small" size="small"
:class="{opacity:currentNum == 0}" :class="{ opacity: currentNum == 0 }"
@click="jump(-1)" @click="jump(-1)"
>上一条</el-button> >上一条</el-button
<div class="text">{{currentNum + 1}}/{{qualityDetailList.length}}</div> >
<div class="text">
{{ currentNum + 1 }}/{{ qualityDetailList.length }}
</div>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
:class="{opacity:currentNum == qualityDetailList.length - 1}" :class="{ opacity: currentNum == qualityDetailList.length - 1 }"
@click="jump(1)" @click="jump(1)"
>下一条</el-button> >下一条</el-button
>
</div> </div>
</div> </div>
</d2-dialog> </d2-dialog>
...@@ -69,22 +68,25 @@ import QualityAnalyse from "./qualityAnalyse" ...@@ -69,22 +68,25 @@ import QualityAnalyse from "./qualityAnalyse"
import DialogueDetail from "./dialogueDetail" import DialogueDetail from "./dialogueDetail"
const toMinutesAndSeconds = (seconds) => { const toMinutesAndSeconds = (seconds) => {
seconds = Math.floor(seconds / 1000) seconds = Math.floor(seconds / 1000)
let formattedTime = '' let formattedTime = ""
if (seconds < 60) { if (seconds < 60) {
return seconds + '<span class="unit">秒</span>' return seconds + '<span class="unit">秒</span>'
} else if (seconds > 3600) { } else if (seconds > 3600) {
let hours = Math.floor(seconds / 3600), let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60) minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '<span class="unit">小时</span>' 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 return formattedTime
} else { } else {
let hours = Math.floor(seconds / 3600), let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60), minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60 remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '<span class="unit">小时</span>' 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)
if (remainingSeconds > 0) formattedTime += remainingSeconds + '<span class="unit">秒</span>' formattedTime += minutes + '<span class="unit">分钟</span>'
if (remainingSeconds > 0)
formattedTime += remainingSeconds + '<span class="unit">秒</span>'
return formattedTime return formattedTime
} }
} }
...@@ -94,57 +96,68 @@ export default { ...@@ -94,57 +96,68 @@ export default {
QualityAnalyse, QualityAnalyse,
DialogueDetail DialogueDetail
}, },
data () { data() {
return { return {
overviewObject: [ overviewObject: [
{ {
label: '客户姓名', label: "客户姓名",
key: 'customerName', key: "customerName"
}, },
{ {
label: '车型', label: "车型",
key: 'carModel', key: "carModel"
}, },
{ {
label: 'APP接待结果', label: "APP接待结果",
formatter (row) { formatter(row) {
const val = { const val = {
1: '成交', 1: "成交",
0: '战败' 0: "战败"
}[row.receptionStatus], }[row.receptionStatus],
color = { color = {
1: '#2CCA74', 1: "#2CCA74",
0: '#EB4E4E' 0: "#EB4E4E"
}[row.receptionStatus] }[row.receptionStatus]
return `<span style="font-size:22px;color:${color}">${val || '-'}</span>` return `<span style="font-size:22px;color:${color}">${
val || "-"
}</span>`
} }
}, },
{ {
label: '预计营销结果', label: "预计营销结果",
formatter (row) { formatter(row) {
const color = { const color =
'成交': '#2CCA74', {
'战败': '#EB4E4E' 成交: "#2CCA74",
}[row.estimatedResult] || '#999999' 战败: "#EB4E4E"
return `<span style="font-size:22px;color:${color}">${row.estimatedResult || '分析中'}</span>` }[row.estimatedResult] || "#999999"
return `<span style="font-size:22px;color:${color}">${
row.estimatedResult || "分析中"
}</span>`
} }
}, },
{ {
label: '话术评分', label: "质检得分",
formatter (row) { formatter(row) {
return row.score != null return row.score != null
? `<div class="num">${row.score}<span class="unit">分</span></div>` ? `<div class="num">${row.score}<span class="unit">分</span></div>`
: `<span style="font-size:22px;color:#999">分析中</span>` : `<span style="font-size:22px;color:#999">分析中</span>`
} }
}, },
{ {
label: '接待时长', label: "攻防得分",
formatter (row) { formatter(row) {
return `<div class="num">${row.duration ? toMinutesAndSeconds(row.duration) : '-'}</div>` 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 { ...@@ -164,18 +177,18 @@ export default {
}, },
computed: {}, computed: {},
mounted () { mounted() {},
},
methods: { methods: {
handleClose () { handleClose() {
this.$emit("closeDialog", false) this.$emit("closeDialog", false)
}, },
jump (num) { jump(num) {
try { try {
const { qualityDetailList, currentNum } = this, const { qualityDetailList, currentNum } = this,
max = qualityDetailList.length - 1 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 this.currentNum += num
} catch (error) { } catch (error) {
if (error) this.$message.error(error) if (error) this.$message.error(error)
......
...@@ -315,11 +315,11 @@ export default { ...@@ -315,11 +315,11 @@ export default {
width: "180px", width: "180px",
prop: "serviceMerchantNo" prop: "serviceMerchantNo"
}, },
{ // {
label: "工牌编号", // label: "工牌编号",
prop: "badgeId", // prop: "badgeId",
width: "140px" // width: "140px"
}, // },
{ {
label: "接待时长", label: "接待时长",
prop: "seconds", prop: "seconds",
......
...@@ -6,11 +6,14 @@ ...@@ -6,11 +6,14 @@
<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 || '-' }} {{queryData.phoneNumber || ''}}</span> <span
>{{ queryData.employeeName || "-" }}
{{ queryData.phoneNumber || "" }}</span
>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>门店:</label> <label>门店:</label>
<span>{{queryData.merchantName}}</span> <span>{{ queryData.merchantName }}</span>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>服务商:</label> <label>服务商:</label>
...@@ -25,7 +28,7 @@ ...@@ -25,7 +28,7 @@
</template> </template>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>质检日期:</label> <label>接待日期:</label>
<span>{{ queryData.searchdate }}</span> <span>{{ queryData.searchdate }}</span>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
...@@ -64,17 +67,10 @@ ...@@ -64,17 +67,10 @@
</template> </template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button @click="handleSearch" size="small" type="primary">
@click="handleSearch"
size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
<el-button <el-button size="small" @click="handleReset"> 重置 </el-button>
size="small"
@click="handleReset"
> 重置 </el-button>
</div> </div>
<div class="content-table"> <div class="content-table">
<d2-table <d2-table
...@@ -86,19 +82,13 @@ ...@@ -86,19 +82,13 @@
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun" @setTableFinishFun="setTableFinishFun"
> >
<div <div slot="durationHtml" slot-scope="scope">
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 <div slot="scoreHtml" slot-scope="scope">
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>
...@@ -107,18 +97,37 @@ ...@@ -107,18 +97,37 @@
<div <div
slot="estimatedResult" slot="estimatedResult"
slot-scope="scope" 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 }} {{ scope.scope.estimatedResult }}
</div> </div>
<template <div slot="defencePoint" slot-scope="scope">
slot="auth-button" <template v-if="scope.scope.defence === 0">{{
slot-scope="scope" scope.scope.defencePoint
> }}</template>
<el-button <template v-else-if="scope.scope.defence === 1">分析中</template>
type="text" <template v-else-if="scope.scope.defence === 2"
@click="qualitDetail(scope.scope)" >未发现攻防</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> </el-button>
</template> </template>
...@@ -144,7 +153,7 @@ export default { ...@@ -144,7 +153,7 @@ export default {
props: { props: {
queryData: Object queryData: Object
}, },
data () { data() {
return { return {
isQualityVisible: false, isQualityVisible: false,
searchForm: { searchForm: {
...@@ -158,7 +167,7 @@ export default { ...@@ -158,7 +167,7 @@ export default {
{ {
label: "接待时间", label: "接待时间",
name: "recepTime", name: "recepTime",
addHtml: 'recepTime', addHtml: "recepTime"
// isClear: true, // isClear: true,
// pickerOptions: "rangePickerOptions" // pickerOptions: "rangePickerOptions"
}, },
...@@ -196,27 +205,37 @@ export default { ...@@ -196,27 +205,37 @@ export default {
}, },
{ {
label: "APP接待结果", label: "APP接待结果",
formatter (row) { formatter(row) {
return { return {
1: '成交', 1: "成交",
0: '战败' 0: "战败"
}[row.receptionStatus] }[row.receptionStatus]
} }
}, },
{ {
label: "预计营销结果", label: "预计营销结果",
prop: "estimatedResult", prop: "estimatedResult",
addHtml: 'estimatedResult' addHtml: "estimatedResult"
}, },
{ {
label: "话术质检评分/分", label: "质检得分/分",
prop: "score", prop: "score",
addHtml: 'scoreHtml' addHtml: "scoreHtml"
},
{
label: "攻防得分/分",
prop: "defencePoint",
addHtml: "defencePoint"
},
{
label: "客户类型识别",
prop: "customerTypeName,",
addHtml: "customerTypeName,"
}, },
{ {
label: "接待时长", label: "接待时长",
prop: "duration", prop: "duration",
addHtml: 'durationHtml' addHtml: "durationHtml"
}, },
{ {
label: "开始接待时间", label: "开始接待时间",
...@@ -225,7 +244,7 @@ export default { ...@@ -225,7 +244,7 @@ export default {
{ {
label: "结束接待时间", label: "结束接待时间",
prop: "endTime" prop: "endTime"
}, }
] ]
}, },
baseData: { baseData: {
...@@ -253,7 +272,7 @@ export default { ...@@ -253,7 +272,7 @@ export default {
ElInputRange, ElInputRange,
QualityDetail QualityDetail
}, },
mounted () { mounted() {
this.getOptionsList() this.getOptionsList()
let timer = setInterval(() => { let timer = setInterval(() => {
if (timer && this.batchNum != null) { if (timer && this.batchNum != null) {
...@@ -265,31 +284,31 @@ export default { ...@@ -265,31 +284,31 @@ export default {
}, 1e3) }, 1e3)
}, },
methods: { methods: {
toMinutesAndSeconds (seconds) { toMinutesAndSeconds(seconds) {
seconds = Math.floor(seconds / 1000) seconds = Math.floor(seconds / 1000)
let formattedTime = '' let formattedTime = ""
if (seconds < 60) { if (seconds < 60) {
return seconds + '秒' return seconds + "秒"
} else if (seconds > 3600) { } else if (seconds > 3600) {
let hours = Math.floor(seconds / 3600), let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60) minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '小时' if (hours > 0) formattedTime += hours + "小时"
if (minutes > 0 || hours > 0) formattedTime += minutes + '分' if (minutes > 0 || hours > 0) formattedTime += minutes + "分"
return formattedTime return formattedTime
} else { } else {
let hours = Math.floor(seconds / 3600), let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60), minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60 remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时' if (hours > 0) formattedTime += hours + "小时"
if (minutes > 0 || hours > 0) formattedTime += minutes + '分' if (minutes > 0 || hours > 0) formattedTime += minutes + "分"
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒' if (remainingSeconds > 0) formattedTime += remainingSeconds + "秒"
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: [],
...@@ -297,20 +316,24 @@ export default { ...@@ -297,20 +316,24 @@ export default {
} }
this.$refs.recepDetail.refreshTable() this.$refs.recepDetail.refreshTable()
}, },
closeDialog () { closeDialog() {
this.isQualityVisible = false this.isQualityVisible = false
}, },
qualitDetail (row) { qualitDetail(row) {
const list = this.$refs.recepDetail.data, 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.currentNum = currentNum
this.qualityDetailList = list this.qualityDetailList = list
this.isQualityVisible = true this.isQualityVisible = true
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
const { queryData } = this 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 = deepClone(this.searchForm)
this.searchFormSearch.conversationDateId = queryData.id this.searchFormSearch.conversationDateId = queryData.id
this.searchFormSearch.pageNum = this.searchFormSearch.currentPage this.searchFormSearch.pageNum = this.searchFormSearch.currentPage
...@@ -322,8 +345,14 @@ export default { ...@@ -322,8 +345,14 @@ export default {
this.searchFormSearch.qualityTestScore[1] this.searchFormSearch.qualityTestScore[1]
} }
if (this.searchFormSearch.recepTime.length > 0) { if (this.searchFormSearch.recepTime.length > 0) {
this.searchFormSearch.startTime = Util.dateFormate(this.searchFormSearch.recepTime[0], 'YYYY-MM-DD HH:mm:ss') this.searchFormSearch.startTime = Util.dateFormate(
this.searchFormSearch.endTime = Util.dateFormate(this.searchFormSearch.recepTime[1], 'YYYY-MM-DD HH:mm:ss') 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) { if (this.searchFormSearch.estimatedResultId) {
...@@ -340,12 +369,12 @@ export default { ...@@ -340,12 +369,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 ( if (
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!