Commit fcbe9295 authored by lixy's avatar lixy

出行记录

parent 42376166
<template> <template>
<div class="app-container calendar-list-container"> <div class="app-container calendar-list-container">
<div class="filter-container"> <div class="filter-container">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号" <el-form>
v-model="listQuery.numberPlate"></el-input> <el-row>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button> <el-col :span="4">
<el-form-item label="日期">
<el-date-picker
v-model="listQuery.time"
type="date"
:editable="false"
format="yyyy-MM-dd"
prop = "time"
placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="车牌号">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
<div v-show="statisticVisiable"> <div v-show="statisticVisiable">
<el-row style="text-align: center;margin-top: 10px;margin-bottom: 10px"> <el-row style="text-align: center;margin-top: 10px;margin-bottom: 10px">
...@@ -124,7 +149,11 @@ ...@@ -124,7 +149,11 @@
page, page,
statistic statistic
} from '../../../api/vehicle/departureLog'; } from '../../../api/vehicle/departureLog';
import {
toEast8Date,
deepCopyDate,
newEast8Date
} from 'utils/dateUtils';
export default { export default {
name: 'vehicleDepartureLog', name: 'vehicleDepartureLog',
data() { data() {
...@@ -161,6 +190,7 @@ ...@@ -161,6 +190,7 @@
listQuery: { listQuery: {
page: 1, page: 1,
limit: 20, limit: 20,
time: "",
numberPlate: undefined numberPlate: undefined
}, },
dialogStatus: '', dialogStatus: '',
...@@ -193,18 +223,34 @@ ...@@ -193,18 +223,34 @@
methods: { methods: {
handleFilter() { handleFilter() {
this.getList(); this.getList();
if (this.listQuery.numberPlate) { // if (this.listQuery.numberPlate) {
statistic({numberPlate: this.listQuery.numberPlate}).then(response => { // statistic({numberPlate: this.listQuery.numberPlate}).then(response => {
this.statisticData = response.data; // this.statisticData = response.data;
}); // });
this.statisticVisiable = true; // this.statisticVisiable = true;
// }
},
dateToString: function(date){
var year = date.getFullYear();
var month =(date.getMonth() + 1).toString();
var day = (date.getDate()).toString();
if (month.length == 1) {
month = "0" + month;
}
if (day.length == 1) {
day = "0" + day;
} }
var dateTime = year + "-" + month + "-" + day;
return dateTime;
}, },
getList() { getList() {
this.listLoading = true; this.listLoading = true;
if (!this.listQuery.numberPlate) { if (!this.listQuery.numberPlate) {
this.statisticVisiable = false; this.statisticVisiable = false;
} }
if(this.listQuery.time){
this.listQuery.time = this.dateToString(this.listQuery.time);
}
page(this.listQuery) page(this.listQuery)
.then(response => { .then(response => {
this.list = response.data.list; this.list = response.data.list;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment