吉安感知网项目-前端
张含笑
2026-01-20 5fb7c18beead1966147fb639c422b7f373170164
applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue
@@ -11,7 +11,7 @@
            <div class="reject-reason-container" v-if="detailDemandStatus === '3'">
               <div class="label">拒绝原因 </div>
               <div class="reject-reason">
                  这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因这是拒绝原因
                  {{reasonForRejection}}
               </div>
            </div>
            <div>
@@ -121,7 +121,7 @@
            <div v-if="detailDemandStatus === '2'">
               <div class="label">数据详情 </div>
               <el-table :data="tableData" border style="width: 100%">
                  <el-table-column prop="name" label="文件名称"  />
                  <el-table-column prop="fileOriginalName" label="文件名称" />
                  <el-table-column prop="fileSize" label="文件大小"  />
                  <el-table-column fixed="right" label="操作" min-width="100">
               <template #default="scope">
@@ -133,8 +133,16 @@
         </div>
      </div>
      <template #footer>
         <template v-if="detailDemandStatus === '1'">
         <el-button class="save-btn" color="#4C34FF" @click="rejectTheApplication">拒绝申请</el-button>
         <el-button color="#F2F3F5" @click="approvedByTheReview">审核通过</el-button>
         </template>
         <template v-if="detailDemandStatus === '2'">
            <el-button class="save-btn" color="#4C34FF" @click="downloadAllFiles">全部下载</el-button>
         </template>
         <template v-if="detailDemandStatus === '3'">
            <el-button class="save-btn" color="#4C34FF" @click="visible =false">关闭</el-button>
         </template>
      </template>
   </el-dialog>
@@ -153,7 +161,7 @@
   putFileAttachApi,
   gdSupplyDemandAuditPassApi,
   gdSupplyDemandAuditRejectApi,
   gdSupplyDemandAuditAttachmentListApi
   gdSupplyDemandAuditAttachmentListApi,
} from '@/views/orderView/orderDataManage/supplyAdd/supplyAddApi'
import { ElMessage } from 'element-plus'
import reasonForRejectionDialog from '@/views/orderView/orderDataManage/supplyAdd/reasonForRejectionDialog.vue'
@@ -163,6 +171,7 @@
const dictObj = inject('dictObj')
const deptTree = inject('deptTree')
const detailDemandStatus = inject('detailDemandStatus')
const reasonForRejection = inject('reasonForRejection')
const demandId = ref('')
const visible = defineModel() // 弹框显隐
const formData = ref({}) // 表单数据
@@ -301,6 +310,37 @@
   }
}
// 下载所有文件
const downloadAllFiles = () => {
   if (!tableData.value || tableData.value.length === 0) {
      ElMessage.warning('没有可下载的文件')
      return
   }
   // 统计有效文件数量
   const validFiles = tableData.value.filter(file => file.fileUrl)
   if (validFiles.length === 0) {
      ElMessage.warning('所有文件链接均无效')
      return
   }
   ElMessage.success(`开始下载${validFiles.length}个文件`)
   // 依次下载每个文件(添加延迟以避免浏览器限制)
   validFiles.forEach((file, index) => {
      setTimeout(() => {
         if (file.fileUrl) {
            const a = document.createElement('a')
            a.href = file.fileUrl
            a.download = file.name || `attachment_${index + 1}`
            document.body.appendChild(a)
            a.click()
            document.body.removeChild(a)
         }
      }, index * 300) // 300ms delay between downloads
   })
}
// 根据部门ID获取部门名称
function getDeptNameById(deptId, deptList) {
   // 处理类型转换,确保比较的是相同类型
@@ -358,10 +398,10 @@
      
      // 格式化附件数据以匹配表格结构
      tableData.value = attachments.map(attachment => ({
         name: attachment.attachId ? `附件ID: ${attachment.attachId}` : '未知附件',
         fileSize: attachment.fileSize ? `${attachment.fileSize}M` : '未知大小',
         fileOriginalName: attachment.fileOriginalName ,
         fileSize: attachment.fileSize ? `${attachment.fileSize}M` : '',
         fileUrl: attachment.fileUrl,
         id: attachment.id
         id: attachment.id,
      }))
   } catch (error) {
      console.error('加载附件数据失败:', error)
@@ -430,12 +470,13 @@
   width: 75%;
   .reject-reason {
      margin-bottom: 20px;
      background: #F2F3F5;
      background: #f2f3f5;
      border-radius: 2px 2px 2px 2px;
      padding: 15px;
      height: 100px;
   }
   .requirementsDetailsBox {
      background: #F2F3F5;
      background: #f2f3f5;
      border-radius: 2px 2px 2px 2px;
   }
@@ -481,7 +522,7 @@
/* 上传容器样式 */
.upload-container {
   padding: 15px;
   background: #F2F3F5;
   background: #f2f3f5;
   border-radius: 2px 2px 2px 2px;
}