Commit 4cd402a7 by 张晓玮

Merge branch 'v1.7.0' into 'develop'

v1.7.0版本需求已经上线,代码合并到develop

See merge request !24
2 parents c7f50bd3 4fdc5ec3
This diff could not be displayed because it is too large.
...@@ -2,40 +2,40 @@ ...@@ -2,40 +2,40 @@
//车辆用途 //车辆用途
export const VEHICLE_USE_LIST = [ export const VEHICLE_USE_LIST = [
{ {
label: "专属用途", label: '专属用途',
value: "1", value: '1',
}, },
{ {
label: "非专属用途", label: '非专属用途',
value: "2", value: '2',
}, },
] ]
// 车辆标签 // 车辆标签
export const VEHICLE_TAG_LIST = [ export const VEHICLE_TAG_LIST = [
{ {
label: "试驶车 ", label: '试驶车 ',
value: "1", value: '1',
}, },
{ {
label: "服务车", label: '服务车',
value: "3", value: '3',
}, },
{ {
label: "代步车", label: '代步车',
value: "4", value: '4',
}, },
{ {
label: "救援车", label: '救援车',
value: "5", value: '5',
}, },
{ {
label: "办公车", label: '办公车',
value: "6", value: '6',
}, },
{ {
label: "其他", label: '其他',
value: "7", value: '7',
}, },
] ]
...@@ -59,3 +59,14 @@ export const VEHICLE_ONLINE_STATUS = [ ...@@ -59,3 +59,14 @@ export const VEHICLE_ONLINE_STATUS = [
{ label: '离线', value: 2 }, { label: '离线', value: 2 },
{ label: '在线', value: 3 }, { label: '在线', value: 3 },
] ]
// 是否结清
export const SETTLEFLAGLIST = {
0: '未结清',
1: '已结清',
}
export const SETTLE_FLAG_LIST = [
{ label: '未结清', value: 0 },
{ label: '已结清', value: 1 },
]
import moment from '@/common/moment'; import moment from '@/common/moment'
// 警情中心-围栏报警 // 全部
export const fenceShortcuts = [ let allDays = {
{ text: '全部',
text: "全部",
onClick(picker) { onClick(picker) {
picker.$emit("pick", []); picker.$emit('pick', [])
}, },
}, { }
text: "今日", // 本月
let currentMonth = {
text: '本月',
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); const start = moment().add('month', 0).format('YYYY-MM') + '-01'
picker.$emit("pick", [end, end]); const end = moment().format('YYYY-MM-DD')
} picker.$emit('pick', [start, end])
}, { },
text: "昨日", }
// 今日
let currentDay = {
text: '今日',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [end, end])
},
}
// 昨日
let yesterday = {
text: '昨日',
onClick(picker) { onClick(picker) {
const start = moment() const start = moment()
.day(moment().day() - 1) .day(moment().day() - 1)
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
const end = moment() const end = moment()
.day(moment().day() - 1) .day(moment().day() - 1)
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
} }
}
// 近3天
let nearly3Days = {
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天",
// 近7天
let nearly7Days = {
text: '近7天',
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); const end = moment().format('YYYY-MM-DD')
const start = moment() const start = moment()
.day(moment().day() - 6) .day(moment().day() - 6)
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
} }
}, }
{
text: "近15天", // 近15天
let nearly15Days = {
text: '近15天',
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); const end = moment().format('YYYY-MM-DD')
const start = moment() const start = moment()
.day(moment().day() - 14) .day(moment().day() - 14)
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
}, }
}, }
{
text: "近30天", // 近30天
let nearly30Days = {
text: '近30天',
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); const end = moment().format('YYYY-MM-DD')
const start = moment() const start = moment()
.day(moment().day() - 29) .day(moment().day() - 29)
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
},
} }
] }
// 警情中心-停驶报警 // 上月
export const shutDownShortcuts = [ let lastMonth = {
{ text: '上月',
text: "全部",
onClick(picker) {
picker.$emit("pick", []);
},
},
{
text: "近3天",
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); const end = moment()
.month(moment().month() - 1)
.endOf('month')
.format('YYYY-MM-DD')
const start = moment() const start = moment()
.day(moment().day() - 2) .month(moment().month() - 1)
.format("YYYY-MM-DD"); .startOf('month')
picker.$emit("pick", [start, end]); .format('YYYY-MM-DD')
} picker.$emit('pick', [start, end])
}, },
{ }
text: "近7天",
// 上周
let lastWeek = {
text: '上周',
onClick(picker) { onClick(picker) {
const end = moment().format("YYYY-MM-DD"); let weekOfDay = parseInt(moment().format('E'))
const end = moment().subtract(weekOfDay, 'days').format('YYYY-MM-DD')
const start = moment() const start = moment()
.day(moment().day() - 6) .subtract(weekOfDay + 7 - 1, 'days')
.format("YYYY-MM-DD"); .format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
}
}, },
{ }
text: "本月",
// 本周
let currentWeek = {
text: '本周',
onClick(picker) { onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01"; const end = moment().format('YYYY-MM-DD')
const end = moment().format("YYYY-MM-DD"); const start = moment().weekday(0).format('YYYY-MM-DD')
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
},
}, },
}
// 警情中心-围栏报警
export const fenceShortcuts = [
allDays,
currentDay,
yesterday,
nearly7Days,
nearly15Days,
nearly30Days
]
// 警情中心-停驶报警
export const shutDownShortcuts = [
allDays,
nearly3Days,
nearly7Days,
currentMonth,
] ]
// 里程统计详情 // 里程统计详情
export const mileageDetailShortcuts = [ export const mileageDetailShortcuts = [
{ allDays,
text: "全部", yesterday,
onClick(picker) { currentWeek,
picker.$emit("pick", []); lastWeek,
}, currentMonth,
}, lastMonth
{ ]
text: "昨日",
onClick(picker) { // 设备激活时间
const start = moment() export const deviceActivedShortcuts = [
.day(moment().day() - 1) allDays,
.format("YYYY-MM-DD"); currentDay,
const end = moment() nearly7Days,
.day(moment().day() - 1) currentMonth,
.format("YYYY-MM-DD"); lastMonth,
picker.$emit("pick", [start, end]); nearly30Days
} ]
},
{ // 超速报警
text: "本周", export const speedShortcuts = [
onClick(picker) { allDays,
const end = moment().format("YYYY-MM-DD"); yesterday,
const start = moment().weekday(0).format("YYYY-MM-DD"); lastWeek,
picker.$emit("pick", [start, end]); currentMonth,
}, lastMonth,
}, ]
{
text: "上周", // 运营统计报表-车辆维度
onClick(picker) { export const staticReportCarShortcuts = [
let weekOfDay = parseInt(moment().format("E")); allDays,
const end = moment() yesterday,
.subtract(weekOfDay, "days") currentWeek,
.format("YYYY-MM-DD"); lastWeek,
const start = moment() currentMonth,
.subtract(weekOfDay + 7 - 1, "days") lastMonth
.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
<template> <template>
<div class="glsx_table_box"> <div class="glsx_table_box">
<el-table class="el_table" :data="tableData" border :size="size" v-loading="loading"> <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 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>
<template slot-scope="{row}">{{row[item.prop]||'--'}}</template>
</el-table-column>
<el-table-column label="操作" v-if="this.$scopedSlots.operate" width="120px"> <el-table-column label="操作" v-if="this.$scopedSlots.operate" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="operate" :scope="scope.row"></slot> <slot name="operate" :scope="scope.row"></slot>
...@@ -9,7 +11,7 @@ ...@@ -9,7 +11,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination_list"> <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" /> <el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :page-size.sync="pageSize" :page-sizes="pageSizes" :current-page.sync="currentPage" @current-change="getList" @size-change="changePageSize" />
</div> </div>
</div> </div>
</template> </template>
...@@ -73,49 +75,71 @@ export default { ...@@ -73,49 +75,71 @@ export default {
return { return {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
pageTotal:0, pageTotal: 0,
tableData:[], tableData: [],
loading:false loading: false,
}; };
}, },
created() {}, watch: {
mounted() { params: {
if (this.request) { handler: function (n, o) {
if (n) {
console.log(n);
this.getList(); this.getList();
} }
}, },
immediate: true,
},
},
created() {},
mounted() {
// if (this.request) {
// this.getList();
// }
},
methods: { methods: {
/** /**
* 每页展示 * 每页展示
*/ */
changePageSize: function (e) { changePageSize: function (e) {
this.pageSize = e; this.pageSize = e;
this.currentPage = 1;
this.getList(); this.getList();
}, },
// 获取参数 // 获取参数
getParams(current){ getParams(current) {
let oParams = {...this.params}; console.log(this.params);
let oParams = { ...this.params };
if (current || oParams.current) {
this.currentPage = current || oParams.current;
}
oParams.pageSize = this.pageSize; oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage; oParams.pageNumber = current || oParams.current || this.currentPage;
return oParams delete oParams.current;
return oParams;
}, },
// 获取列表 // 获取列表
getList(current) { getList(current) {
let request = this.request; let request = this.request;
let oParams = this.getParams(current); let oParams = this.getParams(current);
this.loading = true console.log(oParams);
request(oParams).then((res) => { this.loading = true;
this.loading = false request(oParams)
if(res.code != 200){ .then((res) => {
this.loading = false;
if (res.code != 200) {
return false; return false;
} }
let {data:{list,totalElements}} = res; let {
this.tableData = list||[] data: { list, totalElements },
this.pageTotal = totalElements } = res;
}).catch(error => { this.tableData = list || [];
this.loading = false this.pageTotal = totalElements;
})
.catch((error) => {
this.loading = false;
}); });
}, },
...@@ -125,6 +149,13 @@ export default { ...@@ -125,6 +149,13 @@ export default {
this.currentPage = 1; this.currentPage = 1;
this.getList(); this.getList();
}, },
// 重置分页参数
restParams() {
// this.pageSize = 10;
this.currentPage = 1;
this.pageSize = 10
},
}, },
}; };
</script> </script>
......
...@@ -31,6 +31,7 @@ function render({ data = {} , container } = {}) { ...@@ -31,6 +31,7 @@ function render({ data = {} , container } = {}) {
routes, routes,
}); });
store.state.baseURL = data.baseURL; store.state.baseURL = data.baseURL;
Vue.prototype.$hasPermission = data.common.hasPermission
instance = new Vue({ instance = new Vue({
router, router,
store, store,
......
...@@ -56,3 +56,14 @@ export const GET_FENCEALARM_LIST = (params) => { ...@@ -56,3 +56,14 @@ export const GET_FENCEALARM_LIST = (params) => {
export const ALARM_FENCEALARM_EXPORT = (params) => { export const ALARM_FENCEALARM_EXPORT = (params) => {
return request(params, "/alarmcenternew/fencealarm/export"); return request(params, "/alarmcenternew/fencealarm/export");
} }
// 警情中心-超速报警-获取列表
export const GET_SPEEDING_SEARCH = (params) => {
return request(params, "/alarmcenternew/speeding/search");
}
// 警情中心-超速报警-获取列表-导出excel
export const GET_SPEEDING_EXPORT = (params) => {
return request(params, "/alarmcenternew/speeding/export");
}
...@@ -5,18 +5,18 @@ import store from "@/store"; ...@@ -5,18 +5,18 @@ import store from "@/store";
const BASEURL = store.state.baseURL const BASEURL = store.state.baseURL
// 获取报表列表 // 获取报表列表
function getList (params) { function getList(params) {
const url = REPORT_API.REPORT_SEARCH const url = REPORT_API.REPORT_SEARCH
return request(params, url) return request(params, url)
} }
// 获取报表列表 // 获取报表列表
function getYears (params) { function getYears(params) {
const url = REPORT_API.REPORT_YEARS const url = REPORT_API.REPORT_YEARS
return request(params, url) return request(params, url)
} }
function getOutStoreList (params) { function getOutStoreList(params) {
return request(params, '/trialdrive/notinstorereport/search') return request(params, '/trialdrive/notinstorereport/search')
} }
...@@ -138,4 +138,26 @@ export const EXPORT_BATTERY_LIST = params => { ...@@ -138,4 +138,26 @@ export const EXPORT_BATTERY_LIST = params => {
return request(params, '/alarmcenternew/battery/export') return request(params, '/alarmcenternew/battery/export')
} }
// 报表管理-运营报表统计-获取设备维度列表
export const GET_OPEREPORT_DEVICE_SEARCH = params => {
return request(params, '/trialdrive/opereport/device/search')
}
// 报表管理-运营报表统计-设备维度列表-导出excel
export const GET_OPEREPORT_DEVICE_EXPORT = params => {
return request(params, '/trialdrive/opereport/device/export')
}
// 报表管理-运营报表统计-获取车辆维度列表
export const GET_OPEREPORT_VEHICLE_SEARCH = params => {
return request(params, '/trialdrive/opereport/vehicle/search')
}
// 报表管理-运营报表统计-获取车辆维度列表
export const GET_OPEREPORT_VEHICLE_EXPORT = params => {
return request(params, '/trialdrive/opereport/vehicle/export')
}
export { getList, getYears, getOutStoreList } export { getList, getYears, getOutStoreList }
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
} }
.small_select { .small_select {
width: 120px; width: 140px;
} }
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
line-height: 2; line-height: 2;
} }
.h2 { .h2 {
position: relative;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #666; color: #666;
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
created() { created() {
console.log(history.state); console.log(history.state);
let query = this.$route.query; let query = this.$route.query;
this.fenceId = query.fenceId || ""; // this.fenceId = query.fenceId || "";
if (query.name) { if (query.name) {
this.$set(this.searchForm, "keywords", query.name); this.$set(this.searchForm, "keywords", query.name);
} }
......
...@@ -78,6 +78,11 @@ ...@@ -78,6 +78,11 @@
<el-table-column label="最后GPS定位地址" prop="lastGpsAddress" show-overflow-tooltip width="240"> <el-table-column label="最后GPS定位地址" prop="lastGpsAddress" show-overflow-tooltip width="240">
<template slot-scope="{row}">{{row.lastGpsAddress||'--'}}</template> <template slot-scope="{row}">{{row.lastGpsAddress||'--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" prop="lastGpsAddress">
<template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookDetail(row)">常驻地</el-link>
</template>
</el-table-column>
</el-table> </el-table>
<div class="pagination_list"> <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" /> <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" />
...@@ -90,15 +95,18 @@ ...@@ -90,15 +95,18 @@
<script> <script>
import { shutDownShortcuts } from "@/common"; import { shutDownShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization"; import GlsxOrganization from "@/components/glsx-organization";
import { GET_ALARM_SHUTDOWN, ALARM_SHUTDOWN_EXPORT } from "@/services/alarmCenter"; import {
import { deepClone, showToast,downFileByPath } from "@/utils/util"; GET_ALARM_SHUTDOWN,
ALARM_SHUTDOWN_EXPORT,
} from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
export default { export default {
components: { components: {
GlsxOrganization, GlsxOrganization,
}, },
data() { data() {
return { return {
searchForm: {stayRange:2}, searchForm: { stayRange: 2 },
currentPage: 1, currentPage: 1,
pageSizes: [10, 20, 30, 40], pageSizes: [10, 20, 30, 40],
pageSize: 10, pageSize: 10,
...@@ -157,8 +165,8 @@ export default { ...@@ -157,8 +165,8 @@ export default {
oParams.pageSize = this.pageSize; oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage; oParams.pageNumber = current || this.currentPage;
this.tloading = true; this.tloading = true;
if(current){ if (current) {
this.currentPage = current this.currentPage = current;
} }
GET_ALARM_SHUTDOWN(oParams).then((res) => { GET_ALARM_SHUTDOWN(oParams).then((res) => {
this.tloading = false; this.tloading = false;
...@@ -197,10 +205,16 @@ export default { ...@@ -197,10 +205,16 @@ export default {
if (res.code != 200) { if (res.code != 200) {
return false; return false;
} }
downFileByPath(res.data) downFileByPath(res.data);
//window.open(res.data); //window.open(res.data);
}); });
}, },
// 查看常驻地
lookDetail(row) {
let path = `/oEshield#/monitor/resident?sn=${row.sn}&name=${encodeURI(row.ownerName)}&standno=${row.vin}&locationType=${row.locationType}`;
window.open(path);
},
}, },
}; };
</script> </script>
...@@ -215,7 +229,7 @@ export default { ...@@ -215,7 +229,7 @@ export default {
.el_radio_group { .el_radio_group {
vertical-align: middle; vertical-align: middle;
} }
.table_box{ .table_box {
margin-top: 0; margin-top: 0;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,22 @@ ...@@ -2,7 +2,22 @@
<div class=""> <div class="">
<div class="page_title"> <div class="page_title">
<h2 class="h2">超速报警</h2> <h2 class="h2">
<span>超速报警</span>
<el-popover placement="right-start" trigger="hover">
<div class="popover_box">
<h3 class="h3">上点时间间隔:</h3>
<p>默认为15s</p>
<h3 class="h3">超速开始时间:</h3>
<p>当连续两个上点的速度>=90km/h时,取第一个上点的上点时间作为该段超速记录的超速开始时间</p>
<h3 class="h3">超速结束时间:</h3>
<p>当连续两个上点的速度&lt;=90km/h时,取第一个上点的上点时间作为该段超速记录的超速结束时间</p>
<h3 class="h3">平均车速:</h3>
<p>即超速区间内的平均时速;平均车速 = 超速区间内所有上点的速度之和÷上点数</p>
</div>
<span class="title_tip_icon" slot="reference"><i class="el-icon-question"></i></span>
</el-popover>
</h2>
<h3 class="h3">用于统计和展示有线设备的超速报警</h3> <h3 class="h3">用于统计和展示有线设备的超速报警</h3>
</div> </div>
...@@ -10,7 +25,7 @@ ...@@ -10,7 +25,7 @@
<div class="search_box"> <div class="search_box">
<el-form :inline="true" size="small"> <el-form :inline="true" size="small">
<el-form-item label="关键字"> <el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 车架号 | 姓名 | 工单号" maxlength="20"></el-input> <el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 车架号 | 姓名 | 业务工单号" maxlength="20"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆归属:"> <el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click"> <el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
...@@ -45,8 +60,8 @@ ...@@ -45,8 +60,8 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<div class="table_box"> <div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading"> <el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="工单号" prop="bizOrderNo" show-overflow-tooltip> <el-table-column label="业务工单号" prop="workOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template> <template slot-scope="{row}">{{row.workOrderNo||'--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip> <el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template> <template slot-scope="{row}">{{row.ownerName||'--'}}</template>
...@@ -55,10 +70,18 @@ ...@@ -55,10 +70,18 @@
<el-table-column label="车架号" prop="vin" show-overflow-tooltip> <el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template> <template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="超速开始时间" prop="alarmTime" show-overflow-tooltip></el-table-column> <el-table-column label="超速开始时间" prop="beginTime" show-overflow-tooltip>
<el-table-column label="超速结束时间" prop="alarmTime" show-overflow-tooltip></el-table-column> <template slot-scope="{row}">{{row.beginTime||'--'}}</template>
<el-table-column label="超速时长" prop="duration" show-overflow-tooltip></el-table-column> </el-table-column>
<el-table-column label="平均车速" prop="fenceName" show-overflow-tooltip></el-table-column> <el-table-column label="超速结束时间" prop="endTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.endTime||'--'}}</template>
</el-table-column>
<el-table-column label="超速时长" prop="durationFormat" show-overflow-tooltip>
<template slot-scope="{row}">{{row.durationFormat||'--'}}</template>
</el-table-column>
<el-table-column label="平均车速" prop="averageSpeed" show-overflow-tooltip>
<template slot-scope="{row}">{{(row.averageSpeed||row.averageSpeed == 0)?row.averageSpeed + 'km/h':'--'}}</template>
</el-table-column>
</el-table> </el-table>
<div class="pagination_list"> <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" /> <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" />
...@@ -69,15 +92,13 @@ ...@@ -69,15 +92,13 @@
</div> </div>
</template> </template>
<script> <script>
import moment from "moment"; import { speedShortcuts } from "@/common";
import { fenceShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization"; import GlsxOrganization from "@/components/glsx-organization";
import { import {
GET_FENCEALARM_LIST, GET_SPEEDING_EXPORT,
ALARM_FENCEALARM_EXPORT, GET_SPEEDING_SEARCH,
} from "@/services/alarmCenter"; } from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util"; import { deepClone, showToast, downFileByPath } from "@/utils/util";
import { FENCE_MONITOR_LIST } from "@/common/constants";
export default { export default {
components: { components: {
GlsxOrganization, GlsxOrganization,
...@@ -95,19 +116,15 @@ export default { ...@@ -95,19 +116,15 @@ export default {
showResult: false, showResult: false,
loading: false, loading: false,
offPickerOptions: { offPickerOptions: {
shortcuts: fenceShortcuts, shortcuts: speedShortcuts,
}, },
filterVisible: false, filterVisible: false,
orgInfo: {}, orgInfo: {},
dloading: false, dloading: false,
tloading: false, tloading: false,
FENCE_MONITOR_LIST,
fenceId: "",
}; };
}, },
created() { created() {
console.log(history.state);
this.fenceId = history.state.fenceId;
this.getList(); this.getList();
}, },
mounted() {}, mounted() {},
...@@ -126,12 +143,8 @@ export default { ...@@ -126,12 +143,8 @@ export default {
let oParams = deepClone(this.searchForm); let oParams = deepClone(this.searchForm);
let m = oParams.timeDate; let m = oParams.timeDate;
if (m && m.length > 0) { if (m && m.length > 0) {
oParams.alarmStartTime = m[0]; oParams.startTime = m[0];
oParams.alarmEndTime = m[1]; oParams.endTime = m[1];
}
if (this.fenceId) {
oParams.fenceId = this.fenceId;
} }
delete oParams.orgName; delete oParams.orgName;
...@@ -148,7 +161,7 @@ export default { ...@@ -148,7 +161,7 @@ export default {
if (current) { if (current) {
this.currentPage = current; this.currentPage = current;
} }
GET_FENCEALARM_LIST(oParams).then((res) => { GET_SPEEDING_SEARCH(oParams).then((res) => {
this.tloading = false; this.tloading = false;
let obj = res.data || {}; let obj = res.data || {};
this.tableData = obj.list || []; this.tableData = obj.list || [];
...@@ -180,7 +193,7 @@ export default { ...@@ -180,7 +193,7 @@ export default {
let oParams = this.getParams(); let oParams = this.getParams();
_this.dloading = true; _this.dloading = true;
ALARM_FENCEALARM_EXPORT(oParams).then((res) => { GET_SPEEDING_EXPORT(oParams).then((res) => {
_this.dloading = false; _this.dloading = false;
if (res.code != 200) { if (res.code != 200) {
return false; return false;
...@@ -189,23 +202,6 @@ export default { ...@@ -189,23 +202,6 @@ export default {
downFileByPath(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> </script>
......
...@@ -172,7 +172,8 @@ export default { ...@@ -172,7 +172,8 @@ export default {
// 查看详情 // 查看详情
lookDetail(row) { lookDetail(row) {
let path = `/trialRun#/alarmCenter/fence`; let path = `/trialRun#/alarmCenter/fence`;
let endPath = `${path}?fenceId=${row.id}&name=${row.fenceName}` // let endPath = `${path}?fenceId=${row.id}&name=${row.fenceName}`
let endPath = `${path}?name=${row.fenceName}`
this.$root.parentCommon.setBreadCrumbs(path); this.$root.parentCommon.setBreadCrumbs(path);
history.pushState({}, endPath, endPath); history.pushState({}, endPath, endPath);
//this.$router.push({ path: path, query: { fenceId: row.id,name:row.name } }); //this.$router.push({ path: path, query: { fenceId: row.id,name:row.name } });
......
...@@ -52,16 +52,36 @@ ...@@ -52,16 +52,36 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<div class="table_box"> <div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading"> <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="workOrderNo">
<el-table-column label="姓名" prop="ownerName"></el-table-column> <template slot-scope="{row}">{{row.workOrderNo||'--'}}</template>
<el-table-column label="车架号" prop="vin"></el-table-column> </el-table-column>
<el-table-column label="设备号" prop="sn"></el-table-column> <el-table-column label="姓名" prop="ownerName">
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="车架号" prop="vin">
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn">
<template slot-scope="{row}">{{row.sn||'--'}}</template>
</el-table-column>
<el-table-column label="设备类型" prop="deviceTypeStr"> <el-table-column label="设备类型" prop="deviceTypeStr">
<template slot-scope="{row}">{{(row.deviceTypeStr||'') + (row.sourceStr && row.deviceTypeStr?'/':'') + (row.sourceStr||'')}}</template> <template slot-scope="{row}">{{(row.deviceTypeStr||'') + (row.sourceStr && row.deviceTypeStr?'/':'') + (row.sourceStr||'')}}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否在线" prop="isOnLineStr"></el-table-column> <el-table-column label="是否在线" prop="isOnLineStr">
<el-table-column label="车辆归属" prop="shopName"></el-table-column> <template slot-scope="{row}">{{row.isOnLineStr||'--'}}</template>
<el-table-column label="激活时间" prop="activeDate"></el-table-column> </el-table-column>
<el-table-column label="车辆归属" prop="shopName">
<template slot-scope="{row}">{{row.shopName||'--'}}</template>
</el-table-column>
<el-table-column label="激活时间" prop="activeDate">
<template slot-scope="{row}">{{row.activeDate||'--'}}</template>
</el-table-column>
<el-table-column label="激活经纬度" prop="lngAndLat">
<template slot-scope="{row}">{{row.lngAndLat||'--'}}</template>
</el-table-column>
<el-table-column label="激活地址" prop="activeAddress">
<template slot-scope="{row}">{{row.activeAddress||'--'}}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180px"> <el-table-column label="操作" fixed="right" align="center" width="180px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookLocation(row)" v-if="row.gpsLng|| row.bsLng">查看激活位置</el-link> <el-link class="el_link" type="primary" @click="lookLocation(row)" v-if="row.gpsLng|| row.bsLng">查看激活位置</el-link>
...@@ -84,7 +104,7 @@ import { ...@@ -84,7 +104,7 @@ import {
GET_DEVICEACTIVE_EXPORT, GET_DEVICEACTIVE_EXPORT,
} from "@/services/report"; } from "@/services/report";
import { deepClone, showToast } from "@/utils/util"; import { deepClone, showToast } from "@/utils/util";
import store from "@/store"; import {deviceActivedShortcuts} from '@/common'
export default { export default {
components: { components: {
GlsxOrganization, GlsxOrganization,
...@@ -102,63 +122,7 @@ export default { ...@@ -102,63 +122,7 @@ export default {
showResult: false, showResult: false,
loading: false, loading: false,
pickerOptions: { pickerOptions: {
shortcuts: [ shortcuts: deviceActivedShortcuts,
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "今日",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().format("YYYY-MM-DD");
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
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: "近15天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 15)
.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() - 30)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
}, },
filterVisible: false, filterVisible: false,
orgInfo: {}, orgInfo: {},
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,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.loading = true; this.loading = true;
GETMILEAGESTATISTICS(oParams) GETMILEAGESTATISTICS(oParams)
...@@ -259,8 +259,8 @@ export default { ...@@ -259,8 +259,8 @@ export default {
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();
}, },
}, },
}; };
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,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;
MILEAGE_GETDAILYSEARCH(oParams).then((res) => { MILEAGE_GETDAILYSEARCH(oParams).then((res) => {
let { data } = res; let { data } = res;
...@@ -251,8 +251,8 @@ export default { ...@@ -251,8 +251,8 @@ export default {
rest() { rest() {
this.searchForm = {}; this.searchForm = {};
this.dateTime = []; this.dateTime = [];
this.getList();
this.$refs.glsxTable.rest(); this.$refs.glsxTable.rest();
this.getList();
}, },
}, },
}; };
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<el-tab-pane label="车辆纬度" name="car"> <el-tab-pane label="车辆纬度" name="car">
<statistics-car></statistics-car> <statistics-car></statistics-car>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="设备纬度" name="device">设备纬度</el-tab-pane> <el-tab-pane label="设备纬度" name="device">
<statistics-device></statistics-device>
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -19,9 +21,11 @@ ...@@ -19,9 +21,11 @@
<script> <script>
import {} from "services/report"; import {} from "services/report";
import StatisticsCar from './statistics_car' import StatisticsCar from './statistics_car'
import StatisticsDevice from './statistics_device'
export default { export default {
components: { components: {
StatisticsCar StatisticsCar,
StatisticsDevice
}, },
data() { data() {
return { return {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,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" maxlength="20" v-model.trim="searchForm.keywords"> <el-input placeholder="业务工单|姓名|车架号|设备号" class="a_input" maxlength="20" v-model.trim="searchForm.term">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆归属:"> <el-form-item label="车辆归属:">
...@@ -19,7 +19,17 @@ ...@@ -19,7 +19,17 @@
</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> <div class="pre_select_box">
<el-select v-model="searchForm.queryTimeType" 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="结束日期" unlink-panels :picker-options="dataPickerOptions">
</el-date-picker>
</div>
</el-form-item>
<el-form-item>
<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>
...@@ -36,10 +46,7 @@ ...@@ -36,10 +46,7 @@
<!-- 按钮区域 end --> <!-- 按钮区域 end -->
<!-- 列表 开始 --> <!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :request="GET_FAKEOFFLINE_LIST" :column="columnList" :pageTotal="pageTotal" @change="getList"> <glsx-table ref="glsxTable" v-loading="loading" :params="tableParams" :request="GET_OPEREPORT_VEHICLE_SEARCH" :column="columnList">
<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> </glsx-table>
<!-- 列表 end --> <!-- 列表 end -->
</div> </div>
...@@ -50,21 +57,15 @@ ...@@ -50,21 +57,15 @@
<script> <script>
import GlsxTable from "@/components/glsx-table/table"; import GlsxTable from "@/components/glsx-table/table";
import { import {
GET_JOURNEYS_SEARCH, GET_OPEREPORT_VEHICLE_EXPORT,
GET_JOURNEYS_EXPORT, GET_OPEREPORT_VEHICLE_SEARCH,
GET_JOURNEYS_DAILYEXPORT,
GET_FAKEOFFLINE_LIST,
GET_FAKEOFFLINE_EXPORT,
GET_FAKEOFFLINE_TEMPLATEFILES,
IMPORT_FAKEOFFLINE_FILES,
} from "services/report"; } from "services/report";
import GlsxOrganization from "@/components/glsx-organization"; import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util"; import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
import moment, { max } from "moment";
import GlsxDialog from "@/components/dialog"; import GlsxDialog from "@/components/dialog";
import { staticReportCarShortcuts } from "@/common";
export default { export default {
name:'StatisticsCar', name: "StatisticsCar",
components: { components: {
GlsxTable, GlsxTable,
GlsxOrganization, GlsxOrganization,
...@@ -72,108 +73,69 @@ export default { ...@@ -72,108 +73,69 @@ export default {
}, },
data() { data() {
return { return {
searchForm: {}, searchForm: { queryTimeType: 1 },
tableData: [], tableData: [],
columnList: [ columnList: [
{ label: "工单号", prop: "bizOrderNo" }, { label: "业务工单号", prop: "bizOrderNo" },
{ label: "车牌号", prop: "licensePlate" },
{ label: "姓名", prop: "ownerName" }, { label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sns" },
{ label: "车架号", prop: "vin" }, { label: "车架号", prop: "vin" },
{ label: "假性离线原因", prop: "reason" }, { label: "设备号", prop: "sns" },
{ label: "设备组合", prop: "deviceCompose" },
{ label: "工单接收时间", prop: "createdDate" },
{ label: "车辆激活时间", prop: "activateTime" },
{ label: "所属组织", prop: "belongLevels" },
{ label: "车型", prop: "modelName" },
{ label: "激活人", prop: "activator" },
], ],
pageTotal: 0, pageTotal: 0,
pageSize: 10, pageSize: 10,
filterVisible: false, filterVisible: false,
dloading: false, dloading: false,
showPopover: false, showPopover: false,
cloading: false,
loading: false, loading: false,
aloading: false, GET_OPEREPORT_VEHICLE_SEARCH,
isTimeOut: false, tableParams: {},
sTime: "", dataPickerOptions: {
eTime: "", shortcuts: staticReportCarShortcuts,
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() { mounted() {},
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
//this.getList();
},
methods: { methods: {
// 获取查询参数 // 获取查询参数
getParams() { getParams() {
let oParams = deepClone(this.searchForm); let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
let startIds = {
1: "activateBeginDate",
2: "orderBeginDate",
};
let endIds = {
1: "activateEndDate",
2: "orderEndDate",
};
if (m && m.length > 0) {
oParams[startIds[oParams.queryTimeType]] = m[0];
oParams[endIds[oParams.queryTimeType]] = m[1];
}
delete oParams.queryTimeType;
delete oParams.timeDate;
delete oParams.orgName; delete oParams.orgName;
return oParams; return oParams;
}, },
// 获取列表 // 搜索
getList(options) { searchEvent() {
let oParams = this.getParams(); this.$refs.glsxTable.restParams();
console.log(options); this.tableParams = this.getParams();
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) { onChange(e) {
this.filterVisible = false; this.filterVisible = false;
console.log(e);
if (e) { if (e) {
this.orgInfo = e.origin; this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId; this.searchForm.orgId = e.origin.orgId;
...@@ -188,111 +150,21 @@ export default { ...@@ -188,111 +150,21 @@ export default {
let oParams = this.getParams(); let oParams = this.getParams();
_this.dloading = true; _this.dloading = true;
GET_FAKEOFFLINE_EXPORT(oParams).then((res) => { GET_OPEREPORT_VEHICLE_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({
// url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`,
// method: "GET",
// data: oParams,
// fileName: "里程统计报表",
// success: () => {
// _this.dloading = false;
// },
// fail: () => {
// _this.dloading = false;
// },
// });
}, },
// 重置 // 重置
rest() { rest() {
this.searchForm = {}; this.$refs.glsxTable.restParams()
this.$refs.glsxTable.rest(); this.tableParams = {};
this.getList(); this.searchForm = { queryTimeType: 1 };
}, //this.$refs.glsxTable.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);
}, },
}, },
}; };
......
<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.term">
</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>
<div class="pre_select_box">
<el-select v-model="searchForm.queryTimeType" 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="结束日期" unlink-panels :picker-options="dataPickerOptions">
</el-date-picker>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchEvent()">搜索</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" :params="tableParams" :request="GET_OPEREPORT_DEVICE_SEARCH" :column="columnList">
</glsx-table>
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table/table";
import {
GET_OPEREPORT_DEVICE_SEARCH,
GET_OPEREPORT_DEVICE_EXPORT,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util";
import GlsxDialog from "@/components/dialog";
import {staticReportCarShortcuts} from '@/common'
export default {
name: "StatisticsDevice",
components: {
GlsxTable,
GlsxOrganization,
GlsxDialog,
},
data() {
return {
searchForm: { queryTimeType: 1 },
tableData: [],
columnList: [
{ label: "业务工单号", prop: "bizOrderNo" },
{ label: "设备号", prop: "sns" },
{ label: "车牌号", prop: "licensePlate" },
{ label: "姓名", prop: "ownerName" },
{ label: "车架号", prop: "vin" },
{ label: "所属组织", prop: "belongLevels" },
{ label: "设备激活时间", prop: "activateTime" },
{ label: "定位时间", prop: "gpsTime" },
{ label: "定位地点", prop: "gpsAddress" },
{ label: "工单激活时间", prop: "woActivateTime" },
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
loading: false,
GET_OPEREPORT_DEVICE_SEARCH,
tableParams: {},
dataPickerOptions:{
shortcuts: staticReportCarShortcuts,
}
};
},
mounted() {},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
let startIds = {
1: "activateBeginDate",
2: "gpsBeginDate",
};
let endIds = {
1: "activateEndDate",
2: "gpsEndDate",
};
if (m && m.length > 0) {
oParams[startIds[oParams.queryTimeType]] = m[0];
oParams[endIds[oParams.queryTimeType]] = m[1];
}
delete oParams.queryTimeType;
delete oParams.timeDate;
delete oParams.orgName;
return oParams;
},
// 搜索
searchEvent() {
this.$refs.glsxTable.restParams();
this.tableParams = this.getParams();
},
// 监听树
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_OPEREPORT_DEVICE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
});
},
// 重置
rest() {
this.$refs.glsxTable.restParams()
this.tableParams = {};
this.searchForm = {queryTimeType: 1 };
//this.$refs.glsxTable.rest();
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</style>>
\ No newline at end of file \ No newline at end of file
...@@ -69,7 +69,11 @@ ...@@ -69,7 +69,11 @@
<el-form-item label="车型/车系:" prop="carIds" class="long_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-cascader v-model="snForm.carIds" :options="vehicleList" :props="vehicleProps" class="el_cascader"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="排量:" class="long_form_item"> <el-form-item label="是否结清:">
<el-switch v-model="snForm.value1" active-text="已结清" inactive-text="未结清">
</el-switch>
</el-form-item>
<el-form-item label="排量:">
<el-input v-model="snForm.displacement" maxlength="50" clearable></el-input> <el-input v-model="snForm.displacement" maxlength="50" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆标签:" prop="vehicleType"> <el-form-item label="车辆标签:" prop="vehicleType">
......
...@@ -53,8 +53,14 @@ ...@@ -53,8 +53,14 @@
<el-option v-for="(item,index) in VEHICLE_ONLINE_STATUS" :key="index" :label="item.label" :value="item.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-select>
</el-form-item> </el-form-item>
<el-form-item label="是否结清:">
<el-select v-model="searchForm.settleFlag" class="small_select">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,index) in SETTLE_FLAG_LIST" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<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-search" @click="searchEvent()">搜索</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>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -95,6 +101,14 @@ ...@@ -95,6 +101,14 @@
<el-table-column label="设备类型" prop="deviceTypeStr" show-overflow-tooltip> <el-table-column label="设备类型" prop="deviceTypeStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.deviceTypeStr||'--'}}</template> <template slot-scope="{row}">{{row.deviceTypeStr||'--'}}</template>
</el-table-column> </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="settleFlag" show-overflow-tooltip>
<template slot-scope="{row}">{{row.settleFlag||'--'}}</template>
</el-table-column>
<el-table-column label="车型" prop="modelName" show-overflow-tooltip> <el-table-column label="车型" prop="modelName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.modelName||'--'}}</template> <template slot-scope="{row}">{{row.modelName||'--'}}</template>
</el-table-column> </el-table-column>
...@@ -104,11 +118,6 @@ ...@@ -104,11 +118,6 @@
<el-table-column label="车辆用途" prop="vehicleUsageStr" show-overflow-tooltip> <el-table-column label="车辆用途" prop="vehicleUsageStr" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vehicleUsageStr||'--'}}</template> <template slot-scope="{row}">{{row.vehicleUsageStr||'--'}}</template>
</el-table-column> </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"> <el-table-column label="操作" prop="vehicleUsageStr" width="170">
<template slot-scope="{row}"> <template slot-scope="{row}">
<template v-if="row.permitType == 'r'"> <template v-if="row.permitType == 'r'">
...@@ -208,9 +217,16 @@ ...@@ -208,9 +217,16 @@
<el-form-item label="发动机号:" prop="engine" class="long_form_item"> <el-form-item label="发动机号:" prop="engine" class="long_form_item">
<el-input v-model="snForm.engine" maxlength="50" clearable></el-input> <el-input v-model="snForm.engine" maxlength="50" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆归属:" prop="organizationName" class="long_form_item"> <el-form-item label="车辆归属:" prop="organizationName">
<el-input v-model="snForm.organizationName" readonly @click.native="selectStore"></el-input> <el-input v-model="snForm.organizationName" readonly @click.native="selectStore"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否结清:" v-if="hasPermission('vehicle_vin_settle')">
<div class="el_switch_box">
<el-switch v-model="snForm.settleFlag" :active-value="1" :inactive-value="0">
</el-switch>
<span class="tips">{{snForm.settleFlag?'已结清':'未结清'}}</span>
</div>
</el-form-item>
<el-form-item label="车型/车系:" prop="carIds" class="long_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-cascader v-model="snForm.carIds" :options="vehicleList" :props="vehicleProps" class="el_cascader"></el-cascader>
</el-form-item> </el-form-item>
...@@ -370,7 +386,7 @@ import { getOrgTree } from "services/common"; ...@@ -370,7 +386,7 @@ 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 GlsxOrganization from "@/components/glsx-organization";
import { VEHICLE_USE_LIST, VEHICLE_TAG_LIST } from "@/common/constants"; import { VEHICLE_USE_LIST, VEHICLE_TAG_LIST,SETTLEFLAGLIST,SETTLE_FLAG_LIST } from "@/common/constants";
export default { export default {
components: { components: {
freqModal, freqModal,
...@@ -423,7 +439,7 @@ export default { ...@@ -423,7 +439,7 @@ export default {
return { return {
VEHICLE_USE_LIST, VEHICLE_USE_LIST,
VEHICLE_TAG_LIST, VEHICLE_TAG_LIST,
searchForm: {}, searchForm: {settleFlag:''},
getListApi: getVehicleList, getListApi: getVehicleList,
authList: [ authList: [
...@@ -810,6 +826,8 @@ export default { ...@@ -810,6 +826,8 @@ export default {
], ],
VEHICLE_ONLINE_STATUS, VEHICLE_ONLINE_STATUS,
ajaxLoading: false, ajaxLoading: false,
settleFlagList:SETTLEFLAGLIST,
SETTLE_FLAG_LIST
}; };
}, },
...@@ -826,7 +844,6 @@ export default { ...@@ -826,7 +844,6 @@ export default {
this.getModels(); this.getModels();
resolve(); resolve();
}); });
}, },
mounted() { mounted() {
let _this = this; let _this = this;
...@@ -863,7 +880,7 @@ export default { ...@@ -863,7 +880,7 @@ export default {
refresh() { refresh() {
this.pageSize = 10; this.pageSize = 10;
this.pageNumber = 1; this.pageNumber = 1;
this.searchForm = {}; this.searchForm = {settleFlag:''};
this.getList(); this.getList();
}, },
...@@ -905,7 +922,7 @@ export default { ...@@ -905,7 +922,7 @@ export default {
//this.snForm.deviceArr = [{ sn: "", deviceType: "" }]; //this.snForm.deviceArr = [{ sn: "", deviceType: "" }];
//this.snForm.deviceInfoDtos = [{}]; //this.snForm.deviceInfoDtos = [{}];
this.snForm = {}; this.snForm = {settleFlag:0};
this.$set(this.snForm, "deviceInfoDtos", [ this.$set(this.snForm, "deviceInfoDtos", [
{ sn: "", deviceClassifyName: "" }, { sn: "", deviceClassifyName: "" },
]); ]);
...@@ -1056,10 +1073,13 @@ export default { ...@@ -1056,10 +1073,13 @@ export default {
} }
break; break;
case "export": case "export":
let oParams = this.getParams();
delete oParams.pageSize
delete oParams.pageNumber
this.$Common.exportExcel({ this.$Common.exportExcel({
url: `${store.state.baseURL}/trialdrive/vehicle/vehicleinfo/export`, url: `${store.state.baseURL}/trialdrive/vehicle/vehicleinfo/export`,
method: "GET", method: "GET",
data: this.searchForm, data: oParams,
fileName: "车辆列表" + moment().format("YYYY.MM.DD") + ".xls", fileName: "车辆列表" + moment().format("YYYY.MM.DD") + ".xls",
}); });
break; break;
...@@ -1694,6 +1714,19 @@ export default { ...@@ -1694,6 +1714,19 @@ export default {
row.disabled = !row.disabled; row.disabled = !row.disabled;
this.$set(this.snForm.deviceInfoDtos, index, row); this.$set(this.snForm.deviceInfoDtos, index, row);
}, },
// 是否有权限
hasPermission(id){
return this.$hasPermission(id)
},
// 搜索
searchEvent(){
this.pageNumber = 1;
this.getList()
}
}, },
}; };
</script> </script>
...@@ -1827,4 +1860,13 @@ export default { ...@@ -1827,4 +1860,13 @@ export default {
border-color: #c6e2ff; border-color: #c6e2ff;
background: #ecf5ff; background: #ecf5ff;
} }
.el_switch_box{
display:flex;
align-items: center;
.tips{
font-size:12px;
color:#333;
margin-left:10px;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!