优化
This commit is contained in:
		| @ -1,3 +1,4 @@ | |||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { Ys7DeviceImgVO, Ys7DeviceImgForm, Ys7DeviceImgQuery } from '@/api/other/ys7DeviceImg/types'; | import { Ys7DeviceImgVO, Ys7DeviceImgForm, Ys7DeviceImgQuery } from '@/api/other/ys7DeviceImg/types'; | ||||||
| @ -9,8 +10,8 @@ import { Ys7DeviceImgVO, Ys7DeviceImgForm, Ys7DeviceImgQuery } from '@/api/other | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listYs7DeviceImg = (query?: Ys7DeviceImgQuery): AxiosPromise<Ys7DeviceImgVO[]> => { | export const listYs7DeviceImg = (query?: Ys7DeviceImgQuery): AxiosPromise<Ys7DeviceImgVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/other/ys7DeviceImg/list', |     url: '/zm/api/v1/system/ys7DevicesImg/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import request from '@/utils/request'; | import request from '@/utils/request-go'; | ||||||
| // 人员 考勤 补卡 请假接口 对接go 后台 | // 人员 考勤 补卡 请假接口 对接go 后台 | ||||||
| // 获取施工人员列表 | // 获取施工人员列表 | ||||||
| export const getBusConstructionUser = (params) => { | export const getBusConstructionUser = (params) => { | ||||||
| @ -8,6 +8,15 @@ export const getBusConstructionUser = (params) => { | |||||||
|     params |     params | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | // 根据项目获取班组列表 | ||||||
|  | export const getSysProjectTeamList = (params) => { | ||||||
|  |   return request({ | ||||||
|  |     url: '/zm/api/wxApplet/wxApplet/sysProjectTeam/list', | ||||||
|  |     method: 'get', | ||||||
|  |     params | ||||||
|  |   }); | ||||||
|  | }; | ||||||
|  |  | ||||||
| // 获取人员详情 | // 获取人员详情 | ||||||
| export const getDetails = (id) => { | export const getDetails = (id) => { | ||||||
|   return request({ |   return request({ | ||||||
| @ -26,10 +35,18 @@ export const pcSelectBelowProjectOfPersonnel = (params) => { | |||||||
|     params |     params | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | // 获取考勤列表数据 | ||||||
|  | export const busAttendancepCList = (params) => { | ||||||
|  |   return request({ | ||||||
|  |     url: '/zm/api/wxApplet/wxApplet/busAttendance/pCList', | ||||||
|  |     method: 'get', | ||||||
|  |     params | ||||||
|  |   }); | ||||||
|  | }; | ||||||
| // 获取考勤图表数据 | // 获取考勤图表数据 | ||||||
| export const pcCollectDataForTwoWeeks = (params) => { | export const pcCollectDataForTwoWeeks = (params) => { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/api/v1/system/busConstructionUser/pcCollectDataForTwoWeeks', |     url: '/zm/api/v1/system/busConstructionUser/pcCollectDataForTwoWeeks', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params |     params | ||||||
|   }); |   }); | ||||||
| @ -50,3 +67,21 @@ export const busAskforleaveList = (params) => { | |||||||
|     params |     params | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | // 获取字典 | ||||||
|  | export const getDictData = (dictType) => { | ||||||
|  |   return request({ | ||||||
|  |     url: '/zm/api/v1/system/dict/data/getDictData', | ||||||
|  |     method: 'get', | ||||||
|  |     params: { | ||||||
|  |       dictType: dictType, | ||||||
|  |       defaultValue: '' | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|  | }; | ||||||
|  | export const busHseSecurityLogList = (params) => { | ||||||
|  |   return request({ | ||||||
|  |     url: '/zm/api/v1/system/busHseSecurityLog/list', | ||||||
|  |     method: 'get', | ||||||
|  |     params | ||||||
|  |   }); | ||||||
|  | }; | ||||||
| @ -1,4 +1,5 @@ | |||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { RecognizeRecordVO, RecognizeRecordForm, RecognizeRecordQuery } from '@/api/safety/recognizeRecord/types'; | import { RecognizeRecordVO, RecognizeRecordForm, RecognizeRecordQuery } from '@/api/safety/recognizeRecord/types'; | ||||||
|  |  | ||||||
| @ -9,8 +10,8 @@ import { RecognizeRecordVO, RecognizeRecordForm, RecognizeRecordQuery } from '@/ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listRecognizeRecord = (query?: RecognizeRecordQuery): AxiosPromise<RecognizeRecordVO[]> => { | export const listRecognizeRecord = (query?: RecognizeRecordQuery): AxiosPromise<RecognizeRecordVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/recognizeRecord/list', |     url: '/zm/api/v1/system/busTour/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; | import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; | ||||||
|  |  | ||||||
| @ -9,8 +10,8 @@ import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listSafetyInspection = (query?: SafetyInspectionQuery): AxiosPromise<SafetyInspectionVO[]> => { | export const listSafetyInspection = (query?: SafetyInspectionQuery): AxiosPromise<SafetyInspectionVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/safetyInspection/list', |     url: '/zm/api/v1/system/busHseManagement/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
| @ -20,10 +21,11 @@ export const listSafetyInspection = (query?: SafetyInspectionQuery): AxiosPromis | |||||||
|  * 查询安全巡检工单详细 |  * 查询安全巡检工单详细 | ||||||
|  * @param id |  * @param id | ||||||
|  */ |  */ | ||||||
| export const getSafetyInspection = (id: string | number): AxiosPromise<SafetyInspectionVO> => { | export const getSafetyInspection = (query): AxiosPromise<SafetyInspectionVO> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/safetyInspection/' + id, |     url: '/zm/api/v1/system/busHseManagement/get', | ||||||
|     method: 'get' |     method: 'get', | ||||||
|  |     params: query | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | ||||||
|  |  | ||||||
| @ -9,8 +10,8 @@ import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/t | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listTeamMeeting = (query?: TeamMeetingQuery): AxiosPromise<TeamMeetingVO[]> => { | export const listTeamMeeting = (query?: TeamMeetingQuery): AxiosPromise<TeamMeetingVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/teamMeeting/list', |     url: '/zm/api/wxApplet/wxApplet/sysProjectTeamSquad/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
| @ -20,10 +21,11 @@ export const listTeamMeeting = (query?: TeamMeetingQuery): AxiosPromise<TeamMeet | |||||||
|  * 查询站班会详细 |  * 查询站班会详细 | ||||||
|  * @param id |  * @param id | ||||||
|  */ |  */ | ||||||
| export const getTeamMeeting = (id: string | number): AxiosPromise<TeamMeetingVO> => { | export const getTeamMeeting = (query): AxiosPromise<TeamMeetingVO> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/teamMeeting/' + id, |     url: '/zm/api/wxApplet/wxApplet/sysProjectTeamSquad/get', | ||||||
|     method: 'get' |     method: 'get', | ||||||
|  |     params: query | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { ViolationLevelVO, ViolationLevelForm, ViolationLevelQuery } from '@/api/safety/violationLevel/types'; | import { ViolationLevelVO, ViolationLevelForm, ViolationLevelQuery } from '@/api/safety/violationLevel/types'; | ||||||
| @ -9,8 +10,8 @@ import { ViolationLevelVO, ViolationLevelForm, ViolationLevelQuery } from '@/api | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listViolationLevel = (query?: ViolationLevelQuery): AxiosPromise<ViolationLevelVO[]> => { | export const listViolationLevel = (query?: ViolationLevelQuery): AxiosPromise<ViolationLevelVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/violationLevel/list', |     url: '/zm/api/v1/system/busViolationLevel/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import request from '@/utils/request'; | import request from '@/utils/request'; | ||||||
|  | import request1 from '@/utils/request-go'; | ||||||
| import { AxiosPromise } from 'axios'; | import { AxiosPromise } from 'axios'; | ||||||
| import { ViolationRecordVO, ViolationRecordForm, ViolationRecordQuery } from '@/api/safety/violationRecord/types'; | import { ViolationRecordVO, ViolationRecordForm, ViolationRecordQuery } from '@/api/safety/violationRecord/types'; | ||||||
|  |  | ||||||
| @ -9,8 +10,8 @@ import { ViolationRecordVO, ViolationRecordForm, ViolationRecordQuery } from '@/ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| export const listViolationRecord = (query?: ViolationRecordQuery): AxiosPromise<ViolationRecordVO[]> => { | export const listViolationRecord = (query?: ViolationRecordQuery): AxiosPromise<ViolationRecordVO[]> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/violationRecord/list', |     url: '/zm/api/v1/system/busViolationRecord/list', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }); |   }); | ||||||
| @ -20,10 +21,11 @@ export const listViolationRecord = (query?: ViolationRecordQuery): AxiosPromise< | |||||||
|  * 查询违规记录详细 |  * 查询违规记录详细 | ||||||
|  * @param id |  * @param id | ||||||
|  */ |  */ | ||||||
| export const getViolationRecord = (id: string | number): AxiosPromise<ViolationRecordVO> => { | export const getViolationRecord = (query): AxiosPromise<ViolationRecordVO> => { | ||||||
|   return request({ |   return request1({ | ||||||
|     url: '/safety/violationRecord/' + id, |     url: '/zm/api/v1/system/busViolationRecord/get', | ||||||
|     method: 'get' |     method: 'get', | ||||||
|  |     params: query | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | |||||||
| @ -88,7 +88,8 @@ export const useUserStore = defineStore('user', () => { | |||||||
|       if (projectRes?.data) { |       if (projectRes?.data) { | ||||||
|         const projectList = projectRes.data.map((p) => ({ |         const projectList = projectRes.data.map((p) => ({ | ||||||
|           id: p.projectId, |           id: p.projectId, | ||||||
|           name: p.projectName || '未知项目' |           name: p.projectName || '未知项目', | ||||||
|  |           goId: p.goId | ||||||
|         })); |         })); | ||||||
|  |  | ||||||
|         setProjects(projectList); |         setProjects(projectList); | ||||||
|  | |||||||
| @ -4,12 +4,12 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="摄像头名称" prop="deviceName" :label-width="100"> |             <el-form-item label="摄像头名称" prop="name" :label-width="100"> | ||||||
|               <el-input v-model="queryParams.deviceName" placeholder="请输入摄像头名称" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.name" placeholder="请输入摄像头名称" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="拍摄时间" prop="createTime"> |  | ||||||
|               <el-date-picker clearable v-model="queryParams.createTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择拍摄时间" /> |  | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|  |             <!-- <el-form-item label="拍摄时间" prop="createdAt"> | ||||||
|  |               <el-date-picker clearable v-model="queryParams.createdAt" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择拍摄时间" /> | ||||||
|  |             </el-form-item> --> | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -18,36 +18,23 @@ | |||||||
|         </el-card> |         </el-card> | ||||||
|       </div> |       </div> | ||||||
|     </transition> |     </transition> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <template #header> |       <template #header> | ||||||
|         <el-row :gutter="10" class="mb8"> |         <el-row :gutter="10" class="mb8"> | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['other:ys7DeviceImg:remove']" |  | ||||||
|               >删除</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|         </el-row> |         </el-row> | ||||||
|       </template> |       </template> | ||||||
|  |  | ||||||
|       <el-table v-loading="loading" :data="ys7DeviceImgList" @selection-change="handleSelectionChange"> |       <el-table v-loading="loading" :data="ys7DeviceImgList" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="设备序列号" align="center" prop="deviceSerial" /> |         <el-table-column label="序号" align="center" type="index" width="100" /> | ||||||
|         <el-table-column label="摄像头名称" align="center" prop="deviceName" /> |         <el-table-column label="摄像头名称" align="center" prop="name" /> | ||||||
|         <el-table-column label="图片地址" align="center" prop="url"> |         <el-table-column label="图片地址" align="center" prop="url"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-image :z-index="9999" :preview-src-list="[scope.row.url]" preview-teleported :src="scope.row.url" class="w20" /> |             <el-image :z-index="9999" :preview-src-list="[scope.row.path]" preview-teleported :src="scope.row.path" class="w20" /> | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="拍摄时间" align="center" prop="createTime" /> |  | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['other:ys7DeviceImg:remove']">删除</el-button> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|  |         <el-table-column label="拍摄时间" align="center" prop="createdAt" /> | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|   </div> |   </div> | ||||||
| @ -106,8 +93,8 @@ const { queryParams, form, rules } = toRefs(data); | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listYs7DeviceImg(queryParams.value); |   const res = await listYs7DeviceImg(queryParams.value); | ||||||
|   ys7DeviceImgList.value = res.rows; |   ys7DeviceImgList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | |||||||
| @ -4,12 +4,13 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="人员姓名" prop="userName"> |             <el-form-item label="人员姓名" prop="fuzzyQuery"> | ||||||
|               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.fuzzyQuery" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="班组" prop="teamId"> |             <el-form-item label="班组" prop="teamId"> | ||||||
|               <el-select v-model="queryParams.teamId" placeholder="全部" clearable> |               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="dict in ProjectTeam" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option label="全部" value="" /> | ||||||
|  |                 <el-option v-for="item in TeamList" :key="item.id" :label="item.name" :value="item.id" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="工种" prop="typeOfWork"> |             <el-form-item label="工种" prop="typeOfWork"> | ||||||
| @ -27,7 +28,6 @@ | |||||||
|                 @change="selectDate" |                 @change="selectDate" | ||||||
|               /> |               /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|  |  | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -39,10 +39,6 @@ | |||||||
|     <el-row :gutter="20"> |     <el-row :gutter="20"> | ||||||
|       <el-col :span="24" :offset="0"> |       <el-col :span="24" :offset="0"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <!-- <template #header> |  | ||||||
|             <PieChart style="width: 1em; height: 1em; vertical-align: middle" /> |  | ||||||
|             <span style="vertical-align: middle">命令统计</span> |  | ||||||
|           </template> --> |  | ||||||
|           <div class="el-table el-table--enable-row-hover el-table--medium"> |           <div class="el-table el-table--enable-row-hover el-table--medium"> | ||||||
|             <div ref="commandstats" style="height: 200px" /> |             <div ref="commandstats" style="height: 200px" /> | ||||||
|           </div> |           </div> | ||||||
| @ -51,109 +47,28 @@ | |||||||
|     </el-row> |     </el-row> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <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="['project:attendance:add']">新增</el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['project:attendance:edit']" |  | ||||||
|               >修改</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['project:attendance:remove']" |  | ||||||
|               >删除</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:attendance:export']">导出</el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |  | ||||||
|         </el-row> |  | ||||||
|       </template> --> |  | ||||||
|  |  | ||||||
|       <el-table v-loading="loading" :data="attendanceList"> |       <el-table v-loading="loading" :data="attendanceList"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="主键id" align="center" prop="id" v-if="false" /> |         <el-table-column label="人员姓名" align="center" prop="UserName" /> | ||||||
|         <el-table-column label="人员姓名" align="center" prop="userName" /> |         <el-table-column label="班组" align="center" prop="TeamName" /> | ||||||
|         <el-table-column label="班组" align="center" prop="teamName" /> |  | ||||||
|         <el-table-column label="工种" align="center" prop="typeOfWork"> |         <el-table-column label="工种" align="center" prop="typeOfWork"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="type_of_work" :value="scope.row.typeOfWork" /> |             <dict-tag :options="type_of_work" :value="scope.row.TypeOfWork" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="出勤(天)" align="center" prop="attendanceDays" /> |         <el-table-column label="出勤(天)" align="center" prop="Attendance" /> | ||||||
|         <el-table-column label="迟到(次)" align="center" prop="lateDays" /> |         <el-table-column label="迟到(次)" align="center" prop="LackOfCard" /> | ||||||
|         <el-table-column label="早退(次)" align="center" prop="leaveEarlyDays" /> |         <el-table-column label="早退(次)" align="center" prop="LeaveEarly" /> | ||||||
|         <el-table-column label="缺卡(次)" align="center" prop="unClockDays" /> |         <el-table-column label="缺卡(次)" align="center" prop="BeLate" /> | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |         <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-button link type="primary" icon="View" @click="handleDetails(scope.row)" v-hasPermi="['project:attendance:edit']">详情</el-button> |             <el-button link type="primary" icon="View" @click="handleDetails(scope.row)" v-hasPermi="['project:attendance:edit']">详情</el-button> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> --> | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <!-- 添加或修改考勤对话框 --> |  | ||||||
|     <!-- <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |  | ||||||
|       <el-form ref="attendanceFormRef" :model="form" :rules="rules" label-width="80px"> |  | ||||||
|         <el-form-item label="人员id" prop="userId"> |  | ||||||
|           <el-input v-model="form.userId" placeholder="请输入人员id" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="人脸照" prop="facePic"> |  | ||||||
|           <image-upload v-model="form.facePic" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="项目id" prop="projectId"> |  | ||||||
|           <el-input v-model="form.projectId" placeholder="请输入项目id" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="上班打卡时间" prop="onClockTime"> |  | ||||||
|           <el-date-picker clearable v-model="form.onClockTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择上班打卡时间"> |  | ||||||
|           </el-date-picker> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="下班打卡时间" prop="offClockTime"> |  | ||||||
|           <el-date-picker clearable v-model="form.offClockTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择下班打卡时间"> |  | ||||||
|           </el-date-picker> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="打卡日期" prop="clockDate"> |  | ||||||
|           <el-date-picker clearable v-model="form.clockDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择打卡日期"> |  | ||||||
|           </el-date-picker> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="1正常,2迟到,3早退,4缺勤,5补卡" prop="clockStatus"> |  | ||||||
|           <el-radio-group v-model="form.clockStatus"> |  | ||||||
|             <el-radio v-for="dict in clock_status_type" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio> |  | ||||||
|           </el-radio-group> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="代打人员id" prop="pinchUserId"> |  | ||||||
|           <el-input v-model="form.pinchUserId" placeholder="请输入代打人员id" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="多次打卡时间记录" prop="clockRecord"> |  | ||||||
|           <el-input v-model="form.clockRecord" type="textarea" placeholder="请输入内容" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="上下班" prop="commuter"> |  | ||||||
|           <el-input v-model="form.commuter" placeholder="请输入上下班" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="日薪" prop="dailyWage"> |  | ||||||
|           <el-input v-model="form.dailyWage" placeholder="请输入日薪" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="经度" prop="lng"> |  | ||||||
|           <el-input v-model="form.lng" placeholder="请输入经度" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="纬度" prop="lat"> |  | ||||||
|           <el-input v-model="form.lat" placeholder="请输入纬度" /> |  | ||||||
|         </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 v-model="dialog.details" width="1300px"> |     <el-dialog v-model="dialog.details" width="1300px"> | ||||||
|       <el-calendar ref="calendar" v-model="calendarDay" class="h170 pos-relative"> |       <el-calendar ref="calendar" v-model="calendarDay" class="h170 pos-relative"> | ||||||
| @ -188,40 +103,28 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup name="Attendance" lang="ts"> | <script setup name="Attendance" lang="ts"> | ||||||
| import { | import { addAttendance, updateAttendance, listAttendanceMonth } from '@/api/project/attendance'; | ||||||
|   listAttendance, |  | ||||||
|   getAttendance, |  | ||||||
|   delAttendance, |  | ||||||
|   addAttendance, |  | ||||||
|   updateAttendance, |  | ||||||
|   listAttendanceTwoWeek, |  | ||||||
|   listAttendanceMonth |  | ||||||
| } from '@/api/project/attendance'; |  | ||||||
| import { option } from '@/api/project/attendance/echarts'; | import { option } from '@/api/project/attendance/echarts'; | ||||||
| import * as echarts from 'echarts'; | import * as echarts from 'echarts'; | ||||||
| import { AttendanceVO, AttendanceQuery, AttendanceForm, AttendanceTwoWeekVO, AttendanceMonthVO } from '@/api/project/attendance/types'; | import { AttendanceVO, AttendanceQuery, AttendanceForm, AttendanceTwoWeekVO, AttendanceMonthVO } from '@/api/project/attendance/types'; | ||||||
| import { listProjectTeam } from '@/api/project/projectTeam'; |  | ||||||
| import { ProjectTeamVO } from '@/api/project/projectTeam/types'; |  | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| import { parseTime } from '@/utils/ruoyi'; | import { parseTime } from '@/utils/ruoyi'; | ||||||
| const commandstats = ref(); | const commandstats = ref(); | ||||||
|  | import { pcSelectBelowProjectOfPersonnel, getSysProjectTeamList, pcCollectDataForTwoWeeks } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { clock_status_type, type_of_work } = toRefs<any>(proxy?.useDict('clock_status_type', 'type_of_work')); | const { type_of_work } = toRefs<any>(proxy?.useDict('clock_status_type', 'type_of_work')); | ||||||
| import type { CalendarDateType, CalendarInstance } from 'element-plus'; | import type { CalendarInstance } from 'element-plus'; | ||||||
| // 获取用户 store | // 获取用户 store | ||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const ProjectTeam = computed(() => proxy?.$cache.local.getJSON('ProjectTeamList') || []); |  | ||||||
|  |  | ||||||
| const attendanceList = ref<AttendanceVO[]>([]); | const attendanceList = ref<AttendanceVO[]>([]); | ||||||
| const attendanceTwoWeekList = ref<AttendanceTwoWeekVO[]>([]); | const attendanceTwoWeekList = ref<AttendanceTwoWeekVO[]>([]); | ||||||
| const buttonLoading = ref(false); | const buttonLoading = ref(false); | ||||||
| const loading = ref(true); | const loading = ref(true); | ||||||
| const showSearch = 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 total = ref(0); | ||||||
| const calendarDay = ref<Date | null>(null); | const calendarDay = ref<Date | null>(null); | ||||||
| const monthValue = ref<Date | null>(null); | const monthValue = ref<Date | null>(null); | ||||||
| @ -247,7 +150,7 @@ const initFormData: AttendanceForm = { | |||||||
|   clockRecord: undefined, |   clockRecord: undefined, | ||||||
|   commuter: undefined, |   commuter: undefined, | ||||||
|   dailyWage: undefined, |   dailyWage: undefined, | ||||||
|   projectId: currentProject.value.id, |   projectId: currentProject.value.goId, | ||||||
|   lng: undefined, |   lng: undefined, | ||||||
|   lat: undefined, |   lat: undefined, | ||||||
|   remark: undefined, |   remark: undefined, | ||||||
| @ -263,7 +166,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({ | |||||||
|     clockDate: undefined, |     clockDate: undefined, | ||||||
|     clockStatus: undefined, |     clockStatus: undefined, | ||||||
|     commuter: undefined, |     commuter: undefined, | ||||||
|     projectId: currentProject.value.id, |     projectId: currentProject.value.goId, | ||||||
|     typeOfWork: undefined, |     typeOfWork: undefined, | ||||||
|     teamId: undefined, |     teamId: undefined, | ||||||
|     params: {} |     params: {} | ||||||
| @ -277,6 +180,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({ | |||||||
|     clockStatus: [{ required: true, message: '1正常,2迟到,3早退,4缺勤,5补卡不能为空', trigger: 'change' }] |     clockStatus: [{ required: true, message: '1正常,2迟到,3早退,4缺勤,5补卡不能为空', trigger: 'change' }] | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
|  | const TeamList = ref([]); //班组列表 | ||||||
|  |  | ||||||
| const day = computed(() => (date) => { | const day = computed(() => (date) => { | ||||||
|   return date.day.split('-').slice(1).join('-'); |   return date.day.split('-').slice(1).join('-'); | ||||||
| @ -338,16 +242,20 @@ const handleViewPlayCard = async (data: any) => { | |||||||
| /** 查询考勤列表 */ | /** 查询考勤列表 */ | ||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listAttendance(queryParams.value); |   const res = await pcSelectBelowProjectOfPersonnel(queryParams.value); | ||||||
|   attendanceList.value = res.rows; |   attendanceList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取班组 | ||||||
|  | const getTeamList = async () => { | ||||||
|  |   const res = await getSysProjectTeamList({ pageNum: 1, pageSize: 1000, projectId: currentProject.value.goId }); | ||||||
|  |   TeamList.value = res.data.list; | ||||||
|  | }; | ||||||
| /** 查询近两周考勤列表 */ | /** 查询近两周考勤列表 */ | ||||||
| const getListTwoWeek = async () => { | const getListTwoWeek = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listAttendanceTwoWeek(queryParams.value); |   const res = await pcCollectDataForTwoWeeks(queryParams.value); | ||||||
|   attendanceTwoWeekList.value = res.data; |   attendanceTwoWeekList.value = res.data; | ||||||
|   echartsOption.value = { ...option(attendanceTwoWeekList.value) }; |   echartsOption.value = { ...option(attendanceTwoWeekList.value) }; | ||||||
|   commandstatsIntance.value.setOption(echartsOption.value); |   commandstatsIntance.value.setOption(echartsOption.value); | ||||||
| @ -423,25 +331,6 @@ const submitForm = () => { | |||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 删除按钮操作 */ |  | ||||||
| // const handleDelete = async (row?: AttendanceVO) => { |  | ||||||
| //   const _ids = row?.id || ids.value; |  | ||||||
| //   await proxy?.$modal.confirm('是否确认删除考勤编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); |  | ||||||
| //   await delAttendance(_ids); |  | ||||||
| //   proxy?.$modal.msgSuccess('删除成功'); |  | ||||||
| //   await getList(); |  | ||||||
| // }; |  | ||||||
|  |  | ||||||
| /** 导出按钮操作 */ |  | ||||||
| // const handleExport = () => { |  | ||||||
| //   proxy?.download( |  | ||||||
| //     'project/attendance/export', |  | ||||||
| //     { |  | ||||||
| //       ...queryParams.value |  | ||||||
| //     }, |  | ||||||
| //     `attendance_${new Date().getTime()}.xlsx` |  | ||||||
| //   ); |  | ||||||
| // }; |  | ||||||
| //初始化图表 | //初始化图表 | ||||||
| const init = () => { | const init = () => { | ||||||
|   commandstatsIntance.value = echarts.init(commandstats.value, 'macarons'); |   commandstatsIntance.value = echarts.init(commandstats.value, 'macarons'); | ||||||
| @ -454,8 +343,9 @@ const init = () => { | |||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|  |     getTeamList(); | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|     getList(); |     getList(); | ||||||
| @ -463,10 +353,12 @@ const listeningProject = watch( | |||||||
| ); | ); | ||||||
|  |  | ||||||
| onUnmounted(() => { | onUnmounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   listeningProject(); |   listeningProject(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   getList(); |   getList(); | ||||||
|   getListTwoWeek(); |   getListTwoWeek(); | ||||||
|   init(); |   init(); | ||||||
|  | |||||||
| @ -8,18 +8,12 @@ | |||||||
|               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="班组" prop="teamId"> |             <el-form-item label="班组" prop="teamId"> | ||||||
|               <el-select v-model="queryParams.teamId" placeholder="全部" clearable> |               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="dict in ProjectTeam" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option label="全部" value="" /> | ||||||
|               </el-select> |                 <el-option v-for="item in TeamList" :key="item.id" :label="item.name" :value="item.id" /> | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="打卡日期" prop="clockDate"> |  | ||||||
|               <el-date-picker clearable v-model="queryParams.clockDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择打卡日期" /> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="考勤状态" prop="clockStatus"> |  | ||||||
|               <el-select v-model="queryParams.clockStatus" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in clock_status_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|  |  | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -49,9 +43,9 @@ | |||||||
|             <dict-tag :options="commuter_type" :value="scope.row.commuter" /> |             <dict-tag :options="commuter_type" :value="scope.row.commuter" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="打卡日期" align="center" prop="clockDate"> |         <el-table-column label="打卡日期" align="center" prop="printingDate"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.clockDate, '{y}-{m}-{d}') }}</span> |             <span>{{ parseTime(scope.row.printingDate, '{y}-{m}-{d}') }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="打卡时间" align="center" prop="clockTime"> |         <el-table-column label="打卡时间" align="center" prop="clockTime"> | ||||||
| @ -69,29 +63,17 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup name="Attendance" lang="ts"> | <script setup name="Attendance" lang="ts"> | ||||||
| import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from '@/api/project/attendanceRecords'; |  | ||||||
| import { AttendanceVO, AttendanceQuery, AttendanceForm } from '@/api/project/attendanceRecords/types'; | import { AttendanceVO, AttendanceQuery, AttendanceForm } from '@/api/project/attendanceRecords/types'; | ||||||
| import { listProjectTeam } from '@/api/project/projectTeam'; |  | ||||||
| import { ProjectTeamVO } from '@/api/project/projectTeam/types'; |  | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { clock_status_type, commuter_type } = toRefs<any>(proxy?.useDict('clock_status_type', 'commuter_type')); | const { clock_status_type, commuter_type } = toRefs<any>(proxy?.useDict('clock_status_type', 'commuter_type')); | ||||||
|  | import { busAttendancepCList, getSysProjectTeamList } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| const attendanceList = ref<AttendanceVO[]>([]); | const attendanceList = ref<AttendanceVO[]>([]); | ||||||
| const buttonLoading = ref(false); |  | ||||||
| const loading = ref(true); | const loading = ref(true); | ||||||
| const showSearch = 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 total = ref(0); | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const attendanceFormRef = ref<ElFormInstance>(); |  | ||||||
|  |  | ||||||
| const dialog = reactive<DialogOption>({ |  | ||||||
|   visible: false, |  | ||||||
|   title: '' |  | ||||||
| }); |  | ||||||
| // 获取用户 store | // 获取用户 store | ||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| @ -102,7 +84,7 @@ const initFormData: AttendanceForm = { | |||||||
|   id: undefined, |   id: undefined, | ||||||
|   userId: undefined, |   userId: undefined, | ||||||
|   facePic: undefined, |   facePic: undefined, | ||||||
|   projectId: currentProject.value?.id, |   projectId: currentProject.value?.goId, | ||||||
|   onClockTime: undefined, |   onClockTime: undefined, | ||||||
|   offClockTime: undefined, |   offClockTime: undefined, | ||||||
|   clockDate: undefined, |   clockDate: undefined, | ||||||
| @ -121,7 +103,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({ | |||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     userName: undefined, |     userName: undefined, | ||||||
|     projectId: currentProject.value?.id, |     projectId: currentProject.value?.goId, | ||||||
|     clockDate: undefined, |     clockDate: undefined, | ||||||
|     clockStatus: undefined, |     clockStatus: undefined, | ||||||
|     commuter: undefined, |     commuter: undefined, | ||||||
| @ -137,18 +119,22 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({ | |||||||
|     clockStatus: [{ required: true, message: '1正常,2迟到,3早退,4缺勤,5补卡不能为空', trigger: 'change' }] |     clockStatus: [{ required: true, message: '1正常,2迟到,3早退,4缺勤,5补卡不能为空', trigger: 'change' }] | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
|  | const TeamList = ref([]); //班组列表 | ||||||
| const { queryParams, form, rules } = toRefs(data); | const { queryParams, form, rules } = toRefs(data); | ||||||
|  |  | ||||||
| /** 查询考勤列表 */ | /** 查询考勤列表 */ | ||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listAttendance(queryParams.value); |   const res = await busAttendancepCList(queryParams.value); | ||||||
|   attendanceList.value = res.rows; |   attendanceList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取班组 | ||||||
|  | const getTeamList = async () => { | ||||||
|  |   const res = await getSysProjectTeamList({ pageNum: 1, pageSize: 1000, projectId: currentProject.value.goId }); | ||||||
|  |   TeamList.value = res.data.list; | ||||||
|  | }; | ||||||
| /** 搜索按钮操作 */ | /** 搜索按钮操作 */ | ||||||
| const handleQuery = () => { | const handleQuery = () => { | ||||||
|   queryParams.value.pageNum = 1; |   queryParams.value.pageNum = 1; | ||||||
| @ -163,10 +149,11 @@ const resetQuery = () => { | |||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|  |     getTeamList(); | ||||||
|     getList(); |     getList(); | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
| @ -176,6 +163,7 @@ onUnmounted(() => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -4,27 +4,13 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px"> | ||||||
|             <el-form-item label="申请人" prop="userName"> |             <el-form-item label="申请人" prop="name"> | ||||||
|               <el-input v-model="queryParams.userName" placeholder="请输入申请人" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.name" placeholder="请输入申请人" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="所属班组" prop="leaveType"> |             <el-form-item label="所属班组" prop="leaveType"> | ||||||
|               <el-select v-model="queryParams.teamId" placeholder="全部" clearable> |               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="dict in ProjectTeam" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option label="全部" value="" /> | ||||||
|               </el-select> |                 <el-option v-for="item in TeamList" :key="item.id" :label="item.name" :value="item.id" /> | ||||||
|             </el-form-item> |  | ||||||
|             <!-- <el-form-item label="请假类型" prop="leaveType"> |  | ||||||
|               <el-select v-model="queryParams.leaveType" placeholder="请选择请假类型" clearable> |  | ||||||
|                 <el-option v-for="dict in user_leave_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> --> |  | ||||||
|             <el-form-item label="班组长意见" prop="gangerOpinion"> |  | ||||||
|               <el-select v-model="queryParams.gangerOpinion" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in user_opinion_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="管理员意见" prop="managerOpinion"> |  | ||||||
|               <el-select v-model="queryParams.managerOpinion" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in user_opinion_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
| @ -37,38 +23,12 @@ | |||||||
|     </transition> |     </transition> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <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="['project:leave:add']">新增</el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['project:leave:edit']" |  | ||||||
|               >修改</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['project:leave:remove']" |  | ||||||
|               >删除</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:leave:export']">导出</el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |  | ||||||
|         </el-row> |  | ||||||
|       </template> --> |  | ||||||
|  |  | ||||||
|       <el-table v-loading="loading" :data="leaveList"> |       <el-table v-loading="loading" :data="leaveList"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" align="center" type="index" width="50" /> |         <el-table-column label="序号" align="center" type="index" width="50" /> | ||||||
|         <el-table-column label="申请人" align="center" prop="userName" /> |         <el-table-column label="申请人" align="center" prop="userName" /> | ||||||
|         <el-table-column label="申请请假说明" align="center" prop="argument" /> |         <el-table-column label="申请请假说明" align="center" prop="argument" /> | ||||||
|         <!-- <el-table-column label="请假申请时间" align="center" prop="userTime" width="180"> |         <el-table-column label="请假申请时间" align="center" prop="createdAt" width="180"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.userTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> --> |  | ||||||
|         <el-table-column label="所属班组" align="center" prop="teamName"> |         <el-table-column label="所属班组" align="center" prop="teamName"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="user_leave_type" :value="scope.row.teamName" /> |             <dict-tag :options="user_leave_type" :value="scope.row.teamName" /> | ||||||
| @ -79,28 +39,6 @@ | |||||||
|             <dict-tag :options="user_review_status_type" :value="scope.row.cardNumber" /> |             <dict-tag :options="user_review_status_type" :value="scope.row.cardNumber" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <!-- <el-table-column label="班组长意见" align="center" prop="gangerOpinion"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <dict-tag :options="user_opinion_type" :value="scope.row.gangerOpinion" /> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="班组长说明" align="center" prop="gangerExplain" /> |  | ||||||
|         <el-table-column label="班组长操作时间" align="center" prop="gangerTime" width="180"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.gangerTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="管理员意见" align="center" prop="managerOpinion"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <dict-tag :options="user_opinion_type" :value="scope.row.managerOpinion" /> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="管理员说明" align="center" prop="managerExplain" /> |  | ||||||
|         <el-table-column label="请假申请时间" align="center" prop="userTime" width="180"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.userTime) }}</span> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> --> |  | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-button link type="success" icon="View" @click="handleDetail(scope.row)">详情</el-button> |             <el-button link type="success" icon="View" @click="handleDetail(scope.row)">详情</el-button> | ||||||
| @ -199,16 +137,13 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup name="Leave" lang="ts"> | <script setup name="Leave" lang="ts"> | ||||||
| import { listLeave, getLeave, delLeave, addLeave, updateLeave, AuditReissueCard } from '@/api/project/leave'; | import { listLeave, AuditReissueCard } from '@/api/project/leave'; | ||||||
| import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/project/leave/types'; | import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/project/leave/types'; | ||||||
| import { listProjectTeam } from '@/api/project/projectTeam'; |  | ||||||
| import { ProjectTeamVO } from '@/api/project/projectTeam/types'; |  | ||||||
| import { AuditReissueCardForm, ReissueCardVO } from '@/api/project/reissueCard/types'; | import { AuditReissueCardForm, ReissueCardVO } from '@/api/project/reissueCard/types'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { user_leave_type, user_opinion_type, user_review_status_type } = toRefs<any>( | const { user_leave_type, user_review_status_type } = toRefs<any>(proxy?.useDict('user_leave_type', 'user_opinion_type', 'user_review_status_type')); | ||||||
|   proxy?.useDict('user_leave_type', 'user_opinion_type', 'user_review_status_type') | import { getSysProjectTeamList } from '@/api/project/goUser/index'; | ||||||
| ); |  | ||||||
| const detailObj = ref<ReissueCardVO>({ | const detailObj = ref<ReissueCardVO>({ | ||||||
|   userName: undefined, |   userName: undefined, | ||||||
|   id: undefined, |   id: undefined, | ||||||
| @ -225,18 +160,15 @@ const detailObj = ref<ReissueCardVO>({ | |||||||
|   status: undefined, |   status: undefined, | ||||||
|   managerName: undefined |   managerName: undefined | ||||||
| }); | }); | ||||||
|  | const TeamList = ref([]); //班组列表 | ||||||
| const leaveList = ref<LeaveVO[]>([]); | const leaveList = ref<LeaveVO[]>([]); | ||||||
| const buttonLoading = ref(false); | const buttonLoading = ref(false); | ||||||
| const loading = ref(true); | const loading = ref(true); | ||||||
| const showSearch = ref(true); | const showSearch = ref(true); | ||||||
| const ids = ref<Array<string | number>>([]); | const ids = ref<Array<string | number>>([]); | ||||||
| const single = ref(true); |  | ||||||
| const multiple = ref(true); |  | ||||||
| const total = ref(0); | const total = ref(0); | ||||||
|  |  | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const leaveFormRef = ref<ElFormInstance>(); |  | ||||||
| const dialog = reactive<DialogOption>({ | const dialog = reactive<DialogOption>({ | ||||||
|   visible: false, |   visible: false, | ||||||
|   title: '', |   title: '', | ||||||
| @ -246,8 +178,6 @@ const dialog = reactive<DialogOption>({ | |||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const ProjectTeam = computed(() => proxy?.$cache.local.getJSON('ProjectTeamList') || []); |  | ||||||
|  |  | ||||||
| const initFormData: LeaveForm = { | const initFormData: LeaveForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   userId: undefined, |   userId: undefined, | ||||||
| @ -350,7 +280,11 @@ const getList = async () => { | |||||||
|   total.value = res.data.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取班组 | ||||||
|  | const getTeamList = async () => { | ||||||
|  |   const res = await getSysProjectTeamList({ pageNum: 1, pageSize: 1000, projectId: currentProject.value.goId }); | ||||||
|  |   TeamList.value = res.data.list; | ||||||
|  | }; | ||||||
| /** 取消按钮 */ | /** 取消按钮 */ | ||||||
| const cancel = () => { | const cancel = () => { | ||||||
|   reset(); |   reset(); | ||||||
| @ -410,10 +344,11 @@ const handleExport = () => { | |||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|  |     getTeamList(); | ||||||
|     getList(); |     getList(); | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
| @ -423,6 +358,7 @@ onUnmounted(() => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -137,9 +137,9 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { getConstructionUser } from '@/api/project/constructionUser'; |  | ||||||
| import { ConstructionUserVO } from '@/api/project/constructionUser/types'; | import { ConstructionUserVO } from '@/api/project/constructionUser/types'; | ||||||
| import { dayjs } from 'element-plus'; | import { dayjs } from 'element-plus'; | ||||||
|  | import { getDetails } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { type_of_work, user_sex_type, user_clock_type } = toRefs<any>(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type')); | const { type_of_work, user_sex_type, user_clock_type } = toRefs<any>(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type')); | ||||||
| @ -153,8 +153,8 @@ const loading = ref<boolean>(false); | |||||||
| const userDetail = ref<ConstructionUserVO>(); | const userDetail = ref<ConstructionUserVO>(); | ||||||
| const getUserDetail = async () => { | const getUserDetail = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await getConstructionUser(props.userId); |   const res = await getDetails(props.userId); | ||||||
|   if (res.data && res.code === 200) { |   if (res.data && res.code === 0) { | ||||||
|     userDetail.value = res.data; |     userDetail.value = res.data; | ||||||
|   } |   } | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
|  | |||||||
| @ -7,14 +7,20 @@ | |||||||
|             <el-form-item label="人员姓名" prop="userName"> |             <el-form-item label="人员姓名" prop="userName"> | ||||||
|               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="分包公司" prop="contractorId"> |             <!-- <el-form-item label="分包公司" prop="contractorId"> | ||||||
|               <el-select v-model="queryParams.contractorId" clearable placeholder="全部"> |               <el-select v-model="queryParams.contractorId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" /> |                 <el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|  |             </el-form-item> --> | ||||||
|  |             <el-form-item label="打卡状态" prop="clock"> | ||||||
|  |               <el-select v-model="queryParams.clock" placeholder="请选择状态" clearable> | ||||||
|  |                 <el-option label="启用打卡" :value="1" /> | ||||||
|  |                 <el-option label="禁用打卡" :value="2" /> | ||||||
|  |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="班组" prop="teamId"> |             <el-form-item label="班组" prop="teamId"> | ||||||
|               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> |               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" /> |                 <el-option v-for="item in TeamList" :key="item.id" :label="item.name" :value="item.id" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="工种" prop="typeOfWork"> |             <el-form-item label="工种" prop="typeOfWork"> | ||||||
| @ -41,27 +47,19 @@ | |||||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|         </el-row> |         </el-row> | ||||||
|       </template> |       </template> | ||||||
|       <el-table v-loading="loading" :data="constructionUserList" @selection-change="handleSelectionChange" v-cloak> |       <el-table height="60vh" v-loading="loading" :data="constructionUserList" @selection-change="handleSelectionChange" v-cloak> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> |         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||||
|         <el-table-column label="姓名" align="center" prop="userName"> |         <el-table-column label="姓名" align="center" prop="userName"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <el-link type="primary" @click="handleUpdate(scope.row)">{{ scope.row.userName }}</el-link> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="分包公司" align="center" prop="contractorVo.name" /> |         <el-table-column label="分包公司" align="center" prop="contractorVo.name" /> | ||||||
|         <el-table-column label="班组" align="center" prop="teamId"> |         <el-table-column label="班组" align="center" prop="bzName"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             {{ getTeamName(scope.row.teamId) }} |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="联系电话" align="center" prop="phone" min-width="120" /> |         <el-table-column label="联系电话" align="center" prop="phone" min-width="120" /> | ||||||
|         <el-table-column label="性别" align="center" prop="sex"> |         <el-table-column label="性别" align="center" prop="sex"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="user_sex_type" :value="scope.row.sex" /> |             <dict-tag :options="user_sex_type" :value="scope.row.sex" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="民族" align="center" prop="nation" /> |         <el-table-column label="民族" align="center" prop="sfzNation" /> | ||||||
|         <el-table-column label="身份证号码" align="center" prop="sfzNumber" min-width="180" /> |         <el-table-column label="身份证号码" align="center" prop="sfzNumber" min-width="180" /> | ||||||
|         <el-table-column label="工种" align="center" prop="typeOfWork" min-width="120"> |         <el-table-column label="工种" align="center" prop="typeOfWork" min-width="120"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
| @ -76,24 +74,15 @@ | |||||||
|               inline-prompt |               inline-prompt | ||||||
|               style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" |               style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" | ||||||
|               active-text="开启" |               active-text="开启" | ||||||
|               inactive-text="禁用" |               inactive-text="关闭" | ||||||
|               :loading="playCardLoding" |  | ||||||
|               active-value="0" |               active-value="0" | ||||||
|               inactive-value="1" |               inactive-value="1" | ||||||
|               @change="handleClockStatus(scope.row)" |  | ||||||
|             /> |             /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="薪水" align="center" min-width="180"> |         <el-table-column label="薪水" align="center" prop="original" min-width="180"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <span class="flex justify-center"> |  | ||||||
|               {{ scope.row.salary ? scope.row.salary : scope.row.standardSalary }} |  | ||||||
|               (<dict-tag :options="wage_measure_unit_type" :value="scope.row.wageMeasureUnit"></dict-tag>) |  | ||||||
|             </span> |  | ||||||
|             <div class="text-blue text-sm cursor-pointer" @click="openSalaryDialog(scope.row)">{{ scope.row.salary ? '取消变更' : '变更' }}</div> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="入场时间" align="center" prop="entryDate" min-width="180" /> |         <el-table-column label="入场时间" align="center" prop="entryDate" min-width="180" /> | ||||||
|  |         <el-table-column label="施工单位" align="center" prop="lwName" min-width="180" /> | ||||||
|         <el-table-column label="离场时间" align="center" prop="leaveDate" min-width="180" /> |         <el-table-column label="离场时间" align="center" prop="leaveDate" min-width="180" /> | ||||||
|         <el-table-column label="状态" align="center" prop="status"> |         <el-table-column label="状态" align="center" prop="status"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
| @ -107,11 +96,13 @@ | |||||||
|               <el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['contractor:constructionUser:query']"> |               <el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['contractor:constructionUser:query']"> | ||||||
|                 详情 |                 详情 | ||||||
|               </el-button> |               </el-button> | ||||||
|               <el-tooltip content="红点:部分上传,绿点:已上传,无点:未上传" placement="right" effect="dark"> |               <el-badge :is-dot="scope.row.fileStatus > 1" :class="['item', scope.row.fileStatus == 3 ? 'badgeColor' : '']"> | ||||||
|                 <el-badge :is-dot="scope.row.fileUploadStatus != '1'" :type="uploadStatusColor(scope.row.fileUploadStatus)"> |                 <el-tooltip class="box-item" effect="dark" content="红点:部分上传,绿点:已上传,无点:未上传" placement="left"> | ||||||
|                   <el-button link type="primary" icon="FolderAdd" @click="handleUpload(scope.row)">文件上传 </el-button> |                   <el-button type="primary" link @click="handleUpload(scope.row)" v-auth="'api/wxApplet/wxApplet/busConstructionUser/edit'" | ||||||
|                 </el-badge> |                     ><el-icon><ele-FolderAdd /></el-icon>文件上传</el-button | ||||||
|  |                   > | ||||||
|                 </el-tooltip> |                 </el-tooltip> | ||||||
|  |               </el-badge> | ||||||
|             </el-space> |             </el-space> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
| @ -156,48 +147,21 @@ | |||||||
| <script setup name="ConstructionUser" lang="ts"> | <script setup name="ConstructionUser" lang="ts"> | ||||||
| import { | import { | ||||||
|   addConstructionUser, |   addConstructionUser, | ||||||
|   delConstructionUser, |  | ||||||
|   getConstructionUser, |   getConstructionUser, | ||||||
|   listConstructionUser, |  | ||||||
|   updateConstructionUser, |   updateConstructionUser, | ||||||
|   getProjectContractorList, |  | ||||||
|   transferConstructionUser, |  | ||||||
|   updateConstructionUserStatus, |  | ||||||
|   updateConstructionUserPlayCardStatus, |  | ||||||
|   updateConstructionUserPlayCardOneStatus, |  | ||||||
|   updateConstructionUserSalary, |   updateConstructionUserSalary, | ||||||
|   getConstructionUserExit, |  | ||||||
|   dowloadConstructionUserTemplate, |  | ||||||
|   importConstructionUserInfo, |  | ||||||
|   listConstructionMonth |   listConstructionMonth | ||||||
| } from '@/api/project/constructionUser'; | } from '@/api/project/constructionUser'; | ||||||
| import { | import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO, skipType } from '@/api/project/constructionUser/types'; | ||||||
|   ConstructionUserForm, |  | ||||||
|   ConstructionUserQuery, |  | ||||||
|   ConstructionUserVO, |  | ||||||
|   skipType, |  | ||||||
|   skipOptionType, |  | ||||||
|   skipTeamType |  | ||||||
| } from '@/api/project/constructionUser/types'; |  | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| import { listContractor } from '@/api/project/contractor'; | import { listContractor } from '@/api/project/contractor'; | ||||||
| import { ContractorVO } from '@/api/project/contractor/types'; | import { ContractorVO } from '@/api/project/contractor/types'; | ||||||
| import { ProjectTeamVO } from '@/api/project/projectTeam/types'; | import ConstructionUserDetail from '@/views/project/projectUser/component/ConstructionUserDetail.vue'; | ||||||
| import ConstructionUserDetail from '@/views/project/constructionUser/component/ConstructionUserDetail.vue'; | import { listConstructionUserFile } from '@/api/project/constructionUserFile'; | ||||||
| import { addConstructionBlacklist } from '@/api/project/constructionBlacklist'; | import { ConstructionUserFileVO } from '@/api/project/constructionUserFile/types'; | ||||||
| import { listConstructionUserFile, setConstructionUserFile } from '@/api/project/constructionUserFile'; |  | ||||||
| import { |  | ||||||
|   ConstructionUserFileVO, |  | ||||||
|   ConstructionUserExitVO, |  | ||||||
|   ConstructionUserFileForm, |  | ||||||
|   ConstructionUserFileQuery |  | ||||||
| } from '@/api/project/constructionUserFile/types'; |  | ||||||
| import { ElLoadingService } from 'element-plus'; |  | ||||||
| import type { CalendarDateType, CalendarInstance } from 'element-plus'; |  | ||||||
| import { AttendanceMonthVO } from '@/api/project/attendance/types'; | import { AttendanceMonthVO } from '@/api/project/attendance/types'; | ||||||
| import { parseTime } from '@/utils/ruoyi'; | import { parseTime } from '@/utils/ruoyi'; | ||||||
|  | import { getBusConstructionUser, getSysProjectTeamList } from '@/api/project/goUser/index'; | ||||||
| const calendar = ref<CalendarInstance>(); |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs<any>( | const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs<any>( | ||||||
|   proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type') |   proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type') | ||||||
| @ -206,7 +170,6 @@ const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_statu | |||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const ProjectTeam = computed(() => proxy?.$cache.local.getJSON('ProjectTeamList') || []); |  | ||||||
| const constructionUserList = ref<ConstructionUserVO[]>([]); | const constructionUserList = ref<ConstructionUserVO[]>([]); | ||||||
| const buttonLoading = ref(false); | const buttonLoading = ref(false); | ||||||
| const loading = ref(true); | const loading = ref(true); | ||||||
| @ -215,22 +178,12 @@ const ids = ref<Array<string | number>>([]); | |||||||
| const single = ref(true); | const single = ref(true); | ||||||
| const multiple = ref(true); | const multiple = ref(true); | ||||||
| const total = ref(0); | const total = ref(0); | ||||||
| const skip = ref(false); |  | ||||||
| const fileStatus = ref(false); | const fileStatus = ref(false); | ||||||
| const showFaceDrawer = ref(false); | const showFaceDrawer = ref(false); | ||||||
| const statusDialog = ref(false); |  | ||||||
| const playCardStatus = ref(false); |  | ||||||
| const playCardLoding = ref(false); |  | ||||||
| const playCardCalendar = ref(false); | const playCardCalendar = ref(false); | ||||||
| const salaryStatus = ref(false); | const salaryStatus = ref(false); | ||||||
| const exitStatus = ref(false); |  | ||||||
| const calendarDay = ref<Date | null>(null); | const calendarDay = ref<Date | null>(null); | ||||||
| const monthValue = ref<Date | null>(null); |  | ||||||
| const informationStatus = ref(false); |  | ||||||
| const filePath = ref<string>(''); |  | ||||||
| const exitList = ref<ConstructionUserExitVO[]>([]); |  | ||||||
| const changeSalary = ref<string>(''); | const changeSalary = ref<string>(''); | ||||||
| const vocationalStatus = ref<number>(null); |  | ||||||
| const fileList = ref<ConstructionUserFileVO[]>([]); | const fileList = ref<ConstructionUserFileVO[]>([]); | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const constructionUserFormRef = ref<ElFormInstance>(); | const constructionUserFormRef = ref<ElFormInstance>(); | ||||||
| @ -241,23 +194,14 @@ const dialog = reactive<DialogOption>({ | |||||||
|   title: '', |   title: '', | ||||||
|   id: undefined |   id: undefined | ||||||
| }); | }); | ||||||
| //人员迁移条件 | const TeamList = ref([]); //班组列表 | ||||||
| const skipObject: skipType = reactive({ |  | ||||||
|   id: '', |  | ||||||
|   projectId: '', |  | ||||||
|   contractorId: '' |  | ||||||
| }); |  | ||||||
| const contractorList = ref<Array<skipTeamType>>([]); |  | ||||||
| //项目列表 |  | ||||||
| const skipOptions = ref<Array<skipOptionType>>([]); |  | ||||||
|  |  | ||||||
| const initFormData: ConstructionUserForm = { | const initFormData: ConstructionUserForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   openid: undefined, |   openid: undefined, | ||||||
|   nickName: undefined, |   nickName: undefined, | ||||||
|   facePic: undefined, |   facePic: undefined, | ||||||
|   userName: undefined, |   userName: undefined, | ||||||
|   projectId: currentProject.value.id, |   projectId: currentProject.value.goId, | ||||||
|   contractorId: undefined, |   contractorId: undefined, | ||||||
|   teamId: undefined, |   teamId: undefined, | ||||||
|   status: undefined, |   status: undefined, | ||||||
| @ -294,7 +238,7 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({ | |||||||
|     openid: undefined, |     openid: undefined, | ||||||
|     nickName: undefined, |     nickName: undefined, | ||||||
|     userName: undefined, |     userName: undefined, | ||||||
|     projectId: currentProject.value.id, |     projectId: currentProject.value.goId, | ||||||
|     contractorId: undefined, |     contractorId: undefined, | ||||||
|     teamId: undefined, |     teamId: undefined, | ||||||
|     status: undefined, |     status: undefined, | ||||||
| @ -378,81 +322,18 @@ const uploadStatusColor = computed(() => (str: string) => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| const { queryParams, form, rules } = toRefs(data); | const { queryParams, form, rules } = toRefs(data); | ||||||
|  |  | ||||||
| //打卡时间下标 |  | ||||||
| const playCardIdx = computed(() => (date) => { |  | ||||||
|   return calendarList.value.findIndex((item) => item.clockDate == date.day); |  | ||||||
| }); |  | ||||||
|  |  | ||||||
| //打卡状态颜色 |  | ||||||
| const playCardColor = computed(() => (date) => { |  | ||||||
|   const idx = calendarList.value[playCardIdx.value(date)]?.status; |  | ||||||
|   switch (idx) { |  | ||||||
|     case '1': |  | ||||||
|       return 'green'; |  | ||||||
|     case '2': |  | ||||||
|       return 'orange'; |  | ||||||
|     case '3': |  | ||||||
|       return 'red'; |  | ||||||
|     case '4': |  | ||||||
|       return 'gray'; |  | ||||||
|     default: |  | ||||||
|       return ''; |  | ||||||
|   } |  | ||||||
| }); |  | ||||||
|  |  | ||||||
| /** 查询施工人员列表 */ | /** 查询施工人员列表 */ | ||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listConstructionUser(queryParams.value); |   const res = await getBusConstructionUser(queryParams.value); | ||||||
|   constructionUserList.value = res.rows; |   constructionUserList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取班组 | ||||||
| /** 查看打卡记录详情 */ | const getTeamList = async () => { | ||||||
| const handleViewPlayCard = async (idx: number, data: any) => { |   const res = await getSysProjectTeamList({ pageNum: 1, pageSize: 1000, projectId: currentProject.value.goId }); | ||||||
|   if (data.type == 'next-month' || data.type == 'prev-month') { |   TeamList.value = res.data.list; | ||||||
|     monthValue.value = data.date; |  | ||||||
|     handleCalendarMonth(monthValue.value); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   const statusColor = calendarList.value[idx]?.status; |  | ||||||
|   if (idx == -1 || statusColor == '4' || statusColor == '3') { |  | ||||||
|     return proxy?.$modal.msgWarning('暂无打卡记录数据'); |  | ||||||
|   } |  | ||||||
|   const { downClockTime, downClockPic, upClockTime, upClockPic } = calendarList.value[idx]?.clockList; |  | ||||||
|   ElNotification({ |  | ||||||
|     title: '温馨提示', |  | ||||||
|     dangerouslyUseHTMLString: true, |  | ||||||
|     message: `<div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px"> |  | ||||||
|   						<span>头像:</span> |  | ||||||
|   						<div style="width: 50px;height: 50px;border-radius:15px;"> |  | ||||||
|   							<img src="${upClockPic}" style="width: 100%;height: 100%;border-radius:15px;"> |  | ||||||
|   						</div> |  | ||||||
|   					</div><span>上班打卡时间:${upClockTime ? upClockTime : ''}</span><div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px"> |  | ||||||
|   						<span>头像:</span> |  | ||||||
|   						<div style="width: 50px;height: 50px;border-radius:15px;"> |  | ||||||
|   							<img src="${downClockPic}" style="width: 100%;height: 100%;border-radius:15px;"> |  | ||||||
|   						</div> |  | ||||||
|   					</div><span>下班打卡时间:${downClockTime ? downClockTime : ''}</span>` |  | ||||||
|   }); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| const selectProject = (e: any) => { |  | ||||||
|   //选中项目筛选出项目下的分包单位并清空分包单位value |  | ||||||
|   contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList; |  | ||||||
|   skipObject.contractorId = ''; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| const setUnits = async () => { |  | ||||||
|   //人员迁移 |  | ||||||
|   let res = await transferConstructionUser(skipObject); |  | ||||||
|   if (res.code == 200) { |  | ||||||
|     ElMessage.success(res.msg); |  | ||||||
|     skip.value = false; |  | ||||||
|     getList(); |  | ||||||
|   } |  | ||||||
| }; | }; | ||||||
| const contractorOpt = ref(); | const contractorOpt = ref(); | ||||||
|  |  | ||||||
| @ -488,38 +369,7 @@ const handleCalendarMonth = async (e?) => { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 上传安全协议书按钮操作 */ | /** 上传安全协议书按钮操作 */ | ||||||
|  | const updateProjectFile = async () => {}; | ||||||
| const updateProjectFile = async () => { |  | ||||||
|   buttonLoading.value = true; |  | ||||||
|   let fileList = uploadPath.value.map((item) => { |  | ||||||
|     return { |  | ||||||
|       fileId: item.path, |  | ||||||
|       fileType: item.fileType |  | ||||||
|     }; |  | ||||||
|   }); |  | ||||||
|   const data = { |  | ||||||
|     userId: currentUserId.value, |  | ||||||
|     fileList |  | ||||||
|   }; |  | ||||||
|   console.log('🚀 ~ updateProjectFile ~ data:', data); |  | ||||||
|   await setConstructionUserFile(data); |  | ||||||
|   proxy?.$modal.msgSuccess('上传成功'); |  | ||||||
|   buttonLoading.value = false; |  | ||||||
|   fileStatus.value = false; |  | ||||||
|   await getList(); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| const getTeamName = computed(() => (teamId: string | number) => { |  | ||||||
|   const team = Array.isArray(ProjectTeam.value) ? ProjectTeam.value.find((item: any) => item.value === teamId) : null; |  | ||||||
|   return team ? team.label : teamId; |  | ||||||
| }); |  | ||||||
|  |  | ||||||
| /** 取消按钮 */ |  | ||||||
| const cancel = () => { |  | ||||||
|   reset(); |  | ||||||
|   dialog.visible = false; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| /** 表单重置 */ | /** 表单重置 */ | ||||||
| const reset = () => { | const reset = () => { | ||||||
|   form.value = { ...initFormData }; |   form.value = { ...initFormData }; | ||||||
| @ -581,48 +431,6 @@ const handlePlayCard = async (row: ConstructionUserVO) => { | |||||||
|   playCardCalendar.value = true; |   playCardCalendar.value = true; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| //下载模板 |  | ||||||
| const downloadTemplate = async () => { |  | ||||||
|   const loadingInstance = ElLoadingService({ |  | ||||||
|     lock: true, |  | ||||||
|     text: 'Loading', |  | ||||||
|     background: 'rgba(0, 0, 0, 0.7)' |  | ||||||
|   }); |  | ||||||
|   const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id }); |  | ||||||
|   loadingInstance.close(); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //导入资料 |  | ||||||
| const importInformation = async () => {}; |  | ||||||
|  |  | ||||||
| /** 人员迁移 */ |  | ||||||
| const handleChange = async (row: ConstructionUserVO) => { |  | ||||||
|   const _id = row?.id || ids.value[0]; |  | ||||||
|   skipName.value = row?.userName; |  | ||||||
|   skipObject.id = _id; |  | ||||||
|   const res = await getProjectContractorList(); |  | ||||||
|   skipOptions.value = res.data; |  | ||||||
|   skip.value = true; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| // //切换人脸 |  | ||||||
| // const handleToggle = async (row: ConstructionUserVO) => { |  | ||||||
| //   reset(); |  | ||||||
| //   skipName.value = row?.userName; |  | ||||||
| //   const _id = row?.id || ids.value[0]; |  | ||||||
| //   const res = await getConstructionUser(_id); |  | ||||||
| //   Object.assign(form.value, res.data); |  | ||||||
| //   showFaceDrawer.value = true; |  | ||||||
| // }; |  | ||||||
|  |  | ||||||
| const handleExit = async (row: ConstructionUserVO) => { |  | ||||||
|   const _id = row?.id || ids.value[0]; |  | ||||||
|   currentUserId.value = _id; |  | ||||||
|   const res = await getConstructionUserExit({ userId: _id }); |  | ||||||
|   exitList.value = res.rows; |  | ||||||
|   exitStatus.value = true; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //上传按钮 | //上传按钮 | ||||||
| const handleUpload = async (row: ConstructionUserVO) => { | const handleUpload = async (row: ConstructionUserVO) => { | ||||||
|   const _id = row?.id || ids.value[0]; |   const _id = row?.id || ids.value[0]; | ||||||
| @ -653,74 +461,6 @@ const submitForm = () => { | |||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 加入黑名单按钮操作 */ |  | ||||||
| const handleJoinBlacklist = async (row?: ConstructionUserVO) => { |  | ||||||
|   await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false)); |  | ||||||
|   await addConstructionBlacklist({ |  | ||||||
|     userId: row.id, |  | ||||||
|     projectId: currentProject.value.id |  | ||||||
|   }); |  | ||||||
|   proxy?.$modal.msgSuccess('加入成功'); |  | ||||||
|   await getList(); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| /** 删除按钮操作 */ |  | ||||||
| const handleDelete = async (row?: ConstructionUserVO) => { |  | ||||||
|   const _ids = row?.id || ids.value; |  | ||||||
|   await proxy?.$modal.confirm('是否确认删除施工人员编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); |  | ||||||
|   await delConstructionUser(_ids); |  | ||||||
|   proxy?.$modal.msgSuccess('删除成功'); |  | ||||||
|   await getList(); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| /** 导出按钮操作 */ |  | ||||||
| const handleExport = () => { |  | ||||||
|   proxy?.download( |  | ||||||
|     'project/constructionUser/export', |  | ||||||
|     { |  | ||||||
|       ...queryParams.value |  | ||||||
|     }, |  | ||||||
|     `constructionUser_${new Date().getTime()}.xlsx` |  | ||||||
|   ); |  | ||||||
| }; |  | ||||||
| /** 用户状态编辑操作 */ |  | ||||||
| const handleEdit = async () => { |  | ||||||
|   if (!vocationalStatus.value) { |  | ||||||
|     proxy?.$modal.msgError('请选择状态'); |  | ||||||
|     return; |  | ||||||
|   } |  | ||||||
|   const data = { |  | ||||||
|     idList: ids.value, |  | ||||||
|     status: vocationalStatus.value |  | ||||||
|   }; |  | ||||||
|   await updateConstructionUserStatus(data); |  | ||||||
|   proxy?.$modal.msgSuccess('修改成功'); |  | ||||||
|   getList(); |  | ||||||
|   ids.value = []; |  | ||||||
|   statusDialog.value = false; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //打开修改日薪 |  | ||||||
| const openSalaryDialog = (row: ConstructionUserVO) => { |  | ||||||
|   const _id = row?.id || ids.value[0]; |  | ||||||
|   currentUserId.value = _id; |  | ||||||
|   if (row.salary) { |  | ||||||
|     setSalary(); |  | ||||||
|     return; |  | ||||||
|   } |  | ||||||
|   console.log(row); |  | ||||||
|   salaryStatus.value = true; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //变更日薪 |  | ||||||
| const handleSalary = async () => { |  | ||||||
|   if (!changeSalary.value) { |  | ||||||
|     proxy?.$modal.msgError('请输入薪资'); |  | ||||||
|     return; |  | ||||||
|   } |  | ||||||
|   setSalary(); |  | ||||||
| }; |  | ||||||
| const setSalary = async () => { | const setSalary = async () => { | ||||||
|   await updateConstructionUserSalary({ id: currentUserId.value, salary: changeSalary.value }); |   await updateConstructionUserSalary({ id: currentUserId.value, salary: changeSalary.value }); | ||||||
|   proxy?.$modal.msgSuccess('修改成功'); |   proxy?.$modal.msgSuccess('修改成功'); | ||||||
| @ -728,29 +468,9 @@ const setSalary = async () => { | |||||||
|   changeSalary.value = ''; |   changeSalary.value = ''; | ||||||
|   salaryStatus.value = false; |   salaryStatus.value = false; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| // 批量切换在职状态 |  | ||||||
| const handlePlayCardStatus = async (e) => { |  | ||||||
|   playCardLoding.value = true; |  | ||||||
|   const clock = e ? 1 : 0; |  | ||||||
|   await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock }); |  | ||||||
|   proxy?.$modal.msgSuccess('修改成功'); |  | ||||||
|   getList(); |  | ||||||
|   playCardLoding.value = false; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| // 切换在职状态 |  | ||||||
| const handleClockStatus = async (row: ConstructionUserVO) => { |  | ||||||
|   playCardLoding.value = true; |  | ||||||
|   await updateConstructionUserPlayCardOneStatus({ id: row.id, clock: row.clock }); |  | ||||||
|   proxy?.$modal.msgSuccess('修改成功'); |  | ||||||
|   getList(); |  | ||||||
|   playCardLoding.value = false; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
| @ -763,6 +483,7 @@ onUnmounted(() => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   getContractorList(); |   getContractorList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -4,30 +4,15 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="申请人" prop="userName"> |             <el-form-item label="申请人" prop="name"> | ||||||
|               <el-input v-model="queryParams.userName" placeholder="请输入申请人" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.name" placeholder="请输入申请人" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="补卡类型" prop="reissueCardType"> |  | ||||||
|               <el-select v-model="queryParams.reissueCardType" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in commuter_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="所属班组" prop="reissueCardType"> |             <el-form-item label="所属班组" prop="reissueCardType"> | ||||||
|               <el-select v-model="queryParams.teamId" placeholder="全部" clearable> |               <el-select v-model="queryParams.teamId" clearable placeholder="全部"> | ||||||
|                 <el-option v-for="dict in ProjectTeam" :key="dict.value" :label="dict.label" :value="dict.value" /> |                  <el-option label="全部" value="" /> | ||||||
|  |                 <el-option v-for="item in TeamList" :key="item.id" :label="item.name" :value="item.id" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="班组长意见" prop="gangerOpinion" label-width="100px"> |  | ||||||
|               <el-select v-model="queryParams.gangerOpinion" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in user_opinion_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="管理员意见" prop="managerOpinion" label-width="100px"> |  | ||||||
|               <el-select v-model="queryParams.managerOpinion" placeholder="全部" clearable> |  | ||||||
|                 <el-option v-for="dict in user_opinion_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> |  | ||||||
|  |  | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -38,75 +23,39 @@ | |||||||
|     </transition> |     </transition> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <el-table v-loading="loading" :data="reissueCardList"> |       <el-table v-loading="loading" :data="reissueCardList" height="60vh"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" align="center" width="55" type="index" /> |         <el-table-column label="序号" align="center" width="55" type="index" /> | ||||||
|         <el-table-column label="申请人" align="center" prop="userName" /> |         <el-table-column label="申请人" align="center" prop="userName" /> | ||||||
|         <el-table-column label="申请补卡说明" align="center" prop="userExplain" /> |         <el-table-column label="申请补卡说明" align="center" prop="explain" /> | ||||||
|         <el-table-column label="所属班组" align="center" prop="teamName" /> |         <el-table-column label="所属班组" align="center" prop="teamName" /> | ||||||
|         <el-table-column label="状态" align="center" prop="status"> |         <el-table-column label="状态" align="center" prop="status"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="user_review_status_type" :value="scope.row.status" /> |             <dict-tag :options="user_review_status_type" :value="scope.row.status" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <!-- <el-table-column label="班组长意见" align="center" prop="gangerOpinion"> |         <el-table-column label="班组长意见" align="center" prop="gangerOpinion"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="user_opinion_type" :value="scope.row.gangerOpinion" /> |             <dict-tag :options="user_opinion_type" :value="scope.row.gangerOpinion" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="班组长说明" align="center" prop="gangerExplain" /> |         <el-table-column label="班组长说明" align="center" prop="gangerExplain" /> | ||||||
|         <el-table-column label="班组长操作时间" align="center" prop="gangerTime" width="180"> |         <el-table-column label="班组长操作时间" align="center" prop="gangerTime" width="180"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.gangerTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="管理员意见" align="center" prop="managerOpinion"> |         <el-table-column label="管理员意见" align="center" prop="managerOpinion"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="user_opinion_type" :value="scope.row.managerOpinion" /> |             <dict-tag :options="user_opinion_type" :value="scope.row.managerOpinion" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="管理员说明" align="center" prop="managerExplain" /> |         <el-table-column label="管理员说明" align="center" prop="managerExplain" /> | ||||||
|         <el-table-column label="补卡申请时间" align="center" prop="userTime" width="180"> |         <el-table-column label="补卡申请时间" align="center" prop="createdAt" width="180"> </el-table-column> | ||||||
|  |         <el-table-column label="状态" align="center" prop="status"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.userTime, '{y}-{m}-{d}') }}</span> |             <dict-tag :options="user_review_status_type" :value="scope.row.cardNumber" /> | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|  |  | ||||||
|         <el-table-column label="管理员操作时间" align="center" prop="managerTime" width="180"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.managerTime, '{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-button link type="success" icon="View" @click="handleDetail(scope.row)">详情</el-button> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <el-dialog title="修改施工人员补卡申请" v-model="dialog.visible" width="400px"> |  | ||||||
|       <div class="pl-xl"> |  | ||||||
|         <el-form-item label="是否同意"> |  | ||||||
|           <el-radio-group v-model="auditForm.managerOpinion"> |  | ||||||
|             <el-radio value="2" size="small">同意</el-radio> |  | ||||||
|             <el-radio value="3" size="small">拒绝</el-radio> |  | ||||||
|           </el-radio-group> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="拒绝说明" v-if="auditForm.managerOpinion == '3'"> |  | ||||||
|           <el-input v-model="auditForm.managerExplain" placeholder="请输入拒绝说明" type="textarea" clearable></el-input> |  | ||||||
|         </el-form-item> |  | ||||||
|       </div> |  | ||||||
|  |  | ||||||
|       <template #footer> |  | ||||||
|         <span> |  | ||||||
|           <el-button type="primary" @click="submitAudit">确定</el-button> |  | ||||||
|           <el-button @click="dialog.visible = false">取消</el-button> |  | ||||||
|         </span> |  | ||||||
|       </template> |  | ||||||
|     </el-dialog> |  | ||||||
|     <el-dialog :title="detailObj.userName + '补卡申请详情'" v-model="dialog.details" width="700px" append-to-body> |     <el-dialog :title="detailObj.userName + '补卡申请详情'" v-model="dialog.details" width="700px" append-to-body> | ||||||
|       <div class="block_box"> |       <div class="block_box"> | ||||||
|         <span>补卡申请</span> |         <span>补卡申请</span> | ||||||
| @ -173,15 +122,13 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup name="ReissueCard" lang="ts"> | <script setup name="ReissueCard" lang="ts"> | ||||||
| import { listProjectTeam } from '@/api/project/projectTeam'; | import { AuditReissueCard } from '@/api/project/reissueCard'; | ||||||
| import { ProjectTeamVO } from '@/api/project/projectTeam/types'; |  | ||||||
| import { listReissueCard, getReissueCard, delReissueCard, addReissueCard, updateReissueCard, AuditReissueCard } from '@/api/project/reissueCard'; |  | ||||||
| import { ReissueCardVO, ReissueCardQuery, ReissueCardForm, AuditReissueCardForm } from '@/api/project/reissueCard/types'; | import { ReissueCardVO, ReissueCardQuery, ReissueCardForm, AuditReissueCardForm } from '@/api/project/reissueCard/types'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { commuter_type, user_opinion_type, user_review_status_type } = toRefs<any>( | const { user_opinion_type, user_review_status_type } = toRefs<any>(proxy?.useDict('commuter_type', 'user_opinion_type', 'user_review_status_type')); | ||||||
|   proxy?.useDict('commuter_type', 'user_opinion_type', 'user_review_status_type') | import { busReissueACardList, getSysProjectTeamList } from '@/api/project/goUser/index'; | ||||||
| ); |  | ||||||
| const detailObj = ref<ReissueCardVO>({ | const detailObj = ref<ReissueCardVO>({ | ||||||
|   userName: undefined, |   userName: undefined, | ||||||
|   id: undefined, |   id: undefined, | ||||||
| @ -199,15 +146,10 @@ const detailObj = ref<ReissueCardVO>({ | |||||||
|   managerName: undefined |   managerName: undefined | ||||||
| }); | }); | ||||||
| const reissueCardList = ref<ReissueCardVO[]>([]); | const reissueCardList = ref<ReissueCardVO[]>([]); | ||||||
| const buttonLoading = ref(false); |  | ||||||
| const loading = ref(true); | const loading = ref(true); | ||||||
| const showSearch = 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 total = ref(0); | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const reissueCardFormRef = ref<ElFormInstance>(); |  | ||||||
| const auditForm = reactive<AuditReissueCardForm>({ | const auditForm = reactive<AuditReissueCardForm>({ | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   managerOpinion: '2', |   managerOpinion: '2', | ||||||
| @ -222,7 +164,6 @@ const dialog = reactive<DialogOption>({ | |||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const ProjectTeam = computed(() => proxy?.$cache.local.getJSON('ProjectTeamList') || []); |  | ||||||
|  |  | ||||||
| const initFormData: ReissueCardForm = { | const initFormData: ReissueCardForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
| @ -233,7 +174,7 @@ const initFormData: ReissueCardForm = { | |||||||
|   gangerExplain: undefined, |   gangerExplain: undefined, | ||||||
|   managerOpinion: undefined, |   managerOpinion: undefined, | ||||||
|   managerExplain: undefined, |   managerExplain: undefined, | ||||||
|   projectId: currentProject.value?.id, |   projectId: currentProject.value?.goId, | ||||||
|   attendanceId: undefined, |   attendanceId: undefined, | ||||||
|   remark: undefined |   remark: undefined | ||||||
| }; | }; | ||||||
| @ -242,10 +183,10 @@ const data = reactive<PageData<ReissueCardForm, ReissueCardQuery>>({ | |||||||
|   queryParams: { |   queryParams: { | ||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     userName: undefined, |     name: undefined, | ||||||
|     gangerOpinion: undefined, |     gangerOpinion: undefined, | ||||||
|     managerOpinion: undefined, |     managerOpinion: undefined, | ||||||
|     projectId: currentProject.value?.id, |     projectId: currentProject.value?.goId, | ||||||
|     teamId: undefined, |     teamId: undefined, | ||||||
|     reissueCardType: undefined, |     reissueCardType: undefined, | ||||||
|     params: {} |     params: {} | ||||||
| @ -260,7 +201,7 @@ const data = reactive<PageData<ReissueCardForm, ReissueCardQuery>>({ | |||||||
|     attendanceId: [{ required: true, message: '考勤表主键id不能为空', trigger: 'blur' }] |     attendanceId: [{ required: true, message: '考勤表主键id不能为空', trigger: 'blur' }] | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
|  | const TeamList = ref([]); //班组列表 | ||||||
| const { queryParams, form, rules } = toRefs(data); | const { queryParams, form, rules } = toRefs(data); | ||||||
|  |  | ||||||
| //审核进度 | //审核进度 | ||||||
| @ -276,6 +217,7 @@ const auditStatus = computed(() => { | |||||||
|   return false; |   return false; | ||||||
| }); | }); | ||||||
| //管理员审核状态 | //管理员审核状态 | ||||||
|  | // eslint-disable-next-line vue/return-in-computed-property | ||||||
| const managerStatus = computed(() => { | const managerStatus = computed(() => { | ||||||
|   switch (detailObj.value.managerOpinion) { |   switch (detailObj.value.managerOpinion) { | ||||||
|     case '1': |     case '1': | ||||||
| @ -287,6 +229,7 @@ const managerStatus = computed(() => { | |||||||
|   } |   } | ||||||
| }); | }); | ||||||
| //班组审核状态 | //班组审核状态 | ||||||
|  | // eslint-disable-next-line vue/return-in-computed-property | ||||||
| const teamStatus = computed(() => { | const teamStatus = computed(() => { | ||||||
|   switch (detailObj.value.gangerOpinion) { |   switch (detailObj.value.gangerOpinion) { | ||||||
|     case '1': |     case '1': | ||||||
| @ -307,12 +250,16 @@ const resultsStatus = computed(() => { | |||||||
| /** 查询施工人员补卡申请列表 */ | /** 查询施工人员补卡申请列表 */ | ||||||
| async function getList() { | async function getList() { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listReissueCard(queryParams.value); |   const res = await busReissueACardList(queryParams.value); | ||||||
|   reissueCardList.value = res.rows; |   reissueCardList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| } | } | ||||||
|  | // 获取班组 | ||||||
|  | const getTeamList = async () => { | ||||||
|  |   const res = await getSysProjectTeamList({ pageNum: 1, pageSize: 1000, projectId: currentProject.value.goId }); | ||||||
|  |   TeamList.value = res.data.list; | ||||||
|  | }; | ||||||
| /** 表单重置 */ | /** 表单重置 */ | ||||||
| const reset = () => { | const reset = () => { | ||||||
|   auditForm.managerExplain = ''; |   auditForm.managerExplain = ''; | ||||||
| @ -331,22 +278,6 @@ const resetQuery = () => { | |||||||
|   handleQuery(); |   handleQuery(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 新增按钮操作 */ |  | ||||||
| const handleAdd = () => { |  | ||||||
|   reset(); |  | ||||||
|   dialog.visible = true; |  | ||||||
|   dialog.title = '添加施工人员补卡申请'; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| /** 审批按钮操作 */ |  | ||||||
| const handleUpdate = async (row?: ReissueCardVO) => { |  | ||||||
|   reset(); |  | ||||||
|   const _id = row?.id || ids.value[0]; |  | ||||||
|   auditForm.id = _id; |  | ||||||
|   dialog.visible = true; |  | ||||||
|   dialog.title = '修改施工人员补卡申请'; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| const handleDetail = (row: ReissueCardVO) => { | const handleDetail = (row: ReissueCardVO) => { | ||||||
|   detailObj.value = row; |   detailObj.value = row; | ||||||
|   dialog.details = true; |   dialog.details = true; | ||||||
| @ -364,11 +295,12 @@ const submitAudit = async () => { | |||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|     getList(); |     getList(); | ||||||
|  |     getTeamList(); | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
|  |  | ||||||
| @ -377,6 +309,7 @@ onUnmounted(() => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getTeamList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -4,22 +4,19 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="类别" prop="recordCategory"> |             <el-form-item label="类别" prop="tourCategory"> | ||||||
|               <el-select v-model="queryParams.recordCategory" placeholder="请选择类别" clearable> |               <el-select v-model="queryParams.tourCategory" placeholder="请选择类别" clearable> | ||||||
|                 <el-option v-for="dict in recordCategoryType" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option v-for="dict in recordCategoryType" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="类型" prop="violationType"> |             <el-form-item label="违章类型" prop="tourType"> | ||||||
|               <el-select v-model="queryParams.violationType" placeholder="请选择违章类型" clearable> |               <el-select v-model="queryParams.tourType" placeholder="全部" clearable> | ||||||
|                 <el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="故障描述" prop="description"> |             <!-- <el-form-item label="故障描述" prop="describe"> | ||||||
|               <el-input v-model="queryParams.description" placeholder="请输入故障描述" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.describe" placeholder="请输入故障描述" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> --> | ||||||
|             <el-form-item label="创建时间" prop="createTime"> |  | ||||||
|               <el-date-picker clearable v-model="queryParams.createTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择创建时间" /> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -32,16 +29,15 @@ | |||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <el-table v-loading="loading" :data="recognizeRecordList" @selection-change="handleSelectionChange"> |       <el-table v-loading="loading" :data="recognizeRecordList" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="主键id" align="center" prop="id" v-if="false" /> |         <el-table-column label="设备名称" align="center" prop="sxtName" /> | ||||||
|         <el-table-column label="设备名称" align="center" prop="deviceName" /> |  | ||||||
|         <el-table-column label="识别类别" align="center" prop="recordCategory"> |         <el-table-column label="识别类别" align="center" prop="recordCategory"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             {{ scope.row.recordCategory === '1' ? '无人机识别' : '监控拍摄' }} |             {{ scope.row.recordCategory === '1' ? '无人机识别' : '监控拍摄' }} | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="违章类型" align="center" prop="violationType"> |         <el-table-column label="违章类型" align="center"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="violation_level_type" :value="scope.row.violationType" /> |             <span>{{ filterRiskTourType(scope.row.tourType) }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="图片路径" align="center" prop="picture" width="100"> |         <el-table-column label="图片路径" align="center" prop="picture" width="100"> | ||||||
| @ -49,60 +45,11 @@ | |||||||
|             <image-preview :src="scope.row.picture" :width="50" :height="50" /> |             <image-preview :src="scope.row.picture" :width="50" :height="50" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="故障描述" align="center" prop="description" /> |         <el-table-column label="故障描述" align="center" prop="describe" /> | ||||||
|         <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |         <el-table-column label="创建时间" align="center" prop="createdAt" width="180"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:recognizeRecord:remove']" |  | ||||||
|               >删除</el-button |  | ||||||
|             > |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <!-- 添加或修改识别记录对话框 --> |  | ||||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |  | ||||||
|       <el-form ref="recognizeRecordFormRef" :model="form" :rules="rules" label-width="80px"> |  | ||||||
|         <el-form-item label="项目id" prop="projectId"> |  | ||||||
|           <el-input v-model="form.projectId" placeholder="请输入项目id" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="设备序列号" prop="deviceSerial"> |  | ||||||
|           <el-input v-model="form.deviceSerial" placeholder="请输入设备序列号" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="设备名称" prop="deviceName"> |  | ||||||
|           <el-input v-model="form.deviceName" placeholder="请输入设备名称" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="违章类型" prop="violationType"> |  | ||||||
|           <el-select v-model="form.violationType" placeholder="请选择违章类型"> |  | ||||||
|             <el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> |  | ||||||
|           </el-select> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="图片路径" prop="picture"> |  | ||||||
|           <image-upload v-model="form.picture" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="违规数量" prop="num"> |  | ||||||
|           <el-input v-model="form.num" placeholder="请输入违规数量" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="故障描述" prop="description"> |  | ||||||
|           <el-input v-model="form.description" type="textarea" placeholder="请输入内容" /> |  | ||||||
|         </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> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| @ -110,6 +57,7 @@ | |||||||
| import { listRecognizeRecord, getRecognizeRecord, delRecognizeRecord, addRecognizeRecord, updateRecognizeRecord } from '@/api/safety/recognizeRecord'; | import { listRecognizeRecord, getRecognizeRecord, delRecognizeRecord, addRecognizeRecord, updateRecognizeRecord } from '@/api/safety/recognizeRecord'; | ||||||
| import { RecognizeRecordVO, RecognizeRecordQuery, RecognizeRecordForm } from '@/api/safety/recognizeRecord/types'; | import { RecognizeRecordVO, RecognizeRecordQuery, RecognizeRecordForm } from '@/api/safety/recognizeRecord/types'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
|  | import { getDictData } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { violation_level_type } = toRefs<any>(proxy?.useDict('violation_level_type')); | const { violation_level_type } = toRefs<any>(proxy?.useDict('violation_level_type')); | ||||||
| @ -132,7 +80,7 @@ const recognizeRecordFormRef = ref<ElFormInstance>(); | |||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
|  | const safety_inspection_violation_type = ref([]); // 违章类型 | ||||||
| const dialog = reactive<DialogOption>({ | const dialog = reactive<DialogOption>({ | ||||||
|   visible: false, |   visible: false, | ||||||
|   title: '' |   title: '' | ||||||
| @ -140,7 +88,7 @@ const dialog = reactive<DialogOption>({ | |||||||
|  |  | ||||||
| const initFormData: RecognizeRecordForm = { | const initFormData: RecognizeRecordForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   projectId: undefined, |   projectId: currentProject.value.goId, | ||||||
|   deviceSerial: undefined, |   deviceSerial: undefined, | ||||||
|   deviceName: undefined, |   deviceName: undefined, | ||||||
|   recordCategory: undefined, |   recordCategory: undefined, | ||||||
| @ -155,7 +103,7 @@ const data = reactive<PageData<RecognizeRecordForm, RecognizeRecordQuery>>({ | |||||||
|   queryParams: { |   queryParams: { | ||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     projectId: undefined, |     projectId: currentProject.value.goId, | ||||||
|     deviceName: undefined, |     deviceName: undefined, | ||||||
|     recordCategory: undefined, |     recordCategory: undefined, | ||||||
|     violationType: undefined, |     violationType: undefined, | ||||||
| @ -174,11 +122,15 @@ const { queryParams, form, rules } = toRefs(data); | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listRecognizeRecord(queryParams.value); |   const res = await listRecognizeRecord(queryParams.value); | ||||||
|   recognizeRecordList.value = res.rows; |   recognizeRecordList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取字典 | ||||||
|  | const getDictDataList = async () => { | ||||||
|  |   const res1 = await getDictData('tour_type'); | ||||||
|  |   safety_inspection_violation_type.value = res1.data.values; | ||||||
|  | }; | ||||||
| /** 取消按钮 */ | /** 取消按钮 */ | ||||||
| const cancel = () => { | const cancel = () => { | ||||||
|   reset(); |   reset(); | ||||||
| @ -243,7 +195,17 @@ const submitForm = () => { | |||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | const filterRiskTourType = (val: any) => { | ||||||
|  |   let label = ''; | ||||||
|  |   if (val) { | ||||||
|  |     safety_inspection_violation_type.value.forEach((item: any) => { | ||||||
|  |       if (val == item.key) { | ||||||
|  |         label = item.value; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |   return label; | ||||||
|  | }; | ||||||
| /** 删除按钮操作 */ | /** 删除按钮操作 */ | ||||||
| const handleDelete = async (row?: RecognizeRecordVO) => { | const handleDelete = async (row?: RecognizeRecordVO) => { | ||||||
|   const _ids = row?.id || ids.value; |   const _ids = row?.id || ids.value; | ||||||
| @ -265,14 +227,16 @@ const handleExport = () => { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getDictDataList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|  |     getDictDataList(); | ||||||
|     getList(); |     getList(); | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -5,8 +5,8 @@ | |||||||
|       <div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div> |       <div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div> | ||||||
|       <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> |       <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> | ||||||
|       <el-row> |       <el-row> | ||||||
|         <el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col> |         <el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.fill }}</el-col> | ||||||
|         <el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col> |         <el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createdAt }}</el-col> | ||||||
|       </el-row> |       </el-row> | ||||||
|       <el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large"> |       <el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large"> | ||||||
|         <el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item> |         <el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item> | ||||||
| @ -19,7 +19,7 @@ | |||||||
|         <el-descriptions-item label-align="center" label="检查时间" class-name="zebra">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item> |         <el-descriptions-item label-align="center" label="检查时间" class-name="zebra">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item> |         <el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="整改人" label-class-name="white" |         <el-descriptions-item label-align="center" label="整改人" label-class-name="white" | ||||||
|           >{{ safetyInspectionDetail?.correctorName }} |           >{{ safetyInspectionDetail?.abarbeitung }} | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white"> |         <el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white"> | ||||||
|           {{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }} |           {{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }} | ||||||
| @ -67,9 +67,9 @@ | |||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white"> |         <el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white"> | ||||||
|           <el-space wrap> |           <el-space wrap> | ||||||
|             <div v-for="item in rectificationFileList" :key="item.ossId"> |             <div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.id"> | ||||||
|               <span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)"> |               <span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)"> | ||||||
|                 <image-preview :src="item.url" width="200px" /> |                 <image-preview :src="item.path" width="200px" /> | ||||||
|               </span> |               </span> | ||||||
|               <span v-else> |               <span v-else> | ||||||
|                 <el-link :href="`${item.url}`" :underline="false" target="_blank"> |                 <el-link :href="`${item.url}`" :underline="false" target="_blank"> | ||||||
| @ -84,9 +84,7 @@ | |||||||
|         <el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item> |         <el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item> | ||||||
|       </el-descriptions> |       </el-descriptions> | ||||||
|       <el-descriptions :column="2" border label-width="160px" size="large"> |       <el-descriptions :column="2" border label-width="160px" size="large"> | ||||||
|         <el-descriptions-item label-align="center" label="复查人" label-class-name="white" |         <el-descriptions-item label-align="center" label="复查人" label-class-name="white">{{ safetyInspectionDetail?.fill }} </el-descriptions-item> | ||||||
|           >{{ safetyInspectionDetail?.creatorName }} |  | ||||||
|         </el-descriptions-item> |  | ||||||
|         <el-descriptions-item label-align="center" label="复查日期" label-class-name="white" |         <el-descriptions-item label-align="center" label="复查日期" label-class-name="white" | ||||||
|           >{{ safetyInspectionDetail?.reviewTime }} |           >{{ safetyInspectionDetail?.reviewTime }} | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
| @ -103,10 +101,10 @@ | |||||||
|       <img src="../../../../assets/icons/svg/derived.png" /> |       <img src="../../../../assets/icons/svg/derived.png" /> | ||||||
|       <span>导出</span> |       <span>导出</span> | ||||||
|     </div> |     </div> | ||||||
|     <div class="btn-item" v-print="'#printMe'"> |     <!-- <div class="btn-item" v-print="'#printMe'"> | ||||||
|       <img src="../../../../assets/icons/svg/print.png" /> |       <img src="../../../../assets/icons/svg/print.png" /> | ||||||
|       <span>打印</span> |       <span>打印</span> | ||||||
|     </div> |     </div> --> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| @ -132,7 +130,7 @@ const userStore = useUserStoreHook(); | |||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const props = defineProps<Props>(); | const props = defineProps<Props>(); | ||||||
| const loading = ref<boolean>(false); | const loading = ref<boolean>(false); | ||||||
| const safetyInspectionDetail = ref<SafetyInspectionVO>(); | const safetyInspectionDetail = ref({ checkAttachment: [] }); | ||||||
| const checkFileList = ref<OssVO[]>(); | const checkFileList = ref<OssVO[]>(); | ||||||
| const rectificationFileList = ref<OssVO[]>(); | const rectificationFileList = ref<OssVO[]>(); | ||||||
| //检查状态图片 | //检查状态图片 | ||||||
| @ -148,17 +146,9 @@ const inspectionType = computed(() => { | |||||||
|  |  | ||||||
| const get = async () => { | const get = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await getSafetyInspection(props.safetyInspectionId); |   const res = await getSafetyInspection({ id: props.safetyInspectionId }); | ||||||
|   if (res.data && res.code === 200) { |   if (res.data && res.code === 0) { | ||||||
|     safetyInspectionDetail.value = res.data; |     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; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -4,19 +4,14 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="检查类型" prop="checkType"> |             <el-form-item label="检查类型" prop="studyType"> | ||||||
|               <el-select v-model="queryParams.checkType" placeholder="全部" clearable> |               <el-select v-model="queryParams.studyType" placeholder="全部" clearable> | ||||||
|                 <el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |                 <el-option v-for="dict in safety_inspection_check_type" :key="dict.key" :label="dict.value" :value="dict.key" /> | ||||||
|               </el-select> |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="违章类型" prop="violationType"> |             <el-form-item label="违章类型" prop="violationType"> | ||||||
|               <el-select v-model="queryParams.violationType" placeholder="全部" clearable> |               <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-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" /> | ||||||
|               </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-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
| @ -29,45 +24,32 @@ | |||||||
|     </transition> |     </transition> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <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 v-loading="loading" :data="safetyInspectionList" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> |         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||||
|         <el-table-column label="处理状态" align="center" prop="status"> |         <el-table-column label="处理状态" align="center" prop="status" min-width="100px"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="safety_inspection_type" :value="scope.row.status" /> |             <template v-if="scope.row.isReply == 1"> | ||||||
|           </template> |               <el-tag type="primary" v-if="scope.row.status && scope.row.status == 1">通知</el-tag> | ||||||
|         </el-table-column> |               <el-tag type="warning" v-if="scope.row.status && scope.row.status == 2">整改</el-tag> | ||||||
|         <el-table-column label="检查人" align="center" prop="correctorName" /> |               <el-tag type="success" v-if="scope.row.status && scope.row.status == 3 && scope.row.reviewType == 1">通过</el-tag> | ||||||
|         <el-table-column label="检查时间" align="center" prop="rectificationDeadline" width="180"> |               <el-tag type="danger" v-if="scope.row.status && scope.row.status == 3 && scope.row.reviewType == 2">未通过</el-tag> | ||||||
|           <template #default="scope"> |             </template> | ||||||
|             <span>{{ parseTime(scope.row.rectificationDeadline, '{y}-{m}-{d}') }}</span> |             <template v-if="scope.row.isReply == 2"> | ||||||
|  |               <el-tag type="success">通过</el-tag> | ||||||
|  |             </template> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|  |         <el-table-column label="检查人" align="center" prop="fill" /> | ||||||
|  |         <el-table-column label="检查时间" align="center" prop="checkTime" width="180"> </el-table-column> | ||||||
|         <el-table-column label="检查类型" align="center" prop="checkType"> |         <el-table-column label="检查类型" align="center" prop="checkType"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="safety_inspection_check_type" :value="scope.row.checkType" /> |             <span>{{ filterType(scope.row.studyType) }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="违章类型" align="center" prop="violationType"> |         <el-table-column label="违章类型" align="center" prop="violationType"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="safety_inspection_violation_type" :value="scope.row.violationType" /> |             <span>{{ filterTypeS(scope.row.violationType) }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="巡检结果" align="center" prop="inspectionResult"> |         <el-table-column label="巡检结果" align="center" prop="inspectionResult"> | ||||||
| @ -82,28 +64,22 @@ | |||||||
|             </el-tooltip> |             </el-tooltip> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="整改人" align="center" prop="correctorName" /> |         <el-table-column label="整改人" align="center" prop="abarbeitung" /> | ||||||
|         <el-table-column label="复查状态" align="center" prop="reviewType"> |         <el-table-column label="复查状态" align="center" prop="reviewType"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="review_type" :value="scope.row.reviewType" /> |             <dict-tag :options="review_type" :value="scope.row.reviewType" /> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="备注" align="center" prop="remark" /> |  | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220"> |         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-space> |             <el-space> | ||||||
|               <el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyInspection:query']"> |               <el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyInspection:query']"> | ||||||
|                 详情 |                 详情 | ||||||
|               </el-button> |               </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> |             </el-space> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <!-- 添加或修改安全巡检工单对话框 --> |     <!-- 添加或修改安全巡检工单对话框 --> | ||||||
| @ -177,11 +153,10 @@ import { useUserStoreHook } from '@/store/modules/user'; | |||||||
| import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue'; | import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue'; | ||||||
| import { listProjectTeamForeman } from '@/api/project/projectTeam'; | import { listProjectTeamForeman } from '@/api/project/projectTeam'; | ||||||
| import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types'; | import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types'; | ||||||
|  | import { getDictData } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| const { safety_inspection_violation_type, review_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>( | const { review_type } = toRefs<any>(proxy?.useDict('review_type', 'safety_inspection_type')); | ||||||
|   proxy?.useDict('safety_inspection_violation_type', 'review_type', 'safety_inspection_type', 'safety_inspection_check_type') |  | ||||||
| ); |  | ||||||
| // 获取用户 store | // 获取用户 store | ||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| @ -194,7 +169,8 @@ const ids = ref<Array<string | number>>([]); | |||||||
| const single = ref(true); | const single = ref(true); | ||||||
| const multiple = ref(true); | const multiple = ref(true); | ||||||
| const total = ref(0); | const total = ref(0); | ||||||
|  | const safety_inspection_check_type = ref([]); // 检查类型 | ||||||
|  | const safety_inspection_violation_type = ref([]); // 违章类型 | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const safetyInspectionFormRef = ref<ElFormInstance>(); | const safetyInspectionFormRef = ref<ElFormInstance>(); | ||||||
|  |  | ||||||
| @ -206,7 +182,7 @@ const dialog = reactive<DialogOption>({ | |||||||
| const initFormData: SafetyInspectionForm = { | const initFormData: SafetyInspectionForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   pid: undefined, |   pid: undefined, | ||||||
|   projectId: currentProject.value.id, |   projectId: currentProject.value.goId, | ||||||
|   checkType: undefined, |   checkType: undefined, | ||||||
|   violationType: undefined, |   violationType: undefined, | ||||||
|   inspectionResult: undefined, |   inspectionResult: undefined, | ||||||
| @ -234,7 +210,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({ | |||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     id: undefined, |     id: undefined, | ||||||
|     pid: undefined, |     pid: undefined, | ||||||
|     projectId: currentProject.value.id, |     projectId: currentProject.value.goId, | ||||||
|     checkType: undefined, |     checkType: undefined, | ||||||
|     violationType: undefined, |     violationType: undefined, | ||||||
|     inspectionResult: undefined, |     inspectionResult: undefined, | ||||||
| @ -270,8 +246,8 @@ const teamList = ref<ProjectTeamForemanResp[]>(); | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listSafetyInspection(queryParams.value); |   const res = await listSafetyInspection(queryParams.value); | ||||||
|   safetyInspectionList.value = res.rows; |   safetyInspectionList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   // 获取项目班组信息 |   // 获取项目班组信息 | ||||||
|   const teamRes = await listProjectTeamForeman(currentProject.value.id); |   const teamRes = await listProjectTeamForeman(currentProject.value.id); | ||||||
|   teamList.value = teamRes.data; |   teamList.value = teamRes.data; | ||||||
| @ -282,7 +258,13 @@ const getList = async () => { | |||||||
|  |  | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  | // 获取字典 | ||||||
|  | const getDictDataList = async () => { | ||||||
|  |   const res = await getDictData('study_type'); | ||||||
|  |   safety_inspection_check_type.value = res.data.values; | ||||||
|  |   const res1 = await getDictData('tour_type'); | ||||||
|  |   safety_inspection_violation_type.value = res1.data.values; | ||||||
|  | }; | ||||||
| const changeForeman = (value: string | number) => { | const changeForeman = (value: string | number) => { | ||||||
|   const team = teamList.value.filter((team) => team.id === value)[0]; |   const team = teamList.value.filter((team) => team.id === value)[0]; | ||||||
|   foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({ |   foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({ | ||||||
| @ -297,7 +279,6 @@ const currentSafetyInspectionId = ref<string | number>(); | |||||||
| const showDetailDialog = ref<boolean>(false); | const showDetailDialog = ref<boolean>(false); | ||||||
| const handleShowDialog = (row?: SafetyInspectionVO) => { | const handleShowDialog = (row?: SafetyInspectionVO) => { | ||||||
|   currentSafetyInspectionId.value = row.id; |   currentSafetyInspectionId.value = row.id; | ||||||
|  |  | ||||||
|   showDetailDialog.value = true; |   showDetailDialog.value = true; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @ -331,24 +312,6 @@ const handleSelectionChange = (selection: SafetyInspectionVO[]) => { | |||||||
|   single.value = selection.length != 1; |   single.value = selection.length != 1; | ||||||
|   multiple.value = !selection.length; |   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 = () => { | const submitForm = () => { | ||||||
|   safetyInspectionFormRef.value?.validate(async (valid: boolean) => { |   safetyInspectionFormRef.value?.validate(async (valid: boolean) => { | ||||||
| @ -367,29 +330,27 @@ const submitForm = () => { | |||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 删除按钮操作 */ | const filterType = (studyType) => { | ||||||
| const handleDelete = async (row?: SafetyInspectionVO) => { |   let label = ''; | ||||||
|   const _ids = row?.id || ids.value; |   safety_inspection_check_type.value.map((item) => { | ||||||
|   await proxy?.$modal.confirm('是否确认删除安全巡检工单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); |     if (item.key == studyType) { | ||||||
|   await delSafetyInspection(_ids); |       label = item.value; | ||||||
|   proxy?.$modal.msgSuccess('删除成功'); |     } | ||||||
|   await getList(); |   }); | ||||||
|  |   return label; | ||||||
| }; | }; | ||||||
|  | const filterTypeS = (violationType) => { | ||||||
| /** 导出按钮操作 */ |   let label = ''; | ||||||
| const handleExport = () => { |   safety_inspection_violation_type.value.map((item) => { | ||||||
|   proxy?.download( |     if (item.key == violationType) { | ||||||
|     'safety/safetyInspection/export', |       label = item.value; | ||||||
|     { |     } | ||||||
|       ...queryParams.value |   }); | ||||||
|     }, |   return label; | ||||||
|     `safetyInspection_${new Date().getTime()}.xlsx` |  | ||||||
|   ); |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
| @ -402,6 +363,7 @@ onUnmounted(() => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getDictDataList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -4,11 +4,8 @@ | |||||||
|       <div v-show="showSearch" class="mb-[10px]"> |       <div v-show="showSearch" class="mb-[10px]"> | ||||||
|         <el-card shadow="hover"> |         <el-card shadow="hover"> | ||||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||||
|             <el-form-item label="发生日期" prop="dateOfOccurrence"> |             <el-form-item label="录入人" prop="fill"> | ||||||
|               <el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" /> |               <el-input clearable v-model="queryParams.fill" placeholder="请输入录入人" /> | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="录入人" prop="creatorName"> |  | ||||||
|               <el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" /> |  | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
| @ -22,21 +19,9 @@ | |||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <template #header> |       <template #header> | ||||||
|         <el-row :gutter="10" class="mb8"> |         <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> |           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|         </el-row> |         </el-row> | ||||||
|       </template> |       </template> | ||||||
|  |  | ||||||
|       <el-table v-loading="loading" :data="safetyLogList" @selection-change="handleSelectionChange"> |       <el-table v-loading="loading" :data="safetyLogList" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> |         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||||
| @ -138,6 +123,7 @@ import { addSafetyLog, delSafetyLog, getSafetyLog, listSafetyLog, updateSafetyLo | |||||||
| import { SafetyLogForm, SafetyLogQuery, SafetyLogVO } from '@/api/safety/safetyLog/types'; | import { SafetyLogForm, SafetyLogQuery, SafetyLogVO } from '@/api/safety/safetyLog/types'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| import { dayjs } from 'element-plus'; | import { dayjs } from 'element-plus'; | ||||||
|  | import { busHseSecurityLogList } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| import SafetyLogDetailDialog from '@/views/safety/safetyLog/component/SafetyLogDetailDialog.vue'; | import SafetyLogDetailDialog from '@/views/safety/safetyLog/component/SafetyLogDetailDialog.vue'; | ||||||
|  |  | ||||||
| @ -165,7 +151,7 @@ const dialog = reactive<DialogOption>({ | |||||||
|  |  | ||||||
| const initFormData: SafetyLogForm = { | const initFormData: SafetyLogForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   projectId: currentProject.value.id, |   projectId: currentProject.value.goId, | ||||||
|   dateOfOccurrence: undefined, |   dateOfOccurrence: undefined, | ||||||
|   airTemperatureMax: undefined, |   airTemperatureMax: undefined, | ||||||
|   airTemperatureMin: undefined, |   airTemperatureMin: undefined, | ||||||
| @ -188,7 +174,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({ | |||||||
|   queryParams: { |   queryParams: { | ||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     projectId: currentProject.value.id, |     projectId: currentProject.value.goId, | ||||||
|     dateOfOccurrence: undefined, |     dateOfOccurrence: undefined, | ||||||
|     airTemperatureMax: undefined, |     airTemperatureMax: undefined, | ||||||
|     airTemperatureMin: undefined, |     airTemperatureMin: undefined, | ||||||
| @ -217,9 +203,9 @@ const { queryParams, form, rules } = toRefs(data); | |||||||
| /** 查询安全日志列表 */ | /** 查询安全日志列表 */ | ||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listSafetyLog(queryParams.value); |   const res = await busHseSecurityLogList(queryParams.value); | ||||||
|   safetyLogList.value = res.rows; |   safetyLogList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @ -261,24 +247,6 @@ const handleShowDialog = (row?: SafetyLogVO) => { | |||||||
|   currentSafetyLogId.value = row.id; |   currentSafetyLogId.value = row.id; | ||||||
|   showDetailDialog.value = true; |   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 = () => { | const submitForm = () => { | ||||||
|   safetyLogFormRef.value?.validate(async (valid: boolean) => { |   safetyLogFormRef.value?.validate(async (valid: boolean) => { | ||||||
| @ -306,20 +274,9 @@ const handleDelete = async (row?: SafetyLogVO) => { | |||||||
|   await getList(); |   await getList(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 导出按钮操作 */ |  | ||||||
| const handleExport = () => { |  | ||||||
|   proxy?.download( |  | ||||||
|     'safety/safetyLog/export', |  | ||||||
|     { |  | ||||||
|       ...queryParams.value |  | ||||||
|     }, |  | ||||||
|     `safetyLog_${new Date().getTime()}.xlsx` |  | ||||||
|   ); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|  | |||||||
| @ -3,12 +3,12 @@ | |||||||
|     <el-descriptions v-loading="loading" :column="2"> |     <el-descriptions v-loading="loading" :column="2"> | ||||||
|       <el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item> |       <el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item> | ||||||
|       <el-descriptions-item :span="2" label="参与人"> |       <el-descriptions-item :span="2" label="参与人"> | ||||||
|         <span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }},</span> |         <span :key="item.id" v-for="item in teamMeetingDetail?.participantName.split(',')">{{ item }},</span> | ||||||
|       </el-descriptions-item> |       </el-descriptions-item> | ||||||
|       <el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item> |       <el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item> | ||||||
|       <el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractorName }}</el-descriptions-item> |       <el-descriptions-item label="施工单位">{{ teamMeetingDetail?.labourserviceName }}</el-descriptions-item> | ||||||
|       <el-descriptions-item label="开会时间">{{ dayjs(teamMeetingDetail?.meetingDate).format('YYYY 年 MM 月 DD 日') }}</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 label="上传时间">{{ teamMeetingDetail?.createdAt }}</el-descriptions-item> | ||||||
|       <el-descriptions-item :span="2" label="班会内容">{{ teamMeetingDetail?.content }}</el-descriptions-item> |       <el-descriptions-item :span="2" label="班会内容">{{ teamMeetingDetail?.content }}</el-descriptions-item> | ||||||
|       <el-descriptions-item :span="2" label="班会图片"> |       <el-descriptions-item :span="2" label="班会图片"> | ||||||
|         <el-space wrap> |         <el-space wrap> | ||||||
| @ -35,8 +35,8 @@ const loading = ref<boolean>(false); | |||||||
| const teamMeetingDetail = ref<TeamMeetingVO>(); | const teamMeetingDetail = ref<TeamMeetingVO>(); | ||||||
| const get = async () => { | const get = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await getTeamMeeting(props.teamMeetingId); |   const res = await getTeamMeeting({ id: props.teamMeetingId }); | ||||||
|   if (res.data && res.code === 200) { |   if (res.data && res.code === 0) { | ||||||
|     teamMeetingDetail.value = res.data; |     teamMeetingDetail.value = res.data; | ||||||
|   } |   } | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
|  | |||||||
| @ -19,17 +19,6 @@ | |||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <template #header> |       <template #header> | ||||||
|         <el-row :gutter="10" class="mb8"> |         <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> |           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|         </el-row> |         </el-row> | ||||||
|       </template> |       </template> | ||||||
| @ -38,11 +27,11 @@ | |||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" type="index" width="60" align="center" /> |         <el-table-column label="序号" type="index" width="60" align="center" /> | ||||||
|         <el-table-column label="宣讲人" align="center" prop="compereName" /> |         <el-table-column label="宣讲人" align="center" prop="compereName" /> | ||||||
|         <el-table-column label="施工单位" align="center" prop="contractorName" /> |         <el-table-column label="施工单位" align="center" prop="labourserviceName" /> | ||||||
|         <el-table-column label="班组名称" align="center" prop="teamName" /> |         <el-table-column label="班组名称" align="center" prop="teamName" /> | ||||||
|         <el-table-column label="参与人数" align="center"> |         <el-table-column label="参与人数" align="center"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ scope.row.participantList.length + 1 }}</span> |             <span>{{ scope.row.participantId.split(',').length }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="开会时间" align="center" prop="meetingDate" width="180"> |         <el-table-column label="开会时间" align="center" prop="meetingDate" width="180"> | ||||||
| @ -50,27 +39,17 @@ | |||||||
|             <span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span> |             <span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="上传时间" align="center" prop="createTime" width="180"> |         <el-table-column label="上传时间" align="center" prop="createdAt" width="180"> </el-table-column> | ||||||
|           <template #default="scope"> |  | ||||||
|             <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</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"> |         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-space> |             <el-space> | ||||||
|               <el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['safety:teamMeeting:query']"> |               <el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['safety:teamMeeting:query']"> | ||||||
|                 详情 |                 详情 | ||||||
|               </el-button> |               </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> |             </el-space> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|       </el-table> |       </el-table> | ||||||
|  |  | ||||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <!-- 添加或修改站班会对话框 --> |     <!-- 添加或修改站班会对话框 --> | ||||||
| @ -103,8 +82,6 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup name="TeamMeeting" lang="ts"> | <script setup name="TeamMeeting" lang="ts"> | ||||||
| console.log(111); |  | ||||||
|  |  | ||||||
| import { addTeamMeeting, delTeamMeeting, getTeamMeeting, listTeamMeeting, updateTeamMeeting } from '@/api/safety/teamMeeting'; | import { addTeamMeeting, delTeamMeeting, getTeamMeeting, listTeamMeeting, updateTeamMeeting } from '@/api/safety/teamMeeting'; | ||||||
| import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| @ -135,7 +112,7 @@ const dialog = reactive<DialogOption>({ | |||||||
|  |  | ||||||
| const initFormData: TeamMeetingForm = { | const initFormData: TeamMeetingForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   projectId: currentProject.value.id, |   projectId: currentProject.value.goId, | ||||||
|   teamId: undefined, |   teamId: undefined, | ||||||
|   contractorId: undefined, |   contractorId: undefined, | ||||||
|   meetingDate: undefined, |   meetingDate: undefined, | ||||||
| @ -150,7 +127,7 @@ const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({ | |||||||
|   queryParams: { |   queryParams: { | ||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     projectId: currentProject.value.id, |     projectId: currentProject.value.goId, | ||||||
|     teamId: undefined, |     teamId: undefined, | ||||||
|     contractorId: undefined, |     contractorId: undefined, | ||||||
|     meetingDate: undefined, |     meetingDate: undefined, | ||||||
| @ -173,8 +150,8 @@ const { queryParams, form, rules } = toRefs(data); | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listTeamMeeting(queryParams.value); |   const res = await listTeamMeeting(queryParams.value); | ||||||
|   teamMeetingList.value = res.rows; |   teamMeetingList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @ -222,17 +199,6 @@ const handleShowDrawer = (row?: TeamMeetingVO) => { | |||||||
|   currentTeamMeetingId.value = row.id; |   currentTeamMeetingId.value = row.id; | ||||||
|   showDetailDrawer.value = true; |   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 = () => { | const submitForm = () => { | ||||||
|   teamMeetingFormRef.value?.validate(async (valid: boolean) => { |   teamMeetingFormRef.value?.validate(async (valid: boolean) => { | ||||||
| @ -249,30 +215,9 @@ const submitForm = () => { | |||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** 删除按钮操作 */ |  | ||||||
| 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` |  | ||||||
|   ); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     queryParams.value.projectId = nid; |     queryParams.value.projectId = nid; | ||||||
|     form.value.projectId = nid; |     form.value.projectId = nid; | ||||||
|  | |||||||
| @ -6,8 +6,8 @@ | |||||||
|           <el-row> |           <el-row> | ||||||
|             <el-col :span="8" class="colBlock"> |             <el-col :span="8" class="colBlock"> | ||||||
|               <el-form-item label="违章类型" prop="tourType"> |               <el-form-item label="违章类型" prop="tourType"> | ||||||
|                 <el-select v-model="state.tableData.param.violationType" placeholder="请选择违章类型" clearable> |                 <el-select v-model="state.tableData.param.tourType" placeholder="全部" clearable> | ||||||
|                   <el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |                   <el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" /> | ||||||
|                 </el-select> |                 </el-select> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|             </el-col> |             </el-col> | ||||||
| @ -23,54 +23,27 @@ | |||||||
|             </el-col> |             </el-col> | ||||||
|           </el-row> |           </el-row> | ||||||
|         </el-form> |         </el-form> | ||||||
|         <el-row :gutter="10" class="mb8"> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="primary" @click="handleAdd" v-auth="'api/v1/system/busViolationLevel/add'"> |  | ||||||
|               <el-icon><Plus /></el-icon>新增 |  | ||||||
|             </el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="success" :disabled="single" @click="handleUpdate(null)" v-auth="'api/v1/system/busViolationLevel/edit'"> |  | ||||||
|               <el-icon><Edit /></el-icon>修改 |  | ||||||
|             </el-button> |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busViolationLevel/delete'"> |  | ||||||
|               <el-icon><Delete /></el-icon>删除 |  | ||||||
|             </el-button> |  | ||||||
|           </el-col> |  | ||||||
|         </el-row> |  | ||||||
|       </div> |       </div> | ||||||
|       <el-table v-loading="loading" :data="state.tableData.data" @selection-change="handleSelectionChange"> |       <el-table v-loading="loading" :data="state.tableData.data" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="序号" align="center" type="index" :index="indexMethod" width="60" /> |         <el-table-column label="序号" align="center" type="index" :index="indexMethod" width="60" /> | ||||||
|         <el-table-column label="违章等级" align="center" prop="violationLevel" width="100px" /> |         <el-table-column label="违章等级" align="center" prop="grade" width="100px" /> | ||||||
|         <el-table-column label="颜色" align="center" prop="color" width="100px"> |         <el-table-column label="颜色" align="center" prop="color" width="100px"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <div :style="`background: ${scope.row.color};width:15px;height:15px;margin:auto;`"></div> |             <div :style="`background: ${scope.row.color};width:15px;height:15px;margin:auto;`"></div> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="风险等级" align="center" prop="riskType" width="150px"> |         <el-table-column label="风险等级" align="center" width="150px"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ filterRiskLevelType(scope.row.riskType) }}</span> |             <span>{{ filterRiskLevelType(scope.row.risx) }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="违章类型" show-overflow-tooltip align="center" prop="violationType" :formatter="tourTypeFormat" min-width="100px" /> |         <el-table-column label="违章类型" align="center"> | ||||||
|         <el-table-column label="创建时间" align="center" prop="createTime" width="150px"> |  | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |             <span>{{ filterRiskTourType(scope.row.tourType) }}</span> | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding" width="160px" fixed="right"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <el-button type="success" link @click="handleUpdate(scope.row)" v-auth="'api/v1/system/busViolationLevel/edit'"> |  | ||||||
|               <el-icon><EditPen /></el-icon>修改 |  | ||||||
|             </el-button> |  | ||||||
|             <el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busViolationLevel/delete'"> |  | ||||||
|               <el-icon><DeleteFilled /></el-icon>删除 |  | ||||||
|             </el-button> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|  |         <el-table-column label="创建时间" align="center" prop="createdAt"> </el-table-column> | ||||||
|       </el-table> |       </el-table> | ||||||
|       <pagination |       <pagination | ||||||
|         v-show="state.tableData.total > 0" |         v-show="state.tableData.total > 0" | ||||||
| @ -107,6 +80,8 @@ import apiV1SystemBusViolationLevelAdd from '@/views/safety/violationLevel/compo | |||||||
| import apiV1SystemBusViolationLevelEdit from '@/views/safety/violationLevel/component/edit.vue'; | import apiV1SystemBusViolationLevelEdit from '@/views/safety/violationLevel/component/edit.vue'; | ||||||
| import { useUserStoreHook } from '@/store/modules/user'; | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| import { listPost, listTreeByProject, optionselect } from '@/api/system/post'; | import { listPost, listTreeByProject, optionselect } from '@/api/system/post'; | ||||||
|  | import { getDictData } from '@/api/project/goUser/index'; | ||||||
|  |  | ||||||
| // 获取用户 store | // 获取用户 store | ||||||
| const userStore = useUserStoreHook(); | const userStore = useUserStoreHook(); | ||||||
| // 从 store 中获取项目列表和当前选中的项目 | // 从 store 中获取项目列表和当前选中的项目 | ||||||
| @ -118,7 +93,8 @@ const queryRef = ref<FormInstance>(); | |||||||
| const addRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelAdd>>(); | const addRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelAdd>>(); | ||||||
| const editRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelEdit>>(); | const editRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelEdit>>(); | ||||||
| const detailRef = ref<any>(); | const detailRef = ref<any>(); | ||||||
|  | const risx = ref([]); // 风险等级 | ||||||
|  | const safety_inspection_violation_type = ref([]); // 违章类型 | ||||||
| const showAll = ref(false); | const showAll = ref(false); | ||||||
| const single = ref(true); | const single = ref(true); | ||||||
| const multiple = ref(true); | const multiple = ref(true); | ||||||
| @ -133,7 +109,7 @@ const state = reactive<any>({ | |||||||
|     total: 0, |     total: 0, | ||||||
|     loading: false, |     loading: false, | ||||||
|     param: { |     param: { | ||||||
|       projectId: currentProject.value?.id, |       projectId: currentProject.value?.goId, | ||||||
|       pageNum: 1, |       pageNum: 1, | ||||||
|       pageSize: 10, |       pageSize: 10, | ||||||
|       tourType: undefined, |       tourType: undefined, | ||||||
| @ -164,27 +140,17 @@ const resetQuery = (formEl?: FormInstance) => { | |||||||
| const busViolationLevelList = () => { | const busViolationLevelList = () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   listViolationLevel(state.tableData.param).then((res: any) => { |   listViolationLevel(state.tableData.param).then((res: any) => { | ||||||
|     const list = res.rows ?? []; |     state.tableData.data = res.data.list; | ||||||
|     state.tableData.data = list; |     state.tableData.total = res.data.total; | ||||||
|     state.tableData.total = res.total; |  | ||||||
|     loading.value = false; |     loading.value = false; | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | // 获取字典 | ||||||
| const toggleSearch = () => { | const getDictDataList = async () => { | ||||||
|   showAll.value = !showAll.value; |   const res = await getDictData('risx'); | ||||||
| }; |   risx.value = res.data.values; | ||||||
|  |   const res1 = await getDictData('tour_type'); | ||||||
| const tourTypeFormat = (row: ViolationLevelVO) => { |   safety_inspection_violation_type.value = res1.data.values; | ||||||
|   const type: string[] = []; |  | ||||||
|   if (row.violationType.includes(',')) { |  | ||||||
|     (row.violationType as string).split(',').forEach((item) => { |  | ||||||
|       type.push(proxy.selectDictLabel(violation_level_type.value, item)); |  | ||||||
|     }); |  | ||||||
|   } else { |  | ||||||
|     type.push(proxy.selectDictLabel(violation_level_type.value, row.violationType as string)); |  | ||||||
|   } |  | ||||||
|   return type.join(','); |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const handleSelectionChange = (selection: ViolationLevelForm[]) => { | const handleSelectionChange = (selection: ViolationLevelForm[]) => { | ||||||
| @ -233,10 +199,6 @@ const handleDelete = (row: ViolationLevelVO | null) => { | |||||||
|     .catch(() => {}); |     .catch(() => {}); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const handleView = (row: ViolationLevelVO) => { |  | ||||||
|   detailRef.value?.openDialog(toRaw(row)); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| const indexMethod = (index: number) => { | const indexMethod = (index: number) => { | ||||||
|   const pageNum = state.tableData.param.pageNum - 1; |   const pageNum = state.tableData.param.pageNum - 1; | ||||||
|   if (pageNum !== -1 && pageNum !== 0) { |   if (pageNum !== -1 && pageNum !== 0) { | ||||||
| @ -247,27 +209,41 @@ const indexMethod = (index: number) => { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| const filterRiskLevelType = (val: any) => { | const filterRiskLevelType = (val: any) => { | ||||||
|  |   console.log(val); | ||||||
|   let label = ''; |   let label = ''; | ||||||
|   if (val) { |   if (val) { | ||||||
|     if (risk_level_type.value.length) { |     if (risx.value.length) { | ||||||
|       risk_level_type.value.forEach((item: any) => { |       risx.value.forEach((item: any) => { | ||||||
|         if (item.value == val) { |         if (item.key == val) { | ||||||
|           label = item.label; |           label = item.value; | ||||||
|  |         } | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   return label; | ||||||
|  | }; | ||||||
|  | const filterRiskTourType = (val: any) => { | ||||||
|  |   let label = ''; | ||||||
|  |   if (val) { | ||||||
|  |     if (risx.value.length) { | ||||||
|  |       safety_inspection_violation_type.value.forEach((item: any) => { | ||||||
|  |         if (val.split(',').includes(item.key)) { | ||||||
|  |           label += item.value + ','; | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   return label; |   return label; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getDictDataList(); | ||||||
|   postList(); |   postList(); | ||||||
|   initTableData(); |   initTableData(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| //监听项目id刷新数据 | //监听项目id刷新数据 | ||||||
| const listeningProject = watch( | const listeningProject = watch( | ||||||
|   () => currentProject.value.id, |   () => currentProject.value.goId, | ||||||
|   (nid, oid) => { |   (nid, oid) => { | ||||||
|     state.tableData.param.projectId = nid; |     state.tableData.param.projectId = nid; | ||||||
|     initTableData(); |     initTableData(); | ||||||
|  | |||||||
| @ -6,21 +6,16 @@ | |||||||
|       <!-- <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> --> |       <!-- <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> --> | ||||||
|       <el-row> |       <el-row> | ||||||
|         <el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.createByName }}</el-col> |         <el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.createByName }}</el-col> | ||||||
|         <el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col> |         <el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createdAt }}</el-col> | ||||||
|       </el-row> |       </el-row> | ||||||
|       <el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large"> |       <el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large"> | ||||||
|         <el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item> |         <el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item> | ||||||
|  |  | ||||||
|         <el-descriptions-item label-align="center" label="违章类型" label-class-name="white" width="300px"> |         <el-descriptions-item label-align="center" label="违章类型" label-class-name="white" width="300px"> | ||||||
|           <dict-tag :options="violation_level_type" :value="safetyInspectionDetail?.violationType" /> |           {{ safetyInspectionDetail?.tt }} | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="违章等级" label-class-name="white"> |         <el-descriptions-item label-align="center" label="违章等级" label-class-name="white"> | ||||||
|           <div class="flex"> |           {{ safetyInspectionDetail?.level }} | ||||||
|             {{ safetyInspectionDetail?.levelVo.violationLevel }}:<dict-tag |  | ||||||
|               :options="risk_level_type" |  | ||||||
|               :value="safetyInspectionDetail?.levelVo.riskType" |  | ||||||
|             /> |  | ||||||
|           </div> |  | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="检查时间" class-name="zebra" |         <el-descriptions-item label-align="center" label="检查时间" class-name="zebra" | ||||||
|           >{{ safetyInspectionDetail?.violationTime }} |           >{{ safetyInspectionDetail?.violationTime }} | ||||||
| @ -39,24 +34,24 @@ | |||||||
|         <el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item> |         <el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item> | ||||||
|       </el-descriptions> |       </el-descriptions> | ||||||
|       <el-descriptions :column="2" border label-width="160px" size="large"> |       <el-descriptions :column="2" border label-width="160px" size="large"> | ||||||
|         <el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white" |         <el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"> | ||||||
|           >{{ safetyInspectionDetail?.recognizeVo.description }} |           {{ safetyInspectionDetail?.tt }} | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white"> |         <el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white"> | ||||||
|           <el-space wrap> |           <el-space wrap> | ||||||
|             <!-- <div v-for="item in checkFileList" :key="item.ossId"> |             <div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.ossId"> | ||||||
|               <span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)"> |               <span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)"> | ||||||
|                 <image-preview :src="item.url" width="200px" /> |                 <image-preview :src="item.path" width="200px" /> | ||||||
|               </span> |               </span> | ||||||
|               <span v-else> |               <span v-else> | ||||||
|                 <el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank"> |                 <el-link :href="`${item.path}`" type="primary" :underline="false" target="_blank"> | ||||||
|                   <span> {{ item.originalName }} </span> |                   <span> {{ item.name }} </span> | ||||||
|                 </el-link> |                 </el-link> | ||||||
|               </span> |               </span> | ||||||
|             </div> --> |             </div> | ||||||
|             <span> |             <!-- <span> | ||||||
|               <image-preview :src="safetyInspectionDetail?.recognizeVo.picture" width="200px" /> |               <image-preview :src="safetyInspectionDetail?.recognizeVo.picture" width="200px" /> | ||||||
|             </span> |             </span> --> | ||||||
|           </el-space> |           </el-space> | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|         <el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white"> |         <el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white"> | ||||||
| @ -69,16 +64,16 @@ | |||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|   <!-- </el-card> --> |   <!-- </el-card> --> | ||||||
|   <!-- <div class="dialog-footer"> |   <div class="dialog-footer"> | ||||||
|     <div class="btn-item" @click="handleExport"> |     <!-- <div class="btn-item" @click="handleExport"> | ||||||
|       <img src="../../../../assets/icons/svg/derived.png" /> |       <img src="../../../../assets/icons/svg/derived.png" /> | ||||||
|       <span>导出</span> |       <span>导出</span> | ||||||
|     </div> |     </div> --> | ||||||
|     <div class="btn-item" v-print="'#printMe'"> |     <div class="btn-item" v-print="'#printMe'"> | ||||||
|       <img src="../../../../assets/icons/svg/print.png" /> |       <img src="../../../../assets/icons/svg/print.png" /> | ||||||
|       <span>打印</span> |       <span>打印</span> | ||||||
|     </div> |     </div> | ||||||
|   </div> --> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| @ -91,6 +86,7 @@ import { ViolationRecordVO } from '@/api/safety/violationRecord/types'; | |||||||
|  |  | ||||||
| interface Props { | interface Props { | ||||||
|   violationRecordId?: string | number; |   violationRecordId?: string | number; | ||||||
|  |   safety_inspection_violation_type?: Array<any>; | ||||||
| } | } | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
| @ -103,7 +99,11 @@ const userStore = useUserStoreHook(); | |||||||
| const currentProject = computed(() => userStore.selectedProject); | const currentProject = computed(() => userStore.selectedProject); | ||||||
| const props = defineProps<Props>(); | const props = defineProps<Props>(); | ||||||
| const loading = ref<boolean>(false); | const loading = ref<boolean>(false); | ||||||
| const safetyInspectionDetail = ref<any>(); | const safetyInspectionDetail = ref<any>([ | ||||||
|  |   { | ||||||
|  |     checkAttachment: [] | ||||||
|  |   } | ||||||
|  | ]); | ||||||
| const checkFileList = ref<OssVO[]>(); | const checkFileList = ref<OssVO[]>(); | ||||||
| const rectificationFileList = ref<OssVO[]>(); | const rectificationFileList = ref<OssVO[]>(); | ||||||
| //检查状态图片 | //检查状态图片 | ||||||
| @ -119,17 +119,9 @@ const inspectionType = computed(() => { | |||||||
|  |  | ||||||
| const get = async () => { | const get = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await getViolationRecord(props.violationRecordId); |   const res = await getViolationRecord({ id: props.violationRecordId }); | ||||||
|   if (res.data && res.code === 200) { |   if (res.data && res.code === 0) { | ||||||
|     safetyInspectionDetail.value = res.data; |     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; |   loading.value = false; | ||||||
| }; | }; | ||||||
| @ -142,7 +134,17 @@ onMounted(() => { | |||||||
|   console.log('🚀 ~ onMounted ~ props.safetyInspectionId:', props.violationRecordId); |   console.log('🚀 ~ onMounted ~ props.safetyInspectionId:', props.violationRecordId); | ||||||
|   get(); |   get(); | ||||||
| }); | }); | ||||||
|  | const filterRiskTourType = (val: any) => { | ||||||
|  |   let label = ''; | ||||||
|  |   if (val) { | ||||||
|  |     props.safety_inspection_violation_type.value.forEach((item: any) => { | ||||||
|  |       if (val == item.key) { | ||||||
|  |         label = item.value; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |   return label; | ||||||
|  | }; | ||||||
| watch( | watch( | ||||||
|   () => props.violationRecordId, |   () => props.violationRecordId, | ||||||
|   (newId, oldId) => { |   (newId, oldId) => { | ||||||
|  | |||||||
| @ -7,10 +7,11 @@ | |||||||
|             <el-form-item label="工单号" prop="id"> |             <el-form-item label="工单号" prop="id"> | ||||||
|               <el-input v-model="queryParams.id" placeholder="请输入工单号" clearable @keyup.enter="handleQuery" /> |               <el-input v-model="queryParams.id" placeholder="请输入工单号" clearable @keyup.enter="handleQuery" /> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="违章时间" prop="violationTime"> |             <el-form-item label="违章类型" prop="tourType"> | ||||||
|               <el-date-picker clearable v-model="queryParams.violationTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择违章时间" /> |               <el-select v-model="queryParams.tourType" placeholder="全部" clearable> | ||||||
|  |                 <el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" /> | ||||||
|  |               </el-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|  |  | ||||||
|             <el-form-item> |             <el-form-item> | ||||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> |               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||||
| @ -19,15 +20,9 @@ | |||||||
|         </el-card> |         </el-card> | ||||||
|       </div> |       </div> | ||||||
|     </transition> |     </transition> | ||||||
|  |  | ||||||
|     <el-card shadow="never"> |     <el-card shadow="never"> | ||||||
|       <template #header> |       <template #header> | ||||||
|         <el-row :gutter="10" class="mb8"> |         <el-row :gutter="10" class="mb8"> | ||||||
|           <el-col :span="1.5"> |  | ||||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:violationRecord:remove']" |  | ||||||
|               >删除</el-button |  | ||||||
|             > |  | ||||||
|           </el-col> |  | ||||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|         </el-row> |         </el-row> | ||||||
|       </template> |       </template> | ||||||
| @ -35,45 +30,39 @@ | |||||||
|       <el-table v-loading="loading" :data="violationRecordList" @selection-change="handleSelectionChange"> |       <el-table v-loading="loading" :data="violationRecordList" @selection-change="handleSelectionChange"> | ||||||
|         <el-table-column type="selection" width="55" align="center" /> |         <el-table-column type="selection" width="55" align="center" /> | ||||||
|         <el-table-column label="工单号" align="center" prop="id" v-if="true" /> |         <el-table-column label="工单号" align="center" prop="id" v-if="true" /> | ||||||
|         <el-table-column label="违章等级" align="center" prop="levelVo" width="180"> |         <el-table-column label="违章/风险等级" align="center" prop="level" width="180"> </el-table-column> | ||||||
|  |         <el-table-column label="数据源头" align="center" prop="dataSource" width="180"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <div class="flex justify-center"> |             <span>{{ filterRiskTourTypes(scope.row.dataSource) }}</span> | ||||||
|               {{ scope.row.levelVo.violationLevel }}:<dict-tag :options="risk_level_type" :value="scope.row.levelVo.riskType" /> |  | ||||||
|             </div> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="违章类型" align="center" prop="violationType"> |         <el-table-column label="违章类型" align="center"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <dict-tag :options="violation_level_type" :value="scope.row.violationType" /> |             <span>{{ filterRiskTourType(scope.row.tourType) }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="违章时间" align="center" prop="violationTime" width="180"> |         <el-table-column label="处理人" align="center" prop="nickName" min-width="100px"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.violationTime, '{y}-{m}-{d}') }}</span> |             {{ scope.row.userName ? scope.row.userName : scope.row.nickName }} | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="处理人" align="center" prop="handlerName" /> |         <el-table-column label="状态" align="center" prop="status" min-width="100px"> | ||||||
|         <el-table-column label="整改措施" align="center" prop="measure" /> |  | ||||||
|         <el-table-column label="整改时间" align="center" prop="rectificationTime" width="180"> |  | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.rectificationTime, '{y}-{m}-{d}') }}</span> |             <el-tag type="primary" v-if="scope.row.status == 1">通知</el-tag> | ||||||
|  |             <el-tag type="warning" v-if="scope.row.status == 2">整改</el-tag> | ||||||
|  |             <el-tag type="success" v-if="scope.row.status == 3 && scope.row.reviewType == 1">复查成功</el-tag> | ||||||
|  |             <el-tag type="danger" v-if="scope.row.status == 3 && scope.row.reviewType == 2">复查失败</el-tag> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="复查情况" align="center" prop="review" /> |         <el-table-column label="违规时间" align="center" prop="createdAt" min-width="100px"> | ||||||
|         <el-table-column label="复查状态" align="center" prop="reviewType"> |  | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             {{ scope.row.reviewType ? (scope.row.reviewType == 1 ? '已通过' : '未通过') : '' }} |             <span v-if="scope.row.dataSource == 'artificial'">{{ scope.row.laborDate }}</span> | ||||||
|  |             <span v-else>{{ scope.row.createdAt }}</span> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="复查时间" align="center" prop="reviewTime" width="180"> |         <el-table-column label="复查记录" align="center" min-width="100px"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <span>{{ parseTime(scope.row.reviewTime, '{y}-{m}-{d}') }}</span> |             <span>{{ filterHis(scope.row.refuseList) }}</span> | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <!-- <el-table-column label="处理流程类型(0仅通知 1通知整改复查)" align="center" prop="processType" /> --> |  | ||||||
|         <el-table-column label="工单状态" align="center" prop="status"> |  | ||||||
|           <template #default="scope"> |  | ||||||
|             <dict-tag :options="safety_inspection_type" :value="scope.row.status" /> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="备注" align="center" prop="remark" /> |         <el-table-column label="备注" align="center" prop="remark" /> | ||||||
| @ -88,12 +77,6 @@ | |||||||
|                 v-hasPermi="['safety:violationRecord:view']" |                 v-hasPermi="['safety:violationRecord:view']" | ||||||
|               ></el-button> |               ></el-button> | ||||||
|             </el-tooltip> |             </el-tooltip> | ||||||
|             <el-tooltip content="违章处理人" placement="top"> |  | ||||||
|               <el-button link type="primary" icon="User" @click="handleUpdate(scope.row)" v-hasPermi="['safety:violationRecord:edit']"></el-button> |  | ||||||
|             </el-tooltip> |  | ||||||
|             <el-tooltip content="删除" placement="top"> |  | ||||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:violationRecord:remove']"></el-button> |  | ||||||
|             </el-tooltip> |  | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|       </el-table> |       </el-table> | ||||||
| @ -122,7 +105,10 @@ | |||||||
|       </template> |       </template> | ||||||
|     </el-dialog> |     </el-dialog> | ||||||
|     <el-dialog title="违规记录详情" v-model="showDetailDialog" width="60vw"> |     <el-dialog title="违规记录详情" v-model="showDetailDialog" width="60vw"> | ||||||
|       <ViolationRecordDetailDialog :violation-record-id="currentViolationRecordId" /> |       <ViolationRecordDetailDialog | ||||||
|  |         :violation-record-id="currentViolationRecordId" | ||||||
|  |         :safety_inspection_violation_type="safety_inspection_violation_type" | ||||||
|  |       /> | ||||||
|     </el-dialog> |     </el-dialog> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| @ -131,11 +117,16 @@ | |||||||
| import { listViolationRecord, getViolationRecord, delViolationRecord, addViolationRecord, updateViolationRecord } from '@/api/safety/violationRecord'; | import { listViolationRecord, getViolationRecord, delViolationRecord, addViolationRecord, updateViolationRecord } from '@/api/safety/violationRecord'; | ||||||
| import { ViolationRecordVO, ViolationRecordQuery, ViolationRecordForm } from '@/api/safety/violationRecord/types'; | import { ViolationRecordVO, ViolationRecordQuery, ViolationRecordForm } from '@/api/safety/violationRecord/types'; | ||||||
| import ViolationRecordDetailDialog from './component/violationRecordDetailDialog.vue'; | import ViolationRecordDetailDialog from './component/violationRecordDetailDialog.vue'; | ||||||
|  | import { useUserStoreHook } from '@/store/modules/user'; | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
|  | import { getDictData } from '@/api/project/goUser/index'; | ||||||
| const { violation_level_type, risk_level_type, safety_inspection_type } = toRefs<any>( | const { violation_level_type, risk_level_type, safety_inspection_type } = toRefs<any>( | ||||||
|   proxy?.useDict('violation_level_type', 'risk_level_type', 'safety_inspection_type') |   proxy?.useDict('violation_level_type', 'risk_level_type', 'safety_inspection_type') | ||||||
| ); | ); | ||||||
|  | // 获取用户 store | ||||||
|  | const userStore = useUserStoreHook(); | ||||||
|  | // 从 store 中获取项目列表和当前选中的项目 | ||||||
|  | const currentProject = computed(() => userStore.selectedProject); | ||||||
|  |  | ||||||
| const violationRecordList = ref<ViolationRecordVO[]>([]); | const violationRecordList = ref<ViolationRecordVO[]>([]); | ||||||
| const buttonLoading = ref(false); | const buttonLoading = ref(false); | ||||||
| @ -150,7 +141,8 @@ const showDetailDialog = ref(false); | |||||||
|  |  | ||||||
| const queryFormRef = ref<ElFormInstance>(); | const queryFormRef = ref<ElFormInstance>(); | ||||||
| const violationRecordFormRef = ref<ElFormInstance>(); | const violationRecordFormRef = ref<ElFormInstance>(); | ||||||
|  | const safety_inspection_violation_type = ref([]); // 违章类型 | ||||||
|  | const violation_record_data_source = ref([]); // 数据来源 | ||||||
| const dialog = reactive<DialogOption>({ | const dialog = reactive<DialogOption>({ | ||||||
|   visible: false, |   visible: false, | ||||||
|   title: '' |   title: '' | ||||||
| @ -158,7 +150,7 @@ const dialog = reactive<DialogOption>({ | |||||||
|  |  | ||||||
| const initFormData: ViolationRecordForm = { | const initFormData: ViolationRecordForm = { | ||||||
|   id: undefined, |   id: undefined, | ||||||
|   projectId: undefined, |   projectId: currentProject.value.goId, | ||||||
|   levelId: undefined, |   levelId: undefined, | ||||||
|   recognizeId: undefined, |   recognizeId: undefined, | ||||||
|   violationType: undefined, |   violationType: undefined, | ||||||
| @ -181,7 +173,7 @@ const data = reactive<PageData<ViolationRecordForm, ViolationRecordQuery>>({ | |||||||
|     pageNum: 1, |     pageNum: 1, | ||||||
|     pageSize: 10, |     pageSize: 10, | ||||||
|     id: undefined, |     id: undefined, | ||||||
|     projectId: undefined, |     projectId: currentProject.value.goId, | ||||||
|     violationType: undefined, |     violationType: undefined, | ||||||
|     violationTime: undefined, |     violationTime: undefined, | ||||||
|     handlerId: undefined, |     handlerId: undefined, | ||||||
| @ -212,8 +204,8 @@ const { queryParams, form, rules } = toRefs(data); | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   const res = await listViolationRecord(queryParams.value); |   const res = await listViolationRecord(queryParams.value); | ||||||
|   violationRecordList.value = res.rows; |   violationRecordList.value = res.data.list; | ||||||
|   total.value = res.total; |   total.value = res.data.total; | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @ -300,8 +292,42 @@ const handleExport = () => { | |||||||
|     `violationRecord_${new Date().getTime()}.xlsx` |     `violationRecord_${new Date().getTime()}.xlsx` | ||||||
|   ); |   ); | ||||||
| }; | }; | ||||||
|  | const filterHis = (list) => { | ||||||
|  |   if (list && list.length) { | ||||||
|  |     return '重新复查'; | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | const filterRiskTourType = (val: any) => { | ||||||
|  |   let label = ''; | ||||||
|  |   if (val) { | ||||||
|  |     safety_inspection_violation_type.value.forEach((item: any) => { | ||||||
|  |       if (val == item.key) { | ||||||
|  |         label = item.value; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |   return label; | ||||||
|  | }; | ||||||
|  | const filterRiskTourTypes = (val: any) => { | ||||||
|  |   let label = ''; | ||||||
|  |   if (val) { | ||||||
|  |     violation_record_data_source.value.forEach((item: any) => { | ||||||
|  |       if (val == item.key) { | ||||||
|  |         label = item.value; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |   return label; | ||||||
|  | }; | ||||||
|  | // 获取字典 | ||||||
|  | const getDictDataList = async () => { | ||||||
|  |   const res = await getDictData('tour_type'); | ||||||
|  |   safety_inspection_violation_type.value = res.data.values; | ||||||
|  |   const res1 = await getDictData('violation_record_data_source'); | ||||||
|  |   violation_record_data_source.value = res1.data.values; | ||||||
|  | }; | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   getDictDataList(); | ||||||
|   getList(); |   getList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user