|
|
|
@ -66,7 +66,7 @@ |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button v-if="!authSearch" :loading="searchLoading" @click="searchClick()">查询</el-button> |
|
|
|
<el-button type="primary" :loading="checkLoading" @click="checkModals()">批量审核</el-button> |
|
|
|
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button> |
|
|
|
<el-button @click="exportExcel()" type="primary" :loading="exportLoading" style="margin-left: 2px">{{'导出'}}</el-button> |
|
|
|
<!-- <el-button type="primary" @click="changeModel()">更改机修人员</el-button>--> |
|
|
|
<!-- <download-excel--> |
|
|
|
<!-- :fields="fields()"--> |
|
|
|
@ -393,6 +393,7 @@ |
|
|
|
getUserRoleList, |
|
|
|
getRoleByUserName, |
|
|
|
checkWorkOrders, // 批量审核 |
|
|
|
eamMaintainOrderExportExcel |
|
|
|
} from "@/api/eam/eam.js" |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
@ -413,6 +414,7 @@ |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
exportLoading: false, |
|
|
|
// 是否收藏 |
|
|
|
favorite: false, |
|
|
|
// 导出 start |
|
|
|
@ -1200,20 +1202,32 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
async exportExcel() { |
|
|
|
// this.searchData.limit = this.pageSize |
|
|
|
// this.searchData.page = this.pageIndex |
|
|
|
this.searchData.limit = -1 |
|
|
|
this.searchData.page = 1 |
|
|
|
excel.exportTable({ |
|
|
|
url: "/pms/eam/eamWorkOrderSearch", |
|
|
|
columnMapping: this.columnList,//可以直接用table,不需要的列就剔除 |
|
|
|
mergeSetting: [],//需要合并的列 |
|
|
|
params: this.searchData, |
|
|
|
fileName: this.exportName+".xlsx", |
|
|
|
rowFetcher: res => res.data, |
|
|
|
columnFormatter: [], |
|
|
|
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|
|
|
}); |
|
|
|
if (this.exportLoading) return |
|
|
|
|
|
|
|
try { |
|
|
|
this.exportLoading = true |
|
|
|
|
|
|
|
const response = await eamMaintainOrderExportExcel(this.searchData) |
|
|
|
|
|
|
|
const blob = new Blob([response.data]) |
|
|
|
const url = window.URL.createObjectURL(blob) |
|
|
|
const link = document.createElement('a') |
|
|
|
|
|
|
|
link.href = url |
|
|
|
link.download = '设备维保组维保工单.xlsx' |
|
|
|
document.body.appendChild(link) |
|
|
|
link.click() |
|
|
|
|
|
|
|
link.remove() |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
|
|
|
|
this.$message.success('导出完成') |
|
|
|
} catch (e) { |
|
|
|
console.error('导出失败', e) |
|
|
|
this.$message.error('导出失败') |
|
|
|
} finally { |
|
|
|
this.exportLoading = false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//导出excel |
|
|
|
|