123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <!--巡查管理-->-
- <template>
- <div class="app-container inspectionManagement">
- <div class="page-container" v-if="pageType == 1">
- <div class="page-form-title-box">
- <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
- <div class="form-button-max-big-box">
- <div class="form-button-big-box">
- <p class="text-p" :class="queryParams.manageStatus=='-1'?'checkDiv':''" @click="topLeftClickType('-1')">全部</p>
- <p class="text-p" :class="queryParams.manageStatus=='0'?'checkDiv':''" @click="topLeftClickType('0')">待检查</p>
- <p class="text-p" :class="queryParams.manageStatus=='1'?'checkDiv':''" @click="topLeftClickType('1')">检查中</p>
- <p class="text-p" :class="queryParams.manageStatus=='2'?'checkDiv':''" @click="topLeftClickType('2')">已检查</p>
- </div>
- </div>
- <!--与我相关-->
- <div class="form-button-max-big-box-me">
- <div class="form-button-big-box-me">
- <div :class="queryParams.myRelated==1?'checkDiv-me':''" @click="topRightClickType">
- <p class="text-p-me">与我相关{{correlationNum}}</p>
- <p class="el-icon-check icon-p-me" v-if="queryParams.myRelated==1"></p>
- </div>
- </div>
- </div>
- <el-form-item label="" style="margin-left:10px;" prop="searchValue">
- <el-input
- maxLength="30"
- v-model="queryParams.searchValue"
- placeholder="计划标题/实验室/房间号/检查者"
- clearable
- style="width: 250px"
- />
- </el-form-item>
- <el-form-item label="" prop="deptId" label-width="50px">
- <el-select v-model="queryParams.deptId" clearable placeholder="请选择学院" style="width: 150px">
- <el-option
- v-for="item in deptSelectList"
- :key="item.deptId"
- :label="item.deptName"
- :value="item.deptId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="dateRange" label-width="70px">
- <el-date-picker
- :clearable="false"
- v-model="dateRange"
- size="small"
- style="width: 240px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <p class="page-inquire-common-style-button" @click="handleQuery" style="margin-right:10px;">查询</p>
- <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
- </el-form>
- </div>
- <div class="page-content-box">
- <el-table class="table-box" border :data="tableList" ref="multipleTable" @sort-change="sortChange">
- <el-table-column label="序号" align="center" type="index" width="60" fixed/>
- <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip width="250" fixed/>
- <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="220" fixed>
- <template slot-scope="scope">{{scope.row.roomNumber?scope.row.subjectName+'-'+scope.row.roomNumber:scope.row.subjectName}}</template>
- </el-table-column>
- <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="150"/>
- <el-table-column label="检查类型" align="center" prop="checkRange" show-overflow-tooltip width="120">
- <template slot-scope="scope">
- <p>{{scope.row.checkCategory==1?'综合检查':(scope.row.checkCategory==2?'专项检查':'-')}}</p>
- </template>
- </el-table-column>
- <el-table-column label="检查状态" align="center" prop="manageStatus" show-overflow-tooltip width="90">
- <template slot-scope="scope">
- <p :class="scope.row.manageStatus==0?'manageStatus-color-1':(scope.row.manageStatus==1?'manageStatus-color-2':(scope.row.manageStatus==2?'manageStatus-color-3':''))">{{scope.row.manageStatus==0?'待检查':(scope.row.manageStatus==1?'检查中':(scope.row.manageStatus==2?'已检查':''))}}</p>
- </template>
- </el-table-column>
- <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
- <el-table-column label="检查结果" align="center" prop="checkResult" show-overflow-tooltip width="80">
- <template slot-scope="scope">
- <p>{{scope.row.checkResult==0?'不符合':(scope.row.checkResult==1?'符合':'')}}</p>
- </template>
- </el-table-column>
- <el-table-column label="隐患数" align="center" prop="dangerNum" show-overflow-tooltip width="80"/>
- <el-table-column label="整改进度" align="center" prop="rectifySchedule" show-overflow-tooltip width="200"/>
- <el-table-column label="计划周期" align="center" prop="startTime" show-overflow-tooltip width="270">
- <template slot-scope="scope">
- <p>{{scope.row.cycleStartTime}} 至 {{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
- </template>
- </el-table-column>
- <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="157"/>
- <el-table-column label="操作" align="center" prop="deptName" width="280">
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:detail']"
- v-show="scope.row.manageStatus==0||scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
- <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
- v-show="scope.row.manageStatus==1 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">编辑</p>
- <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
- v-show="scope.row.manageStatus==0 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">开始检查</p>
- <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
- style="color:#999" v-show="scope.row.manageStatus==0 && scope.row.isCheck==0 && scope.row.isSelfData==1">开始检查</p>
- <p class="table-button-p" v-show="scope.row.isEndProcess==1 && scope.row.checkResult==0" @click="lookDocumentButton(1,scope.row)">整改报告</p>
- <p class="table-button-p" v-show="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</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>
- <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
- <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
- <lookDocumentDataDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDataDialog>
- <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
- </div>
- </template>
- <script>
- import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
- import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
- import lookDocumentDataDialog from '@/components/lookDocumentDialog/lookDocumentDataDialog.vue'
- import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
- // V3
- import {
- getDeptDropList
- } from '@/api/commonality/permission'
- import {
- checkManageList, getFindByCheckPlanId
- } from '@/api/safetyCheck/indexTow'
- export default {
- name: 'index',
- components: {
- addPage,
- infoPage,
- lookDocumentDataDialog,
- lookDocumentListDialog
- },
- data(){
- return{
- //子组件数据
- lookDocumentType:false,
- propsLookDocumentData:{},
- lookDocumentListType:false,
- propsLookDocumentListData:{},
- propsAddData:{},
- propsInfoData:{},
- //学院列表
- deptSelectList:[],
- pageType:1,
- queryParams:{
- page:1,
- pageSize:20,
- checkType:1,
- manageStatus:'-1',
- checkTimeSort:0,
- searchValue:"",
- deptId:"",
- myRelated:1,
- },
- dateRange:[],
- tableList:[],
- total:0,
- correlationNum:'',
- }
- },
- created(){
- if(this.$route.query.id){
- this.goAddPage(2,this.$route.query.id);
- }
- },
- mounted(){
- this.getDeptDropList();
- this.getList();
- },
- methods:{
- //获取相关数量
- getCorrelationNum(){
- checkManageList({
- page:1,
- pageSize:20,
- checkType:1,
- checkTimeSort:0,
- myRelated:1,
- manageStatus:this.queryParams.manageStatus,
- searchValue:this.queryParams.searchValue,
- deptId:this.queryParams.deptId,
- startTime:this.dateRange[0]?this.dateRange[0]+'T00:00:00':'',
- endTime:this.dateRange[1]?this.dateRange[1]+'T23:59:59':'',
- }).then(response => {
- this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
- });
- },
- //开始检查
- goAddPage(type,id){
- if(this.pageType != type){
- if(type == 1){
- //返回
- this.$set(this,'pageType',type);
- }else if(type == 2){
- //开始检查/编辑
- this.$set(this,'propsAddData',{
- id:id,
- title:'校院巡查',
- });
- this.$set(this,'pageType',type);
- }else if(type == 3){
- //详情
- this.$set(this,'propsInfoData',{id:id});
- this.$set(this,'pageType',type);
- }else if(type == 4){
- //返回并刷新
- this.getList();
- this.$set(this,'pageType',1);
- }
- }
- },
- //时间排序方法
- sortChange(val){
- if(val.prop == 'checkTime'){
- this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
- this.handleQuery();
- }
- },
- //范围选择
- topLeftClickType(type){
- if(this.queryParams.manageStatus != type){
- this.$set(this.queryParams,'manageStatus',type);
- this.handleQuery();
- }
- },
- //与我相关按钮
- topRightClickType(){
- this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
- this.handleQuery();
- },
- //获取数据列表
- getList(){
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- if(this.dateRange[0]){
- obj.startTime = this.dateRange[0]+'T00:00:00';
- obj.endTime = this.dateRange[1]+'T23:59:59';
- }else{
- obj.startTime = "";
- obj.endTime = "";
- }
- let self = this;
- setTimeout(function(){
- self.getCorrelationNum();
- },500);
- checkManageList(obj).then(response => {
- this.total = response.data.total;
- this.tableList = response.data.records;
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.$set(this.queryParams,'page',1);
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.$set(this,'dateRange',[]);
- this.$set(this,'queryParams',{
- page:1,
- pageSize:20,
- checkType:1,
- manageStatus:'-1',
- checkTimeSort:0,
- searchValue:"",
- deptId:"",
- myRelated:1,
- });
- this.handleQuery();
- },
- //查看单个文档
- lookDocumentButton(type,row){
- if(type==1){
- this.$set(this,'propsLookDocumentData',{
- title:"整改报告",
- type:1,
- id:row.id,
- name:row.title
- });
- this.$set(this,'lookDocumentType',true);
- }else{
- this.$set(this,'lookDocumentType',false);
- }
- },
- //查看多个文档
- lookDocumentListButton(type,row){
- if(type==1){
- getFindByCheckPlanId({checkPlanId:row.checkPlanId}).then(response => {
- let list = [];
- for(let i=0;i<response.data.length;i++){
- let obj = {
- name:response.data[i].fileName,
- url:response.data[i].fileUrl,
- }
- list.push(obj);
- }
- this.$set(this,'propsLookDocumentListData',{
- title:"查看附件",
- list:list
- });
- this.$set(this,'lookDocumentListType',true);
- });
- }else{
- this.$set(this,'lookDocumentListType',false);
- }
- },
- //获取学院列表
- getDeptDropList(){
- getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
- this.$set(this, 'deptSelectList', response.data)
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- ::v-deep .el-table__body-wrapper{
- padding-bottom: 8px;
- }
- ::v-deep .el-table__fixed{
- margin-top:-1px;
- margin-left:-1px;
- height:calc(100% - 8px)!important;
- }
- ::v-deep .el-table__fixed-body-wrapper{
- height: calc(100% - 48px);
- overflow-y: auto;
- }
- .inspectionManagement{
- flex: 1;
- display: flex !important;
- flex-direction: column;
- overflow: hidden;
- .page-container{
- .page-form-title-box{
- .form-button-max-big-box{
- display: inline-block;
- overflow: hidden;
- .form-button-big-box{
- display: flex;
- p:nth-child(1){
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(2){
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(3){
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(4){
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- border-right:1px solid #E0E0E0;
- }
- p{
- height:40px;
- width:80px;
- line-height: 40px;
- text-align: center;
- color:#666666;
- font-size:14px;
- font-weight:500;
- cursor: pointer;
- border-left:1px solid #E0E0E0;
- }
- .checkDiv{
- color:#fff!important;
- border:1px solid #0183FA!important;
- background-color: #0183FA;
- }
- }
- }
- .form-button-max-big-box-me{
- display: inline-block;
- overflow: hidden;
- .form-button-big-box-me{
- display: flex;
- div{
- position: relative;
- height:40px;
- width:130px;
- line-height: 40px;
- text-align: center;
- color:#999;
- font-size:14px;
- border:1px solid #999;
- border-radius:4px;
- margin-left:10px;
- 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>
|