Просмотр исходного кода

Merge branch 'feat/production-safety' into feat/production-safety-evaluation

xiaweibo 3 месяцев назад
Родитель
Сommit
65d152180f
23 измененных файлов с 1869 добавлено и 256 удалено
  1. 54 1
      src/api/production-safety/responsibility-implementation/index.ts
  2. 1 1
      src/components/UploadFiles/UploadFiles.vue
  3. 1 0
      src/router/routers/production-safety-router/risk-identification-and-control.ts
  4. 1 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanRecordDetailDept.vue
  5. 214 55
      src/views/production-safety/implement-safety-duty/agree-document-review.vue
  6. 4 4
      src/views/production-safety/implement-safety-duty/create-responsibility-agree.vue
  7. 4 4
      src/views/production-safety/implement-safety-duty/edit-responsibility-agree.vue
  8. 47 15
      src/views/production-safety/implement-safety-duty/responsibility-agree-manage-dept.vue
  9. 3 3
      src/views/production-safety/implement-safety-duty/responsibility-agree-manage.vue
  10. 243 76
      src/views/production-safety/implement-safety-duty/responsibility-feedback.vue
  11. 1 1
      src/views/production-safety/implement-safety-duty/responsibility-notice-manage-admin/components/SelectNotifyArea.vue
  12. 2 2
      src/views/production-safety/implement-safety-duty/responsibility-notice-manage-admin/notice-view.vue
  13. 4 4
      src/views/production-safety/implement-safety-duty/responsibility-notice-manage-dept/list.vue
  14. 3 3
      src/views/production-safety/implement-safety-duty/review-responsibility-agree.vue
  15. 0 1
      src/views/production-safety/implement-safety-duty/sign-agree-dept.vue
  16. 20 15
      src/views/production-safety/implement-safety-duty/view-recipients.vue
  17. 298 1
      src/views/production-safety/risk-identification-and-control/construction-safety-manage/add.vue
  18. 254 2
      src/views/production-safety/risk-identification-and-control/construction-safety-manage/audit.vue
  19. 339 1
      src/views/production-safety/risk-identification-and-control/construction-safety-manage/edit.vue
  20. 133 4
      src/views/production-safety/risk-identification-and-control/construction-safety-manage/list.vue
  21. 211 1
      src/views/production-safety/risk-identification-and-control/construction-safety-manage/view.vue
  22. 19 25
      src/views/production-safety/safetyAssessment/evaluationSystem/evaluationSystem.vue
  23. 13 37
      src/views/production-safety/safetyAssessment/receiptRecord/components/ReceiptRecordDetail.vue

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

@@ -744,7 +744,7 @@ export function constructionSafetyQueryPageConstruction(params) {
  */
 export function constructionSafetyDeleteConstructionById(id) {
   return http.request({
-    url: `/constructionSafety/deleteConstructionById/${id}`,
+    url: `/constructionSafety/deleteConstructionById?id=${id}`,
     method: 'delete',
   });
 }
@@ -776,3 +776,56 @@ export function safetyResponsibilityDeptSaveSign(params) {
     params
   });
 }
+
+
+/**
+ * 管理端更新施工安全申请
+ * @param params - 更新后的施工安全申请数据(需包含 ID)
+ * @returns Promise<void>
+ */
+export function constructionSafetyUpdateApply(params) {
+  return http.request({
+    url: `/constructionSafety/updateApply`,
+    method: 'put',
+    params
+  });
+}
+
+/**
+ * 管理端保存施工安全数据
+ * @param params - 施工安全数据
+ * @returns Promise<void>
+ */ 
+export function constructionSafetySaveConstruction(params) {
+  return http.request({
+    url: `/constructionSafety/saveConstruction`,
+    method: 'post',
+    params
+  });
+}
+
+/**
+ * 管理端更新施工安全数据
+ * @param params - 更新后的施工安全数据(需包含 ID)
+ * @returns Promise<void>
+ */
+export function constructionSafetyUpdateConstruction(params) {
+  return http.request({
+    url: `/constructionSafety/updateConstruction`,
+    method: 'put',
+    params
+  });
+}
+
+
+/**
+ * 管理端查询施工安全详情
+ * @param id - 施工安全申请 ID
+ * @returns Promise<any> 施工安全申请详细信息
+ */
+export function constructionSafetyQueryDetailConstruction(id) {
+  return http.request({
+    url: `/constructionSafety/queryDetailConstruction?id=${id}`,
+    method: 'get',
+  });
+}

+ 1 - 1
src/components/UploadFiles/UploadFiles.vue

@@ -13,7 +13,7 @@
       :id="inputId"
       class="upload-input"
       multiple
-      accept=".pdf,.docx,.xlsx,.pptx"
+      accept=".pdf,.docx,.doc,.xlsx,.pptx"
       @change="handleFileSelect"
       :disabled="isUploadDisabled"
     />

+ 1 - 0
src/router/routers/production-safety-router/risk-identification-and-control.ts

@@ -199,6 +199,7 @@ import { RouteComponent } from "vue-router";
             noCache: false,
           }
         },
+        
         {
           id: 93009,
           parentId: 90014,

+ 1 - 0
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanRecordDetailDept.vue

@@ -171,6 +171,7 @@
     try {
       await saveAreaCheckPlanDetailDept({
         areaPlanId: planId.value,
+        checkedCompanyName: formData.value.inspectedUnit,
         checkTime: formData.value.checkTime,
         checkPersonName: formData.value.inspector,
         // 暂无人员 code 来源,前端先不传或由后端根据名称解析

+ 214 - 55
src/views/production-safety/implement-safety-duty/agree-document-review.vue

@@ -8,6 +8,12 @@
         <span>创建时间:{{ formData?.createdAt }} </span>
       </div>
     </header>
+    <el-alert
+      v-if="showAlertBar"
+      title="您提交的反馈材料审核不通过,请尽快查看并修改,再次提交进行审核,谢谢!"
+      type="warning"
+    />
+
     <main class="safety-platform-container__main">
       <el-form ref="formRef" label-width="auto" :model="formData" :rules="rules">
         <h4>基本信息</h4>
@@ -27,10 +33,10 @@
               <div class="label">签署人数:</div>
               <div class="value">{{ formData.signedQuantity }}</div>
             </div>
-            <div class="col">
+            <!-- <div class="col">
               <div class="label">下发对象:</div>
               <div class="value">{{ formData.userGroupName }}</div>
-            </div>
+            </div> -->
           </div>
           <div class="row">
             <div class="col">
@@ -69,45 +75,131 @@
             </div>
           </div>
         </div>
-        <h4>责任书签署文件</h4>
-        <div class="detail-ct">
-          <div class="row">
-            <div class="col">
-              <div class="label">责任书文档:</div>
-              <div class="value value-s1">
-                <div class="file-list">
-                  <div class="file-item" v-for="item in formData.signsUpload" :key="item.fileId">
-                    <span class="file-item--name">{{ item.fileName }}</span>
-                    <div class="file-item--footer">
-                      <!-- <div class="info">
-                        <span>{{ item.fileSize }}</span>
-                      </div> -->
-                      <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
-                        >预览</el-button
-                      >
-                      <el-button link type="primary" @click.stop="downloadFile(item.fileUrl, item.fileName)"
-                        >下载</el-button
-                      >
+        <template v-if="signRecords.level1.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 副院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 负责人签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 负责人签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'D'"> 科室负责人签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level1" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      disabled
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
                     </div>
-                  </div>
+                  </div> -->
                 </div>
               </div>
             </div>
           </div>
-        </div>
+        </template>
+        <template v-if="signRecords.level2.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 党委书记签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 党委书记签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 党委书记签署</h4>
+          <h4 v-if="currentDepartmentKey === 'D'"> 部门负责人签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level2" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      disabled
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
+                    </div>
+                  </div> -->
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
+        <template v-if="signRecords.level3.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 所长签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level3" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      disabled
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
+                    </div>
+                  </div> -->
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
         <h4>材料上传</h4>
+
         <div class="detail-ct">
           <div class="row">
             <div class="col">
               <div class="label">上传附件:</div>
               <div class="value value-s1">
-                <div class="file-list">
+                <el-form-item prop="feedback">
+                  <UploadFiles
+                    label="上传附件"
+                    @upload-success="(fileList) => handleUploadSuccess('feedback', fileList)"
+                    :fileList="formData.feedback"
+                  />
+                </el-form-item>
+                <div class="file-list" v-if="formData.feedback?.length">
                   <div class="file-item" v-for="item in formData.feedback" :key="item.fileId">
                     <span class="file-item--name">{{ item.fileName }}</span>
                     <div class="file-item--footer">
-                      <!-- <div class="info">
-                        <span>{{ item.fileSize }}</span>
-                      </div> -->
                       <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
                         >预览</el-button
                       >
@@ -133,8 +225,7 @@
   <RefuseReason ref="reviewFeedBackRef" @submit="handleReviewFailedSubmit" />
 </template>
 <script lang="ts" setup>
-  import { onMounted, ref, nextTick, reactive, shallowRef } from 'vue';
-  import dayjs from 'dayjs';
+  import { onMounted, ref, computed, reactive } from 'vue';
   import { ElMessage } from 'element-plus';
   import '@wangeditor/editor/dist/css/style.css';
   import { useRouter, useRoute } from 'vue-router';
@@ -145,6 +236,7 @@
     safetyResponsibilityDeptQueryDetail,
     safetyResponsibilityAdminApprove,
   } from '@/api/production-safety/responsibility-implementation';
+
   import RefuseReason from './components/RefuseReason.vue';
 
   import { unformatAttachment, formatAttachmentList } from '@/components/UploadFiles/utils';
@@ -154,7 +246,7 @@
   const route = useRoute();
   const formRef = ref<any>(null);
   const submiting = ref(false);
-
+  const reviewFeedBackRef = ref<InstanceType<typeof RefuseReason>>();
   const formData = reactive<any>({
     departmentName: '',
     createdByName: '',
@@ -164,40 +256,69 @@
     signsUpload: [],
     responsibilityName: '',
     statusName: '',
-    signedQuantity: 0,
+    signedQuantity: '',
     userGroupName: '',
     planStartTime: null,
     planEndTime: null,
+    rejection: '',
+    signRecords: [],
   });
 
-  const rules = reactive({});
+  const rules = reactive({
+    signsUpload: [
+      {
+        required: true,
+        message: '请上传签署材料',
+      },
+    ],
+  });
+
+  const signRecords = computed(() => {
+    return {
+      level1: formData.signRecords.filter((item) => item.signLevel === 1),
+      level2: formData.signRecords.filter((item) => item.signLevel === 2),
+      level3: formData.signRecords.filter((item) => item.signLevel === 3),
+    };
+  });
+
+  const currentDepartmentKey = computed(() => {
+    switch (formData.departmentName.trim()) {
+      case '院领导':
+        return 'A';
+      case '所/中心/职能部门/直属研究部/分公司':
+        return 'B';
+      case '所/中心级部门':
+        return 'C';
+      case '科室':
+        return 'D';
+      case '员工':
+      case '常驻供应商':
+        return 'E';
+      default:
+        return '';
+    }
+  });
+
+  const showAlertBar = computed(() => {
+    if (!formData.rejection) {
+      return false;
+    }
+    return route.query.status === '3' && formData.rejection !== null;
+  });
   const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
-  const reviewFeedBackRef = ref<any>(null);
   const previewOnline = (url: string | undefined, type) => {
     if (url) {
       previewOnlineRef.value?.open(url, type);
     }
   };
-
-  const handleUploadSuccess = (fileList) => {
-    formData.attachment = fileList;
-    formRef.value.validateField('attachment');
+  const handleUploadSignsUploadSuccess = (item, fileList) => {
+    item.attachment = fileList;
+    formData.signRecords = [...signRecords.value.level1, ...signRecords.value.level2, ...signRecords.value.level3];
   };
 
-  const handleReviewFailedSubmit = (formData) => {
-    reviewFeedBackRef.value.submitLoading = true;
-    safetyResponsibilityAdminApprove({
-      approveType: 0,
-      refuseReason: formData.refuseReason,
-      id: route.query.id,
-    })
-      .then(() => {
-        reviewFeedBackRef.value.dialogHide();
-        ElMessage.success('提交成功');
-      })
-      .finally(() => {
-        reviewFeedBackRef.value.submitLoading = false;
-      });
+  const handleUploadSuccess = (prop: string, fileList: any[]) => {
+    formData[prop] = fileList;
+    formRef.value.validateField(prop);
   };
   const handleReviewApproved = () => {
     submiting.value = true;
@@ -216,7 +337,6 @@
         submiting.value = false;
       });
   };
-
   const handleQueryDetail = () => {
     safetyResponsibilityDeptQueryDetail({
       id: route.query.id,
@@ -228,17 +348,35 @@
             attachment: unformatAttachment(res.attachment),
             signsUpload: unformatAttachment(res.signsUpload),
             feedback: unformatAttachment(res.feedback),
+            signRecords: res.signRecords?.map((item) => ({
+              ...item,
+              attachment: unformatAttachment(item.attachment),
+            })),
           });
         }
       });
-      console.log(formData);
     });
   };
