You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1113 lines
30 KiB

<template>
<basic-container>
<avue-crud
v-if="edit"
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left>
<el-button
type="danger"
icon="el-icon-delete"
plain
v-if="permission.basicdataVehicle_delete"
@click="handleDelete"
>删 除
</el-button>
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ size, row, index }">
<el-button type="primary" text icon="el-icon-view" @click="editDeline(row)"
> </el-button
>
<el-button type="primary" text icon="el-icon-view" @click="viewDeline(row)"
> </el-button
>
</template>
</avue-crud>
<basicdata-vehicleform
@returnvehicle="returnvehicle"
:vehicleformdata="vehicleformdata"
:dicDatas="dicDatas"
v-if="!edit"
/>
</basic-container>
</template>
<script>
import {
getList,
getDetail,
add,
update,
remove,
getPage,
getVehicle,
} from '@/api/basicdata/basicdataVehicle';
import { getOwn } from '@/api/basicdata/basicdataDriverArtery';
import option from '@/option/basicdata/basicdataVehicle';
import { mapGetters } from 'vuex';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { dateNow } from '@/utils/date';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import BasicdataVehicleform from '/src/views/basicdata/vehicle/basicdataVehicleform.vue';
export default {
components: { BasicdataVehicleform },
data() {
return {
form: {},
query: {},
search: {},
loading: true,
vehicleformdata: {},
dicDatas: [],
edit: true, //修改
page: {
pageSize: 30,
currentPage: 1,
total: 0,
},
selectionList: [],
option: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: false,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: false,
editBtn: false,
selection: true,
dialogClickModal: false,
column: [
{
label: '主键',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '租户号',
prop: 'tenantId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '更新人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '更新时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '状态',
prop: 'status',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '是否已删除;1-未删除,2-已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '车牌号',
prop: 'vehicleNub',
type: 'input',
search: true,
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '承运商名称',
labelWidth: '150',
// width: 'fit-content',
width: '100px',
align: 'center',
span: 11,
prop: 'carrierName',
type: 'input',
editDisplay: false,
addDisplay: false,
},
{
label: '绑定驾驶人',
prop: 'vehicleOwners',
type: 'select',
labelWidth: '150',
width: '200px',
align: 'center',
span: 11,
multiple: true,
dicData: [],
// dicUrl: '/api/logpm-basicdata/vehicle/dictionary',
// props: {
// label: 'vehicleNub',
// value: 'id',
// },
// addDisplay: false,
// editDisplay: false,
// viewDisplay: false,
// hide: true,
},
{
label: '车辆来源',
prop: 'vehicleSource',
type: 'select',
search: true,
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_vehicle_source',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '是否车头',
prop: 'isHead',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=yes_no',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '挂车类型',
prop: 'trailerType',
type: 'select',
search: true,
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_trailer_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车辆类型',
prop: 'vehicleModel',
type: 'select',
search: true,
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_vehicle_model',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车厢类型',
prop: 'carType',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_car_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车长(M)',
prop: 'vehicleCommander',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '外廓高',
prop: 'vehicleHeight',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '付款方式',
prop: 'paymentMethod',
type: 'select',
search: true,
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
filterable: true,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basicdata_vehicle_paymentmethod',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '核定体积',
prop: 'approvedVolume',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '车牌颜色',
prop: 'licensePlateColor',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_plate_color',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车身颜色',
prop: 'vehicleColor',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_vehicle_color',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '能源类型',
prop: 'energyType',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_energy_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车牌类型',
prop: 'licensePlateType',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_plate_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '备注',
prop: 'notes',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
// {
// label: "车辆所属人",
// prop: "vehicleOwner",
// type: "input",
// labelWidth:'150',
// width:"100px",
// align:'center',
// span:11,
// },
{
label: '品牌型号',
prop: 'vehicleBrand',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '车辆代号',
prop: 'vehicleCode',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '发动机型号',
prop: 'engineCode',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '车辆总质量(T)',
prop: 'vehicleQuality',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: '整备质量(T)',
prop: 'curbWeight',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: '载荷质量(T)',
prop: 'loadMass',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: '外廓宽(M)',
prop: 'outerWidth',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: '到期时间',
prop: 'expirationTime',
type: 'input',
labelWidth: '150',
width: '100px',
align: 'center',
span: 11,
},
{
label: '道路运输证号',
prop: 'roadTransport',
type: 'input',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '经营许可证号',
prop: 'businessLicense',
type: 'input',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '车辆所属单位',
prop: 'vehicleUnit',
type: 'input',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '车辆所属单位电话',
prop: 'vehicleUnitPhone',
type: 'input',
labelWidth: '150',
width: '180px',
align: 'center',
span: 11,
},
{
label: '车辆所属人手机号',
prop: 'vehicleOwnerPhone',
type: 'input',
labelWidth: '150',
width: '180px',
align: 'center',
span: 11,
},
{
label: '车辆所属人身份证号',
prop: 'vehicleOwnerCard',
type: 'input',
labelWidth: '150',
width: '180px',
align: 'center',
span: 11,
},
{
label: '承运商',
prop: 'carrierId',
type: 'select',
labelWidth: '150',
width: '100px',
align: 'center',
search: true,
span: 11,
filterable: true,
dicUrl: '/api/logpm-basicdata/carrier/dictionary',
props: {
label: 'carrierName',
value: 'id',
},
rules: [{ required: true, message: '请选择承运商!', trigger: 'blur' }],
},
{
label: '车辆年审时间',
prop: 'reviewTime',
width: '120px',
align: 'center',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
labelWidth: '150',
span: 11,
},
{
label: '车辆年审有效期',
prop: 'reviewValidity',
type: 'input',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '车辆保险开始时间',
prop: 'insuranceStartTime',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '车辆保险结束时间',
prop: 'insuranceEndTime',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
},
{
label: '有无车身广告',
prop: 'bodyAdvertising',
type: 'select',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=yes_no',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车身广告更新时间',
prop: 'advertisementsNewTimes',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
labelWidth: '150',
width: '180px',
align: 'center',
span: 11,
},
// {
// label: "车辆挂靠公司",
// prop: "vehicleParkingCompany",
// type: "input",
// labelWidth:'150',
// width:"150px",
// align:'center',
// span:11,
// },
{
label: '是否有GPS',
prop: 'withGps',
type: 'select',
labelWidth: '150',
width: '150px',
align: 'center',
span: 11,
dicUrl: '/api/blade-system/dict-biz/dictionary?code=yes_no',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: 'GPS服务商',
prop: 'gpsServiceProvider',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: 'GPS型号',
prop: 'gpsModel',
type: 'input',
labelWidth: '150',
width: '120px',
align: 'center',
span: 11,
},
{
label: '行驶证正面照片',
prop: 'drivingLicensePhoto',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '行驶证照片反面',
prop: 'drivingLicensePhotoBack',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '许可证照片',
prop: 'licensePhoto',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '车辆照片(最新)',
prop: 'vehiclePhoto',
type: 'upload',
listType: 'picture-img',
dataType: 'string',
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
// limit: 3,
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '车尾照片',
prop: 'vehicleRearPhoto',
type: 'upload',
listType: 'picture-img',
dataType: 'string',
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
// limit: 3,
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '道路运输照片',
prop: 'roadTransportPhoto',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '人车合影照片',
prop: 'vehiclePeoplePhoto',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '保险卡照片',
prop: 'insuranceCardPhoto',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
labelWidth: '150',
span: 11,
multiple: false,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '车俩历史照片',
prop: 'historicPhotos',
type: 'upload',
listType: 'picture-card',
dataType: 'string',
labelWidth: '150',
span: 11,
multiple: true,
width: '200px',
align: 'left',
action: '/blade-resource/oss/endpoint/put-file',
limit: 3,
disabled: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
propsHttp: {
res: 'data',
url: 'link',
},
},
{
label: '预留1',
prop: 'reserve1',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '预留2',
prop: 'reserve2',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '预留3',
prop: 'reserve3',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '预留4',
prop: 'reserve4',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '预留5',
prop: 'reserve5',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
],
},
data: [],
};
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataVehicle_add, false),
viewBtn: this.validData(this.permission.basicdataVehicle_view, false),
delBtn: this.validData(this.permission.basicdataVehicle_delete, false),
editBtn: this.validData(this.permission.basicdataVehicle_edit, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
error => {
loading();
window.console.log(error);
}
);
},
editDeline(row) {
console.log('row>>>>>>>>>>>>>>>', row);
console.log('this.dicDatas>>>>>>>>>>>>>>>', this.dicDatas);
this.vehicleformdata = row;
this.vehicleformdata.view = false;
this.edit = false;
},
viewDeline(row) {
console.log('>>>>>>>>>>>>>>>', row);
this.vehicleformdata = row;
this.vehicleformdata.view = true;
console.log('this.vehicleformdata.view>>>>>>>>>>>>>>>', this.vehicleformdata.view);
this.edit = false;
},
returnvehicle(val) {
console.log('取消>>>>>', val);
this.edit = true;
},
rowUpdate(row, index, done, loading) {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
error => {
loading();
console.log(error);
}
);
},
rowDel(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-basicdataVehicle/basicdataVehicle/export-basicdataVehicle?${
this.website.tokenHeader
}=${getToken()}`;
const {} = this.query;
let values = {};
this.$confirm('是否导出数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `车辆信息表${dateNow()}.xlsx`);
NProgress.done();
});
});
},
beforeOpen(done, type) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
console.log('this.form>>>>>>>>>>>>>', this.form);
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const { vehicleNub, vehicleSource, trailerType, vehicleModel, paymentMethod, carrierId } =
this.query;
let values = {
vehicleNub: vehicleNub,
vehicleSource: vehicleSource,
trailerType: trailerType,
vehicleModel: vehicleModel,
paymentMethod: paymentMethod,
carrierId: carrierId,
};
getPage(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.option.column[10].dicData = [];
this.dicDatas = [];
//查询绑定人
this.getOwns();
this.loading = false;
this.selectionClear();
});
},
//查询绑定人
getOwns() {
getOwn().then(res => {
console.log('res.data.data>>>>>>>', res.data.data);
res.data.data.map(v => {
let value = {
label: v.name,
value: v.id,
};
this.option.column[10].dicData.push(value);
this.dicDatas.push(value);
});
});
},
},
};
</script>
<style scoped lang='scss'>
:deep(.avue-form__row){
margin-left:10px;
max-width:250px!important;
}
:deep(.avue-form__row){
margin-left:0;
}
:deep(.el-form-item__label){
width:auto !important;
}
:deep(.no-print){
max-width:120px !important;
margin-left:auto;
.el-button{
margin-right:0;
}
}
</style>