问题修复
This commit is contained in:
parent
c4a1747dc3
commit
102d1c3665
|
|
@ -371,7 +371,7 @@ export default {
|
||||||
this.$modal.msgSuccess('审核成功')
|
this.$modal.msgSuccess('审核成功')
|
||||||
loading.close()
|
loading.close()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// const obj = { path: '/business-examine/receive-apply' }
|
// const obj = { path: '/business-examine/direct-rotation-apply' }
|
||||||
// this.$tab.closeOpenPage(obj)
|
// this.$tab.closeOpenPage(obj)
|
||||||
this.$tab.closePage()
|
this.$tab.closePage()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|
|
||||||
|
|
@ -99,14 +99,15 @@
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button icon="el-icon-download" size="mini" @click="handleBulkDownload">一键下载</el-button>
|
<el-button icon="el-icon-download" size="mini" @click="handleBulkDownload">一键下载</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="id" @selection-change="handleSelectionChange" border>
|
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="id" @selection-change="handleSelectionChange" border>
|
||||||
<el-table-column type="selection" width="45"></el-table-column>
|
<el-table-column type="selection" width="45" :reserve-selection="true"></el-table-column>
|
||||||
<el-table-column label="序号" align="center" width="70" type="index">
|
<el-table-column label="序号" align="center" width="60" type="index">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -134,7 +135,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="领用日期" align="center" prop="leaseTime" :show-overflow-tooltip="true"/>
|
<el-table-column label="领用日期" align="center" prop="leaseTime" :show-overflow-tooltip="true" width="100px"/>
|
||||||
<el-table-column label="出库检验报告" align="center" :show-overflow-tooltip="true">
|
<el-table-column label="出库检验报告" align="center" :show-overflow-tooltip="true">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
|
|
@ -364,6 +365,12 @@ export default {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keyWord:undefined,
|
keyWord:undefined,
|
||||||
taskStatus:undefined,
|
taskStatus:undefined,
|
||||||
|
departName:undefined,
|
||||||
|
proName:undefined,
|
||||||
|
impUnitName:undefined,
|
||||||
|
typeName:undefined,
|
||||||
|
typeModelName:undefined,
|
||||||
|
jiJuType:undefined,
|
||||||
},
|
},
|
||||||
impUnitOptions: [], // 分公司下拉
|
impUnitOptions: [], // 分公司下拉
|
||||||
departOptions: [], // 项目部下拉
|
departOptions: [], // 项目部下拉
|
||||||
|
|
@ -375,6 +382,9 @@ export default {
|
||||||
printTableData: [],
|
printTableData: [],
|
||||||
uploadOpen: false,
|
uploadOpen: false,
|
||||||
rowObj: {},
|
rowObj: {},
|
||||||
|
|
||||||
|
// 全局选中的项,用于跨页勾选
|
||||||
|
selectedItems: new Map(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -524,6 +534,17 @@ export default {
|
||||||
this.tableList = response.data.rows;
|
this.tableList = response.data.rows;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
// 加载完成后,根据全局选中状态设置当前页的选中项
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.multipleTable) {
|
||||||
|
this.tableList.forEach(row => {
|
||||||
|
if (this.selectedItems.has(row.id)) {
|
||||||
|
this.$refs.multipleTable.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
|
|
@ -531,19 +552,46 @@ export default {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.dateRange=[]
|
this.dateRange=[]
|
||||||
this.queryParams.keyWord=null;
|
this.queryParams.keyWord=null;
|
||||||
|
// 清空选中状态
|
||||||
|
this.selectedItems.clear();
|
||||||
|
if (this.$refs.multipleTable) {
|
||||||
|
this.$refs.multipleTable.clearSelection();
|
||||||
|
}
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
// 查询时清除选中状态
|
||||||
|
this.selectedItems.clear();
|
||||||
|
if (this.$refs.multipleTable) {
|
||||||
|
this.$refs.multipleTable.clearSelection();
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
// 更新全局选中状态
|
||||||
this.infos = selection.map(item => ({ id: item.id }))
|
selection.forEach(item => {
|
||||||
this.single = selection.length != 1
|
this.selectedItems.set(item.id, item);
|
||||||
this.multiple = !selection.length
|
});
|
||||||
|
|
||||||
|
// 找出当前页未被选中但之前被选中的项,并从全局选中状态中移除
|
||||||
|
const currentIds = selection.map(item => item.id);
|
||||||
|
for (let id of this.selectedItems.keys()) {
|
||||||
|
if (!currentIds.includes(id)) {
|
||||||
|
const itemInCurrentPage = this.tableList.find(row => row.id === id);
|
||||||
|
if (itemInCurrentPage) {
|
||||||
|
this.selectedItems.delete(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新ids和infos数组,用于其他操作
|
||||||
|
this.ids = Array.from(this.selectedItems.keys());
|
||||||
|
this.infos = Array.from(this.selectedItems.values()).map(item => ({ id: item.id }));
|
||||||
|
this.single = this.ids.length !== 1;
|
||||||
|
this.multiple = this.ids.length === 0;
|
||||||
},
|
},
|
||||||
//查看
|
//查看
|
||||||
handleView(row){
|
handleView(row){
|
||||||
|
|
@ -852,36 +900,34 @@ export default {
|
||||||
async handleBulkDownload() {
|
async handleBulkDownload() {
|
||||||
const grouped = {};
|
const grouped = {};
|
||||||
try {
|
try {
|
||||||
if (!this.infos || !this.infos.length) {
|
// 检查是否有选中项
|
||||||
|
if (!this.selectedItems || this.selectedItems.size === 0) {
|
||||||
this.$message.warning('请先勾选要下载的行');
|
this.$message.warning('请先勾选要下载的行');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建 items
|
// 从全局选中状态构建 items,不再只依赖当前页的 tableList
|
||||||
const items = this.infos.map((x) => {
|
const items = Array.from(this.selectedItems.values()).map(item => ({
|
||||||
const r = this.tableList.find(t => t.id === x.id) || {};
|
proName: item.proName || '',
|
||||||
return {
|
departName: item.departName || '',
|
||||||
proName: r.proName || '',
|
typeName: item.typeName || '',
|
||||||
departName: r.departName || '',
|
typeModelName: item.typeModelName || '',
|
||||||
typeName: r.typeName || '',
|
qualifiedUrl: item.qualifiedUrl || null,
|
||||||
typeModelName: r.typeModelName || '',
|
testReportUrl: item.testReportUrl || null,
|
||||||
qualifiedUrl: r.qualifiedUrl || null,
|
thirdReportUrl: item.thirdReportUrl || null,
|
||||||
testReportUrl: r.testReportUrl || null,
|
factoryReportUrl: item.factoryReportUrl || null,
|
||||||
thirdReportUrl: r.thirdReportUrl || null,
|
otherReportUrl: item.otherReportUrl || null,
|
||||||
factoryReportUrl: r.factoryReportUrl || null,
|
unit: item.unit || '',
|
||||||
otherReportUrl: r.otherReportUrl || null,
|
num: item.num || '',
|
||||||
unit: r.unit || '',
|
maCode: item.maCode || '',
|
||||||
num: r.num || '',
|
ratedLoad: item.ratedLoad || '',
|
||||||
maCode: r.maCode || '',
|
testLoad: item.testLoad || '',
|
||||||
ratedLoad: r.ratedLoad || '',
|
holdingTime: item.holdingTime || '',
|
||||||
testLoad: r.testLoad || '',
|
testTime: item.testTime || '',
|
||||||
holdingTime: r.holdingTime || '',
|
nextTestTime: item.nextTestTime || '',
|
||||||
testTime: r.testTime || '',
|
checkResult: item.checkResult || '',
|
||||||
nextTestTime: r.nextTestTime || '',
|
remark: ''
|
||||||
checkResult: r.checkResult || '',
|
}));
|
||||||
remark: ''
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
// 按工程 -> 领用日期 -> 类型-规格分组
|
// 按工程 -> 领用日期 -> 类型-规格分组
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue