xiaweibo 3 месяцев назад
Родитель
Сommit
40f72430cf

+ 72 - 11
src/views/production-safety/safetyAssessment/evaluationSystem/components/EvaluationSystemFeedback.vue

@@ -43,13 +43,29 @@
           <el-table-column label="评分方式" prop="scoringMethod" min-width="150" />
           <el-table-column label="加减分项" prop="scoreType" min-width="120" />
           <el-table-column label="自评得分" prop="selfScore" min-width="120" />
-          <el-table-column label="资料说明" prop="materialDescription" min-width="400">
+          <el-table-column label="资料说明" prop="materialDescription" min-width="200">
             <template #default="scope">
-              <UploadFiles
-                label="上传附件"
-                :file-list="scope.row.attachmentFileList"
-                @uploadSuccess="(files) => handleRowUploadSuccess(scope.$index, files)"
-              />
+              <div
+                class="file-container--div"
+                v-for="item in parseAttachments(scope.row.materialDescription)"
+                :key="item.fileUrl"
+              >
+                <img
+                  class="file-container--div__icon"
+                  @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
+                  :src="FILE_TYPE_ICON[item.fileType]"
+                />
+                <span
+                  class="file-container--div__name"
+                  @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
+                  >{{ item.fileName }}</span
+                >
+                <img
+                  class="file-container--div__download"
+                  :src="DownloadIcon"
+                  @click="downloadFile(item.fileUrl, item.fileName)"
+                />
+              </div>
             </template>
           </el-table-column>
           <el-table-column label="复核人姓名" prop="reviewUserName" min-width="120" />
@@ -106,7 +122,6 @@
   import { useRouter, useRoute } from 'vue-router';
   import { ElMessage } from 'element-plus';
   import type { FormInstance } from 'element-plus';
-  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import {
     querySecurityExamineIssueDetail,
     updateSecurityExamineIssueReviewSubmit,
@@ -119,6 +134,10 @@
   } from '@/api/evaluationSystem';
   import type { FileItem } from '@/components/UploadFiles/types';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
+  import DownloadIcon from '@/views/disaster/disaster-control/src/svg/download.svg';
+  import { downloadFile } from '@/views/disaster/utils';
+  import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
+  import { FILE_TYPE_ICON } from '@/components/UploadFiles/constants';
 
   const props = defineProps<{
     id: number;
@@ -322,10 +341,51 @@
     }
   };
 
-  // 行内上传附件成功
-  const handleRowUploadSuccess = (rowIndex: number, files: FileItem[]) => {
-    if (!evaluationItems.value[rowIndex]) return;
-    evaluationItems.value[rowIndex].attachmentFileList = files;
+  // 预览
+  const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
+  const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
+    if (url) {
+      previewOnlineRef.value?.open(url, type);
+    }
+  };
+
+  // 解析逗号分隔的URL字符串为文件列表(用于表格资料说明展示)
+  const parseAttachments = (
+    attachmentsStr: string | undefined,
+  ): Array<{
+    fileUrl: string;
+    fileName: string;
+    fileType: string;
+  }> => {
+    if (!attachmentsStr || !attachmentsStr.trim()) {
+      return [];
+    }
+
+    const urls = attachmentsStr
+      .split(',')
+      .map((url) => url.trim())
+      .filter((url) => url);
+
+    return urls.map((url) => {
+      const urlParts = url.split('/');
+      const fileName = urlParts[urlParts.length - 1] || '未知文件';
+
+      const extension = fileName.split('.').pop()?.toLowerCase() || '';
+      let fileType = 'pdf';
+      if (extension === 'doc' || extension === 'docx') {
+        fileType = 'word';
+      } else if (extension === 'xls' || extension === 'xlsx') {
+        fileType = 'excel';
+      } else if (extension === 'ppt' || extension === 'pptx') {
+        fileType = 'ppt';
+      }
+
+      return {
+        fileUrl: url,
+        fileName,
+        fileType,
+      };
+    });
   };
 
   // 将逗号分隔的 URL 字符串转换为 FileItem[] 格式
