Commit c6e76831 by 张杰

v1.15.0版本需求

1 parent 04d282bc
<template>
<div class="dialog_page">
<el-dialog ref="glsxDialogCom" :title="title" :visible.sync="show" :width="width" :append-to-body="appendtobody" :show-close="showClose" custom-class="glsx_dialog" :close-on-press-escape="false" :close-on-click-modal="false" @close="onCancel" @opened="onDialogOpened">
<div slot="title" class="test" v-if="slotInfo.title">
<slot name="title" />
</div>
<div class="dialog_content">
<slot />
</div>
<div class="dialog_footer" v-show="hasFooter">
<slot name="footer"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "GlsxDialog",
props: {
show: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "提示",
},
width: {
type: String,
default: "46%",
},
cancel: {
required: false,
type: Function,
},
confirm: {
required: false,
type: Function,
},
usefooter: {
required: false,
type: Boolean,
default: false,
},
appendtobody: {
required: false,
type: Boolean,
default: false,
},
value: {
type: Boolean,
default: false,
},
showClose: {
required: false,
type: Boolean,
default: true,
},
},
data() {
return {
hasFooter: false,
hasTitle: false,
slotInfo: {},
};
},
created() {
let o = this.$slots;
this.hasFooter = o.footer;
this.hasTitle = o.title;
this.slotInfo = o;
},
mounted: function () {
//this.$refs.glsxDialogCom.rendered = true;
},
methods: {
/**
* 取消关闭弹框
*/
onCancel: function () {
// 兼容以前的页面
this.$emit("close");
//this.$emit("input", false);
},
/**
* 确定
*/
onConfirm: function () {},
//
onDialogOpened() {},
},
};
</script>
<style lang="scss">
.glsx_dialog {
.el-dialog__header {
border-bottom: 1px solid #ddd !important;
padding-top: 10px;
font-size: 14px;
}
.el-dialog__headerbtn {
top: 10px;
right: 10px;
}
.el-dialog__body {
padding: 0;
}
.el-dialog__footer {
border-top: 1px solid #ddd;
}
}
</style>
<style lang="scss" scoped>
.dialog_content {
max-height: 600px;
overflow-y: auto;
padding: 20px;
}
.dialog_footer {
padding: 10px 15px;
border-top: 1px solid #e1e1e1;
text-align: right;
}
</style>
......@@ -180,6 +180,24 @@ const routes = [
}
},
{
path: '/reportManage/offline',
name: 'pseudoOfflineReport',
component: () => import('../views/reportManage/offline.vue'),
meta: {
title: '假性离线报表',
keepAlive: true
}
},
{
path: '/reportManage/map',
name: 'offlineReportMap',
component: () => import('../views/reportManage/map.vue'),
meta: {
title: '假性离线位置',
keepAlive: true
}
},
{
path: '/specialShop',
name: 'specialShop',
component: () => import('../views/specialShop/index.vue'),
......
import { REPORT_API } from '@/config/config'
import request from '@/services/request'
import store from "@/store";
const BASEURL = store.state.baseURL
// 获取报表列表
function getList (params) {
......@@ -106,7 +109,21 @@ export const GET_JOURNEYS_DAILYEXPORT = params => {
return request(params, '/trialdrive/journeys/dailyExport')
}
// 报表管理-假性离线报警-获取列表
export const GET_FAKEOFFLINE_LIST = params => {
return request(params, '/trialdrive/fakeoffline/search')
}
// 报表管理-假性离线报警-导出excel
export const GET_FAKEOFFLINE_EXPORT = params => {
return request(params, '/trialdrive/fakeoffline/export')
}
// 报表管理-假性离线报警-下载模板
export const GET_FAKEOFFLINE_TEMPLATEFILES = BASEURL + "/trialdrive/fakeoffline/downloadtemplate";
// 报表管理-假性离线报警-导入excel
export const IMPORT_FAKEOFFLINE_FILES = BASEURL + '/trialdrive/fakeoffline/import'
export { getList, getYears, getOutStoreList }
.title_tips {
font-size: 14px;
}
.links_group {
display: flex;
align-items: center;
justify-content: space-between;
.pull-right {
margin-left: 10px;
}
}
.search_box {
.a_input {
width: 320px;
}
}
.upload_box {
.input_box {
display: flex;
align-items: center;
.a_input {
margin-right: 10px;
width: 320px;
}
}
.tips {
font-size: 12px;
color: #999;
line-height: 2;
}
}
.dialog_links {
display: flex;
align-items: center;
justify-content: space-between;
}
.upload_result {
display: flex;
justify-content: center;
.cell {
position: relative;
width: 200px;
display: flex;
flex-direction: column;
text-align: center;
span {
line-height: 2;
}
.num {
font-size: 18px;
font-weight: bold;
color: #666;
}
.cred {
color: #f00;
}
}
.cell:after {
display: block;
content: "";
width: 1px;
background: #d8d8d8;
position: absolute;
top: 50%;
right: 0;
height: 70%;
transform: translateY(-50%);
opacity: 0.8;
}
.cell:last-child:after {
display: none;
}
}
\ No newline at end of file
......@@ -67,6 +67,12 @@
<el-table-column label="设备号" prop="sn"></el-table-column>
<el-table-column label="报警类型" prop="alarmTypeStr"></el-table-column>
<el-table-column label="报警状态" prop="alarmStatusStr"></el-table-column>
<!-- todo等待后台参数 -->
<el-table-column label="报警次数" prop="alarmStatusStr"></el-table-column>
<el-table-column label="风险等级" prop="alarmStatusStr"></el-table-column>
<!-- todo等待后台参数 -->
<el-table-column label="报警编号" prop="geoCode"></el-table-column>
<el-table-column label="报警地点" prop="alarmAddress"></el-table-column>
<el-table-column label="报警生效时间" prop="alarmBeginTime"></el-table-column>
......@@ -245,9 +251,13 @@ export default {
oParams.name = row.ownerName;
oParams.standNo = row.vin;
oParams.time = row.alarmBeginTime;
let path = `/oEshield#/monitor/activeLocation`;
let path = `/oEshield/#/monitor/activeLocation`;
let o = window.location.origin
//this.$root.parentCommon.setBreadCrumbs(path);
window.open(`${o}${path}?vin=${row.vin}`)
history.pushState(oParams, "报警位置点", path);
//history.pushState(oParams, "报警位置点", path);
},
},
};
......
......@@ -281,11 +281,11 @@ export default {
oParams.bsLat = row.bsAlarmLat;
oParams.bsAddress = row.bsAlarmAddress;
oParams.bsTime = row.lastBsTime;
let a = window.location.origin;
//let a = window.location.origin;
let path = `/oEshield#/monitor/activeLocation`;
// window.open(path)
history.pushState(oParams, "报警位置点", path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path)
//history.pushState(oParams, "报警位置点", path);
},
},
};
......
<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 label="关键字:">
<el-input placeholder="设备号|车架号|姓名|业务工单号" class="a_input" maxlength="20" v-model="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>
<div>
<el-button type="default" icon="el-icon-download" size="mini" @click="openDialog()">导入白名单</el-button>
<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>
<!-- 列表 end -->
</div>
<!-- 弹框 开始 -->
<glsx-dialog :show="showDialog" title="批量操作" width="560px" @close="closeDialog()">
<div>
<div class="upload_box" v-show="!showResult">
<div class="input_box">
<el-input v-model="uploadFile.name" placeholder="请选择需要导入的工单表格" class="a_input" size="small" readonly></el-input>
<el-upload ref="elUpload" :action="IMPORT_FAKEOFFLINE_FILES" :headers="uploadHeaders" :show-file-list="false" :auto-upload="false" :on-change="onFileChange" :on-success="onSuccess">
<el-button size="small" type="primary">选择文件</el-button>
</el-upload>
</div>
<div class="tips">*请选择需要导入的工单表格*</div>
</div>
<div class="upload_result" v-show="showResult">
<div class="cell">
<span class="num">{{uploadResult.succNum}}</span>
<span>成功记录</span>
</div>
<div class="cell">
<span class="num cred">{{uploadResult.failNum}}</span>
<span>失败记录</span>
</div>
</div>
</div>
<div slot="footer">
<div class="dialog_links">
<div>
<el-button type="primary" size="small" v-if="!showResult" @click="downloadTemplate()">下载模板</el-button>
<el-button type="primary" size="small" v-if="showResult && uploadResult.failFile" @click="downloadFail()">导出失败记录</el-button>
</div>
<div class="">
<el-button type="primary" size="small" :loading="loading" :disabled="!uploadFile.name" v-if="!showResult" @click="saveFile()">确认</el-button>
<el-button type="default" size="small" @click="closeDialog()">关闭</el-button>
</div>
</div>
</div>
</glsx-dialog>
<!-- 弹框 end -->
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-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 {
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,
filterVisible: false,
dloading: false,
showPopover: false,
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 = "";
}
},
},
showDialog: false,
uploadFile: {},
showResult: false,
uploadHeaders: {},
uploadResult: {},
IMPORT_FAKEOFFLINE_FILES
};
},
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();
oParams.pageSize = this.$refs.glsxTable.pageSize;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
//GET_FAKEOFFLINE_LIST 等后台部署后替换
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 o = window.location.origin
let query = { vin: row.vin };
let path = "/trialRun#/reportManage/map";
//history.pushState(query, path, path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path + '?sn=' + row.sn);
//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.getList();
this.$refs.glsxTable.rest();
},
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
}
},
// 打开批量导入弹框
openDialog() {
this.showDialog = true;
},
// 关闭弹框
closeDialog() {
this.showDialog = false;
this.uploadFile = {};
this.uploadResult = {};
this.showResult = false;
},
// 上传文件
saveFile() {
if (!this.uploadFile.name) {
showToast({
message: "请选择上传文件",
});
return false;
}
console.log(this.uploadFile);
this.loading = true;
this.$refs.elUpload.submit();
},
// 监听文件上传成功
onSuccess(response, file, fileList) {
this.loading = 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() {
window.open(GET_FAKEOFFLINE_TEMPLATEFILES);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</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!