123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- <!-- 检查管理 -->
- <template>
- <div class="app-container inspectManage">
- <div class="page-container inspectManagePage" v-if="pageType === 1">
- <!--左侧计划栏-->
- <div class="page-content-left-box">
- <!--计划栏搜索框-->
- <div>
- <el-form :model="leftQueryParams" class="form-box" ref="leftQueryForm"
- :inline="true" style="width:100%;">
- <el-form-item label="" prop="searchValue">
- <el-input
- maxLength="30"
- v-model="leftQueryParams.searchValue"
- placeholder="计划标题"
- clearable
- @clear="leftClear"
- style="width: 365px"
- />
- </el-form-item>
- <p class="page-save-common-style-button" style="width:80px;display: inline-block" @click="leftHandleQuery">查询</p>
- </el-form>
- </div>
- <!--计划栏列表-->
- <div class="left-max-list-box scrollbar-box">
- <div class="left-list-for-max-big-box" v-for="(bigItem,bigIndex) in leftListData" :key="bigIndex">
- <div class="left-list-title-box" @click="leftBigCheckButton(bigIndex)">
- <p :class="bigIndex == leftBigCheckType?'el-icon-caret-bottom':'el-icon-caret-right'"></p>
- <p>{{bigItem.planTitle}}</p>
- <p>{{bigItem.checkTypeName}}</p>
- </div>
- <div class="left-list-box">
- <div class="left-list-for-box" v-if="bigIndex == leftBigCheckType"
- @click="leftCheckButton(index,bigIndex)"
- :class="index == leftCheckType ? 'check-left-list-for-box':''"
- v-for="(item,index) in bigItem.checkPlanSetVoList" :key="index">
- <div class="left-list-text-box">
- <p>{{item.checkName}}</p>
- <p>检查开始时间:{{parseTime(item.checkStartTime,"{y}-{m}-{d}")}}</p>
- </div>
- <div class="left-list-progress-box">
- <el-progress :stroke-width="14" :percentage="item.checkSetProgress"></el-progress>
- </div>
- </div>
- </div>
- </div>
- <p v-if="!leftListData[0]" class="left-list-for-null-p">暂无数据</p>
- </div>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="titleTotal>0"
- :total="titleTotal"
- :page.sync="leftQueryParams.page"
- :limit.sync="leftQueryParams.pageSize"
- @pagination="getTitleList"
- />
- </div>
- <div class="page-content-center-box"></div>
- <!--右侧数据表格-->
- <div class="page-content-right-box">
- <div class="page-form-title-box" style="border:none;" :class="advancedType?'page-advanced-form-title-box':''">
- <el-form :model="queryParams" class="form-box" ref="queryForm"
- :inline="true" style="width:100%;">
- <div class="table-school-college-toggle-box">
- <p :class="tableButtonCheckType===''?'p-check':''" @click="tableCheck('')">全部</p>
- <p :class="tableButtonCheckType===0?'p-check':''" @click="tableCheck(0)">待检查</p>
- <p :class="tableButtonCheckType===1?'p-check':''" @click="tableCheck(1)">检查中</p>
- <p :class="tableButtonCheckType===2?'p-check':''" @click="tableCheck(2)">已检查</p>
- </div>
- <el-form-item label="" prop="deptId">
- <el-select v-model="queryParams.deptId" placeholder="学院单位" style="width:157px;">
- <el-option
- v-for="dict in deptOption"
- :key="dict.deptId"
- :label="dict.deptName"
- :value="dict.deptId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="floorId">
- <!--<el-select v-model="queryParams.floorId" placeholder="楼栋" style="width:150px;">-->
- <!--<el-option-->
- <!--v-for="dict in buildOption"-->
- <!--:key="dict.id"-->
- <!--:label="dict.name"-->
- <!--:value="dict.id"-->
- <!--/>-->
- <!--</el-select>-->
- <el-cascader
- style="width: 150px"
- placeholder="楼栋"
- v-model="queryParams.floorId"
- filterable
- :show-all-levels="false"
- :options="buildOption"
- :props="{ value: 'id', label: 'name',emitPath:false }"
- ></el-cascader>
- </el-form-item>
- <el-form-item label="" prop="typeId" v-if="advancedType">
- <el-select v-model="queryParams.typeId" placeholder="安全分类" style="width:175px;">
- <el-option
- v-for="dict in classOption"
- :key="dict.typeId"
- :label="dict.typeName"
- :value="dict.typeId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="levelId" v-if="advancedType">
- <el-select v-model="queryParams.levelId" placeholder="安全分级" style="width:175px;">
- <el-option
- v-for="dict in levelOption"
- :key="dict.levelId"
- :label="dict.levelName"
- :value="dict.levelId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="searchValue" v-if="advancedType">
- <el-input
- maxLength="30"
- v-model="queryParams.searchValue"
- placeholder="实验室/房间号"
- style="width:170px;"
- />
- </el-form-item>
- <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
- <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
- <p class="page-save-common-style-button" style="display: inline-block;margin-left:10px;" @click="searchToggle">{{advancedType?'普通搜索':'高级搜索'}}</p>
- </el-form>
- </div>
- <div class="page-conten-box page-content-right-bottom-box">
- <el-table class="table-box" v-loading="loading" border :data="dataList">
- <el-table-column label="序号" type="index" width="60"/>
- <el-table-column label="实验室" prop="subName" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.subName}}{{scope.row.roomNum?'('+scope.row.roomNum+')':''}}</span>
- </template>
- </el-table-column>
- <el-table-column label="检查状态" prop="manageStatus" width="150" show-overflow-tooltip>
- <template slot-scope="scope">
- <span :class="scope.row.manageStatus==0?'colorA':(scope.row.manageStatus==1?'colorB':(scope.row.manageStatus==2?'colorC':''))">
- {{scope.row.manageStatus==0?'待检查':(scope.row.manageStatus==1?'检查中':(scope.row.manageStatus==2?'已检查':''))}}
- </span>
- </template>
- </el-table-column>
- <el-table-column label="检查人" prop="checkUserNames" width="230" show-overflow-tooltip/>
- <el-table-column label="操作" width="240" show-overflow-tooltip >
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p"
- @click="tableButton(1,scope.row)"
- v-hasPermiRouter="['security:checkSetOption:list']"
- >检查项</p>
- <p class="table-button-p"
- v-if='scope.row.manageStatus !=2'
- @click="tableButton(2,scope.row)"
- v-hasPermiRouter="['security:checkPlan:detail']"
- >检查</p>
- <p class="table-button-p"
- v-if='scope.row.manageStatus !=2'
- @click="tableButton(3,scope.row)"
- v-hasPermiRouter="['security:checkSetOption:batch']"
- >检查完成</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.page"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </div>
- </div>
- <checkItem :propsData="propsData" v-if="pageType === 2"></checkItem>
- <initiateInspect v-if="pageType == 3" :initiateInspectData="initiateInspectData"></initiateInspect>
- </div>
- </template>
- <script>
- import {
- getDeptDropList,
- systemBuildingGetOptList,
- laboratoryClassLevelGetList,
- laboratoryClassTypeGetList,
- } from '@/api/commonality/permission'
- import {
- securityCheckPlanTitleList,
- securityCheckManageList,
- securityCheckSetOptionFinishCheck,
- } from '@/api/safetyCheck/index'
- import checkItem from "@/views/safetyCheck/components/checkItem.vue";
- import initiateInspect from "@/views/safetyCheck/components/initiateInspect/initiateInspect.vue";
- export default {
- name: 'index',
- components: {
- checkItem,
- initiateInspect,
- },
- data () {
- return {
- //页面状态
- pageType:1,
- //复查状态选项卡
- tableButtonCheckType:'',
- //页面遮罩
- loading:false,
- //学院
- deptOption:[],
- //楼栋
- buildOption:[],
- //分级
- levelOption:[],
- //分类
- classOption:[],
- //计划查询条件
- leftQueryParams:{
- checkCategory:1,
- searchValue:'',
- page:1,
- pageSize:20,
- },
- titleTotal:0,
- //查询条件
- queryParams:{
- page:1,
- pageSize:20,
- myRelated:1,
- deptId:null,
- floorId:null,
- typeId :null,
- levelId :null,
- searchValue:'',
- },
- //时间数据
- dateRange:[],
- //搜索模式切换
- advancedType:false,
- //列表数据
- dataList:[],
- //数据数量
- total:0,
- //组件传参
- propsData:{},
- leftBigCheckType:"0",
- leftCheckType:"0",
- leftListData:[],
- checkSetProgress:0,
- //检查组件
- initiateInspectData:{},
- }
- },
- created () {
- },
- mounted () {
- this.getTitleList();
- this.getDeptDropList();
- this.systemBuildingGetOptList();
- this.laboratoryClassLevelGetList();
- this.laboratoryClassTypeGetList();
- },
- methods: {
- //左侧清除查询按钮
- leftClear(){
- this.$set(this.leftQueryParams,'searchValue','');
- this.getTitleList();
- },
- //左侧查询按钮
- leftHandleQuery(){
- this.getTitleList();
- },
- //左侧计划切换
- leftBigCheckButton(index){
- if(this.leftBigCheckType !== index){
- this.$set(this,'leftBigCheckType',index);
- this.$set(this,'leftCheckType',0);
- this.$set(this,'checkSetProgress',this.leftListData[index].checkPlanSetVoList[0].checkSetProgress);
- this.resetQuery();
- }
- },
- //左侧计划子级切换
- leftCheckButton(index,bigIndex){
- if(this.leftCheckType !== index){
- this.$set(this,'leftCheckType',index);
- this.$set(this,'checkSetProgress',this.leftListData[bigIndex].checkPlanSetVoList[index].checkSetProgress);
- this.resetQuery();
- }
- },
- //复查状态选项卡切换
- tableCheck(type){
- if (this.tableButtonCheckType !== type){
- this.$set(this,'tableButtonCheckType',type);
- this.resetQuery();
- }
- },
- //搜索模式切换
- searchToggle(){
- this.$set(this,'advancedType',!this.advancedType);
- },
- //查询按钮
- handleQuery(){
- this.$set(this.queryParams,'page',1);
- this.getList();
- },
- //重置按钮
- resetQuery(){
- this.$set(this,'dateRange',[])
- this.$set(this,'queryParams',{
- page:1,
- pageSize:20,
- deptId:null,
- floorId:null,
- typeId :null,
- levelId :null,
- searchValue:'',
- });
- this.getList();
- },
- //获取计划数据列表
- getTitleList(){
- securityCheckPlanTitleList(this.leftQueryParams).then(response => {
- this.$set(this,'leftListData',response.data.records);
- this.$set(this,'titleTotal',response.data.total);
- this.$set(this,'leftBigCheckType',0);
- this.$set(this,'leftCheckType',0);
- this.resetQuery();
- if(response.data.records[0]){
- this.$set(this,'checkSetProgress',this.leftListData[0].checkPlanSetVoList[0].checkSetProgress);
- }
- });
- },
- getTitleListTwo(){
- securityCheckPlanTitleList(this.leftQueryParams).then(response => {
- this.$set(this,'leftListData',response.data.records);
- this.$set(this,'titleTotal',response.data.total);
- this.getList();
- });
- },
- //获取数据列表
- getList(){
- if(!this.leftListData[0]){
- this.$set(this,'dataList',[]);
- this.$set(this,'total',0);
- return
- }
- this.$set(this,'loading',true);
- let obj = {
- planSetId:this.leftListData[this.leftBigCheckType].checkPlanSetVoList[this.leftCheckType].planSetId,
- page:this.queryParams.page,
- pageSize:this.queryParams.pageSize,
- manageStatus:this.tableButtonCheckType,
- deptId:this.queryParams.deptId,
- floorId:this.queryParams.floorId,
- }
- if(this.advancedType){
- obj.searchValue = this.queryParams.searchValue;
- obj.typeId = this.queryParams.typeId;
- obj.levelId = this.queryParams.levelId;
- }
- securityCheckManageList(obj).then(response => {
- this.$set(this,'loading',false);
- this.$set(this,'dataList',response.data.records);
- this.$set(this,'total',response.data.total);
- });
- },
- //操作按钮
- tableButton(type,row){
- let self = this;
- if(type == 1){
- //检查项列表
- this.$set(this,'pageType',2);
- let obj = JSON.parse(JSON.stringify(row))
- obj.showType = true;
- obj.pageType = 1;
- obj.checkSetProgress = this.checkSetProgress;
- this.$set(this,'propsData',obj);
- }else if(type == 2){
- //开始检查
- this.$set(this,'pageType',3);
- let obj = JSON.parse(JSON.stringify(row))
- obj.freeChoiceType = true;
- obj.showType = false;
- obj.orderTitle = '开始检查';
- obj.orderType = '1';
- this.$set(this,'initiateInspectData',obj);
- }else if(type == 3){
- //批量完成
- this.$confirm(`是否确认检查完成?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(async () => {
- securityCheckSetOptionFinishCheck({manageId:row.manageId }).then(response => {
- self.msgSuccess(response.message)
- self.getTitleListTwo();
- });
- }).catch(() => {
- })
- }else if(type == 6){
- //返回并刷新
- this.$set(this,'pageType',1);
- this.getTitleListTwo();
- }
- },
- /*********************************** 学院/楼栋/分类/分级 ***********************************/
- //学院下拉列表
- getDeptDropList(){
- getDeptDropList({level: 2, deptType: 1 }).then(response => {
- this.$set(this,'deptOption',response.data);
- });
- },
- //楼栋下拉列表
- systemBuildingGetOptList(){
- systemBuildingGetOptList({}).then(response => {
- let list = this.handleTree(response.data);
- pushNode(list)
- function pushNode(list){
- for(let i=0;i<list.length;i++){
- if(!list[i].children && list[i].type!= 3){
- list.splice(i,1)
- i--
- }if(list[i].children){
- pushNode(list[i].children)
- }
- }
- }
- this.$set(this,'buildOption',list);
- });
- },
- //分级下拉列表
- laboratoryClassLevelGetList(){
- laboratoryClassLevelGetList({}).then(response => {
- this.$set(this,'levelOption',response.data);
- });
- },
- //分类下拉列表
- laboratoryClassTypeGetList(){
- laboratoryClassTypeGetList({}).then(response => {
- this.$set(this,'classOption',response.data);
- });
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .inspectManage{
- .inspectManagePage{
- overflow: hidden;
- display: flex;
- flex-direction: row;
- flex:1;
- .page-content-left-box{
- width: 480px;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- margin:20px 0 20px 20px;
- padding-right:10px;
- .left-max-list-box{
- flex:1;
- padding-right:10px;
- .left-list-for-max-big-box{
- .left-list-title-box{
- cursor: pointer;
- display: flex;
- p{
- height:30px;
- line-height:30px;
- margin:15px 0;
- }
- p:nth-child(1){
- font-size:16px;
- width:30px;
- }
- p:nth-child(2){
- font-size:16px;
- flex:1;
- /*单行省略号*/
- display:block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap;
- }
- p:nth-child(3){
- font-size:14px;
- width:80px;
- height:30px;
- text-align: center;
- color:#fff;
- background-color: #0183FA;
- border-radius:4px;
- }
- }
- .left-list-box{
- .left-list-for-box{
- cursor: pointer;
- display: flex;
- height:70px;
- background-color: #F5F5F5;
- padding:5px 23px;
- .left-list-text-box{
- width:240px;
- p{
- height:30px;
- line-height: 30px;
- font-size:16px;
- /*单行省略号*/
- display:block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap;
- }
- p:nth-child(2){
- color:#666666;
- }
- }
- .left-list-progress-box{
- flex:1;
- padding-top:15px;
- ::v-deep .el-progress-bar{
- margin-right: -62px;
- }
- }
- }
- .check-left-list-for-box{
- background: rgba(1,131,250,0.1);
- }
- }
- }
- .left-list-for-null-p{
- text-align: center;
- line-height:400px;
- color:#999;
- }
- }
- }
- .page-content-center-box{
- margin:20px 0;
- border-right:1px dashed #dedede;
- }
- .page-content-right-box{
- display: flex;
- flex-direction: column;
- overflow: hidden;
- flex:1;
- .page-content-right-bottom-box{
- display: flex;
- flex-direction: column;
- overflow: hidden;
- flex:1;
- padding:0 20px 20px;
- .colorA{
- color:#FA4A04;
- }
- .colorB{
- color:#0484FA;
- }
- .colorC{
- color:#039C06;
- }
- }
- }
- .table-school-college-toggle-box{
- overflow: hidden;
- display: inline-block;
- margin-right:10px;
- p{
- display: inline-block;
- text-align: center;
- width:80px;
- line-height:40px;
- height:40px;
- color:#333;
- background-color: #fff;
- border:1px solid #E0E0E0;
- font-size:14px;
- cursor: pointer;
- }
- p:nth-child(1){
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- /*border-right:none;*/
- }
- p:nth-child(4){
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- /*border-left:none;*/
- }
- .p-check{
- border:1px solid #0183FA;
- background-color: #0183FA;
- color:#fff;
- }
- }
- .form-button-max-big-box-me{
- display: inline-block;
- overflow: hidden;
- margin-right:10px;
- .form-button-big-box-me{
- display: flex;
- div{
- position: relative;
- height:40px;
- width:100px;
- line-height: 40px;
- text-align: center;
- color:#999;
- font-size:14px;
- border:1px solid #999;
- border-radius:4px;
- font-weight:500;
- cursor: pointer;
- .icon-p-me{
- width:15px;
- height:15px;
- line-height:15px;
- text-align: center;
- position: absolute;
- right:0;
- bottom:0;
- color:#fff;
- background: #0183fa;
- border-top-left-radius:4px;
- }
- }
- .checkDiv-me{
- color:#0183FA!important;
- border:1px solid #0183FA!important;
- }
- }
- }
- }
- }
- </style>
|