问题修复

This commit is contained in:
hongchao 2025-12-05 15:42:56 +08:00
parent c4a1747dc3
commit 102d1c3665
2 changed files with 80 additions and 34 deletions

View File

@ -371,7 +371,7 @@ export default {
this.$modal.msgSuccess('审核成功')
loading.close()
setTimeout(() => {
// const obj = { path: '/business-examine/receive-apply' }
// const obj = { path: '/business-examine/direct-rotation-apply' }
// this.$tab.closeOpenPage(obj)
this.$tab.closePage()
}, 500)

View File

@ -99,14 +99,15 @@
<el-form-item>
<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-form-item>
</el-form>
<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 label="序号" align="center" width="70" type="index">
<el-table-column type="selection" width="45" :reserve-selection="true"></el-table-column>
<el-table-column label="序号" align="center" width="60" type="index">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
@ -134,7 +135,7 @@
</template>
</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">
<template #default="scope">
<span
@ -364,6 +365,12 @@ export default {
pageSize: 10,
keyWord:undefined,
taskStatus:undefined,
departName:undefined,
proName:undefined,
impUnitName:undefined,
typeName:undefined,
typeModelName:undefined,
jiJuType:undefined,
},
impUnitOptions: [], //
departOptions: [], //
@ -375,6 +382,9 @@ export default {
printTableData: [],
uploadOpen: false,
rowObj: {},
//
selectedItems: new Map(),
};
},
created() {
@ -524,6 +534,17 @@ export default {
this.tableList = response.data.rows;
this.total = response.data.total;
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.dateRange=[]
this.queryParams.keyWord=null;
//
this.selectedItems.clear();
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection();
}
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
//
this.selectedItems.clear();
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection();
}
this.getList();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.infos = selection.map(item => ({ id: item.id }))
this.single = selection.length != 1
this.multiple = !selection.length
//
selection.forEach(item => {
this.selectedItems.set(item.id, item);
});
//
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);
}
}
}
// idsinfos
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){
@ -852,36 +900,34 @@ export default {
async handleBulkDownload() {
const grouped = {};
try {
if (!this.infos || !this.infos.length) {
//
if (!this.selectedItems || this.selectedItems.size === 0) {
this.$message.warning('请先勾选要下载的行');
return;
}
// items
const items = this.infos.map((x) => {
const r = this.tableList.find(t => t.id === x.id) || {};
return {
proName: r.proName || '',
departName: r.departName || '',
typeName: r.typeName || '',
typeModelName: r.typeModelName || '',
qualifiedUrl: r.qualifiedUrl || null,
testReportUrl: r.testReportUrl || null,
thirdReportUrl: r.thirdReportUrl || null,
factoryReportUrl: r.factoryReportUrl || null,
otherReportUrl: r.otherReportUrl || null,
unit: r.unit || '',
num: r.num || '',
maCode: r.maCode || '',
ratedLoad: r.ratedLoad || '',
testLoad: r.testLoad || '',
holdingTime: r.holdingTime || '',
testTime: r.testTime || '',
nextTestTime: r.nextTestTime || '',
checkResult: r.checkResult || '',
// items tableList
const items = Array.from(this.selectedItems.values()).map(item => ({
proName: item.proName || '',
departName: item.departName || '',
typeName: item.typeName || '',
typeModelName: item.typeModelName || '',
qualifiedUrl: item.qualifiedUrl || null,
testReportUrl: item.testReportUrl || null,
thirdReportUrl: item.thirdReportUrl || null,
factoryReportUrl: item.factoryReportUrl || null,
otherReportUrl: item.otherReportUrl || null,
unit: item.unit || '',
num: item.num || '',
maCode: item.maCode || '',
ratedLoad: item.ratedLoad || '',
testLoad: item.testLoad || '',
holdingTime: item.holdingTime || '',
testTime: item.testTime || '',
nextTestTime: item.nextTestTime || '',
checkResult: item.checkResult || '',
remark: ''
};
});
}));
// -> -> -
items.forEach(item => {