statistics_car.vue
5.63 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
<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_VEHICLE_SEARCH" :column="columnList">
</glsx-table>
<!-- 列表 end -->
</div>
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table/table";
import {
GET_OPEREPORT_VEHICLE_EXPORT,
GET_OPEREPORT_VEHICLE_SEARCH,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
import GlsxDialog from "@/components/dialog";
import { staticReportCarShortcuts } from "@/common";
export default {
name: "StatisticsCar",
components: {
GlsxTable,
GlsxOrganization,
GlsxDialog,
},
data() {
return {
searchForm: { queryTimeType: 1 },
tableData: [],
columnList: [
{ label: "业务工单号", prop: "bizOrderNo" },
{ label: "车牌号", prop: "licensePlate" },
{ label: "姓名", prop: "ownerName" },
{ label: "车架号", prop: "vin" },
{ label: "设备号", prop: "sns" },
{ label: "设备组合", prop: "deviceCompose" },
{ label: "工单接收时间", prop: "createdDate" },
{ label: "车辆激活时间", prop: "activateTime" },
{ label: "所属组织", prop: "belongLevels" },
{ label: "车型", prop: "modelName" },
{ label: "激活人", prop: "activator" },
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
loading: false,
GET_OPEREPORT_VEHICLE_SEARCH,
tableParams: {},
dataPickerOptions: {
shortcuts: staticReportCarShortcuts,
},
};
},
mounted() {},
methods: {
// 获取查询参数
getParams() {
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;
return oParams;
},
// 搜索
searchEvent() {
this.$refs.glsxTable.restParams();
this.tableParams = this.getParams();
},
// 监听树
onChange(e) {
this.filterVisible = false;
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_VEHICLE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
// window.open(res.data);
downFileByPath(res.data);
});
},
// 重置
rest() {
this.$refs.glsxTable.restParams()
this.tableParams = {};
this.searchForm = { queryTimeType: 1 };
//this.$refs.glsxTable.getList();
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</style>>