质量报表导出,隐藏功能实现,仓库dialog弹窗点击屏幕外关闭修复
This commit is contained in:
@@ -34,8 +34,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label=" ">
|
||||
<el-button size="mini" type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
|
||||
<el-button size="mini" type="warning" @click="exportDataEvent">EXCEL导出</el-button>
|
||||
<el-button size="mini" type="success" @click="exportAllDataEvent">导出全部记录</el-button>
|
||||
<el-button size="mini" type="warning" @click="exportAllDataEvent(false)">日生产报表导出</el-button>
|
||||
<el-button size="mini" type="success" @click="exportAllDataEvent(true)">缺陷详情导出</el-button>
|
||||
<!-- <el-button size="mini" type="success" @click="exportDataEvent">缺陷详情导出</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -254,6 +255,9 @@
|
||||
// { row: 0, col: 10, rowspan: 3, colspan: 0 },
|
||||
// { row: 0, col: 11, rowspan: 3, colspan: 0 },
|
||||
],
|
||||
hiddenCells: [],
|
||||
// 列表对照表
|
||||
tableCellDict: [],
|
||||
// 右键菜单
|
||||
tableMenu: {
|
||||
header: {
|
||||
@@ -289,19 +293,16 @@
|
||||
mergeTable(num) {
|
||||
this.mergeCells = []
|
||||
for (let i = 0; i < this.QualityStatisticsTable.length; i = i + num) {
|
||||
this.mergeCells.push({ row: i, col: 0, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 1, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 2, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 3, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 4, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 5, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 6, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 7, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 8, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 9, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 10, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 11, rowspan: num, colspan: 0 })
|
||||
this.mergeCells.push({ row: i, col: 12, rowspan: num, colspan: 0 })
|
||||
let count = 13 - this.hiddenCells.length;
|
||||
for (let j = 0; j < count; j++) {
|
||||
this.mergeCells.push({ row: i, col: j, rowspan: num, colspan: 0 })
|
||||
}
|
||||
// if(this.hiddenCells.includes('工单号')){
|
||||
|
||||
// }
|
||||
// this.mergeCells.push({ row: i, col: 10, rowspan: num, colspan: 0 })
|
||||
// this.mergeCells.push({ row: i, col: 11, rowspan: num, colspan: 0 })
|
||||
// this.mergeCells.push({ row: i, col: 12, rowspan: num, colspan: 0 })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -386,11 +387,11 @@
|
||||
this.$refs.xTable.openExport()
|
||||
},
|
||||
// 导出全部数据
|
||||
exportAllDataEvent() {
|
||||
exportAllDataEvent(isShowDetail = false) {
|
||||
let data = { ...this.search, ...this.pagination };
|
||||
data.type = this.search.reportType + 1;
|
||||
data.isShowDetail = false;
|
||||
let fileName = this.reportType_options[this.search.reportType].label + '.xlsx';
|
||||
data.isShowDetail = isShowDetail;
|
||||
let fileName = this.reportType_options[this.search.reportType].label + (isShowDetail ? '-缺陷详情' : '-日生产报表') + '.xlsx';
|
||||
downloadStatisticsTableExcel(data).then(res => {
|
||||
console.log(res);
|
||||
let blobURL = URL.createObjectURL(res.data)
|
||||
@@ -428,10 +429,10 @@
|
||||
const $table = this.$refs.xTable
|
||||
switch (menu.code) {
|
||||
case 'hideColumn':
|
||||
$table.hideColumn(column)
|
||||
this.hideColumn(column);
|
||||
break
|
||||
case 'showAllColumn':
|
||||
$table.resetColumn()
|
||||
this.resetColumn()
|
||||
break
|
||||
case 'remove':
|
||||
this.removeData(row)
|
||||
@@ -441,6 +442,28 @@
|
||||
break
|
||||
}
|
||||
},
|
||||
// 隐藏列
|
||||
hideColumn(column) {
|
||||
const $table = this.$refs.xTable;
|
||||
$table.hideColumn(column);
|
||||
this.hiddenCells.push(column.title);
|
||||
this.resetMergeTable();
|
||||
},
|
||||
// 取消所有隐藏列
|
||||
resetColumn() {
|
||||
const $table = this.$refs.xTable;
|
||||
this.hiddenCells = [];
|
||||
$table.resetColumn();
|
||||
this.resetMergeTable();
|
||||
},
|
||||
resetMergeTable(){
|
||||
if(this.search.reportType === 3){
|
||||
this.mergeTable(2);
|
||||
}else{
|
||||
this.mergeTable(3);
|
||||
}
|
||||
|
||||
},
|
||||
// 删除数据
|
||||
removeData(row) {
|
||||
this.$confirm('此操作将永久删除该条记录, 是否继续?', '提示', {
|
||||
|
||||
Reference in New Issue
Block a user