Commit c7f50bd3 by 胡悦

Merge branch 'v1.6.0' into 'develop'

V1.6.0已上线,代码合并

See merge request !6
2 parents ec4bbb04 dd9da669
//常量定义
//车辆用途
export const VEHICLE_USE_LIST = [
{
label: "专属用途",
value: "1",
},
{
label: "非专属用途",
value: "2",
},
]
// 车辆标签
export const VEHICLE_TAG_LIST = [
{
label: "试驶车 ",
value: "1",
},
{
label: "服务车",
value: "3",
},
{
label: "代步车",
value: "4",
},
{
label: "救援车",
value: "5",
},
{
label: "办公车",
value: "6",
},
{
label: "其他",
value: "7",
},
]
// 围栏列表-监控类型
export const FENCE_MONITOR_LIST = [
{ label: '驶入', value: '1' },
{ label: '驶出', value: '2' },
{ label: '驶入驶出', value: '3' },
]
// 围栏列表-状态
export const FENCE_TYPE_LIST = [
{ label: '已开启', value: '1' },
{ label: '已关闭', value: '0' },
]
// 车辆在线状态
export const VEHICLE_ONLINE_STATUS = [
{ label: '行驶中', value: 0 },
{ label: '静止', value: 1 },
{ label: '离线', value: 2 },
{ label: '在线', value: 3 },
]
\ No newline at end of file \ No newline at end of file
import moment from '@/common/moment';
// 警情中心-围栏报警
export const fenceShortcuts = [
{
text: "全部",
onClick(picker) {
picker.$emit("pick", []);
},
}, {
text: "今日",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [end, end]);
}
}, {
text: "昨日",
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
const end = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "近7天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 6)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "近15天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 14)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "近30天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 29)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
}
]
// 警情中心-停驶报警
export const shutDownShortcuts = [
{
text: "全部",
onClick(picker) {
picker.$emit("pick", []);
},
},
{
text: "近3天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 2)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "近7天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 6)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
]
// 里程统计详情
export const mileageDetailShortcuts = [
{
text: "全部",
onClick(picker) {
picker.$emit("pick", []);
},
},
{
text: "昨日",
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
const end = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(0).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
]
\ No newline at end of file \ No newline at end of file
import moment from 'moment';
// 设置moment的语言环境配置
moment.locale('zh-cn', {
week: {
dow: 1,
doy: 4
}
})
export default moment
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,10 @@ export default { ...@@ -14,6 +14,10 @@ export default {
type: [String, Number], type: [String, Number],
default: "", default: "",
}, },
pid: {
type: [String, Number],
default: "",
},
name: { name: {
type: String, type: String,
default: "", default: "",
...@@ -40,11 +44,12 @@ export default { ...@@ -40,11 +44,12 @@ export default {
hasPermission() { hasPermission() {
let id = this.uid; let id = this.uid;
let _name = this.name; let _name = this.name;
let pid = this.pid
let list = this.$root.parentCommon.getAuthData(); let list = this.$root.parentCommon.getAuthData();
if (!list || list.length <= 0) { if (!list || list.length <= 0) {
return false; return false;
} }
let idx = list.findIndex((k) => k.id == id || k.label == _name); let idx = list.findIndex((k) => k.id == id || k.label == _name || k.origin.permissionTag == pid);
if (idx < 0) { if (idx < 0) {
return false; return false;
} else { } else {
......
...@@ -11,6 +11,10 @@ export default { ...@@ -11,6 +11,10 @@ export default {
type: [String, Number], type: [String, Number],
default: "", default: "",
}, },
pid: {
type: [String, Number],
default: "",
},
name: { name: {
type: String, type: String,
default: "", default: "",
...@@ -33,11 +37,14 @@ export default { ...@@ -33,11 +37,14 @@ export default {
hasPermission() { hasPermission() {
let id = this.uid; let id = this.uid;
let _name = this.name; let _name = this.name;
let pid = this.pid;
let list = this.$root.parentCommon.getAuthData(); let list = this.$root.parentCommon.getAuthData();
if (!list || list.length <= 0) { if (!list || list.length <= 0) {
return false; return false;
} }
let idx = list.findIndex((k) => k.id == id || k.label == _name); let idx = list.findIndex(
(k) => k.id == id || k.label == _name || k.origin.permissionTag == pid
);
if (idx < 0) { if (idx < 0) {
return false; return false;
} else { } else {
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
v-show="hasOk" v-show="hasOk"
type="primary" type="primary"
:size="btn_size" :size="btn_size"
:loading="loading"
@click="handleConfirm" @click="handleConfirm"
>{{btnOkLabel}}</el-button> >{{btnOkLabel}}</el-button>
<slot name="btn-behind"></slot> <slot name="btn-behind"></slot>
...@@ -54,6 +55,10 @@ export default { ...@@ -54,6 +55,10 @@ export default {
hasOk: { hasOk: {
type: Boolean, type: Boolean,
default: true default: true
},
loading:{
type:Boolean,
default:false
} }
}, },
methods: { methods: {
......
...@@ -93,9 +93,13 @@ export default { ...@@ -93,9 +93,13 @@ export default {
}, },
// 重置 // 重置
rest() { rest(id, e) {
if (id) {
this[id] = e;
} else {
this.currentPage = 1; this.currentPage = 1;
this.pageSizeNum = 10; this.pageSizeNum = 10;
}
}, },
}, },
}; };
......
<template>
<div class="glsx_table_box">
<el-table class="el_table" :data="tableData" border :size="size" v-loading="loading">
<el-table-column v-for="(item,index) in column" :key="index" :label="item.label" :prop="item.prop" :formatter="item.formatter" :align="item.align" :fixed="item.fixed" :width="item.width" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" v-if="this.$scopedSlots.operate" width="120px">
<template slot-scope="scope">
<slot name="operate" :scope="scope.row"></slot>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :page-size.sync="currentPage" :page-sizes="pageSizes" :current-page.sync="currentPage" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
</template>
<script>
/**
* request: 接口方法
* list: 表格数据
* border:是否带边框
* size:表格尺寸
* column: 列数据
* layout:分页展示数据
* pageSizes: 默认展示多少页列表
* pageSize: 当前展示页条数
* params: 外部查询参数
*/
export default {
name: "GlsxTable",
props: {
request: {
type: Function,
},
list: {
type: Array,
default: function () {
return [];
},
},
column: {
type: Array,
default: function () {
return [];
},
},
border: {
type: Boolean,
default: true,
},
size: {
type: String,
default: "small",
},
layout: {
type: String,
default: "sizes, total,prev, pager, next, jumper",
},
pageSizes: {
type: Array,
default: function () {
return [10, 20, 30, 40];
},
},
params: {
type: Object,
default: function () {
return {};
},
},
},
data() {
return {
currentPage: 1,
pageSize: 10,
pageTotal:0,
tableData:[],
loading:false
};
},
created() {},
mounted() {
if (this.request) {
this.getList();
}
},
methods: {
/**
* 每页展示
*/
changePageSize: function (e) {
this.pageSize = e;
this.getList();
},
// 获取参数
getParams(current){
let oParams = {...this.params};
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
return oParams
},
// 获取列表
getList(current) {
let request = this.request;
let oParams = this.getParams(current);
this.loading = true
request(oParams).then((res) => {
this.loading = false
if(res.code != 200){
return false;
}
let {data:{list,totalElements}} = res;
this.tableData = list||[]
this.pageTotal = totalElements
}).catch(error => {
this.loading = false
});
},
// 重置
rest() {
this.pageSize = 10;
this.currentPage = 1;
this.getList();
},
},
};
</script>
<style lang="scss">
.el_table {
thead {
th {
//background: rgba(197, 197, 197, 0.1);
background: #f5f7fa;
}
}
}
</style>
<style lang="scss" scoped>
.glsx_table_box {
margin: 10px 0;
}
.pagination_list {
text-align: right;
padding: 10px 0;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -189,6 +189,15 @@ const routes = [ ...@@ -189,6 +189,15 @@ const routes = [
} }
}, },
{ {
path: '/reportManage/electricity',
name: 'pseudoOfflineReport',
component: () => import('../views/reportManage/electricity.vue'),
meta: {
title: '电量统计',
keepAlive: true
}
},
{
path: '/specialShop', path: '/specialShop',
name: 'specialShop', name: 'specialShop',
component: () => import('../views/specialShop/index.vue'), component: () => import('../views/specialShop/index.vue'),
...@@ -251,6 +260,69 @@ const routes = [ ...@@ -251,6 +260,69 @@ const routes = [
title: '离线报警', title: '离线报警',
keepAlive: true keepAlive: true
} }
},
{
path: '/alarmCenter/alarm',
name: 'synthesisAlarm',
component: () => import('../views/alarmCenter/alarm.vue'),
meta: {
title: '警情研判',
keepAlive: true
}
},
{
path: '/alarmCenter/alarm/detail',
name: 'synthesisAlarmDetail',
component: () => import('../views/alarmCenter/alarmDetail.vue'),
meta: {
title: '详情',
keepAlive: true
}
},
{
path: '/alarmCenter/fence',
name: 'fenceAlarm',
component: () => import('../views/alarmCenter/fence.vue'),
meta: {
title: '围栏报警',
keepAlive: true
}
},
{
path: '/alarmCenter/shutdown',
name: 'shutdownAlarm',
component: () => import('../views/alarmCenter/shutdown.vue'),
meta: {
title: '停驶报警',
keepAlive: true
}
},
{
path: '/fence/index',
name: 'fenceIndex',
component: () => import('../views/fence/index.vue'),
meta: {
title: '围栏列表',
keepAlive: true
}
},
{
path: '/alarmCenter/speed',
name: 'speedAlarm',
component: () => import('../views/alarmCenter/speed.vue'),
meta: {
title: '超速报警',
keepAlive: true
}
},
{
path: '/reportManage/statistics',
name: 'statisticsAlarm',
component: () => import('../views/reportManage/statistics.vue'),
meta: {
title: '运营统计报表',
keepAlive: true
}
} }
] ]
......
...@@ -36,3 +36,23 @@ export const GETOFFLINESEARCH = (params) => { ...@@ -36,3 +36,23 @@ export const GETOFFLINESEARCH = (params) => {
export const ALARM_OFFLINE_EXPORT = (params) => { export const ALARM_OFFLINE_EXPORT = (params) => {
return request(params, "/trialdrive/offline/export"); return request(params, "/trialdrive/offline/export");
} }
// 警情中心-停驶报警-导出excel
export const ALARM_SHUTDOWN_EXPORT = (params) => {
return request(params, "/alarmcenternew/stayalarm/export");
}
// 警情中心-停驶报警-列表
export const GET_ALARM_SHUTDOWN = (params) => {
return request(params, "/alarmcenternew/stayalarm/search");
}
// 警情中心-围栏报警-列表
export const GET_FENCEALARM_LIST = (params) => {
return request(params, "/alarmcenternew/fencealarm/search");
}
// 警情中心-围栏报警-导出excel
export const ALARM_FENCEALARM_EXPORT = (params) => {
return request(params, "/alarmcenternew/fencealarm/export");
}
\ No newline at end of file \ No newline at end of file
import request from '@/services/request'
// 围栏管理-获取围栏列表
export const GET_FENCE_LIST = params => {
return request(params, '/trialdrive/elecfence/search')
}
// 围栏管理-删除围栏
export const DELETE_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/delete')
}
// 围栏管理-启用关闭围栏
export const STARTSTOP_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/startstop')
}
// 围栏管理-获取围栏详情
export const GET_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/info')
}
// 围栏管理-更新围栏
export const UPDATE_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/edit', 'POST')
}
// 围栏管理-导出围栏
export const EXPORT_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/export')
}
// 围栏管理-新建围栏
export const ADD_FENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/add', 'POST')
}
\ No newline at end of file \ No newline at end of file
...@@ -128,5 +128,14 @@ export const GET_FAKEOFFLINE_TEMPLATEFILES = params => { ...@@ -128,5 +128,14 @@ export const GET_FAKEOFFLINE_TEMPLATEFILES = params => {
// 报表管理-假性离线报警-导入excel // 报表管理-假性离线报警-导入excel
export const IMPORT_FAKEOFFLINE_FILES = BASEURL + '/trialdrive/fakeoffline/import' export const IMPORT_FAKEOFFLINE_FILES = BASEURL + '/trialdrive/fakeoffline/import'
// 报表管理-电量统计列表-获取列表
export const GET_BATTERY_LIST = params => {
return request(params, '/alarmcenternew/battery/search')
}
// 报表管理-电量统计列表-导出excel
export const EXPORT_BATTERY_LIST = params => {
return request(params, '/alarmcenternew/battery/export')
}
export { getList, getYears, getOutStoreList } export { getList, getYears, getOutStoreList }
.base_box {
margin: 0 0 30px 0;
.title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
color: #333;
display: flex;
.sub_desc {
display: flex;
flex-direction: column;
font-size: 14px;
font-weight: normal;
color: #666;
margin-left: 30px;
span {
margin-bottom: 10px;
}
}
}
.cell_list {
display: flex;
flex-wrap: wrap;
.cell {
flex: 0 0 33%;
display: flex;
padding: 4px 0;
font-size: 14px;
color: #666;
.name {
width: 130px;
flex-shrink: 0;
display: flex;
align-items: center;
}
.txt {
flex: 1;
display: flex;
align-items: center;
.btn {
margin-left: 10px;
}
}
}
}
}
.filter_date_box {
margin: 10px 0;
display: flex;
align-items: center;
.el_date_picker {
width: 120px;
margin-right: 10px;
}
.el_checkbox {
margin-left: 10px;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -137,8 +137,102 @@ ...@@ -137,8 +137,102 @@
font-size: 0; font-size: 0;
} }
.el-button.is-plain:focus, // .el-button.is-plain:focus,
.el-button.is-plain:hover { // .el-button.is-plain:hover {
background: none; // background: none;
border: 0px; // border: 0px;
// }
// 搜索框
.search_box {
.a_input {
width: 240px;
}
.input_number_list {
.a_input_number {
width: 80px;
}
.sp {
padding: 0 10px;
}
}
.small_select {
width: 120px;
}
}
.pre_select_box {
display: flex;
align-items: center;
}
.sort_select {
width: 100px;
}
.long_select {
width: 260px;
}
.long_input {
width: 240px;
}
.small_select {
width: 120px;
}
.data_picker {
width: 240px;
}
.mr5 {
margin-right: 5px;
}
.page_title {
position: relative;
.title_tip_icon {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
font-size: 16px;
color: #999;
}
}
.popover_box {
.h3 {
font-size: 14px;
color: #666;
}
p {
font-size: 12px;
color: #999;
}
}
// 页面公共标题
.page_head_title {
.h2,
.h3 {
margin: 0;
padding: 0;
line-height: 1.8;
}
.h2 {
font-size: 18px;
}
.h3 {
font-weight: normal;
font-size: 14px;
color: #999;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
.long_select{ .long_select{
width:260px; width:260px;
} }
.super_long_input{
width:300px;
}
.long_input{ .long_input{
width:240px; width:240px;
} }
......
...@@ -242,6 +242,21 @@ export const Util = { ...@@ -242,6 +242,21 @@ export const Util = {
throw new Error("Unable to clone obj! Its type isn't supported.") throw new Error("Unable to clone obj! Its type isn't supported.")
}, },
} }
// 通过url下载文件
export const downFileByPath = function(url){
if (!url) {
return false;
};
// let link = document.createElement('a')
// link.style.display = 'none'
// link.src = url
// link.target = '_blank'
// document.body.appendChild(link);
// link.click();
window.location.href = url
}
export const showModal = Util.msg export const showModal = Util.msg
export const showToast = Util.Info export const showToast = Util.Info
export const showLoading = Util.loading export const showLoading = Util.loading
......
<template>
<div class="">
<div class="page_title">
<h2 class="h2">警情研判</h2>
<h3 class="h3">用于统计和展示车辆的风险综合预警情况</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="关键字">
<el-input v-model="searchForm.keywords" placeholder="设备号|车架号|姓名|工单号"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item label="处理状态:">
<el-select v-model="searchForm.deviceTypeAndSource" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option label="未处理" value="1"></el-option>
<el-option label="已处理" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="离线时间:">
<el-date-picker v-model="searchForm.offDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="报警等级:">
<el-select v-model="searchForm.deviceTypeAndSource" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option label="1级" value="1"></el-option>
<el-option label="2级" value="2"></el-option>
<el-option label="3级" value="3"></el-option>
<el-option label="4级" value="4"></el-option>
<el-option label="5级" value="5"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">警情研判列表</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="业务工单号/姓名/设备号/车架号" prop="workOrderNo"></el-table-column>
<el-table-column label="警情等级" prop="ownerName"></el-table-column>
<el-table-column label="报警说明&建议" prop="sn"></el-table-column>
<el-table-column label="处理状态" prop="vin"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180px">
<template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookDetail(row)">详情</el-link>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import moment from "moment";
import GlsxOrganization from "@/components/glsx-organization";
import { GETOFFLINESEARCH, ALARM_OFFLINE_EXPORT } from "@/services/alarmCenter";
import { deepClone, showToast } from "@/utils/util";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: { deviceTypeAndSource: "" },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: [
{
text: "近1天不在线",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "近3天不在线",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "近7天不在线",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 7)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
},
pickerOptions: {
shortcuts: [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "近3天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "近7天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 7)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
};
},
created() {
let end = moment().format("YYYY-MM-DD");
let start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD");
this.$set(this.searchForm, "offDate", [start, end]);
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = { deviceTypeAndSource: "" };
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
let n = oParams.offDate;
if (m && m.length > 0) {
oParams.activeStartTime = m[0];
oParams.activeEndTime = m[1];
}
if (n && n.length > 0) {
oParams.offlineStartTime = n[0];
oParams.offlineEndTime = n[1];
}
delete oParams.offDate;
delete oParams.orgName;
delete oParams.timeDate;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
GETOFFLINESEARCH(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
this.tableData = obj.list;
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_OFFLINE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
});
},
// 查看详情
lookDetail(row) {
let path = `#/alarmCenter/alarm/detail`;
let oParams = {}
//this.$root.parentCommon.setBreadCrumbs(path);
history.pushState(oParams, "详情", path);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="alarm_detail_page">
<!-- 基本信息 开始 -->
<div class="base_box">
<div class="title">基本信息</div>
<div class="cell_list">
<div class="cell">
<div class="name">姓名:</div>
<div class="txt">赖晓峰</div>
</div>
<div class="cell">
<div class="name">门店名称:</div>
<div class="txt">四川厚德汇汽车服务有限公司</div>
</div>
<div class="cell cell_address">
<div class="name">门店地址:</div>
<div class="txt">成都市武侯区新希望路7号6栋2单元17层1702号</div>
</div>
<div class="cell">
<div class="name">车架号:</div>
<div class="txt">3214321432</div>
</div>
<div class="cell">
<div class="name">门店联系方式:</div>
<div class="txt">18100000000</div>
</div>
<div class="cell">
<div class="name">工单号:</div>
<div class="txt">18100000000</div>
</div>
<div class="cell">
<div class="name">激活时间:</div>
<div class="txt">2018-10-29 14:41</div>
</div>
<div class="cell">
<div class="name">设备号:</div>
<div class="txt">1234123421</div>
</div>
<div class="cell">
<div class="name">设备号(无线):</div>
<div class="txt">1234123421</div>
</div>
<div class="cell">
<div class="name">客户联系方式:</div>
<div class="txt">18100000000</div>
</div>
</div>
</div>
<!-- 基本信息 end -->
<!-- 设备信息 开始 -->
<div class="base_box">
<div class="title">设备信息</div>
<div class="cell_list">
<div class="cell">
<div class="name">设备状态(有线):</div>
<div class="txt">
<span>离线(3天0小时20分)</span>
<el-button type="primary" size="mini" class="btn">监控车辆</el-button>
</div>
</div>
<div class="cell">
<div class="name">设备状态(无线):</div>
<div class="txt">离线(9天10小时26分)</div>
</div>
<div class="cell">
<div class="name">行驶里程:</div>
<div class="txt">
<span>200km</span>
<el-button type="primary" size="mini" class="btn">详情</el-button>
</div>
</div>
<div class="cell">
<div class="name">是否产生防拆报警:</div>
<div class="txt">
<span>是</span>
<el-button type="primary" size="mini" class="btn">详情</el-button>
</div>
</div>
</div>
</div>
<!-- 设备信息 end -->
<!-- 警情日历 开始 -->
<div class="base_box">
<div class="title">
<span>警情日历</span>
<div class="sub_desc">
<span>首次报警日期:2018-10-29</span>
<span>累计报警次数:10次</span>
</div>
</div>
<div class="filter_date_box">
<el-date-picker class="el_date_picker" v-model="month" type="month" placeholder="选择月" size="small"></el-date-picker>
<el-button-group class="el_btn_group">
<el-button :type="primaryalarmLevel == item.id?'primary':'default'" plain size="small" v-for="(item,index) in alarmLevelList" :key="index" @click="alarmEvenet(item)">{{item.name}}</el-button>
</el-button-group>
<el-checkbox class="el_checkbox" v-model="checked">仅显示未处理的报警</el-checkbox>
</div>
<div class="calendar_box">
<el-calendar class="el_calendar" v-model="month"></el-calendar>
</div>
</div>
<!-- 警情日历 end -->
</div>
</template>
<script>
import moment from "moment";
import {} from "@/services/alarmCenter";
import { deepClone, showToast } from "@/utils/util";
export default {
components: {},
data() {
return {
month: "",
alarmLevelList:[
{name:'全部等级',id:''},
{name:'1级',id:'1'},
{name:'2级',id:'2'},
{name:'3级',id:'3'},
{name:'4级',id:'4'},
{name:'5级',id:'5'},
],
alarmLevel:''
};
},
created() {
this.month = moment()
},
mounted() {},
methods: {
// 切换风险等级
alarmEvenet(row){
this.alarmLevel = row.id;
}
},
};
</script>
<style lang="scss">
.el_calendar {
.el-calendar__header {
display: none !important;
}
.el-calendar__body {
padding: 0;
thead {
th {
border-top: 1px solid #ebeef5;
border-left: 1px solid #ebeef5;
font-weight: bold;
}
th:last-child {
border-right: 1px solid #ebeef5;
}
}
}
}
</style>
<style lang="scss" scoped>
@import "@/styles/alarmDetail.scss";
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="">
<div class="page_title">
<h2 class="h2">围栏报警</h2>
<h3 class="h3">用于统计和展示车辆的围栏报警数据(仅针对有线设备)</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="super_long_input" placeholder="设备号 | 姓名 | 车架号 | 业务工单 | 围栏名称" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item label="报警类型:">
<el-select v-model="searchForm.alarmType" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in FENCE_MONITOR_LIST" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警时间:">
<el-date-picker v-model="searchForm.timeDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">围栏报警列表</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="业务工单号" prop="bizOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
</el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn" show-overflow-tooltip></el-table-column>
<el-table-column label="围栏名称" prop="fenceName" show-overflow-tooltip></el-table-column>
<el-table-column label="报警地点" prop="address" show-overflow-tooltip></el-table-column>
<el-table-column label="报警类型" prop="alarmTypeStr" show-overflow-tooltip></el-table-column>
<el-table-column label="报警开始时间" prop="alarmTime" show-overflow-tooltip></el-table-column>
<el-table-column label="持续时长" prop="duration" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120px">
<template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookDetail(row)">轨迹回放</el-link>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="currentPage" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import moment from "moment";
import { fenceShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization";
import {
GET_FENCEALARM_LIST,
ALARM_FENCEALARM_EXPORT,
} from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
import { FENCE_MONITOR_LIST } from "@/common/constants";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: { alarmType: "" },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: fenceShortcuts,
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
FENCE_MONITOR_LIST,
fenceId: "",
};
},
created() {
console.log(history.state);
let query = this.$route.query;
this.fenceId = query.fenceId || "";
if (query.name) {
this.$set(this.searchForm, "keywords", query.name);
}
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = { alarmType: "" };
this.currentPage = 1;
this.pageSize = 10;
this.fenceId = "";
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
if (m && m.length > 0) {
oParams.alarmStartTime = m[0];
oParams.alarmEndTime = m[1];
}
if (this.fenceId) {
oParams.fenceId = this.fenceId;
}
delete oParams.orgName;
delete oParams.timeDate;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if (current) {
this.currentPage = current;
}
GET_FENCEALARM_LIST(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
this.tableData = obj.list || [];
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_FENCEALARM_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
//window.open(res.data);
downFileByPath(res.data);
});
},
// 查看轨迹回放
lookDetail(row) {
let startTime = row.alarmTime
? moment(row.alarmTime).format("x") - 120000
: "";
let sTime = moment(startTime).format("yyyy-MM-DD HH:mm:ss");
let endTime = row.endTime || "";
let eTime = moment(endTime).format("yyyy-MM-DD HH:mm:ss");
if (!row.endTime) {
eTime = moment(startTime + 3600000).format("yyyy-MM-DD HH:mm:ss");
}
console.log(sTime + "---" + eTime);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&name=${row.ownerName}&standno=${row.vin}&startTime=${sTime}&endTime=${eTime}&fenceId=${row.fenceId}&isInitFence=1`;
//this.$root.parentCommon.setBreadCrumbs(path);
window.open(path);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="">
<div class="page_title">
<h2 class="h2">停驶报警</h2>
<h3 class="h3">用于统计和展示车辆的停驶报警数据(仅针对有线设备)</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="停驶时间:">
<el-radio-group v-model="searchForm.stayRange" class="el_radio_group">
<el-radio-button v-for="(item,index) in timeList" :key="index" :label="item.id">{{item.name}}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="激活区间:">
<el-date-picker v-model="searchForm.offDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 姓名 | 车架号 | 业务工单" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">停驶报警列表</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="序号" type="index" show-overflow-tooltip></el-table-column>
<el-table-column label="业务工单号" prop="bizOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
</el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn" show-overflow-tooltip>
<template slot-scope="{row}">{{row.sn||'--'}}</template>
</el-table-column>
<el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="车辆归属" prop="shopName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.shopName||'--'}}</template>
</el-table-column>
<el-table-column label="激活时间" prop="activeTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.activeTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后GPS时间" prop="lastGpsTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastGpsTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后基站时间" prop="lastBsTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastBsTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后GPS定位地址" prop="lastGpsAddress" show-overflow-tooltip width="240">
<template slot-scope="{row}">{{row.lastGpsAddress||'--'}}</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="currentPage" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import { shutDownShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization";
import { GET_ALARM_SHUTDOWN, ALARM_SHUTDOWN_EXPORT } from "@/services/alarmCenter";
import { deepClone, showToast,downFileByPath } from "@/utils/util";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: {stayRange:2},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: shutDownShortcuts,
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
timeList: [
{ name: "近2天停驶", id: 2 },
{ name: "近7天停驶", id: 7 },
{ name: "超长停驶", id: 168 },
],
timeActive: 2,
};
},
created() {
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = { stayRange: 2 };
this.currentPage = 1;
this.pageSize = 10;
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let n = oParams.offDate;
if (n && n.length > 0) {
oParams.activeStartTime = n[0];
oParams.activeEndTime = n[1];
}
delete oParams.offDate;
delete oParams.orgName;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if(current){
this.currentPage = current
}
GET_ALARM_SHUTDOWN(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
this.tableData = obj.list;
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_SHUTDOWN_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
downFileByPath(res.data)
//window.open(res.data);
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
.el_link {
margin: 0 10px 0 0;
}
.links_group:after {
display: none;
}
.el_radio_group {
vertical-align: middle;
}
.table_box{
margin-top: 0;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="">
<div class="page_title">
<h2 class="h2">超速报警</h2>
<h3 class="h3">用于统计和展示有线设备的超速报警</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 车架号 | 姓名 | 工单号" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item label="报警时间:">
<el-date-picker v-model="searchForm.timeDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">超速报警信息</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="工单号" prop="bizOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
</el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn" show-overflow-tooltip></el-table-column>
<el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="超速开始时间" prop="alarmTime" show-overflow-tooltip></el-table-column>
<el-table-column label="超速结束时间" prop="alarmTime" show-overflow-tooltip></el-table-column>
<el-table-column label="超速时长" prop="duration" show-overflow-tooltip></el-table-column>
<el-table-column label="平均车速" prop="fenceName" show-overflow-tooltip></el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="currentPage" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import moment from "moment";
import { fenceShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization";
import {
GET_FENCEALARM_LIST,
ALARM_FENCEALARM_EXPORT,
} from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
import { FENCE_MONITOR_LIST } from "@/common/constants";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: fenceShortcuts,
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
FENCE_MONITOR_LIST,
fenceId: "",
};
},
created() {
console.log(history.state);
this.fenceId = history.state.fenceId;
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = {};
this.currentPage = 1;
this.pageSize = 10;
this.fenceId = "";
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
if (m && m.length > 0) {
oParams.alarmStartTime = m[0];
oParams.alarmEndTime = m[1];
}
if (this.fenceId) {
oParams.fenceId = this.fenceId;
}
delete oParams.orgName;
delete oParams.timeDate;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if (current) {
this.currentPage = current;
}
GET_FENCEALARM_LIST(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
this.tableData = obj.list || [];
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_FENCEALARM_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
//window.open(res.data);
downFileByPath(res.data);
});
},
// 查看轨迹回放
lookDetail(row) {
let startTime = row.alarmTime
? moment(row.alarmTime).format("x") - 120000
: "";
let sTime = moment(startTime).format("yyyy-MM-DD HH:mm:ss");
let endTime = row.endTime || "";
let eTime = moment(endTime).format("yyyy-MM-DD HH:mm:ss");
if (!row.endTime) {
eTime = moment(startTime + 3600000).format("yyyy-MM-DD HH:mm:ss");
}
console.log(sTime + "---" + eTime);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&name=${row.ownerName}&standno=${row.vin}&startTime=${sTime}&endTime=${eTime}&fenceId=${row.fenceId}&isInitFence=1`;
//this.$root.parentCommon.setBreadCrumbs(path);
window.open(path);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<h1 class="page_title">
<span>电量统计</span>
<el-popover placement="right-start" trigger="hover">
<div class="popover_box">
<h3 class="h3">首次上点时间</h3>
<p>指无线设备激活时间;</p>
<h3 class="h3">最近上点时间</h3>
<p>指无线设备最近一次的上点时间;</p>
<h3 class="h3">当前电量(%)</h3>
<p>显示设备当前电量百分比;</p>
<p>仅统计无线设备的用户</p>
</div>
<span class="title_tip_icon" slot="reference"><i class="el-icon-question"></i></span>
</el-popover>
</h1>
<div class="m-b-md title_tips">用于统计无线设备的剩余电量</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="业务工单|姓名|车架号|设备号" class="a_input" maxlength="20" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="选择电量:">
<div class="input_number_list">
<el-input-number class="a_input_number" placeholder="最低" v-model="searchForm.minBattery" :controls="false" :min="0" :max="searchForm.maxBattery"></el-input-number>
<span class="sp">-</span>
<el-input-number class="a_input_number" placeholder="最高" v-model="searchForm.maxBattery" :controls="false" :min="searchForm.minBattery" :max="100"></el-input-number>
</div>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 按钮区域 开始 -->
<div class="links_group">
<span>电量统计列表</span>
<el-button class="pull-right" type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
</glsx-table>
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table";
import { GET_BATTERY_LIST, EXPORT_BATTERY_LIST } from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
import moment from "moment";
export default {
components: {
GlsxTable,
GlsxOrganization,
},
data() {
return {
searchForm: {},
tableData: [],
columnList: [
{
label: "业务工单号",
prop: "workOrderNo",
formatter: (row) => {
return `${row.workOrderNo || "--"}`;
},
},
{
label: "姓名",
prop: "ownerName",
formatter: (row) => {
return `${row.ownerName || "--"}`;
},
},
{
label: "设备号",
prop: "sn",
formatter: (row) => {
return `${row.sn || "--"}`;
},
},
{
label: "车架号",
prop: "vin",
formatter: (row) => {
return `${row.vin || "--"}`;
},
},
{
label: "首次上点时间",
prop: "firstGpsTime",
formatter: (row) => {
return `${row.firstGpsTime || "--"}`;
},
},
{
label: "最后上点时间",
prop: "lastGpsTime",
formatter: (row) => {
return `${row.lastGpsTime || "--"}`;
},
},
{
label: "当前电量",
prop: "soc",
formatter: (row) => {
return `${row.soc || row.soc == 0 ? row.soc + "%" : "--"}`;
},
},
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
cloading: false,
loading: false,
aloading: false,
isTimeOut: false,
sTime: "",
eTime: "",
pickerOptions: {
onPick: ({ maxDate, minDate }) => {
this.sTime = minDate || "";
this.eTime = maxDate || "";
if (maxDate && minDate) {
let m = moment(maxDate).diff(moment(minDate), "days");
if (m > 60) {
this.isTimeOut = true;
} else {
this.isTimeOut = false;
}
this.eTime = "";
this.sTime = "";
}
},
},
showDialog: false,
uploadFile: {},
showResult: false,
uploadHeaders: {},
uploadResult: {},
fileList: [],
acceptFile: ".xlsx,.xls",
};
},
mounted() {
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
if (
(oParams.minBattery || oParams.minBattery == 0) &&
!oParams.maxBattery &&
oParams.maxBattery !== 0
) {
showToast({
message: "请输入最大电量",
});
return false;
}
if (
!oParams.minBattery &&
oParams.minBattery !== 0 &&
(oParams.maxBattery || oParams.maxBattery == 0)
) {
showToast({
message: "请输入最小电量",
});
return false;
}
delete oParams.orgName;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum);
oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
GET_BATTERY_LIST(oParams)
.then((res) => {
this.loading = false;
let { data } = res;
let { list, totalElements } = data;
this.pageTotal = totalElements || 0;
this.tableData = list || [];
})
.catch((error) => {
this.loading = false;
});
},
// 查看详情
lookDetail(row) {
console.log(row);
let o = window.location.origin;
let query = { vin: row.vin };
//let path = "/trialRun#/reportManage/map";
let path = `/oEshield/#/monitor/activeLocation`;
//history.pushState(query, path, path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path + "?sns=" + row.sns);
//this.$router.push({ name: "mileageDetail", query: { vin: row.vin } });
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
EXPORT_BATTERY_LIST(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
//window.open(res.data);
downFileByPath(res.data);
});
},
// 重置
rest() {
this.searchForm = {};
this.$refs.glsxTable.rest();
this.getList();
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/common.scss";
</style>>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="search_box"> <div class="search_box">
<el-form :model="searchForm" :inline="true" size="small"> <el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:"> <el-form-item label="关键字:">
<el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model="searchForm.keywords"> <el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model.trim="searchForm.keywords">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆归属:"> <el-form-item label="车辆归属:">
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-popover> </el-popover>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="searchEvent()">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button> <el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
...@@ -102,12 +102,49 @@ export default { ...@@ -102,12 +102,49 @@ export default {
preText: "orderNo", preText: "orderNo",
tableData: [], tableData: [],
columnList: [ columnList: [
{ label: "工单号", prop: "workOrderNo", align: "center" }, {
{ label: "姓名", prop: "ownerName" }, label: "工单号",
{ label: "设备号", prop: "sn" }, prop: "workOrderNo",
{ label: "车架号", prop: "vin" }, align: "center",
{ label: "总行驶次数", prop: "tripCount" }, formatter: (row) => {
{ label: "总里程km", prop: "distance" }, return `${row.workOrderNo || "--"}`;
},
},
{
label: "姓名",
prop: "ownerName",
formatter: (row) => {
return `${row.ownerName || "--"}`;
},
},
{
label: "设备号",
prop: "sn",
formatter: (row) => {
return `${row.sn || "--"}`;
},
},
{
label: "车架号",
prop: "vin",
formatter: (row) => {
return `${row.vin || "--"}`;
},
},
{
label: "总行驶次数",
prop: "tripCount",
formatter: (row) => {
return `${row.tripCount || "--"}`;
},
},
{
label: "总里程km",
prop: "distance",
formatter: (row) => {
return `${row.distance || "--"}`;
},
},
], ],
pageTotal: 0, pageTotal: 0,
filterVisible: false, filterVisible: false,
...@@ -131,8 +168,8 @@ export default { ...@@ -131,8 +168,8 @@ export default {
} else { } else {
this.isTimeOut = false; this.isTimeOut = false;
} }
this.eTime = ''; this.eTime = "";
this.sTime = '' this.sTime = "";
} }
}, },
}, },
...@@ -153,10 +190,18 @@ export default { ...@@ -153,10 +190,18 @@ export default {
return oParams; return oParams;
}, },
// 搜索
searchEvent(){
this.$refs.glsxTable.rest('currentPage',1);
this.getList()
},
// 获取列表 // 获取列表
getList(options) { getList(options) {
let oParams = this.getParams(); let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize; oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1; oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true; this.loading = true;
GET_JOURNEYS_SEARCH(oParams) GET_JOURNEYS_SEARCH(oParams)
...@@ -199,13 +244,13 @@ export default { ...@@ -199,13 +244,13 @@ export default {
let oParams = this.getParams(); let oParams = this.getParams();
_this.dloading = true; _this.dloading = true;
GET_JOURNEYS_EXPORT(oParams).then(res => { GET_JOURNEYS_EXPORT(oParams).then((res) => {
_this.dloading = false; _this.dloading = false;
if (res.code != 200) { if (res.code != 200) {
return false; return false;
} }
window.open(res.data); window.open(res.data);
}) });
// _this.$Common.exportExcel({ // _this.$Common.exportExcel({
// url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`, // url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`,
...@@ -239,13 +284,13 @@ export default { ...@@ -239,13 +284,13 @@ export default {
oParams.journeyEndTime = o[1]; oParams.journeyEndTime = o[1];
_this.cloading = true; _this.cloading = true;
GET_JOURNEYS_DAILYEXPORT(oParams).then(res => { GET_JOURNEYS_DAILYEXPORT(oParams).then((res) => {
_this.cloading = false; _this.cloading = false;
if (res.code != 200) { if (res.code != 200) {
return false; return false;
} }
window.open(res.data); window.open(res.data);
}) });
}, },
// 重置 // 重置
...@@ -253,9 +298,9 @@ export default { ...@@ -253,9 +298,9 @@ export default {
this.searchForm = {}; this.searchForm = {};
this.searchText = ""; this.searchText = "";
this.preText = "orderNo"; this.preText = "orderNo";
this.mileageDate = [] this.mileageDate = [];
this.getList();
this.$refs.glsxTable.rest(); this.$refs.glsxTable.rest();
this.getList();
}, },
}, },
}; };
...@@ -296,9 +341,9 @@ export default { ...@@ -296,9 +341,9 @@ export default {
margin: 10px 0 0 0; margin: 10px 0 0 0;
} }
} }
.search_box{ .search_box {
.a_input{ .a_input {
width:320px; width: 320px;
} }
} }
</style>> </style>>
\ No newline at end of file \ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="searchEvent()">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="default" icon="el-icon-refresh" @click="rest()">重置</el-button> <el-button type="default" icon="el-icon-refresh" @click="rest()">重置</el-button>
...@@ -64,102 +64,71 @@ import { ...@@ -64,102 +64,71 @@ import {
GET_JOURNEYS_EXPORTDETAIL, GET_JOURNEYS_EXPORTDETAIL,
} from "services/report"; } from "services/report";
import { deepClone, showToast } from "@/utils/util"; import { deepClone, showToast } from "@/utils/util";
import moment from "moment"; import { mileageDetailShortcuts } from "@/common/index";
export default { export default {
data() { data() {
return { return {
searchForm: {sn:this.$route.query.sn}, searchForm: { sn: this.$route.query.sn },
snList: [], snList: [],
dateTime: [], dateTime: [],
tableData: [], tableData: [],
columnList: [ columnList: [
{ label: "工单号", prop: "workOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sn" },
{ label: "车架号", prop: "vin" },
{ {
label: "行程开始/结束时间", label: "工单号",
prop: "journeyStartTime", prop: "workOrderNo",
formatter: (row) => { formatter: (row) => {
return `${row.journeyStartTime}~${row.journeyEndTime}`; return `${row.workOrderNo || "--"}`;
}, },
}, },
{ label: "行驶时长", prop: "durationStr" },
{ {
label: "行驶里程km", label: "姓名",
prop: "distance", prop: "ownerName",
formatter: (row) => { formatter: (row) => {
return `${row.distance || 0}km`; return `${row.ownerName || "--"}`;
}, },
}, },
],
pageTotal: 0,
pickerOptions: {
shortcuts: [
{ {
text: "全部", label: "设备号",
onClick(picker) { prop: "sn",
const end = ""; formatter: (row) => {
const start = ""; return `${row.sn || "--"}`;
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
}, },
}, },
{ {
text: "本周", label: "车架号",
onClick(picker) { prop: "vin",
const end = moment().format("YYYY-MM-DD"); formatter: (row) => {
const start = moment().weekday(1).format("YYYY-MM-DD"); return `${row.vin || "--"}`;
picker.$emit("pick", [start, end]);
}, },
}, },
{ {
text: "上周", label: "行程开始/结束时间",
onClick(picker) { prop: "journeyStartTime",
let weekOfDay = parseInt(moment().format("E")); formatter: (row) => {
const end = moment() return `${row.journeyStartTime}~${row.journeyEndTime}`;
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}, },
}, },
{ {
text: "本月", label: "行驶时长",
onClick(picker) { prop: "durationStr",
const start = moment().add("month", 0).format("YYYY-MM") + "-01"; formatter: (row) => {
const end = moment().format("YYYY-MM-DD"); return `${row.durationStr || "--"}`;
picker.$emit("pick", [start, end]);
}, },
}, },
{ {
text: "上月", label: "行驶里程km",
onClick(picker) { prop: "distance",
const end = moment() formatter: (row) => {
.month(moment().month() - 1) return `${row.distance ? row.distance.toFixed(2) : 0}`;
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}, },
}, },
], ],
pageTotal: 0,
pickerOptions: {
shortcuts: mileageDetailShortcuts,
}, },
dloading: false, dloading: false,
aloding:false aloding: false,
}; };
}, },
components: { components: {
...@@ -169,7 +138,7 @@ export default { ...@@ -169,7 +138,7 @@ export default {
//this.getSn(); //this.getSn();
}, },
mounted() { mounted() {
this.getList() this.getList();
//this.getTableList(); //this.getTableList();
}, },
methods: { methods: {
...@@ -189,7 +158,7 @@ export default { ...@@ -189,7 +158,7 @@ export default {
// 获取列表 // 获取列表
getList(options) { getList(options) {
let oParams = this.getParams(); let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize; oParams.pageSize = this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1; oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.aloding = true; this.aloding = true;
GET_JOURNEYS_SEARCHDETAIL(oParams).then((res) => { GET_JOURNEYS_SEARCHDETAIL(oParams).then((res) => {
...@@ -215,11 +184,13 @@ export default { ...@@ -215,11 +184,13 @@ export default {
// 查看轨迹 // 查看轨迹
lookTrack(row) { lookTrack(row) {
console.log(row); console.log(row);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&isInitFence=1&name=${ let path = `/oEshield#/monitor/replay?sn=${
row.ownerName row.sn || ""
}&standno=${row.vin}&startTime=${row.journeyStartTime || ""}&endTime=${ }&isInitFence=1&name=${row.ownerName || ""}&standno=${
row.vin || ""
}&startTime=${row.journeyStartTime || ""}&endTime=${
row.journeyEndTime || 0 row.journeyEndTime || 0
}&fenceId=${row.fenceId}`; }&fenceId=${row.fenceId || ""}`;
//let query = {sn:row.sn,isInitFence:1,name:row.name,standno:row.vin}; //let query = {sn:row.sn,isInitFence:1,name:row.name,standno:row.vin};
let query = {}; let query = {};
//this.$router.push({path:path}) //this.$router.push({path:path})
...@@ -231,21 +202,27 @@ export default { ...@@ -231,21 +202,27 @@ export default {
let _this = this; let _this = this;
let oParams = this.getParams(); let oParams = this.getParams();
_this.dloading = true; _this.dloading = true;
GET_JOURNEYS_EXPORTDETAIL(oParams).then(res => { GET_JOURNEYS_EXPORTDETAIL(oParams).then((res) => {
_this.dloading = false; _this.dloading = false;
if (res.code != 200) { if (res.code != 200) {
return false; return false;
} }
window.open(res.data); window.open(res.data);
}) });
}, },
// 重置 // 重置
rest() { rest() {
//this.searchForm = {}; //this.searchForm = {};
this.dateTime = []; this.dateTime = [];
this.getList();
this.$refs.glsxTable.rest(); this.$refs.glsxTable.rest();
this.getList();
},
// 搜索事件
searchEvent() {
this.$refs.glsxTable.rest("currentPage", 1);
this.getList();
}, },
}, },
}; };
......
<template>
<div class="system-container">
<div class="page_head_title">
<h2 class="h2">运营统计报表</h2>
<h3 class="h3">通过车辆或设备纬度,统计系统内设备数据,并支持宽表输出</h3>
</div>
<el-tabs v-model="tabActive">
<el-tab-pane label="车辆纬度" name="car">
<statistics-car></statistics-car>
</el-tab-pane>
<el-tab-pane label="设备纬度" name="device">设备纬度</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {} from "services/report";
import StatisticsCar from './statistics_car'
export default {
components: {
StatisticsCar
},
data() {
return {
tabActive: "car",
};
},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
@import "@/styles/common.scss";
</style>>
\ No newline at end of file \ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="设备号|姓名|车架号|业务工单号" class="a_input" maxlength="20" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 按钮区域 开始 -->
<div class="links_group">
<span>统计列表详情-车辆纬度</span>
<el-button class="pull-right" type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :request="GET_FAKEOFFLINE_LIST" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookDetail(scope)" v-if="scope.locationFlag == 1">查看位置</el-link>
</div>
</glsx-table>
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table/table";
import {
GET_JOURNEYS_SEARCH,
GET_JOURNEYS_EXPORT,
GET_JOURNEYS_DAILYEXPORT,
GET_FAKEOFFLINE_LIST,
GET_FAKEOFFLINE_EXPORT,
GET_FAKEOFFLINE_TEMPLATEFILES,
IMPORT_FAKEOFFLINE_FILES,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
import moment, { max } from "moment";
import GlsxDialog from "@/components/dialog";
export default {
name:'StatisticsCar',
components: {
GlsxTable,
GlsxOrganization,
GlsxDialog,
},
data() {
return {
searchForm: {},
tableData: [],
columnList: [
{ label: "工单号", prop: "bizOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sns" },
{ label: "车架号", prop: "vin" },
{ label: "假性离线原因", prop: "reason" },
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
cloading: false,
loading: false,
aloading: false,
isTimeOut: false,
sTime: "",
eTime: "",
pickerOptions: {
onPick: ({ maxDate, minDate }) => {
this.sTime = minDate || "";
this.eTime = maxDate || "";
if (maxDate && minDate) {
let m = moment(maxDate).diff(moment(minDate), "days");
if (m > 60) {
this.isTimeOut = true;
} else {
this.isTimeOut = false;
}
this.eTime = "";
this.sTime = "";
}
},
},
showDialog: false,
uploadFile: {},
showResult: false,
uploadHeaders: {},
uploadResult: {},
IMPORT_FAKEOFFLINE_FILES,
fileList: [],
acceptFile: ".xlsx,.xls",
GET_FAKEOFFLINE_LIST
};
},
mounted() {
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
//this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
delete oParams.orgName;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum);
oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
GET_FAKEOFFLINE_LIST(oParams)
.then((res) => {
this.loading = false;
let { data } = res;
let { list, totalElements } = data;
this.pageTotal = totalElements || 0;
this.tableData = list || [];
})
.catch((error) => {
this.loading = false;
});
},
// 查看详情
lookDetail(row) {
console.log(row);
let o = window.location.origin;
let query = { vin: row.vin };
//let path = "/trialRun#/reportManage/map";
let path = `/oEshield/#/monitor/activeLocation`;
//history.pushState(query, path, path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path + "?sns=" + row.sns);
//this.$router.push({ name: "mileageDetail", query: { vin: row.vin } });
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_FAKEOFFLINE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
});
// _this.$Common.exportExcel({
// url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`,
// method: "GET",
// data: oParams,
// fileName: "里程统计报表",
// success: () => {
// _this.dloading = false;
// },
// fail: () => {
// _this.dloading = false;
// },
// });
},
// 重置
rest() {
this.searchForm = {};
this.$refs.glsxTable.rest();
this.getList();
},
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
this.fileList = [file];
}
},
// 打开批量导入弹框
openDialog() {
this.showDialog = true;
},
// 关闭弹框
closeDialog() {
this.showDialog = false;
this.uploadFile = {};
this.uploadResult = {};
this.showResult = false;
},
// 上传文件
saveFile() {
let o = this.uploadFile;
console.log(o);
if (!this.uploadFile.name) {
showToast({
message: "请选择上传文件",
});
return false;
}
let list = o.name.split(".");
let acceptFile = this.acceptFile;
let _type = list[list.length - 1];
console.log(_type);
let idx = acceptFile.includes(_type);
if (!idx) {
showToast({
message: `导入文件只支持${acceptFile}`,
});
return false;
}
this.aloading = true;
this.$refs.elUpload.submit();
},
// 监听文件上传成功
onSuccess(response, file, fileList) {
this.aloading = false;
if (response.code != 200) {
showToast({
message: response.message,
});
this.uploadFile = {};
this.$refs.elUpload.clearFiles();
return false;
}
this.uploadResult = response.data;
this.showResult = true;
this.getList();
},
// 下载模板
downloadTemplate() {
GET_FAKEOFFLINE_TEMPLATEFILES().then((res) => {
window.open(res.data);
});
},
// 下载失败模板
downloadFail() {
let o = this.uploadResult;
window.open(o.failFile);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</style>>
\ No newline at end of file \ No newline at end of file
<template>
<div class="dialog_content" v-loading="formLoading">
<el-form class="el_form" ref="snForm" :model="snForm" :rules="vehicleRules" :inline="false" :disabled="isReadonly" size="mini" label-width="100px">
<h2 class="h2_title">设备信息</h2>
<!-- 新增 -->
<template v-if="dialogType == 'create'">
<el-form-item label="" class="long_form_item" v-for="(item, index) in snForm.deviceInfoDtos" :key="index" label-width="0">
<div class="el_item_inner el_sn_list">
<el-form-item label="设备SN号" class="is-required" :prop="'deviceInfoDtos.'+index + '.sn'" :rules="{required:true,validator:checkDevice,trigger:'blur'}">
<el-input v-model="item.sn" :disabled="dialogType != 'create'"></el-input>
</el-form-item>
<el-form-item label="设备型号:" class="is-required">
<el-input v-model="item.deviceClassifyName" disabled></el-input>
</el-form-item>
<div class="icon_box" v-if="dialogType == 'create'">
<i v-show="!isViewMode && index != 0" @click="removeDevice(index)" class="el-icon-remove-outline"></i>
<i v-show="!isViewMode" @click="addDevice" class="el-icon-circle-plus-outline"></i>
</div>
</div>
</el-form-item>
</template>
<!-- 新增 -->
<!-- 编辑 -->
<template v-if="dialogType != 'create'">
<el-form-item label="" class="long_form_item" v-for="(item, index) in snForm.deviceInfoDtos" :key="index" label-width="0">
<div class="el_item_inner el_sn_list">
<el-form-item label="设备SN号" class="is-required">
<el-input v-model="item.sn" :disabled="dialogType != 'create'"></el-input>
</el-form-item>
<el-form-item label="设备型号:" class="is-required">
<el-input v-model="item.deviceClassifyName" disabled></el-input>
</el-form-item>
</div>
</el-form-item>
</template>
<!-- 编辑 -->
<h2 class="h2_title">车主信息</h2>
<el-form-item label="姓名:" prop="ownerName">
<el-input v-model="snForm.ownerName" maxlength="50" clearable></el-input>
</el-form-item>
<el-form-item label="性别:" prop="ownerSex">
<el-select v-model="snForm.ownerSex">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式:" prop="ownerTel" class="long_form_item">
<el-input v-model="snForm.ownerTel" maxlength="11" clearable></el-input>
</el-form-item>
<h2 class="h2_title">车辆信息</h2>
<el-form-item label="车牌号:" prop="licensePlate" class="long_form_item">
<el-input v-model="snForm.licensePlate" maxlength="9" clearable></el-input>
</el-form-item>
<el-form-item label="车架号:" prop="vin" class="long_form_item">
<div class="el_item_inner">
<el-input v-model="snForm.vin" class="a_input" maxlength="17" clearable :disabled="vinEdit && dialogType != 'create'"></el-input>
<auth-button type="primary" class="btn" size="mini" v-show="vinEdit && dialogType != 'create'" :uid="6010209" name="车架编辑" @click.native="vinEdit = !vinEdit">编辑</auth-button>
<el-button v-show="!vinEdit" class="btn" @click="vinEdit = !vinEdit">取消</el-button>
</div>
</el-form-item>
<el-form-item label="发动机号:" prop="engine" class="long_form_item">
<el-input v-model="snForm.engine" maxlength="50" clearable></el-input>
</el-form-item>
<el-form-item label="车辆归属:" prop="organizationName" class="long_form_item">
<el-input v-model="snForm.organizationName" readonly @click.native="selectStore"></el-input>
</el-form-item>
<el-form-item label="车型/车系:" prop="carIds" class="long_form_item">
<el-cascader v-model="snForm.carIds" :options="vehicleList" :props="vehicleProps" class="el_cascader"></el-cascader>
</el-form-item>
<el-form-item label="排量:" class="long_form_item">
<el-input v-model="snForm.displacement" maxlength="50" clearable></el-input>
</el-form-item>
<el-form-item label="车辆标签:" prop="vehicleType">
<el-select v-model="snForm.vehicleType">
<el-option label="试驶车" :value="1"></el-option>
<el-option label="服务车" :value="3"></el-option>
<el-option label="代步车" :value="4"></el-option>
<el-option label="救援车" :value="5"></el-option>
<el-option label="办公车" :value="6"></el-option>
<el-option label="其他" :value="7"></el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆用途:" prop="vehicleUsages">
<el-select v-model="snForm.vehicleUsages">
<el-option label="专属用途" :value="1"></el-option>
<el-option label="非专属用途" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注:" class="long_form_item">
<el-input type="textarea" v-model="snForm.remark" maxlength="200" rows="4" resize="none"></el-input>
</el-form-item>
</el-form>
<template v-if="dialogType == 'view'">
<h2 class="h2_title">操作日志</h2>
<table class="freq_table el_table" v-loading="freqLoading">
<tr>
<th width="33.3%">操作项</th>
<th width="33.3%">操作时间</th>
<th width="33.4%">操作人</th>
</tr>
<tr v-for="(item,index) in (snForm.vehicleLogs||[])" :key="index">
<td>{{item.operateContent }}</td>
<td>{{item.createdDate}}</td>
<td>{{item.operator}}</td>
</tr>
<tr v-if="!snForm.vehicleLogs || snForm.vehicleLogs.length<=0">
<td colspan="7">暂无操作日志</td>
</tr>
</table>
<h2 class="h2_title">特殊操作记录</h2>
<table class="freq_table el_table" v-loading="freqLoading">
<tr>
<th width="20%">调频时间</th>
<th width="16%">调频模式</th>
<th width="10%">上点频次</th>
<th width="14%">调频上点个数</th>
<th width="16%">设备上点总个数</th>
<th width="10%">剩余电量</th>
<th width="14%">调频操作人</th>
</tr>
<tr v-for="(item,index) in freqTableData" :key="index">
<td>{{item.createTime}}</td>
<td>{{item.freqTypeStr}}</td>
<td>{{item.frequency}}</td>
<td>{{item.freTotal}}</td>
<td>{{item.devicePointTotal}}</td>
<td>{{item.batteryLevel}}%</td>
<td>{{item.operation}}</td>
</tr>
<tr v-if="!freqTableData || freqTableData.length<=0">
<td colspan="7">暂无特殊操作日志</td>
</tr>
</table>
</template>
</div>
</template>
<script>
export default {
name: "AddVehicle",
data() {
return {
formLoading: false,
freqTableData: [],
snForm: {},
};
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!