소스 검색

fix:修复施工安全模版下载功能,以及安全责任书下发时增加查看员工详情数据

sunqijun 1 개월 전
부모
커밋
2f4f9950a1

+ 16 - 0
src/api/production-safety/responsibility-implementation/index.ts

@@ -78,6 +78,8 @@ export function safetyResponsibilityAdminQueryDetail(params) {
   });
 }
 
+
+
 /**
  * 作废指定 ID 的安全责任书(管理端)
  * @param id - 安全责任书 ID
@@ -103,6 +105,20 @@ export function safetyResponsibilityAdminQueryIssuedObject(params) {
   });
 }
 
+
+/**
+ * 分页查询分组下面的人(管理端)
+ * @param params - 查询条件,如责任书 ID、分页参数等
+ * @returns Promise<QueryPageResponse>
+ */
+export function queryUserByGroupIds(params) {
+  return http.request({
+    url: '/safetyResponsibility/admin/queryUserByGroupIds',
+    method: 'post',
+    params
+  });
+}
+
 /**
  * 导出已下发对象列表(管理端)
  * @param params - 导出条件参数

+ 187 - 18
src/views/production-safety/implement-safety-duty/components/IssueSafetyResponsibility.vue

@@ -52,22 +52,28 @@
           </el-select>
       </el-form-item>
 
-      <el-form-item label="下发分组名称" prop="userGroupId" v-else>
-        <el-select
-          multiple
-          size="large"
-          v-model="formData.userGroupId"
-          placeholder="请选择下发分组"
-          style="width: 100%"
-        >
-          <el-option
-            v-for="group in groupList"
-            :disabled="originUserGroupId.includes(group.id)"
-            :key="group.id"
-            :label="group.name"
-            :value="group.id"
-          />
-        </el-select>
+      <el-form-item label="下发分组名称" prop="userGroupId"  v-else>
+        <el-row style="width:100%" :gutter="12">
+            <el-col :span="16">
+              <el-select
+                multiple
+                size="large"
+                v-model="formData.userGroupId"
+                placeholder="请选择下发分组"
+                >
+                <el-option
+                    v-for="group in groupList"
+                    :disabled="originUserGroupId.includes(group.id)"
+                    :key="group.id"
+                    :label="group.name"
+                    :value="group.id"
+                />
+                </el-select>
+            </el-col>
+            <el-col :span="8">
+                <el-button link type="primary" @click="reviewStaffData">查看人员详情</el-button>
+            </el-col>
+        </el-row>
       </el-form-item>
 
       <el-form-item label="多人签署设置" prop="signConfig" v-if="currentDepartmentKey === 'B'">
@@ -226,6 +232,50 @@
       <el-button @click="handleClose">取消</el-button>
     </template>
   </el-dialog>
+  <el-dialog v-model="staffDialogVisible" width="70%" title="查看分组人员详情" @close="handleRestParams">
+    <div class="search-form">
+        <el-form :inline="true">
+          <el-form-item>
+            <el-input
+              v-model="tableQuery.queryParam.keyword"
+              placeholder="搜索工号/姓名/分组名称"
+              style="width: 170px"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-cascader
+                ref="cascaderRef"
+                style="width: 100%"
+                size="large"
+                v-model="tableQuery.queryParam.deptId"
+                :options="firstLevelDepts"
+                :props="deptProp"
+                :show-all-levels="false"
+                placeholder="请选择部门"
+                :clearable="false"
+                @change="handleDeptChange"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="handleSearch">查询</el-button>
+            <el-button @click="handleRestParams">重置</el-button>
+          </el-form-item>
+        </el-form>
+        
+      </div>
+
+    <h4 style="margin:10px 0" v-if="messages">{{ messages.toString() }}</h4>
+    <div class="batch-table">
+        <BasicTable
+        ref="basicTableRef"
+        :tableData="staffTableData"
+        :tableConfig="tableConfig"
+        @update:pageSize="handleSizeChange"
+        @update:pageNumber="handleCurrentChange"
+        >
+        </BasicTable>
+    </div>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
@@ -236,7 +286,19 @@
   import {
     queryAvailableUserList,
     safetyResponsibilityAdminQueryDetail,
+    queryUserByGroupIds
   } from '@/api/production-safety/responsibility-implementation';
+  import {STAFF_TABLE_COLUMNS, TABLE_OPTIONS} from "../config/table"
+  import type { QueryPageRequest } from '@/types/basic-query';
+  import useTableConfig from '@/hooks/useTableConfigHook';
+  import BasicTable from '@/components/BasicTable.vue';
+  import { getAllDepartments } from '@/api/auth/dept';
+  import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
+
+  // 表格
+  const basicTableRef = ref<InstanceType<typeof BasicTable>>();
+
+  const { tableConfig, pagination } = useTableConfig(STAFF_TABLE_COLUMNS, TABLE_OPTIONS);
 
   const props = defineProps<{
     modelValue: boolean;
@@ -248,6 +310,8 @@
 
   const emit = defineEmits(['close', 'submit', 'update:modelValue']);
   const submitLoading = ref(false);
+  const staffDialogVisible = ref(false);
+  const staffTableData = ref<any[]>([]);
   const ruleFormRef = ref<FormInstance>();
   const cascaderRef = ref<any>();
   const userList = reactive<{
@@ -271,6 +335,17 @@
     deptId: [],
   });
 
+  const tableQuery = reactive<QueryPageRequest<any>>({
+    pageNumber: pagination.pageNumber,
+    pageSize: pagination.pageSize,
+    queryParam: {
+        userGroupIds: [], // 用户分组
+        keyword: '',// 支持搜索工号,姓名,分组名称
+        deptName: undefined,// 部门
+        deptId: undefined // 部门id 
+    },
+  });
+
   const cascaderProp = {
     expandTrigger: 'click',
     checkStrictly: props.currentDepartmentKey === 'default',
@@ -281,7 +356,32 @@
       return originDeptId.value.some((path) => isEqual(path, node.pathValues));
     },
   };
-
+  const firstLevelDepts = ref<any[]>([]);
+  const deptProp = {
+    expandTrigger: 'click',
+    checkStrictly: true,
+    // emitPath: false,
+    value: 'id',
+    label: 'deptName',
+  };
+  const getDeptData = () => {
+    getAllDepartments().then((res) => {
+      firstLevelDepts.value = formatDeptTree(res);
+    });
+  };
+  const handleDeptChange = () => {
+  const nodes = cascaderRef.value?.getCheckedNodes();
+  
+  if (nodes && nodes.length > 0) {
+    // 当前选中的【唯一节点】
+    const currentDept = nodes[0];
+    tableQuery.queryParam.deptId = currentDept.value
+    // tableQuery.queryParam.deptName = currentDept.label
+    // console.log('✅ 当前选中部门完整数据:', currentDept.data); 
+    // console.log('ID:', currentDept.value);
+    // console.log('名称:', currentDept.label);
+  }
+};
   watch(
     () => [props.currentDepartmentKey, props.departmentOptions],
     ([currentDepartmentKey, departmentOptions]) => {
@@ -331,7 +431,67 @@
     // if (!query) return;
     getUserData(dataName, query);
   };
+  
+  const handleSizeChange = (value: number) => {
+    pagination.pageSize = value;
+    tableQuery.pageSize = value;
+    getTableData();
+  };
+    const handleCurrentChange = (value: number) => {
+    pagination.pageNumber = value;
+    tableQuery.pageNumber = value;
+    getTableData();
+  };
+  const messages = ref([])
+  async function getTableData() {
+    tableConfig.loading = true;
+    try {
+      tableQuery.queryParam.userGroupIds =  formData.userGroupId
+      const res = await queryUserByGroupIds(tableQuery);
+      if (res) {
+        // 映射返回数据字段到表格字段
+        messages.value = res.messages
+        staffTableData.value = res.pages.records;
+        pagination.total = res.pages.totalRow;
+      }
+    } catch (e) {
+      staffTableData.value = [];
+      pagination.total = 0;
+    } finally {
+      tableConfig.loading = false;
+    }
+  }
 
+  const handleSearch = () => {
+    pagination.pageNumber = 1;
+    tableQuery.pageNumber = 1;
+    getTableData();
+  };
+  const handleRestParams = async ()=>{
+  pagination.pageNumber = 1;
+  pagination.pageSize = 10
+  Object.assign(tableQuery, {
+    pageNumber: pagination.pageNumber,
+    pageSize: pagination.pageSize,
+    queryParam: {
+        userGroupIds: formData.userGroupId,
+        keyword: undefined,
+        deptName: undefined,
+        deptId: undefined
+    }
+  })
+  await getTableData();
+  }
+  const reviewStaffData = async ()=>{
+    console.log(formData.userGroupId, formData.userGroupId.length)
+    if(formData.userGroupId.length === 0){
+        ElMessage.error('请先选择分组')
+        return
+    }
+    staffDialogVisible.value = true
+    await getDeptData();
+    await getTableData();
+  }
   // const handleRemoveTag = (val, field, originData) => {
   //   console.log('has:', originData, val);
 
@@ -456,4 +616,13 @@
   }
 </script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.flex {
+    display: flex;
+    gap: 6px;
+}
+.align-center {
+    align-items: center;
+}
+
+</style>

+ 41 - 0
src/views/production-safety/implement-safety-duty/config/table.ts

@@ -0,0 +1,41 @@
+import type { TableColumnProps } from '@/types/basic-table';
+// 基础表格样式配置
+export const TABLE_OPTIONS = {
+  emptyText: '暂无数据',
+  loading: true,
+  maxHeight: 'calc(70vh - 150px)',
+};
+export const STAFF_TABLE_COLUMNS: TableColumnProps[] = [
+  {
+    label: '编号',
+    type: 'index',
+    align: 'center',
+    width: '80px',
+    fixed: 'left',
+  },
+  {
+    label: '员工工号',
+    prop: 'staffNo',
+    align: 'left',
+    minWidth: '200px',
+    fixed: 'left',
+  },
+  {
+    label: '员工姓名',
+    prop: 'realname',
+    align: 'center',
+    minWidth: '200px',
+  },
+  {
+    label: '所属部门',
+    prop: 'deptName',
+    align: 'center',
+    minWidth: '180px',
+  },
+  {
+    label: '分组名称',
+    prop: 'userGroupName',
+    align: 'center',
+    minWidth: '140px',
+  },
+];

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

@@ -305,7 +305,7 @@
   };
 
   const handleOpenBatchSign = () => {
-    const selectedData = selectedRows.value;
+    const selectedData = selectedRows.value as any;
     if (!selectedData.length) {
       ElMessage.warning('请选择需要批量签署的责任书');
       return;

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

@@ -31,15 +31,30 @@
         </el-form-item>
 
         <el-form-item label="施工项目负责人" prop="projectManagerName">
-          <el-input v-model="formValue.projectManagerName" size="large" placeholder="输入施工项目负责人" style="width: 330px" />
+          <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="输入施工项目负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone1"
+            size="large"
+            placeholder="输入施工项目负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工项目负责人电话2" prop="projectManagerPhone2">
-          <el-input v-model="formValue.projectManagerPhone2" size="large" placeholder="输入施工项目负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone2"
+            size="large"
+            placeholder="输入施工项目负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人" prop="siteSafetyManagerName">
@@ -52,11 +67,21 @@
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话1" prop="siteSafetyPhone1">
-          <el-input v-model="formValue.siteSafetyPhone1" size="large" placeholder="输入施工现场安全负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone1"
+            size="large"
+            placeholder="输入施工现场安全负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话2" prop="siteSafetyPhone2">
-          <el-input v-model="formValue.siteSafetyPhone2" size="large" placeholder="输入施工现场安全负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone2"
+            size="large"
+            placeholder="输入施工现场安全负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="开始时间" prop="projectStartTime">
@@ -91,6 +116,7 @@
               v-for="t in ['水电', '泥瓦', '木工', '焊接', '气割', '登高', '密闭', '特种驾驶', '其他']"
               :key="t"
               :label="t"
+              :value="t"
             />
           </el-checkbox-group>
         </el-form-item>
@@ -120,23 +146,29 @@
         </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>
+        <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"
-          label-width="240px"
+          label-width="250px"
           :prop="item.prop"
           class="label"
-          style="width: 43.6%;"
+          style="width: 43%"
         >
-          <UploadFiles
-            label="上传文件"
-            @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
-            :fileList="attachmentLists[item.prop]"
-          />
+          <el-row style="width: 100%">
+            <el-col :span="12">
+              <UploadFiles
+                label="上传文件"
+                @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
+                :fileList="attachmentLists[item.prop]"
+              />
+            </el-col>
+            <el-col :span="12">
+              <el-button type="primary" link @click="templateDownload(item)"> 模版下载 </el-button>
+            </el-col>
+          </el-row>
         </el-form-item>
 
         <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
@@ -171,6 +203,7 @@
 
   import { constructionSafetySaveConstruction } from '@/api/production-safety/responsibility-implementation';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
+  import { downloadFile } from '@/views/disaster/utils';
 
   const router = useRouter();
   const formRef = ref<any>(null);
@@ -178,26 +211,42 @@
   const tradeArray = ref<string[]>([]);
   const approvalOptions = ref<any[]>([]);
   const attachmentConfigs = [
-    { label: '施工人员身份信息(复印件,施工单位盖章)', prop: 'personnelIdAttachment' },
-    
-    { label: '施工方提供施工安全交底(施工方敲章)', prop: 'safetyCommitmentAttachment' },
-
-    { label: '施工方提供施工人员安全教育(施工人员签字并敲章)', prop: 'safetyEducationAttachment' },
-
-    { label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)', prop: 'safetyAgreementAttachment' },
-
-    { label: '施工作业环境承诺(上飞院的项目具体经办人签字)', prop: 'environmentCommitmentAttachment' },
-
-    { label: '安全告知单(部门具体经办人签字)', prop: 'safetyNoticeAttachment' },
-    
-    { label: '消防管理承诺书(部门具体经办人签字)', prop: 'fireManagementAttachment' },
-
-    { label: '施工方案(含风险识别、安全措施、应急预案等)', prop: 'constructionPlanAttachment' },
-    
-    { label: '劳保用品清单', prop: 'ppeListAttachment' },
-    { label: '施工机械清单', prop: 'equipmentListAttachment' },
-    { label: '若有特种施工人员提供特种作业证(复印件,施工单位盖章)', prop: 'specialWorkerCertAttachment' },
-    { label: '若有特种设备提供特种设备的合格证(复印件,施工单位盖章', prop: 'specialEquipmentCertAttachment' },
+    { label: '施工人员身份信息(复印件,施工单位盖章)', prop: 'personnelIdAttachment', required: true },
+
+    { label: '施工方提供施工安全交底(施工方敲章)', prop: 'safetyCommitmentAttachment', required: true },
+
+    { label: '施工方提供施工人员安全教育(施工人员签字并敲章)', prop: 'safetyEducationAttachment', required: true },
+
+    {
+      label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)',
+      prop: 'safetyAgreementAttachment',
+      required: true,
+    },
+
+    {
+      label: '施工作业环境承诺(上飞院的项目具体经办人签字)',
+      prop: 'environmentCommitmentAttachment',
+      required: true,
+    },
+
+    { label: '安全告知单(部门具体经办人签字)', prop: 'safetyNoticeAttachment', required: true },
+
+    { label: '消防管理承诺书(部门具体经办人签字)', prop: 'fireManagementAttachment', required: true },
+
+    { label: '施工方案(含风险识别、安全措施、应急预案等)', prop: 'constructionPlanAttachment', required: true },
+
+    { label: '劳保用品清单', prop: 'ppeListAttachment', required: true },
+    { label: '施工机械清单', prop: 'equipmentListAttachment', required: true },
+    {
+      label: '若有特种施工人员提供特种作业证(复印件,施工单位盖章)',
+      prop: 'specialWorkerCertAttachment',
+      required: false,
+    },
+    {
+      label: '若有特种设备提供特种设备的合格证(复印件,施工单位盖章',
+      prop: 'specialEquipmentCertAttachment',
+      required: false,
+    },
   ];
 
   const attachmentLists = reactive<any>(Object.fromEntries(attachmentConfigs.map((a) => [a.prop, []])));
@@ -242,66 +291,67 @@
     constructionLocation: [{ required: true, message: '请输入施工地点', trigger: 'blur' }],
     workerCount: [{ required: true, message: '请输入人数', trigger: 'blur' }],
     projectManagerName: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
+    otherDescription: [{ required: true, message: '请输入其他说明', trigger: 'blur' }],
     projectManagerPhone1: [
-        { required: true, message: '请输入电话', trigger: 'blur' },
-        {
-          validator: (_rule: any, value: any, callback: any) => {
-            if (!value) {
-                callback(new Error('请输入电话'));
-            } else if (!/^1[3-9]\d{9}$/.test(value)) {
-                callback(new Error('请输入有效的11位手机号'));
-            } else {
-                callback();
-            }
-          },
-          trigger: 'blur'
-        }
+      { required: true, message: '请输入电话', trigger: 'blur' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (!value) {
+            callback(new Error('请输入电话'));
+          } else if (!/^1[3-9]\d{9}$/.test(value)) {
+            callback(new Error('请输入有效的11位手机号'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'blur',
+      },
     ],
     projectManagerPhone2: [
-        { required: true, message: '请输入电话', trigger: 'blur' },
-        {
-          validator: (_rule: any, value: any, callback: any) => {
-            if (!value) {
-                callback(new Error('请输入电话'));
-            } else if (!/^1[3-9]\d{9}$/.test(value)) {
-                callback(new Error('请输入有效的11位手机号'));
-            } else {
-                callback();
-            }
-          },
-          trigger: 'blur'
-        }
+      { required: true, message: '请输入电话', trigger: 'blur' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (!value) {
+            callback(new Error('请输入电话'));
+          } else if (!/^1[3-9]\d{9}$/.test(value)) {
+            callback(new Error('请输入有效的11位手机号'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'blur',
+      },
     ],
     siteSafetyManagerName: [{ required: true, message: '请输入安全负责人', trigger: 'blur' }],
     siteSafetyPhone1: [
-        { required: true, message: '请输入电话', trigger: 'blur' },
-        {
-          validator: (_rule: any, value: any, callback: any) => {
-            if (!value) {
-                callback(new Error('请输入电话'));
-            } else if (!/^1[3-9]\d{9}$/.test(value)) {
-                callback(new Error('请输入有效的11位手机号'));
-            } else {
-                callback();
-            }
-          },
-          trigger: 'blur'
-        }
+      { required: true, message: '请输入电话', trigger: 'blur' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (!value) {
+            callback(new Error('请输入电话'));
+          } else if (!/^1[3-9]\d{9}$/.test(value)) {
+            callback(new Error('请输入有效的11位手机号'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'blur',
+      },
     ],
     siteSafetyPhone2: [
-        { required: true, message: '请输入电话', trigger: 'blur' },
-        {
-          validator: (_rule: any, value: any, callback: any) => {
-            if (!value) {
-                callback(new Error('请输入电话'));
-            } else if (!/^1[3-9]\d{9}$/.test(value)) {
-                callback(new Error('请输入有效的11位手机号'));
-            } else {
-                callback();
-            }
-          },
-          trigger: 'blur'
-        }
+      { required: true, message: '请输入电话', trigger: 'blur' },
+      {
+        validator: (_rule: any, value: any, callback: any) => {
+          if (!value) {
+            callback(new Error('请输入电话'));
+          } else if (!/^1[3-9]\d{9}$/.test(value)) {
+            callback(new Error('请输入有效的11位手机号'));
+          } else {
+            callback();
+          }
+        },
+        trigger: 'blur',
+      },
     ],
     projectStartTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
     projectEndTime: [
@@ -321,10 +371,72 @@
     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' }]]),
+      attachmentConfigs.map((a) => [
+        a.prop,
+        [{ required: a.required, message: `请上传${a.label}`, trigger: 'change' }],
+      ]),
     ),
   });
 
+  // 下载模版
+  const templateDownload = (item) => {
+    const baseUrl = './skyeye-file-upload/sfysecurity/TEMPLATE/';
+
+    switch (item.prop) {
+      case 'personnelIdAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyEducationAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyAgreementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'environmentCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyNoticeAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'fireManagementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'constructionPlanAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'ppeListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'equipmentListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialWorkerCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialEquipmentCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      // 无匹配时提示
+      default:
+        ElMessage.warning('该附件暂无模板可下载');
+    }
+  };
+
   /**
    * 统一保存逻辑
    * @param status 0-保存草稿(通常不强校验附件),1-提交申请(强制校验)
@@ -371,9 +483,9 @@
       }
     }
   }
-  .label{
-    :deep(.el-form-item__label){
-        line-height: 26px;
+  .label {
+    :deep(.el-form-item__label) {
+      line-height: 26px;
     }
   }
 </style>

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

@@ -5,9 +5,9 @@
     </header>
 
     <main class="safety-platform-container__main">
-        <div style="margin-bottom:20px">
-            <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
-        </div>
+      <div style="margin-bottom: 20px">
+        <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
+      </div>
       <div class="search-form">
         <el-form :inline="true">
           <el-form-item label="项目名称">
@@ -44,7 +44,6 @@
         </el-form>
 
         <div>
-          
           <el-button type="primary" @click="queryTableList">查询</el-button>
           <el-button @click="handleRestParams">重置</el-button>
         </div>

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

@@ -10,7 +10,6 @@
 
     <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>
@@ -142,15 +141,30 @@
         </el-form-item>
 
         <el-form-item label="施工项目负责人" prop="projectManagerName">
-          <el-input v-model="formValue.projectManagerName" size="large" placeholder="输入施工项目负责人" style="width: 330px" />
+          <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="输入施工项目负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone1"
+            size="large"
+            placeholder="输入施工项目负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工项目负责人电话2" prop="projectManagerPhone2">
-          <el-input v-model="formValue.projectManagerPhone2" size="large" placeholder="输入施工项目负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone2"
+            size="large"
+            placeholder="输入施工项目负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人" prop="siteSafetyManagerName">
@@ -163,11 +177,21 @@
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话1" prop="siteSafetyPhone1">
-          <el-input v-model="formValue.siteSafetyPhone1" size="large" placeholder="输入施工现场安全负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone1"
+            size="large"
+            placeholder="输入施工现场安全负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话2" prop="siteSafetyPhone2">
-          <el-input v-model="formValue.siteSafetyPhone2" size="large" placeholder="输入施工现场安全负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone2"
+            size="large"
+            placeholder="输入施工现场安全负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="开始时间" prop="projectStartTime">
@@ -202,6 +226,7 @@
               v-for="t in ['水电', '泥瓦', '木工', '焊接', '气割', '登高', '密闭', '特种驾驶', '其他']"
               :key="t"
               :label="t"
+              :value="t"
             />
           </el-checkbox-group>
         </el-form-item>
@@ -237,15 +262,22 @@
           v-for="item in attachmentConfigs"
           :key="item.prop"
           :label="item.label"
-          label-width="240px"
+          label-width="250px"
           :prop="item.prop"
-          style="width: 43.6%"
+          style="width: 43%"
         >
-          <UploadFiles
-            label="上传文件"
-            @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
-            :fileList="attachmentLists[item.prop]"
-          />
+          <el-row style="width: 100%">
+            <el-col :span="12">
+              <UploadFiles
+                label="上传文件"
+                @upload-success="(fileList) => handleUploadSuccess(item.prop, fileList)"
+                :fileList="attachmentLists[item.prop]"
+              />
+            </el-col>
+            <el-col :span="12">
+              <el-button type="primary" link @click="templateDownload(item)"> 模版下载 </el-button>
+            </el-col>
+          </el-row>
         </el-form-item>
 
         <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
@@ -281,6 +313,7 @@
     constructionSafetyUpdateConstruction,
   } from '@/api/production-safety/responsibility-implementation';
   import { unformatAttachment, formatAttachmentList } from '@/components/UploadFiles/utils';
+  import { downloadFile } from '@/views/disaster/utils';
 
   const router = useRouter();
   const route = useRoute();
@@ -295,26 +328,42 @@
     return formValue.status === 1 && formValue.rejectReason !== '';
   });
   const attachmentConfigs = [
-    { label: '施工人员身份信息(复印件,施工单位盖章)', prop: 'personnelIdAttachment' },
-    
-    { label: '施工方提供施工安全交底(施工方敲章)', prop: 'safetyCommitmentAttachment' },
-
-    { label: '施工方提供施工人员安全教育(施工人员签字并敲章)', prop: 'safetyEducationAttachment' },
-
-    { label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)', prop: 'safetyAgreementAttachment' },
-
-    { label: '施工作业环境承诺(上飞院的项目具体经办人签字)', prop: 'environmentCommitmentAttachment' },
-
-    { label: '安全告知单(部门具体经办人签字)', prop: 'safetyNoticeAttachment' },
-    
-    { label: '消防管理承诺书(部门具体经办人签字)', prop: 'fireManagementAttachment' },
-
-    { label: '施工方案(含风险识别、安全措施、应急预案等)', prop: 'constructionPlanAttachment' },
-    
-    { label: '劳保用品清单', prop: 'ppeListAttachment' },
-    { label: '施工机械清单', prop: 'equipmentListAttachment' },
-    { label: '若有特种施工人员提供特种作业证(复印件,施工单位盖章)', prop: 'specialWorkerCertAttachment' },
-    { label: '若有特种设备提供特种设备的合格证(复印件,施工单位盖章', prop: 'specialEquipmentCertAttachment' },
+    { label: '施工人员身份信息(复印件,施工单位盖章)', prop: 'personnelIdAttachment', required: true },
+
+    { label: '施工方提供施工安全交底(施工方敲章)', prop: 'safetyCommitmentAttachment', required: true },
+
+    { label: '施工方提供施工人员安全教育(施工人员签字并敲章)', prop: 'safetyEducationAttachment', required: true },
+
+    {
+      label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)',
+      prop: 'safetyAgreementAttachment',
+      required: true,
+    },
+
+    {
+      label: '施工作业环境承诺(上飞院的项目具体经办人签字)',
+      prop: 'environmentCommitmentAttachment',
+      required: true,
+    },
+
+    { label: '安全告知单(部门具体经办人签字)', prop: 'safetyNoticeAttachment', required: true },
+
+    { label: '消防管理承诺书(部门具体经办人签字)', prop: 'fireManagementAttachment', required: true },
+
+    { label: '施工方案(含风险识别、安全措施、应急预案等)', prop: 'constructionPlanAttachment', required: true },
+
+    { label: '劳保用品清单', prop: 'ppeListAttachment', required: true },
+    { label: '施工机械清单', prop: 'equipmentListAttachment', required: true },
+    {
+      label: '若有特种施工人员提供特种作业证(复印件,施工单位盖章)',
+      prop: 'specialWorkerCertAttachment',
+      required: false,
+    },
+    {
+      label: '若有特种设备提供特种设备的合格证(复印件,施工单位盖章',
+      prop: 'specialEquipmentCertAttachment',
+      required: false,
+    },
   ];
 
   const attachmentLists = reactive<any>(Object.fromEntries(attachmentConfigs.map((a) => [a.prop, []])));
@@ -348,6 +397,7 @@
     constructionUnit: [{ required: true, message: '请输入施工单位', trigger: 'blur' }],
     constructionLocation: [{ required: true, message: '请输入施工地点', trigger: 'blur' }],
     workerCount: [{ required: true, message: '请输入施工人数', trigger: 'blur' }],
+    otherDescription: [{ required: true, message: '请输入其他说明', trigger: 'blur' }],
     projectManagerName: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
     projectManagerPhone1: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
     siteSafetyManagerName: [{ required: true, message: '请输入现场安全员', trigger: 'blur' }],
@@ -372,7 +422,10 @@
     templateId: [{ required: true, message: '请选择审批流程', trigger: 'change' }],
     // 自动为所有附件添加必填验证
     ...Object.fromEntries(
-      attachmentConfigs.map((a) => [a.prop, [{ required: true, message: `请上传${a.label}`, trigger: 'change' }]]),
+      attachmentConfigs.map((a) => [
+        a.prop,
+        [{ required: a.required, message: `请上传${a.label}`, trigger: 'change' }],
+      ]),
     ),
   });
 
@@ -414,7 +467,64 @@
       console.error('获取详情数据失败:', error);
     }
   };
-
+  // 下载模版
+  const templateDownload = (item) => {
+    const baseUrl = './skyeye-file-upload/sfysecurity/TEMPLATE/';
+
+    switch (item.prop) {
+      case 'personnelIdAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyEducationAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyAgreementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'environmentCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyNoticeAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'fireManagementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'constructionPlanAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'ppeListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'equipmentListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialWorkerCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialEquipmentCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      // 无匹配时提示
+      default:
+        ElMessage.warning('该附件暂无模板可下载');
+    }
+  };
   const handleSave = (status: number) => {
     // status: 0 保存, 1 提交
     formRef.value?.validate(async (valid: boolean) => {

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

@@ -4,12 +4,12 @@
       <div class="breadcrumb-title"> 施工作业安全管理 </div>
     </header>
     <main class="safety-platform-container__main">
-        <div style="margin-bottom:20px">
-            <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
-            <!-- <el-button plain class="search-table-container--button" @click="handleImport">
+      <div style="margin-bottom: 20px">
+        <el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
+        <!-- <el-button plain class="search-table-container--button" @click="handleImport">
               导入
             </el-button> -->
-        </div>
+      </div>
       <div class="search-form">
         <el-form :inline="true">
           <el-form-item label="项目名称">
@@ -48,9 +48,7 @@
         <div>
           <el-button type="primary" @click="queryTableList">查询</el-button>
           <el-button @click="handleRestParams">重置</el-button>
-          <el-button plain  @click="handleDownload">
-            导出
-          </el-button>
+          <el-button plain @click="handleDownload"> 导出 </el-button>
         </div>
       </div>
 

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

@@ -11,7 +11,13 @@
     <main class="safety-platform-container__main">
       <el-form ref="formRef" :inline="true" label-width="auto" :model="formValue">
         <el-form-item label="项目名称" prop="projectName">
-          <el-input v-model="formValue.projectName" size="large" :disabled="true" placeholder="请输入项目名称" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectName"
+            size="large"
+            :disabled="true"
+            placeholder="请输入项目名称"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工地点(区域)" prop="constructionLocation">
@@ -35,15 +41,33 @@
         </el-form-item>
 
         <el-form-item label="施工项目负责人" prop="projectManagerName">
-          <el-input v-model="formValue.projectManagerName" :disabled="true" size="large" placeholder="输入施工项目负责人" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerName"
+            :disabled="true"
+            size="large"
+            placeholder="输入施工项目负责人"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工项目负责人电话1" prop="projectManagerPhone1">
-          <el-input v-model="formValue.projectManagerPhone1" :disabled="true" size="large" placeholder="输入施工项目负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone1"
+            :disabled="true"
+            size="large"
+            placeholder="输入施工项目负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工项目负责人电话2" prop="projectManagerPhone2">
-          <el-input v-model="formValue.projectManagerPhone2" :disabled="true" size="large" placeholder="输入施工项目负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.projectManagerPhone2"
+            :disabled="true"
+            size="large"
+            placeholder="输入施工项目负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人" prop="siteSafetyManagerName">
@@ -57,11 +81,23 @@
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话1" prop="siteSafetyPhone1">
-          <el-input v-model="formValue.siteSafetyPhone1" :disabled="true" size="large" placeholder="输入施工现场安全负责人电话1" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone1"
+            :disabled="true"
+            size="large"
+            placeholder="输入施工现场安全负责人电话1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="施工现场安全负责人电话2" prop="siteSafetyPhone2">
-          <el-input v-model="formValue.siteSafetyPhone2" size="large" :disabled="true" placeholder="输入施工现场安全负责人电话2" style="width: 330px" />
+          <el-input
+            v-model="formValue.siteSafetyPhone2"
+            size="large"
+            :disabled="true"
+            placeholder="输入施工现场安全负责人电话2"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="开始时间" prop="projectStartTime">
@@ -89,7 +125,13 @@
         </el-form-item>
 
         <el-form-item label="施工人数" prop="workerCount">
-          <el-input-number v-model="formValue.workerCount" :disabled="true" size="large" :min="1" style="width: 330px" />
+          <el-input-number
+            v-model="formValue.workerCount"
+            :disabled="true"
+            size="large"
+            :min="1"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="所涉工种" prop="involvedTrades" style="width: 87.2%">
@@ -104,7 +146,13 @@
         </el-form-item>
 
         <el-form-item v-if="tradeArray.includes('其他')" label="其他工种说明" prop="otherTrade">
-          <el-input v-model="formValue.otherTrade" size="large" :disabled="true" placeholder="请补充工种类型" style="width: 330px" />
+          <el-input
+            v-model="formValue.otherTrade"
+            size="large"
+            :disabled="true"
+            placeholder="请补充工种类型"
+            style="width: 330px"
+          />
         </el-form-item>
 
         <el-form-item label="工程施工内容(方案)简要描述" prop="constructionContent" style="width: 81%">
@@ -139,27 +187,27 @@
           label-width="240px"
           :prop="item.prop"
           class="label"
-          style="width: 43.6%;"
+          style="width: 43.6%"
         >
-            <!-- 详情页面只展示,不需要上传 -->
+          <!-- 详情页面只展示,不需要上传 -->
           <!-- <UploadFiles
             label="上传文件"
             :disabled="true"
             :fileList="attachmentLists[item.prop]"
           /> -->
-           <div class="file-list" v-if="attachmentLists[item.prop]?.length">
-                <div class="file-item" v-for="li in attachmentLists[item.prop]" :key="li.fileId">
-                <span class="file-item--name">{{ li.fileName }}</span>
-                <div class="file-item--footer">
-                    <el-button link type="primary" @click="previewOnline(li.fileUrl, li.fileType)"
-                    >预览</el-button
-                    >
-                    <el-button link type="primary" @click.stop="downloadFile(li.fileUrl, li.fileName)"
-                    >下载</el-button
-                    >
-                </div>
-                </div>
+          <div class="file-list" v-if="attachmentLists[item.prop]?.length">
+            <div class="file-item" v-for="li in attachmentLists[item.prop]" :key="li.fileId">
+              <span class="file-item--name">{{ li.fileName }}</span>
+              <div class="file-item--footer">
+                <el-button link type="primary" @click="previewOnline(li.fileUrl, li.fileType)">预览</el-button>
+                <el-button link type="primary" @click.stop="downloadFile(li.fileUrl, li.fileName)">下载</el-button>
+                <el-button type="primary" link @click="templateDownload(item)"> 模版下载 </el-button>
+              </div>
             </div>
+          </div>
+          <div v-else>
+            <el-button type="primary" link @click="templateDownload(item)"> 模版下载 </el-button>
+          </div>
         </el-form-item>
 
         <div style="width: 100%; height: 1px; background: #eee; margin: 20px 0"></div>
@@ -180,6 +228,7 @@
 <script lang="ts" setup>
   import { ref, reactive, onMounted, computed } from 'vue';
   import { useRouter, useRoute } from 'vue-router';
+  import { ElMessage } from 'element-plus';
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import { getAllApproval } from '@/api/approval/approval';
   import { constructionSafetyQueryDetailConstruction } from '@/api/production-safety/responsibility-implementation';
@@ -193,21 +242,24 @@
 
   const attachmentConfigs = [
     { label: '施工人员身份信息(复印件,施工单位盖章)', prop: 'personnelIdAttachment' },
-    
+
     { label: '施工方提供施工安全交底(施工方敲章)', prop: 'safetyCommitmentAttachment' },
 
     { label: '施工方提供施工人员安全教育(施工人员签字并敲章)', prop: 'safetyEducationAttachment' },
 
-    { label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)', prop: 'safetyAgreementAttachment' },
+    {
+      label: '安全管理协议(双方签字两份,上飞院部门领导签甲方代表、乙方盖章并签字)',
+      prop: 'safetyAgreementAttachment',
+    },
 
     { label: '施工作业环境承诺(上飞院的项目具体经办人签字)', prop: 'environmentCommitmentAttachment' },
 
     { label: '安全告知单(部门具体经办人签字)', prop: 'safetyNoticeAttachment' },
-    
+
     { label: '消防管理承诺书(部门具体经办人签字)', prop: 'fireManagementAttachment' },
 
     { label: '施工方案(含风险识别、安全措施、应急预案等)', prop: 'constructionPlanAttachment' },
-    
+
     { label: '劳保用品清单', prop: 'ppeListAttachment' },
     { label: '施工机械清单', prop: 'equipmentListAttachment' },
     { label: '若有特种施工人员提供特种作业证(复印件,施工单位盖章)', prop: 'specialWorkerCertAttachment' },
@@ -279,6 +331,64 @@
       console.error('获取详情数据失败:', error);
     }
   };
+  // 下载模版
+  const templateDownload = (item) => {
+    const baseUrl = './skyeye-file-upload/sfysecurity/TEMPLATE/';
+
+    switch (item.prop) {
+      case 'personnelIdAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyEducationAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyAgreementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'environmentCommitmentAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'safetyNoticeAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'fireManagementAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'constructionPlanAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'ppeListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'equipmentListAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialWorkerCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      case 'specialEquipmentCertAttachment':
+        downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', item.label);
+        break;
+
+      // 无匹配时提示
+      default:
+        ElMessage.warning('该附件暂无模板可下载');
+    }
+  };
 
   onMounted(() => {
     initData();
@@ -307,16 +417,16 @@
     //   color: #606266;
     // }
   }
-  .label{
-    :deep(.el-form-item__label){
-        line-height: 26px;
+  .label {
+    :deep(.el-form-item__label) {
+      line-height: 26px;
     }
   }
-  .file-list{
-    .file-item--name{
-        padding:6px 14px;
-        border:1px solid #efefef;
-        border-radius: 8px;
+  .file-list {
+    .file-item--name {
+      padding: 6px 14px;
+      border: 1px solid #efefef;
+      border-radius: 8px;
     }
   }
 </style>