-
   const handleReviewFailed = () => {
     reviewFeedBackRef.value.dialogShow();
   };
 
+  const handleReviewFailedSubmit = (formData) => {
+    reviewFeedBackRef.value.submitLoading = true;
+    safetyResponsibilityAdminApprove({
+      approveType: 0,
+      refuseReason: formData.refuseReason,
+      id: route.query.id,
+    })
+      .then(() => {
+        reviewFeedBackRef.value.dialogHide();
+        ElMessage.success('提交成功');
+      })
+      .finally(() => {
+        reviewFeedBackRef.value.submitLoading = false;
+      });
+  };
+
   onMounted(() => {
     handleQueryDetail();
   });
@@ -287,8 +425,9 @@
 
       .value {
         display: flex;
+        justify-content: space-between;
         flex: 1;
-        padding-left: 20px;
+        padding: 10px 20px;
         align-items: center;
         border-right: 1px solid rgb(220, 223, 230);
       }
@@ -303,6 +442,26 @@
       border-left: 1px solid rgb(220, 223, 230);
     }
   }
+  .table {
+    display: flex;
+    align-items: stretch;
+    border: 1px solid rgb(220, 223, 230);
+    border-width: 1px 1px 0 1px;
+  }
+  .table .value {
+    display: flex;
+    align-items: center;
+    // (:deep).el-form-item {
+    //   margin-bottom: 0;
+    // }
+  }
+  .table .label {
+    display: flex;
+    align-items: center;
+    border-right: 1px solid rgb(220, 223, 230);
+    background-color: rgb(245, 247, 250);
+  }
+
   // :deep(.breadcrumb .title) {
   //   margin-left: 0;
   // }

+ 4 - 4
src/views/production-safety/implement-safety-duty/create-responsibility-agree.vue

@@ -16,8 +16,8 @@
             style="width: 50%"
           />
         </el-form-item>
-        <el-form-item label="所属部门" prop="departmentName">
-          <el-select v-model="formValue.departmentName" size="large" placeholder="所属部门" style="width: 50%">
+        <el-form-item label="类别名称" prop="departmentName">
+          <el-select v-model="formValue.departmentName" size="large" placeholder="类别名称" style="width: 50%">
             <el-option value="院领导">院领导</el-option>
             <el-option value="所/中心/职能部门/直属研究部/分公司">所/中心/职能部门/直属研究部/分公司</el-option>
             <el-option value="所/中心级部门">所/中心级部门</el-option>