@@ -537,6 +597,7 @@
 
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/basic-table-file.scss' as *;
 
   .reject-alert {
     margin-bottom: 20px;

+ 1 - 1
src/views/production-safety/safetyAssessment/inventory/inventory.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="safety-platform-container">
     <header class="safety-platform-container__header">
-      <div class="breadcrumb-title"> 物品库存管理 </div>
+      <div class="breadcrumb-title"> 奖品库管理 </div>
     </header>
     <main class="safety-platform-container__main">
       <div class="search-table-container">

+ 2 - 1
src/views/production-safety/safetyAssessment/pointDeduction/components/PointDeductionDetail.vue

@@ -156,7 +156,8 @@
     if (!res) return;
     try {
       const basePayload = {
-        deductionTitle: ruleFormData.deductionTitle,
+        // 扣分标题沿用扣分原因,后端若需要标题字段可复用
+        deductionTitle: ruleFormData.deductionReason,
         deductionDate: ruleFormData.deductionDate,
         deductionScore: ruleFormData.deductionValue,
         departmentName: ruleFormData.departmentName,

+ 4 - 14
src/views/production-safety/safetyAssessment/pointDeduction/configs/form.ts

@@ -2,12 +2,9 @@ import { FormConfig } from '@/types/basic-form';
 
 export const POINT_DEDUCTION_FORM_CONFIG: FormConfig[] = [
   {
-    prop: 'deductionTitle',
-    label: '扣分标题:',
-    component: 'ElInput',
-    componentProps: {
-      placeholder: '请输入扣分标题',
-    },
+    prop: 'hiddenDangerId',
+    label: '扣分原因:',
+    slot: 'deductionReason',
   },
   {
     prop: 'deductionDate',
@@ -32,17 +29,12 @@ export const POINT_DEDUCTION_FORM_CONFIG: FormConfig[] = [
   },
   {
     prop: 'departmentName',
-    label: '部门名称:',
+    label: '部门:',
     component: 'ElInput',
     componentProps: {
       placeholder: '请输入部门名称',
     },
   },
-  {
-    prop: 'hiddenDangerId',
-    label: '扣分原因:',
-    slot: 'deductionReason',
-  },
   {
     prop: 'status',
     label: '状态:',
@@ -51,7 +43,6 @@ export const POINT_DEDUCTION_FORM_CONFIG: FormConfig[] = [
 ];
 
 export const POINT_DEDUCTION_FORM_DATA = {
-  deductionTitle: '',
   deductionDate: '',
   deductionValue: 1, // 最小值为1
   departmentName: '',
@@ -61,7 +52,6 @@ export const POINT_DEDUCTION_FORM_DATA = {
 };
 
 export const POINT_DEDUCTION_FORM_RULES = {
-  deductionTitle: [{ required: true, message: '请输入扣分标题', trigger: 'blur' }],
   deductionDate: [{ required: true, message: '请选择扣分日期', trigger: 'change' }],
   deductionValue: [
     { required: true, message: '请输入扣分值', trigger: 'blur' },

+ 4 - 4
src/views/production-safety/safetyAssessment/receiptRecord/receiptRecordAdministratorReview.vue

@@ -69,17 +69,17 @@
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-                <!-- 0 待审核:审核、显示 -->
+                <!-- 0 待审核:审核、查看 -->
                 <template v-if="Number(scope.row.status) === 0">
                   <ActionButton
                     text="审核"
                     @click="handleAudit(scope.row.id, scope.row.approvalOrder)"
                   />
-                  <ActionButton text="显示" @click="handleView(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
                 </template>
-                <!-- 1 审核通过、-1 审核不通过、2 已领取:显示 -->
+                <!-- 1 审核通过、-1 审核不通过、2 已领取:查看 -->
                 <template v-else>
-                  <ActionButton text="显示" @click="handleView(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
                 </template>
               </div>
             </template>