shutdown.vue
7.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<template>
<div class="">
<div class="page_title">
<h2 class="h2">停驶报警</h2>
<h3 class="h3">用于统计和展示车辆的停驶报警数据(仅针对有线设备)</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="停驶时间:">
<el-radio-group v-model="searchForm.stayRange" class="el_radio_group">
<el-radio-button v-for="(item,index) in timeList" :key="index" :label="item.id">{{item.name}}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="激活区间:">
<el-date-picker v-model="searchForm.offDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 姓名 | 车架号 | 业务工单" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">停驶报警列表</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="序号" type="index" show-overflow-tooltip></el-table-column>
<el-table-column label="业务工单号" prop="bizOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
</el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn" show-overflow-tooltip>
<template slot-scope="{row}">{{row.sn||'--'}}</template>
</el-table-column>
<el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="车辆归属" prop="shopName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.shopName||'--'}}</template>
</el-table-column>
<el-table-column label="激活时间" prop="activeTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.activeTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后GPS时间" prop="lastGpsTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastGpsTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后基站时间" prop="lastBsTime" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastBsTime||'--'}}</template>
</el-table-column>
<el-table-column label="最后GPS定位地址" prop="lastGpsAddress" show-overflow-tooltip width="240">
<template slot-scope="{row}">{{row.lastGpsAddress||'--'}}</template>
</el-table-column>
<el-table-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>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="currentPage" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import { shutDownShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization";
import {
GET_ALARM_SHUTDOWN,
ALARM_SHUTDOWN_EXPORT,
} from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: { stayRange: 2 },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: shutDownShortcuts,
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
timeList: [
{ name: "近2天停驶", id: 2 },
{ name: "近7天停驶", id: 7 },
{ name: "超长停驶", id: 168 },
],
timeActive: 2,
};
},
created() {
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = { stayRange: 2 };
this.currentPage = 1;
this.pageSize = 10;
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let n = oParams.offDate;
if (n && n.length > 0) {
oParams.activeStartTime = n[0];
oParams.activeEndTime = n[1];
}
delete oParams.offDate;
delete oParams.orgName;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if (current) {
this.currentPage = current;
}
GET_ALARM_SHUTDOWN(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
this.tableData = obj.list;
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_SHUTDOWN_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
downFileByPath(res.data);
//window.open(res.data);
});
},
// 查看常驻地
lookDetail(row) {
let path = `/oEshield#/monitor/resident?sn=${row.sn}&name=${encodeURI(row.ownerName)}&standno=${row.vin}&locationType=${row.locationType}`;
window.open(path);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
.el_link {
margin: 0 10px 0 0;
}
.links_group:after {
display: none;
}
.el_radio_group {
vertical-align: middle;
}
.table_box {
margin-top: 0;
}
</style>