Browse Source

提交导出按钮

master
风继续吹 1 year ago
parent
commit
b159c904f1
1 changed files with 235 additions and 206 deletions
  1. +235
    -206
      src/views/Statistics/Insightintothedetails.vue

+ 235
- 206
src/views/Statistics/Insightintothedetails.vue View File

@@ -1,6 +1,5 @@
<template >

<div class="box-center" style="cursor:pointer;">
<div class="box-center" style="cursor: pointer">
<!-- 头 -->
<div class="app-top">
<div class="app-titel" style="margin-top: 15px">
@@ -17,7 +16,7 @@
</div>
</div>
<div>
<el-date-picker
<el-date-picker
v-model="customtime"
@change="confirmtime()"
type="daterange"
@@ -25,248 +24,279 @@
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</div>
<div class="app-titel" style="margin-top: 15px">
<div class="label">客户名称:</div>
<div>
<el-input v-model="fromobj.name" placeholder="客户名称"></el-input>
<el-input v-model="fromobj.name" placeholder="客户名称"></el-input>
</div>
<div class="label">置业顾问:</div>
<div>
<el-input v-model="fromobj.agentName" placeholder="置业顾问"></el-input>
<el-input
v-model="fromobj.agentName"
placeholder="置业顾问"
></el-input>
</div>
</div>

<div class="app-titel" style="margin-top: 15px">
<div class="label">客户意向:</div>
<div >
<el-select v-model="fromobj.keywordIds" multiple filterable placeholder="请选择">
<div>
<el-select
v-model="fromobj.keywordIds"
multiple
filterable
placeholder="请选择"
>
<el-option
v-for="item in options5"
:key="item.keywordsId"
:label="item.isInterval==0?item.name+'-'+item.endName+item.unit:item.name"
:value="item.keywordsId">

:label="
item.isInterval == 0
? item.name + '-' + item.endName + item.unit
: item.name
"
:value="item.keywordsId"
>
</el-option>
</el-select>
</div>
<div style="margin-left: 20px">
<el-button @click="screening()" style="background: #2671e2; color: #ffffff"
<el-button
@click="screening()"
style="background: #2671e2; color: #ffffff"
>筛选</el-button
>
</div>
<div style="margin-left: 20px">
<el-button @click="Screeningofempty()" type="text">清空筛选条件</el-button>
<el-button @click="Screeningofempty()" type="text"
>清空筛选条件</el-button
>
</div>
<div style="margin-left: auto; margin-right:20px;">
<el-button icon="el-icon-download" v-if="fromobj.keywordIds.length==1&&sta_idx_download" @click="downLoad()">导出</el-button>
<div style="margin-left: auto; margin-right: 20px">
<!-- -->
<el-button
icon="el-icon-download"
v-if="fromobj.keywordIds.length == 1 && sta_idx_download"
@click="downLoad()"
>洞察详情导出</el-button
>

<!-- -->
<el-button
icon="el-icon-download"
v-if="permissions['sta_idx_download_detail']"
@click="downLoads()"
>命中详情导出</el-button
>
</div>
</div>
</div>

<!-- 表格 -->
<div class="cen-tab">
<el-table
:data="tableData"
stripe
height="400"
style="width: 100%">
<el-table-column
prop="staTime"
label="接待开始时间"
align="center"
>
</el-table-column>
<el-table-column
prop="agentName"
label="置业顾问"
align="center"
>
</el-table-column>
<el-table-column
prop="name"
label="客户姓名"
align="center">
</el-table-column>
<el-table :data="tableData" stripe height="400" style="width: 100%">
<el-table-column prop="staTime" label="接待开始时间" align="center">
</el-table-column>
<el-table-column prop="agentName" label="置业顾问" align="center">
</el-table-column>
<el-table-column prop="name" label="客户姓名" align="center">
</el-table-column>

<el-table-column
prop="mm"
label="接待时长(分钟)"
align="center"
>
</el-table-column>
<el-table-column
prop="total"
label="画像语义词触达次数"
align="center"
>
</el-table-column>
<el-table-column
prop="fraction"
label="接访得分"
align="center">
</el-table-column>
<!-- scope -->
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<div style="color: #2671E2;" @click="Receivedetailsabout(row)">查看详情</div>
</template>
</el-table-column>
</el-table>
<div style="display: flex;justify-content:flex-end;margin-top: 10px;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 30, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<el-table-column prop="mm" label="接待时长(分钟)" align="center">
</el-table-column>
<el-table-column prop="total" label="画像语义词触达次数" align="center">
</el-table-column>
<el-table-column prop="fraction" label="接访得分" align="center">
</el-table-column>
<!-- scope -->
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<div style="color: #2671e2" @click="Receivedetailsabout(row)">
查看详情
</div>
</template>
</el-table-column>
</el-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 30, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</template>

