...
|
...
|
@@ -2,13 +2,13 @@ |
|
|
<el-container>
|
|
|
<el-main>
|
|
|
<!--面包屑导航区域-->
|
|
|
<!-- <div>-->
|
|
|
<!-- <el-breadcrumb separator-class="el-icon-arrow-right">-->
|
|
|
<!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>-->
|
|
|
<!-- <el-breadcrumb-item>车辆调度</el-breadcrumb-item>-->
|
|
|
<!-- <el-breadcrumb-item>车辆信息</el-breadcrumb-item>-->
|
|
|
<!-- </el-breadcrumb>-->
|
|
|
<!-- </div>-->
|
|
|
<!-- <div>-->
|
|
|
<!-- <el-breadcrumb separator-class="el-icon-arrow-right">-->
|
|
|
<!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>-->
|
|
|
<!-- <el-breadcrumb-item>车辆调度</el-breadcrumb-item>-->
|
|
|
<!-- <el-breadcrumb-item>车辆信息</el-breadcrumb-item>-->
|
|
|
<!-- </el-breadcrumb>-->
|
|
|
<!-- </div>-->
|
|
|
<el-card style="background-color: #F5F7FA">
|
|
|
<!--搜索区域-->
|
|
|
<div>
|
...
|
...
|
@@ -45,11 +45,13 @@ |
|
|
<el-row style="margin-top: 20px;">
|
|
|
<el-button type="primary" @click="getVehicleInfoList">查询车辆信息</el-button>
|
|
|
<el-button type="success" @click="addVehicleInfoFormVisible = true">增加车辆信息</el-button>
|
|
|
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<!--车辆信息列表区域-->
|
|
|
<div style="margin-top: 20px;">
|
|
|
<el-table :data="vehicleInfoList" border stripe highlight-current-row v-loading="listLoading" element-loading-text="拼命加载中">
|
|
|
<el-table :data="vehicleInfoList" border stripe highlight-current-row v-loading="listLoading"
|
|
|
element-loading-text="拼命加载中">
|
|
|
<el-table-column type="index" align="center"></el-table-column>
|
|
|
<el-table-column label="车辆类型" prop="vehicleType" align="center" width="120">
|
|
|
<template slot-scope="scope">
|
...
|
...
|
@@ -61,8 +63,10 @@ |
|
|
<span v-if="scope.row.vehicleType ==='6'">叉车</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="车牌号码" prop="licensePlateNumber" align="center" width="130"></el-table-column>
|
|
|
<el-table-column label="车辆载重/Kg" prop="vehicleLoad" align="center" width="110"></el-table-column>
|
|
|
<el-table-column label="车牌号码" prop="licensePlateNumber" align="center"
|
|
|
width="130"></el-table-column>
|
|
|
<el-table-column label="车辆载重/Kg" prop="vehicleLoad" align="center"
|
|
|
width="110"></el-table-column>
|
|
|
<el-table-column label="挂车与否" prop="isTrailer" align="center" width="110">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.isTrailer ==='1'">有挂车</span>
|
...
|
...
|
@@ -79,8 +83,10 @@ |
|
|
<span v-if="scope.row.vehicleStatus ==='5'">保养状态</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="车辆公司" prop="vehicleCompany" align="center" width="200"></el-table-column>
|
|
|
<el-table-column label="行驶证号" prop="drivingLicenseNumber" align="center" width="160"></el-table-column>
|
|
|
<el-table-column label="车辆公司" prop="vehicleCompany" align="center"
|
|
|
width="200"></el-table-column>
|
|
|
<el-table-column label="行驶证号" prop="drivingLicenseNumber" align="center"
|
|
|
width="160"></el-table-column>
|
|
|
<el-table-column label="操作" width="200px" align="center" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<!--查看按钮-->
|
...
|
...
|
@@ -126,11 +132,13 @@ |
|
|
<div style="margin-left: 30px">
|
|
|
<br>
|
|
|
<el-form-item label="车牌号码:" prop="licensePlateNumber">
|
|
|
<el-input v-model="addVehicleInfoForm.licensePlateNumber" clearable style="width: 300px;"
|
|
|
<el-input v-model="addVehicleInfoForm.licensePlateNumber" clearable
|
|
|
style="width: 300px;"
|
|
|
placeholder="请输入车牌号码"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="行驶证号:" prop="drivingLicenseNumber">
|
|
|
<el-input v-model="addVehicleInfoForm.drivingLicenseNumber" clearable style="width: 300px;"
|
|
|
<el-input v-model="addVehicleInfoForm.drivingLicenseNumber" clearable
|
|
|
style="width: 300px;"
|
|
|
placeholder="请输入车辆行驶证号"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆类型:" prop="vehicleType">
|
...
|
...
|
@@ -188,11 +196,13 @@ |
|
|
<div style="margin-left: 30px">
|
|
|
<br>
|
|
|
<el-form-item label="车牌号码:" prop="licensePlateNumber">
|
|
|
<el-input v-model="editVehicleInfoForm.licensePlateNumber" clearable style="width: 300px;"
|
|
|
<el-input v-model="editVehicleInfoForm.licensePlateNumber" clearable
|
|
|
style="width: 300px;"
|
|
|
placeholder="请输入车牌号码"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="行驶证号:" prop="drivingLicenseNumber">
|
|
|
<el-input v-model="editVehicleInfoForm.drivingLicenseNumber" clearable style="width: 300px;"
|
|
|
<el-input v-model="editVehicleInfoForm.drivingLicenseNumber" clearable
|
|
|
style="width: 300px;"
|
|
|
placeholder="请输入车辆行驶证号"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆类型:" prop="vehicleType">
|
...
|
...
|
@@ -207,13 +217,15 @@ |
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆载重:" prop="vehicleLoad">
|
|
|
<el-input-number style="width: 200px" v-model="editVehicleInfoForm.vehicleLoad" clearable
|
|
|
<el-input-number style="width: 200px" v-model="editVehicleInfoForm.vehicleLoad"
|
|
|
clearable
|
|
|
:min="10" :max="10000" controls-position="right">
|
|
|
</el-input-number>
|
|
|
<span style="margin-left:5px;font-size: 18px">Kg</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆状态:" prop="vehicleStatus">
|
|
|
<el-select v-model="editVehicleInfoForm.vehicleStatus" clearable style="width: 300px" clearable placeholder="请选择车辆状态">
|
|
|
<el-select v-model="editVehicleInfoForm.vehicleStatus" clearable style="width: 300px"
|
|
|
clearable placeholder="请选择车辆状态">
|
|
|
<el-option
|
|
|
v-for="item in vehicleStatusList"
|
|
|
:key="item.value"
|
...
|
...
|
@@ -223,7 +235,8 @@ |
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="有无挂车:" prop="vehicleType">
|
|
|
<el-select v-model="editVehicleInfoForm.isTrailer" clearable style="width: 300px" clearable
|
|
|
<el-select v-model="editVehicleInfoForm.isTrailer" clearable style="width: 300px"
|
|
|
clearable
|
|
|
placeholder="请选择有无挂车">
|
|
|
<el-option
|
|
|
v-for="item in isTrailerList"
|
...
|
...
|
@@ -237,8 +250,9 @@ |
|
|
<el-input v-model="editVehicleInfoForm.vehicleCompany" clearable style="width: 300px;"
|
|
|
placeholder="请输入车辆公司"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="空闲时间:" prop="freetime" >
|
|
|
<el-date-picker v-model="editVehicleInfoForm.freetime" type="datetime" style="width: 300px;"
|
|
|
<el-form-item label="空闲时间:" prop="freetime">
|
|
|
<el-date-picker v-model="editVehicleInfoForm.freetime" type="datetime"
|
|
|
style="width: 300px;"
|
|
|
placeholder="选择调度时间"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<br>
|
...
|
...
|
@@ -452,77 +466,80 @@ |
|
|
/**
|
|
|
* 管理员端,获取车辆信息列表
|
|
|
*/
|
|
|
async getVehicleInfoList() {
|
|
|
getVehicleInfoList() {
|
|
|
//开启加载
|
|
|
this.listLoading = true;
|
|
|
const {data: res} = await selectVehicleInfoList(this.queryInfo).catch(error => {
|
|
|
selectVehicleInfoList(this.queryInfo).then((response) => {
|
|
|
let res = response.data;
|
|
|
if (res.code !== '200') return this.$message.error('获取车辆信息列表失败');
|
|
|
// 获取车辆信息列表数据
|
|
|
this.vehicleInfoList = res.data.list;
|
|
|
// 获取列表的总记录数
|
|
|
this.total = res.data.total;
|
|
|
//关闭加载
|
|
|
this.listLoading = false;
|
|
|
this.$message.success('获取车辆信息列表,成功');
|
|
|
}).catch(error => {
|
|
|
this.listLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
if (res.code !== '200') return this.$message.error('获取车辆信息列表失败');
|
|
|
// 获取车辆信息列表数据
|
|
|
this.vehicleInfoList = res.data.list;
|
|
|
// 获取列表的总记录数
|
|
|
this.total = res.data.total;
|
|
|
//关闭加载
|
|
|
this.listLoading = false;
|
|
|
this.$message.success('获取车辆信息列表,成功');
|
|
|
},
|
|
|
/**
|
|
|
* 管理员端,增加车辆信息
|
|
|
*/
|
|
|
addVehicleInfo() {
|
|
|
/*进行表单的预验证*/
|
|
|
this.$refs.addVehicleInfoFormRef.validate(async valid => {
|
|
|
this.$refs.addVehicleInfoFormRef.validate(valid => {
|
|
|
// 未通过,表单预校验
|
|
|
if (!valid) return;
|
|
|
// 通过,表单预检验,发起添加车辆信息的网络请求,开启加载
|
|
|
this.addLoading = true;
|
|
|
const {data: res} = await insertVehicleInfo(this.addVehicleInfoForm).catch(error => {
|
|
|
insertVehicleInfo(this.addVehicleInfoForm).then((response) => {
|
|
|
let res = response.data;
|
|
|
//添加调度记录信息,失败
|
|
|
if (res.code !== '200') return this.$message.error('添加车辆信息,失败');
|
|
|
//关闭加载
|
|
|
this.addLoading = false;
|
|
|
this.$message.success('添加调度记录信息,成功');
|
|
|
//隐藏对话框
|
|
|
this.addVehicleInfoFormVisible = false;
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
}).catch(error => {
|
|
|
this.addLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
//添加调度记录信息,失败
|
|
|
if (res.code !== '200') return this.$message.error('添加车辆信息,失败');
|
|
|
//关闭加载
|
|
|
this.addLoading = false;
|
|
|
this.$message.success('添加调度记录信息,成功');
|
|
|
//隐藏对话框
|
|
|
this.addVehicleInfoFormVisible = false;
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 管理员端,删除车辆信息
|
|
|
*/
|
|
|
async removeVehicleInfo(index,row) {
|
|
|
removeVehicleInfo(index, row) {
|
|
|
//弹框询问是否删除车辆信息
|
|
|
const confirmResult = await this.$confirm('此操作永久删除该车辆信息, 是否继续?', '警告', {
|
|
|
this.$confirm('此操作永久删除该车辆信息, 是否继续?', '警告', {
|
|
|
confirmButtonText: '确定删除',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}
|
|
|
).catch(error => {
|
|
|
return error;
|
|
|
});
|
|
|
if (confirmResult !== 'confirm') {
|
|
|
return this.$message.info('已取消删除');
|
|
|
}
|
|
|
//开启加载
|
|
|
this.delLoading = true;
|
|
|
const {data: res} = await deleteVehicleInfo(row).catch(error => {
|
|
|
this.delLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error('删除车辆信息,失败');
|
|
|
}
|
|
|
//关闭加载
|
|
|
this.delLoading = false;
|
|
|
this.$message.success('删除车辆信息,成功!');
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
).then(() => {
|
|
|
//开启加载
|
|
|
this.delLoading = true;
|
|
|
deleteVehicleInfo(row).then((response) => {
|
|
|
let res = response.data;
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error('删除车辆信息,失败');
|
|
|
}
|
|
|
//关闭加载
|
|
|
this.delLoading = false;
|
|
|
this.$message.success('删除车辆信息,成功!');
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
}).catch(error => {
|
|
|
this.delLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
}).catch();
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -530,25 +547,27 @@ |
|
|
*/
|
|
|
editVehicleInfo() {
|
|
|
/*进行表单的预验证*/
|
|
|
this.$refs.editVehicleInfoFormRef.validate(async valid => {
|
|
|
this.$refs.editVehicleInfoFormRef.validate(valid => {
|
|
|
// 未通过,表单预校验
|
|
|
if (!valid) return;
|
|
|
// 通过,表单预校验,开启加载
|
|
|
this.editLoading = true;
|
|
|
const {data: res} = await updateVehicleInfo(this.editVehicleInfoForm).catch(error => {
|
|
|
updateVehicleInfo(this.editVehicleInfoForm).then((response) => {
|
|
|
let res = response.data;
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error('修改车辆信息,失败');
|
|
|
}
|
|
|
//关闭加载
|
|
|
this.editLoading = false;
|
|
|
this.$message.success('修改车辆信息,成功!');
|
|
|
//关闭编辑车辆信息对话框
|
|
|
this.editDialogVisible = false;
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
}).catch(error => {
|
|
|
this.editLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error('修改车辆信息,失败');
|
|
|
}
|
|
|
//关闭加载
|
|
|
this.editLoading = false;
|
|
|
this.$message.success('修改车辆信息,成功!');
|
|
|
//关闭编辑车辆信息对话框
|
|
|
this.editDialogVisible = false;
|
|
|
//刷新车辆信息列表
|
|
|
this.getVehicleInfoList();
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -567,7 +586,7 @@ |
|
|
/**
|
|
|
* 打开编辑车辆信息对话框
|
|
|
*/
|
|
|
showEditDialogVisible(index,row) {
|
|
|
showEditDialogVisible(index, row) {
|
|
|
this.editVehicleInfoForm = Object.assign({}, row);
|
|
|
this.editDialogVisible = true;
|
|
|
},
|
...
|
...
|
|