Commit aac62864 authored by libin's avatar libin

出车记录添加出车公司查询

parent a37ae453
......@@ -10,22 +10,42 @@
type="date"
:editable="false"
format="yyyy-MM-dd"
prop = "time"
prop="time"
placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item>
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code"
placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item >
<el-form-item>
<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-row>
<el-row>
<el-col :span="5">
<el-form-item label="所属大区">
<el-select class="filter-item" v-model="listQuery.zoneId" placeholder="请选择" @change="getProvinceRegions">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in getAllZoneList" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="出车分公司">
<el-select class="filter-item" v-model="listQuery.departureId" placeholder="请选择"
@change="getAllBranchCompanyChange">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in allBranchCompany" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
......@@ -66,9 +86,9 @@
width="65">
</el-table-column>
<!--<el-table-column align="center" label="编号" width="65">-->
<!--<template scope="scope">-->
<!--<span>{{scope.row.id}}</span>-->
<!--</template>-->
<!--<template scope="scope">-->
<!--<span>{{scope.row.id}}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="车牌号" width="120">
<template scope="scope">
......@@ -76,75 +96,75 @@
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车时间">
<template scope="scope">
<span>{{scope.row.departureTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="使用人">
<template scope="scope">
<span>{{scope.row.user}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车地点">
<template scope="scope">
<span>{{scope.row.departureName}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车时间">
<template scope="scope">
<span>{{scope.row.arrivalTime}}</span>
</template>
</el-table-column>
<template scope="scope">
<span>{{scope.row.departureTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="使用人">
<template scope="scope">
<span>{{scope.row.user}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车地点">
<template scope="scope">
<span>{{scope.row.departureName}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车时间">
<template scope="scope">
<span>{{scope.row.arrivalTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="还车人">
<template scope="scope">
<span>{{scope.row.recycleMan}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车地点">
<template scope="scope">
<span>{{scope.row.arrivalName}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行天数">
<template scope="scope">
<span>{{scope.row.departureDay}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行公里">
<template scope="scope">
<span>{{scope.row.mileage}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="验车人">
<template scope="scope">
<span>{{scope.row.checkMan}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车地点">
<template scope="scope">
<span>{{scope.row.arrivalName}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行天数">
<template scope="scope">
<span>{{scope.row.departureDay}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行公里">
<template scope="scope">
<span>{{scope.row.mileage}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="验车人">
<template scope="scope">
<span>{{scope.row.checkMan}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="用途">
<template scope="scope">
<span>{{scope.row.use}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="使用人电话" v-if="showMoreMoreCol" >
<el-table-column width="200" align="center" label="使用人电话" v-if="showMoreMoreCol">
<template scope="scope">
<span>{{scope.row.userTel}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="验车人电话" v-if="showMoreMoreCol" >
<el-table-column width="200" align="center" label="验车人电话" v-if="showMoreMoreCol">
<template scope="scope">
<span>{{scope.row.checkManTel}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="开始公里数" v-if="showMoreMoreCol" >
<el-table-column width="100" align="center" label="开始公里数" v-if="showMoreMoreCol">
<template scope="scope">
<span>{{scope.row.mileageStart}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="结束公里数" v-if="showMoreMoreCol" >
<el-table-column width="100" align="center" label="结束公里数" v-if="showMoreMoreCol">
<template scope="scope">
<span>{{scope.row.mileageEnd}}</span>
</template>
......@@ -182,129 +202,164 @@
}
</style>
<script>
import {mapGetters} from 'vuex';
import {
page,
statistic
} from '../../../api/vehicle/departureLog';
import {
toEast8Date,
deepCopyDate,
newEast8Date
} from 'utils/dateUtils';
export default {
name: 'vehicleDepartureLog',
data() {
return {
showMoreMoreCol: false,
form: {
id: null,
numberPlate: null,
vehicleId: null,
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
recycleMan: null,
recycleManTel: null,
departureTime: null,
arrivalTime: null,
mileageStart: null,
mileageEnd: null,
state: null
},
rules: {
name: [
{
required: true,
message: '请输入用户',
trigger: 'blur'
import {mapGetters} from 'vuex';
import {
page,
statistic
} from '../../../api/vehicle/departureLog';
import {
getAllCompany,
getAll
} from 'api/base_info/branch_company/';
import {
getAllZone
} from 'api/base_info/constant/';
import {
getAllBranchCompanyByZoneId
} from 'api/order/rentVehicle';
import {
toEast8Date,
deepCopyDate,
newEast8Date
} from 'utils/dateUtils';
export default {
name: 'vehicleDepartureLog',
data() {
return {
showMoreMoreCol: false,
form: {
id: null,
numberPlate: null,
vehicleId: null,
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
recycleMan: null,
recycleManTel: null,
departureTime: null,
arrivalTime: null,
mileageStart: null,
mileageEnd: null,
state: null,
},
rules: {
name: [
{
required: true,
message: '请输入用户',
trigger: 'blur'
}
]
},
list: null,
total: null,
listLoading: true,
allBranchCompany:[],
baranchQuery: {
zoneId:null
},
allZoneArr:[],//全部片区
listQuery: {
page: 1,
limit: 20,
time: "",
zoneId:undefined,
numberPlate: undefined,
departureId:undefined,
},
dialogStatus: '',
textMap: {
update: '编辑',
create: '创建'
},
tableKey: 0,
dialogFormVisible: null,
statisticVisiable: true,
statisticData: {
departureCount: null,
departureDay: null,
departureMileage: null
}
}
]
},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
time: "",
numberPlate: undefined
created() {
const numberPlate = this.$route.query.numberPlate;
if (numberPlate) {
this.listQuery.numberPlate = numberPlate;
}
this.handleFilter();
},
dialogStatus: '',
textMap: {
update: '编辑',
create: '创建'
computed: {
...mapGetters([
'elements'
]),
//获取大区列表
getAllZoneList() {
return getAllZone();
},
},
tableKey: 0,
dialogFormVisible: null,
statisticVisiable: true,
statisticData: {
departureCount: null,
departureDay: null,
departureMileage: null
}
}
},
created() {
const numberPlate = this.$route.query.numberPlate;
if (numberPlate) {
this.listQuery.numberPlate = numberPlate;
}
this.handleFilter();
},
computed: {
...mapGetters([
'elements'
])
},
methods: {
handleFilter() {
this.getList();
if (this.listQuery.numberPlate) {
statistic({numberPlate: this.listQuery.numberPlate}).then(response => {
this.statisticData = response.data;
});
this.statisticVisiable = true;
methods: {
handleFilter() {
this.getList();
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;
this.total = response.data.total;
this.listLoading = false;
})
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
//监听change事件
getProvinceRegions(item) {
this.listQuery.zoneId = item
this.baranchQuery.zoneId = item
this.listQuery.departureId = undefined;
getAllBranchCompanyByZoneId(this.baranchQuery)
.then(response => {
this.allBranchCompany = response.data;
})
},
getAllBranchCompanyChange(item) {
this.listQuery.departureId = item
},
}
},
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;
this.total = response.data.total;
this.listLoading = false;
})
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
}
}
}
</script>
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