Browse Source

2026-01-22

检验导出优化
master
fengyuan_yang 1 month ago
parent
commit
1415e3ee54
  1. 39
      src/views/modules/qc/FQCResultEntry.vue
  2. 39
      src/views/modules/qc/IPQCResultEntry.vue
  3. 38
      src/views/modules/qc/IQCResultEntry.vue
  4. 50
      src/views/modules/qc/OQCResultEntry.vue

39
src/views/modules/qc/FQCResultEntry.vue

@ -233,11 +233,16 @@
@click="printList"> @click="printList">
打印 打印
</el-button> </el-button>
<el-button
icon="el-icon-download"
@click="exportExcel()">
<download-excel
:fields="exportFields"
:data="dataList"
type="xls"
:name="exportName"
worksheet="导出信息"
class="el-button el-button--medium">
<i class="el-icon-download"></i>
导出 导出
</el-button>
</download-excel>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -1314,6 +1319,17 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
//
exportFields () {
let fields = {}
//
fields['状态'] = 'state'
//
this.columnList1.forEach(item => {
fields[item.columnLabel] = item.columnProp
})
return fields
} }
}, },
watch: { watch: {
@ -4323,21 +4339,6 @@
} }
}, },
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/pms/qc/qcFQCInspectionSearch",
columnMapping: this.columnList, //table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],
})
},
// //
async getTableUserColumn (tableId, columnId) { async getTableUserColumn (tableId, columnId) {
let queryTableUser = { let queryTableUser = {

39
src/views/modules/qc/IPQCResultEntry.vue

@ -262,11 +262,16 @@
@click="printList"> @click="printList">
打印 打印
</el-button> </el-button>
<el-button
icon="el-icon-download"
@click="exportExcel()">
<download-excel
:fields="exportFields"
:data="dataList"
type="xls"
:name="exportName"
worksheet="导出信息"
class="el-button el-button--medium">
<i class="el-icon-download"></i>
导出 导出
</el-button>
</download-excel>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -1526,6 +1531,17 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
//
exportFields () {
let fields = {}
//
fields['状态'] = 'state'
//
this.columnList1.forEach(item => {
fields[item.columnLabel] = item.columnProp
})
return fields
} }
}, },
watch: { watch: {
@ -4655,21 +4671,6 @@
} }
}, },
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/pms/qc/qcIPQCInspectionSearch",
columnMapping: this.columnList, //table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],
})
},
// //
async getTableUserColumn (tableId, columnId) { async getTableUserColumn (tableId, columnId) {
let queryTableUser = { let queryTableUser = {

38
src/views/modules/qc/IQCResultEntry.vue

@ -251,11 +251,16 @@
@click="printList"> @click="printList">
打印 打印
</el-button> </el-button>
<el-button
icon="el-icon-download"
@click="exportExcel()">
<download-excel
:fields="exportFields"
:data="dataList"
type="xls"
:name="exportName"
worksheet="导出信息"
class="el-button el-button--medium">
<i class="el-icon-download"></i>
导出 导出
</el-button>
</download-excel>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -1156,6 +1161,17 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
//
exportFields () {
let fields = {}
//
fields['状态'] = 'state'
//
this.columnList1.forEach(item => {
fields[item.columnLabel] = item.columnProp
})
return fields
} }
}, },
watch: { watch: {
@ -3524,20 +3540,6 @@
} }
}, },
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/pms/qc/qcIQCInspectionSearch",
columnMapping: this.columnList, //table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],
})
},
// //
async getTableUserColumn (tableId, columnId) { async getTableUserColumn (tableId, columnId) {

50
src/views/modules/qc/OQCResultEntry.vue

@ -219,17 +219,12 @@
任务重载 任务重载
</el-button> </el-button>
<download-excel <download-excel
:fields="fields()"
:data="exportData"
:fields="exportFields"
:data="dataList"
type="xls" type="xls"
:name="exportName" :name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息" worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
class="el-button el-button--medium">
<i class="el-icon-download"></i> <i class="el-icon-download"></i>
导出 导出
</download-excel> </download-excel>
@ -1015,6 +1010,17 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
//
exportFields () {
let fields = {}
//
fields['状态'] = 'state'
//
this.columnList1.forEach(item => {
fields[item.columnLabel] = item.columnProp
})
return fields
} }
}, },
watch: { 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) { async getTableUserColumn (tableId, columnId) {
let queryTableUser = { let queryTableUser = {

Loading…
Cancel
Save