<script>
import { mapGetters } from "vuex";

import { exportMethodPost } from "@/util/util";

export default {
data() {
return {
TimetoAhoose: 2,
customtime: [],
currentPage4:1,
currentPage4: 1,
value: "",
input: "",
tableData: [],
fromobj: {
starttime: "",
endoftime: "",
name:'',
agentName:'',
projectId:'',
type:0,
keywords:'',
keywordIds:[]
name: "",
agentName: "",
projectId: "",
type: 0,
keywords: "",
keywordIds: [],
},
pageNum:1,
pageSize:30,
options5:[],
total:0,

pageNum: 1,
pageSize: 30,
options5: [],
total: 0,
};
},
mounted() {
// 权限
this.sta_idx_download = this.permissions["sta_idx_download"];
var isnull=this.$route.query.flag;
if (isnull.TimetoAhoose) this.TimetoAhoose=isnull.TimetoAhoose;
if (isnull.customtime) this.customtime=isnull.customtime;
this.fromobj.starttime=isnull.starttime;
this.fromobj.endoftime=isnull.endoftime;
this.fromobj.projectId=isnull.houseId;
this.fromobj.keywords=isnull.keywordsId;
if (!isnull.TimetoAhoose && isnull.starttime && isnull.endoftime) {
this.TimetoAhoose = 6
}
this.Accesstolevel()
// 权限
this.sta_idx_download = this.permissions["sta_idx_download"];
var isnull = this.$route.query.flag;
if (isnull.TimetoAhoose) this.TimetoAhoose = isnull.TimetoAhoose;
if (isnull.customtime) this.customtime = isnull.customtime;
this.fromobj.starttime = isnull.starttime;
this.fromobj.endoftime = isnull.endoftime;
this.fromobj.projectId = isnull.houseId;
this.fromobj.keywords = isnull.keywordsId;
if (!isnull.TimetoAhoose && isnull.starttime && isnull.endoftime) {
this.TimetoAhoose = 6;
}
this.Accesstolevel();
},
computed: {
...mapGetters(["permissions"]),
},
methods: {
// 跳转接待详情
Receivedetailsabout(row){
this.$api.http.findByCusIdcusId({cusId:row.id}).then((res) => {
if(res.data.length==0){

// 导出
downLoads() {
exportMethodPost("autoSR/matchKeywords/receptionRecordExport", "画像详情", this.fromobj);
},

// 跳转接待详情
Receivedetailsabout(row) {
this.$api.http.findByCusIdcusId({ cusId: row.id }).then((res) => {
if (res.data.length == 0) {
this.$message({
message: '无录音',
type: 'warning'
message: "无录音",
type: "warning",
});
} else {
this.$router.push({
path: "/Receive/index",
query: { flag: row.id, AudioIdx: 0 },
});
}else{
this.$router.push({
path: "/Receive/index",
query: { flag: row.id ,AudioIdx:0},
});
}
})
});
},
//获取三级
Accesstolevel(){
this.options5=[];
var datatype='';
if(this.TimetoAhoose==6){
datatype=''
}else {
datatype=this.TimetoAhoose
}
this.$api.http.findKeywords({
type:this.fromobj.type,
dateType:datatype,
statDateStart:this.fromobj.starttime,
statDateEnd:this.fromobj.endoftime,
projectId:this.fromobj.projectId
}).then((res) => {
if(res.code==0){
this.options5=res.data;
this.receptionRecord()
}
Accesstolevel() {
this.options5 = [];
var datatype = "";
if (this.TimetoAhoose == 6) {
datatype = "";
} else {
datatype = this.TimetoAhoose;
}
this.$api.http
.findKeywords({
type: this.fromobj.type,
dateType: datatype,
statDateStart: this.fromobj.starttime,
statDateEnd: this.fromobj.endoftime,
projectId: this.fromobj.projectId,
})
.then((res) => {
if (res.code == 0) {
this.options5 = res.data;
this.receptionRecord();
}
});
},
receptionRecord(){
var dateType='';
if(this.TimetoAhoose==6){
dateType='';
}else {
dateType=this.TimetoAhoose;
}
this.$api.http.receptionRecord({
dateType:dateType,
staDate:this.fromobj.starttime,
endDate:this.fromobj.endoftime,
projectId:this.fromobj.projectId,
name:this.fromobj.name,
agentName:this.fromobj.agentName,
type:this.fromobj.type,
time:1,
keywordIds:this.fromobj.keywordIds.length>0?this.fromobj.keywordIds.join(','):this.fromobj.keywords,
current:this.pageNum,
size:this.pageSize,
}).then((res) => {
if(res.code==0){
this.tableData=res.data.records;
this.total=res.data.total
}
receptionRecord() {
var dateType = "";
if (this.TimetoAhoose == 6) {
dateType = "";
} else {
dateType = this.TimetoAhoose;
}
this.$api.http
.receptionRecord({
dateType: dateType,
staDate: this.fromobj.starttime,
endDate: this.fromobj.endoftime,
projectId: this.fromobj.projectId,
name: this.fromobj.name,
agentName: this.fromobj.agentName,
type: this.fromobj.type,
time: 1,
keywordIds:
this.fromobj.keywordIds.length > 0
? this.fromobj.keywordIds.join(",")
: this.fromobj.keywords,
current: this.pageNum,
size: this.pageSize,
})
.then((res) => {
if (res.code == 0) {
this.tableData = res.data.records;
this.total = res.data.total;
}
});
},
downLoad(){
var dateType='';
if(this.TimetoAhoose==6){
dateType='';
}else {
dateType=this.TimetoAhoose;
}
this.exportMethodPost('/autoSR/matchKeywords/dcCarReceptionRecord','洞察详情',{
dateType:dateType,
staDate:this.fromobj.starttime,
endDate:this.fromobj.endoftime,
projectId:this.fromobj.projectId,
name:this.fromobj.name,
agentName:this.fromobj.agentName,
type:this.fromobj.type,
time:1,
keywordIds:this.fromobj.keywordIds.length>0?this.fromobj.keywordIds.join(','):this.fromobj.keywords,
})
downLoad() {
var dateType = "";
if (this.TimetoAhoose == 6) {
dateType = "";
} else {
dateType = this.TimetoAhoose;
}
this.exportMethodPosts(
"/autoSR/matchKeywords/dcCarReceptionRecord",
"洞察详情",
{
dateType: dateType,
staDate: this.fromobj.starttime,
endDate: this.fromobj.endoftime,
projectId: this.fromobj.projectId,
name: this.fromobj.name,
agentName: this.fromobj.agentName,
type: this.fromobj.type,
time: 1,
keywordIds:
this.fromobj.keywordIds.length > 0
? this.fromobj.keywordIds.join(",")
: this.fromobj.keywords,
}
);
},
// 导出.Excel公用方法
exportMethodPost(url, name, data = {}) {
// 导出.Excel公用方法
exportMethodPosts(url, name, data = {}) {
axios({
method: "get",
url: url,
params:data,
params: data,
responseType: "blob",
})
.then((res) => {
@@ -297,51 +327,50 @@ export default {
});
},
//筛选
screening(){
this.fromobj.type=1;
this.pageNum=1;
this.receptionRecord()
screening() {
this.fromobj.type = 1;
this.pageNum = 1;
this.receptionRecord();
},
//清空筛选条件
Screeningofempty(){
this.TimetoAhoose=2;
this.fromobj.starttime = "";
this.fromobj.endoftime = "";
this.fromobj.name='';
this.fromobj.agentName='';
this.fromobj.keywords='';
this.fromobj.type=0;
this.fromobj.keywordIds=[];
this.pageNum=1;
this.customtime = [];
this.receptionRecord()
Screeningofempty() {
this.TimetoAhoose = 2;
this.fromobj.starttime = "";
this.fromobj.endoftime = "";
this.fromobj.name = "";
this.fromobj.agentName = "";
this.fromobj.keywords = "";
this.fromobj.type = 0;
this.fromobj.keywordIds = [];
this.pageNum = 1;
this.customtime = [];
this.receptionRecord();
},
//切换时间
//切换时间
tabtimetap(index) {
this.TimetoAhoose = index;
this.fromobj.starttime = "";
this.fromobj.endoftime = "";
this.customtime = [];
this.pageNum=1;
this.receptionRecord()
this.pageNum = 1;
this.receptionRecord();
},
//自定义时间
//自定义时间
confirmtime() {
this.TimetoAhoose = 6;
this.fromobj.starttime = this.customtime[0];
this.fromobj.endoftime = this.customtime[1];
this.pageNum=1;
this.receptionRecord()
this.fromobj.starttime = this.customtime[0];
this.fromobj.endoftime = this.customtime[1];
this.pageNum = 1;
this.receptionRecord();
},
handleSizeChange(val) {
this.pageSize=val;
this.receptionRecord()
this.pageSize = val;
this.receptionRecord();
},
handleCurrentChange(val) {
this.pageNum=val;
this.receptionRecord()
this.pageNum = val;
this.receptionRecord();
},

},
};
</script>
@@ -352,10 +381,10 @@ export default {
padding: 15px 15px 40px;
min-width: 1000px;
}
.cen-tab{
.cen-tab {
width: 100%;
padding: 15px;
background: #FFFFFF;
background: #ffffff;
margin-top: 15px;
}
.tophove {
@@ -398,7 +427,7 @@ export default {
}
}
}
/deep/ .el-button--text{
color: #2671E2;
/deep/ .el-button--text {
color: #2671e2;
}
</style>

Loading…
Cancel
Save