From 733aa2ee33557f85367e8e392e9a0137ae00eaad Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 28 Jan 2026 17:07:59 +0800
Subject: [PATCH] feat:更新工单
---
applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue | 43 ++++++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
index 206b08d..b4b865e 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
@@ -138,10 +138,10 @@
</template>
<script setup>
import { Search, RefreshRight, Download, Upload, Delete } from '@element-plus/icons-vue'
-import { fjPageApi, fjSubmitApi, fjRemoveApi, fjDetailApi, fjUploadApi } from './inspectionRequestApi'
+import { fjPageApi, fjSubmitApi, fjRemoveApi, fjDetailApi, fjUploadApi,fjDownloadByByteApi } from './inspectionRequestApi'
import { useStore } from 'vuex'
import { ref, computed, inject, onMounted } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'
import { getDictLabel } from '@ztzf/utils'
import PreviewFiles from '@/components/PreviewFiles/PreviewFiles.vue'
import { getDictionaryByCode } from '@/api/system/dictbiz'
@@ -261,9 +261,9 @@
const fileType = row?.link?.split('.').pop() || ''
if (!row.link) {
ElMessage.warning('文件链接不存在')
- }else if (allSupportedExtensions.includes(fileType)){
+ } else if (allSupportedExtensions.includes(fileType)){
window.open(`${VITE_APP_PREVIEW_URL}/onlinePreview?url=`+encodeURIComponent(Base64.encode(row.link)));
- }else {
+ } else {
ElMessage.warning(`${fileType}文件格式,可以下载再查看`)
}
}
@@ -289,7 +289,7 @@
selectedFiles.value = rows
selectedIds.value = rows.map(item => item.id)
}
-
+let loadingData
// 文档下载
async function handleDownload() {
// 如果是勾选一个可以直接下载,超过一个打包下载
@@ -298,8 +298,9 @@
ElMessage.warning('请选择要下载的文件')
return
}
- selectedFiles.value.forEach((file, index) => {
- setTimeout(() => {
+ if (selectedFiles.value.length === 1) {
+ selectedFiles.value.forEach((file, index) => {
+ // setTimeout(() => {
if (file.link) {
const a = document.createElement('a')
a.href = file.link
@@ -308,8 +309,32 @@
a.click()
document.body.removeChild(a)
}
- }, index * 300) // 300ms delay between downloads
- })
+ // }, index * 300) // 300ms delay between downloads
+ })
+ } else {
+ // 批量下载
+ try {
+ console.log(selectedFiles.value, '9999')
+ loadingData = ElLoading.service({ background: 'rgba(0, 0, 0, 0.5)', text: '打包中,请稍等...' })
+ const fileIds = selectedFiles.value.map(i => i.id)
+ // const res = await getDownloadStatusApi({ type: 'dpsjzx' })
+ // if (!['CANCELLED', 'COMPLETED'].includes(res.data.data?.status || 'COMPLETED')) {
+ // return ElMessage.warning('还有正在处理的')
+ // }
+ console.log(fileIds, '7777')
+ await fjDownloadByByteApi({ attachIds: fileIds }).then(res => {
+ if (res.data.code === 200) {
+ ElMessage.success('下载成功')
+ } else {
+ ElMessage.error(res.msg || '下载失败')
+ }
+ })
+ } catch (e) {
+ } finally {
+ loadingData.close()
+ }
+
+ }
}
// 文档上传
--
Gitblit v1.9.3