Commit 310278b0 by 胡悦

Merge branch 'develop' into 'master'

v1.6.0版本已上线,需合并代码到主干

See merge request !7
2 parents cb572124 c7f50bd3
//常量定义
//车辆用途
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>围栏列表</h1>
<div class="m-b-md title_tips">用于统计和展示设备的围栏关联信息(仅针对有线设备)</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item>
<div class="pre_select_box">
<el-select v-model="searchForm.timeType" class="small_select mr5" placeholder="请选择">
<el-option label="创建时间" value="1"></el-option>
<el-option label="监控时间" value="2"></el-option>
</el-select>
<el-date-picker v-model="searchForm.timeDate" class="data_picker" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="searchForm.enableStatus" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in FENCE_TYPE_LIST" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="监控类型:">
<el-select v-model="searchForm.triggerType" 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-input placeholder="设备号 | 姓名 | 车架号|围栏名称" class="long_input" maxlength="20" v-model.trim="searchForm.term">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList(1)">搜索</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>
<div>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="addFence()">新增围栏</el-button>
<el-button type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<div class="table_box">
<el-table class="el_table" border size="small" :data="tableData" v-loading="loading">
<el-table-column label="围栏名称" prop="fenceName" show-overflow-tooltip></el-table-column>
<el-table-column label="监控类型" prop="triggerType" show-overflow-tooltip></el-table-column>
<el-table-column label="监控时间" prop="timeType" show-overflow-tooltip width="160">
<template slot-scope="{row}">{{row.startTime}}~{{row.endTime}}</template>
</el-table-column>
<el-table-column label="关联设备数" prop="linkDeviceCnt" show-overflow-tooltip></el-table-column>
<el-table-column label="报警设备数" prop="alarmDeviceCnt" show-overflow-tooltip></el-table-column>
<el-table-column label="状态" prop="enableStatusDesc" show-overflow-tooltip></el-table-column>
<el-table-column label="报警次数" prop="alarmCnt" show-overflow-tooltip></el-table-column>
<el-table-column label="最新报警时间" prop="lastAlarmDate" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastAlarmDate||'--'}}</template>
</el-table-column>
<el-table-column label="创建时间" prop="createdDate" show-overflow-tooltip></el-table-column>
<el-table-column label="创建人" prop="creator" show-overflow-tooltip>
<template slot-scope="{row}">{{row.creator||'--'}}</template>
</el-table-column>
<el-table-column label="操作" prop="creator" width="200" fixed="right">
<template slot-scope="{row}">
<el-link type="primary" class="el_link" :underline="false" @click="updateStatus(row)">{{row.enableStatus == 1?'关闭':'开启'}}</el-link>
<el-link type="primary" class="el_link" :underline="false" @click="addFence(row)">编辑</el-link>
<el-link type="primary" class="el_link" :underline="false" @click="removeFence(row)">删除</el-link>
<el-link type="primary" class="el_link" :underline="false" @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="pageNumber" :page-size.sync="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- <glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}" width="170">
<el-link type="primary" :underline="false" @click="updateStatus(scope)">{{scope.enableStatus == 1?'关闭':'开启'}}</el-link>
<el-link type="primary" :underline="false" @click="lookDetail(scope)">编辑</el-link>
<el-link type="primary" :underline="false" @click="lookDetail(scope)">删除</el-link>
<el-link type="primary" :underline="false" @click="lookDetail(scope)">查看预警</el-link>
</div>
</glsx-table> -->
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table";
import { GET_FAKEOFFLINE_LIST, GET_FAKEOFFLINE_EXPORT } from "services/report";
import {
EXPORT_FENCE_INFO,
STARTSTOP_FENCE_INFO,
DELETE_FENCE_INFO,
GET_FENCE_LIST,
} from "@/services/fence";
import { deepClone, showToast, showModal, downFileByPath } from "@/utils/util";
import moment from "moment";
import { FENCE_MONITOR_LIST, FENCE_TYPE_LIST } from "@/common/constants";
export default {
components: {
GlsxTable,
},
data() {
return {
searchForm: { timeType: "1", enableStatus: "", triggerType: "" },
tableData: [],
pageTotal: 0,
pageSize: 10,
pageNumber: 1,
pageSizes: [10, 20, 30, 40],
dloading: false,
showPopover: false,
loading: false,
FENCE_MONITOR_LIST,
FENCE_TYPE_LIST,
};
},
mounted() {
this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let o = oParams.timeDate;
if (o && o.length > 0) {
oParams.beginDate = o[0];
oParams.endDate = o[1];
}
delete oParams.timeDate;
return oParams;
},
// 获取列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || 1;
this.loading = true;
if (current) {
this.pageNumber = current;
}
GET_FENCE_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) {
let path = `/trialRun#/alarmCenter/fence`;
let endPath = `${path}?fenceId=${row.id}&name=${row.fenceName}`
this.$root.parentCommon.setBreadCrumbs(path);
history.pushState({}, endPath, endPath);
//this.$router.push({ path: path, query: { fenceId: row.id,name:row.name } });
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
EXPORT_FENCE_INFO(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
downFileByPath(res.data);
//window.open(res.data);
});
},
// 重置
rest() {
this.searchForm = { timeType: "1", enableStatus: "", triggerType: "" };
this.pageSize = 10;
this.pageNumber = 1;
this.getList();
},
// 开启关闭
updateStatus(row) {
let _this = this;
let _typeList = {
1: "关闭",
0: "开启",
};
showModal({
message: `确定${_typeList[row.enableStatus]}'${row.fenceName}'吗?`,
showCancelButton: true,
type: "warning",
success: function () {
let oParams = {};
oParams.fenceId = row.id;
STARTSTOP_FENCE_INFO(oParams).then((res) => {
if (res.code == 200) {
showToast({
message: `${_typeList[row.enableStatus]}成功`,
type: "success",
});
_this.getList();
}
});
},
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 删除围栏
removeFence(row) {
let _this = this;
showModal({
message: `确定删除${row.fenceName}吗?`,
showCancelButton: true,
type: "warning",
success: function () {
let oParams = {};
oParams.fenceId = row.id;
DELETE_FENCE_INFO(oParams).then((res) => {
if (res.code == 200) {
showToast({
message: "删除成功",
type: "success",
});
_this.getList();
}
});
},
});
},
// 新增围栏
addFence(row) {
let path = `/oEshield#/monitor/addFence`;
if (row) {
path = `/oEshield#/monitor/addFence?id=${row.id}`;
}
history.pushState({}, path, path);
//window.open(path);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/common.scss";
.table_box {
margin: 10px 0;
}
</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
...@@ -3,16 +3,67 @@ ...@@ -3,16 +3,67 @@
<div class="container"> <div class="container">
<!-- 搜索区域 开始 --> <!-- 搜索区域 开始 -->
<search-form class="searchTop border-shadow vehicle inline" :formModel="searchForm" :formList="vehicleFormList" @input="onInput"> <!-- <search-form class="searchTop border-shadow vehicle inline" :formModel="searchForm" :formList="vehicleFormList" @input="onInput">
<span class="sinline-b" slot="form-slot"> <span class="sinline-b" slot="form-slot">
<el-button type="primary" :size="btn_size" icon="el-icon-search" ref="serchButton" :id="vehicleTableParams.btnId">搜索</el-button> <el-button type="primary" :size="btn_size" icon="el-icon-search" ref="serchButton" :id="vehicleTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button> <el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
</span> </span>
</search-form> </search-form> -->
<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="车主姓名|车架号|设备号|车型"></el-input>
</el-form-item>
<el-form-item label="设备类型:">
<el-select v-model="searchForm.deviceType" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option label="有线" value="1"></el-option>
<el-option label="无线" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="激活时间:">
<el-date-picker v-model="searchForm.offDate" type="daterange" class="data_picker" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="showGlsxOranization" 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.vehicleType" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in VEHICLE_TAG_LIST" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆用途:">
<el-select v-model="searchForm.vehicleUsages" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in VEHICLE_USE_LIST" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备状态:">
<el-select v-model="searchForm.deviceState" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in VEHICLE_ONLINE_STATUS" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="btn_size" icon="el-icon-search" @click="getList()">搜索</el-button>
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end --> <!-- 搜索区域 end -->
<!-- 操作按钮区域 开始 --> <!-- 操作按钮区域 开始 -->
<h3>车辆列表 <div class="links_group">
<span>车辆列表</span>
<div class="pull-right"> <div class="pull-right">
<template> <template>
<auth-button name="新增车辆" type="primary" :size="btn_size" @click.native="btnClick('create')">新增车辆</auth-button> <auth-button name="新增车辆" type="primary" :size="btn_size" @click.native="btnClick('create')">新增车辆</auth-button>
...@@ -20,52 +71,93 @@ ...@@ -20,52 +71,93 @@
<el-button v-for="item in authList" :key="item.id" :type="item.type" :size="btn_size" @click="btnClick(item.pType)">{{item.name}}</el-button> <el-button v-for="item in authList" :key="item.id" :type="item.type" :size="btn_size" @click="btnClick(item.pType)">{{item.name}}</el-button>
</template> </template>
</div> </div>
</h3> </div>
<!-- 操作按钮区域 end --> <!-- 操作按钮区域 end -->
<!-- 列表数据 开始 --> <!-- 列表数据 开始 -->
<basic-table ref="vehicleForm" :beforeSearchFn="beforeSearchFn" :tableParams="vehicleTableParams" :getListApi="getListApi" :searchForm="searchForm" @dataFinished="tableDataFinished" :hasNum="false"> <div class="table_box">
<span slot="table-button" slot-scope="scope"> <el-table class="el_table" :data="dataList" border size="small" v-loading="tableLoading">
<el-table-column label="业务工单号" prop="bizOrderNo" show-overflow-tooltip>
<template v-if="scope.scope.permitType == 'r'"> <template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
<!-- <el-button type="view" size="mini" plain @click="btnClick('view', scope.scope)">查看</el-button> --> </el-table-column>
<el-link type="primary" size="mini" plain @click="btnClick('view', scope.scope)">查看</el-link> <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="creator" show-overflow-tooltip>
<template slot-scope="{row}">{{row.creator||'--'}}</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="deviceTypeStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.deviceTypeStr||'--'}}</template>
</el-table-column>
<el-table-column label="车型" prop="modelName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.modelName||'--'}}</template>
</el-table-column>
<el-table-column label="车辆标签" prop="vehicleTypeStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vehicleTypeStr||'--'}}</template>
</el-table-column>
<el-table-column label="车辆用途" prop="vehicleUsageStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vehicleUsageStr||'--'}}</template>
</el-table-column>
<el-table-column label="激活时间" prop="activateTime" show-overflow-tooltip></el-table-column>
<el-table-column label="设备状态" prop="deviceStateStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.deviceStateStr||'--'}}</template>
</el-table-column>
<el-table-column label="特殊状态" prop="specialState" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" prop="vehicleUsageStr" width="170">
<template slot-scope="{row}">
<template v-if="row.permitType == 'r'">
<el-link type="primary" size="mini" plain @click="btnClick('view', row)">查看</el-link>
</template> </template>
<template v-else> <template v-else>
<el-button v-for="(j, idx) in vehicleTableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" size="mini" plain @click="btnClick(j.pType, scope.scope)">{{j.name}}</el-button> <auth-button v-for="(j, idx) in btnList" :name="j.name" :key="idx" :type="j.type || 'text'" size="mini" plain @click.native="btnClick(j.pType, row)">{{j.name}}</auth-button>
<el-button v-if="scope.scope.sns" type="text" size="mini" @click="btnClick('unbind', scope.scope)">解绑</el-button> <el-button v-if="row.sns" type="text" size="mini" @click="btnClick('unbind', row)">解绑</el-button>
<!-- <el-button v-if="scope.scope.adjFreq === 1" type="text" size="mini" @click="btnClick('freq', scope.scope)">一键调频</el-button> --> <!-- <el-button v-if="scope.scope.adjFreq === 1" type="text" size="mini" @click="btnClick('freq', scope.scope)">一键调频</el-button> -->
<el-dropdown v-if="scope.scope.adjFreq" @command="handleCommand" style="margin-left:5px"> <el-button type="text" size="mini" @click="gotoMonitor(row)">监控</el-button>
<el-dropdown v-if="row.adjFreq" @command="handleCommand" style="margin-left:5px">
<el-button size="mini"> <el-button size="mini">
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="scope.scope.adjFreq===1" :command="getCommand('freq', scope.scope.sn, scope.scope.enableFre)">一键调频</el-dropdown-item> <el-dropdown-item v-if="row.adjFreq===1" :command="getCommand('freq', row.sn, row.enableFre)">一键调频</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</template>
</span> </el-table-column>
</basic-table> </el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="pageNumber" :page-size.sync="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 列表数据 end --> <!-- 列表数据 end -->
<!-- 新增、编辑、查看弹框 开始 --> <!-- 新增、编辑、查看弹框 开始 -->
<basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')"> <basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" :loading="ajaxLoading" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')">
<slot> <slot>
<div class="dialog_content" v-loading="formLoading"> <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"> <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> <h2 class="h2_title">设备信息</h2>
<!-- 新增 --> <!-- 新增 -->
<template v-if="dialogType == 'create'"> <template v-if="dialogType != 'view'">
<el-form-item label="" class="long_form_item" v-for="(item, index) in snForm.deviceInfoDtos" :key="index" label-width="0"> <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"> <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-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-input v-model="item.sn" :disabled="item.disabled"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备型号:" class="is-required"> <el-form-item label="设备型号:" class="is-required">
<el-input v-model="item.deviceClassifyName" disabled></el-input> <el-input v-model="item.deviceClassifyName" disabled></el-input>
</el-form-item> </el-form-item>
<div class="icon_box">
<auth-button type="primary" class="btn" size="mini" v-show="item.edit && dialogType != 'create'" pid="vehicle_vin_edit" @click.native="editDevince(item,index)">编辑</auth-button>
<el-button v-show="!item.edit && dialogType != 'create'" class="btn" @click="editDevince(item,index)">取消</el-button>
</div>
<div class="icon_box" v-if="dialogType == 'create'"> <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 && index != 0" @click="removeDevice(index)" class="el-icon-remove-outline"></i>
<i v-show="!isViewMode" @click="addDevice" class="el-icon-circle-plus-outline"></i> <i v-show="!isViewMode" @click="addDevice" class="el-icon-circle-plus-outline"></i>
...@@ -74,8 +166,8 @@ ...@@ -74,8 +166,8 @@
</el-form-item> </el-form-item>
</template> </template>
<!-- 新增 --> <!-- 新增 -->
<!-- 编辑 --> <!-- 查看 -->
<template v-if="dialogType != 'create'"> <template v-if="dialogType == 'view'">
<el-form-item label="" class="long_form_item" v-for="(item, index) in snForm.deviceInfoDtos" :key="index" label-width="0"> <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"> <div class="el_item_inner el_sn_list">
<el-form-item label="设备SN号" class="is-required"> <el-form-item label="设备SN号" class="is-required">
...@@ -87,7 +179,7 @@ ...@@ -87,7 +179,7 @@
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
<!-- 编辑 --> <!-- 查看 -->
<h2 class="h2_title">车主信息</h2> <h2 class="h2_title">车主信息</h2>
<el-form-item label="姓名:" prop="ownerName"> <el-form-item label="姓名:" prop="ownerName">
...@@ -109,7 +201,7 @@ ...@@ -109,7 +201,7 @@
<el-form-item label="车架号:" prop="vin" class="long_form_item"> <el-form-item label="车架号:" prop="vin" class="long_form_item">
<div class="el_item_inner"> <div class="el_item_inner">
<el-input v-model="snForm.vin" class="a_input" maxlength="17" clearable :disabled="vinEdit && dialogType != 'create'"></el-input> <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> <auth-button type="primary" class="btn" size="mini" v-show="vinEdit && dialogType != 'create'" pid="vehicle_vin_edit" @click.native="vinEdit = !vinEdit">编辑</auth-button>
<el-button v-show="!vinEdit" class="btn" @click="vinEdit = !vinEdit">取消</el-button> <el-button v-show="!vinEdit" class="btn" @click="vinEdit = !vinEdit">取消</el-button>
</div> </div>
</el-form-item> </el-form-item>
...@@ -251,7 +343,8 @@ import { VEHICLE_API } from "@/config/config"; ...@@ -251,7 +343,8 @@ import { VEHICLE_API } from "@/config/config";
import store from "@/store"; import store from "@/store";
import freqModal from "./freqModal"; import freqModal from "./freqModal";
import { Validator } from "@/utils/validator"; import { Validator } from "@/utils/validator";
import { deepClone } from "@/utils/util"; import { deepClone, showToast } from "@/utils/util";
import { VEHICLE_ONLINE_STATUS } from "@/common/constants";
import { import {
getVehicleList, getVehicleList,
// getSpecialShopList, // getSpecialShopList,
...@@ -276,7 +369,14 @@ import { ...@@ -276,7 +369,14 @@ import {
import { getOrgTree } from "services/common"; import { getOrgTree } from "services/common";
import AuthButton from "@/components/auth-button"; import AuthButton from "@/components/auth-button";
import moment from "moment"; import moment from "moment";
import GlsxOrganization from "@/components/glsx-organization";
import { VEHICLE_USE_LIST, VEHICLE_TAG_LIST } from "@/common/constants";
export default { export default {
components: {
freqModal,
AuthButton,
GlsxOrganization,
},
data() { data() {
const _this = this; const _this = this;
let checkShopName = (rule, vaule, cb) => { let checkShopName = (rule, vaule, cb) => {
...@@ -293,6 +393,7 @@ export default { ...@@ -293,6 +393,7 @@ export default {
let sn = this.snForm.deviceArr[i].sn; let sn = this.snForm.deviceArr[i].sn;
if (this.snForm.deviceArr[i].disabled) return cb(); if (this.snForm.deviceArr[i].disabled) return cb();
if (sn == "") { if (sn == "") {
this.snForm.deviceArr[i].deviceType = "";
cb(new Error("请输入设备号")); cb(new Error("请输入设备号"));
} }
if (sn) { if (sn) {
...@@ -307,6 +408,7 @@ export default { ...@@ -307,6 +408,7 @@ export default {
}); });
cb(); cb();
} else { } else {
this.snForm.deviceArr[i].deviceType = "";
cb(new Error(res.message)); cb(new Error(res.message));
} }
}); });
...@@ -319,205 +421,10 @@ export default { ...@@ -319,205 +421,10 @@ export default {
} }
}; };
return { return {
VEHICLE_USE_LIST,
VEHICLE_TAG_LIST,
searchForm: {}, searchForm: {},
vehicleFormList: [
{
label: "关键字",
type: "input",
inputType: "text",
prop: "keywords",
width: "360",
placeholder: "车主姓名|车架号|设备号|车型",
},
{
label: "设备类型",
type: "select",
prop: "deviceType",
placeholder: "请选择",
options: [
{
label: "全部",
value: "",
},
{
label: "有线",
value: "1",
},
{
label: "无线",
value: "0",
},
],
},
/* {
label: "设备状态",
type: 'select',
prop: 'deviceState',
placeholder: '请选择',
class: 'unvisible',
options: [{
label: '全部',
value: ''
}, {
label: '行驶中',
value: '0'
}, {
label: '静止',
value: '1'
}, {
label: '离线',
value: '2'
}, {
label: '在线',
value: '3'
}]
}, */
{
label: "激活时间",
type: "daterange",
dateType: "day",
prop: "date",
placeholder: "请选择年月",
selectStyle: "width:360px",
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date(_this.date).getTime();
},
},
},
{
label: "车辆标签",
type: "select",
prop: "vehicleType",
placeholder: "请选择",
options: [
{
label: "全部",
value: "",
},
{
label: "试驶车 ",
value: "1",
},
{
label: "服务车",
value: "3",
},
{
label: "代步车",
value: "4",
},
{
label: "救援车",
value: "5",
},
{
label: "办公车",
value: "6",
},
{
label: "其他",
value: "7",
},
],
},
{
label: "车辆用途",
type: "select",
prop: "vehicleUsages",
placeholder: "请选择",
options: [
{
label: "全部",
value: "",
},
{
label: "专属用途",
value: "1",
},
{
label: "非专属用途",
value: "2",
},
],
},
],
vehicleTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableColumns: [
{
label: "业务工单号",
prop: "bizOrderNo",
},
{
label: "车主姓名",
prop: "ownerName",
},
{
label: "车架号",
prop: "vin",
width: 150,
},
{
label: "设备号",
prop: "sn",
width: 110,
},
{
label: "设备类型",
prop: "deviceTypeStr",
},
{
label: "车型",
prop: "modelName",
width: 150,
},
{
label: "车辆标签",
prop: "vehicleTypeStr",
width: 100,
},
{
label: "车辆用途",
prop: "vehicleUsageStr",
width: 100,
},
{
label: "激活时间",
prop: "activateTime",
width: 160,
},
{
label: "设备状态",
prop: "deviceStateStr",
},
{
label: "特殊状态",
prop: "specialState",
width: 110,
},
],
tableOption: {
width: 170,
btnList: [
{
name: "编辑",
pType: "edit",
},
{
name: "删除",
pType: "delete",
},
{
name: "查看",
pType: "view",
},
],
align: "left",
},
},
getListApi: getVehicleList, getListApi: getVehicleList,
authList: [ authList: [
// { // {
...@@ -880,12 +787,32 @@ export default { ...@@ -880,12 +787,32 @@ export default {
dialogType: "", dialogType: "",
vinEdit: true, // 编辑车辆是否可以编辑车架号 vinEdit: true, // 编辑车辆是否可以编辑车架号
btn_size: "mini", btn_size: "mini",
}; showGlsxOranization: false,
pageSize: 10,
pageNumber: 1,
pageSizes: [10, 20, 30, 40],
pageTotal: 0,
dataList: [],
tableLoading: false,
btnList: [
{
name: "编辑",
pType: "edit",
}, },
components: { {
freqModal, name: "删除",
AuthButton, pType: "delete",
},
{
name: "查看",
pType: "view",
},
],
VEHICLE_ONLINE_STATUS,
ajaxLoading: false,
};
}, },
watch: { watch: {
filterText(val) { filterText(val) {
this._timeout && clearTimeout(this._timeout); this._timeout && clearTimeout(this._timeout);
...@@ -899,20 +826,9 @@ export default { ...@@ -899,20 +826,9 @@ export default {
this.getModels(); this.getModels();
resolve(); resolve();
}); });
}, },
mounted() { mounted() {
/* dictInfo("trialdrive_vehicle_model").then((res) => {
this.vehicleData.find((item) => item.prop == "modelId").options =
res.data;
// this.vehicleDefalutData.find((item) => item.prop == "modelId").options =
// res.data;
});
dictInfo("trialdrive_vehicle_config").then((res) => {
this.vehicleData.find((item) => item.prop == "configId").options =
res.data;
// this.vehicleDefalutData.find((item) => item.prop == "configId").options =
// res.data;
}); */
let _this = this; let _this = this;
let o = history.state; let o = history.state;
if (o.vin) { if (o.vin) {
...@@ -925,6 +841,7 @@ export default { ...@@ -925,6 +841,7 @@ export default {
_this.getMenuPath(); _this.getMenuPath();
}); });
} }
this.getList();
}, },
methods: { methods: {
...@@ -944,8 +861,10 @@ export default { ...@@ -944,8 +861,10 @@ export default {
}); });
}, },
refresh() { refresh() {
this.pageSize = 10;
this.pageNumber = 1;
this.searchForm = {}; this.searchForm = {};
this.$refs.vehicleForm.refreshTable(); this.getList();
}, },
// 按钮操作事件 // 按钮操作事件
...@@ -980,11 +899,13 @@ export default { ...@@ -980,11 +899,13 @@ export default {
this.vehicleForm = {}; this.vehicleForm = {};
this.vehicleData = _arr; this.vehicleData = _arr;
} }
if (this.$refs.vehicleRuleForm) if (this.$refs.vehicleRuleForm) {
this.$refs.vehicleRuleForm.$children[0].clearValidate(); this.$refs.vehicleRuleForm.$children[0].clearValidate();
}
//this.snForm.deviceArr = [{ sn: "", deviceType: "" }]; //this.snForm.deviceArr = [{ sn: "", deviceType: "" }];
//this.snForm.deviceInfoDtos = [{}]; //this.snForm.deviceInfoDtos = [{}];
this.snForm = {};
this.$set(this.snForm, "deviceInfoDtos", [ this.$set(this.snForm, "deviceInfoDtos", [
{ sn: "", deviceClassifyName: "" }, { sn: "", deviceClassifyName: "" },
]); ]);
...@@ -1010,7 +931,9 @@ export default { ...@@ -1010,7 +931,9 @@ export default {
getVehicleInfo({ id: scope.id }).then((res) => { getVehicleInfo({ id: scope.id }).then((res) => {
const { code, data } = res; const { code, data } = res;
if (code == 200) { if (res.code != 200) {
return false;
}
this.vehicleForm.id = scope.id; this.vehicleForm.id = scope.id;
data.carIds = []; data.carIds = [];
if (data.brandId) { if (data.brandId) {
...@@ -1021,11 +944,14 @@ export default { ...@@ -1021,11 +944,14 @@ export default {
data.typeId || data.modelId, data.typeId || data.modelId,
]; ];
} }
data.deviceInfoDtos.map((k) => {
k.edit = true;
k.disabled = true;
return k;
});
this.snForm = { ...data }; this.snForm = { ...data };
console.log(this.snForm); console.log(this.snForm);
this.formLoading = false; this.formLoading = false;
}
}); });
this.freqTableData = []; this.freqTableData = [];
} }
...@@ -1085,7 +1011,8 @@ export default { ...@@ -1085,7 +1011,8 @@ export default {
type: "success", type: "success",
message: "删除成功!", message: "删除成功!",
}); });
this.$refs.vehicleForm.refreshTable(); //this.$refs.vehicleForm.refreshTable();
this.getList();
} else { } else {
this.$message({ this.$message({
message, message,
...@@ -1108,7 +1035,8 @@ export default { ...@@ -1108,7 +1035,8 @@ export default {
type: "success", type: "success",
message: "解绑成功!", message: "解绑成功!",
}); });
this.$refs.vehicleForm.refreshTable(); //this.$refs.vehicleForm.refreshTable();
this.getList();
} else { } else {
this.$message({ this.$message({
message, message,
...@@ -1157,6 +1085,7 @@ export default { ...@@ -1157,6 +1085,7 @@ export default {
// 新增车辆、编辑车辆 // 新增车辆、编辑车辆
handleConfirm(type) { handleConfirm(type) {
let _this = this;
switch (type) { switch (type) {
case "create": case "create":
//console.log(this.vehicleForm, this.vehicleData); //console.log(this.vehicleForm, this.vehicleData);
...@@ -1165,11 +1094,21 @@ export default { ...@@ -1165,11 +1094,21 @@ export default {
//params.deviceInfoDtos = arr[1]; //params.deviceInfoDtos = arr[1];
let api = addNewVehicle; let api = addNewVehicle;
if (params.id) api = updateNewVehicle; if (params.id) {
api(params).then((res) => { api = updateNewVehicle;
}
_this.ajaxLoading = true;
api(params)
.then((res) => {
_this.ajaxLoading = false;
const { code, message } = res; const { code, message } = res;
if (code == 200) { if (code != 200) {
this.$message({ showToast({
message: message,
});
return false;
}
showToast({
message: "操作成功", message: "操作成功",
type: "success", type: "success",
}); });
...@@ -1177,10 +1116,13 @@ export default { ...@@ -1177,10 +1116,13 @@ export default {
this.snForm = {}; this.snForm = {};
this.dialogType = ""; this.dialogType = "";
this.$refs.snForm.clearValidate(); this.$refs.snForm.clearValidate();
this.$refs.serchButton.$el.click(); //this.$refs.serchButton.$el.click();
this.getList();
//this.$refs.vehicleForm.refreshTable(); //this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable(); //this.$refs.snForm.refreshTable();
} })
.catch(() => {
_this.ajaxLoading = false;
}); });
}); });
break; break;
...@@ -1211,6 +1153,7 @@ export default { ...@@ -1211,6 +1153,7 @@ export default {
this.importing = false; this.importing = false;
if (res.data.code == 200) { if (res.data.code == 200) {
this.exportData = res.data.data; this.exportData = res.data.data;
this.getList();
} else { } else {
this.$message({ this.$message({
message: res.data.message, message: res.data.message,
...@@ -1266,6 +1209,13 @@ export default { ...@@ -1266,6 +1209,13 @@ export default {
} }
delete params.carIds; delete params.carIds;
//deviceInfoDtos
params.deviceInfoDtos.map((k) => {
delete k.edit;
delete k.disabled;
return k;
});
//params.modelId = params.typeId; //params.modelId = params.typeId;
delete params.deviceArr; delete params.deviceArr;
...@@ -1293,6 +1243,7 @@ export default { ...@@ -1293,6 +1243,7 @@ export default {
}); });
}); });
}, },
// 关闭弹框
handleClose(id) { handleClose(id) {
this.btnClick(id); this.btnClick(id);
}, },
...@@ -1569,9 +1520,6 @@ export default { ...@@ -1569,9 +1520,6 @@ export default {
} else { } else {
_list.splice(idx + 2, 0, _models); _list.splice(idx + 2, 0, _models);
} }
//this.changeCarBrand(data.brandId)
//this.changeCarModel(data.seriesId, _series)
} }
return _list; return _list;
...@@ -1589,26 +1537,18 @@ export default { ...@@ -1589,26 +1537,18 @@ export default {
}, },
// 查看监控 // 查看监控
gotoMonitor() { gotoMonitor(row) {
console.log(this.snForm); console.log(this.snForm);
/* let snO = { let o = row || this.snForm;
name: this.vehicleForm.name, let path = `/oEshield#/monitor/monitor`;
standNo: this.vehicleForm.vin, this.$root.parentCommon.setBreadCrumbs(path);
sn: this.vehicleForm.trackInfo.sn, window.open(`${path}?vin=${o.vin}`);
sourceType: this.vehicleForm.trackInfo.source === 0?'无线':'有线',
source: this.vehicleForm.trackInfo.source // history.pushState(
} */ // null,
//this.$router.push({ name: 'monitor', params: { snArr: [snO], mode: 'monitor' }}) // "name",
// "/oEshield#/monitor/monitor?vin=" + this.snForm.vin
//let routeData = this.$router.resolve({ path: '../oEshield#/monitor/monitor', query: { snArr: JSON.stringify([snO])}}); // );
// window.open(routeData.href, '_blank');
//location.href = '/trialRun#/vehicleSubmit'//'/oEshield#/monitor/monitor?vin='+this.vehicleForm.vin
history.pushState(
null,
"name",
"/oEshield#/monitor/monitor?vin=" + this.snForm.vin
);
}, },
// 手动获取二级菜单权限 // 手动获取二级菜单权限
...@@ -1666,7 +1606,12 @@ export default { ...@@ -1666,7 +1606,12 @@ export default {
} }
let i = rule.field.split(".")[1]; let i = rule.field.split(".")[1];
verifydevice({ sn: value }).then((res) => { let oParams = {};
oParams.sn = value;
if (_this.snForm.id) {
oParams.vehicleId = _this.snForm.id;
}
verifydevice(oParams).then((res) => {
if (res.code == 200) { if (res.code == 200) {
checkSn({ sn: value }).then((res) => { checkSn({ sn: value }).then((res) => {
if (res.data) { if (res.data) {
...@@ -1687,6 +1632,68 @@ export default { ...@@ -1687,6 +1632,68 @@ export default {
chooseFiles() { chooseFiles() {
this.$refs.importInputFile.click(); this.$refs.importInputFile.click();
}, },
// 监听树
onChange(e) {
this.showGlsxOranization = 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;
}
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let n = oParams.offDate;
if (n && n.length > 0) {
oParams.activateTimeStart = n[0];
oParams.activateTimeEnd = n[1];
}
delete oParams.dateRange;
delete oParams.orgName;
delete oParams.offDate;
oParams.pageSize = this.pageSize;
oParams.pageNumber = this.pageNumber;
return oParams;
},
// 获取列表
getList() {
let _this = this;
let oParams = _this.getParams();
_this.tableLoading = true;
getVehicleList(oParams)
.then((res) => {
_this.tableLoading = false;
let obj = res.data;
_this.dataList = obj.list || [];
_this.pageTotal = obj.totalElements;
})
.catch((error) => {
_this.tableLoading = false;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 编辑设备号
editDevince(row, index) {
let list = this.snForm.deviceInfoDtos;
row.edit = !row.edit;
row.disabled = !row.disabled;
this.$set(this.snForm.deviceInfoDtos, index, row);
},
}, },
}; };
</script> </script>
...@@ -1726,6 +1733,7 @@ export default { ...@@ -1726,6 +1733,7 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/styles/hadoop.scss";
.el_form { .el_form {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!