Преглед изворни кода

Merge branch 'feat/production-safety' of http://192.168.6.110/product-group-fe/sfy-safety-group/sfy-safety into feat/production-safety

sunqijun пре 1 месец
родитељ
комит
7af62745f4

+ 2 - 1
src/api/production-safety/responsibility-implementation/index.ts

@@ -976,11 +976,12 @@ export function dangerWorkSaveApproval(params) {
  * 导出风险清单
  * @returns Promise<any> 导出的风险清单数据
  */
-export function exportRiskList () {
+export function exportRiskList (queryParam) {
   return http.request({
     url: '/safetyRisk/list/exportRiskList',
     method: 'post',
     responseType: 'blob',
+    data: queryParam,
   }, {
     isTransformResponse: false,
   });

+ 1 - 1
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/employeeReportHiddenTroubleManagement/components/employeeReportHiddenTroubleManagementDetail.vue

@@ -213,7 +213,7 @@
         ruleFormData.reporterJobNo = res.reporterJobNo || '';
         ruleFormData.reporterMobile = res.reporterMobile || '';
         ruleFormData.attachment = res.attachment || '';
-
+        ruleFormData.reportTime = res.reportTime || '';
         // 设置审核表单的隐患ID
         approveForm.value.hazardId = res.id;
       }

+ 1 - 3
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/employeeReportHiddenTroubleManagement/configs/form.ts

@@ -23,11 +23,9 @@ export const ACADEMY_FILE_FORM_CONFIG: FormConfig[] = [
   {
     prop: 'reportTime',
     label: '上报时间:',
-    component: 'ElDatePicker',
+    component: 'ElInput',
     componentProps: {
-      type: 'datetime',
       placeholder: '上报时间',
-      valueFormat: 'YYYY-MM-DD HH:mm:ss',
       disabled: true,
     },
   },

+ 3 - 3
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleCategoryManagement/hiddenTroubleCategoryManagement.vue

@@ -13,9 +13,6 @@
             <el-button plain class="search-table-container--button" @click="handleImport">
               导入
             </el-button>
-            <el-button plain class="search-table-container--button" @click="handleDownload">
-              导出
-            </el-button>
           </div>
 
           <div class="act-search">
@@ -54,6 +51,9 @@
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
               <el-button @click="handleReset">重置</el-button>
+              <el-button plain @click="handleDownload">
+                导出
+              </el-button>
             </section>
           </div>
         </header>

+ 11 - 5
src/views/production-safety/productionSafetySystem/collegeFileManagement/components/collegeFileManagementDetail.vue

@@ -29,9 +29,9 @@
               <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
                 >预览</el-button
               >
-              <!-- <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+              <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
                 >下载</el-button
-              > -->
+              >
             </div>
           </div>
         </div>
@@ -89,6 +89,7 @@
   import type { FileItem } from '@/components/UploadFiles/types';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
+  import { downloadFile } from '@/views/disaster/utils';
 
   const router = useRouter();
   const route = useRoute();
@@ -220,6 +221,11 @@
       ElMessage.warning('请上传文件');
       return;
     }
+
+    if (!ruleFormData.content || ruleFormData.content === '<p><br></p>') {
+      ElMessage.error('请输入文档内容');
+      return;
+    }
     
     try {
       // 处理文件上传:先上传文件获取 URL,然后提取 fileUrl
@@ -277,7 +283,7 @@
         });
         ElMessage.success('保存成功');
       }
