Переглянути джерело

fix:修复责任通知管理bug

sunqijun 2 місяців тому
батько
коміт
479d300672

+ 1 - 0
src/views/production-safety/implement-safety-duty/non-public-area-responsibilities/change.vue

@@ -174,6 +174,7 @@
     if (deptInfo?.length) {
       formValue[prop] = deptInfo[0]?.label;
       formValue.safetySpecificPersonTodo = null;
+      getUserData(todoUserOptions, deptInfo[0]?.label);
     }
   };
 

+ 10 - 3
src/views/production-safety/implement-safety-duty/public-area-responsibilities/list.vue

@@ -78,9 +78,16 @@
                                 <el-button type="primary" link
                                     @click="handleAreaCheckListApprove(scope, 0)">拒绝</el-button>
                             </template>
-                            <!-- <template v-if="scope.row.status === 3">
-                                <el-button type="primary" link>变更</el-button>
-                            </template> -->
+                            <template v-if="scope.row.status === 1 && scope.row.safetySpecificPerson === id">
+                                <el-button type="primary" link @click="
+                                    $router.push({
+                                        name: 'areaChangeResponsibilities:public',
+                                        query: {
+                                            id: scope.row.id,
+                                        },
+                                    })
+                                    ">变更</el-button>
+                            </template>
                             <el-button type="primary" link @click="
                                 $router.push({
                                     name: 'areaViewResponsibilities:public',

+ 1 - 1
src/views/production-safety/implement-safety-duty/responsibility-notice-manage-admin/review.vue

@@ -2,7 +2,7 @@
     <div class="safety-platform-container">
         <header class="safety-platform-container__header">
             <div class="detail-content">
-                <span>类型:{{ formData?.safetyAreaName }} </span>
+                <span>类型:{{ formData?.departmentName }} </span>
                 <span>创建人:{{ formData?.createdByName }} </span>
                 <span>创建时间:{{ formData?.createdAt }} </span>
             </div>

+ 41 - 48
src/views/production-safety/safetyTrainingAndEducation/educationTrainingPlanManagementDept/components/addTrainingInformation.vue

@@ -138,40 +138,47 @@
   };
   const handleImageUploadSuccess = (response: any, file: any, fileList: any[]) => {};
 
-  const handleFileChange = (file, fileList) => {
-    // 验证文件类型
+const handleFileChange = (file, fileList) => {
+    // 1. 验证文件类型和大小
     const allowedTypes = [
-      'application/rar',
-      'application/zip',
-      'application/msword',
-      'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
-      'application/pdf',
-      'video/mp4',
+        'application/rar', 
+        'application/zip', 
+        'application/msword',
+        'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+        'application/pdf',
+        'video/mp4'
     ];
-
+    
     if (!allowedTypes.includes(file.raw.type)) {
-      ElMessage.error('不支持的文件格式');
-      return;
+        ElMessage.error('不支持的文件格式');
+        return;
     }
 
-    // 验证文件大小
     if (file.raw.size > 20 * 1024 * 1024) {
-      ElMessage.error('文件大小不能超过20MB');
-      return;
+        ElMessage.error('文件大小不能超过20MB');
+        return;
     }
-    console.log('选择的文件:', file.raw);
-    fileList.value = [file.raw];
-    // 生成文件信息JSON
+
+    // 2. 关键修改:强制覆盖旧文件
+    fileList.value = [file.raw];  // 直接替换为新文件
+
+    // 3. 生成文件信息JSON
     fileInfo.value = {
-      fileName: file.raw.name,
-      fileSize: `${(file.raw.size / (1024 * 1024)).toFixed(2)} MB`,
-      fileType: file.raw.type,
-      lastModified: new Date(file.raw.lastModified).toLocaleString(),
-      rawFile: file.raw, // 包含更多原始文件信息
+        fileName: file.raw.name,
+        fileSize: `${(file.raw.size / (1024 * 1024)).toFixed(2)} MB`,
+        fileType: file.raw.type,
+        lastModified: new Date(file.raw.lastModified).toLocaleString(),
+        rawFile: file.raw
     };
+}
+
+  const handleUploadSignsUploadSuccess = async (item, fileList) => {
+    // const attachment = await formatAttachmentList(fileList);
+    // item.attachment = attachment;
+
+    // form.courseImg = [...signRecords.value.level1, ...signRecords.value.level2, ...signRecords.value.level3];
   };
 
-  const handleImageRemove = (file: any, fileList: any[]) => {};
 
   // 文件上传
   const handleUploadSuccess = (files: FileItem[]) => {
@@ -276,21 +283,6 @@
           <!-- <UploadFiles label="上传文件" :maxCount="1" :file-list="form.courseImg" :disabled="isViewMode"
                         accept=".rar,.zip,.doc,.docx,.pdf,.mp4" desc="支持格式:.rar .zip .doc .docx .pdf .mp4 ,单个文件不能超过20MB"
                         :allow-all-file-types="true" @uploadSuccess="handleUploadSuccess" /> -->
-
-          <!-- <el-upload action="https://jsonplaceholder.typicode.com/posts/" :on-exceed="handleExceed"
-                        :before-upload="beforeUpload" :file-list="fileList" :limit="1"
-                        accept=".rar, .zip, .doc, .docx, .pdf, .mp4">
-                        <el-button type="default" :disabled="isViewMode">
-                            <el-icon style="margin-right: 6px;">
-                                <UploadFilled />
-                            </el-icon> 选择附件
-                        </el-button>
-                        <template #tip>
-                            <div class="el-upload__tip">
-                                支持格式:.rar .zip .doc .docx .pdf .mp4,单个文件不能超过20MB
-                            </div>
-                        </template>
-</el-upload> -->
           <el-upload
             action=""
             :auto-upload="false"
@@ -309,12 +301,6 @@
               <div class="el-upload__tip"> 支持格式:.rar .zip .doc .docx .pdf .mp4,单个文件不能超过20MB </div>
             </template>
           </el-upload>
-
-          <!-- 显示文件信息 -->
-          <div v-if="fileInfo" class="file-info">
-            <h3>文件信息:</h3>
-            <pre>{{ fileInfo }}</pre>
-          </div>
         </el-form-item>
 
         <el-form-item label="是否需要签名:" prop="isSign">
@@ -325,12 +311,19 @@
         </el-form-item>
 
         <el-form-item label="课程图片:" prop="courseImg">
-          <el-upload
+            <UploadFiles
+                accept=".jpeg,.jpg,.png,.svg"
+                label="上传文件"
+                :fileList="form.courseImg"
+                @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+            />
+          <!-- <el-upload
             class="image-uploader"
-            action="/api/admin/minio/uploadFile"
+            action="safety_api/api/admin/minio/uploadFile"
             :file-list="form.courseContent"
             :disabled="isViewMode"
-            :limit="5"
+            :limit="1"
+            accept=".jpg,.png,.jpeg"
             :on-success="handleImageUploadSuccess"
             :on-remove="handleImageRemove"
             list-type="picture-card"
@@ -342,7 +335,7 @@
             <template #tip>
               <div class="el-upload__tip"> 支持格式:.jpg .png .jpeg,单个文件不能超过300k,设置一个默认图片。 </div>
             </template>
-          </el-upload>
+          </el-upload> -->
         </el-form-item>
       </el-form>