问题修复

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('审核成功') 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)

View File

@ -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);
}
}
}
// 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){ 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 => {