Commit a79496be authored by hanfeng's avatar hanfeng

解决冲突

parent ae53a87a
......@@ -113,4 +113,12 @@ export function checkEngineNum(engineNum, id) {
url: '/vehicle/vehicleInfo/exist_engineNum/' + engineNum + '?id=' + id,
method: 'get'
});
}
\ No newline at end of file
}
export function downloadExcel(query) {
return fetch({
url: '/vehicle/VehicleInformationDownload/excel',
method: 'get',
params: {vehiclePageQueryVoJson: query}
});
}
......@@ -165,7 +165,7 @@
</div>
</transition>
</el-form>
<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('search')">搜索</el-button>
<el-button class="filter-item" v-if="vehicleInfo_btn_add" style="margin-left: 10px;" @click="handleCreate"
type="primary" icon="edit">添加
</el-button>
......@@ -174,6 +174,7 @@
更多列
</el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">重置</el-button>
<el-button class="filter-item" type="primary" v-waves @click="handleFilter('download')">下载车辆信息Excel表</el-button>
</div>
......@@ -436,6 +437,29 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="终端号" prop="terminalNumber">
<el-input v-model="form.terminalNumber" placeholder="请输入终端号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SIM卡号" prop="simNumber">
<el-input v-model="form.simNumber" placeholder="请输入SIM卡号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="通讯类型" prop="CommunicationType">
<el-select class="filter-item" v-model="form.communicationType" placeholder="请选择通讯类型">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="item in getAllUseType() " :key="item.code" :label="item.val"
:value="item.code"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="保险公司" prop="insuranceCompany">
......@@ -767,9 +791,10 @@
delObj,
getSysRegionByIds,
checkCode,
downloadExcel,
checkVin,
checkEngineNum,
getArea,
checkVin,
checkEngineNum
} from '../../../api/vehicle/vehicleInfo/';
import {
......@@ -891,7 +916,11 @@
mileageLastUpdate: undefined,
// receiveTime: undefined,
drivingLicensePath: undefined,
remark: undefined
remark: undefined,
terminalNumber:undefined,
simNumber:undefined,
communicationType:undefined
},
rules: {
subordinateBranchName: [
......@@ -1647,6 +1676,41 @@
}
this.getList();
},
/**
* 下载车辆信息excel表
* */
download(){
this.listLoading = true;
let listQueryTemp = this.fillDateRange2Object(this.listQuery, 'mRange', 'mRangeDateStart', 'mRangeDateEnd');
listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'aVRange', 'aVRangeDateStart', 'aVRangeDateEnd');
listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'insuranceDateRange', 'insuranceDateRangeStart', 'insuranceDateRangeEnd');
if (!this.state1) {
listQueryTemp.subordinateBranch = undefined;
}
if (!this.vehicleArr) {
listQueryTemp.modelId = undefined;
}
downloadExcel(listQueryTemp).then(res=>{
const content = res
const blob = new Blob([content])
const fileName = '车辆信息.xlsx'
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName)
}
})
},
/**
* 出车modal传递回来的数据
* */
......@@ -2130,14 +2194,14 @@
code: 4,
val: '出车'
},
6: {
6: {
code: 6,
val: '维修中'
},
7: {
code: 7,
val: '保养中'
}
7: {
code: 7,
val: '保养中'
}
};
},
getBrand: function (code) {
......@@ -2196,7 +2260,7 @@
let regions = getRegionByCodes([branchCompany.addrProvince, branchCompany.addrCity, branchCompany.addrTown]);
return regions[0].name + ' ' + regions[1].name + ' ' + regions[2].name + ' ';
},
handleFilter() {
handleFilter(p) {
let t = this;
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
......@@ -2204,7 +2268,14 @@
if(t.listQuery){
localStorage.setItem("vehicleInfo", JSON.stringify(this.listQuery));
}
this.getList();
//搜索
if (p=='search') {
this.getList();
}
//下载
if (p=='download') {
this.download()
}
} else {
return false;
}
......
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