@@ -247,8 +247,8 @@
         const attachment = await formatAttachmentList(formValue.attachment);
         safetyResponsibilitySaveSafetyResponsibility({
           ...formValue,
-          planStartTime: formValue.planStartTime ? dayjs(formValue.planStartTime).format('YYYY-MM-DD') : null,
-          planEndTime: formValue.planEndTime ? dayjs(formValue.planEndTime).format('YYYY-MM-DD') : null,
+          // planStartTime: formValue.planStartTime ? dayjs(formValue.planStartTime).format('YYYY-MM-DD') : null,
+          // planEndTime: formValue.planEndTime ? dayjs(formValue.planEndTime).format('YYYY-MM-DD') : null,
           attachment: JSON.stringify(attachment),
           executeObject: Number(formValue.executeObject),
           userGroupId: formValue.userGroupId.join(','),

+ 4 - 4
src/views/production-safety/implement-safety-duty/edit-responsibility-agree.vue

@@ -13,8 +13,8 @@
             style="width: 50%"
           />
         </el-form-item>
-        <el-form-item label="所属部门" prop="departmentName">
-          <el-select v-model="formValue.departmentName" size="large" placeholder="所属部门" style="width: 50%">
+        <el-form-item label="类别名称" prop="departmentName">
+          <el-select v-model="formValue.departmentName" size="large" placeholder="类别名称" style="width: 50%">
             <el-option value="院领导">院领导</el-option>
             <el-option value="所/中心/职能部门/直属研究部/分公司">所/中心/职能部门/直属研究部/分公司</el-option>
             <el-option value="所/中心级部门">所/中心级部门</el-option>
@@ -249,8 +249,8 @@
         safetyResponsibilityUpdateSafetyResponsibility({
           ...formValue,
           id: Number(route.query.id),
-          planStartTime: formValue.planStartTime ? dayjs(formValue.planStartTime).format('YYYY-MM-DD') : null,
-          planEndTime: formValue.planEndTime ? dayjs(formValue.planEndTime).format('YYYY-MM-DD') : null,
+          // planStartTime: formValue.planStartTime ? dayjs(formValue.planStartTime).format('YYYY-MM-DD') : null,
+          // planEndTime: formValue.planEndTime ? dayjs(formValue.planEndTime).format('YYYY-MM-DD') : null,
           attachment: JSON.stringify(attachment),
           executeObject: Number(formValue.executeObject),
           userGroupId: formValue.userGroupId.join(','),

+ 47 - 15
src/views/production-safety/implement-safety-duty/responsibility-agree-manage-dept.vue

@@ -31,11 +31,11 @@
               <el-option :value="6" label="已作废" />
             </el-select>
           </el-form-item>
-          <el-form-item v-if="activeTab" label="所属部门">
+          <el-form-item v-if="activeTab" label="类别名称">
             <el-select
               v-model="queryParams.queryParam.departmentName"
               clearable
-              placeholder="所属部门"
+              placeholder="类别名称"
               style="width: 170px"
             >
               <el-option value="院领导">院领导</el-option>
@@ -70,7 +70,25 @@
       <div class="table-content">
         <el-table ref="multipleTableRef" :data="tableData.data" @selection-change="handleSelectionChange">
           <el-table-column type="selection" :selectable="selectable" width="55" />
-          <el-table-column label="责任书名称" prop="responsibilityName" width="180" />
+          <el-table-column label="责任书名称" prop="responsibilityName" width="180">
+            <template #default="scope">
+              <el-button
+                link
+                type="primary"
+                @click.prevent="
+                  $router.push({
+                    name: 'responsibilityFeedback',
+                    query: {
+                      id: scope.row.id,
+                      status: scope.row.status,
+                      mode: 'view',
+                    },
+                  })
+                "
+                >{{ scope.row.responsibilityName }}
+              </el-button>
+            </template>
+          </el-table-column>
           <el-table-column label="状态" prop="statusName" width="100" />
           <el-table-column label="类别" prop="departmentName" width="180" />
           <el-table-column label="下发数" prop="issuedQuantity" width="120" />
@@ -82,10 +100,7 @@
             <template #default="scope">
               <div style="display: flex">
                 <el-button
-                  v-if="
-                    scope.row.status === 2 &&
-                    (scope.row.departmentName !== '员工' || scope.row.departmentName !== '常驻供应商')
-                  "
+                  v-if="scope.row.status === 2 && !/员工|常驻供应商/.test(scope.row.departmentName)"
                   type="primary"
                   link
                   @click="
@@ -101,10 +116,7 @@
                   签署
                 </el-button>
                 <el-button
-                  v-if="
-                    scope.row.status === 2 &&
-                    (scope.row.departmentName === '员工' || scope.row.departmentName === '常驻供应商')
-                  "
+                  v-if="scope.row.status === 2 && /员工|常驻供应商/.test(scope.row.departmentName)"
                   type="primary"
                   link
                   @click="handleConfirm(scope)"
@@ -112,7 +124,22 @@
                   确认
                 </el-button>
                 <el-dropdown trigger="click">
-                  <el-button type="primary" link>反馈</el-button>
+                  <el-button
+                    v-if="scope.row.status === 3"
+                    type="primary"
+                    link
+                    @click="
+                      $router.push({
+                        name: 'responsibilityFeedback',
+                        query: {
+                          id: scope.row.id,
+                          status: scope.row.status,
+                        },
+                      })
+                    "
+                  >
+                    反馈
+                  </el-button>
                   <!-- <template #dropdown>
                     <el-dropdown-menu>
                       <el-dropdown-item
@@ -195,12 +222,13 @@
   import { omit } from 'lodash-es';
   import { queryUserGroupPage } from '@/api/system/person-group';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
+  import { useUserInfoHook } from '@/hooks/useUserInfoHook';
 
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
 
   import { unformatAttachment } from '@/components/UploadFiles/utils';
   import { downloadFile } from '@/views/disaster/utils';
-  import { el } from 'element-plus/es/locale';
+
   // import IssueSafetyResponsibility from './components/IssueSafetyResponsibility.vue';
   const router = useRouter();
   const batchSignDialogVisible = ref(false);
@@ -208,6 +236,8 @@
   const activeTab = ref('');
   const groupList = ref<any[]>([]);
   const submitLoading = ref(false);
+  const { id: userId } = useUserInfoHook();
+
   const queryParams = reactive<any>({
     pageNumber: 1,
     pageSize: 10,
@@ -216,9 +246,10 @@
       departmentName: '',
       status: '',
       date: '',
-      responsibilityPersonId: '',
+      responsibilityPersonId: userId,
     },
   });
+
   const multipleTableRef = ref<any>();
   const tableData = reactive({
     data: [],
@@ -228,7 +259,7 @@
   const attachment = ref<any[]>([]);
 
   const selectable = (row) => {
-    return row.status === 2 && (row.departmentName !== '员工' || row.departmentName !== '常驻供应商');
+    return row.status === 2 && !/员工|常驻供应商/.test(row.departmentName);
   };
 
   const handleSelectionChange = (val) => {
@@ -300,6 +331,7 @@
         router.push({
           name: 'responsibilityAgreeManageDept',
         });
+        queryTableList();
       })
       .finally(() => {});
   };

+ 3 - 3
src/views/production-safety/implement-safety-duty/responsibility-agree-manage.vue

@@ -32,11 +32,11 @@
               <el-option :value="6" label="已作废" />
             </el-select>
           </el-form-item>
-          <el-form-item v-if="activeTab" label="所属部门">
+          <el-form-item v-if="!activeTab" label="类别名称">
             <el-select
               v-model="queryParams.queryParam.departmentName"
               clearable
-              placeholder="所属部门"
+              placeholder="类别名称"
               style="width: 170px"
             >
               <el-option value="院领导">院领导</el-option>
@@ -78,7 +78,7 @@
         <el-table :data="tableData.data">
           <el-table-column label="责任书名称" prop="responsibilityName" width="180" />
           <el-table-column label="状态" prop="statusName" width="100" />
-          <el-table-column label="所属部门" prop="departmentName" width="180" />
+          <el-table-column label="类别名称" prop="departmentName" width="180" />
           <el-table-column label="下发数" prop="issuedQuantity" width="120" />
           <el-table-column label="签署人数" prop="signedQuantity" width="120" />
           <el-table-column label="签署比例" prop="signedRatio" width="120" />

+ 243 - 76
src/views/production-safety/implement-safety-duty/responsibility-feedback.vue

@@ -8,6 +8,8 @@
         <span>创建时间:{{ formData?.createdAt }} </span>
       </div>
     </header>
+    <el-alert v-if="showAlertBar" :title="formData.rejection" type="warning" />
+
     <main class="safety-platform-container__main">
       <el-form ref="formRef" label-width="auto" :model="formData" :rules="rules">
         <h4>基本信息</h4>
@@ -27,10 +29,10 @@
               <div class="label">签署人数:</div>
               <div class="value">{{ formData.signedQuantity }}</div>
             </div>
-            <div class="col">
+            <!-- <div class="col">
               <div class="label">下发对象:</div>
               <div class="value">{{ formData.userGroupName }}</div>
-            </div>
+            </div> -->
           </div>
           <div class="row">
             <div class="col">
@@ -69,45 +71,133 @@
             </div>
           </div>
         </div>
-        <h4>责任书签署文件</h4>
-        <div class="detail-ct">
-          <div class="row">
-            <div class="col">
-              <div class="label">责任书文档:</div>
-              <div class="value value-s1">
-                <div class="file-list">
-                  <div class="file-item" v-for="item in formData.signsUpload" :key="item.fileId">
-                    <span class="file-item--name">{{ item.fileName }}</span>
-                    <div class="file-item--footer">
-                      <!-- <div class="info">
-                        <span>{{ item.fileSize }}</span>
-                      </div> -->
-                      <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
-                        >预览</el-button
-                      >
-                      <el-button link type="primary" @click.stop="downloadFile(item.fileUrl, item.fileName)"
-                        >下载</el-button
-                      >
+        <template v-if="signRecords.level1.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 副院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 负责人签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 负责人签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'D'"> 科室负责人签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level1" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      :disabled="!item.signFlag || $route.query.mode === 'view'"
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
                     </div>
-                  </div>
+                  </div> -->
                 </div>
               </div>
             </div>
           </div>
-        </div>
+        </template>
+        <template v-if="signRecords.level2.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 党委书记签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 党委书记签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 党委书记签署</h4>
+          <h4 v-if="currentDepartmentKey === 'D'"> 部门负责人签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level2" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      :disabled="!item.signFlag || $route.query.mode === 'view'"
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
+                    </div>
+                  </div> -->
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
+        <template v-if="signRecords.level3.length">
+          <h4 v-if="currentDepartmentKey === 'A'"> 院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'B'"> 院长签署 </h4>
+          <h4 v-if="currentDepartmentKey === 'C'"> 所长签署 </h4>
+          <div class="detail-ct">
+            <div class="row" v-for="item in signRecords.level3" :key="item.id">
+              <div class="col">
+                <div class="label">签名:</div>
+                <div class="value value-s1">
+                  <el-form-item>
+                    <UploadFiles
+                      :disabled="!item.signFlag || $route.query.mode === 'view'"
+                      label="上传文件"
+                      :fileList="item.attachment"
+                      @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
+                    />
+                  </el-form-item>
+                  <!-- <div class="file-list">
+                    <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
+                      <span class="file-item--name">{{ file.fileName }}</span>
+                      <div class="file-item--footer">
+                        <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
+                        >
+                      </div>
+                    </div>
+                  </div> -->
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
+
         <h4>材料上传</h4>
+
         <div class="detail-ct">
           <div class="row">
             <div class="col">
               <div class="label">上传附件:</div>
               <div class="value value-s1">
-                <div class="file-list">
+                <el-form-item prop="feedback">
+                  <UploadFiles
+                    :disabled="$route.query.mode === 'view'"
+                    label="上传附件"
+                    @upload-success="(fileList) => handleUploadSuccess('feedback', fileList)"
+                    :fileList="formData.feedback"
+                  />
+                </el-form-item>
+                <div class="file-list" v-if="formData.feedback?.length">
                   <div class="file-item" v-for="item in formData.feedback" :key="item.fileId">
                     <span class="file-item--name">{{ item.fileName }}</span>
                     <div class="file-item--footer">
-                      <!-- <div class="info">
-                        <span>{{ item.fileSize }}</span>
-                      </div> -->
                       <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
                         >预览</el-button
                       >
@@ -124,17 +214,16 @@
       </el-form>
     </main>
     <footer class="safety-platform-container__footer">
-      <el-button @click="$router.push({ name: 'responsibilityAgreeManage' })">返回</el-button>
-      <el-button type="primary" @click="handleReviewFailed">审核不通过</el-button>
-      <el-button type="primary" @click="handleReviewApproved" :loading="submiting">审核通过</el-button>
+      <el-button @click="$router.push({ name: 'responsibilityAgreeManageDept' })">返回</el-button>
+      <el-button v-if="$route.query.mode !== 'view'" type="primary" @click="handleSubmit" :loading="submiting"
+        >提交</el-button
+      >
     </footer>
   </div>
   <PreviewOnline ref="previewOnlineRef" />
-  <RefuseReason ref="reviewFeedBackRef" @submit="handleReviewFailedSubmit" />
 </template>
 <script lang="ts" setup>
-  import { onMounted, ref, nextTick, reactive, shallowRef } from 'vue';
-  import dayjs from 'dayjs';
+  import { onMounted, ref, computed, reactive } from 'vue';
   import { ElMessage } from 'element-plus';
   import '@wangeditor/editor/dist/css/style.css';
   import { useRouter, useRoute } from 'vue-router';
@@ -143,9 +232,9 @@
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import {
     safetyResponsibilityDeptQueryDetail,
-    safetyResponsibilityAdminApprove,
+    queryAvailableUserList,
+    safetyResponsibilityDeptSignOrFeedback,
   } from '@/api/production-safety/responsibility-implementation';
-  import RefuseReason from './components/RefuseReason.vue';
 
   import { unformatAttachment, formatAttachmentList } from '@/components/UploadFiles/utils';
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
@@ -164,57 +253,101 @@
     signsUpload: [],
     responsibilityName: '',
     statusName: '',
-    signedQuantity: 0,
+    signedQuantity: '',
     userGroupName: '',
     planStartTime: null,
     planEndTime: null,
+    status: '',
+    rejection: '',
+    signRecords: [],
+  });
+
+  const rules = reactive({
+    signsUpload: [
+      {
+        required: true,
+        message: '请上传签署材料',
+      },
+    ],
+    feedback: [
+      {
+        required: true,
+        message: '请上传反馈材料',
+      },
+    ],
+  });
+
+  const signRecords = computed(() => {
+    return {
+      level1: formData.signRecords.filter((item) => item.signLevel === 1),
+      level2: formData.signRecords.filter((item) => item.signLevel === 2),
+      level3: formData.signRecords.filter((item) => item.signLevel === 3),
+    };
   });
 
-  const rules = reactive({});
+  const currentDepartmentKey = computed(() => {
+    switch (formData.departmentName.trim()) {
+      case '院领导':
+        return 'A';
+      case '所/中心/职能部门/直属研究部/分公司':
+        return 'B';
+      case '所/中心级部门':
+        return 'C';
+      case '科室':
+        return 'D';
+      case '员工':
+      case '常驻供应商':
+        return 'E';
+      default:
+        return '';
+    }
+  });
+
+  const userOptions = ref<any[]>([]);
+
+  const showAlertBar = computed(() => {
+    if (!formData.rejection) {
+      return false;
+    }
+    return formData.status !== 5 && formData.rejection !== null;
+  });
   const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
-  const reviewFeedBackRef = ref<any>(null);
+
   const previewOnline = (url: string | undefined, type) => {
     if (url) {
       previewOnlineRef.value?.open(url, type);
     }
   };
-
-  const handleUploadSuccess = (fileList) => {
-    formData.attachment = fileList;
-    formRef.value.validateField('attachment');
+  const handleUploadSignsUploadSuccess = (item, fileList) => {
+    item.attachment = fileList;
+    formData.signRecords = [...signRecords.value.level1, ...signRecords.value.level2, ...signRecords.value.level3];
   };
 
-  const handleReviewFailedSubmit = (formData) => {
-    reviewFeedBackRef.value.submitLoading = true;
-    safetyResponsibilityAdminApprove({
-      approveType: 0,
-      refuseReason: formData.refuseReason,
-      id: route.query.id,
-    })
-      .then(() => {
-        reviewFeedBackRef.value.dialogHide();
-        ElMessage.success('提交成功');
-      })
-      .finally(() => {
-        reviewFeedBackRef.value.submitLoading = false;
-      });
+  const handleUploadSuccess = (prop, fileList) => {
+    formData[prop] = fileList;
+    formRef.value.validateField(prop);
   };
-  const handleReviewApproved = () => {
-    submiting.value = true;
-    safetyResponsibilityAdminApprove({
-      approveType: 1,
-      refuseReason: null,
+
+  const handleSubmit = async () => {
+    const params = {
+      updateType: 1,
       id: route.query.id,
-    })
-      .then(() => {
-        ElMessage.success('审核成功');
-        router.push({
-          name: 'responsibilityAgreeManage',
-        });
-      })
-      .finally(() => {
-        submiting.value = false;
-      });
+      feedback: JSON.stringify(await formatAttachmentList(formData.feedback)),
+    };
+    console.log('params:', params);
+    formRef.value?.validate((valid) => {
+      if (valid) {
+        submiting.value = true;
+        safetyResponsibilityDeptSignOrFeedback(params)
+          .then((res) => {
+            ElMessage.success('提交成功');
+            router.push({ name: 'responsibilityAgreeManageDept' });
+          })
+          .finally(() => {
+            submiting.value = false;
+          });
+      }
+    });
   };
 
   const handleQueryDetail = () => {
@@ -228,18 +361,31 @@
             attachment: unformatAttachment(res.attachment),
             signsUpload: unformatAttachment(res.signsUpload),
             feedback: unformatAttachment(res.feedback),
+            signRecords: res.signRecords?.map((item) => ({
+              ...item,
+              attachment: unformatAttachment(item.attachment),
+            })),
           });
         }
       });
-      console.log(formData);
     });
   };
 
