This commit is contained in:
hayu 2025-10-31 20:56:57 +08:00
parent ea5921eadf
commit be2d7f7685
1 changed files with 38 additions and 24 deletions

View File

@ -380,8 +380,8 @@ export default {
created() {
this.getList();
this.getImpUnitOptions()
this.handleImpUnitChange()
this.handleDepartChange()
this.departList()
this.proList()
this.getDeviceType()
},
methods: {
@ -397,10 +397,36 @@ export default {
console.error('获取分公司下拉失败:', e)
}
},
/** 获取项目部下拉 */
async departList() {
try {
const res = await getDepartListByImpUnitApi() //
this.departOptions = res.data.map(item => ({
label: item.departName, //
value: item.departName
}))
} catch (e) {
console.error('获取项目部下拉失败:', e)
}
},
/** 获取工程下拉 */
async proList() {
try {
const res = await getProListByDepartApi() //
this.proOptions = res.data.map(item => ({
label: item.proName, //
value: item.proName
}))
} catch (e) {
console.error('获取工程下拉失败:', e)
}
},
/** 分公司选择变化,加载项目部 */
async handleImpUnitChange() {
this.queryParams.departName = null //
this.departOptions = [] //
this.queryParams.proName = null //
this.proOptions = [] //
try {
const params = {
@ -812,19 +838,11 @@ export default {
zipName: row.proName || 'report',
};
// 访
downloadFileApi(payload)
.then((res) => {
downloadFile({
fileName: (row.proName || '文件档案下载') + '.zip',
fileData: res,
fileType: 'application/zip',
});
})
.catch((err) => {
console.error('单条下载失败:', err);
this.$message.error('下载失败');
});
this.downloadZip(
'/material/bm_report/downloadSingle',
JSON.stringify(payload),
`${row.proName || '文件档案下载'}.zip`
);
},
@ -897,15 +915,11 @@ export default {
zipName: `报告下载_${(new Date()).toISOString().slice(0,10)}`,
};
//
const res = await batchDownloadFileApi(payload);
//
downloadFile({
fileName: payload.zipName + '.zip',
fileData: res,
fileType: 'application/zip'
});
this.downloadZip(
'/material/bm_report/downloadBulk',
JSON.stringify(payload),
payload.zipName + '.zip'
);
} catch (err) {
console.error('一键下载失败', err);