|
|
|
@ -219,17 +219,12 @@ |
|
|
|
任务重载 |
|
|
|
</el-button> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
:data="exportData" |
|
|
|
:fields="exportFields" |
|
|
|
:data="dataList" |
|
|
|
type="xls" |
|
|
|
:name="exportName" |
|
|
|
:header="exportHeader" |
|
|
|
:footer="exportFooter" |
|
|
|
:fetch="createExportData" |
|
|
|
:before-generate="startDownload" |
|
|
|
:before-finish="finishDownload" |
|
|
|
worksheet="导出信息" |
|
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
|
class="el-button el-button--medium"> |
|
|
|
<i class="el-icon-download"></i> |
|
|
|
导出 |
|
|
|
</download-excel> |
|
|
|
@ -1015,6 +1010,17 @@ |
|
|
|
end = this.tableData.length |
|
|
|
} |
|
|
|
return this.tableData.slice(start,end) |
|
|
|
}, |
|
|
|
// 导出字段映射 |
|
|
|
exportFields () { |
|
|
|
let fields = {} |
|
|
|
// 添加固定的状态列 |
|
|
|
fields['状态'] = 'state' |
|
|
|
// 添加动态列 |
|
|
|
this.columnList1.forEach(item => { |
|
|
|
fields[item.columnLabel] = item.columnProp |
|
|
|
}) |
|
|
|
return fields |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
@ -3367,34 +3373,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//导出excel |
|
|
|
async createExportData () { |
|
|
|
this.searchData.limit = -1 |
|
|
|
this.searchData.page = 1 |
|
|
|
await qcOQCInspectionSearch(this.searchData).then(({data}) => { |
|
|
|
this.exportList = data.page.list |
|
|
|
}) |
|
|
|
return this.exportList |
|
|
|
}, |
|
|
|
|
|
|
|
startDownload() {}, |
|
|
|
|
|
|
|
finishDownload() {}, |
|
|
|
|
|
|
|
fields () { |
|
|
|
let json = "{" |
|
|
|
this.columnList1.forEach((item, index) => { |
|
|
|
if (index == this.columnList1.length - 1) { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|
|
|
} else { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|
|
|
} |
|
|
|
}) |
|
|
|
json += "}" |
|
|
|
let s = eval("(" + json + ")") |
|
|
|
return s |
|
|
|
}, |
|
|
|
|
|
|
|
// 动态列开始 获取 用户保存的 格式列 |
|
|
|
async getTableUserColumn (tableId, columnId) { |
|
|
|
let queryTableUser = { |
|
|
|
|