Quellcode durchsuchen

feat:新增安全生产复制功能

sunqijun vor 4 Wochen
Ursprung
Commit
364331ada5

+ 12 - 3
src/api/safety-system-construction-work-plan/index.ts

@@ -2,7 +2,7 @@
  * @Author: liuJie
  * @Date: 2026-02-06 16:29:04
  * @LastEditors: liuJie
- * @LastEditTime: 2026-03-07 22:19:23
+ * @LastEditTime: 2026-04-08 10:27:40
  * @Describe: 安全体系建设工作计划管理(管理员)
  */
 import { http } from '@/utils/http/axios';
@@ -64,11 +64,11 @@ export interface SaveWorkPlanRequest {
   workContent: string;
   categoryName: string;
   trainingPlanName: string;
-  responsibleDeptIds: string | number[] | string[];
+  responsibleDeptIds: any;
   cooperateDeptIds: string | number[] | string[];
   executGroupIds: string | number[] | string[];
   plannedComplateTime: string;
-  fileUrl: string;
+  fileUrl: string | any;
   /** 其他业务字段按需扩展 */
   [key: string]: unknown;
 }
@@ -219,6 +219,15 @@ export function newCancelWorkPlan(id: number) {
   });
 }
 
+// 安全体系计划复制
+export function copyWorkPlan(data) {
+  return http.request<number | void>({
+    url: '/safetyWorkPlan/workPlan/copy',
+    method: 'post',
+    data
+  });
+}
+
 /**
  * @description: 查看发送对象列表
  */

+ 1 - 1
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/tables.ts

@@ -9,7 +9,7 @@ export const TABLE_OPTIONS = {
   maxHeight: 'calc(70vh - 150px)',
 };
 
-// 表格样式与检查单模版管理列表一致(TABLE_OPTIONS、编号/操作列宽)
+// 表格样式与检查单模版管理列表一致(TABLE_OPTIONS、编号/操作列宽)(2026.03.24内部bug清单上,按照甲方要求修改展示字段)
 export const AREA_CHECK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '编号',

+ 44 - 10
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/components/safetySystemConstructionWorkPlanManagementDetail.vue

@@ -19,18 +19,29 @@
       </el-form-item>
 
       <el-form-item label="责任部门:" prop="responsibleDeptIds" required>
-        <el-cascader
+        <!-- 新需求,增加全选功能 -->
+        <el-select
           v-model="form.responsibleDeptIds"
-          :options="deptTreeOne"
-          :props="cascaderProp"
-          clearable
+          multiple
+          :disabled="isViewMode"
           collapse-tags
-          :show-all-levels="false"
+          collapse-tags-tooltip
           :max-collapse-tags="3"
           placeholder="请选择责任部门"
-          style="width: 100%"
-          :disabled="isViewMode"
-        />
+          filterable
+        >
+          <template #header>
+            <el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAllChange">
+              全部单位
+            </el-checkbox>
+          </template>
+          <el-option
+            v-for="item in deptTreeOne"
+            :key="item.id"
+            :label="item.deptName"
+            :value="item.id"
+          />
+        </el-select>
       </el-form-item>
 
       <el-form-item label="配合部门:" prop="cooperateDeptIds" required>
@@ -88,6 +99,7 @@
         </div>
       </el-form-item>
     </el-form>
+    <PreviewOnline ref="previewOnlineRef" />
   </main>
   <footer class="safety-platform-container__footer">
     <el-button @click="router.back()">返回</el-button>
@@ -115,6 +127,8 @@
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
   import { DeptTree } from '@/types/dept/type';
   import { getAllDepartments } from '@/api/auth/dept';
+  import { downloadFile } from '@/views/disaster/utils';
+
   const router = useRouter();
   const route = useRoute();
 
@@ -164,8 +178,22 @@
         ...item,
         children: []
       }));
+    //编辑、查看时当一级部门个数和所选长度一致,则是全选
+    if (isEditMode.value || isViewMode.value) {
+        if(deptTreeOne.value.length === form.responsibleDeptIds.length){
+            checkAll.value = true
+        }
+    }
+  };
+  const checkAll = ref(false);
+  const indeterminate = ref(false);
+  const handleCheckAllChange = () => {
+    if (checkAll.value && deptTreeOne.value) {
+      form.responsibleDeptIds = deptTreeOne.value.map((item) => item.id);
+    } else {
+      form.responsibleDeptIds = [];
+    }
   };
-
   /** 附件 JSON [{file_name, url}] 转 FileItem 列表,供 UploadFiles 使用(新增/编辑/查看/审核统一展示) */
   function convertAttachmentJsonToFileItems(attachmentStr: string): FileItem[] {
     if (!attachmentStr || !String(attachmentStr).trim()) return [];
@@ -225,6 +253,12 @@
       previewOnlineRef.value?.open(url, fileType);
     }
   };
+  
+  const previewOnline = (url: string | undefined, type) => {
+    if (url) {
+      previewOnlineRef.value?.open(url, type);
+    }
+  };
   //  时间格式化
   const formatDate = (date) => {
     if (!date) return '';
@@ -280,7 +314,7 @@
       }
       // cloneRuleFormData();
     } catch (e) {
-      console.error('获取物品库存详情失败:', e);
+      console.error('获取详情失败:', e);
       ElMessage.error('获取详情失败');
     }
   };

+ 9 - 5
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/configs/tables.ts

@@ -2,7 +2,7 @@
  * @Author: liuJie
  * @Date: 2026-01-28 11:03:32
  * @LastEditors: liuJie
- * @LastEditTime: 2026-03-31 11:02:13
+ * @LastEditTime: 2026-04-07 16:11:47
  * @Describe: file describe
  */
 import type { TableColumnProps } from '@/types/basic-table';
@@ -77,12 +77,14 @@ export const WORK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
     prop: 'responsibleDeptNames',
     align: 'left',
     minWidth: '200px',
+    showOverflowTooltip: true,
   },
   {
     label: '配合部门',
     prop: 'cooperateDeptNames',
     align: 'left',
     minWidth: '200px',
+    showOverflowTooltip: true,
   },
   {
     label: '下发数',
@@ -143,7 +145,7 @@ export const VIEW_SENDS_TABLE_COLUMNS: TableColumnProps[] = [
     label: '分类名称',
     prop: 'categoryName',
     align: 'left',
-    minWidth: '120px',
+    minWidth: '140px',
   },
   {
     label: '培训计划名称',
@@ -156,19 +158,21 @@ export const VIEW_SENDS_TABLE_COLUMNS: TableColumnProps[] = [
     label: '责任部门',
     prop: 'responsibleDeptNames',
     align: 'left',
-    minWidth: '120px',
+    minWidth: '160px',
+    showOverflowTooltip: true,
   },
   {
     label: '配合部门',
     prop: 'cooperateDeptNames',
     align: 'left',
-    minWidth: '120px',
+    minWidth: '160px',
+    showOverflowTooltip: true,
   },
   {
     label: '下发分组名称',
     prop: 'executGroupNames',
     align: 'left',
-    minWidth: '130px',
+    minWidth: '160px',
   },
   {
     label: '下发责任人',

+ 57 - 16
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/safetySystemConstructionWorkPlanManagement.vue

@@ -78,10 +78,20 @@
             @update:pageSize="handleSizeChange"
             @update:pageNumber="handleCurrentChange"
           >
-          
+            <template #feedbackCount="scope">
+              {{ (scope.row.feedbackCount === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackCount }}
+            </template>
+            <template #issuedCount="scope">
+              {{ (scope.row.issuedCount === 0 && scope.row.status === 1) ? '-' : scope.row.issuedCount }}
+            </template>
+            <template #feedbackRatio="scope">
+              {{ (scope.row.feedbackRatio === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackRatio+'%' }}
+            </template>
+            <template #plannedEndTime="scope">
+                {{ scope.row.status === 1 ? '-' : scope.row.plannedEndTime }}
+            </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-
                 <!-- 1-未下发、2-待反馈、3-已完成 4- 已作废 -->
                 <!-- 未下发(1):编辑、删除、下发 -->
                 <template v-if="Number(scope.row.status) === 1">
@@ -108,7 +118,6 @@
                     @confirm="handleViewInvalid(scope.row.id)"
                   />
                 </template>
-
                 <!-- 已完成(3)/已作废(4)-->
                 <template v-else>
                   <ActionButton
@@ -118,25 +127,43 @@
                     }"
                     @confirm="handleDelete(scope.row.id)"
                   />
-                  <ActionButton text="发送查看对象" @click="handleViewRecipients(scope.row.id)" />
+                  <ActionButton text="查看发送对象" @click="handleViewRecipients(scope.row.id)" />
                 </template>
+                <ActionButton text="复制" v-if="Number(scope.row.status) !== 4" @click="handleCopyData(scope.row.id)" />
               </div>
             </template>
-            <template #feedbackCount="scope">
-              {{ (scope.row.feedbackCount === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackCount }}
-            </template>
-            <template #issuedCount="scope">
-              {{ (scope.row.issuedCount === 0 && scope.row.status === 1) ? '-' : scope.row.issuedCount }}
-            </template>
-            <template #feedbackRatio="scope">
-              {{ (scope.row.feedbackRatio === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackRatio+'%' }}
-            </template>
-            <template #plannedEndTime="scope">
-                {{ scope.row.status === 1 ? '-' : scope.row.plannedEndTime }}
-            </template>
+            
           </BasicTable>
         </div>
       </div>
+      <!-- 生产安全计划时间设置(复制) -->
+       <el-dialog
+        v-model="copyDialogVisible"
+        title="生产安全计划时间设置"
+        width="500"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+      >
+        <div>
+          <el-form ref="formRef" :model="issueWorkPlanForm" :rules="issueWorkPlanFormRules" label-width="150px">
+            <el-form-item label="计划结束时间:" prop="plannedEndTime" required>
+              <el-date-picker
+                v-model="issueWorkPlanForm.plannedEndTime"
+                type="date"
+                placeholder="请选择完成时间"
+                style="width: 100%"
+              />
+            </el-form-item>
+          </el-form>
+        </div>
+        <template #footer>
+          <div class="dialog-footer">
+            <el-button @click="copyDialogVisible = false">取消</el-button>
+            <el-button type="primary" @click="handleConfirmCopy"> 保存 </el-button>
+          </div>
+        </template>
+      </el-dialog>
+      <!-- 生产安全计划下发 -->
       <el-dialog
         v-model="issueWorkPlanDialogVisible"
         title="生产安全计划下发"
@@ -219,6 +246,7 @@
     issueWorkPlan,
     deleteWorkPlan,
     exportTableData,
+    copyWorkPlan,
     type IssueWorkPlanParams,
   } from '@/api/safety-system-construction-work-plan';
 
@@ -477,6 +505,19 @@
       },
     });
   };
+  // 复制
+  const copyDialogVisible = ref(false)
+  const copyParams = reactive({
+
+  })
+  const handleCopyData = (id:number)=>{
+    copyDialogVisible.value = true
+  }
+  // 保存复制
+  const handleConfirmCopy = async ()=>{
+    const data = {}
+    await copyWorkPlan(data)
+  }
     // 批量导入
   const batchImportVisible = ref(false);
   const { urlPrefix } = useGlobSetting();