|
|
@ -81,7 +81,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label=" "> |
|
|
<el-form-item label=" "> |
|
|
<el-button v-if="!authSearch" @click="getDataList()">查询</el-button> |
|
|
<el-button v-if="!authSearch" @click="getDataList()">查询</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> |
|
|
<!-- <download-excel--> |
|
|
<!-- <download-excel--> |
|
|
<!-- :fields="fields()"--> |
|
|
<!-- :fields="fields()"--> |
|
|
<!-- :data="exportData"--> |
|
|
<!-- :data="exportData"--> |
|
|
@ -732,6 +732,7 @@ |
|
|
saveCoreComponent, |
|
|
saveCoreComponent, |
|
|
getSparPartImages, // 获取备件图片 |
|
|
getSparPartImages, // 获取备件图片 |
|
|
deleteCoreComponents,//删除核心备件 |
|
|
deleteCoreComponents,//删除核心备件 |
|
|
|
|
|
reportExchangeWorkOrderExport//执行工单导出 |
|
|
} from "@/api/eam/eam.js" |
|
|
} from "@/api/eam/eam.js" |
|
|
import { |
|
|
import { |
|
|
downLoadObjectFile, |
|
|
downLoadObjectFile, |
|
|
@ -771,6 +772,7 @@ |
|
|
}, |
|
|
}, |
|
|
data () { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
|
|
|
exportLoading: false, |
|
|
coreComponentFlag: false, |
|
|
coreComponentFlag: false, |
|
|
uploadDialog: false, |
|
|
uploadDialog: false, |
|
|
planPeople:'', |
|
|
planPeople:'', |
|
|
@ -2181,18 +2183,40 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async exportExcel() { |
|
|
async exportExcel() { |
|
|
this.searchData.limit = -1 |
|
|
|
|
|
this.searchData.page = 1 |
|
|
|
|
|
excel.exportTable({ |
|
|
|
|
|
url: "/pms/eam/eamWorkOrderSearch2", |
|
|
|
|
|
columnMapping: this.columnList,//可以直接用table,不需要的列就剔除 |
|
|
|
|
|
mergeSetting: [],//需要合并的列 |
|
|
|
|
|
params: this.searchData, |
|
|
|
|
|
fileName: this.exportName+".xlsx", |
|
|
|
|
|
rowFetcher: res => res.data, |
|
|
|
|
|
columnFormatter: [], |
|
|
|
|
|
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
this.exportLoading = true |
|
|
|
|
|
let params = this.searchData |
|
|
|
|
|
params.limit = -1 |
|
|
|
|
|
params.page = 1 |
|
|
|
|
|
|
|
|
|
|
|
const response = await reportExchangeWorkOrderExport(params) |
|
|
|
|
|
|
|
|
|
|
|
const now = new Date() |
|
|
|
|
|
const pad = n => n.toString().padStart(2, '0') |
|
|
|
|
|
const timeStr = |
|
|
|
|
|
now.getFullYear() + |
|
|
|
|
|
pad(now.getMonth() + 1) + |
|
|
|
|
|
pad(now.getDate()) + |
|
|
|
|
|
pad(now.getHours()) + |
|
|
|
|
|
pad(now.getMinutes()) + |
|
|
|
|
|
pad(now.getSeconds()) |
|
|
|
|
|
|
|
|
|
|
|
const fileName = `换线专家组维修执行工单_${timeStr}.xlsx` |
|
|
|
|
|
|
|
|
|
|
|
const url = window.URL.createObjectURL(new Blob([response.data])) |
|
|
|
|
|
const link = document.createElement('a') |
|
|
|
|
|
link.href = url |
|
|
|
|
|
link.setAttribute('download', fileName) |
|
|
|
|
|
document.body.appendChild(link) |
|
|
|
|
|
link.click() |
|
|
|
|
|
link.remove() |
|
|
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('导出失败:', error) |
|
|
|
|
|
this.$message.error('导出失败') |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.exportLoading = false |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//导出excel |
|
|
//导出excel |
|
|
|