index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <!-- 检查管理 -->
  2. <template>
  3. <div class="app-container inspectManage">
  4. <div class="page-container inspectManagePage" v-if="pageType === 1">
  5. <!--左侧计划栏-->
  6. <div class="page-content-left-box">
  7. <!--计划栏搜索框-->
  8. <div>
  9. <el-form :model="leftQueryParams" class="form-box" ref="leftQueryForm"
  10. :inline="true" style="width:100%;">
  11. <el-form-item label="" prop="searchValue">
  12. <el-input
  13. maxLength="30"
  14. v-model="leftQueryParams.searchValue"
  15. placeholder="计划标题"
  16. clearable
  17. @clear="leftClear"
  18. style="width: 365px"
  19. />
  20. </el-form-item>
  21. <p class="page-save-common-style-button" style="width:80px;display: inline-block" @click="leftHandleQuery">查询</p>
  22. </el-form>
  23. </div>
  24. <!--计划栏列表-->
  25. <div class="left-max-list-box scrollbar-box">
  26. <div class="left-list-for-max-big-box" v-for="(bigItem,bigIndex) in leftListData" :key="bigIndex">
  27. <div class="left-list-title-box" @click="leftBigCheckButton(bigIndex)">
  28. <p :class="bigIndex == leftBigCheckType?'el-icon-caret-bottom':'el-icon-caret-right'"></p>
  29. <p>{{bigItem.planTitle}}</p>
  30. <p>{{bigItem.checkTypeName}}</p>
  31. </div>
  32. <div class="left-list-box">
  33. <div class="left-list-for-box" v-if="bigIndex == leftBigCheckType"
  34. @click="leftCheckButton(index,bigIndex)"
  35. :class="index == leftCheckType ? 'check-left-list-for-box':''"
  36. v-for="(item,index) in bigItem.checkPlanSetVoList" :key="index">
  37. <div class="left-list-text-box">
  38. <p>{{item.checkName}}</p>
  39. <p>检查开始时间:{{parseTime(item.checkStartTime,"{y}-{m}-{d}")}}</p>
  40. </div>
  41. <div class="left-list-progress-box">
  42. <el-progress :stroke-width="14" :percentage="item.checkSetProgress"></el-progress>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <p v-if="!leftListData[0]" class="left-list-for-null-p">暂无数据</p>
  48. </div>
  49. <pagination :page-sizes="[20, 30, 40, 50]"
  50. v-show="titleTotal>0"
  51. :total="titleTotal"
  52. :page.sync="leftQueryParams.page"
  53. :limit.sync="leftQueryParams.pageSize"
  54. @pagination="getTitleList"
  55. />
  56. </div>
  57. <div class="page-content-center-box"></div>
  58. <!--右侧数据表格-->
  59. <div class="page-content-right-box">
  60. <div class="page-form-title-box" style="border:none;" :class="advancedType?'page-advanced-form-title-box':''">
  61. <el-form :model="queryParams" class="form-box" ref="queryForm"
  62. :inline="true" style="width:100%;">
  63. <div class="table-school-college-toggle-box">
  64. <p :class="tableButtonCheckType===''?'p-check':''" @click="tableCheck('')">全部</p>
  65. <p :class="tableButtonCheckType===0?'p-check':''" @click="tableCheck(0)">待检查</p>
  66. <p :class="tableButtonCheckType===1?'p-check':''" @click="tableCheck(1)">检查中</p>
  67. <p :class="tableButtonCheckType===2?'p-check':''" @click="tableCheck(2)">已检查</p>
  68. </div>
  69. <el-form-item label="" prop="deptId">
  70. <el-select v-model="queryParams.deptId" placeholder="学院单位" style="width:157px;">
  71. <el-option
  72. v-for="dict in deptOption"
  73. :key="dict.deptId"
  74. :label="dict.deptName"
  75. :value="dict.deptId"
  76. />
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item label="" prop="floorId">
  80. <!--<el-select v-model="queryParams.floorId" placeholder="楼栋" style="width:150px;">-->
  81. <!--<el-option-->
  82. <!--v-for="dict in buildOption"-->
  83. <!--:key="dict.id"-->
  84. <!--:label="dict.name"-->
  85. <!--:value="dict.id"-->
  86. <!--/>-->
  87. <!--</el-select>-->
  88. <el-cascader
  89. style="width: 150px"
  90. placeholder="楼栋"
  91. v-model="queryParams.floorId"
  92. filterable
  93. :show-all-levels="false"
  94. :options="buildOption"
  95. :props="{ value: 'id', label: 'name',emitPath:false }"
  96. ></el-cascader>
  97. </el-form-item>
  98. <el-form-item label="" prop="typeId" v-if="advancedType">
  99. <el-select v-model="queryParams.typeId" placeholder="安全分类" style="width:175px;">
  100. <el-option
  101. v-for="dict in classOption"
  102. :key="dict.typeId"
  103. :label="dict.typeName"
  104. :value="dict.typeId"
  105. />
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item label="" prop="levelId" v-if="advancedType">
  109. <el-select v-model="queryParams.levelId" placeholder="安全分级" style="width:175px;">
  110. <el-option
  111. v-for="dict in levelOption"
  112. :key="dict.levelId"
  113. :label="dict.levelName"
  114. :value="dict.levelId"
  115. />
  116. </el-select>
  117. </el-form-item>
  118. <el-form-item label="" prop="searchValue" v-if="advancedType">
  119. <el-input
  120. maxLength="30"
  121. v-model="queryParams.searchValue"
  122. placeholder="实验室/房间号"
  123. style="width:170px;"
  124. />
  125. </el-form-item>
  126. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  127. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  128. <p class="page-save-common-style-button" style="display: inline-block;margin-left:10px;" @click="searchToggle">{{advancedType?'普通搜索':'高级搜索'}}</p>
  129. </el-form>
  130. </div>
  131. <div class="page-conten-box page-content-right-bottom-box">
  132. <el-table class="table-box" v-loading="loading" border :data="dataList">
  133. <el-table-column label="序号" type="index" width="60"/>
  134. <el-table-column label="实验室" prop="subName" show-overflow-tooltip>
  135. <template slot-scope="scope">
  136. <span>{{scope.row.subName}}{{scope.row.roomNum?'('+scope.row.roomNum+')':''}}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="检查状态" prop="manageStatus" width="150" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. <span :class="scope.row.manageStatus==0?'colorA':(scope.row.manageStatus==1?'colorB':(scope.row.manageStatus==2?'colorC':''))">
  142. {{scope.row.manageStatus==0?'待检查':(scope.row.manageStatus==1?'检查中':(scope.row.manageStatus==2?'已检查':''))}}
  143. </span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="检查人" prop="checkUserNames" width="230" show-overflow-tooltip/>
  147. <el-table-column label="操作" width="240" show-overflow-tooltip >
  148. <template slot-scope="scope">
  149. <div class="table-button-box">
  150. <p class="table-button-null"></p>
  151. <p class="table-button-p"
  152. @click="tableButton(1,scope.row)"
  153. v-hasPermiRouter="['security:checkSetOption:list']"
  154. >检查项</p>
  155. <p class="table-button-p"
  156. v-if='scope.row.manageStatus !=2'
  157. @click="tableButton(2,scope.row)"
  158. v-hasPermiRouter="['security:checkPlan:detail']"
  159. >检查</p>
  160. <p class="table-button-p"
  161. v-if='scope.row.manageStatus !=2'
  162. @click="tableButton(3,scope.row)"
  163. v-hasPermiRouter="['security:checkSetOption:batch']"
  164. >检查完成</p>
  165. <p class="table-button-null"></p>
  166. </div>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. <pagination :page-sizes="[20, 30, 40, 50]"
  171. v-show="total>0"
  172. :total="total"
  173. :page.sync="queryParams.page"
  174. :limit.sync="queryParams.pageSize"
  175. @pagination="getList"
  176. />
  177. </div>
  178. </div>
  179. </div>
  180. <checkItem :propsData="propsData" v-if="pageType === 2"></checkItem>
  181. <initiateInspect v-if="pageType == 3" :initiateInspectData="initiateInspectData"></initiateInspect>
  182. </div>
  183. </template>
  184. <script>
  185. import {
  186. getDeptDropList,
  187. systemBuildingGetOptList,
  188. laboratoryClassLevelGetList,
  189. laboratoryClassTypeGetList,
  190. } from '@/api/commonality/permission'
  191. import {
  192. securityCheckPlanTitleList,
  193. securityCheckManageList,
  194. securityCheckSetOptionFinishCheck,
  195. } from '@/api/safetyCheck/index'
  196. import checkItem from "@/views/safetyCheck/components/checkItem.vue";
  197. import initiateInspect from "@/views/safetyCheck/components/initiateInspect/initiateInspect.vue";
  198. export default {
  199. name: 'index',
  200. components: {
  201. checkItem,
  202. initiateInspect,
  203. },
  204. data () {
  205. return {
  206. //页面状态
  207. pageType:1,
  208. //复查状态选项卡
  209. tableButtonCheckType:'',
  210. //页面遮罩
  211. loading:false,
  212. //学院
  213. deptOption:[],
  214. //楼栋
  215. buildOption:[],
  216. //分级
  217. levelOption:[],
  218. //分类
  219. classOption:[],
  220. //计划查询条件
  221. leftQueryParams:{
  222. checkCategory:1,
  223. searchValue:'',
  224. page:1,
  225. pageSize:20,
  226. },
  227. titleTotal:0,
  228. //查询条件
  229. queryParams:{
  230. page:1,
  231. pageSize:20,
  232. myRelated:1,
  233. deptId:null,
  234. floorId:null,
  235. typeId :null,
  236. levelId :null,
  237. searchValue:'',
  238. },
  239. //时间数据
  240. dateRange:[],
  241. //搜索模式切换
  242. advancedType:false,
  243. //列表数据
  244. dataList:[],
  245. //数据数量
  246. total:0,
  247. //组件传参
  248. propsData:{},
  249. leftBigCheckType:"0",
  250. leftCheckType:"0",
  251. leftListData:[],
  252. checkSetProgress:0,
  253. //检查组件
  254. initiateInspectData:{},
  255. }
  256. },
  257. created () {
  258. },
  259. mounted () {
  260. this.getTitleList();
  261. this.getDeptDropList();
  262. this.systemBuildingGetOptList();
  263. this.laboratoryClassLevelGetList();
  264. this.laboratoryClassTypeGetList();
  265. },
  266. methods: {
  267. //左侧清除查询按钮
  268. leftClear(){
  269. this.$set(this.leftQueryParams,'searchValue','');
  270. this.getTitleList();
  271. },
  272. //左侧查询按钮
  273. leftHandleQuery(){
  274. this.getTitleList();
  275. },
  276. //左侧计划切换
  277. leftBigCheckButton(index){
  278. if(this.leftBigCheckType !== index){
  279. this.$set(this,'leftBigCheckType',index);
  280. this.$set(this,'leftCheckType',0);
  281. this.$set(this,'checkSetProgress',this.leftListData[index].checkPlanSetVoList[0].checkSetProgress);
  282. this.resetQuery();
  283. }
  284. },
  285. //左侧计划子级切换
  286. leftCheckButton(index,bigIndex){
  287. if(this.leftCheckType !== index){
  288. this.$set(this,'leftCheckType',index);
  289. this.$set(this,'checkSetProgress',this.leftListData[bigIndex].checkPlanSetVoList[index].checkSetProgress);
  290. this.resetQuery();
  291. }
  292. },
  293. //复查状态选项卡切换
  294. tableCheck(type){
  295. if (this.tableButtonCheckType !== type){
  296. this.$set(this,'tableButtonCheckType',type);
  297. this.resetQuery();
  298. }
  299. },
  300. //搜索模式切换
  301. searchToggle(){
  302. this.$set(this,'advancedType',!this.advancedType);
  303. },
  304. //查询按钮
  305. handleQuery(){
  306. this.$set(this.queryParams,'page',1);
  307. this.getList();
  308. },
  309. //重置按钮
  310. resetQuery(){
  311. this.$set(this,'dateRange',[])
  312. this.$set(this,'queryParams',{
  313. page:1,
  314. pageSize:20,
  315. deptId:null,
  316. floorId:null,
  317. typeId :null,
  318. levelId :null,
  319. searchValue:'',
  320. });
  321. this.getList();
  322. },
  323. //获取计划数据列表
  324. getTitleList(){
  325. securityCheckPlanTitleList(this.leftQueryParams).then(response => {
  326. this.$set(this,'leftListData',response.data.records);
  327. this.$set(this,'titleTotal',response.data.total);
  328. this.$set(this,'leftBigCheckType',0);
  329. this.$set(this,'leftCheckType',0);
  330. this.resetQuery();
  331. if(response.data.records[0]){
  332. this.$set(this,'checkSetProgress',this.leftListData[0].checkPlanSetVoList[0].checkSetProgress);
  333. }
  334. });
  335. },
  336. getTitleListTwo(){
  337. securityCheckPlanTitleList(this.leftQueryParams).then(response => {
  338. this.$set(this,'leftListData',response.data.records);
  339. this.$set(this,'titleTotal',response.data.total);
  340. this.getList();
  341. });
  342. },
  343. //获取数据列表
  344. getList(){
  345. if(!this.leftListData[0]){
  346. this.$set(this,'dataList',[]);
  347. this.$set(this,'total',0);
  348. return
  349. }
  350. this.$set(this,'loading',true);
  351. let obj = {
  352. planSetId:this.leftListData[this.leftBigCheckType].checkPlanSetVoList[this.leftCheckType].planSetId,
  353. page:this.queryParams.page,
  354. pageSize:this.queryParams.pageSize,
  355. manageStatus:this.tableButtonCheckType,
  356. deptId:this.queryParams.deptId,
  357. floorId:this.queryParams.floorId,
  358. }
  359. if(this.advancedType){
  360. obj.searchValue = this.queryParams.searchValue;
  361. obj.typeId = this.queryParams.typeId;
  362. obj.levelId = this.queryParams.levelId;
  363. }
  364. securityCheckManageList(obj).then(response => {
  365. this.$set(this,'loading',false);
  366. this.$set(this,'dataList',response.data.records);
  367. this.$set(this,'total',response.data.total);
  368. });
  369. },
  370. //操作按钮
  371. tableButton(type,row){
  372. let self = this;
  373. if(type == 1){
  374. //检查项列表
  375. this.$set(this,'pageType',2);
  376. let obj = JSON.parse(JSON.stringify(row))
  377. obj.showType = true;
  378. obj.pageType = 1;
  379. obj.checkSetProgress = this.checkSetProgress;
  380. this.$set(this,'propsData',obj);
  381. }else if(type == 2){
  382. //开始检查
  383. this.$set(this,'pageType',3);
  384. let obj = JSON.parse(JSON.stringify(row))
  385. obj.freeChoiceType = true;
  386. obj.showType = false;
  387. obj.orderTitle = '开始检查';
  388. obj.orderType = '1';
  389. this.$set(this,'initiateInspectData',obj);
  390. }else if(type == 3){
  391. //批量完成
  392. this.$confirm(`是否确认检查完成?`, "提示", {
  393. confirmButtonText: "确定",
  394. cancelButtonText: "取消",
  395. type: "warning"
  396. }).then(async () => {
  397. securityCheckSetOptionFinishCheck({manageId:row.manageId }).then(response => {
  398. self.msgSuccess(response.message)
  399. self.getTitleListTwo();
  400. });
  401. }).catch(() => {
  402. })
  403. }else if(type == 6){
  404. //返回并刷新
  405. this.$set(this,'pageType',1);
  406. this.getTitleListTwo();
  407. }
  408. },
  409. /*********************************** 学院/楼栋/分类/分级 ***********************************/
  410. //学院下拉列表
  411. getDeptDropList(){
  412. getDeptDropList({level: 2, deptType: 1 }).then(response => {
  413. this.$set(this,'deptOption',response.data);
  414. });
  415. },
  416. //楼栋下拉列表
  417. systemBuildingGetOptList(){
  418. systemBuildingGetOptList({}).then(response => {
  419. let list = this.handleTree(response.data);
  420. pushNode(list)
  421. function pushNode(list){
  422. for(let i=0;i<list.length;i++){
  423. if(!list[i].children && list[i].type!= 3){
  424. list.splice(i,1)
  425. i--
  426. }if(list[i].children){
  427. pushNode(list[i].children)
  428. }
  429. }
  430. }
  431. this.$set(this,'buildOption',list);
  432. });
  433. },
  434. //分级下拉列表
  435. laboratoryClassLevelGetList(){
  436. laboratoryClassLevelGetList({}).then(response => {
  437. this.$set(this,'levelOption',response.data);
  438. });
  439. },
  440. //分类下拉列表
  441. laboratoryClassTypeGetList(){
  442. laboratoryClassTypeGetList({}).then(response => {
  443. this.$set(this,'classOption',response.data);
  444. });
  445. },
  446. },
  447. }
  448. </script>
  449. <style scoped lang="scss">
  450. .inspectManage{
  451. .inspectManagePage{
  452. overflow: hidden;
  453. display: flex;
  454. flex-direction: row;
  455. flex:1;
  456. .page-content-left-box{
  457. width: 480px;
  458. display: flex;
  459. flex-direction: column;
  460. overflow: hidden;
  461. margin:20px 0 20px 20px;
  462. padding-right:10px;
  463. .left-max-list-box{
  464. flex:1;
  465. padding-right:10px;
  466. .left-list-for-max-big-box{
  467. .left-list-title-box{
  468. cursor: pointer;
  469. display: flex;
  470. p{
  471. height:30px;
  472. line-height:30px;
  473. margin:15px 0;
  474. }
  475. p:nth-child(1){
  476. font-size:16px;
  477. width:30px;
  478. }
  479. p:nth-child(2){
  480. font-size:16px;
  481. flex:1;
  482. /*单行省略号*/
  483. display:block;
  484. overflow:hidden;
  485. text-overflow:ellipsis;
  486. white-space:nowrap;
  487. }
  488. p:nth-child(3){
  489. font-size:14px;
  490. width:80px;
  491. height:30px;
  492. text-align: center;
  493. color:#fff;
  494. background-color: #0183FA;
  495. border-radius:4px;
  496. }
  497. }
  498. .left-list-box{
  499. .left-list-for-box{
  500. cursor: pointer;
  501. display: flex;
  502. height:70px;
  503. background-color: #F5F5F5;
  504. padding:5px 23px;
  505. .left-list-text-box{
  506. width:240px;
  507. p{
  508. height:30px;
  509. line-height: 30px;
  510. font-size:16px;
  511. /*单行省略号*/
  512. display:block;
  513. overflow:hidden;
  514. text-overflow:ellipsis;
  515. white-space:nowrap;
  516. }
  517. p:nth-child(2){
  518. color:#666666;
  519. }
  520. }
  521. .left-list-progress-box{
  522. flex:1;
  523. padding-top:15px;
  524. ::v-deep .el-progress-bar{
  525. margin-right: -62px;
  526. }
  527. }
  528. }
  529. .check-left-list-for-box{
  530. background: rgba(1,131,250,0.1);
  531. }
  532. }
  533. }
  534. .left-list-for-null-p{
  535. text-align: center;
  536. line-height:400px;
  537. color:#999;
  538. }
  539. }
  540. }
  541. .page-content-center-box{
  542. margin:20px 0;
  543. border-right:1px dashed #dedede;
  544. }
  545. .page-content-right-box{
  546. display: flex;
  547. flex-direction: column;
  548. overflow: hidden;
  549. flex:1;
  550. .page-content-right-bottom-box{
  551. display: flex;
  552. flex-direction: column;
  553. overflow: hidden;
  554. flex:1;
  555. padding:0 20px 20px;
  556. .colorA{
  557. color:#FA4A04;
  558. }
  559. .colorB{
  560. color:#0484FA;
  561. }
  562. .colorC{
  563. color:#039C06;
  564. }
  565. }
  566. }
  567. .table-school-college-toggle-box{
  568. overflow: hidden;
  569. display: inline-block;
  570. margin-right:10px;
  571. p{
  572. display: inline-block;
  573. text-align: center;
  574. width:80px;
  575. line-height:40px;
  576. height:40px;
  577. color:#333;
  578. background-color: #fff;
  579. border:1px solid #E0E0E0;
  580. font-size:14px;
  581. cursor: pointer;
  582. }
  583. p:nth-child(1){
  584. border-top-left-radius: 4px;
  585. border-bottom-left-radius: 4px;
  586. /*border-right:none;*/
  587. }
  588. p:nth-child(4){
  589. border-top-right-radius: 4px;
  590. border-bottom-right-radius: 4px;
  591. /*border-left:none;*/
  592. }
  593. .p-check{
  594. border:1px solid #0183FA;
  595. background-color: #0183FA;
  596. color:#fff;
  597. }
  598. }
  599. .form-button-max-big-box-me{
  600. display: inline-block;
  601. overflow: hidden;
  602. margin-right:10px;
  603. .form-button-big-box-me{
  604. display: flex;
  605. div{
  606. position: relative;
  607. height:40px;
  608. width:100px;
  609. line-height: 40px;
  610. text-align: center;
  611. color:#999;
  612. font-size:14px;
  613. border:1px solid #999;
  614. border-radius:4px;
  615. font-weight:500;
  616. cursor: pointer;
  617. .icon-p-me{
  618. width:15px;
  619. height:15px;
  620. line-height:15px;
  621. text-align: center;
  622. position: absolute;
  623. right:0;
  624. bottom:0;
  625. color:#fff;
  626. background: #0183fa;
  627. border-top-left-radius:4px;
  628. }
  629. }
  630. .checkDiv-me{
  631. color:#0183FA!important;
  632. border:1px solid #0183FA!important;
  633. }
  634. }
  635. }
  636. }
  637. }
  638. </style>