-      cloneRuleFormData();
+      // cloneRuleFormData();
       router.back();
     } catch (e) {
       console.error('保存院级文件失败:', e);
@@ -292,8 +298,8 @@
   };
 
   onMounted(() => {
-    cloneRuleFormData();
-    beforeRouteLeave();
+    // cloneRuleFormData();
+    // beforeRouteLeave();
     if (isEditMode.value || isViewMode.value) {
       getDetail();
     }

+ 1 - 0
src/views/production-safety/productionSafetySystem/collegeFileManagement/configs/form.ts

@@ -90,4 +90,5 @@ export const ACADEMY_FILE_FORM_RULES = {
   fileFormat: [{ required: true, message: '请选择文件格式', trigger: 'change' }],
   releaseDate: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
   fileUrl: [{ required: true, message: '请上传文件', trigger: 'change' }],
+  content: [{ required: true, message: '请输入文档内容', trigger: 'blur' }],
 };

+ 10 - 4
src/views/production-safety/productionSafetySystem/lawManagement/components/lawManagementDetail.vue

@@ -29,9 +29,9 @@
               <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
                 >预览</el-button
               >
-              <!-- <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+              <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
                 >下载</el-button
-              > -->
+              >
             </div>
           </div>
         </div>
@@ -89,6 +89,7 @@
   import type { FileItem } from '@/components/UploadFiles/types';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
+  import { downloadFile } from '@/views/disaster/utils';
 
   const router = useRouter();
   const route = useRoute();
@@ -224,6 +225,11 @@
       return;
     }
     
+    if(!ruleFormData.content || ruleFormData.content == '<p><br></p>') {
+      ElMessage.error('请输入文档内容');
+      return;
+    }
+    
     try {
       // 处理文件上传:先上传文件获取 URL,然后提取 fileUrl
       // let fileUrl = '';
@@ -311,8 +317,8 @@
   };
 
   onMounted(() => {
-    cloneRuleFormData();
-    beforeRouteLeave();
+    // cloneRuleFormData();
+    // beforeRouteLeave();
     // 新增模式下,确保默认值正确设置
     if (isCreateMode.value) {
       ruleFormData.fileFormat = ruleFormData.fileFormat || '';

+ 1 - 0
src/views/production-safety/productionSafetySystem/lawManagement/configs/form.ts

@@ -91,4 +91,5 @@ export const LAW_REGULATION_FORM_RULES = {
   releaseDate: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
   // 文件上传的验证在 handleSubmit 中手动处理
   fileUrl: [{ required: true, message: '请选择文件上传', trigger: 'change' }],
+  content: [{ required: true, message: '请输入文档内容', trigger: 'blur' }],
 };

+ 7 - 2
src/views/production-safety/productionSafetySystem/safetyOrganizationSystemManagement/safetyOrganizationSystemManagement.vue

@@ -369,8 +369,13 @@ const position = ref('left')
   };
   // 时间查询
   const onchangeDateRange = () => {
-    tableQuery.queryParam.startTime = dateRange.value[0];
-    tableQuery.queryParam.endTime = dateRange.value[1];
+    if (dateRange.value && Array.isArray(dateRange.value) && dateRange.value.length === 2) {
+      tableQuery.queryParam.startTime = dateRange.value[0] || '';
+      tableQuery.queryParam.endTime = dateRange.value[1] || '';
+    } else {
+      tableQuery.queryParam.startTime = '';
+      tableQuery.queryParam.endTime = '';
+    }
     getTableData();
   };
   const handleSearch = () => {

+ 7 - 3
src/views/production-safety/productionSafetySystem/safetyTraining/components/safetyTrainingDetail.vue

@@ -150,7 +150,6 @@
 
   // 文件上传
   const handleUploadSuccess = (files: FileItem[]) => {
-    debugger
     ruleFormData.fileUrlList = files;
     ruleFormData.fileUrl = JSON.stringify(files) || '';
   };
@@ -229,6 +228,11 @@
       ElMessage.warning('请上传文件');
       return;
     }
+
+    if(!ruleFormData.content || ruleFormData.content === '<p><br></p>') {
+      ElMessage.error('请输入文档内容');
+      return;
+    }
     
     try {
       // 处理文件上传:先上传文件获取 URL,然后提取 fileUrl
@@ -301,8 +305,8 @@
   };
 
   onMounted(() => {
-    cloneRuleFormData();
-    beforeRouteLeave();
+    // cloneRuleFormData();
+    // beforeRouteLeave();
     if (isEditMode.value || isViewMode.value) {
       getDetail();
     }

+ 1 - 0
src/views/production-safety/productionSafetySystem/safetyTraining/configs/form.ts

@@ -90,4 +90,5 @@ export const INDUSTRY_STANDARD_FORM_RULES = {
   fileFormat: [{ required: true, message: '请选择文件格式', trigger: 'change' }],
   releaseDate: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
   fileUrl: [{ required: true, message: '请选择文件上传', trigger: 'change' }],
+  content: [{ required: true, message: '请输入文档内容', trigger: 'blur' }],
 };

+ 1 - 1
src/views/production-safety/risk-identification-and-control/risk-manage/list.vue

@@ -296,7 +296,7 @@
 
   const handleDownload = async () => {
     try {
-      const response = await exportRiskList();
+      const response = await exportRiskList(queryParams.queryParam);
       if (response) {
         const fileName = `风险清单管理_${new Date().toISOString().split('T')[0]}.xlsx`;
         downloadByData(response, fileName);