代码补正

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

View File

@ -83,7 +83,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -215,7 +215,7 @@
</template>
<script>
import { listRescueCarSpend, getRescueCarSpend, delRescueCarSpend, addRescueCarSpend, updateRescueCarSpend,listCar } from "./api/rescueCarSpend";
import { listRescueCarSpend, getRescueCarSpend, delRescueCarSpend, addRescueCarSpend, updateRescueCarSpend,listCar,exportCarSpend } from "./api/rescueCarSpend";
export default {
name: "RescueCarSpend",
@ -258,6 +258,8 @@ export default {
multiple: true,
//
showSearch: true,
//
exportLoading: false,
//
total: 0,
time1:[],
@ -419,10 +421,15 @@ export default {
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('rescue/rescueCarSpend/export', {
...this.queryParams
}, `rescueCarSpend_${new Date().getTime()}.xlsx`)
async handleExport() {
try {
this.exportLoading = true
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"
size="mini"
@click="handleExport"
:loading="exportLoading"
>导出
</el-button>
</el-col>
@ -146,6 +147,8 @@ export default {
dicts: ['dljy_type', 'fee_type', 'car_type', 'yes_no', 'jy_status', 'jy_order_status'],
data() {
return {
//
exportLoading: false,
pickerOptions: null,
chooseDriverId: '',
rescueInfoId: '',
@ -428,8 +431,17 @@ export default {
},
/** 导出按钮操作 */
async handleExport() {
const data = await exportManagement(this.queryParams)
this.$download.excel(data, `救援财务报表_${new Date().getTime()}.xlsx`)
try {
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
}
}
}
}