-  const handleReviewFailed = () => {
-    reviewFeedBackRef.value.dialogShow();
+  const getUserData = (realname = '') => {
+    queryAvailableUserList({
+      pageNumber: 1,
+      pageSize: 300,
+      queryParam: { realname },
+    }).then((res: any) => {
+      userOptions.value = (res.records || [])?.map((u: any) => ({
+        value: u.id,
+        label: u.realname,
+      }));
+    });
   };
 
-  onMounted(() => {
+  onMounted(async () => {
+    await getUserData('');
     handleQueryDetail();
   });
 </script>
@@ -287,8 +433,9 @@
 
       .value {
         display: flex;
+        justify-content: space-between;
         flex: 1;
-        padding-left: 20px;
+        padding: 10px 20px;
         align-items: center;
         border-right: 1px solid rgb(220, 223, 230);
       }
@@ -303,6 +450,26 @@
       border-left: 1px solid rgb(220, 223, 230);
     }
   }
+  .table {
+    display: flex;
+    align-items: stretch;
+    border: 1px solid rgb(220, 223, 230);
+    border-width: 1px 1px 0 1px;
+  }
+  .table .value {
+    display: flex;
+    align-items: center;
+    // (:deep).el-form-item {
+    //   margin-bottom: 0;
+    // }
+  }
+  .table .label {
+    display: flex;
+    align-items: center;
+    border-right: 1px solid rgb(220, 223, 230);
+    background-color: rgb(245, 247, 250);
+  }
+
   // :deep(.breadcrumb .title) {
   //   margin-left: 0;
   // }

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

@@ -40,7 +40,7 @@
           <el-table-column type="selection" :reserve-selection="true" width="55" />
 
           <el-table-column type="index" label="序号" width="80" />
-          <el-table-column label="楼宇/区域" prop="buildingCode" width="180" />
+          <el-table-column label="楼宇/区域" prop="buildingNo" width="180" />
           <el-table-column label="房间/区域" prop="floorRoomNo" width="180" />
           <el-table-column label="功能名称" prop="nameFunction" width="120" />
           <el-table-column label="安全责任所/中心" prop="safetyResponsibleCenter" width="200" />

+ 2 - 2
src/views/production-safety/implement-safety-duty/responsibility-notice-manage-admin/notice-view.vue

@@ -38,7 +38,7 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="所属部门">
+          <el-form-item label="分组名称">
             <el-select v-model="queryParams.queryParam.userGroupId" placeholder="分组名称" style="width: 170px">
               <el-option v-for="group in groupList" :key="group.id" :label="group.name" :value="group.id" />
             </el-select>
@@ -66,7 +66,7 @@
         <el-table :data="tableData.data">
           <el-table-column label="责任书名称" prop="responsibilityName" width="180" />
           <el-table-column label="状态" prop="statusName" width="100" />
-          <el-table-column label="所属部门" prop="departmentName" />
+          <el-table-column label="类别名称" prop="departmentName" />
 
           <el-table-column label="分组名称" prop="userGroupName" />
           <el-table-column label="计划完成时间" prop="planEndTime" />

+ 4 - 4
src/views/production-safety/implement-safety-duty/responsibility-notice-manage-dept/list.vue

@@ -30,11 +30,11 @@
               <el-option :value="5" label="已作废" />
             </el-select>
           </el-form-item>
-          <el-form-item v-if="activeTab" label="所属部门">
+          <el-form-item v-if="activeTab" label="类别名称">
             <el-select
               v-model="queryParams.queryParam.departmentName"
               clearable
-              placeholder="所属部门"
+              placeholder="类别名称"
               style="width: 170px"
             >
               <el-option value="院领导">院领导</el-option>
@@ -67,9 +67,9 @@
           <el-table-column label="责任书通知名称" prop="responsibilityName" width="180" />
           <el-table-column label="状态" prop="statusName" width="100" />
           <!-- <el-table-column label="类型" prop="safetyAreaName" width="130" /> -->
-          <el-table-column label="下发数" prop="issuedQuantity" width="120" />
+          <!-- <el-table-column label="下发数" prop="issuedQuantity" width="120" />
           <el-table-column label="反馈人数" prop="signedQuantity" width="120" />
-          <el-table-column label="反馈比例" prop="signedRatio" width="120" />
+          <el-table-column label="反馈比例" prop="signedRatio" width="120" /> -->
           <el-table-column label="计划开始时间" prop="planStartTime" width="200" />
           <el-table-column label="计划完成时间" prop="planEndTime" width="200" />
           <el-table-column fixed="right" min-width="300" label="操作">

+ 3 - 3
src/views/production-safety/implement-safety-duty/review-responsibility-agree.vue

@@ -26,11 +26,11 @@
               <el-option :value="6" label="已作废" />
             </el-select>
           </el-form-item>
-          <el-form-item v-if="activeTab" label="所属部门">
+          <el-form-item v-if="activeTab" label="类别名称">
             <el-select
               v-model="queryParams.queryParam.departmentName"
               clearable
-              placeholder="所属部门"
+              placeholder="类别名称"
               style="width: 170px"
             >
               <el-option value="院领导">院领导</el-option>
@@ -74,7 +74,7 @@
           <el-table-column fixed="left" type="selection" width="60" />
           <el-table-column label="责任书名称" prop="responsibilityName" width="180" />
           <el-table-column label="状态" prop="statusName" width="100" />
-          <el-table-column label="所属部门" prop="departmentName" width="180" />
+          <el-table-column label="类别名称" prop="departmentName" width="180" />
           <el-table-column label="分组名称" prop="userGroupName" width="150" />
           <el-table-column label="计划结束时间" prop="planEndTime" width="150" />
           <el-table-column fixed="right" min-width="300" label="操作">

+ 0 - 1
src/views/production-safety/implement-safety-duty/sign-agree-dept.vue

@@ -445,7 +445,6 @@
         value: u.id,
         label: u.realname,
       }));
-      console.log('userData:', userOptions.value);
     });
   };
 

+ 20 - 15
src/views/production-safety/implement-safety-duty/view-recipients.vue

@@ -9,17 +9,17 @@
       </div>
       <el-tabs v-model="activeTab">
         <el-tab-pane label="全部" name="" />
-        <el-tab-pane label="待签署" name="2" />
-        <el-tab-pane label="待反馈材料" name="3" />
-        <el-tab-pane label="待审核" name="4" />
-        <el-tab-pane label="已完成" name="5" />
-        <el-tab-pane label="已作废" name="6" />
+        <el-tab-pane label="待签署" :name="2" />
+        <el-tab-pane label="待反馈材料" :name="3" />
+        <el-tab-pane label="待审核" :name="4" />
+        <el-tab-pane label="已完成" :name="5" />
+        <el-tab-pane label="已作废" :name="6" />
       </el-tabs>
     </header>
     <main class="safety-platform-container__main">
       <div class="search-form">
         <el-form :inline="true">
-          <el-form-item label="状态" v-if="activeTab">
+          <el-form-item label="状态" v-if="!activeTab">
             <el-select v-model="queryParams.queryParam.status" clearable placeholder="状态" style="width: 170px">
               <el-option :value="1" label="未下发" />
               <el-option :value="2" label="待签署" />
@@ -29,7 +29,7 @@
               <el-option :value="6" label="已作废" />
             </el-select>
           </el-form-item>
-          <el-form-item label="所属部门">
+          <el-form-item label="分组名称">
             <el-select v-model="queryParams.queryParam.userGroupId" placeholder="分组名称" style="width: 170px">
               <el-option v-for="group in groupList" :key="group.id" :label="group.name" :value="group.id" />
             </el-select>
@@ -57,7 +57,7 @@
         <el-table :data="tableData.data">
           <el-table-column label="责任书名称" prop="responsibilityName" width="180" />
           <el-table-column label="状态" prop="statusName" width="100" />
-          <el-table-column label="所属部门" prop="departmentName" />
+          <el-table-column label="类别名称" prop="departmentName" />
 
           <el-table-column label="分组名称" prop="userGroupName" />
           <el-table-column label="计划完成时间" prop="planEndTime" />
@@ -75,6 +75,7 @@
               <el-popconfirm v-if="scope.row.status === 6">
                 <el-button type="primary" link @click="handleScrap(scope)">作废</el-button>
               </el-popconfirm>
+
               <el-button
                 v-if="scope.row.status === 4"
                 type="primary"
@@ -133,7 +134,7 @@
     pageSize: 10,
     queryParam: {
       adminId: route.query.id,
-      status: '',
+      status: route.query.status,
       date: '',
       userGroupId: '',
     },
@@ -238,17 +239,21 @@
     queryTableList();
   };
 
