Commit 6f22e62b by 张杰

111

1 parent c3563b4c
......@@ -161,6 +161,25 @@ const routes = [
}
},
{
path: '/reportManage/mileageGeneral',
name: 'mileageGeneral',
component: () => import('../views/reportManage/mileageGeneral.vue'),
meta: {
title: '里程统计(通用)',
keepAlive: true
}
},
{
path: '/reportManage/mileageGeneralDetail',
name: 'mileageGeneralDetail',
component: () => import('../views/reportManage/mileageGeneralDetail.vue'),
meta: {
title: '里程详情(通用)',
pushState: true,
keepAlive: true
}
},
{
path: '/specialShop',
name: 'specialShop',
component: () => import('../views/specialShop/index.vue'),
......
......@@ -76,6 +76,37 @@ export const GET_DEVICEACTIVE_EXPORT = params => {
export const GET_FINALPOSITIONING_SEARCH = params => {
return request(params, '/trialdrive/finalpositioning/search')
}
// 报表管理-最后定位报表-导出excel
export const GET_FINALPOSITIONING_EXPORT = params => {
return request(params, '/trialdrive/finalpositioning/export')
}
// 报表管理-里程统计(通用)-查询列表
export const GET_JOURNEYS_SEARCH = params => {
return request(params, '/trialdrive/journeys/search')
}
// 报表管理-里程统计(通用)-导出excel
export const GET_JOURNEYS_EXPORT = params => {
return request(params, '/trialdrive/journeys/export')
}
// 报表管理-里程统计(通用)-查询详情
export const GET_JOURNEYS_SEARCHDETAIL = params => {
return request(params, '/trialdrive/journeys/searchdetail')
}
// 报表管理-里程统计(通用)-详情-导出excel
export const GET_JOURNEYS_EXPORTDETAIL = params => {
return request(params, '/trialdrive/journeys/exportdetail')
}
// 报表管理-里程统计(通用)-日里程-导出excel
export const GET_JOURNEYS_DAILYEXPORT = params => {
return request(params, '/trialdrive/journeys/dailyExport')
}
export { getList, getYears, getOutStoreList }
......@@ -17,6 +17,10 @@
color: #999;
}
}
.pre_select_box{
display:flex;
align-items: center;
}
.sort_select {
width: 100px;
}
......@@ -32,6 +36,9 @@
.data_picker {
width: 240px;
}
.mr5{
margin-right:5px;
}
.table_box {
margin: 10px 0;
}
......
......@@ -56,7 +56,9 @@
<el-table-column label="姓名" prop="ownerName"></el-table-column>
<el-table-column label="车架号" prop="vin"></el-table-column>
<el-table-column label="设备号" prop="sn"></el-table-column>
<el-table-column label="设备类型" prop="deviceTypeStr"></el-table-column>
<el-table-column label="设备类型" prop="deviceTypeStr">
<template slot-scope="{row}">{{(row.deviceTypeStr||'') + (row.sourceStr && row.deviceTypeStr?'/':'') + (row.sourceStr||'')}}</template>
</el-table-column>
<el-table-column label="是否在线" prop="isOnLineStr"></el-table-column>
<el-table-column label="车辆归属" prop="shopName"></el-table-column>
<el-table-column label="激活时间" prop="activeDate"></el-table-column>
......@@ -77,7 +79,10 @@
<script>
import moment from "moment";
import GlsxOrganization from "@/components/glsx-organization";
import {GET_DEVICEACTIVE_SEARCH,GET_DEVICEACTIVE_EXPORT} from '@/services/report'
import {
GET_DEVICEACTIVE_SEARCH,
GET_DEVICEACTIVE_EXPORT,
} from "@/services/report";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
export default {
......@@ -109,16 +114,16 @@ export default {
{
text: "今日",
onClick(picker) {
const end = moment().format('YYYY-MM-DD');
const start = moment().format('YYYY-MM-DD');
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');
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]);
},
......@@ -153,7 +158,6 @@ export default {
picker.$emit("pick", [start, end]);
},
},
],
},
filterVisible: false,
......@@ -166,8 +170,8 @@ export default {
let o = history.state;
if (o.alarmStatus) {
let n = moment().format("YYYY-MM-DD");
this.$set(this.searchForm,'timeDate',[n, n])
this.$set(this.searchForm,'alarmStatus',o.alarmStatus)
this.$set(this.searchForm, "timeDate", [n, n]);
this.$set(this.searchForm, "alarmStatus", o.alarmStatus);
}
},
mounted() {
......@@ -234,23 +238,30 @@ export default {
if (res.code != 200) {
return false;
}
// let link = document.createElement("a");
// link.style.display = "none";
// link.href = res.data;
// link.setAttribute("download", "test.xlsx");
// document.body.appendChild(link);
// link.click();
window.open(res.data);
});
},
// 查看激活位置点
lookLocation(row) {
let oParams = {...row}
oParams.lng = row.gpsLng
oParams.lat = row.gpsLat
oParams.address = row.firstGpsAddress
oParams.name = row.ownerName
oParams.standNo = row.vin
oParams.time = row.activeDate
oParams.bsLng = row.bsLng
oParams.bsLat = row.bsLat
oParams.bsAddress = row.firstBsAddress
oParams.bsTime = row.activeDate
let oParams = { ...row };
oParams.lng = row.gpsLng;
oParams.lat = row.gpsLat;
oParams.address = row.firstGpsAddress;
oParams.name = row.ownerName;
oParams.standNo = row.vin;
oParams.time = row.activeDate;
oParams.bsLng = row.bsLng;
oParams.bsLat = row.bsLat;
oParams.bsAddress = row.firstBsAddress;
oParams.bsTime = row.activeDate;
oParams.type = 1;
let path = `/oEshield#/monitor/activeLocation`;
history.pushState(oParams, "激活位置点", path);
},
......
......@@ -10,13 +10,15 @@
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item>
<el-select v-model="searchForm.queryTimeType" class="sort_select" placeholder="请选择">
<el-option label="最后GPS定位时间" value="1"></el-option>
<el-option label="最后基站时间" value="2"></el-option>
<el-option label="激活时间" value="3"></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 class="pre_select_box">
<el-select v-model="searchForm.queryTimeType" class="small_select mr5" placeholder="请选择">
<el-option label="最后GPS定位时间" value="1"></el-option>
<el-option label="最后基站时间" value="2"></el-option>
<el-option label="激活时间" value="3"></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-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
......@@ -39,6 +41,20 @@
<el-input v-model="searchForm.keywords" class="long_input" placeholder="工单号|店面名称|设备号|车架号|姓名"></el-input>
</el-form-item>
<el-form-item>
<template slot="label">
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
<p>最后定位数据过滤:</p>
<p>仅统计该账号权限下,对应车辆“最后定位时间”并且配合展示定位类型,方便平台使用者进行区分</p>
</div>
<i class="el-icon-question"></i>
</el-tooltip>
<span>最后定位数据过滤:</span>
</template>
<el-switch v-model="showColumn">
</el-switch>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
......@@ -59,16 +75,26 @@
<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="shopName"></el-table-column>
<el-table-column label="姓名" prop="ownerName"></el-table-column>
<el-table-column label="车架号" prop="vin"></el-table-column>
<el-table-column label="设备号" prop="sn"></el-table-column>
<el-table-column label="设备类型" prop="modelName"></el-table-column>
<el-table-column label="是否在线" prop="alarmTypeStr"></el-table-column>
<el-table-column label="车辆归属" prop="alarmStatusStr"></el-table-column>
<el-table-column label="激活时间" prop="geoCode"></el-table-column>
<el-table-column label="设备类型" prop="modelName">
<template slot-scope="{row}">{{(row.deviceTypeStr||'') + (row.sourceStr && row.deviceTypeStr?'/':'') + row.sourceStr}}</template>
</el-table-column>
<el-table-column label="激活时间" prop="activeDate"></el-table-column>
<template v-if="!showColumn">
<el-table-column label="最后GPS定位时间" prop="finalGpsTime"></el-table-column>
<el-table-column label="最后基站定位时间" prop="finalBsTime"></el-table-column>
</template>
<template v-if="showColumn">
<el-table-column label="最后定位时间" prop="lastPoiTime"></el-table-column>
<el-table-column label="最后定位类型" prop="poiType"></el-table-column>
<el-table-column label="最后定位地址" prop="lastPoiAddress"></el-table-column>
</template>
<el-table-column label="操作" fixed="right" align="center" width="180px">
<template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookLocation(row)">查看报警位置</el-link>
<el-link class="el_link" type="primary" @click="lookLocation(row)" v-if="row.gpsLng || row.bsLng">查看定位位置</el-link>
</template>
</el-table-column>
</el-table>
......@@ -83,10 +109,9 @@
<script>
import moment from "moment";
import GlsxOrganization from "@/components/glsx-organization";
import { GETJUDGMENTSEARCH, ALARM_HADOOP_EXPORT } from "@/services/alarmCenter";
import {
GET_FINALPOSITIONING_SEARCH,
GET_DEVICEACTIVE_EXPORT,
GET_FINALPOSITIONING_EXPORT,
} from "@/services/report";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
......@@ -96,7 +121,8 @@ export default {
},
data() {
return {
searchForm: {queryTimeType:'1'},
showColumn: false,
searchForm: { queryTimeType: "1" },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -258,7 +284,7 @@ export default {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_DEVICEACTIVE_EXPORT(oParams).then((res) => {
GET_FINALPOSITIONING_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
......@@ -267,20 +293,22 @@ export default {
});
},
// 查看报警位置点
lookLocation(row1) {
let row = {
sn: "1700151515",
ownerName: "默认",
vin: "test321test321tes",
mileageStartTime: "2021-12-03 15:59:49",
mileageEndTime: "",
lng: "113.986208",
lat: "22.590340",
address: "广东省深圳市南山区南方科技大学",
};
// 查看定位位置点
lookLocation(row) {
let oParams = { ...row };
oParams.lng = row.gpsLng;
oParams.lat = row.gpsLat;
oParams.address = row.activeDate;
oParams.name = row.ownerName;
oParams.standNo = row.vin;
oParams.time = row.finalGpsTime;
oParams.bsLng = row.bsLng;
oParams.bsLat = row.bsLat;
oParams.bsAddress = row.lastBsAddress;
oParams.bsTime = row.finalBsTime;
oParams.type = 2;
let path = `/oEshield#/monitor/activeLocation`;
history.pushState(row, "报警位置点", path);
history.pushState(row, "定位位置点", path);
},
},
};
......
<template>
<div class="system-container">
<div class="container">
<h1>里程统计</h1>
<div class="m-b-md title_tips">用于统计用户的车辆行驶里程信息,并支持详情查看(仅针对有线/OBD设备)</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="车辆归属:">
<!-- <el-input v-model="searchForm.dddd"></el-input> -->
<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 label="">
<el-input placeholder="工单号|车架号|姓名|设备" class="a_input" v-model="searchText">
<el-select class="pre_select" v-model="preText" slot="prepend" placeholder="请选择">
<el-option label="工单号" value="orderNo"></el-option>
<el-option label="车架号" value="vin"></el-option>
<el-option label="姓名" value="ownerName"></el-option>
<el-option label="设备" value="sn"></el-option>
</el-select>
</el-input>
</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>
<div>
<el-popover placement="bottom-end" v-model="showPopover" trigger="click">
<div class="el_popover">
<div class="cell">
<div class="name">选择日期:</div>
<div class="txt">
<el-date-picker v-model="mileageDate" size="small" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions">
</el-date-picker>
</div>
</div>
<div class="show_tips" v-if="isTimeOut">提示:导出日期范围超过60天</div>
<div class="btn_group">
<el-button type="primary" size="mini" :loading="cloading" @click="singleDownloadExcel" :disabled="isTimeOut">导出</el-button>
<el-button type="default" size="mini" @click="showPopover = false">取消</el-button>
</div>
</div>
<el-button slot="reference" type="default" icon="el-icon-download" size="mini">日里程导出</el-button>
</el-popover>
<el-button class="pull-right" type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookDetail(scope)">详情</el-link>
</div>
</glsx-table>
<!-- <div class="table_box">
<el-table :data="tableData" border>
<el-table-column label="工单号" prop=""></el-table-column>
<el-table-column label="姓名" prop=""></el-table-column>
<el-table-column label="设备号" prop=""></el-table-column>
<el-table-column label="车架号" prop=""></el-table-column>
<el-table-column label="总行驶次数" prop=""></el-table-column>
<el-table-column label="总里程km" prop=""></el-table-column>
<el-table-column label="操作" prop=""></el-table-column>
</el-table>
</div> -->
<!-- <basic-table ref="reportTable" :tableParams="reportTableParams" :beforeSearchFn="beforeSearchFn" :searchForm="searchDataForm" :getListApi="getListApi" @dataFinished="tableDataFinished" :hasNum="false">
</basic-table> -->
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table";
import {
GET_JOURNEYS_SEARCH,
GET_JOURNEYS_EXPORT,
GET_JOURNEYS_DAILYEXPORT,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
import moment, { max } from "moment";
export default {
components: {
GlsxTable,
GlsxOrganization,
},
data() {
return {
searchForm: {},
preText: "orderNo",
tableData: [],
columnList: [
{ label: "工单号", prop: "workOrderNo", align: "center" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sn" },
{ label: "车架号", prop: "vin" },
{ label: "总行驶次数", prop: "tripCount" },
{ label: "总里程km", prop: "distance" },
],
pageTotal: 0,
filterVisible: false,
searchText: "",
dloading: false,
showPopover: false,
mileageDate: [],
cloading: false,
loading: 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 = ''
}
},
},
};
},
mounted() {
this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
if (this.searchText) {
oParams[this.preText] = this.searchText;
}
delete oParams.orgName;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
GET_JOURNEYS_SEARCH(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 query = { vin: row.vin };
let path = "/trialRun#/reportManage/mileageGeneralDetail?vin=" + row.vin;
history.pushState(query, path, path);
//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.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_JOURNEYS_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;
// },
// });
},
// 日里程导出
singleDownloadExcel() {
let _this = this;
let o = this.mileageDate;
if (!o || o.length <= 0) {
showToast({
message: "请选择日期",
});
return false;
}
let oParams = this.getParams();
oParams.journeyStartTime = o[0];
oParams.journeyEndTime = o[1];
_this.cloading = true;
GET_JOURNEYS_DAILYEXPORT(oParams).then(res => {
_this.cloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
})
},
// 重置
rest() {
this.searchForm = {};
this.searchText = "";
this.preText = "orderNo";
this.mileageDate = []
this.getList();
this.$refs.glsxTable.rest();
},
},
};
</script>
<style lang="scss" scoped>
.pre_select {
width: 100px;
}
.title_tips {
font-size: 14px;
}
.links_group {
display: flex;
align-items: center;
justify-content: space-between;
.pull-right {
margin-left: 10px;
}
}
.el_popover {
.cell {
// display: flex;
// align-items: center;
.name {
width: 80px;
line-height: 2;
}
}
.show_tips {
//padding-left: 80px;
color: #f00;
font-size: 12px;
line-height: 2;
}
.btn_group {
text-align: right;
margin: 10px 0 0 0;
}
}
.search_box{
.a_input{
width:320px;
}
}
</style>>
\ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<h1>里程详情</h1>
<div class="m-b-md title_tips">用于统计和展示单个有线/OBD设备的历史行程信息</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="medium">
<el-form-item label="日期:">
<el-date-picker v-model="dateTime" type="daterange" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="设备号:">
<!-- <el-input placeholder="工单号|车架号|姓名|设备" v-model="searchForm.input3">
<template slot="prepend">设备号</template>
</el-input> -->
<el-select v-model="searchForm.sn">
<el-option v-for="item in snList" :key="item" :label="item" :value="item"></el-option>
</el-select>
</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="default" 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="medium" :loading="dloading" @click="downloadExcel()">导出Excel</el-button>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookTrack(scope)">查看轨迹</el-link>
</div>
</glsx-table>
<!-- <div class="table_box">
<el-table :data="tableData" border>
<el-table-column label="工单号" prop=""></el-table-column>
<el-table-column label="姓名" prop=""></el-table-column>
<el-table-column label="设备号" prop=""></el-table-column>
<el-table-column label="车架号" prop=""></el-table-column>
<el-table-column label="总行驶次数" prop=""></el-table-column>
<el-table-column label="总里程km" prop=""></el-table-column>
<el-table-column label="操作" prop=""></el-table-column>
</el-table>
</div> -->
<!-- <basic-table ref="reportTable" :tableParams="reportTableParams" :beforeSearchFn="beforeSearchFn" :searchForm="searchDataForm" :getListApi="getListApi" @dataFinished="tableDataFinished" :hasNum="false">
</basic-table> -->
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table";
import {
GET_JOURNEYS_SEARCHDETAIL,
MILEAGE_GETSN,
GET_JOURNEYS_EXPORTDETAIL,
} from "services/report";
import { deepClone, showToast } from "@/utils/util";
import moment from "moment";
export default {
data() {
return {
searchForm: {},
snList: [],
dateTime: [],
tableData: [],
columnList: [
{ label: "工单号", prop: "workOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sn" },
{ label: "车架号", prop: "vin" },
{
label: "行程开始/结束时间",
prop: "journeyStartTime",
formatter: (row) => {
return `${row.journeyStartTime}~${row.journeyEndTime}`;
},
},
{ label: "行驶时长", prop: "durationStr" },
{
label: "行驶里程km",
prop: "distance",
formatter: (row) => {
return `${row.distance || 0}km`;
},
},
],
pageTotal: 0,
pickerOptions: {
shortcuts: [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
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: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).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]);
},
},
],
},
dloading: false,
};
},
components: {
GlsxTable,
},
created() {
this.getSn();
},
mounted() {
const startDate = moment().weekday(1).format("YYYY-MM-DD");
console.log(startDate);
//this.getTableList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let o = this.dateTime;
if (o && o.length > 0) {
oParams.journeyStartTime = o[0];
oParams.journeyEndTime = o[1];
}
oParams.vin = this.$route.query.vin;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
GET_JOURNEYS_SEARCHDETAIL(oParams).then((res) => {
let { data } = res;
let { list, totalElements } = data || {};
this.pageTotal = totalElements;
this.tableData = list;
});
},
// 获取设备列表
getSn() {
let oParams = { vin: this.$route.query.vin };
MILEAGE_GETSN(oParams).then((res) => {
let list = res.data || [];
this.snList = res.data || [];
this.$set(this.searchForm, "sn", list[0] || "");
this.getList();
});
},
// 查看轨迹
lookTrack(row) {
console.log(row);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&isInitFence=1&name=${
row.ownerName
}&standno=${row.vin}&startTime=${row.journeyStartTime || ""}&endTime=${
row.journeyEndTime || 0
}&fenceId=${row.fenceId}`;
//let query = {sn:row.sn,isInitFence:1,name:row.name,standno:row.vin};
let query = {};
//this.$router.push({path:path})
history.pushState(query, path, path);
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_JOURNEYS_EXPORTDETAIL(oParams).then(res => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
})
},
// 重置
rest() {
this.searchForm = {};
this.dateTime = [];
this.getList();
this.$refs.glsxTable.rest();
},
},
};
</script>
<style lang="scss" scoped>
.pre_select {
width: 100px;
}
.title_tips {
font-size: 14px;
}
.links_group {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>>
\ 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!