Commit fcbe9295 authored by lixy's avatar lixy

出行记录

parent 42376166
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-form>
<el-row>
<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 v-show="statisticVisiable">
<el-row style="text-align: center;margin-top: 10px;margin-bottom: 10px">
......@@ -124,7 +149,11 @@
page,
statistic
} from '../../../api/vehicle/departureLog';
import {
toEast8Date,
deepCopyDate,
newEast8Date
} from 'utils/dateUtils';
export default {
name: 'vehicleDepartureLog',
data() {
......@@ -161,6 +190,7 @@
listQuery: {
page: 1,
limit: 20,
time: "",
numberPlate: undefined
},
dialogStatus: '',
......@@ -193,18 +223,34 @@
methods: {
handleFilter() {
this.getList();
if (this.listQuery.numberPlate) {
statistic({numberPlate: this.listQuery.numberPlate}).then(response => {
this.statisticData = response.data;
});
this.statisticVisiable = true;
// if (this.listQuery.numberPlate) {
// statistic({numberPlate: this.listQuery.numberPlate}).then(response => {
// this.statisticData = response.data;
// });
// 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() {
this.listLoading = true;
if (!this.listQuery.numberPlate) {
this.statisticVisiable = false;
}
if(this.listQuery.time){
this.listQuery.time = this.dateToString(this.listQuery.time);
}
page(this.listQuery)
.then(response => {
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