|
|
|
@ -32,6 +32,19 @@
|
|
|
|
|
@click="handleDelete" |
|
|
|
|
>删 除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
plain |
|
|
|
|
@click="ExportVehicle" |
|
|
|
|
>导 出 |
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
plain |
|
|
|
|
@click="VehicleImport" |
|
|
|
|
>导 入 |
|
|
|
|
</el-button> |
|
|
|
|
<!-- <el-button type="warning"--> |
|
|
|
|
<!-- plain--> |
|
|
|
|
<!-- icon="el-icon-download"--> |
|
|
|
@ -53,6 +66,15 @@
|
|
|
|
|
:dicDatas="dicDatas" |
|
|
|
|
v-if="!edit" |
|
|
|
|
/> |
|
|
|
|
<el-dialog title="车辆导入" append-to-body v-model="excelBox" width="555px"> |
|
|
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
|
|
|
|
<template #excelTemplate> |
|
|
|
|
<el-button type="primary" @click="handleTemplate"> |
|
|
|
|
点击下载<i class="el-icon-download el-icon--right"></i> |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-form> |
|
|
|
|
</el-dialog> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -65,6 +87,7 @@ import {
|
|
|
|
|
remove, |
|
|
|
|
getPage, |
|
|
|
|
getVehicle, |
|
|
|
|
$_Exportvehicle, |
|
|
|
|
} from '@/api/basicdata/basicdataVehicle'; |
|
|
|
|
import { getOwn } from '@/api/basicdata/basicdataDriverArtery'; |
|
|
|
|
import option from '@/option/basicdata/basicdataVehicle'; |
|
|
|
@ -76,11 +99,38 @@ import { dateNow } from '@/utils/date';
|
|
|
|
|
import NProgress from 'nprogress'; |
|
|
|
|
import 'nprogress/nprogress.css'; |
|
|
|
|
import BasicdataVehicleform from '/src/views/basicdata/vehicle/basicdataVehicleform.vue'; |
|
|
|
|
|
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
|
export default { |
|
|
|
|
components: { BasicdataVehicleform }, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
excelBox:true, |
|
|
|
|
excelForm: {}, |
|
|
|
|
excelOption: { |
|
|
|
|
submitBtn: false, |
|
|
|
|
emptyBtn: false, |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '文件上传', |
|
|
|
|
prop: 'excelFile', |
|
|
|
|
type: 'upload', |
|
|
|
|
drag: true, |
|
|
|
|
loadText: '文件上传,请稍等', |
|
|
|
|
span: 24, |
|
|
|
|
propsHttp: { |
|
|
|
|
res: 'data', |
|
|
|
|
}, |
|
|
|
|
tip: '请上传 .xls,.xlsx 标准格式文件', |
|
|
|
|
action: '/api/logpm-basicdata/vehicle/import-basicdataVehicle', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '模板下载', |
|
|
|
|
prop: 'excelTemplate', |
|
|
|
|
formslot: true, |
|
|
|
|
span: 24, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
form: {}, |
|
|
|
|
query: {}, |
|
|
|
|
search: {}, |
|
|
|
@ -1042,6 +1092,45 @@ export default {
|
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 导出车辆信息 |
|
|
|
|
ExportVehicle() { |
|
|
|
|
|
|
|
|
|
if(!this.selectionList.length){ |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '请勾选要导出的数据', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let downloadUrl = `/logpm-basicdata/vehicle/export-basicdataVehicle?${ |
|
|
|
|
this.website.tokenHeader |
|
|
|
|
}=${getToken()}`; |
|
|
|
|
let values = { |
|
|
|
|
ids:'', |
|
|
|
|
} |
|
|
|
|
values.ids = this.selectionList.map(item => item.id).join(','); |
|
|
|
|
this.$confirm('是否导出数据?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
this.loading=true |
|
|
|
|
NProgress.start(); |
|
|
|
|
exportBlob(downloadUrl, values).then(res => { |
|
|
|
|
downloadXls(res.data, `车辆信息导出${dateNow()}.xlsx`); |
|
|
|
|
NProgress.done(); |
|
|
|
|
this.loading=false |
|
|
|
|
}).catch(()=>{ |
|
|
|
|
this.loading=false |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 导入 |
|
|
|
|
VehicleImport(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
handleExport() { |
|
|
|
|
let downloadUrl = `/blade-basicdataVehicle/basicdataVehicle/export-basicdataVehicle?${ |
|
|
|
|
this.website.tokenHeader |
|
|
|
@ -1068,6 +1157,21 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
//下载模板 |
|
|
|
|
handleTemplate() { |
|
|
|
|
console.log('下载模板!!!'); |
|
|
|
|
exportBlob( |
|
|
|
|
`/api/logpm-basicdata/import-basicdataVehicle?${this.website.tokenHeader}=${getToken()}` |
|
|
|
|
).then(res => { |
|
|
|
|
downloadXls(res.data, '车辆信息导入模板.xlsx'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
uploadAfter(res, done, loading, column) { |
|
|
|
|
window.console.log(column); |
|
|
|
|
this.excelBox = false; |
|
|
|
|
this.refreshChange(); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|