代码补正

This commit is contained in:
xiao-fajia 2024-08-27 14:46:31 +08:00
parent eb126928f2
commit e7ade0eb34
5 changed files with 47 additions and 12 deletions

View File

@ -34,7 +34,7 @@
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" prop="sort" /> <!-- <el-table-column label="排序" align="center" prop="sort" />-->
<el-table-column label="扣车地址" align="center" prop="dictLabel"> <el-table-column label="扣车地址" align="center" prop="dictLabel">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -53,3 +53,12 @@ export function listCar() {
} }
}) })
} }
export function exportCarSpend(params) {
return request({
url: 'rescue/rescueCarSpend/export',
method: 'get',
params,
responseType: 'blob'
})
}

View File

@ -94,7 +94,7 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> <el-button type="primary" icon="el-icon-download" :loading="exportLoading" size="mini" @click="handleExport">导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -392,6 +392,8 @@ export default {
dicts: ['dljy_type', 'fee_type', 'rescue_car_type', 'yes_no','jy_status','jy_order_status'], dicts: ['dljy_type', 'fee_type', 'rescue_car_type', 'yes_no','jy_status','jy_order_status'],
data() { data() {
return { return {
//
exportLoading: false,
chooseDriverId:'', chooseDriverId:'',
rescueInfoId:'', rescueInfoId:'',
// //
@ -686,10 +688,15 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {
try { try {
this.exportLoading = true
this.queryParams.pageNo = 1
this.queryParams.pageSize = 500
const data = await downloadOrder(this.queryParams) const data = await downloadOrder(this.queryParams)
this.$download.excel(data, `救援订单_${new Date().getTime()}.xls`) this.$download.excel(data, `救援订单_${new Date().getTime()}.xls`)
}catch {} }catch {}
finally {} finally {
this.exportLoading = false
}
} }
} }
}; };

View File

@ -83,7 +83,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
:loading="exportLoading"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -215,7 +215,7 @@
</template> </template>
<script> <script>
import { listRescueCarSpend, getRescueCarSpend, delRescueCarSpend, addRescueCarSpend, updateRescueCarSpend,listCar } from "./api/rescueCarSpend"; import { listRescueCarSpend, getRescueCarSpend, delRescueCarSpend, addRescueCarSpend, updateRescueCarSpend,listCar,exportCarSpend } from "./api/rescueCarSpend";
export default { export default {
name: "RescueCarSpend", name: "RescueCarSpend",
@ -258,6 +258,8 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
//
exportLoading: false,
// //
total: 0, total: 0,
time1:[], time1:[],
@ -419,10 +421,15 @@ export default {
}).catch(() => {}); }).catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { async handleExport() {
this.download('rescue/rescueCarSpend/export', { try {
...this.queryParams this.exportLoading = true
}, `rescueCarSpend_${new Date().getTime()}.xlsx`) const data = await exportCarSpend(this.queryParams)
this.$download.excel(data, `rescueCarSpend_${new Date().getTime()}.xlsx`)
}catch{}
finally {
this.exportLoading = false
}
} }
} }
}; };

View File

@ -72,6 +72,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
:loading="exportLoading"
>导出 >导出
</el-button> </el-button>
</el-col> </el-col>
@ -146,6 +147,8 @@ export default {
dicts: ['dljy_type', 'fee_type', 'car_type', 'yes_no', 'jy_status', 'jy_order_status'], dicts: ['dljy_type', 'fee_type', 'car_type', 'yes_no', 'jy_status', 'jy_order_status'],
data() { data() {
return { return {
//
exportLoading: false,
pickerOptions: null, pickerOptions: null,
chooseDriverId: '', chooseDriverId: '',
rescueInfoId: '', rescueInfoId: '',
@ -428,8 +431,17 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {
const data = await exportManagement(this.queryParams) try {
this.$download.excel(data, `救援财务报表_${new Date().getTime()}.xlsx`) this.exportLoading = true
this.queryParams.pageNo = 1
this.queryParams.pageSize = 500
this.$modal.msgError("系统故障,联系管理员")
// const data = await exportManagement(this.queryParams)
// this.$download.excel(data, `_${new Date().getTime()}.xlsx`)
} catch {
} finally {
this.exportLoading = false
}
} }
} }
} }