Commit 7aa7e035 by zhangxw

Merge branch 'v1.6.0' of http://192.168.3.233:8090/micro-customization-system/mi…

…cro-trialrun into v1.6.0
2 parents 7c30b0cb bbbef7e1
...@@ -30,7 +30,7 @@ export const fenceShortcuts = [ ...@@ -30,7 +30,7 @@ export const fenceShortcuts = [
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() - 7) .day(moment().day() - 6)
.format("YYYY-MM-DD"); .format("YYYY-MM-DD");
picker.$emit("pick", [start, end]); picker.$emit("pick", [start, end]);
} }
...@@ -40,7 +40,7 @@ export const fenceShortcuts = [ ...@@ -40,7 +40,7 @@ export const fenceShortcuts = [
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() - 15) .day(moment().day() - 14)
.format("YYYY-MM-DD"); .format("YYYY-MM-DD");
picker.$emit("pick", [start, end]); picker.$emit("pick", [start, end]);
}, },
...@@ -50,7 +50,7 @@ export const fenceShortcuts = [ ...@@ -50,7 +50,7 @@ export const fenceShortcuts = [
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() - 30) .day(moment().day() - 29)
.format("YYYY-MM-DD"); .format("YYYY-MM-DD");
picker.$emit("pick", [start, end]); picker.$emit("pick", [start, end]);
}, },
...@@ -70,7 +70,7 @@ export const shutDownShortcuts = [ ...@@ -70,7 +70,7 @@ export const shutDownShortcuts = [
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() - 3) .day(moment().day() - 2)
.format("YYYY-MM-DD"); .format("YYYY-MM-DD");
picker.$emit("pick", [start, end]); picker.$emit("pick", [start, end]);
} }
...@@ -80,7 +80,7 @@ export const shutDownShortcuts = [ ...@@ -80,7 +80,7 @@ export const shutDownShortcuts = [
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() - 7) .day(moment().day() - 6)
.format("YYYY-MM-DD"); .format("YYYY-MM-DD");
picker.$emit("pick", [start, end]); picker.$emit("pick", [start, end]);
} }
......
<template>
<div class="glsx_table_box">
<el-table class="el_table" :data="tableData" border :size="size" v-loading="loading">
<el-table-column v-for="(item,index) in column" :key="index" :label="item.label" :prop="item.prop" :formatter="item.formatter" :align="item.align" :fixed="item.fixed" :width="item.width" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" v-if="this.$scopedSlots.operate" width="120px">
<template slot-scope="scope">
<slot name="operate" :scope="scope.row"></slot>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :page-size.sync="currentPage" :page-sizes="pageSizes" :current-page.sync="currentPage" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
</template>
<script>
/**
* request: 接口方法
* list: 表格数据
* border:是否带边框
* size:表格尺寸
* column: 列数据
* layout:分页展示数据
* pageSizes: 默认展示多少页列表
* pageSize: 当前展示页条数
* params: 外部查询参数
*/
export default {
name: "GlsxTable",
props: {
request: {
type: Function,
},
list: {
type: Array,
default: function () {
return [];
},
},
column: {
type: Array,
default: function () {
return [];
},
},
border: {
type: Boolean,
default: true,
},
size: {
type: String,
default: "small",
},
layout: {
type: String,
default: "sizes, total,prev, pager, next, jumper",
},
pageSizes: {
type: Array,
default: function () {
return [10, 20, 30, 40];
},
},
params: {
type: Object,
default: function () {
return {};
},
},
},
data() {
return {
currentPage: 1,
pageSize: 10,
pageTotal:0,
tableData:[],
loading:false
};
},
created() {},
mounted() {
if (this.request) {
this.getList();
}
},
methods: {
/**
* 每页展示
*/
changePageSize: function (e) {
this.pageSize = e;
this.getList();
},
// 获取参数
getParams(current){
let oParams = {...this.params};
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
return oParams
},
// 获取列表
getList(current) {
let request = this.request;
let oParams = this.getParams(current);
this.loading = true
request(oParams).then((res) => {
this.loading = false
if(res.code != 200){
return false;
}
let {data:{list,totalElements}} = res;
this.tableData = list||[]
this.pageTotal = totalElements
}).catch(error => {
this.loading = false
});
},
// 重置
rest() {
this.pageSize = 10;
this.currentPage = 1;
this.getList();
},
},
};
</script>
<style lang="scss">
.el_table {
thead {
th {
//background: rgba(197, 197, 197, 0.1);
background: #f5f7fa;
}
}
}
</style>
<style lang="scss" scoped>
.glsx_table_box {
margin: 10px 0;
}
.pagination_list {
text-align: right;
padding: 10px 0;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -208,11 +208,31 @@ ...@@ -208,11 +208,31 @@
.popover_box { .popover_box {
.h3 { .h3 {
font-size: 14px; font-size: 14px;
color:#666; color: #666;
} }
p { p {
font-size: 12px; font-size: 12px;
color:#999; color: #999;
}
}
// 页面公共标题
.page_head_title {
.h2,
.h3 {
margin: 0;
padding: 0;
line-height: 1.8;
}
.h2 {
font-size: 18px;
}
.h3 {
font-weight: normal;
font-size: 14px;
color: #999;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,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">
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
}, },
data() { data() {
return { return {
searchForm: {alarmType:''}, searchForm: { alarmType: "" },
currentPage: 1, currentPage: 1,
pageSizes: [10, 20, 30, 40], pageSizes: [10, 20, 30, 40],
pageSize: 10, pageSize: 10,
...@@ -119,14 +119,18 @@ export default { ...@@ -119,14 +119,18 @@ export default {
}, },
created() { created() {
console.log(history.state); console.log(history.state);
this.fenceId = history.state.fenceId; let query = this.$route.query;
this.fenceId = query.fenceId || "";
if (query.name) {
this.searchForm.keywords = query.name;
}
this.getList(); this.getList();
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 重置 // 重置
rest() { rest() {
this.searchForm = {alarmType:''}; this.searchForm = { alarmType: "" };
this.currentPage = 1; this.currentPage = 1;
this.pageSize = 10; this.pageSize = 10;
this.fenceId = ""; this.fenceId = "";
......
...@@ -171,11 +171,11 @@ export default { ...@@ -171,11 +171,11 @@ export default {
// 查看详情 // 查看详情
lookDetail(row) { lookDetail(row) {
console.log(row);
let path = `/trialRun#/alarmCenter/fence`; let path = `/trialRun#/alarmCenter/fence`;
let endPath = `${path}?fenceId=${row.id}&name=${row.fenceName}`
this.$root.parentCommon.setBreadCrumbs(path); this.$root.parentCommon.setBreadCrumbs(path);
history.pushState({ fenceId: row.id }, path, path); history.pushState({}, endPath, endPath);
//this.$router.push({ name: "fenceAlarm", query: { fenceId: row.id } }); //this.$router.push({ path: path, query: { fenceId: row.id,name:row.name } });
}, },
// 导出excel // 导出excel
......
<template>
<div class="system-container">
<div class="container">
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="设备号|姓名|车架号|业务工单号" class="a_input" maxlength="20" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 按钮区域 开始 -->
<div class="links_group">
<span>统计列表详情-车辆纬度</span>
<el-button class="pull-right" type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :request="GET_FAKEOFFLINE_LIST" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookDetail(scope)" v-if="scope.locationFlag == 1">查看位置</el-link>
</div>
</glsx-table>
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table/table";
import {
GET_JOURNEYS_SEARCH,
GET_JOURNEYS_EXPORT,
GET_JOURNEYS_DAILYEXPORT,
GET_FAKEOFFLINE_LIST,
GET_FAKEOFFLINE_EXPORT,
GET_FAKEOFFLINE_TEMPLATEFILES,
IMPORT_FAKEOFFLINE_FILES,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
import moment, { max } from "moment";
import GlsxDialog from "@/components/dialog";
export default {
name:'StatisticsCar',
components: {
GlsxTable,
GlsxOrganization,
GlsxDialog,
},
data() {
return {
searchForm: {},
tableData: [],
columnList: [
{ label: "工单号", prop: "bizOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sns" },
{ label: "车架号", prop: "vin" },
{ label: "假性离线原因", prop: "reason" },
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
cloading: false,
loading: false,
aloading: false,
isTimeOut: false,
sTime: "",
eTime: "",
pickerOptions: {
onPick: ({ maxDate, minDate }) => {
this.sTime = minDate || "";
this.eTime = maxDate || "";
if (maxDate && minDate) {
let m = moment(maxDate).diff(moment(minDate), "days");
if (m > 60) {
this.isTimeOut = true;
} else {
this.isTimeOut = false;
}
this.eTime = "";
this.sTime = "";
}
},
},
showDialog: false,
uploadFile: {},
showResult: false,
uploadHeaders: {},
uploadResult: {},
IMPORT_FAKEOFFLINE_FILES,
fileList: [],
acceptFile: ".xlsx,.xls",
GET_FAKEOFFLINE_LIST
};
},
mounted() {
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
//this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
delete oParams.orgName;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum);
oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
GET_FAKEOFFLINE_LIST(oParams)
.then((res) => {
this.loading = false;
let { data } = res;
let { list, totalElements } = data;
this.pageTotal = totalElements || 0;
this.tableData = list || [];
})
.catch((error) => {
this.loading = false;
});
},
// 查看详情
lookDetail(row) {
console.log(row);
let o = window.location.origin;
let query = { vin: row.vin };
//let path = "/trialRun#/reportManage/map";
let path = `/oEshield/#/monitor/activeLocation`;
//history.pushState(query, path, path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path + "?sns=" + row.sns);
//this.$router.push({ name: "mileageDetail", query: { vin: row.vin } });
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_FAKEOFFLINE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
});
// _this.$Common.exportExcel({
// url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`,
// method: "GET",
// data: oParams,
// fileName: "里程统计报表",
// success: () => {
// _this.dloading = false;
// },
// fail: () => {
// _this.dloading = false;
// },
// });
},
// 重置
rest() {
this.searchForm = {};
this.$refs.glsxTable.rest();
this.getList();
},
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
this.fileList = [file];
}
},
// 打开批量导入弹框
openDialog() {
this.showDialog = true;
},
// 关闭弹框
closeDialog() {
this.showDialog = false;
this.uploadFile = {};
this.uploadResult = {};
this.showResult = false;
},
// 上传文件
saveFile() {
let o = this.uploadFile;
console.log(o);
if (!this.uploadFile.name) {
showToast({
message: "请选择上传文件",
});
return false;
}
let list = o.name.split(".");
let acceptFile = this.acceptFile;
let _type = list[list.length - 1];
console.log(_type);
let idx = acceptFile.includes(_type);
if (!idx) {
showToast({
message: `导入文件只支持${acceptFile}`,
});
return false;
}
this.aloading = true;
this.$refs.elUpload.submit();
},
// 监听文件上传成功
onSuccess(response, file, fileList) {
this.aloading = false;
if (response.code != 200) {
showToast({
message: response.message,
});
this.uploadFile = {};
this.$refs.elUpload.clearFiles();
return false;
}
this.uploadResult = response.data;
this.showResult = true;
this.getList();
},
// 下载模板
downloadTemplate() {
GET_FAKEOFFLINE_TEMPLATEFILES().then((res) => {
window.open(res.data);
});
},
// 下载失败模板
downloadFail() {
let o = this.uploadResult;
window.open(o.failFile);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</style>>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!