| | |
| | | </div> |
| | | <!-- 搜索 --> |
| | | <div class="flex a-center gap--16 mt--24 mb--20"> |
| | | <!-- 项目选择(非项目端才显示) --> |
| | | <div |
| | | v-if="!projectId" |
| | | v-if="!isProjectMode" |
| | | class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox" |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | v-model="searchForm.projectId" |
| | | placeholder="请选择项目" |
| | | class="flex1" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | v-for="item in projectList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 整改状态 --> |
| | | <div |
| | | class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox" |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | v-model="searchForm.reformed" |
| | | placeholder="请选择整改状态" |
| | | class="flex1" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | v-for="item in reformedOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 隐患类型(仅重大隐患显示) --> |
| | | <div |
| | | v-if="activeTab == 1" |
| | | v-if="showTypeFilter" |
| | | class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox" |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | v-model="searchForm.type" |
| | | placeholder="请选择隐患类型" |
| | | class="flex1" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="安全隐患" :value="1"></el-option> |
| | | <el-option label="设备隐患" :value="2"></el-option> |
| | | </el-select> |
| | | <img |
| | | src="../../assets/img/down-circle@2x.png" |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 隐患等级(安全和设备隐患显示) --> |
| | | <div |
| | | v-else |
| | | v-if="showLevelFilter" |
| | | class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox" |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | v-model="searchForm.level" |
| | | placeholder="请选择隐患等级" |
| | | class="flex1" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | v-for="item in levelOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 开始时间 --> |
| | | <div |
| | | @click="handleClick(1)" |
| | | class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker" |
| | | > |
| | | <el-date-picker |
| | | v-model="dateTime" |
| | | v-model="startDateTime" |
| | | ref="datetime1" |
| | | type="datetime" |
| | | placeholder="" |
| | |
| | | <div |
| | | class="absolute w100 h100 flex a-center c-fff fs--14 SHS" |
| | | style="width: calc(100% - 20px)" |
| | | v-if="dateTxt" |
| | | v-if="startDateTxt" |
| | | > |
| | | {{ dateTxt }} |
| | | {{ startDateTxt }} |
| | | </div> |
| | | <div |
| | | v-else |
| | | class="absolute w100 h100 flex a-center c-fff fs--14 SHSR" |
| | | > |
| | | 请选择日期 |
| | | 开始时间 |
| | | </div> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (6).png" |
| | | class="w--13 h--13 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 结束时间 --> |
| | | <div |
| | | @click="handleClick(2)" |
| | | class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker" |
| | | > |
| | | <el-date-picker |
| | | v-model="dateTime" |
| | | v-model="endDateTime" |
| | | ref="datetime2" |
| | | type="datetime" |
| | | placeholder="" |
| | |
| | | <div |
| | | class="absolute w100 h100 flex a-center c-fff fs--14 SHS" |
| | | style="width: calc(100% - 20px)" |
| | | v-if="dateTxt" |
| | | v-if="endDateTxt" |
| | | > |
| | | {{ dateTxt }} |
| | | {{ endDateTxt }} |
| | | </div> |
| | | <div |
| | | v-else |
| | | class="absolute w100 h100 flex a-center c-fff fs--14 SHSR" |
| | | > |
| | | 请选择日期 |
| | | 结束时间 |
| | | </div> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (6).png" |
| | | class="w--13 h--13 shrink0" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 搜索内容 --> |
| | | <div |
| | | class="flex a-center j-between w--300 pl--20 h--40 relative bgcolor1 searchBox" |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | <el-input |
| | | v-model="searchForm.content" |
| | | placeholder="请输入搜索内容" |
| | | class="flex1" |
| | | clearable |
| | | @keyup.enter.native="handleSearch" |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <div class="btn SHSR">搜索</div> |
| | | </el-input> |
| | | <div class="btn SHSR" @click="handleSearch">搜索</div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格 --> |
| | | <CustomTable |
| | | :data="[{ projectName: '项目777' }, { projectName: '项目2' }]" |
| | | :data="tableData" |
| | | height="800" |
| | | style="border: 2px solid #3d7fff" |
| | | v-loading="loading" |
| | | > |
| | | <el-table-column |
| | | v-if="!projectId" |
| | | v-if="!isProjectMode" |
| | | label="项目名称" |
| | | prop="projectName" |
| | | min-width="150" |
| | | /> |
| | | <el-table-column label="检查计划" prop="projectName" /> |
| | | <el-table-column label="检查内容" prop="projectName" /> |
| | | <el-table-column label="问题描述" prop="projectName" /> |
| | | <el-table-column label="问题部位" prop="projectName" /> |
| | | <el-table-column label="问题备注" prop="projectName" /> |
| | | <el-table-column label="隐患等级" prop="projectName" /> |
| | | <el-table-column |
| | | label="检查计划" |
| | | prop="planName" |
| | | min-width="150" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="检查内容" |
| | | prop="hierarchyName" |
| | | min-width="150" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="问题描述" |
| | | prop="description" |
| | | min-width="200" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="问题部位" |
| | | prop="problemPart" |
| | | min-width="150" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="问题备注" |
| | | prop="remark" |
| | | min-width="150" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="隐患等级" |
| | | min-width="120" |
| | | > |
| | | <template #default="{ row }"> |
| | | <span>{{ getLevelText(row.level) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="activeTab == 1" |
| | | label="隐患类型" |
| | | prop="projectName" |
| | | /> |
| | | <el-table-column label="图片" prop="projectName"> |
| | | <template #default="{ row }" |
| | | ><div |
| | | min-width="120" |
| | | > |
| | | <template #default="{ row }"> |
| | | <span>{{ row.type === 1 ? '安全隐患' : row.type === 2 ? '设备隐患' : '-' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="图片" min-width="100"> |
| | | <template #default="{ row }"> |
| | | <div |
| | | class="btnColor cursor-pointer" |
| | | :class="false && 'disableColor'" |
| | | @click="previewVisible = true" |
| | | :class="!row.userFiles || row.userFiles.length === 0 ? 'disableColor' : ''" |
| | | @click="handlePreviewImages(row.userFiles)" |
| | | > |
| | | 1张 |
| | | {{ row.fileNum || 0 }}张 |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="检查时间" prop="projectName" /> |
| | | <el-table-column label="整改状态" prop="projectName"> |
| | | <template #default="{ row, $index }"> |
| | | <el-table-column |
| | | label="检查时间" |
| | | prop="createTime" |
| | | min-width="180" |
| | | /> |
| | | <el-table-column label="整改状态" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <div class="flex a-center j-center"> |
| | | <div class="ripple"> |
| | | <div |
| | | class="ripple-wave wave-1" |
| | | :class="{ bgColor33: $index === 0 }" |
| | | :class="{ bgColor33: row.reformed }" |
| | | ></div> |
| | | <div |
| | | class="ripple-wave wave-2" |
| | | :class="{ bgColor44: $index === 0 }" |
| | | :class="{ bgColor44: row.reformed }" |
| | | ></div> |
| | | <div |
| | | class="ripple-wave wave-3" |
| | | :class="{ bgColor55: $index === 0 }" |
| | | :class="{ bgColor55: row.reformed }" |
| | | ></div> |
| | | </div> |
| | | <div class="ml--6 SHSR">{{ $index }}</div> |
| | | <div class="ml--6 SHSR">{{ getReformedText(row.reformed) }}</div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="责任人" prop="projectName" /> |
| | | <el-table-column label="操作"> |
| | | <el-table-column |
| | | label="责任人" |
| | | prop="responsiblePerson" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column label="操作" min-width="200" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <el-button @click="updatePeople = true" type="text" class="btnColor" |
| | | >编辑责任人</el-button |
| | | <el-button |
| | | @click="handleEditPeople(row)" |
| | | type="text" |
| | | class="btnColor" |
| | | > |
| | | 编辑责任人 |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | class="btnColor" |
| | | @click="detailVisible = true" |
| | | >详情</el-button |
| | | @click="handleViewDetail(row)" |
| | | > |
| | | 详情 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </CustomTable> |
| | | <CustomPagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :page-size="10" |
| | | :total="400" |
| | | :current-page="pageNum" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | :page-size="pageSize" |
| | | :total="total" |
| | | /> |
| | | </div> |
| | | <!-- 修改责任人 --> |
| | |
| | | </div> |
| | | </CustomDialog> |
| | | <!-- 隐患详情 --> |
| | | <CustomDialog title="项目名称" :visible.sync="detailVisible" width="1420px"> |
| | | <CustomDialog |
| | | :title="detailData ? detailData.projectName || '隐患详情' : '隐患详情'" |
| | | :visible.sync="detailVisible" |
| | | width="1420px" |
| | | > |
| | | <el-tabs v-model="activeName" type="card" @tab-click="handleClickTab"> |
| | | <el-tab-pane label="基本信息" name="first"> |
| | | <div class="oa" style="height: 700px"> |
| | |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">计划名称:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.planName || '-' }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">项目名称:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.projectName || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">检查内容:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.hierarchyName || '-' }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">责任人:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.responsiblePerson || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">问题部门:</div> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">问题部位:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.problemPart || '-' }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">创建时间:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ currentRow && currentRow.createTime || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="mt--30"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">规范条款:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | <div class="min-h--60 py--20 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | <template v-if="detailData && detailData.specificTerms && detailData.specificTerms.length > 0"> |
| | | <div v-for="(term, index) in detailData.specificTerms" :key="'term-' + index" class="mb--10"> |
| | | {{ index + 1 }}. {{ term }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | {{ detailData && detailData.specificTermsStr || '-' }} |
| | | </template> |
| | | </div> |
| | | </div> |
| | | <div class="mt--30"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">建议措施:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | <div class="min-h--60 py--20 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | <template v-if="detailData && detailData.suggestActions && detailData.suggestActions.length > 0"> |
| | | <div v-for="(action, index) in detailData.suggestActions" :key="'action-' + index" class="mb--10"> |
| | | {{ index + 1 }}. {{ action }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | {{ detailData && detailData.suggestActionsStr || '-' }} |
| | | </template> |
| | | </div> |
| | | </div> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">问题数量:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ getNumberFactorName() }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">扣除积分:</div> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">扣除分数:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ getNumberFactorDeductPoint() }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">附加分数:</div> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">附加加分:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | {{ getNumberFactorAdditionPoint() }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">备注:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | </div> |
| | | <!-- 占位 --> |
| | | </div> |
| | | </div> |
| | | <div class="mt--30"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">备注:</div> |
| | | <div class="min-h--60 py--20 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ detailData && detailData.remark || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="复查记录(无)" name="second"> |
| | | <el-tab-pane |
| | | :label="getReviewRecordsLabel()" |
| | | name="second" |
| | | > |
| | | <div class="oa" style="height: 700px"> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复合内容:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复合状态:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | </div> |
| | | </div> |
| | | <div v-if="!detailData || !detailData.errorReview" class="txt-center c-fff fs--16 mt--50"> |
| | | 暂无复查记录 |
| | | </div> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复合图片:</div> |
| | | <div |
| | | class="lh--60 px--19 btnColor SHSBold fs--18 w100 cursor-pointer" |
| | | :class="false && 'disableColor'" |
| | | @click="previewVisible = true" |
| | | > |
| | | 1张 |
| | | <div v-else> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复查内容:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ detailData.errorReview.content || '-' }} |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复查状态:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ getReviewStateText(detailData.errorReview.state) }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复核人:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复查图片:</div> |
| | | <div |
| | | class="lh--60 px--19 btnColor SHSBold fs--18 w100 cursor-pointer" |
| | | :class="!detailData.errorReview.img || detailData.errorReview.img.length === 0 ? 'disableColor' : ''" |
| | | @click="handlePreviewReviewImages(detailData.errorReview.img)" |
| | | > |
| | | {{ detailData.errorReview.img && detailData.errorReview.img.length || 0 }}张 |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">复核人:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ detailData.errorReview.creator || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">创建时间:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">创建时间:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ detailData.errorReview.createTime || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">更新时间:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | 计划名称计划名称计划名称 |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">更新时间:</div> |
| | | <div class="lh--60 px--19 c-fff SHSBold fs--18 w100 bgcolor6"> |
| | | {{ detailData.errorReview.updateTime || '-' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 图片预览 --> |
| | | <CustomPreview |
| | | :show="previewVisible" |
| | | :imgArr="[]" |
| | | :imgArr="previewImages" |
| | | @close="previewVisible = false" |
| | | /> |
| | | </div> |
| | |
| | | <script> |
| | | import HeaderBox from "../header/index.vue"; |
| | | import moment from "moment"; |
| | | import { |
| | | getLoginNameVoList, |
| | | getHiddenDangerList, |
| | | getHiddenDangerDetail, |
| | | editHiddenDangerResponsiblePerson, |
| | | } from "./service"; |
| | | import { |
| | | errorLevelMap, |
| | | errorReviewStateMap, |
| | | } from "@/utils/riskSourceMap"; |
| | | |
| | | export default { |
| | | components: { HeaderBox }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | activeTab: 1, |
| | | dateTime: null, |
| | | projectId: null, |
| | | projectName: "", |
| | | dateTxt: "", |
| | | currentPage: 1, |
| | | // Tab 相关 |
| | | activeTab: 1, // 1=重大隐患 2=安全隐患 3=设备隐患 |
| | | |
| | | // 路由参数 |
| | | projectId: null, // 项目ID,如果有则是项目端使用 |
| | | projectName: "", // 项目名称 |
| | | |
| | | // 搜索条件 |
| | | searchForm: { |
| | | projectId: null, // 选中的项目ID |
| | | reformed: null, // 整改状态:1已整改 0未整改 |
| | | type: null, // 隐患类型:1=安全 2=设备 |
| | | level: null, // 隐患等级:0=一级 1=二级 2=三级 3=四级 |
| | | startTime: null, // 开始时间 |
| | | endTime: null, // 结束时间 |
| | | content: "", // 搜索内容 |
| | | }, |
| | | |
| | | // 日期选择 |
| | | startDateTime: null, |
| | | endDateTime: null, |
| | | startDateTxt: "", |
| | | endDateTxt: "", |
| | | |
| | | // 下拉选项 |
| | | projectList: [], // 项目列表 |
| | | reformedOptions: [], // 整改状态选项 |
| | | levelOptions: [], // 隐患等级选项 |
| | | |
| | | // 表格数据 |
| | | tableData: [], |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | loading: false, |
| | | |
| | | // 弹窗相关 |
| | | updatePeople: false, |
| | | peopleName: "", |
| | | currentEditRow: null, // 当前编辑的行数据 |
| | | detailVisible: false, |
| | | detailData: null, // 详情数据 |
| | | currentRow: null, // 当前查看详情的列表行数据 |
| | | activeName: "first", |
| | | previewVisible: false, |
| | | previewImages: [], // 预览图片列表 |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | computed: { |
| | | // 是否是项目端(有projectId参数) |
| | | isProjectMode() { |
| | | return !!this.projectId; |
| | | }, |
| | | |
| | | // 当前隐患类型(根据activeTab判断) |
| | | currentType() { |
| | | // 1=重大隐患(暂无对应type) 2=安全隐患(type=1) 3=设备隐患(type=2) |
| | | if (this.activeTab === 2) return 1; |
| | | if (this.activeTab === 3) return 2; |
| | | return null; |
| | | }, |
| | | |
| | | // 是否显示隐患类型筛选(仅重大隐患显示) |
| | | showTypeFilter() { |
| | | return this.activeTab === 1; |
| | | }, |
| | | |
| | | // 是否显示隐患等级筛选(安全和设备隐患显示) |
| | | showLevelFilter() { |
| | | return this.activeTab !== 1; |
| | | }, |
| | | }, |
| | | watch: { |
| | | dateTime: { |
| | | handler(newVal, oldVal) { |
| | | // 监听 tab 切换 |
| | | activeTab: { |
| | | handler(newVal) { |
| | | // 切换 tab 时重置筛选条件并重新加载数据 |
| | | this.resetSearchForm(); |
| | | this.pageNum = 1; |
| | | this.loadTableData(); |
| | | }, |
| | | }, |
| | | |
| | | // 监听开始时间 |
| | | startDateTime: { |
| | | handler(newVal) { |
| | | if (newVal) { |
| | | this.dateTxt = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss"); |
| | | this.startDateTxt = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss"); |
| | | this.searchForm.startTime = moment(newVal).format("YYYY-MM-DD HH:mm:ss"); |
| | | } else { |
| | | this.startDateTxt = ""; |
| | | this.searchForm.startTime = null; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | |
| | | // 监听结束时间 |
| | | endDateTime: { |
| | | handler(newVal) { |
| | | if (newVal) { |
| | | this.endDateTxt = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss"); |
| | | this.searchForm.endTime = moment(newVal).format("YYYY-MM-DD HH:mm:ss"); |
| | | } else { |
| | | this.endDateTxt = ""; |
| | | this.searchForm.endTime = null; |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | created() { |
| | | // 从路由获取参数 |
| | | if (this.$route.query.activeTab) { |
| | | this.activeTab = this.$route.query.activeTab; |
| | | this.activeTab = Number(this.$route.query.activeTab); |
| | | } |
| | | if (this.$route.query.projectId) { |
| | | this.projectId = this.$route.query.projectId; |
| | | this.searchForm.projectId = this.$route.query.projectId; |
| | | } |
| | | if (this.$route.query.projectName) { |
| | | this.projectName = this.$route.query.projectName; |
| | | } |
| | | |
| | | // 初始化下拉选项 |
| | | this.initOptions(); |
| | | |
| | | // 加载项目列表(如果不是项目端) |
| | | if (!this.isProjectMode) { |
| | | this.loadProjectList(); |
| | | } |
| | | |
| | | // 加载表格数据 |
| | | this.loadTableData(); |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | handleClickTab(tab) { |
| | | this.activeName = tab.name; |
| | | // 初始化下拉选项 |
| | | initOptions() { |
| | | // 整改状态选项 |
| | | this.reformedOptions = [ |
| | | { label: '未整改', value: 0 }, |
| | | { label: '已整改', value: 1 } |
| | | ]; |
| | | |
| | | // 隐患等级选项 |
| | | this.levelOptions = [ |
| | | { label: '一级隐患', value: 0 }, |
| | | { label: '二级隐患', value: 1 }, |
| | | { label: '三级隐患', value: 2 }, |
| | | { label: '四级隐患', value: 3 } |
| | | ]; |
| | | }, |
| | | |
| | | // 重置搜索表单 |
| | | resetSearchForm() { |
| | | this.searchForm = { |
| | | projectId: this.projectId || null, |
| | | reformed: null, |
| | | type: this.currentType, |
| | | level: null, |
| | | startTime: null, |
| | | endTime: null, |
| | | content: "", |
| | | }; |
| | | this.startDateTime = null; |
| | | this.endDateTime = null; |
| | | }, |
| | | |
| | | // 加载项目列表 |
| | | async loadProjectList() { |
| | | try { |
| | | const res = await getLoginNameVoList({}); |
| | | if (res && res) { |
| | | this.projectList = res.map((item) => ({ |
| | | label: item.name, |
| | | value: item.id, |
| | | })); |
| | | } |
| | | } catch (error) { |
| | | console.error("加载项目列表失败:", error); |
| | | } |
| | | }, |
| | | |
| | | // 加载表格数据 |
| | | async loadTableData() { |
| | | this.loading = true; |
| | | try { |
| | | const params = { |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.searchForm, |
| | | type: this.currentType, |
| | | }; |
| | | |
| | | // 过滤掉空值 |
| | | Object.keys(params).forEach((key) => { |
| | | if (params[key] === null || params[key] === "") { |
| | | delete params[key]; |
| | | } |
| | | }); |
| | | |
| | | const res = await getHiddenDangerList(params); |
| | | if (res ) { |
| | | this.tableData = res.records || []; |
| | | this.total = res.total || 0; |
| | | } |
| | | } catch (error) { |
| | | console.error("加载表格数据失败:", error); |
| | | this.$message.error("加载数据失败"); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | // 搜索 |
| | | handleSearch() { |
| | | this.pageNum = 1; |
| | | this.loadTableData(); |
| | | }, |
| | | |
| | | // 点击日期选择器 |
| | | handleClick(type) { |
| | | if (type === 1) { |
| | | this.$refs.datetime1.focus(); |
| | | } else { |
| | | this.$refs.datetime2.focus(); |
| | | } |
| | | }, |
| | | |
| | | // 获取隐患等级文本 |
| | | getLevelText(level) { |
| | | const key = `P${level + 1}`; |
| | | return errorLevelMap[key] || "-"; |
| | | }, |
| | | |
| | | // 获取整改状态文本 |
| | | getReformedText(reformed) { |
| | | return reformed ? "已整改" : "未整改"; |
| | | }, |
| | | |
| | | // 预览图片 |
| | | handlePreviewImages(userFiles) { |
| | | if (!userFiles || userFiles.length === 0) { |
| | | this.$message.warning("暂无图片"); |
| | | return; |
| | | } |
| | | this.previewImages = userFiles.map((file) => file.url || file.name); |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | // 编辑责任人 |
| | | handleEditPeople(row) { |
| | | this.currentEditRow = row; |
| | | this.peopleName = row.responsiblePerson || ""; |
| | | this.updatePeople = true; |
| | | }, |
| | | |
| | | // 关闭编辑责任人弹窗 |
| | | closeUpdatePeople() { |
| | | this.updatePeople = false; |
| | | this.peopleName = ""; |
| | | this.currentEditRow = null; |
| | | }, |
| | | saveUpdatePeople() { |
| | | |
| | | // 保存责任人 |
| | | async saveUpdatePeople() { |
| | | if (!this.peopleName) { |
| | | this.$message({ |
| | | message: "请输入责任人", |
| | |
| | | }); |
| | | return; |
| | | } |
| | | this.$message({ |
| | | message: "保存成功", |
| | | type: "success", |
| | | }); |
| | | this.closeUpdatePeople(); |
| | | |
| | | try { |
| | | await editHiddenDangerResponsiblePerson({ |
| | | id: this.currentEditRow.id, |
| | | responsiblePerson: this.peopleName, |
| | | }); |
| | | |
| | | this.$message({ |
| | | message: "保存成功", |
| | | type: "success", |
| | | }); |
| | | |
| | | // 更新表格数据 |
| | | this.currentEditRow.responsiblePerson = this.peopleName; |
| | | this.closeUpdatePeople(); |
| | | } catch (error) { |
| | | console.error("保存责任人失败:", error); |
| | | this.$message.error("保存失败"); |
| | | } |
| | | }, |
| | | |
| | | // 查看详情 |
| | | async handleViewDetail(row) { |
| | | try { |
| | | // 保存当前行数据 |
| | | this.currentRow = row; |
| | | |
| | | const res = await getHiddenDangerDetail(row.problemId); |
| | | if (res && res) { |
| | | this.detailData = res; |
| | | this.detailVisible = true; |
| | | this.activeName = "first"; |
| | | } |
| | | } catch (error) { |
| | | console.error("加载详情失败:", error); |
| | | this.$message.error("加载详情失败"); |
| | | } |
| | | }, |
| | | |
| | | // 切换详情 tab |
| | | handleClickTab(tab) { |
| | | this.activeName = tab.name; |
| | | }, |
| | | |
| | | // 获取复查记录标签 |
| | | getReviewRecordsLabel() { |
| | | if (!this.detailData || !this.detailData.errorReview) { |
| | | return '复查记录(无)'; |
| | | } |
| | | return '复查记录'; |
| | | }, |
| | | |
| | | // 获取复查状态文本 |
| | | getReviewStateText(state) { |
| | | const stateMap = { |
| | | 0: '未整改', |
| | | 1: '部分整改', |
| | | 2: '已整改' |
| | | }; |
| | | return stateMap[state] || '-'; |
| | | }, |
| | | |
| | | // 预览复查图片(需要添加前缀) |
| | | handlePreviewReviewImages(imgArray) { |
| | | if (!imgArray || imgArray.length === 0) { |
| | | this.$message.warning("暂无图片"); |
| | | return; |
| | | } |
| | | // 图片没有前缀,需要根据实际情况添加图片服务器地址前缀 |
| | | // 假设图片服务器地址为 process.env.VUE_APP_IMG_BASE_URL 或者其他配置 |
| | | const baseUrl = process.env.VUE_APP_IMG_BASE_URL || ''; |
| | | this.previewImages = imgArray.map((img) => { |
| | | // 如果图片已经是完整URL,直接返回;否则添加前缀 |
| | | if (img.startsWith('http://') || img.startsWith('https://')) { |
| | | return img; |
| | | } |
| | | return baseUrl + img; |
| | | }); |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | // 获取问题数量名称(取第一条数据的 name) |
| | | getNumberFactorName() { |
| | | if (this.detailData && this.detailData.numberFactors && this.detailData.numberFactors.length > 0) { |
| | | try { |
| | | const firstItem = typeof this.detailData.numberFactors[0] === 'string' |
| | | ? JSON.parse(this.detailData.numberFactors[0]) |
| | | : this.detailData.numberFactors[0]; |
| | | return firstItem.name || '-'; |
| | | } catch (error) { |
| | | console.error('解析 numberFactors 失败:', error); |
| | | return '-'; |
| | | } |
| | | } |
| | | return '-'; |
| | | }, |
| | | |
| | | // 获取扣除分数(取第一条数据的 deductPoint) |
| | | getNumberFactorDeductPoint() { |
| | | if (this.detailData && this.detailData.numberFactors && this.detailData.numberFactors.length > 0) { |
| | | try { |
| | | const firstItem = typeof this.detailData.numberFactors[0] === 'string' |
| | | ? JSON.parse(this.detailData.numberFactors[0]) |
| | | : this.detailData.numberFactors[0]; |
| | | const deductPoint = firstItem.deductPoint; |
| | | return deductPoint !== undefined && deductPoint !== null ? deductPoint : '-'; |
| | | } catch (error) { |
| | | console.error('解析 numberFactors 失败:', error); |
| | | return '-'; |
| | | } |
| | | } |
| | | return '-'; |
| | | }, |
| | | |
| | | // 获取附加加分(取第一条数据的 additionPoint) |
| | | getNumberFactorAdditionPoint() { |
| | | if (this.detailData && this.detailData.numberFactors && this.detailData.numberFactors.length > 0) { |
| | | try { |
| | | const firstItem = typeof this.detailData.numberFactors[0] === 'string' |
| | | ? JSON.parse(this.detailData.numberFactors[0]) |
| | | : this.detailData.numberFactors[0]; |
| | | const additionPoint = firstItem.additionPoint; |
| | | return additionPoint !== undefined && additionPoint !== null ? additionPoint : '-'; |
| | | } catch (error) { |
| | | console.error('解析 numberFactors 失败:', error); |
| | | return '-'; |
| | | } |
| | | } |
| | | return '-'; |
| | | }, |
| | | |
| | | // 返回 |
| | | backFun() { |
| | | this.$router.go(-1); |
| | | }, |
| | | |
| | | // 分页-每页条数改变 |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | this.pageSize = val; |
| | | this.pageNum = 1; |
| | | this.loadTableData(); |
| | | }, |
| | | |
| | | // 分页-当前页改变 |
| | | handleCurrentChange(val) { |
| | | console.log(`当前页: ${val}`); |
| | | this.pageNum = val; |
| | | this.loadTableData(); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | |
| | | .color1 { |
| | | color: rgba(255, 255, 255, 0.9); |
| | | } |
| | | |
| | | .min-h--60 { |
| | | min-height: 60px; |
| | | } |
| | | |
| | | .bgcolor1 { |
| | |
| | | } |
| | | |
| | | ::v-deep .el-input__suffix { |
| | | display: none; |
| | | } |
| | | |
| | | ::v-deep .el-input__prefix { |
| | | display: none; |
| | | } |
| | | |
| | |
| | | opacity: 0; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |