Commit aac62864 authored by libin's avatar libin

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

parent a37ae453
...@@ -10,22 +10,42 @@ ...@@ -10,22 +10,42 @@
type="date" type="date"
:editable="false" :editable="false"
format="yyyy-MM-dd" format="yyyy-MM-dd"
prop = "time" prop="time"
placeholder="请选择日期"> placeholder="请选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item> <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-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item > <el-form-item>
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号" <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input> v-model="listQuery.numberPlate"></el-input>
</el-form-item> </el-form-item>
</el-col> </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-col :span="5">
<el-form-item> <el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
...@@ -66,9 +86,9 @@ ...@@ -66,9 +86,9 @@
width="65"> width="65">
</el-table-column> </el-table-column>
<!--<el-table-column align="center" label="编号" width="65">--> <!--<el-table-column align="center" label="编号" width="65">-->
<!--<template scope="scope">--> <!--<template scope="scope">-->
<!--<span>{{scope.row.id}}</span>--> <!--<span>{{scope.row.id}}</span>-->
<!--</template>--> <!--</template>-->
<!--</el-table-column>--> <!--</el-table-column>-->
<el-table-column align="center" label="车牌号" width="120"> <el-table-column align="center" label="车牌号" width="120">
<template scope="scope"> <template scope="scope">
...@@ -76,75 +96,75 @@ ...@@ -76,75 +96,75 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" align="center" label="出车时间"> <el-table-column width="200" align="center" label="出车时间">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.departureTime}}</span> <span>{{scope.row.departureTime}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="使用人"> <el-table-column width="100" align="center" label="使用人">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.user}}</span> <span>{{scope.row.user}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" align="center" label="出车地点"> <el-table-column width="200" align="center" label="出车地点">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.departureName}}</span> <span>{{scope.row.departureName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" align="center" label="还车时间"> <el-table-column width="200" align="center" label="还车时间">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.arrivalTime}}</span> <span>{{scope.row.arrivalTime}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="还车人"> <el-table-column width="100" align="center" label="还车人">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.recycleMan}}</span> <span>{{scope.row.recycleMan}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" align="center" label="还车地点"> <el-table-column width="200" align="center" label="还车地点">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.arrivalName}}</span> <span>{{scope.row.arrivalName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="150" align="center" label="本次出行天数"> <el-table-column width="150" align="center" label="本次出行天数">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.departureDay}}</span> <span>{{scope.row.departureDay}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="150" align="center" label="本次出行公里"> <el-table-column width="150" align="center" label="本次出行公里">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.mileage}}</span> <span>{{scope.row.mileage}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="验车人"> <el-table-column width="100" align="center" label="验车人">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.checkMan}}</span> <span>{{scope.row.checkMan}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="用途"> <el-table-column width="100" align="center" label="用途">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.use}}</span> <span>{{scope.row.use}}</span>
</template> </template>
</el-table-column> </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"> <template scope="scope">
<span>{{scope.row.userTel}}</span> <span>{{scope.row.userTel}}</span>
</template> </template>
</el-table-column> </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"> <template scope="scope">
<span>{{scope.row.checkManTel}}</span> <span>{{scope.row.checkManTel}}</span>
</template> </template>
</el-table-column> </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"> <template scope="scope">
<span>{{scope.row.mileageStart}}</span> <span>{{scope.row.mileageStart}}</span>
</template> </template>
</el-table-column> </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"> <template scope="scope">
<span>{{scope.row.mileageEnd}}</span> <span>{{scope.row.mileageEnd}}</span>
</template> </template>
...@@ -182,129 +202,164 @@ ...@@ -182,129 +202,164 @@
} }
</style> </style>
<script> <script>
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
import { import {
page, page,
statistic statistic
} from '../../../api/vehicle/departureLog'; } from '../../../api/vehicle/departureLog';
import { import {
toEast8Date, getAllCompany,
deepCopyDate, getAll
newEast8Date } from 'api/base_info/branch_company/';
} from 'utils/dateUtils'; import {
export default { getAllZone
name: 'vehicleDepartureLog', } from 'api/base_info/constant/';
data() { import {
return { getAllBranchCompanyByZoneId
showMoreMoreCol: false, } from 'api/order/rentVehicle';
form: { import {
id: null, toEast8Date,
numberPlate: null, deepCopyDate,
vehicleId: null, newEast8Date
use: null, } from 'utils/dateUtils';
user: null,
userTel: null, export default {
checkMan: null, name: 'vehicleDepartureLog',
checkManTel: null, data() {
recycleMan: null, return {
recycleManTel: null, showMoreMoreCol: false,
departureTime: null, form: {
arrivalTime: null, id: null,
mileageStart: null, numberPlate: null,
mileageEnd: null, vehicleId: null,
state: null use: null,
}, user: null,
rules: { userTel: null,
name: [ checkMan: null,
{ checkManTel: null,
required: true, recycleMan: null,
message: '请输入用户', recycleManTel: null,
trigger: 'blur' 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, created() {
total: null, const numberPlate = this.$route.query.numberPlate;
listLoading: true, if (numberPlate) {
listQuery: { this.listQuery.numberPlate = numberPlate;
page: 1, }
limit: 20, this.handleFilter();
time: "",
numberPlate: undefined
}, },
dialogStatus: '', computed: {
textMap: { ...mapGetters([
update: '编辑', 'elements'
create: '创建' ]),
//获取大区列表
getAllZoneList() {
return getAllZone();
},
}, },
tableKey: 0, methods: {
dialogFormVisible: null, handleFilter() {
statisticVisiable: true, this.getList();
statisticData: { if (this.listQuery.numberPlate) {
departureCount: null, statistic({numberPlate: this.listQuery.numberPlate}).then(response => {
departureDay: null, this.statisticData = response.data;
departureMileage: null });
} this.statisticVisiable = true;
} }
}, },
created() { dateToString: function (date) {
const numberPlate = this.$route.query.numberPlate; var year = date.getFullYear();
if (numberPlate) { var month = (date.getMonth() + 1).toString();
this.listQuery.numberPlate = numberPlate; var day = (date.getDate()).toString();
} if (month.length == 1) {
this.handleFilter(); month = "0" + month;
}, }
computed: { if (day.length == 1) {
...mapGetters([ day = "0" + day;
'elements' }
]) var dateTime = year + "-" + month + "-" + day;
}, return dateTime;
methods: { },
handleFilter() { getList() {
this.getList(); this.listLoading = true;
if (this.listQuery.numberPlate) { if (!this.listQuery.numberPlate) {
statistic({numberPlate: this.listQuery.numberPlate}).then(response => { this.statisticVisiable = false;
this.statisticData = response.data; }
}); if (this.listQuery.time) {
this.statisticVisiable = true; 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> </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