-  watch(route.query, (a, b) => {
-    console.log('a:', a, b);
-    //
-  });
+  watch(
+    () => route.query.status,
+    (a, b) => {
+      activeTab.value = Number(a);
+    },
+    {
+      immediate: true,
+    },
+  );
 
   onMounted(async () => {
-    activeTab.value = route.query.status;
     Object.assign(queryParams, {
       queryParam: {
         ...queryParams.queryParam,
-        status: Number(activeTab.value),
+        // status: Number(activeTab.value),
       },
     });
     await handleQueryUserGroupPage();

+ 298 - 1
src/views/production-safety/risk-identification-and-control/construction-safety-manage/add.vue

@@ -1 +1,298 @@
-<template> xxx </template>
+<template>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <div class="breadcrumb-title">
+        <BreadcrumbBack />
+        新增施工安全申请
+      </div>
+    </header>
+    <main class="safety-platform-container__main">
+      <el-form ref="formRef" :inline="true" label-width="auto" :model="formValue" :rules="rules">
+        <el-form-item label="项目名称" prop="projectName">
+          <el-input v-model="formValue.projectName" size="large" placeholder="请输入项目名称" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工单位" prop="constructionUnit">
+          <el-input
+            v-model="formValue.constructionUnit"
+            size="large"
+            placeholder="请输入单位全称"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="施工地点" prop="constructionLocation">
+          <el-input
+            v-model="formValue.constructionLocation"
+            size="large"
+            placeholder="楼宇名称/区域"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="施工人数" prop="workerCount">
+          <el-input-number v-model="formValue.workerCount" size="large" :min="1" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="项目负责人" prop="projectManagerName">
+          <el-input v-model="formValue.projectManagerName" size="large" placeholder="负责人姓名" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="负责人电话1" prop="projectManagerPhone1">
+          <el-input v-model="formValue.projectManagerPhone1" size="large" placeholder="必填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="负责人电话2" prop="projectManagerPhone2">
+          <el-input v-model="formValue.projectManagerPhone2" size="large" placeholder="选填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="现场安全员" prop="siteSafetyManagerName">
+          <el-input
+            v-model="formValue.siteSafetyManagerName"
+            size="large"
+            placeholder="安全员姓名"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="安全员电话1" prop="siteSafetyPhone1">
+          <el-input v-model="formValue.siteSafetyPhone1" size="large" placeholder="必填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="安全员电话2" prop="siteSafetyPhone2">
+          <el-input v-model="formValue.siteSafetyPhone2" size="large" placeholder="选填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="开始时间" prop="projectStartTime">
+          <el-date-picker
+            v-model="formValue.projectStartTime"
+            type="date"
+            value-format="YYYY-MM-DD"
+            size="large"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="结束时间" prop="projectEndTime">
+          <el-date-picker
+            v-model="formValue.projectEndTime"
+            type="date"
+            value-format="YYYY-MM-DD"
+            size="large"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="涉及工种" prop="involvedTrades" style="width: 87.2%">
+          <el-checkbox-group v-model="tradeArray">
+            <el-checkbox
+              v-for="t in ['水电', '泥瓦', '木工', '焊接', '气割', '登高', '密闭', '特种驾驶', '其他']"
+              :key="t"
+              :label="t"
+            />
+          </el-checkbox-group>
+        </el-form-item>
+
+        <el-form-item v-if="tradeArray.includes('其他')" label="其他工种说明" prop="otherTrade">
+          <el-input v-model="formValue.otherTrade" size="large" placeholder="请补充工种类型" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工内容简述" prop="constructionContent" style="width: 87.2%">
+          <el-input
+            type="textarea"
+            v-model="formValue.constructionContent"
+            size="large"
+            :rows="3"
+            placeholder="简要描述施工方案"
+          />
+        </el-form-item>
+
+        <el-form-item label="备注说明" prop="otherDescription" style="width: 87.2%">
+          <el-input
+            type="textarea"
+            v-model="formValue.otherDescription"
+            size="large"
+            :rows="3"
+            placeholder="其他补充说明"
+          />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <div style="width: 100%; margin-bottom: 20px; font-weight: bold; padding-left: 10px"
+          >附件上传清单(全项必填)</div
+        >
+
+        <el-form-item
+          v-for="item in attachmentConfigs"
+          :key="item.prop"
+          :label="item.label"
+          :prop="item.prop"
+          style="width: 43.6%"
+        >
+          <UploadFiles
+            label="上传文件"
+            @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
+            :fileList="attachmentLists[item.prop]"
+          />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <el-form-item label="审批流程" prop="templateId" style="width: 87.2%">
+          <el-select
+            v-model="formValue.templateId"
+            placeholder="请选择审批流程"
+            size="large"
+            style="width: 330px"
+            clearable
+          >
+            <el-option v-for="opt in approvalOptions" :key="opt.id" :label="opt.templateName" :value="opt.id" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </main>
+    <footer class="safety-platform-container__footer">
+      <el-button @click="router.back()">返回</el-button>
+      <el-button type="primary" :loading="submiting" @click="handleSave">保存</el-button>
+    </footer>
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { ref, reactive, watch, onMounted } from 'vue';
+  import { useRouter } from 'vue-router';
+  import { ElMessage } from 'element-plus';
+  import dayjs from 'dayjs';
+
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import { constructionSafetySaveConstruction } from '@/api/production-safety/responsibility-implementation';
+  import { formatAttachmentList } from '@/components/UploadFiles/utils';
+
+  const router = useRouter();
+  const formRef = ref<any>(null);
+  const submiting = ref(false);
+  const tradeArray = ref<string[]>([]);
+  const approvalOptions = ref<any[]>([]);
+  const attachmentConfigs = [
+    { label: '施工安全交底', prop: 'safetyCommitmentAttachment' },
+    { label: '安全管理协议', prop: 'safetyAgreementAttachment' },
+    { label: '安全告知单', prop: 'safetyNoticeAttachment' },
+    { label: '施工方案', prop: 'constructionPlanAttachment' },
+    { label: '劳保用品清单', prop: 'ppeListAttachment' },
+    { label: '施工机械清单', prop: 'equipmentListAttachment' },
+    { label: '人员身份信息', prop: 'personnelIdAttachment' },
+    { label: '安全教育记录', prop: 'safetyEducationAttachment' },
+    { label: '环境承诺书', prop: 'environmentCommitmentAttachment' },
+    { label: '消防管理承诺', prop: 'fireManagementAttachment' },
+    { label: '特种作业证', prop: 'specialWorkerCertAttachment' },
+    { label: '特种设备合格证', prop: 'specialEquipmentCertAttachment' },
+  ];
+
+  const attachmentLists = reactive<any>(Object.fromEntries(attachmentConfigs.map((a) => [a.prop, []])));
+
+  const formValue = reactive<any>({
+    projectName: '',
+    constructionContent: '',
+    constructionLocation: '',
+    constructionUnit: '',
+    projectManagerName: '',
+    projectManagerPhone1: '',
+    projectManagerPhone2: '',
+    siteSafetyManagerName: '',
+    siteSafetyPhone1: '',
+    siteSafetyPhone2: '',
+    workerCount: undefined,
+    projectStartTime: '',
+    projectEndTime: '',
+    involvedTrades: '',
+    otherTrade: '',
+    otherDescription: '',
+    templateId: '',
+    ...Object.fromEntries(attachmentConfigs.map((a) => [a.prop, ''])),
+  });
+
+  // 提交审批弹窗相关
+
+  const handleUploadSuccess = async (prop: string, fileList: any[]) => {
+    attachmentLists[prop] = fileList;
+    const formatted = await formatAttachmentList(fileList);
+    formValue[prop] = formatted.length > 0 ? JSON.stringify(formatted) : '';
+    formRef.value?.validateField(prop);
+  };
+
+  watch(tradeArray, (val) => {
+    formValue.involvedTrades = val.join(',');
+  });
+
+  const rules = reactive({
+    projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+    constructionUnit: [{ required: true, message: '请输入施工单位', trigger: 'blur' }],
+    constructionLocation: [{ required: true, message: '请输入施工地点', trigger: 'blur' }],
+    workerCount: [{ required: true, message: '请输入人数', trigger: 'blur' }],
+    projectManagerName: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
+    projectManagerPhone1: [{ required: true, message: '请输入电话', trigger: 'blur' }],
+    siteSafetyManagerName: [{ required: true, message: '请输入安全负责人', trigger: 'blur' }],
+    siteSafetyPhone1: [{ required: true, message: '请输入电话', trigger: 'blur' }],
+    projectStartTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
+    projectEndTime: [
+      { required: true, message: '请选择结束时间', trigger: 'change' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (value && formValue.projectStartTime && dayjs(value).isBefore(dayjs(formValue.projectStartTime))) {
+            callback(new Error('不能早于开始时间'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'change',
+      },
+    ],
+    involvedTrades: [{ required: true, message: '请选择工种', trigger: 'change' }],
+    constructionContent: [{ required: true, message: '请输入简述', trigger: 'blur' }],
+    templateId: [{ required: true, message: '请选择审批流程', trigger: 'change' }],
+    ...Object.fromEntries(
+      attachmentConfigs.map((a) => [a.prop, [{ required: true, message: `请上传${a.label}`, trigger: 'change' }]]),
+    ),
+  });
+
+  /**
+   * 统一保存逻辑
+   * @param status 0-保存草稿(通常不强校验附件),1-提交申请(强制校验)
+   */
+  const handleSave = () => {
+    formRef.value?.validate(async (valid: boolean) => {
+      if (valid) {
+        submiting.value = true;
+        // 这里的 status 根据后端接口文档调整,通常提交需要带上业务状态
+        constructionSafetySaveConstruction({ ...formValue, submitStatus: status })
+          .then(() => {
+            ElMessage.success('保存成功!');
+            router.push({ name: 'constructionSafetyManage' });
+          })
+          .finally(() => {
+            submiting.value = false;
+          });
+      } else {
+      }
+    });
+  };
+</script>
+
+<style lang="scss" scoped>
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/page-details-layout.scss' as *;
+
+  .safety-platform-container {
+    &__main {
+      padding: 24px;
+      background-color: #fff;
+    }
+    :deep(.el-form-item) {
+      margin-right: 20px;
+      margin-bottom: 24px;
+      vertical-align: top;
+      .el-form-item__label {
+        font-weight: bold;
+      }
+    }
+  }
+</style>

+ 254 - 2
src/views/production-safety/risk-identification-and-control/construction-safety-manage/audit.vue

@@ -1,5 +1,257 @@
 <template>
-  <div>
-    <h1>Audit</h1>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <div class="breadcrumb-title"> 施工作业安全管理 </div>
+    </header>
+    <main class="safety-platform-container__main">
+      <div class="search-form">
+        <el-form :inline="true">
+          <el-form-item label="项目名称">
+            <el-input v-model="queryParams.queryParam.projectName" placeholder="搜索项目名称" style="width: 170px" />
+          </el-form-item>
+          <el-form-item label="状态">
+            <el-select v-model="queryParams.queryParam.status" clearable placeholder="状态" style="width: 170px">
+              <el-option value="" label="全部" />
+              <el-option :value="1" label="待提交" />
+              <el-option :value="2" label="待审批" />
+              <el-option :value="3" label="已完成" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="部门名称">
+            <el-cascader
+              v-model="queryParams.queryParam.departmentId"
+              style="width: 170px"
+              ref="cascaderRef"
+              :options="firstLevelDepts"
+              :props="cascaderProp"
+              :show-all-levels="false"
+              placeholder="部门名称"
+              filterable
+              @change="handleChangeDept"
+            />
+          </el-form-item>
+          <el-form-item label="施工地点">
+            <el-input
+              v-model="queryParams.queryParam.constructionLocation"
+              placeholder="输入施工地点"
+              style="width: 170px"
+            />
+          </el-form-item>
+        </el-form>
+
+        <div>
+          <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
+          <el-button type="primary" @click="queryTableList">查询</el-button>
+          <el-button @click="handleRestParams">重置</el-button>
+        </div>
+      </div>
+
+      <div class="table-content">
+        <el-table :data="tableData.data">
+          <el-table-column type="index" label="序号" width="80" />
+          <el-table-column label="项目名称" prop="projectName" width="180" />
+          <el-table-column label="申请单号" prop="code" width="180" />
+          <el-table-column label="施工地点(区域)" prop="constructionLocation" width="180" />
+          <el-table-column label="工程施工内容简要描述 " prop="constructionContent" width="230" />
+          <el-table-column label="施工单位名称" prop="constructionUnit" width="180" />
+          <el-table-column label="施工项目负责人" prop="projectManagerName" width="180" />
+          <el-table-column label="施工现场安全负责人" prop="siteSafetyManagerName" width="240" />
+          <el-table-column label="当前流程节点" prop="nodeDescription" width="180" />
+          <el-table-column label="状态" props="statusName" width="100" />
+          <el-table-column fixed="right" min-width="140" label="操作">
+            <template #default="scope">
+              <!-- <el-button
+                type="primary"
+                link
+                @click="$router.push({ name: 'constructionSafetyManageEdit', query: { id: scope.row.id } })"
+                >编辑</el-button
+              > -->
+              <el-button
+                type="primary"
+                link
+                @click="$router.push({ name: 'constructionSafetyManageView', query: { id: scope.row.id } })"
+                >查看</el-button
+              >
+
+              <!-- <el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button> -->
+
+              <el-button type="primary" link>审批</el-button>
+              <!-- <el-button
+                type="primary"
+                link
+                @click="$router.push({ name: 'constructionSafetyManageMonitor', query: { id: scope.row.id } })"
+                >视频监控</el-button
+              > -->
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination-container" v-if="tableData.total > 0">
+        <el-pagination
+          background
+          :current-page="queryParams.pageNumber"
+          :page-size="queryParams.pageSize"
+          :total="tableData.total"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        />
+      </div>
+    </main>
   </div>
 </template>
+<script lang="ts" setup>
+  import { onMounted, reactive, ref } from 'vue';
+  import { ElMessage } from 'element-plus';
+  import { useRouter } from 'vue-router';
+  import {
+    constructionSafetyQueryPageConstruction,
+    constructionSafetyDeleteConstructionById,
+  } from '@/api/production-safety/responsibility-implementation';
+  import { omit } from 'lodash-es';
+  import { useUserInfoHook } from '@/hooks/useUserInfoHook';
+  import { unformatAttachment } from '@/components/UploadFiles/utils';
+  import { downloadFile } from '@/views/disaster/utils';
+  import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
+  import { getAllDepartments } from '@/api/auth/dept';
+
+  const router = useRouter();
+  const { id } = useUserInfoHook();
+  const firstLevelDepts = ref<any[]>([]);
+  const cascaderProp = {
+    expandTrigger: 'click',
+    checkStrictly: true,
+    // emitPath: false,
+    value: 'id',
+    label: 'deptName',
+  };
+  const queryParams = reactive<any>({
+    pageNumber: 1,
+    pageSize: 10,
+    queryParam: {
+      status: '',
+      projectName: '',
+      constructionLocation: '',
+      department: '',
+      departmentId: [],
+    },
+  });
+  const cascaderRef = ref();
+
+  const tableData = reactive({
+    data: [],
+    total: 0,
+  });
+
+  const handleSizeChange = (value) => {};
+
+  const handleCurrentChange = (value) => {
+    queryParams.pageNumber = value;
+    queryTableList();
+  };
+
+  const getDeptData = () => {
+    getAllDepartments().then((res) => {
+      firstLevelDepts.value = formatDeptTree(res);
+    });
+  };
+  const handleChangeDept = () => {
+    const deptInfo = cascaderRef.value?.getCheckedNodes();
+    if (deptInfo?.[0]) {
+      queryParams.queryParam.department = deptInfo[0].label;
+      queryParams.queryParam.departmentId = deptInfo[0].pathValues;
+    }
+  };
+
+  const handleConfirmDeleteRow = (scope) => {
+    constructionSafetyDeleteConstructionById(scope.row.id).then(() => {
+      ElMessage.success('删除成功!');
+      queryTableList();
+    });
+  };
+
+  const queryTableList = () => {
+    constructionSafetyQueryPageConstruction({
+      ...queryParams,
+      queryParam: {
+        ...omit(queryParams.queryParam, 'responsibleDepartmentId'),
+      },
+    }).then((res) => {
+      tableData.data = res.records;
+      tableData.total = res.totalRow;
+    });
+  };
+  const handleRestParams = () => {
+    Object.assign(queryParams, {
+      pageNumber: 1,
+      pageSize: 10,
+      queryParam: {
+        ...queryParams.queryParam,
+        status: '',
+        projectName: '',
+        constructionLocation: '',
+        department: '',
+        departmentId: [],
+      },
+    });
+    queryTableList();
+  };
+
+  onMounted(async () => {
+    await getDeptData();
+    queryTableList();
+  });
+</script>
+
+<style lang="scss" scoped>
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/basic-table-action.scss' as *;
+
+  :deep(.el-tabs__header) {
+    margin: 0;
+  }
+  :deep(.el-tabs__item) {
+    font-size: 14px !important;
+  }
+  :deep(.flexContent) {
+    display: flex;
+  }
+  :deep(.breadcrumb .title) {
+    margin-left: 0;
+  }
+
+  :deep(.el-form) {
+    flex: 1;
+    display: flex;
+    row-gap: 15px;
+    flex-wrap: wrap;
+  }
+  :deep(.el-form-item) {
+    margin-bottom: 0;
+  }
+  :deep(main) {
+    display: flex;
+    flex-direction: column;
+  }
+  .search-form {
+    min-width: 800px;
+    display: flex;
+
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+  }
+
+  .button-content {
+    margin-bottom: 20px;
+  }
+  .table-content {
+    flex: 1;
+    overflow: hidden;
+    overflow-y: auto;
+  }
+  .page-content {
+    display: flex;
+    justify-content: flex-end;
+  }
+</style>

+ 339 - 1
src/views/production-safety/risk-identification-and-control/construction-safety-manage/edit.vue

@@ -1 +1,339 @@
-<template> xxx </template>
+<template>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <div class="breadcrumb-title">
+        <BreadcrumbBack />
+        编辑施工安全申请
+      </div>
+    </header>
+    <main class="safety-platform-container__main">
+      <el-form ref="formRef" :inline="true" label-width="auto" :model="formValue" :rules="rules">
+        <el-form-item label="项目名称" prop="projectName">
+          <el-input v-model="formValue.projectName" size="large" placeholder="请输入项目名称" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工单位" prop="constructionUnit">
+          <el-input
+            v-model="formValue.constructionUnit"
+            size="large"
+            placeholder="请输入单位全称"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="施工地点" prop="constructionLocation">
+          <el-input
+            v-model="formValue.constructionLocation"
+            size="large"
+            placeholder="楼宇名称/区域"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="施工人数" prop="workerCount">
+          <el-input-number v-model="formValue.workerCount" size="large" :min="1" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="项目负责人" prop="projectManagerName">
+          <el-input v-model="formValue.projectManagerName" size="large" placeholder="负责人姓名" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="负责人电话1" prop="projectManagerPhone1">
+          <el-input
+            v-model="formValue.projectManagerPhone1"
+            size="large"
+            placeholder="手机或座机"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="负责人电话2" prop="projectManagerPhone2">
+          <el-input v-model="formValue.projectManagerPhone2" size="large" placeholder="选填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="现场安全员" prop="siteSafetyManagerName">
+          <el-input
+            v-model="formValue.siteSafetyManagerName"
+            size="large"
+            placeholder="安全员姓名"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="安全员电话1" prop="siteSafetyPhone1">
+          <el-input v-model="formValue.siteSafetyPhone1" size="large" placeholder="手机或座机" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="安全员电话2" prop="siteSafetyPhone2">
+          <el-input v-model="formValue.siteSafetyPhone2" size="large" placeholder="选填" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="开始时间" prop="projectStartTime">
+          <el-date-picker
+            v-model="formValue.projectStartTime"
+            type="date"
+            value-format="YYYY-MM-DD"
+            size="large"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="结束时间" prop="projectEndTime">
+          <el-date-picker
+            v-model="formValue.projectEndTime"
+            type="date"
+            value-format="YYYY-MM-DD"
+            size="large"
+            style="width: 330px"
+          />
+        </el-form-item>
+
+        <el-form-item label="涉及工种" prop="involvedTrades" style="width: 87.2%">
+          <el-checkbox-group v-model="tradeArray" @change="handleTradeChange">
+            <el-checkbox
+              v-for="t in ['水电', '泥瓦', '木工', '焊接', '气割', '登高', '密闭', '特种驾驶', '其他']"
+              :key="t"
+              :label="t"
+              :value="t"
+            />
+          </el-checkbox-group>
+        </el-form-item>
+
+        <el-form-item v-if="tradeArray.includes('其他')" label="其他工种说明" prop="otherTrade">
+          <el-input v-model="formValue.otherTrade" size="large" placeholder="请详细补充" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工内容简述" prop="constructionContent" style="width: 87.2%">
+          <el-input
+            type="textarea"
+            v-model="formValue.constructionContent"
+            size="large"
+            :rows="3"
+            placeholder="请填写详细施工内容"
+          />
+        </el-form-item>
+
+        <el-form-item label="备注说明" prop="otherDescription" style="width: 87.2%">
+          <el-input type="textarea" v-model="formValue.otherDescription" size="large" :rows="3" placeholder="选填" />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <div style="width: 100%; margin-bottom: 20px; font-weight: bold; padding-left: 10px">附件清单(全项必填)</div>
+
+        <el-form-item
+          v-for="item in attachmentConfigs"
+          :key="item.prop"
+          :label="item.label"
+          :prop="item.prop"
+          style="width: 43.6%"
+        >
+          <UploadFiles
+            label="上传文件"
+            @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
+            :fileList="attachmentLists[item.prop]"
+          />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <el-form-item label="审批流程" prop="templateId" style="width: 87.2%">
+          <el-select
+            v-model="formValue.templateId"
+            placeholder="请选择审批流程"
+            size="large"
+            style="width: 330px"
+            clearable
+          >
+            <el-option v-for="opt in approvalOptions" :key="opt.id" :label="opt.templateName" :value="opt.id" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </main>
+    <footer class="safety-platform-container__footer">
+      <el-button @click="router.back()">返回</el-button>
+      <el-button type="primary" :loading="submiting" @click="handleSave(0)">保存</el-button>
+    </footer>
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { ref, reactive, onMounted } from 'vue';
+  import { useRouter, useRoute } from 'vue-router';
+  import { ElMessage } from 'element-plus';
+  import dayjs from 'dayjs';
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import { getAllApproval } from '@/api/approval/approval';
+  import {
+    constructionSafetyQueryDetailConstruction,
+    constructionSafetyUpdateConstruction,
+  } from '@/api/production-safety/responsibility-implementation';
+  import { unformatAttachment, formatAttachmentList } from '@/components/UploadFiles/utils';
+
+  const router = useRouter();
+  const route = useRoute();
+  const formRef = ref<any>();
+  const submiting = ref(false);
+  const tradeArray = ref<string[]>([]);
+  const approvalOptions = ref<any[]>([]);
+
+  const attachmentConfigs = [
+    { label: '施工安全交底', prop: 'safetyCommitmentAttachment' },
+    { label: '安全管理协议', prop: 'safetyAgreementAttachment' },
+    { label: '安全告知单', prop: 'safetyNoticeAttachment' },
+    { label: '施工方案', prop: 'constructionPlanAttachment' },
+    { label: '劳保用品清单', prop: 'ppeListAttachment' },
+    { label: '施工机械清单', prop: 'equipmentListAttachment' },
+    { label: '人员身份信息', prop: 'personnelIdAttachment' },
+    { label: '安全教育记录', prop: 'safetyEducationAttachment' },
+    { label: '环境承诺书', prop: 'environmentCommitmentAttachment' },
+    { label: '消防管理承诺', prop: 'fireManagementAttachment' },
+    { label: '特种作业证', prop: 'specialWorkerCertAttachment' },
+    { label: '特种设备合格证', prop: 'specialEquipmentCertAttachment' },
+  ];
+
+  const attachmentLists = reactive<any>(Object.fromEntries(attachmentConfigs.map((a) => [a.prop, []])));
+
+  const formValue = reactive<any>({
+    id: undefined,
+    projectName: '',
+    constructionContent: '',
+    constructionLocation: '',
+    constructionUnit: '',
+    projectManagerName: '',
+    projectManagerPhone1: '',
+    projectManagerPhone2: '',
+    siteSafetyManagerName: '',
+    siteSafetyPhone1: '',
+    siteSafetyPhone2: '',
+    workerCount: undefined,
+    projectStartTime: '',
+    projectEndTime: '',
+    involvedTrades: '',
+    otherTrade: '',
+    otherDescription: '',
+    templateId: '',
+    ...Object.fromEntries(attachmentConfigs.map((a) => [a.prop, ''])),
+  });
+
+  // 2. 验证规则定义
+  const rules = reactive({
+    projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+    constructionUnit: [{ required: true, message: '请输入施工单位', trigger: 'blur' }],
+    constructionLocation: [{ required: true, message: '请输入施工地点', trigger: 'blur' }],
+    workerCount: [{ required: true, message: '请输入施工人数', trigger: 'blur' }],
+    projectManagerName: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
+    projectManagerPhone1: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
+    siteSafetyManagerName: [{ required: true, message: '请输入现场安全员', trigger: 'blur' }],
+    siteSafetyPhone1: [{ required: true, message: '请输入安全员电话', trigger: 'blur' }],
+    projectStartTime: [{ required: true, message: '请选择开始日期', trigger: 'change' }],
+    projectEndTime: [
+      { required: true, message: '请选择结束日期', trigger: 'change' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (value && formValue.projectStartTime && dayjs(value).isBefore(dayjs(formValue.projectStartTime))) {
+            callback(new Error('结束时间不能早于开始时间'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'change',
+      },
+    ],
+    involvedTrades: [{ required: true, message: '请至少选择一个涉及工种', trigger: 'change' }],
+    otherTrade: [{ required: true, message: '请补充其他工种说明', trigger: 'blur' }],
+    constructionContent: [{ required: true, message: '请输入施工内容简述', trigger: 'blur' }],
+    templateId: [{ required: true, message: '请选择审批流程', trigger: 'change' }],
+    // 自动为所有附件添加必填验证
+    ...Object.fromEntries(
+      attachmentConfigs.map((a) => [a.prop, [{ required: true, message: `请上传${a.label}`, trigger: 'change' }]]),
+    ),
+  });
+
+  const handleTradeChange = (val: string[]) => {
+    formValue.involvedTrades = val.join(',');
+    formRef.value?.validateField('involvedTrades');
+  };
+
+  const handleUploadSuccess = async (prop: string, fileList: any[]) => {
+    attachmentLists[prop] = fileList;
+    const formatted = await formatAttachmentList(fileList);
+    formValue[prop] = formatted.length > 0 ? JSON.stringify(formatted) : '';
+    // 上传后主动触发单个字段校验,消除错误提示
+    formRef.value?.validateField(prop);
+  };
+
+  const initData = async () => {
+    const id = route.query.id as string;
+    if (!id) return;
+    formValue.id = id;
+
+    try {
+      const approvals = await getAllApproval();
+      approvalOptions.value = approvals || [];
+
+      const res = await constructionSafetyQueryDetailConstruction(id);
+      if (res) {
+        Object.assign(formValue, res);
+        if (res.involvedTrades) {
+          tradeArray.value = res.involvedTrades.split(',');
+        }
+        attachmentConfigs.forEach((item) => {
+          if (res[item.prop]) {
+            attachmentLists[item.prop] = unformatAttachment(res[item.prop]);
+          }
+        });
+      }
+    } catch (error) {
+      console.error('获取详情数据失败:', error);
+    }
+  };
+
+  const handleSave = (status: number) => {
+    // status: 0 保存, 1 提交
+    formRef.value?.validate(async (valid: boolean) => {
+      if (valid) {
+        submiting.value = true;
+        constructionSafetyUpdateConstruction({ ...formValue, submitStatus: status })
+          .then(() => {
+            ElMessage.success(status === 1 ? '提交成功!' : '保存成功!');
+            router.push({ name: 'constructionSafetyManage' });
+          })
+          .catch((err) => {
+            console.error(err);
+          })
+          .finally(() => {
+            submiting.value = false;
+          });
+      } else {
+        return false;
+      }
+    });
+  };
+
+  onMounted(() => {
+    initData();
+  });
+</script>
+
+<style lang="scss" scoped>
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/page-details-layout.scss' as *;
+
+  .safety-platform-container {
+    &__main {
+      padding: 24px;
+      background-color: #fff;
+    }
+    :deep(.el-form-item) {
+      margin-right: 20px;
+      margin-bottom: 24px;
+      vertical-align: top;
+      .el-form-item__label {
+        font-weight: bold;
+      }
+    }
+    // :deep(.el-input.is-disabled .el-input__wrapper) {
+    //   background-color: #f8f9fb;
+    //   color: #606266;
+    // }
+  }
+</style>

+ 133 - 4
src/views/production-safety/risk-identification-and-control/construction-safety-manage/list.vue

@@ -40,7 +40,7 @@
         </el-form>
 
         <div>
-          <el-button type="primary" @click="$router.push({ name: 'hazardManageAdd' })">添加 </el-button>
+          <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
           <el-button type="primary" @click="queryTableList">查询</el-button>
           <el-button @click="handleRestParams">重置</el-button>
         </div>
@@ -60,6 +60,7 @@
           <el-table-column label="状态" props="statusName" width="100" />
           <el-table-column fixed="right" min-width="240" label="操作">
             <template #default="scope">
+              <el-button v-if="scope.row.status === 1" type="primary" link>提交</el-button>
               <el-button
                 type="primary"
                 link
@@ -75,7 +76,7 @@
 
               <el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button>
 
-              <el-button type="primary" link>审批</el-button>
+              <!-- <el-button type="primary" link>审批</el-button> -->
               <el-button
                 type="primary"
                 link
@@ -98,6 +99,65 @@
       </div>
     </main>
   </div>
+  <BasicDialog
+    v-if="approvalVisible"
+    v-model="approvalVisible"
+    ref="basicDialogRef"
+    title="提交审批"
+    @refresh="closeApprovalDialog"
+  >
+    <template #form>
+      <div class="form">
+        <el-form ref="approvalFormRef" :model="approvalForm">
+          <el-form-item label="审批描述:" label-position="top">
+            <el-input v-model="approvalForm.description" placeholder="请输入审批描述" type="textarea" />
+          </el-form-item>
+          <div class="form-item">
+            <span>审批流程:</span>
+            <template v-for="item in approvalNodeList" :key="item.id">
+              <el-form-item
+                :label="`第${item.approvalOrder}步:${item.nodeDescription}(${APPROVAL_TYPE_MAP[item.approvalType]})`"
+                label-position="top"
+                :prop="item.approverType !== APPROVER_TYPE.FIX ? `approvers.${item.id}` : ''"
+                :rules="{ required: true, message: '请选择审批人员', trigger: 'change' }"
+              >
+                <el-input
+                  v-if="item.approverType === APPROVER_TYPE.FIX"
+                  :model-value="item.approverInfoList.map((info) => info.approverName).join(',')"
+                  disabled
+                />
+                <el-select
+                  v-else
+                  v-model="approvalForm.approvers[item.id]"
+                  placeholder="请选择审批人员"
+                  value-key="id"
+                  filterable
+                  remote
+                  collapse-tags
+                  collapse-tags-tooltip
+                  :max-collapse-tags="2"
+                  :remote-method="remoteMethod"
+                  :loading="loading"
+                  multiple
+                >
+                  <el-option
+                    v-for="option in userOptions"
+                    :key="option.id"
+                    :label="`${option.realname}(${option.username})${option.deptName}`"
+                    :value="option.id"
+                  />
+                </el-select>
+              </el-form-item>
+            </template>
+          </div>
+        </el-form>
+      </div>
+    </template>
+    <template #footer>
+      <el-button type="primary" @click="handleSubmitApproval">提交</el-button>
+      <el-button @click="basicDialogRef?.closeDialog()">取消</el-button>
+    </template>
+  </BasicDialog>
 </template>
 <script lang="ts" setup>
   import { onMounted, reactive, ref } from 'vue';
@@ -107,16 +167,22 @@
     constructionSafetyQueryPageConstruction,
     constructionSafetyDeleteConstructionById,
   } from '@/api/production-safety/responsibility-implementation';
+  import BasicDialog from '@/components/BasicDialog.vue';
+  import { getApprovalNodeInstanceList } from '@/api/approval/approval';
+  import { submitReceiptRecordApprovalProcess } from '@/api/receiptRecord';
   import { omit } from 'lodash-es';
   import { useUserInfoHook } from '@/hooks/useUserInfoHook';
-  import { unformatAttachment } from '@/components/UploadFiles/utils';
-  import { downloadFile } from '@/views/disaster/utils';
+  import type { ApprovalNodeInstanceType } from '@/views/system/approval/types';
+
   import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
   import { getAllDepartments } from '@/api/auth/dept';
+  import { APPROVAL_TYPE_MAP, APPROVER_TYPE } from '@/views/emergency/emergency-plan/src/constant';
+  import { useEmergencySuppliesHook } from '@/views/emergency/emergency-supplies/src/hook';
 
   const router = useRouter();
   const { id } = useUserInfoHook();
   const firstLevelDepts = ref<any[]>([]);
+  const approvalVisible = ref(false);
   const cascaderProp = {
     expandTrigger: 'click',
     checkStrictly: true,
@@ -196,6 +262,69 @@
     queryTableList();
   };
 
+  const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
+  const approvalFormRef = ref();
+  const approvalForm = reactive({
+    description: '',
+    approvers: {} as Record<number, any[]>,
+  });
+
+  const approvalNodeList = ref<ApprovalNodeInstanceType[]>([]);
+
+  const { userOptions, loading, remoteMethod } = useEmergencySuppliesHook();
+
+  const getApprovalNode = async (id: number) => {
+    const res = await getApprovalNodeInstanceList(id);
+    approvalNodeList.value = res.approvalNodeInfoList || [];
+  };
+
+  const resetApprovalForm = () => {
+    approvalFormRef.value?.resetFields();
+    approvalForm.description = '';
+  };
+
+  const closeApprovalDialog = () => {
+    resetApprovalForm();
+    basicDialogRef.value?.closeDialog();
+  };
+
+  const handleSubmitApproval = () => {
+    approvalFormRef.value?.validate(async (valid: boolean) => {
+      if (!valid) return;
+      if (!receiptRecordId.value) {
+        ElMessage.error('缺少物品领取记录ID,无法提交审批');
+        return;
+      }
+
+      const approvalData: any = {
+        planId: receiptRecordId.value,
+        approvalDescription: approvalForm.description,
+        approvalInfoList: approvalNodeList.value.map((node) => {
+          let approverIdList: number[] = [];
+          if (node.approverType === APPROVER_TYPE.FIX) {
+            approverIdList = node.approverInfoList.map((info) => info.approverId);
+          } else if (approvalForm.approvers[node.id]) {
+            approverIdList = approvalForm.approvers[node.id];
+          }
+          return {
+            approvalOrder: node.approvalOrder,
+            approverIdList,
+          };
+        }),
+      };
+
+      try {
+        await submitReceiptRecordApprovalProcess(approvalData);
+        ElMessage.success('提交成功');
+        closeApprovalDialog();
+        router.back();
+      } catch (e) {
+        console.error('提交审批失败:', e);
+        ElMessage.error('提交审批失败,请重试');
+      }
+    });
+  };
+
   onMounted(async () => {
     await getDeptData();
     queryTableList();

+ 211 - 1
src/views/production-safety/risk-identification-and-control/construction-safety-manage/view.vue

@@ -1 +1,211 @@
-<template> xxx </template>
+<template>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <div class="breadcrumb-title">
+        <BreadcrumbBack />
+        查看施工安全申请
+      </div>
+    </header>
+    <main class="safety-platform-container__main">
+      <el-form ref="formRef" :inline="true" label-width="auto" :model="formValue" :disabled="true">
+        <el-form-item label="项目名称">
+          <el-input v-model="formValue.projectName" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工单位">
+          <el-input v-model="formValue.constructionUnit" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工地点">
+          <el-input v-model="formValue.constructionLocation" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="施工人数">
+          <el-input-number v-model="formValue.workerCount" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="项目负责人">
+          <el-input v-model="formValue.projectManagerName" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="负责人电话1">
+          <el-input v-model="formValue.projectManagerPhone1" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="负责人电话2">
+          <el-input v-model="formValue.projectManagerPhone2" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="现场安全员">
+          <el-input v-model="formValue.siteSafetyManagerName" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="安全员电话1">
+          <el-input v-model="formValue.siteSafetyPhone1" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="安全员电话2">
+          <el-input v-model="formValue.siteSafetyPhone2" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="开始时间">
+          <el-date-picker v-model="formValue.projectStartTime" type="date" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="结束时间">
+          <el-date-picker v-model="formValue.projectEndTime" type="date" size="large" style="width: 330px" />
+        </el-form-item>
+
+        <el-form-item label="涉及工种" style="width: 87.2%">
+          <el-checkbox-group v-model="tradeArray">
+            <el-checkbox
+              v-for="t in ['水电', '泥瓦', '木工', '焊接', '气割', '登高', '密闭', '特种驾驶', '其他']"
+              :key="t"
+              :label="t"
+            />
+          </el-checkbox-group>
+        </el-form-item>
+
+        <el-form-item v-if="tradeArray.includes('其他')" label="其他工种说明" style="width: 330px">
+          <el-input v-model="formValue.otherTrade" size="large" />
+        </el-form-item>
+
+        <el-form-item label="施工内容简述" style="width: 87.2%">
+          <el-input type="textarea" v-model="formValue.constructionContent" size="large" :rows="3" />
+        </el-form-item>
+
+        <el-form-item label="备注说明" style="width: 87.2%">
+          <el-input type="textarea" v-model="formValue.otherDescription" size="large" :rows="3" />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <div style="width: 100%; margin-bottom: 20px; font-weight: bold; padding-left: 10px">附件清单</div>
+
+        <el-form-item v-for="item in attachmentConfigs" :key="item.prop" :label="item.label" style="width: 43.6%">
+          <UploadFiles label="上传附件" :disabled="true" :fileList="attachmentLists[item.prop]" />
+        </el-form-item>
+
+        <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
+        <el-form-item label="审批流程" style="width: 87.2%">
+          <el-select v-model="formValue.templateId" size="large" style="width: 330px">
+            <el-option v-for="opt in approvalOptions" :key="opt.id" :label="opt.templateName" :value="opt.id" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </main>
+    <footer class="safety-platform-container__footer">
+      <el-button @click="router.back()">返回</el-button>
+    </footer>
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { ref, reactive, onMounted } from 'vue';
+  import { useRouter, useRoute } from 'vue-router';
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import { getAllApproval } from '@/api/approval/approval';
+  import { constructionSafetyQueryDetailConstruction } from '@/api/production-safety/responsibility-implementation';
+  import { unformatAttachment } from '@/components/UploadFiles/utils';
+
+  const router = useRouter();
+  const route = useRoute();
+  const tradeArray = ref<string[]>([]);
+  const approvalOptions = ref<any[]>([]);
+
+  const attachmentConfigs = [
+    { label: '施工安全交底', prop: 'safetyCommitmentAttachment' },
+    { label: '安全管理协议', prop: 'safetyAgreementAttachment' },
+    { label: '安全告知单', prop: 'safetyNoticeAttachment' },
+    { label: '施工方案', prop: 'constructionPlanAttachment' },
+    { label: '劳保用品清单', prop: 'ppeListAttachment' },
+    { label: '施工机械清单', prop: 'equipmentListAttachment' },
+    { label: '人员身份信息', prop: 'personnelIdAttachment' },
+    { label: '安全教育记录', prop: 'safetyEducationAttachment' },
+    { label: '环境承诺书', prop: 'environmentCommitmentAttachment' },
+    { label: '消防管理承诺', prop: 'fireManagementAttachment' },
+    { label: '特种作业证', prop: 'specialWorkerCertAttachment' },
+    { label: '特种设备合格证', prop: 'specialEquipmentCertAttachment' },
+  ];
+
+  const attachmentLists = reactive<any>(Object.fromEntries(attachmentConfigs.map((a) => [a.prop, []])));
+
+  const formValue = reactive<any>({
+    projectName: '',
+    constructionContent: '',
+    constructionLocation: '',
+    constructionUnit: '',
+    projectManagerName: '',
+    projectManagerPhone1: '',
+    projectManagerPhone2: '',
+    siteSafetyManagerName: '',
+    siteSafetyPhone1: '',
+    siteSafetyPhone2: '',
+    workerCount: undefined,
+    projectStartTime: '',
+    projectEndTime: '',
+    involvedTrades: '',
+    otherTrade: '',
+    otherDescription: '',
+    templateId: '',
+  });
+
+  const initData = async () => {
+    const id = route.query.id as string;
+    if (!id) return;
+
+    try {
+      // 1. 获取审批流选项(为了回显 label)
+      const approvals = await getAllApproval();
+      approvalOptions.value = approvals || [];
+
+      // 2. 获取详情
+      const res = await constructionSafetyQueryDetailConstruction(id);
+      if (res) {
+        // 基础数据回显
+        Object.assign(formValue, res);
+
+        // 工种回显
+        if (res.involvedTrades) {
+          tradeArray.value = res.involvedTrades.split(',');
+        }
+
+        // 附件回显还原
+        attachmentConfigs.forEach((item) => {
+          if (res[item.prop]) {
+            attachmentLists[item.prop] = unformatAttachment(res[item.prop]);
+          }
+        });
+      }
+    } catch (error) {
+      console.error('获取详情数据失败:', error);
+    }
+  };
+
+  onMounted(() => {
+    initData();
+  });
+</script>
+
+<style lang="scss" scoped>
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/page-details-layout.scss' as *;
+
+  .safety-platform-container {
+    &__main {
+      padding: 24px;
+      background-color: #fff;
+    }
+    :deep(.el-form-item) {
+      margin-right: 20px;
+      margin-bottom: 24px;
+      vertical-align: top;
+      .el-form-item__label {
+        font-weight: bold;
+      }
+    }
+    // :deep(.el-input.is-disabled .el-input__wrapper) {
+    //   background-color: #f8f9fb;
+    //   color: #606266;
+    // }
+  }
+</style>

+ 19 - 25
src/views/production-safety/safetyAssessment/evaluationSystem/evaluationSystem.vue

@@ -7,9 +7,7 @@
       <div class="search-table-container">
         <header>
           <div style="position: relative">
-            <el-button type="primary" class="search-table-container--button" @click="handleCreate">
-              添加
-            </el-button>
+            <el-button type="primary" class="search-table-container--button" @click="handleCreate"> 添加 </el-button>
           </div>
 
           <div class="act-search">
@@ -24,11 +22,7 @@
               </div>
               <div class="select-box--item">
                 <span>状态:</span>
-                <el-select
-                  v-model="tableQuery.queryParam.status"
-                  placeholder="请选择状态"
-                  clearable
-                >
+                <el-select v-model="tableQuery.queryParam.status" placeholder="请选择状态" clearable>
                   <el-option
                     v-for="item in EVALUATION_SYSTEM_STATUS_OPTIONS"
                     :key="item.value"
@@ -215,12 +209,7 @@
               clearable
               style="width: 100%"
             >
-              <el-option
-                v-for="item in userGroupOptions"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              />
+              <el-option v-for="item in userGroupOptions" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
           <el-form-item label="部门自评审核人:">
@@ -433,9 +422,10 @@
           feedbackCount: item.replyNum, // 反馈数(接口未返回,暂时设为0)
           feedbackRatio: item.replyRate, // 反馈比例(接口未返回,暂时设为0%)
           evaluationDocument: item.attachments, // 考核文档
-          plannedCompletionTime: item.planStartTime && item.planEndTime
-            ? `${item.planStartTime} 至 ${item.planEndTime}`
-            : item.planStartTime || item.planEndTime || '-', // 计划完成时间
+          plannedCompletionTime:
+            item.planStartTime && item.planEndTime
+              ? `${item.planStartTime} 至 ${item.planEndTime}`
+              : item.planStartTime || item.planEndTime || '-', // 计划完成时间
         }));
         pagination.total = res.totalRow;
       }
@@ -513,16 +503,15 @@
     issueDeptIds.value = [];
     issueDialogVisible.value = true;
     // 弹窗打开时才加载下发弹窗所需数据
-    await Promise.all([
-      getDeptTreeData(),
-      getUserGroupOptions(),
-      getDeptSelfApproveUserList(),
-    ]);
+    await Promise.all([getDeptTreeData(), getUserGroupOptions(), getDeptSelfApproveUserList()]);
   };
 
   const handleIssueDeptChange = () => {
     const nodes = issueDeptCascaderRef.value?.getCheckedNodes?.() ?? [];
-    issueForm.departmentName = nodes.map((n: { label?: string; pathLabels?: string[] }) => n.pathLabels?.join('/') || n.label || '').filter(Boolean).join(',');
+    issueForm.departmentName = nodes
+      .map((n: { label?: string; pathLabels?: string[] }) => n.pathLabels?.join('/') || n.label || '')
+      .filter(Boolean)
+      .join(',');
   };
 
   const handleIssueConfirm = async () => {
@@ -653,7 +642,9 @@
   };
 
   // 解析逗号分隔的URL字符串为文件列表
-  const parseAttachments = (attachmentsStr: string | undefined): Array<{
+  const parseAttachments = (
+    attachmentsStr: string | undefined,
+  ): Array<{
     fileUrl: string;
     fileName: string;
     fileType: string;
@@ -663,7 +654,10 @@
     }
 
     // 按逗号分割URL
-    const urls = attachmentsStr.split(',').map(url => url.trim()).filter(url => url);
+    const urls = attachmentsStr
+      .split(',')
+      .map((url) => url.trim())
+      .filter((url) => url);
 
     return urls.map((url) => {
       // 从URL中提取文件名

+ 13 - 37
src/views/production-safety/safetyAssessment/receiptRecord/components/ReceiptRecordDetail.vue

@@ -14,12 +14,7 @@
           clearable
           :disabled="isViewMode || isAuditMode"
         >
-          <el-option
-            v-for="item in inventoryList"
-            :key="item.id"
-            :label="item.stuffName"
-            :value="item.id"
-          />
+          <el-option v-for="item in inventoryList" :key="item.id" :label="item.stuffName" :value="item.id" />
         </el-select>
       </template>
       <template #department>
@@ -44,12 +39,7 @@
           :disabled="isViewMode || isAuditMode"
           @change="handleRecipientChange"
         >
-          <el-option
-            v-for="user in recipientUserList"
-            :key="user.id"
-            :label="user.realname"
-            :value="user.id"
-          />
+          <el-option v-for="user in recipientUserList" :key="user.id" :label="user.realname" :value="user.id" />
         </el-select>
       </template>
       <template #approvalTemplateId>
@@ -60,12 +50,7 @@
           clearable
           :disabled="isViewMode || isAuditMode"
         >
-          <el-option
-            v-for="item in approvalList"
-            :key="item.id"
-            :label="item.templateName"
-            :value="item.id"
-          />
+          <el-option v-for="item in approvalList" :key="item.id" :label="item.templateName" :value="item.id" />
         </el-select>
       </template>
     </BasicForm>
@@ -80,12 +65,7 @@
       {{ isCreateMode ? '提交' : '保存' }}
     </el-button>
   </footer>
-  <BasicDialog
-    v-if="!isViewMode && !isAuditMode"
-    ref="basicDialogRef"
-    title="提交审批"
-    @refresh="closeApprovalDialog"
-  >
+  <BasicDialog v-if="!isViewMode && !isAuditMode" ref="basicDialogRef" title="提交审批" @refresh="closeApprovalDialog">
     <template #form>
       <div class="form">
         <el-form ref="approvalFormRef" :model="approvalForm">
@@ -105,7 +85,7 @@
                   v-if="item.approverType === APPROVER_TYPE.FIX"
                   :model-value="item.approverInfoList.map((info) => info.approverName).join(',')"
                   disabled
-                ></el-input>
+                />
                 <el-select
                   v-else
                   v-model="approvalForm.approvers[item.id]"
@@ -147,11 +127,7 @@
   import BasicForm from '@/components/BasicForm.vue';
   import BasicDialog from '@/components/BasicDialog.vue';
   import { useFormConfigHook } from '@/hooks/useFormConfigHook';
-  import {
-    RECEIPT_RECORD_FORM_CONFIG,
-    RECEIPT_RECORD_FORM_DATA,
-    RECEIPT_RECORD_FORM_RULES,
-  } from '../configs/form';
+  import { RECEIPT_RECORD_FORM_CONFIG, RECEIPT_RECORD_FORM_DATA, RECEIPT_RECORD_FORM_RULES } from '../configs/form';
   import {
     saveClaimItemsLog,
     updateClaimItemsLog,
@@ -265,8 +241,11 @@
     }
   };
 
-  const { ruleFormData, formRules, ruleFormConfig, cloneRuleFormData, beforeRouteLeave } =
-    useFormConfigHook(RECEIPT_RECORD_FORM_CONFIG, RECEIPT_RECORD_FORM_DATA, RECEIPT_RECORD_FORM_RULES);
+  const { ruleFormData, formRules, ruleFormConfig, cloneRuleFormData, beforeRouteLeave } = useFormConfigHook(
+    RECEIPT_RECORD_FORM_CONFIG,
+    RECEIPT_RECORD_FORM_DATA,
+    RECEIPT_RECORD_FORM_RULES,
+  );
 
   // 提交审批弹窗相关
   const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
@@ -382,7 +361,7 @@
         ruleFormData.deptId = findDeptIdByName(deptTree.value, res.deptName ?? '') ?? null;
         ruleFormData.recipient = res.userName ?? '';
         ruleFormData.pimId = res.pimId;
-        
+
         // 如果部门ID存在,先获取该部门的用户列表,然后根据用户名查找用户ID
         if (ruleFormData.deptId) {
           await getRecipientUserList(ruleFormData.deptId);
@@ -426,9 +405,7 @@
       const basePayload = {
         stuffName: selectedInventory.stuffName,
         pimId: selectedInventory.id,
-        outStoreTime: ruleFormData.outboundDate
-          ? new Date(ruleFormData.outboundDate).toISOString()
-          : '',
+        outStoreTime: ruleFormData.outboundDate ? new Date(ruleFormData.outboundDate).toISOString() : '',
         claimQty: ruleFormData.outboundQuantity,
         orderNumber: ruleFormData.receiptNumber,
         deptName: ruleFormData.department,
@@ -541,4 +518,3 @@
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
 </style>
-