Commit d32d8ca5 authored by 彭松's avatar 彭松

报表

parent e0d545e7
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_PRP_RUL
// http://8.136.255.30/eas/customer/list
// 查询客户管理列表
export function getCustomer(params) {
return http.post(`${baseURL}/eas/customer/list`, params);
}
// http://112.19.80.237:11007/basics_api/base/window/list
// 窗口列表
export function windowList(params) {
return http.post(`${baseURL}/basics_api/base/window/list`, params);
}
...@@ -2,77 +2,43 @@ ...@@ -2,77 +2,43 @@
<div class="reportForm-Container"> <div class="reportForm-Container">
<div class="header_box"> <div class="header_box">
<div> <div>
<a-button type="success" @click="exportTable"> <a-button type="success" @click="handleExportTable">
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span> <span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button> </a-button>
</div> </div>
<span> <span>
<a-checkbox-group <a-checkbox-group :options="checkboxOptions" v-model="checkboxVALUE" @change="checkboxonChange" />
:options="checkboxOptions" <a-input allowClear v-model="Query.workman_name" placeholder="请输入工作人员姓名查询 ">
v-model="checkboxVALUE"
@change="checkboxonChange"
/>
<a-input
allowClear
v-model="Query.workman_name"
placeholder="请输入工作人员姓名查询 "
>
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
<a-select default-value="001" placeholder="请选择窗口"> <a-select v-model="Query.window_id" placeholder="请选择窗口">
<!-- <a-select-option <a-select-option value=""> 全部 </a-select-option>
v-for="(item, index) of selectOptions" <a-select-option v-for="(item, index) of windowData" :key="index" :value="item.id">
:key="index" {{ item.englishName }} - {{item.fromnum}}
:value="item.value" </a-select-option>
>
{{ item.label }}
</a-select-option> -->
<a-select-option value="001"> 窗口001 </a-select-option>
<a-select-option value="002"> 窗口002 </a-select-option>
</a-select> </a-select>
<a-select v-model="Query.warn_alert" placeholder="请选择类型"> <a-select v-model="Query.warn_alert" placeholder="请选择类型">
<a-select-option value=""> 全部 </a-select-option> <a-select-option value=""> 全部 </a-select-option>
<a-select-option <a-select-option v-for="(item,i) in warn_alert" :key="i" :value="i">
v-for="(item,i) in warn_alert"
:key="i"
:value="i"
>
{{ item }} {{ item }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-range-picker <a-range-picker format="YYYY年MM月DD日" valueFormat="yyyy-MM-DD" class="range_picker_style"
format="YYYY年MM月DD日" v-model="Query.time">
class="range_picker_style"
@change="rangePickerChange"
v-model="Query.time"
>
</a-range-picker> </a-range-picker>
<a-button type="primary">搜索</a-button> <a-button type="primary" @click="onGetKqalert">搜索</a-button>
</span> </span>
</div> </div>
<div class="main"> <div class="main">
<a-table <a-table size="small" bordered :row-key="(record) => record.id" :row-selection="{
size="small"
bordered
:row-key="(record) => record.id"
:row-selection="{
selectedRowKeys: tableSelectedKeys, selectedRowKeys: tableSelectedKeys,
onChange: onSelectChange, onChange: onSelectChange,
}" }" :scroll="{ y: 590 }" :pagination="tablePagination" @change="changeTablePage" :loading="tableLoading"
:scroll="{ y: 590 }" :columns="tableHeaders" :dataSource="tableSourceData">
:pagination="tablePagination"
@change="pagTableChange"
:loading="tableLoading"
:columns="tableHeaders"
:dataSource="tableSourceData"
>
<template slot="operation" slot-scope="text, record"> <template slot="operation" slot-scope="text, record">
<a-button type="link" @click="openDetails" <a-button type="link" @click="openDetails">查看详情{{ record.id }}</a-button>
>查看详情{{ record.id }}</a-button
>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -80,38 +46,45 @@ ...@@ -80,38 +46,45 @@
</template> </template>
<script> <script>
import table from "@/mixins/table"; import table from "@/mixins/table";
import {getKqalert} from "@/api/dataAdmin" import {
const warn_alert = { export2Excel
1:'离岗', } from "@/utils/js/exportExcel";
2:'离开', import {
4:'玩手机', getKqalert
5:'扶头', } from "@/api/dataAdmin"
6:'趴桌', import {
} windowList
export default { } from "@/api/customer"
import moment from "moment";
const warn_alert = {
1: '离岗',
2: '离开',
4: '玩手机',
5: '扶头',
6: '趴桌',
}
export default {
mixins: [table], mixins: [table],
name: "PortalAdminVueReportForm", name: "PortalAdminVueReportForm",
data() { data() {
return { return {
windowData: [],
warn_alert, warn_alert,
Query:{ Query: {
have_process:"",//只看未处理 0 have_process: "", //只看未处理 0
warn_alert:"",//1离岗,2离开 4:玩手机 5:扶头 6:趴桌 warn_alert: "", //1离岗,2离开 4:玩手机 5:扶头 6:趴桌
window_id:"",//窗口ID window_id: "", //窗口ID
workman_name:"",//工作人员姓名 workman_name: "", //工作人员姓名
time:[],//时间段 time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")], // 时间区间
},//查询条件 }, //查询条件
checkboxVALUE: [], checkboxVALUE: [],
BegindAndEndTime: [], BegindAndEndTime: [],
checkboxOptions: [ checkboxOptions: [{
{
label: "只看未处理", label: "只看未处理",
value: "0", value: "0",
}, }, ],
], tableHeaders: [{
tableHeaders: [
{
title: "序号", title: "序号",
dataIndex: "index", dataIndex: "index",
width: "60px", width: "60px",
...@@ -122,47 +95,47 @@ export default { ...@@ -122,47 +95,47 @@ export default {
{ {
title: "报警类型", title: "报警类型",
dataIndex: "warn_alert", dataIndex: "warn_alert",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => warn_alert[text]
}, },
{ {
title: "发生窗口", title: "发生窗口",
dataIndex: "window_name", dataIndex: "window_name",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "工作人员", title: "工作人员",
dataIndex: "workman_name", dataIndex: "workman_name",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "所属部门", title: "所属部门",
dataIndex: "section_name", dataIndex: "section_name",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "手机号", title: "手机号",
dataIndex: "workman_phone", dataIndex: "workman_phone",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "发生时间", title: "发生时间",
dataIndex: "out_time", dataIndex: "out_time",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "时长", title: "时长",
dataIndex: "duration", dataIndex: "duration",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "是否准确", title: "是否准确",
dataIndex: "isaccuracy", dataIndex: "isaccuracy",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text == 1 ? '准确' : '--'
}, },
{ {
title: "是否处理", title: "是否处理",
dataIndex: "have_process_name", dataIndex: "have_process_name",
customRender:(text, record)=>text?text:'--' customRender: (text, record) => text ? text : '--'
}, },
{ {
title: "操作", title: "操作",
...@@ -181,29 +154,85 @@ export default { ...@@ -181,29 +154,85 @@ export default {
mounted() { mounted() {
this.onGetKqalert() this.onGetKqalert()
this.setMoment(); this.setMoment();
this.getWindowList();
}, },
methods: { methods: {
// 导出
async handleExportTable() {
if (this.tableSelectedKeys.length && this.tableSelectedRows.length) {
export2Excel(
this.tHeader,
this.filterVal,
this.tableSelectedRows,
"AI效能监察异常行为数据报表" + this.$moment().format("YYYYMMDDHHmmss")
);
} else {
getKqalert({
...this.Query,
page: 1,
size: -1,
}).then(res => {
const {
code,
data
} = res;
if (code == 1) {
if (!data.data.length) return;
export2Excel(
this.tHeader,
this.filterVal,
data.data,
"AI效能监察异常行为数据报表" + this.$moment().format("YYYYMMDDHHmmss")
);
}
})
}
},
// 报表接口 // 报表接口
onGetKqalert(){ onGetKqalert() {
getKqalert(this.Query).then(res=>{ getKqalert({
const {code,data} = res ...this.Query,
if(code == 1){ page: this.tablePagination.current,
size: this.tablePagination.pageSize,
}).then(res => {
const {
code,
data
} = res
if (code == 1) {
this.tableSourceData = data.data this.tableSourceData = data.data
this.tablePagination.total = data.total this.tablePagination.total = data.total
} }
console.log(res) console.log(res)
}) })
}, },
getWindowList() {
windowList({
page: 1,
size: -1,
siteId: JSON.parse(localStorage.getItem("siteId"))
}).then(res => {
const {
code,
data
} = res
if (code == 1) {
this.windowData = data.data
}
})
},
openDetails() { openDetails() {
console.log("跳转网页"); console.log("跳转网页");
}, },
rangePickerChange(val) { //分页
console.log(val); changeTablePage(page) {
this.pagTableChange(page);
this.onGetKqalert();
}, },
checkboxonChange(val) { checkboxonChange(val) {
if(val.length == 0){ if (val.length == 0) {
this.Query.have_process = "" this.Query.have_process = ""
}else{ } else {
this.Query.have_process = "0" this.Query.have_process = "0"
} }
}, },
...@@ -219,16 +248,19 @@ export default { ...@@ -219,16 +248,19 @@ export default {
} }
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.ant-spin-container { /deep/.ant-spin-container {
display: block; display: block;
} }
/deep/.ant-checkbox-group{
width: 220px;
}
</style>
/deep/.ant-checkbox-group {
width: 220px;
}
.range_picker_style {
margin-right: 20px;
}
</style>
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<a-select-option value="001"> 等级001 </a-select-option> <a-select-option value="001"> 等级001 </a-select-option>
<a-select-option value="002"> 等级002 </a-select-option> <a-select-option value="002"> 等级002 </a-select-option>
</a-select> </a-select>
<a-button type="primary" >搜索</a-button> <a-button type="primary">搜索</a-button>
</span> </span>
</div> </div>
<div class="main"> <div class="main">
...@@ -51,16 +51,18 @@ ...@@ -51,16 +51,18 @@
</template> </template>
<script> <script>
import table from "@/mixins/table"; import table from "@/mixins/table";
import UserDetails from "./components/UserDetails.vue"; import UserDetails from "./components/UserDetails.vue";
import PicWorks from "./components/PicWorks.vue"; import PicWorks from "./components/PicWorks.vue";
export default { import {
getCustomer
} from "@/api/customer";
export default {
mixins: [table], mixins: [table],
name: "PortalAdminVuePoliticsShow", name: "PortalAdminVuePoliticsShow",
data() { data() {
return { return {
tableHeaders: [ tableHeaders: [{
{
title: "序号", title: "序号",
dataIndex: "index", dataIndex: "index",
width: "60px", width: "60px",
...@@ -138,7 +140,28 @@ export default { ...@@ -138,7 +140,28 @@ export default {
}); });
} }
}, },
created() {
this.getList();
},
methods: { methods: {
// 获取列表数据
async getList(search = {}) {
let res = await getCustomer({
page: this.tablePagination.current,
size: this.tablePagination.pageSize,
...this.searchForm,
...search,
});
if (res.code == 1) {
let {
data,
total
} = res.data;
this.tableList = data;
this.tablePagination.total = total;
return data;
}
},
QueueState(type) { QueueState(type) {
switch (type) { switch (type) {
case 0: case 0:
...@@ -160,14 +183,11 @@ export default { ...@@ -160,14 +183,11 @@ export default {
this.$refs.UserDetails.modalInfo.visible = true; this.$refs.UserDetails.modalInfo.visible = true;
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.ant-spin-container { /deep/.ant-spin-container {
display: block; display: block;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment