添加站班会、安全巡检工单、安全日志、安全周报前端页面,以及修复部分后端逻辑
This commit is contained in:
		| @ -1,6 +1,6 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { ProjectTeamForm, ProjectTeamQuery, ProjectTeamVO } from '@/api/project/projectTeam/types'; | ||||
| import { ProjectTeamForemanResp, ProjectTeamForm, ProjectTeamQuery, ProjectTeamVO } from '@/api/project/projectTeam/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询项目班组列表 | ||||
| @ -16,6 +16,17 @@ export const listProjectTeam = (query?: ProjectTeamQuery): AxiosPromise<ProjectT | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 根据项目id查询项目班组班组长信息列表 | ||||
|  * @param projectId | ||||
|  */ | ||||
| export const listProjectTeamForeman = (projectId: string | number): AxiosPromise<ProjectTeamForemanResp[]> => { | ||||
|   return request({ | ||||
|     url: '/project/projectTeam/listForeman/' + projectId, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询项目班组详细 | ||||
|  * @param id | ||||
|  | ||||
| @ -78,3 +78,30 @@ export interface ProjectTeamQuery extends PageQuery { | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
|  | ||||
| export interface ProjectTeamForemanResp { | ||||
|   /** | ||||
|    * 班组id | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组名称 | ||||
|    */ | ||||
|   teamName: string; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组长id | ||||
|    */ | ||||
|   foremanId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组长名字 | ||||
|    */ | ||||
|   foremanName: string; | ||||
| } | ||||
|  | ||||
							
								
								
									
										63
									
								
								src/api/safety/safetyInspection/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/safety/safetyInspection/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询安全巡检工单列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listSafetyInspection = (query?: SafetyInspectionQuery): AxiosPromise<SafetyInspectionVO[]> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyInspection/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询安全巡检工单详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getSafetyInspection = (id: string | number): AxiosPromise<SafetyInspectionVO> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyInspection/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增安全巡检工单 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addSafetyInspection = (data: SafetyInspectionForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyInspection', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改安全巡检工单 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateSafetyInspection = (data: SafetyInspectionForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyInspection', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除安全巡检工单 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delSafetyInspection = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyInspection/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										340
									
								
								src/api/safety/safetyInspection/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										340
									
								
								src/api/safety/safetyInspection/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,340 @@ | ||||
| export interface SafetyInspectionVO { | ||||
|   /** | ||||
|    * 主键ID | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 父id(默认为0) | ||||
|    */ | ||||
|   pid: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目ID | ||||
|    */ | ||||
|   projectId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 检查类型 | ||||
|    */ | ||||
|   checkType: string; | ||||
|  | ||||
|   /** | ||||
|    * 违章类型 | ||||
|    */ | ||||
|   violationType: string; | ||||
|  | ||||
|   /** | ||||
|    * 巡检结果 | ||||
|    */ | ||||
|   inspectionResult: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改班组id | ||||
|    */ | ||||
|   teamId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改班组名字 | ||||
|    */ | ||||
|   teamName: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改人(班组长)id | ||||
|    */ | ||||
|   correctorId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改人(班组长)名字 | ||||
|    */ | ||||
|   correctorName: string; | ||||
|  | ||||
|   /** | ||||
|    * 是否回复(1回复 2不回复) | ||||
|    */ | ||||
|   isReply: string; | ||||
|  | ||||
|   /** | ||||
|    * 回复日期 | ||||
|    */ | ||||
|   replyDate: string; | ||||
|  | ||||
|   /** | ||||
|    * 工单状态(1通知 2整改 3复查) | ||||
|    */ | ||||
|   status: string; | ||||
|  | ||||
|   /** | ||||
|    * 问题隐患 | ||||
|    */ | ||||
|   hiddenDanger: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改措施 | ||||
|    */ | ||||
|   measure: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查情况 | ||||
|    */ | ||||
|   review: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查状态(1通过 2未通过) | ||||
|    */ | ||||
|   reviewType: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查时间 | ||||
|    */ | ||||
|   checkTime: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改时间 | ||||
|    */ | ||||
|   rectificationTime: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查时间 | ||||
|    */ | ||||
|   reviewTime: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查附件 | ||||
|    */ | ||||
|   checkFile: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改附件 | ||||
|    */ | ||||
|   rectificationFile: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark: string; | ||||
|  | ||||
|   /** | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
|  | ||||
|   /** | ||||
|    * 创建人id | ||||
|    */ | ||||
|   creatorId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 创建人名字 | ||||
|    */ | ||||
|   creatorName: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyInspectionForm extends BaseEntity { | ||||
|   /** | ||||
|    * 主键ID | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 父id(默认为0) | ||||
|    */ | ||||
|   pid?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目ID | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 检查类型 | ||||
|    */ | ||||
|   checkType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 违章类型 | ||||
|    */ | ||||
|   violationType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 巡检结果 | ||||
|    */ | ||||
|   inspectionResult?: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改班组id | ||||
|    */ | ||||
|   teamId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改人(班组长)id | ||||
|    */ | ||||
|   correctorId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 是否回复(1回复 2不回复) | ||||
|    */ | ||||
|   isReply?: string; | ||||
|  | ||||
|   /** | ||||
|    * 回复日期 | ||||
|    */ | ||||
|   replyDate?: string; | ||||
|  | ||||
|   /** | ||||
|    * 工单状态(1通知 2整改 3复查) | ||||
|    */ | ||||
|   status?: string; | ||||
|  | ||||
|   /** | ||||
|    * 问题隐患 | ||||
|    */ | ||||
|   hiddenDanger?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改措施 | ||||
|    */ | ||||
|   measure?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查情况 | ||||
|    */ | ||||
|   review?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查状态(1通过 2未通过) | ||||
|    */ | ||||
|   reviewType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查时间 | ||||
|    */ | ||||
|   checkTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改时间 | ||||
|    */ | ||||
|   rectificationTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查时间 | ||||
|    */ | ||||
|   reviewTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查附件 | ||||
|    */ | ||||
|   checkFile?: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改附件 | ||||
|    */ | ||||
|   rectificationFile?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyInspectionQuery extends PageQuery { | ||||
|   /** | ||||
|    * 主键ID | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 父id(默认为0) | ||||
|    */ | ||||
|   pid?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目ID | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 检查类型 | ||||
|    */ | ||||
|   checkType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 违章类型 | ||||
|    */ | ||||
|   violationType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 巡检结果 | ||||
|    */ | ||||
|   inspectionResult?: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改班组id | ||||
|    */ | ||||
|   teamId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改人(班组长)id | ||||
|    */ | ||||
|   correctorId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 是否回复(1回复 2不回复) | ||||
|    */ | ||||
|   isReply?: string; | ||||
|  | ||||
|   /** | ||||
|    * 回复日期 | ||||
|    */ | ||||
|   replyDate?: string; | ||||
|  | ||||
|   /** | ||||
|    * 工单状态(1通知 2整改 3复查) | ||||
|    */ | ||||
|   status?: string; | ||||
|  | ||||
|   /** | ||||
|    * 问题隐患 | ||||
|    */ | ||||
|   hiddenDanger?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 整改措施 | ||||
|    */ | ||||
|   measure?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查情况 | ||||
|    */ | ||||
|   review?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查状态(1通过 2未通过) | ||||
|    */ | ||||
|   reviewType?: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查时间 | ||||
|    */ | ||||
|   checkTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 整改时间 | ||||
|    */ | ||||
|   rectificationTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 复查时间 | ||||
|    */ | ||||
|   reviewTime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
							
								
								
									
										63
									
								
								src/api/safety/safetyLog/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/safety/safetyLog/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { SafetyLogForm, SafetyLogQuery, SafetyLogVO } from '@/api/safety/safetyLog/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询安全日志列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listSafetyLog = (query?: SafetyLogQuery): AxiosPromise<SafetyLogVO[]> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyLog/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询安全日志详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getSafetyLog = (id: string | number): AxiosPromise<SafetyLogVO> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyLog/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增安全日志 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addSafetyLog = (data: SafetyLogForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyLog', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改安全日志 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateSafetyLog = (data: SafetyLogForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyLog', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除安全日志 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delSafetyLog = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyLog/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										267
									
								
								src/api/safety/safetyLog/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										267
									
								
								src/api/safety/safetyLog/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,267 @@ | ||||
| import { IdAndNameVO } from '@/api/types'; | ||||
|  | ||||
| export interface SafetyLogVO { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 发生日期 | ||||
|    */ | ||||
|   dateOfOccurrence: string; | ||||
|  | ||||
|   /** | ||||
|    * 最高气温 | ||||
|    */ | ||||
|   airTemperatureMax: number; | ||||
|  | ||||
|   /** | ||||
|    * 最低气温 | ||||
|    */ | ||||
|   airTemperatureMin: number; | ||||
|  | ||||
|   /** | ||||
|    * 气候 | ||||
|    */ | ||||
|   weather: string; | ||||
|  | ||||
|   /** | ||||
|    * 进展 | ||||
|    */ | ||||
|   progress: string; | ||||
|  | ||||
|   /** | ||||
|    * 作业内容 | ||||
|    */ | ||||
|   jobContent: string; | ||||
|  | ||||
|   /** | ||||
|    * 交底情况 | ||||
|    */ | ||||
|   discloseCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 活动情况 | ||||
|    */ | ||||
|   activityCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查情况 | ||||
|    */ | ||||
|   examineCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 实施情况 | ||||
|    */ | ||||
|   implementCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 安全检查情况 | ||||
|    */ | ||||
|   safetyInspectionCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 停工或加班情况 | ||||
|    */ | ||||
|   stoppageOrOvertime: string; | ||||
|  | ||||
|   /** | ||||
|    * 其他情况 | ||||
|    */ | ||||
|   otherCondition: string; | ||||
|  | ||||
|   /** | ||||
|    * 文件id列表 | ||||
|    */ | ||||
|   fileId: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark: string; | ||||
|  | ||||
|   /** | ||||
|    * 创建人 | ||||
|    */ | ||||
|   creator: IdAndNameVO; | ||||
|  | ||||
|   /** | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyLogForm extends BaseEntity { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 发生日期 | ||||
|    */ | ||||
|   dateOfOccurrence?: string; | ||||
|  | ||||
|   /** | ||||
|    * 最高气温 | ||||
|    */ | ||||
|   airTemperatureMax?: number; | ||||
|  | ||||
|   /** | ||||
|    * 最低气温 | ||||
|    */ | ||||
|   airTemperatureMin?: number; | ||||
|  | ||||
|   /** | ||||
|    * 气候 | ||||
|    */ | ||||
|   weather?: string; | ||||
|  | ||||
|   /** | ||||
|    * 进展 | ||||
|    */ | ||||
|   progress?: string; | ||||
|  | ||||
|   /** | ||||
|    * 作业内容 | ||||
|    */ | ||||
|   jobContent?: string; | ||||
|  | ||||
|   /** | ||||
|    * 交底情况 | ||||
|    */ | ||||
|   discloseCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 活动情况 | ||||
|    */ | ||||
|   activityCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查情况 | ||||
|    */ | ||||
|   examineCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 实施情况 | ||||
|    */ | ||||
|   implementCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 安全检查情况 | ||||
|    */ | ||||
|   safetyInspectionCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 停工或加班情况 | ||||
|    */ | ||||
|   stoppageOrOvertime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 其他情况 | ||||
|    */ | ||||
|   otherCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 文件id列表 | ||||
|    */ | ||||
|   fileId: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyLogQuery extends PageQuery { | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 发生日期 | ||||
|    */ | ||||
|   dateOfOccurrence?: string; | ||||
|  | ||||
|   /** | ||||
|    * 最高气温 | ||||
|    */ | ||||
|   airTemperatureMax?: number; | ||||
|  | ||||
|   /** | ||||
|    * 最低气温 | ||||
|    */ | ||||
|   airTemperatureMin?: number; | ||||
|  | ||||
|   /** | ||||
|    * 气候 | ||||
|    */ | ||||
|   weather?: string; | ||||
|  | ||||
|   /** | ||||
|    * 进展 | ||||
|    */ | ||||
|   progress?: string; | ||||
|  | ||||
|   /** | ||||
|    * 作业内容 | ||||
|    */ | ||||
|   jobContent?: string; | ||||
|  | ||||
|   /** | ||||
|    * 交底情况 | ||||
|    */ | ||||
|   discloseCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 活动情况 | ||||
|    */ | ||||
|   activityCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 检查情况 | ||||
|    */ | ||||
|   examineCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 实施情况 | ||||
|    */ | ||||
|   implementCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 安全检查情况 | ||||
|    */ | ||||
|   safetyInspectionCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 停工或加班情况 | ||||
|    */ | ||||
|   stoppageOrOvertime?: string; | ||||
|  | ||||
|   /** | ||||
|    * 其他情况 | ||||
|    */ | ||||
|   otherCondition?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
							
								
								
									
										63
									
								
								src/api/safety/safetyWeeklyReport/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/safety/safetyWeeklyReport/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO } from '@/api/safety/safetyWeeklyReport/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询安全周报列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listSafetyWeeklyReport = (query?: SafetyWeeklyReportQuery): AxiosPromise<SafetyWeeklyReportVO[]> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyWeeklyReport/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询安全周报详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getSafetyWeeklyReport = (id: string | number): AxiosPromise<SafetyWeeklyReportVO> => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyWeeklyReport/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增安全周报 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addSafetyWeeklyReport = (data: SafetyWeeklyReportForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyWeeklyReport', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改安全周报 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateSafetyWeeklyReport = (data: SafetyWeeklyReportForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyWeeklyReport', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除安全周报 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delSafetyWeeklyReport = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/safety/safetyWeeklyReport/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										112
									
								
								src/api/safety/safetyWeeklyReport/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								src/api/safety/safetyWeeklyReport/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,112 @@ | ||||
| import { IdAndNameVO } from '@/api/types'; | ||||
|  | ||||
| export interface SafetyWeeklyReportVO { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 周期 | ||||
|    */ | ||||
|   week: string; | ||||
|  | ||||
|   /** | ||||
|    * 周期范围 | ||||
|    */ | ||||
|   scope: string; | ||||
|  | ||||
|   /** | ||||
|    * 周期范围结束 | ||||
|    */ | ||||
|   scopeEnd: string; | ||||
|  | ||||
|   /** | ||||
|    * 文件位置 | ||||
|    */ | ||||
|   pathUrl: IdAndNameVO; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark: string; | ||||
|  | ||||
|   /** | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyWeeklyReportForm extends BaseEntity { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 周期 | ||||
|    */ | ||||
|   week?: string; | ||||
|  | ||||
|   /** | ||||
|    * 周期范围 | ||||
|    */ | ||||
|   scope?: string; | ||||
|  | ||||
|   /** | ||||
|    * 周期范围结束 | ||||
|    */ | ||||
|   scopeEnd?: string; | ||||
|  | ||||
|   /** | ||||
|    * 文件位置 | ||||
|    */ | ||||
|   path?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
| } | ||||
|  | ||||
| export interface SafetyWeeklyReportQuery extends PageQuery { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 周期 | ||||
|    */ | ||||
|   week?: string; | ||||
|  | ||||
|   /** | ||||
|    * 周期范围 | ||||
|    */ | ||||
|   scopeDate?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
							
								
								
									
										63
									
								
								src/api/safety/teamMeeting/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/safety/teamMeeting/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询站班会列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listTeamMeeting = (query?: TeamMeetingQuery): AxiosPromise<TeamMeetingVO[]> => { | ||||
|   return request({ | ||||
|     url: '/safety/teamMeeting/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询站班会详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getTeamMeeting = (id: string | number): AxiosPromise<TeamMeetingVO> => { | ||||
|   return request({ | ||||
|     url: '/safety/teamMeeting/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增站班会 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addTeamMeeting = (data: TeamMeetingForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/teamMeeting', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改站班会 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateTeamMeeting = (data: TeamMeetingForm) => { | ||||
|   return request({ | ||||
|     url: '/safety/teamMeeting', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除站班会 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delTeamMeeting = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/safety/teamMeeting/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										151
									
								
								src/api/safety/teamMeeting/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								src/api/safety/teamMeeting/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,151 @@ | ||||
| import { IdAndNameVO } from '@/api/types'; | ||||
|  | ||||
| export interface TeamMeetingVO { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组 | ||||
|    */ | ||||
|   team: IdAndNameVO; | ||||
|  | ||||
|   /** | ||||
|    * 分包公司 | ||||
|    */ | ||||
|   contractor: IdAndNameVO; | ||||
|  | ||||
|   /** | ||||
|    * 开会时间 | ||||
|    */ | ||||
|   meetingDate: string; | ||||
|  | ||||
|   /** | ||||
|    * 宣讲人 | ||||
|    */ | ||||
|   compere: IdAndNameVO; | ||||
|  | ||||
|   /** | ||||
|    * 参与人列表 | ||||
|    */ | ||||
|   participantList: Array<IdAndNameVO>; | ||||
|  | ||||
|   /** | ||||
|    * 班会内容 | ||||
|    */ | ||||
|   content: string; | ||||
|  | ||||
|   /** | ||||
|    * 班会图片Url | ||||
|    */ | ||||
|   pictureUrl: Array<IdAndNameVO>; | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark: string; | ||||
|  | ||||
|   /** | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
| } | ||||
|  | ||||
| export interface TeamMeetingForm extends BaseEntity { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组id | ||||
|    */ | ||||
|   teamId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 分包公司id | ||||
|    */ | ||||
|   contractorId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 开会时间 | ||||
|    */ | ||||
|   meetingDate?: string; | ||||
|  | ||||
|   /** | ||||
|    * 宣讲人 | ||||
|    */ | ||||
|   compereId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 参与人id列表 | ||||
|    */ | ||||
|   participantIdList?: Array<string | number>; | ||||
|  | ||||
|   /** | ||||
|    * 班会内容 | ||||
|    */ | ||||
|   content?: string; | ||||
|  | ||||
|   /** | ||||
|    * 班会图片 | ||||
|    */ | ||||
|   pictureList?: Array<string | number>; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
| } | ||||
|  | ||||
| export interface TeamMeetingQuery extends PageQuery { | ||||
|   /** | ||||
|    * 项目id | ||||
|    */ | ||||
|   projectId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 班组id | ||||
|    */ | ||||
|   teamId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 分包公司id | ||||
|    */ | ||||
|   contractorId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 开会时间 | ||||
|    */ | ||||
|   meetingDate?: string; | ||||
|  | ||||
|   /** | ||||
|    * 宣讲人 | ||||
|    */ | ||||
|   compereId?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 参与人id | ||||
|    */ | ||||
|   participantIdList?: Array<string | number>; | ||||
|  | ||||
|   /** | ||||
|    * 班会内容 | ||||
|    */ | ||||
|   content?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
| @ -68,3 +68,8 @@ export interface UserProject { | ||||
|   projectName: string; | ||||
|   shortName: string; | ||||
| } | ||||
|  | ||||
| export interface IdAndNameVO { | ||||
|   id: string | number; | ||||
|   name: string; | ||||
| } | ||||
|  | ||||
| @ -10,6 +10,7 @@ | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { propTypes } from '@/utils/propTypes'; | ||||
| import { PictureFilled } from '@element-plus/icons-vue'; | ||||
|  | ||||
| const props = defineProps({ | ||||
|   src: propTypes.string.def(''), | ||||
|  | ||||
| @ -39,8 +39,8 @@ VXETable.config({ | ||||
| }); | ||||
|  | ||||
| // 修改 el-dialog 默认点击遮照为不关闭 | ||||
| import { ElDialog } from 'element-plus'; | ||||
| ElDialog.props.closeOnClickModal.default = false; | ||||
| /*import { ElDialog } from 'element-plus'; | ||||
| ElDialog.props.closeOnClickModal.default = false;*/ | ||||
|  | ||||
| const app = createApp(App); | ||||
|  | ||||
|  | ||||
| @ -0,0 +1,140 @@ | ||||
| <template> | ||||
|   <el-card v-loading="loading"> | ||||
|     <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> | ||||
|     <el-row> | ||||
|       <el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col> | ||||
|       <el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col> | ||||
|     </el-row> | ||||
|     <el-descriptions :column="2" border style="margin-top: 8px" label-width="160px"> | ||||
|       <el-descriptions-item label-align="center" label="检查项目" :span="2">{{ currentProject?.name }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="检查类型"> | ||||
|         <dict-tag :options="safety_inspection_check_type" :value="safetyInspectionDetail?.checkType" /> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="违章类型"> | ||||
|         <dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" /> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="检查时间">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="检查人">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="整改人">{{ safetyInspectionDetail?.correctorName }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="要求整改期限">{{ safetyInspectionDetail?.rectificationTime }} </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|     <div class="table-title">巡检结果</div> | ||||
|     <el-descriptions :column="2" border label-width="160px"> | ||||
|       <el-descriptions-item label-align="center" label="内容" :span="2">{{ safetyInspectionDetail?.hiddenDanger }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="检查附件" :span="2"> | ||||
|         <el-space wrap> | ||||
|           <div v-for="item in checkFileList" :key="item.ossId"> | ||||
|             <span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)"> | ||||
|               <image-preview :src="item.url" width="200px" /> | ||||
|             </span> | ||||
|             <span v-else> | ||||
|               <el-link :href="`${item.url}`" :underline="false" target="_blank"> | ||||
|                 <span> {{ item.originalName }} </span> | ||||
|               </el-link> | ||||
|             </span> | ||||
|           </div> | ||||
|         </el-space> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="检查状态" :span="2"> | ||||
|         <el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="success"> | ||||
|           <el-step v-for="item in safety_inspection_type" :key="item.value" :title="item.label" /> | ||||
|         </el-steps> | ||||
|       </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|     <div class="table-title">整改情况</div> | ||||
|     <el-descriptions :column="2" border label-width="160px"> | ||||
|       <el-descriptions-item label-align="center" label="班组">{{ safetyInspectionDetail?.teamName }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="整改日期">{{ safetyInspectionDetail?.rectificationTime }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2"> | ||||
|         {{ safetyInspectionDetail?.measure }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="整改附件" :span="2"> | ||||
|         <el-space wrap> | ||||
|           <div v-for="item in rectificationFileList" :key="item.ossId"> | ||||
|             <span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)"> | ||||
|               <image-preview :src="item.url" width="200px" /> | ||||
|             </span> | ||||
|             <span v-else> | ||||
|               <el-link :href="`${item.url}`" :underline="false" target="_blank"> | ||||
|                 <span> {{ item.originalName }} </span> | ||||
|               </el-link> | ||||
|             </span> | ||||
|           </div> | ||||
|         </el-space> | ||||
|       </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|     <div class="table-title">复查结果</div> | ||||
|     <el-descriptions :column="2" border label-width="160px"> | ||||
|       <el-descriptions-item label-align="center" label="复查人">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="复查日期">{{ safetyInspectionDetail?.reviewTime }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="复查情况" :span="2">{{ safetyInspectionDetail?.review }} </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|   </el-card> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| import { SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; | ||||
| import { getSafetyInspection } from '@/api/safety/safetyInspection'; | ||||
| import { listByIds } from '@/api/system/oss'; | ||||
| import { OssVO } from '@/api/system/oss/types'; | ||||
|  | ||||
| interface Props { | ||||
|   safetyInspectionId?: string | number; | ||||
| } | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { safety_inspection_violation_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>( | ||||
|   proxy?.useDict('safety_inspection_violation_type', 'review_type', 'reply_type', 'safety_inspection_type', 'safety_inspection_check_type') | ||||
| ); | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const props = defineProps<Props>(); | ||||
| const loading = ref<boolean>(false); | ||||
| const safetyInspectionDetail = ref<SafetyInspectionVO>(); | ||||
| const checkFileList = ref<OssVO[]>(); | ||||
| const rectificationFileList = ref<OssVO[]>(); | ||||
| const get = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await getSafetyInspection(props.safetyInspectionId); | ||||
|   if (res.data && res.code === 200) { | ||||
|     safetyInspectionDetail.value = res.data; | ||||
|     if (res.data.checkFile) { | ||||
|       const checkFileRes = await listByIds(res.data.checkFile.split(',')); | ||||
|       checkFileList.value = checkFileRes.data; | ||||
|     } | ||||
|     if (res.data.rectificationFile) { | ||||
|       const rectificationFileRes = await listByIds(res.data.rectificationFile.split(',')); | ||||
|       rectificationFileList.value = rectificationFileRes.data; | ||||
|     } | ||||
|   } | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   get(); | ||||
| }); | ||||
|  | ||||
| watch( | ||||
|   () => props.safetyInspectionId, | ||||
|   (newId, oldId) => { | ||||
|     if (newId !== oldId) { | ||||
|       get(); | ||||
|     } | ||||
|   } | ||||
| ); | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
| .table-title { | ||||
|   display: flex; | ||||
|   justify-content: center; | ||||
|   align-items: flex-end; | ||||
|   height: 35px; | ||||
|   font-weight: bold; | ||||
|   font-size: 16px; | ||||
|   padding-bottom: 4px; | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										425
									
								
								src/views/safety/safetyInspection/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										425
									
								
								src/views/safety/safetyInspection/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,425 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="检查类型" prop="checkType"> | ||||
|               <el-select v-model="queryParams.checkType" placeholder="请选择检查类型" clearable> | ||||
|                 <el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="违章类型" prop="violationType"> | ||||
|               <el-select v-model="queryParams.violationType" placeholder="请选择违章类型" clearable> | ||||
|                 <el-option v-for="dict in safety_inspection_violation_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="是否回复" prop="isReply"> | ||||
|               <el-select v-model="queryParams.isReply" placeholder="请选择是否回复" clearable> | ||||
|                 <el-option v-for="dict in reply_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="处理状态" prop="status"> | ||||
|               <el-select v-model="queryParams.status" placeholder="请选择工单状态" clearable> | ||||
|                 <el-option v-for="dict in safety_inspection_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="复查状态" prop="reviewType"> | ||||
|               <el-select v-model="queryParams.reviewType" placeholder="请选择复查状态" clearable> | ||||
|                 <el-option v-for="dict in review_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
|  | ||||
|     <el-card shadow="never"> | ||||
|       <template #header> | ||||
|         <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyInspection:add']"> 新增 </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyInspection:remove']"> | ||||
|               批量删除 | ||||
|             </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyInspection:export']">导出 </el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
|  | ||||
|       <el-table v-loading="loading" :data="safetyInspectionList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||
|         <el-table-column label="处理状态" align="center" prop="status"> | ||||
|           <template #default="scope"> | ||||
|             <dict-tag :options="safety_inspection_type" :value="scope.row.status" /> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="检查人" align="center" prop="creator.name" /> | ||||
|         <el-table-column label="检查时间" align="center" prop="checkTime" width="180"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="检查类型" align="center" prop="checkType"> | ||||
|           <template #default="scope"> | ||||
|             <dict-tag :options="safety_inspection_check_type" :value="scope.row.checkType" /> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="违章类型" align="center" prop="violationType"> | ||||
|           <template #default="scope"> | ||||
|             <dict-tag :options="safety_inspection_violation_type" :value="scope.row.violationType" /> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="巡检结果" align="center" prop="inspectionResult" /> | ||||
|         <el-table-column label="整改人" align="center" prop="correctorName" /> | ||||
|         <el-table-column label="复查情况" align="center" prop="review" /> | ||||
|         <el-table-column label="复查状态" align="center" prop="reviewType"> | ||||
|           <template #default="scope"> | ||||
|             <dict-tag :options="review_type" :value="scope.row.reviewType" /> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="复查时间" align="center" prop="reviewTime" width="180"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ parseTime(scope.row.reviewTime, '{y}-{m}-{d}') }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="备注" align="center" prop="remark" /> | ||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|           <template #default="scope"> | ||||
|             <el-space wrap> | ||||
|               <el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyInspection:query']"> | ||||
|                 详情 | ||||
|               </el-button> | ||||
|               <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']"> | ||||
|                 修改 | ||||
|               </el-button> | ||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyInspection:remove']"> | ||||
|                 修改 | ||||
|               </el-button> | ||||
|             </el-space> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|  | ||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改安全巡检工单对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="safetyInspectionFormRef" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="检查类型" prop="checkType"> | ||||
|           <el-select v-model="form.checkType" placeholder="请选择检查类型"> | ||||
|             <el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="违章类型" prop="violationType"> | ||||
|           <el-select v-model="form.violationType" placeholder="请选择违章类型"> | ||||
|             <el-option v-for="dict in safety_inspection_violation_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="巡检结果" prop="inspectionResult"> | ||||
|           <el-input v-model="form.inspectionResult" placeholder="请输入巡检结果" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="整改班组" prop="teamId"> | ||||
|           <el-select v-model="form.teamId" placeholder="请选择整改班组"> | ||||
|             <el-option v-for="item in teamOpt" :key="item.value" :label="item.label" :value="item.value" @click="changeForeman(item.value)" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="整改人" prop="correctorId"> | ||||
|           <el-select v-model="form.correctorId" placeholder="请选择整改人" disabled> | ||||
|             <el-option v-for="item in foremanOpt" :key="item.value" :label="item.label" :value="item.value" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="是否回复" prop="isReply"> | ||||
|           <el-select v-model="form.isReply" placeholder="请选择是否回复"> | ||||
|             <el-option v-for="dict in reply_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="回复日期" prop="replyDate"> | ||||
|           <el-date-picker clearable v-model="form.replyDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择回复日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="工单状态" prop="status"> | ||||
|           <el-select v-model="form.status" placeholder="请选择工单状态"> | ||||
|             <el-option v-for="dict in safety_inspection_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="问题隐患" prop="hiddenDanger"> | ||||
|           <el-input v-model="form.hiddenDanger" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="整改措施" prop="measure"> | ||||
|           <el-input v-model="form.measure" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="复查情况" prop="review"> | ||||
|           <el-input v-model="form.review" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="复查状态" prop="reviewType"> | ||||
|           <el-select v-model="form.reviewType" placeholder="请选择复查状态"> | ||||
|             <el-option v-for="dict in review_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="检查时间" prop="checkTime"> | ||||
|           <el-date-picker clearable v-model="form.checkTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择检查时间"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="整改时间" prop="rectificationTime"> | ||||
|           <el-date-picker clearable v-model="form.rectificationTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择整改时间"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="复查时间" prop="reviewTime"> | ||||
|           <el-date-picker clearable v-model="form.reviewTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择复查时间"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="检查附件" prop="checkFile"> | ||||
|           <file-upload v-model="form.checkFile" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="整改附件" prop="rectificationFile"> | ||||
|           <image-upload v-model="form.rectificationFile" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|     <el-dialog title="巡检工单详情" v-model="showDetailDialog"> | ||||
|       <safety-inspection-detail-dialog :safety-inspection-id="currentSafetyInspectionId" /> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="SafetyInspection" lang="ts"> | ||||
| import { | ||||
|   addSafetyInspection, | ||||
|   delSafetyInspection, | ||||
|   getSafetyInspection, | ||||
|   listSafetyInspection, | ||||
|   updateSafetyInspection | ||||
| } from '@/api/safety/safetyInspection'; | ||||
| import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue'; | ||||
| import { listProjectTeamForeman } from '@/api/project/projectTeam'; | ||||
| import { ProjectTeamForemanResp } from '@/api/project/projectTeam/types'; | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { safety_inspection_violation_type, review_type, reply_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>( | ||||
|   proxy?.useDict('safety_inspection_violation_type', 'review_type', 'reply_type', 'safety_inspection_type', 'safety_inspection_check_type') | ||||
| ); | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const safetyInspectionList = ref<SafetyInspectionVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
|  | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const safetyInspectionFormRef = ref<ElFormInstance>(); | ||||
|  | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
|  | ||||
| const initFormData: SafetyInspectionForm = { | ||||
|   id: undefined, | ||||
|   pid: undefined, | ||||
|   projectId: currentProject.value.id, | ||||
|   checkType: undefined, | ||||
|   violationType: undefined, | ||||
|   inspectionResult: undefined, | ||||
|   teamId: undefined, | ||||
|   correctorId: undefined, | ||||
|   isReply: undefined, | ||||
|   replyDate: undefined, | ||||
|   status: undefined, | ||||
|   hiddenDanger: undefined, | ||||
|   measure: undefined, | ||||
|   review: undefined, | ||||
|   reviewType: undefined, | ||||
|   checkTime: undefined, | ||||
|   rectificationTime: undefined, | ||||
|   reviewTime: undefined, | ||||
|   checkFile: undefined, | ||||
|   rectificationFile: undefined, | ||||
|   remark: undefined | ||||
| }; | ||||
| const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     id: undefined, | ||||
|     pid: undefined, | ||||
|     projectId: currentProject.value.id, | ||||
|     checkType: undefined, | ||||
|     violationType: undefined, | ||||
|     inspectionResult: undefined, | ||||
|     teamId: undefined, | ||||
|     correctorId: undefined, | ||||
|     isReply: undefined, | ||||
|     replyDate: undefined, | ||||
|     status: undefined, | ||||
|     hiddenDanger: undefined, | ||||
|     measure: undefined, | ||||
|     review: undefined, | ||||
|     reviewType: undefined, | ||||
|     checkTime: undefined, | ||||
|     rectificationTime: undefined, | ||||
|     reviewTime: undefined, | ||||
|     remark: undefined, | ||||
|     params: {} | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }], | ||||
|     projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }] | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
|  | ||||
| const teamOpt = ref(); | ||||
| const foremanOpt = ref(); | ||||
| const teamList = ref<ProjectTeamForemanResp[]>(); | ||||
| /** 查询安全巡检工单列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listSafetyInspection(queryParams.value); | ||||
|   safetyInspectionList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   // 获取项目班组信息 | ||||
|   const teamRes = await listProjectTeamForeman(currentProject.value.id); | ||||
|   teamList.value = teamRes.data; | ||||
|   teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ | ||||
|     label: team.teamName, | ||||
|     value: team.id | ||||
|   })); | ||||
|   foremanOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ | ||||
|     label: team.foremanName, | ||||
|     value: team.foremanId | ||||
|   })); | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| const changeForeman = (value: string | number) => { | ||||
|   const team = teamList.value.find((team) => team.id === value); | ||||
|   form.value.correctorId = team.foremanId; | ||||
| }; | ||||
|  | ||||
| /** 展开安全巡检工单详情对话框操作 */ | ||||
| const currentSafetyInspectionId = ref<string | number>(); | ||||
| const showDetailDialog = ref<boolean>(false); | ||||
| const handleShowDialog = (row?: SafetyInspectionVO) => { | ||||
|   currentSafetyInspectionId.value = row.id; | ||||
|   showDetailDialog.value = true; | ||||
| }; | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| }; | ||||
|  | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   safetyInspectionFormRef.value?.resetFields(); | ||||
| }; | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| }; | ||||
|  | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: SafetyInspectionVO[]) => { | ||||
|   ids.value = selection.map((item) => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| }; | ||||
|  | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '添加安全巡检工单'; | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: SafetyInspectionVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   const res = await getSafetyInspection(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '修改安全巡检工单'; | ||||
| }; | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   safetyInspectionFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       if (form.value.id) { | ||||
|         await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } else { | ||||
|         await addSafetyInspection(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess('操作成功'); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: SafetyInspectionVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除安全巡检工单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); | ||||
|   await delSafetyInspection(_ids); | ||||
|   proxy?.$modal.msgSuccess('删除成功'); | ||||
|   await getList(); | ||||
| }; | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download( | ||||
|     'safety/safetyInspection/export', | ||||
|     { | ||||
|       ...queryParams.value | ||||
|     }, | ||||
|     `safetyInspection_${new Date().getTime()}.xlsx` | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
| }); | ||||
| </script> | ||||
							
								
								
									
										102
									
								
								src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,102 @@ | ||||
| <template> | ||||
|   <el-card v-loading="loading"> | ||||
|     <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全日志</h2> | ||||
|     <el-row> | ||||
|       <el-col :span="12" style="text-align: left">记录人:{{ safetyLogDetail?.creator?.name }}</el-col> | ||||
|       <el-col :span="12" style="text-align: right">记录时间:{{ safetyLogDetail?.createTime }}</el-col> | ||||
|     </el-row> | ||||
|     <el-descriptions :column="3" border style="margin-top: 8px"> | ||||
|       <el-descriptions-item label-align="center" width="160px" label="项目名称" :span="3">{{ currentProject?.name }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="发生日期">{{ safetyLogDetail?.dateOfOccurrence }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="气温"> | ||||
|         <span>最高:{{ safetyLogDetail?.airTemperatureMax }}(℃)</span> | ||||
|         <span>最低:{{ safetyLogDetail?.airTemperatureMin }}(℃)</span> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="气候"> | ||||
|         <dict-tag :value="safetyLogDetail?.weather" :options="weather_type" /> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="工程施工部位及施工进展情况" :span="3"> | ||||
|         {{ safetyLogDetail?.progress }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="当日主要危险性项目作业内容" :span="3"> | ||||
|         {{ safetyLogDetail?.jobContent }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="施工项目安全教育与安全交底情况" :span="3"> | ||||
|         {{ safetyLogDetail?.discloseCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="施工作业队伍班前施工安全活动情况" :span="3"> | ||||
|         {{ safetyLogDetail?.activityCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="现场施工安全巡视与检查情况" :span="3"> | ||||
|         {{ safetyLogDetail?.examineCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="季节施工防寒、防暑等措施实施情况" :span="3"> | ||||
|         {{ safetyLogDetail?.implementCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="监理通知有关部门安全检查情况" :span="3"> | ||||
|         {{ safetyLogDetail?.safetyInspectionCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="停工、加班情况" :span="3">{{ safetyLogDetail?.stoppageOrOvertime }} </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="其他应记录的安全与文明施工事项" :span="3"> | ||||
|         {{ safetyLogDetail?.otherCondition }} | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="附件" :span="3"> | ||||
|         <el-space direction="vertical"> | ||||
|           <el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" :underline="false" target="_blank"> | ||||
|             <span> {{ item.originalName }} </span> | ||||
|           </el-link> | ||||
|         </el-space> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label-align="center" label="备注" :span="3">{{ safetyLogDetail?.remark }} </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|   </el-card> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { SafetyLogVO } from '@/api/safety/safetyLog/types'; | ||||
| import { getSafetyLog } from '@/api/safety/safetyLog'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| import { listByIds } from '@/api/system/oss'; | ||||
| import { OssVO } from '@/api/system/oss/types'; | ||||
|  | ||||
| interface Props { | ||||
|   safetyLogId?: string | number; | ||||
| } | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { weather_type } = toRefs<any>(proxy?.useDict('weather_type')); | ||||
|  | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const props = defineProps<Props>(); | ||||
| const loading = ref<boolean>(false); | ||||
| const safetyLogDetail = ref<SafetyLogVO>(); | ||||
| const fileList = ref<Array<OssVO>>([]); | ||||
| const get = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await getSafetyLog(props.safetyLogId); | ||||
|   if (res.data && res.code === 200) { | ||||
|     safetyLogDetail.value = res.data; | ||||
|     if (res.data.fileId) { | ||||
|       const fileRes = await listByIds(res.data.fileId.split(',')); | ||||
|       fileList.value = fileRes.data; | ||||
|     } | ||||
|   } | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   get(); | ||||
| }); | ||||
|  | ||||
| watch( | ||||
|   () => props.safetyLogId, | ||||
|   (newId, oldId) => { | ||||
|     if (newId !== oldId) { | ||||
|       get(); | ||||
|     } | ||||
|   } | ||||
| ); | ||||
| </script> | ||||
							
								
								
									
										316
									
								
								src/views/safety/safetyLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										316
									
								
								src/views/safety/safetyLog/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,316 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="发生日期" prop="dateOfOccurrence"> | ||||
|               <el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
|  | ||||
|     <el-card shadow="never"> | ||||
|       <template #header> | ||||
|         <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">新增 </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyLog:remove']"> | ||||
|               批量删除 | ||||
|             </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyLog:export']">导出 </el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
|  | ||||
|       <el-table v-loading="loading" :data="safetyLogList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||
|         <el-table-column label="日志名称" align="center"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ dayjs(scope.row.dateOfOccurrence).format('YYYY 年 MM 月 DD 日') }}安全日志</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="发生日期" align="center" prop="dateOfOccurrence" width="180"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ parseTime(scope.row.dateOfOccurrence, '{y}-{m}-{d}') }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="录入时间" align="center" prop="createTime" /> | ||||
|         <el-table-column label="录入人" align="center" prop="creator.name" /> | ||||
|         <el-table-column label="备注" align="center" prop="remark" /> | ||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|           <template #default="scope"> | ||||
|             <el-space> | ||||
|               <el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyLog:query']"> | ||||
|                 详情 | ||||
|               </el-button> | ||||
|               <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyLog:edit']"> 修改 </el-button> | ||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyLog:remove']"> 删除 </el-button> | ||||
|             </el-space> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|  | ||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改安全日志对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="950px" append-to-body> | ||||
|       <el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="120px"> | ||||
|         <el-form-item label="发生日期" prop="dateOfOccurrence"> | ||||
|           <el-date-picker clearable v-model="form.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="最高气温" prop="airTemperatureMax"> | ||||
|           <el-input v-model="form.airTemperatureMax" placeholder="请输入最高气温" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="最低气温" prop="airTemperatureMin"> | ||||
|           <el-input v-model="form.airTemperatureMin" placeholder="请输入最低气温" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="气候" prop="weather"> | ||||
|           <el-select v-model="form.weather" placeholder="请选择气候"> | ||||
|             <el-option v-for="dict in weather_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="工程施工部位及施工进展情况" prop="progress"> | ||||
|           <el-input v-model="form.progress" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="当日主要危险性项目作业内容"> | ||||
|           <editor v-model="form.jobContent" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="施工项目安全教育与安全交底情况"> | ||||
|           <editor v-model="form.discloseCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="施工作业队伍班前施工安全活动情况"> | ||||
|           <editor v-model="form.activityCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="现场施工安全巡视与检查情况"> | ||||
|           <editor v-model="form.examineCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="季节施工防寒、防暑等措施实施情况"> | ||||
|           <editor v-model="form.implementCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="监理通知有关部门安全检查情况"> | ||||
|           <editor v-model="form.safetyInspectionCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="停工、加班情况"> | ||||
|           <editor v-model="form.stoppageOrOvertime" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="其他应记录的安全与文明施工事项"> | ||||
|           <editor v-model="form.otherCondition" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="附件" prop="fileId"> | ||||
|           <file-upload v-model="form.fileId" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|     <el-dialog title="安全日志详情" v-model="showDetailDialog"> | ||||
|       <safety-log-detail-dialog :safety-log-id="currentSafetyLogId" /> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="SafetyLog" lang="ts"> | ||||
| import { addSafetyLog, delSafetyLog, getSafetyLog, listSafetyLog, updateSafetyLog } from '@/api/safety/safetyLog'; | ||||
| import { SafetyLogForm, SafetyLogQuery, SafetyLogVO } from '@/api/safety/safetyLog/types'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| import dayjs from 'dayjs'; | ||||
| import SafetyLogDetailDialog from '@/views/safety/safetyLog/component/SafetyLogDetailDialog.vue'; | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { weather_type } = toRefs<any>(proxy?.useDict('weather_type')); | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const safetyLogList = ref<SafetyLogVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const safetyLogFormRef = ref<ElFormInstance>(); | ||||
|  | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
|  | ||||
| const initFormData: SafetyLogForm = { | ||||
|   id: undefined, | ||||
|   projectId: currentProject.value.id, | ||||
|   dateOfOccurrence: undefined, | ||||
|   airTemperatureMax: undefined, | ||||
|   airTemperatureMin: undefined, | ||||
|   weather: undefined, | ||||
|   progress: undefined, | ||||
|   jobContent: undefined, | ||||
|   discloseCondition: undefined, | ||||
|   activityCondition: undefined, | ||||
|   examineCondition: undefined, | ||||
|   implementCondition: undefined, | ||||
|   safetyInspectionCondition: undefined, | ||||
|   stoppageOrOvertime: undefined, | ||||
|   otherCondition: undefined, | ||||
|   fileId: undefined, | ||||
|   remark: undefined | ||||
| }; | ||||
| const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     projectId: currentProject.value.id, | ||||
|     dateOfOccurrence: undefined, | ||||
|     airTemperatureMax: undefined, | ||||
|     airTemperatureMin: undefined, | ||||
|     weather: undefined, | ||||
|     progress: undefined, | ||||
|     jobContent: undefined, | ||||
|     discloseCondition: undefined, | ||||
|     activityCondition: undefined, | ||||
|     examineCondition: undefined, | ||||
|     implementCondition: undefined, | ||||
|     safetyInspectionCondition: undefined, | ||||
|     stoppageOrOvertime: undefined, | ||||
|     otherCondition: undefined, | ||||
|     remark: undefined, | ||||
|     params: {} | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], | ||||
|     projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }] | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
|  | ||||
| /** 查询安全日志列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listSafetyLog(queryParams.value); | ||||
|   safetyLogList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| }; | ||||
|  | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   safetyLogFormRef.value?.resetFields(); | ||||
| }; | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| }; | ||||
|  | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: SafetyLogVO[]) => { | ||||
|   ids.value = selection.map((item) => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| }; | ||||
|  | ||||
| /** 展开安全日志详情对话框操作 */ | ||||
| const currentSafetyLogId = ref<string | number>(); | ||||
| const showDetailDialog = ref<boolean>(false); | ||||
| const handleShowDialog = (row?: SafetyLogVO) => { | ||||
|   currentSafetyLogId.value = row.id; | ||||
|   showDetailDialog.value = true; | ||||
| }; | ||||
|  | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '添加安全日志'; | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: SafetyLogVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   const res = await getSafetyLog(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '修改安全日志'; | ||||
| }; | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   safetyLogFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       if (form.value.id) { | ||||
|         await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } else { | ||||
|         await addSafetyLog(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess('操作成功'); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: SafetyLogVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除安全日志编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); | ||||
|   await delSafetyLog(_ids); | ||||
|   proxy?.$modal.msgSuccess('删除成功'); | ||||
|   await getList(); | ||||
| }; | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download( | ||||
|     'safety/safetyLog/export', | ||||
|     { | ||||
|       ...queryParams.value | ||||
|     }, | ||||
|     `safetyLog_${new Date().getTime()}.xlsx` | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
| }); | ||||
| </script> | ||||
							
								
								
									
										269
									
								
								src/views/safety/safetyWeeklyReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										269
									
								
								src/views/safety/safetyWeeklyReport/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,269 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="周期范围" prop="scope"> | ||||
|               <el-date-picker | ||||
|                 clearable | ||||
|                 v-model="queryParams.scopeDate" | ||||
|                 format="YYYY-MM-DD" | ||||
|                 value-format="YYYY-MM-DD" | ||||
|                 type="daterange" | ||||
|                 range-separator="至" | ||||
|                 start-placeholder="开始时间" | ||||
|                 end-placeholder="结束时间" | ||||
|               /> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
|  | ||||
|     <el-card shadow="never"> | ||||
|       <template #header> | ||||
|         <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyWeeklyReport:add']">新增 </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button | ||||
|               type="danger" | ||||
|               plain | ||||
|               icon="Delete" | ||||
|               :disabled="multiple" | ||||
|               @click="handleDelete()" | ||||
|               v-hasPermi="['safety:safetyWeeklyReport:remove']" | ||||
|             > | ||||
|               批量删除 | ||||
|             </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyWeeklyReport:export']">导出 </el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
|  | ||||
|       <el-table v-loading="loading" :data="safetyWeeklyReportList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||
|         <el-table-column label="周期" align="center" prop="week" /> | ||||
|         <el-table-column label="周期范围" align="center" prop="scope" width="260"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ parseTime(scope.row.scope, '{y}-{m}-{d}') }} 至 {{ parseTime(scope.row.scopeEnd, '{y}-{m}-{d}') }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="创建时间" align="center" prop="createTime" /> | ||||
|         <el-table-column label="备注" align="center" prop="remark" /> | ||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|           <template #default="scope"> | ||||
|             <el-space> | ||||
|               <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyWeeklyReport:edit']"> | ||||
|                 修改 | ||||
|               </el-button> | ||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyWeeklyReport:remove']"> | ||||
|                 删除 | ||||
|               </el-button> | ||||
|             </el-space> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|  | ||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改安全周报对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="safetyWeeklyReportFormRef" :model="form" :rules="rules" label-width="120px"> | ||||
|         <el-form-item label="周期" prop="week"> | ||||
|           <el-input v-model="form.week" placeholder="请输入周期" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="周期开始范围" prop="scope"> | ||||
|           <el-date-picker clearable v-model="form.scope" type="date" value-format="YYYY-MM-DD" placeholder="请选择周期范围" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="周期范围结束" prop="scopeEnd"> | ||||
|           <el-date-picker clearable v-model="form.scopeEnd" type="date" value-format="YYYY-MM-DD" placeholder="请选择周期范围结束" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="文件位置" prop="path"> | ||||
|           <file-upload v-model="form.path" :file-size="20" :limit="1" :file-type="['doc', 'docx']" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="SafetyWeeklyReport" lang="ts"> | ||||
| import { | ||||
|   addSafetyWeeklyReport, | ||||
|   delSafetyWeeklyReport, | ||||
|   getSafetyWeeklyReport, | ||||
|   listSafetyWeeklyReport, | ||||
|   updateSafetyWeeklyReport | ||||
| } from '@/api/safety/safetyWeeklyReport'; | ||||
| import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO } from '@/api/safety/safetyWeeklyReport/types'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
|  | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const safetyWeeklyReportList = ref<SafetyWeeklyReportVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
|  | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const safetyWeeklyReportFormRef = ref<ElFormInstance>(); | ||||
|  | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
|  | ||||
| const initFormData: SafetyWeeklyReportForm = { | ||||
|   id: undefined, | ||||
|   projectId: currentProject.value.id, | ||||
|   week: undefined, | ||||
|   scope: undefined, | ||||
|   scopeEnd: undefined, | ||||
|   path: undefined, | ||||
|   remark: undefined | ||||
| }; | ||||
| const data = reactive<PageData<SafetyWeeklyReportForm, SafetyWeeklyReportQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     id: undefined, | ||||
|     projectId: currentProject.value.id, | ||||
|     week: undefined, | ||||
|     scopeDate: undefined, | ||||
|     remark: undefined, | ||||
|     params: {} | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], | ||||
|     projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }] | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
|  | ||||
| /** 查询安全周报列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listSafetyWeeklyReport(queryParams.value); | ||||
|   safetyWeeklyReportList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| }; | ||||
|  | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   safetyWeeklyReportFormRef.value?.resetFields(); | ||||
| }; | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| }; | ||||
|  | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: SafetyWeeklyReportVO[]) => { | ||||
|   ids.value = selection.map((item) => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| }; | ||||
|  | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '添加安全周报'; | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: SafetyWeeklyReportVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   const res = await getSafetyWeeklyReport(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '修改安全周报'; | ||||
| }; | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       if (form.value.id) { | ||||
|         await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } else { | ||||
|         await addSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess('操作成功'); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: SafetyWeeklyReportVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除安全周报编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); | ||||
|   await delSafetyWeeklyReport(_ids); | ||||
|   proxy?.$modal.msgSuccess('删除成功'); | ||||
|   await getList(); | ||||
| }; | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download( | ||||
|     'safety/safetyWeeklyReport/export', | ||||
|     { | ||||
|       ...queryParams.value | ||||
|     }, | ||||
|     `safetyWeeklyReport_${new Date().getTime()}.xlsx` | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
| }); | ||||
| </script> | ||||
| @ -0,0 +1,57 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-descriptions v-loading="loading" :column="2"> | ||||
|       <el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compere?.name }}</el-descriptions-item> | ||||
|       <el-descriptions-item :span="2" label="参与人"> | ||||
|         <span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }},</span> | ||||
|       </el-descriptions-item> | ||||
|       <el-descriptions-item label="班组名称">{{ teamMeetingDetail?.team.name }}</el-descriptions-item> | ||||
|       <el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractor.name }}</el-descriptions-item> | ||||
|       <el-descriptions-item label="开会时间">{{ dayjs(teamMeetingDetail?.meetingDate).format('YYYY 年 MM 月 DD 日') }}</el-descriptions-item> | ||||
|       <el-descriptions-item label="上传时间">{{ teamMeetingDetail?.createTime }}</el-descriptions-item> | ||||
|       <el-descriptions-item :span="2" label="班会内容">{{ teamMeetingDetail?.content }}</el-descriptions-item> | ||||
|       <el-descriptions-item :span="2" label="班会图片"> | ||||
|         <el-space wrap> | ||||
|           <span :key="item.id" v-for="item in teamMeetingDetail?.pictureUrl"> | ||||
|             <image-preview :src="item.name" width="200px" /> | ||||
|           </span> | ||||
|         </el-space> | ||||
|       </el-descriptions-item> | ||||
|     </el-descriptions> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { getTeamMeeting } from '@/api/safety/teamMeeting'; | ||||
| import { TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | ||||
| import dayjs from 'dayjs'; | ||||
|  | ||||
| interface Props { | ||||
|   teamMeetingId?: string | number; | ||||
| } | ||||
|  | ||||
| const props = defineProps<Props>(); | ||||
| const loading = ref<boolean>(false); | ||||
| const teamMeetingDetail = ref<TeamMeetingVO>(); | ||||
| const get = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await getTeamMeeting(props.teamMeetingId); | ||||
|   if (res.data && res.code === 200) { | ||||
|     teamMeetingDetail.value = res.data; | ||||
|   } | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   get(); | ||||
| }); | ||||
|  | ||||
| watch( | ||||
|   () => props.teamMeetingId, | ||||
|   (newId, oldId) => { | ||||
|     if (newId !== oldId) { | ||||
|       get(); | ||||
|     } | ||||
|   } | ||||
| ); | ||||
| </script> | ||||
							
								
								
									
										269
									
								
								src/views/safety/teamMeeting/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										269
									
								
								src/views/safety/teamMeeting/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,269 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="开会时间" prop="meetingDate"> | ||||
|               <el-date-picker clearable v-model="queryParams.meetingDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择开会时间" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
|  | ||||
|     <el-card shadow="never"> | ||||
|       <template #header> | ||||
|         <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:teamMeeting:add']"> 新增 </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:teamMeeting:remove']"> | ||||
|               批量删除 | ||||
|             </el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:teamMeeting:export']">导出 </el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
|  | ||||
|       <el-table v-loading="loading" :data="teamMeetingList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||
|         <el-table-column label="宣讲人" align="center" prop="compere.name" /> | ||||
|         <el-table-column label="施工单位" align="center" prop="contractor.name" /> | ||||
|         <el-table-column label="班组名称" align="center" prop="team.name" /> | ||||
|         <el-table-column label="参与人数" align="center"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ scope.row.participantList.length + 1 }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="开会时间" align="center" prop="meetingDate" width="180"> | ||||
|           <template #default="scope"> | ||||
|             <span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="备注" align="center" prop="remark" /> | ||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|           <template #default="scope"> | ||||
|             <el-space> | ||||
|               <el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['safety:teamMeeting:query']"> | ||||
|                 详情 | ||||
|               </el-button> | ||||
|               <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:teamMeeting:edit']"> 修改 </el-button> | ||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:teamMeeting:remove']"> | ||||
|                 删除 | ||||
|               </el-button> | ||||
|             </el-space> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|  | ||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改站班会对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="teamMeetingFormRef" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="开会时间" prop="meetingDate"> | ||||
|           <el-date-picker clearable v-model="form.meetingDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择开会时间" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="班会内容"> | ||||
|           <editor v-model="form.content" :min-height="192" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="班会图片" prop="picture"> | ||||
|           <image-upload v-model="form.pictureList" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|     <el-drawer title="站班会详情" v-model="showDetailDrawer" :size="'40%'"> | ||||
|       <team-meeting-detail-drawer :team-meeting-id="currentTeamMeetingId" /> | ||||
|     </el-drawer> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="TeamMeeting" lang="ts"> | ||||
| import { addTeamMeeting, delTeamMeeting, getTeamMeeting, listTeamMeeting, updateTeamMeeting } from '@/api/safety/teamMeeting'; | ||||
| import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| import TeamMeetingDetailDrawer from '@/views/safety/teamMeeting/component/TeamMeetingDetailDrawer.vue'; | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
|  | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const teamMeetingList = ref<TeamMeetingVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
|  | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const teamMeetingFormRef = ref<ElFormInstance>(); | ||||
| const currentTeamMeetingId = ref<string | number>(0); | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
|  | ||||
| const initFormData: TeamMeetingForm = { | ||||
|   id: undefined, | ||||
|   projectId: currentProject.value.id, | ||||
|   teamId: undefined, | ||||
|   contractorId: undefined, | ||||
|   meetingDate: undefined, | ||||
|   compereId: undefined, | ||||
|   participantIdList: undefined, | ||||
|   content: undefined, | ||||
|   pictureList: undefined, | ||||
|   remark: undefined | ||||
| }; | ||||
| const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     projectId: currentProject.value.id, | ||||
|     teamId: undefined, | ||||
|     contractorId: undefined, | ||||
|     meetingDate: undefined, | ||||
|     compereId: undefined, | ||||
|     participantIdList: undefined, | ||||
|     content: undefined, | ||||
|     params: {} | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], | ||||
|     projectId: [{ required: true, message: '项目id不能为空', trigger: 'change' }], | ||||
|     teamId: [{ required: true, message: '班组id不能为空', trigger: 'change' }], | ||||
|     contractorId: [{ required: true, message: '分包公司id不能为空', trigger: 'change' }] | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
|  | ||||
| /** 查询站班会列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listTeamMeeting(queryParams.value); | ||||
|   teamMeetingList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| }; | ||||
|  | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   teamMeetingFormRef.value?.resetFields(); | ||||
| }; | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| }; | ||||
|  | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: TeamMeetingVO[]) => { | ||||
|   ids.value = selection.map((item) => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| }; | ||||
|  | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '添加站班会'; | ||||
| }; | ||||
|  | ||||
| /** 展开站班会详情抽屉操作 */ | ||||
| const showDetailDrawer = ref<boolean>(false); | ||||
| const handleShowDrawer = (row?: TeamMeetingVO) => { | ||||
|   currentTeamMeetingId.value = row.id; | ||||
|   showDetailDrawer.value = true; | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: TeamMeetingVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   const res = await getTeamMeeting(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '修改站班会'; | ||||
| }; | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   teamMeetingFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       if (form.value.id) { | ||||
|         await updateTeamMeeting(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } else { | ||||
|         await addTeamMeeting(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess('操作成功'); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: TeamMeetingVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除站班会编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); | ||||
|   await delTeamMeeting(_ids); | ||||
|   proxy?.$modal.msgSuccess('删除成功'); | ||||
|   await getList(); | ||||
| }; | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download( | ||||
|     'safety/teamMeeting/export', | ||||
|     { | ||||
|       ...queryParams.value | ||||
|     }, | ||||
|     `teamMeeting_${new Date().getTime()}.xlsx` | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
| }); | ||||
| </script> | ||||
		Reference in New Issue
	
	Block a user