xy 14 hours ago
parent
commit
2dde6313d1

+ 14 - 1
yudao-ui-admin-vue3/src/views/pressure2/boilerchecker/AuditCheckRecord.vue

@@ -745,7 +745,8 @@ const canSubmitMainReportType = ()=>{
       label: '结果',
       prop: 'result',
       render: (row, result) => {
-        return ['100', '200'].includes(result) ? resultMap[result] : !result ? '-' : PressureCheckerRecheckStatusMap[Number(result)]
+        return formatResult(result)
+        // return ['100', '200'].includes(result) ? resultMap[result] : !result ? '-' : PressureCheckerRecheckStatusMap[Number(result)]
         // return result === '100'
         //   ?
         // getRouteName.value === 'AuditInspectionCommentsNotice' ? '拒绝' : '通过'
@@ -772,6 +773,18 @@ const canSubmitMainReportType = ()=>{
     '100': '通过',
     '200': '拒绝',
   }
+
+  // 结果格式化
+  const formatResult = (result) => {
+    switch (result) {
+      case 100:
+        return '通过'
+      case 200:
+        return '拒绝'
+      default:
+        return result || '-'
+    }
+  }
   
   // 记录校核:审核
   const fetchRecordList = async () => {

+ 20 - 0
yudao-ui-admin-vue3/src/views/pressure2/boilerchecker/myTask.vue

@@ -848,6 +848,12 @@ const handleSelectionChange = (selection) => {
 }
 
 const handleDownload = async () => {
+  // 判空检查
+  if (!selectionProject.value || selectionProject.value.length === 0) {
+    ElMessage.warning('请先选择要下载的项目')
+    return
+  }
+
   let data: any[] = []
   console.log(selectionProject)
   selectionProject.value.forEach(
@@ -863,6 +869,12 @@ const handleDownload = async () => {
     }
   )
 
+  let loadingInstance = ElLoading.service({
+    lock: true,
+    text: '正在下载...',
+    spinner: 'el-icon-loading',
+  })
+
   try {
     // 调用 API 获取 ZIP blob
     const zipBlob = await PipeInputApi.handleDownload(data)
@@ -889,10 +901,18 @@ const handleDownload = async () => {
   } catch (error) {
     console.error('下载失败:', error)
     ElMessage.error('下载失败')
+  } finally {
+    loadingInstance.close()
   }
 }
 
 const handlePrint = async () => {
+  // 判空检查
+  if (!selectionProject.value || selectionProject.value.length === 0) {
+    ElMessage.warning('请先选择要打印的项目')
+    return
+  }
+
   let data: any[] = []
   selectionProject.value.forEach(
     (item) => {

+ 13 - 1
yudao-ui-admin-vue3/src/views/pressure2/pipechecker/AuditCheckRecord.vue

@@ -705,7 +705,7 @@ const canSubmitMainReportType = ()=>{
       label: '结果',
       prop: 'result',
       render: (row, result) => {
-        return ['100', '200'].includes(result) ? resultMap[result] : !result ? '-' : PressureCheckerRecheckStatusMap[Number(result)]
+        return formatResult(result)
         // return result === '100'
         //   ?
         // getRouteName.value === 'AuditInspectionCommentsNotice' ? '拒绝' : '通过'
@@ -753,6 +753,18 @@ const canSubmitMainReportType = ()=>{
     }
   }
 
+  // 结果格式化
+  const formatResult = (result) => {
+    switch (result) {
+      case 100:
+        return '通过'
+      case 200:
+        return '拒绝'
+      default:
+        return result || '-'
+    }
+  }
+
   const handleChangeEntrustUnit = (unit: Record<string, any>) => {
     form.value.recheckUser = unit
   }

+ 23 - 1
yudao-ui-admin-vue3/src/views/pressure2/pipechecker/myTask.vue

@@ -758,6 +758,13 @@ const handleSelectionChange = (selection) => {
 }
 
 const handleDownload = async () => {
+
+  // 判空检查
+  if (!selectionProject.value || selectionProject.value.length === 0) {
+    ElMessage.warning('请先选择要下载的项目')
+    return
+  }
+
   let data: any[] = []
   console.log(selectionProject)
   selectionProject.value.forEach(
@@ -772,7 +779,13 @@ const handleDownload = async () => {
       })
     }
   )
-  
+
+  let loadingInstance = ElLoading.service({
+    lock: true,
+    text: '正在下载...',
+    spinner: 'el-icon-loading',
+  })
+
   try {
     // 调用 API 获取 ZIP blob
     const zipBlob = await PipeInputApi.handleDownload(data)
@@ -799,10 +812,19 @@ const handleDownload = async () => {
   } catch (error) {
     console.error('下载失败:', error)
     ElMessage.error('下载失败')
+  } finally {
+    loadingInstance.close()
   }
 }
 
 const handlePrint = async () => {
+
+  // 判空检查
+  if (!selectionProject.value || selectionProject.value.length === 0) {
+    ElMessage.warning('请先选择要打印的项目')
+    return
+  }
+
   let data: any[] = []
   selectionProject.value.forEach(
     (item) => {