Przeglądaj źródła

fix:修复隐患台账整改页面整改数据必填,以及时间改为期限

sunqijun 3 tygodni temu
rodzic
commit
a40b16dd8e

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

@@ -252,13 +252,7 @@
     }
     try {
       const list = await formatAttachmentList(files);
-      const jsonArr = (list || [])
-        .map((r) => ({
-          file_name: r.fileName,
-          url: r.fileUrl || '',
-        }))
-        .filter((x) => x.url);
-      ruleFormData.attachment = JSON.stringify(jsonArr);
+      ruleFormData.attachment = JSON.stringify(list);
     } catch (e:any) {
       console.error('附件上传失败:', e);
       ElMessage.error(e?.message || e?.data || '附件上传失败,请重试');
@@ -400,7 +394,6 @@
   // 提交流程
 
   const handleSubmitApproval = () => {
-    
     approvalFormRef.value.validate(async (valid: boolean) => {
       if (valid) {
         const approvalInfoList: ApprovalInfoItem[] = approvalNodeList.value.map((node) => {

+ 11 - 10
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/components/hiddenTroubleAccountManagementDetail.vue

@@ -8,7 +8,7 @@
     />
   <main class="safety-platform-container__main">
     
-    <el-form label-width="150px" :model="ruleFormData" :rules="isViewMode ? undefined : formRules" ref="basicFormRef">
+    <el-form label-width="150px" :model="ruleFormData" :rules="formRules" ref="basicFormRef">
       <el-form-item label="隐患类别:" prop="typeId">
         <el-select
           v-model="ruleFormData.typeId"
@@ -92,12 +92,12 @@
         />
       </el-form-item>
 
-      <el-form-item label="整改期:" prop="rectificationDeadline">
+      <el-form-item label="整改期:" prop="rectificationDeadline">
         <el-date-picker
           v-model="ruleFormData.rectificationDeadline"
           type="date"
           value-format="YYYY-MM-DD"
-          placeholder="请选择整改期"
+          placeholder="请选择整改期"
           :disabled="isViewMode"
           style="width: 450px"
         />
@@ -248,7 +248,7 @@
       </el-button>
     </template>
     <template v-else-if="isRectifyMode">
-      <el-button type="primary" @click="handleRectifySubmitDirect">整改</el-button>
+      <el-button type="primary" @click="handleRectifySubmitDirect">提交</el-button>
     </template>
     <!-- 纯查看时仅保留上面的返回,不显示其他按钮 -->
   </footer>
@@ -381,7 +381,7 @@
   import type { DeptTree } from '@/types/dept/type';
   import { queryAvailableUserList } from '@/api/production-safety/responsibility-implementation';
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
-  import { ru } from 'element-plus/es/locale';
+
   import {
     queryDangerTypePage
   } from '@/api/production-safety';
@@ -396,9 +396,9 @@
   const isEditMode = computed(() => operate.value === 'hidden-trouble-account-edit');
   const isViewMode = computed(
     () =>
-      operate.value === 'hidden-trouble-account-view' ||
-      operate.value === 'hidden-trouble-account-rectify' ||
-      operate.value === 'hidden-trouble-account-review',
+      operate.value === 'hidden-trouble-account-view' || // 查看
+      operate.value === 'hidden-trouble-account-rectify' || // 整改
+      operate.value === 'hidden-trouble-account-review', // 复查
   );
   const isRectifyMode = computed(() => operate.value === 'hidden-trouble-account-rectify');
   const isReviewMode = computed(() => operate.value === 'hidden-trouble-account-review');
@@ -661,7 +661,7 @@ const attachmentsFileList = ref([]) as any
         ElMessage.success('保存成功');
       }
       router.back();
-    } catch (e) {
+    } catch (e:any) {
       console.error('保存隐患台账失败:', e);
       ElMessage.error(e?.message || e?.data || '保存失败,请重试');
     }
@@ -669,10 +669,11 @@ const attachmentsFileList = ref([]) as any
 
   // ---------- 整改(详情页直接提交,无弹窗) ----------
   async function handleRectifySubmitDirect() {
+    const ok = await handleValidate();
+    if (!ok) return;
     if (!currentId.value) return;
     try {
 
-
       const uploadedFileList = await formatAttachmentList(attachmentsFileList.value);
 
       await rectifyHiddenDanger({