index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <!--巡查管理-->-
  2. <template>
  3. <div class="app-container inspectionManagement">
  4. <div class="inspectionManagement-page" v-if="pageType == 1">
  5. <div class="title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
  7. <div class="form-button-max-big-box">
  8. <div class="form-button-big-box" style="margin-left:10px;">
  9. <div :class="queryParams.manageStatus=='-1'?'checkDiv':''" @click="topLeftClickType('-1')">
  10. <p class="text-p">全部</p>
  11. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus=='-1'"></p>
  12. </div>
  13. <div :class="queryParams.manageStatus==0?'checkDiv':''" @click="topLeftClickType(0)">
  14. <p class="text-p">待检查</p>
  15. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==0"></p>
  16. </div>
  17. <div :class="queryParams.manageStatus==1?'checkDiv':''" @click="topLeftClickType(1)">
  18. <p class="text-p">检查中</p>
  19. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==1"></p>
  20. </div>
  21. <div :class="queryParams.manageStatus==2?'checkDiv':''" @click="topLeftClickType(2)">
  22. <p class="text-p">已检查</p>
  23. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==2"></p>
  24. </div>
  25. </div>
  26. </div>
  27. <el-form-item label="关键字" prop="searchValue">
  28. <el-input
  29. maxLength="30"
  30. v-model="queryParams.searchValue"
  31. placeholder="计划标题/实验室/房间号/检查者"
  32. clearable
  33. style="width: 250px"
  34. />
  35. </el-form-item>
  36. <el-form-item label="学院" prop="deptId" label-width="50px">
  37. <el-select v-model="queryParams.deptId" clearable placeholder="请选择学院" style="width: 150px">
  38. <el-option
  39. v-for="item in deptSelectList"
  40. :key="item.deptId"
  41. :label="item.deptName"
  42. :value="item.deptId">
  43. </el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item label="检查时间" prop="dateRange" style="margin-left:10px;" label-width="70px">
  47. <el-date-picker
  48. :clearable="false"
  49. v-model="dateRange"
  50. size="small"
  51. style="width: 240px"
  52. value-format="yyyy-MM-dd"
  53. type="daterange"
  54. range-separator="-"
  55. start-placeholder="开始日期"
  56. end-placeholder="结束日期"
  57. ></el-date-picker>
  58. </el-form-item>
  59. <el-form-item>
  60. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  61. <p class="reset-button-one" @click="resetQuery">重置</p>
  62. </el-form-item>
  63. <!--与我相关-->
  64. <div class="form-button-max-big-box-me">
  65. <div class="form-button-big-box-me">
  66. <div :class="queryParams.myRelated==1?'checkDiv-me':''" @click="topRightClickType">
  67. <p class="text-p-me">与我相关{{correlationNum}}</p>
  68. <p class="el-icon-check icon-p-me" v-if="queryParams.myRelated==1"></p>
  69. </div>
  70. </div>
  71. </div>
  72. </el-form>
  73. </div>
  74. <div class="content-box">
  75. <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  76. <el-table-column label="序号" align="center" type="index" width="60" fixed/>
  77. <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip width="250" fixed/>
  78. <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="220" fixed>
  79. <template slot-scope="scope">{{scope.row.roomNumber?scope.row.subjectName+'-'+scope.row.roomNumber:scope.row.subjectName}}</template>
  80. </el-table-column>
  81. <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="150"/>
  82. <el-table-column label="检查状态" align="center" prop="manageStatus" show-overflow-tooltip width="90">
  83. <template slot-scope="scope">
  84. <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>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
  88. <el-table-column label="检查结果" align="center" prop="checkResult" show-overflow-tooltip width="80">
  89. <template slot-scope="scope">
  90. <p>{{scope.row.checkResult==0?'不符合':(scope.row.checkResult==1?'符合':'')}}</p>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="隐患数" align="center" prop="dangerNum" show-overflow-tooltip width="80"/>
  94. <el-table-column label="整改进度" align="center" prop="rectifySchedule" show-overflow-tooltip width="200"/>
  95. <el-table-column label="计划周期" align="center" prop="startTime" show-overflow-tooltip width="270">
  96. <template slot-scope="scope">
  97. <p>{{scope.row.cycleStartTime}} 至 {{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="157"/>
  101. <el-table-column label="操作" align="center" prop="deptName" width="280">
  102. <template slot-scope="scope">
  103. <div class="table-button-box">
  104. <p class="table-button-null"></p>
  105. <p class="table-button-p" v-hasPermi="['safety:checkManage:query']"
  106. v-show="scope.row.manageStatus==0||scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
  107. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  108. v-show="scope.row.manageStatus==1 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">编辑</p>
  109. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  110. v-show="scope.row.manageStatus==0 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">开始检查</p>
  111. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  112. style="color:#999" v-show="scope.row.manageStatus==0 && scope.row.isCheck==0 && scope.row.isSelfData==1">开始检查</p>
  113. <p class="table-button-p" v-show="scope.row.isEndProcess==1 && scope.row.checkResult==0" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  114. <p class="table-button-p" v-show="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
  115. <p class="table-button-null"></p>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <pagination :page-sizes="[20, 30, 40, 50]"
  121. v-show="total>0"
  122. :total="total"
  123. :page.sync="queryParams.pageNum"
  124. :limit.sync="queryParams.pageSize"
  125. @pagination="getList"
  126. />
  127. </div>
  128. </div>
  129. <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
  130. <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
  131. <lookDocumentDataDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDataDialog>
  132. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  133. </div>
  134. </template>
  135. <script>
  136. import { listDepartments } from "@/api/system/dept";
  137. import { checkManageList,getFindByCheckPlanId } from '@/api/safetyCheck/index'
  138. import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
  139. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  140. import lookDocumentDataDialog from '@/components/lookDocumentDialog/lookDocumentDataDialog.vue'
  141. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  142. export default {
  143. name: 'index',
  144. components: {
  145. addPage,
  146. infoPage,
  147. lookDocumentDataDialog,
  148. lookDocumentListDialog
  149. },
  150. data(){
  151. return{
  152. //子组件数据
  153. lookDocumentType:false,
  154. propsLookDocumentData:{},
  155. lookDocumentListType:false,
  156. propsLookDocumentListData:{},
  157. propsAddData:{},
  158. propsInfoData:{},
  159. //学院列表
  160. deptSelectList:[],
  161. pageType:1,
  162. queryParams:{
  163. pageNum:1,
  164. pageSize:20,
  165. checkType:1,
  166. manageStatus:'-1',
  167. checkTimeSort:0,
  168. searchValue:"",
  169. deptId:"",
  170. myRelated:1,
  171. },
  172. dateRange:[],
  173. tableList:[],
  174. total:0,
  175. correlationNum:'',
  176. }
  177. },
  178. created(){
  179. if(this.$route.query.id){
  180. this.goAddPage(2,this.$route.query.id);
  181. }
  182. },
  183. mounted(){
  184. this.listDepartments();
  185. this.getList();
  186. },
  187. methods:{
  188. //获取相关数量
  189. getCorrelationNum(){
  190. checkManageList({
  191. pageNum:1,
  192. pageSize:20,
  193. checkType:1,
  194. manageStatus:'-1',
  195. checkTimeSort:0,
  196. searchValue:"",
  197. deptId:"",
  198. myRelated:1,
  199. }).then(response => {
  200. this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
  201. });
  202. },
  203. //开始检查
  204. goAddPage(type,id){
  205. if(this.pageType != type){
  206. if(type == 1){
  207. //返回
  208. this.$set(this,'pageType',type);
  209. }else if(type == 2){
  210. //开始检查/编辑
  211. this.$set(this,'propsAddData',{
  212. id:id,
  213. title:'校院巡查',
  214. });
  215. this.$set(this,'pageType',type);
  216. }else if(type == 3){
  217. //详情
  218. this.$set(this,'propsInfoData',{id:id});
  219. this.$set(this,'pageType',type);
  220. }else if(type == 4){
  221. //返回并刷新
  222. this.getList();
  223. this.$set(this,'pageType',1);
  224. }
  225. }
  226. },
  227. //时间排序方法
  228. sortChange(val){
  229. if(val.prop == 'checkTime'){
  230. this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
  231. this.handleQuery();
  232. }
  233. },
  234. //范围选择
  235. topLeftClickType(type){
  236. if(this.queryParams.manageStatus != type){
  237. this.$set(this.queryParams,'manageStatus',type);
  238. this.handleQuery();
  239. }
  240. },
  241. //与我相关按钮
  242. topRightClickType(){
  243. this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
  244. this.handleQuery();
  245. },
  246. //获取数据列表
  247. getList(){
  248. let obj = JSON.parse(JSON.stringify(this.queryParams))
  249. if(this.dateRange[0]){
  250. obj.startTime = this.dateRange[0];
  251. }else{
  252. obj.startTime = "";
  253. }
  254. if(this.dateRange[1]){
  255. obj.endTime = this.dateRange[1];
  256. }else{
  257. obj.endTime = "";
  258. }
  259. this.getCorrelationNum();
  260. checkManageList(obj).then(response => {
  261. this.total = response.data.total;
  262. this.tableList = response.data.records;
  263. });
  264. },
  265. /** 搜索按钮操作 */
  266. handleQuery() {
  267. this.$set(this.queryParams,'pageNum',1);
  268. this.getList();
  269. },
  270. /** 重置按钮操作 */
  271. resetQuery() {
  272. this.$set(this,'dateRange',[]);
  273. this.$set(this,'queryParams',{
  274. pageNum:1,
  275. pageSize:20,
  276. checkType:1,
  277. manageStatus:'-1',
  278. checkTimeSort:0,
  279. searchValue:"",
  280. deptId:"",
  281. myRelated:1,
  282. });
  283. this.handleQuery();
  284. },
  285. //查看单个文档
  286. lookDocumentButton(type,row){
  287. if(type==1){
  288. this.$set(this,'propsLookDocumentData',{
  289. title:"整改报告",
  290. type:1,
  291. id:row.id,
  292. name:row.title
  293. });
  294. this.$set(this,'lookDocumentType',true);
  295. }else{
  296. this.$set(this,'lookDocumentType',false);
  297. }
  298. },
  299. //查看多个文档
  300. lookDocumentListButton(type,row){
  301. if(type==1){
  302. getFindByCheckPlanId({checkPlanId:row.checkPlanId}).then(response => {
  303. let list = [];
  304. for(let i=0;i<response.data.length;i++){
  305. let obj = {
  306. name:response.data[i].fileName,
  307. url:response.data[i].fileUrl,
  308. }
  309. list.push(obj);
  310. }
  311. this.$set(this,'propsLookDocumentListData',{
  312. title:"查看附件",
  313. list:list
  314. });
  315. this.$set(this,'lookDocumentListType',true);
  316. });
  317. }else{
  318. this.$set(this,'lookDocumentListType',false);
  319. }
  320. },
  321. //获取学院列表
  322. listDepartments(){
  323. listDepartments().then(response => {
  324. this.deptSelectList = response.data;
  325. });
  326. },
  327. }
  328. }
  329. </script>
  330. <style scoped lang="scss">
  331. ::v-deep .el-table__body-wrapper{
  332. padding-bottom: 8px;
  333. }
  334. ::v-deep .el-table__fixed{
  335. margin-top:-1px;
  336. margin-left:-1px;
  337. height:calc(100% - 8px)!important;
  338. }
  339. ::v-deep .el-table__fixed-body-wrapper{
  340. height: calc(100% - 48px);
  341. overflow-y: auto;
  342. }
  343. .inspectionManagement{
  344. flex: 1;
  345. display: flex !important;
  346. flex-direction: column;
  347. overflow: hidden;
  348. .inspectionManagement-page{
  349. flex: 1;
  350. display: flex !important;
  351. flex-direction: column;
  352. overflow: hidden;
  353. .title-box{
  354. padding-top:20px;
  355. border-bottom:1px solid #dedede;
  356. .form-button-max-big-box{
  357. display: inline-block;
  358. .form-button-big-box{
  359. display: flex;
  360. div{
  361. position: relative;
  362. height:40px;
  363. width:80px;
  364. line-height: 40px;
  365. text-align: center;
  366. color:#999;
  367. font-size:14px;
  368. border:1px solid #999;
  369. border-radius:4px;
  370. margin-left:10px;
  371. font-weight:500;
  372. cursor: pointer;
  373. .icon-p{
  374. width:15px;
  375. height:15px;
  376. line-height:15px;
  377. text-align: center;
  378. position: absolute;
  379. right:0;
  380. bottom:0;
  381. color:#fff;
  382. background: #0183fa;
  383. border-top-left-radius:4px;
  384. }
  385. }
  386. .checkDiv{
  387. color:#0183FA;
  388. border:1px solid #0183FA;
  389. }
  390. }
  391. }
  392. .form-button-max-big-box-me{
  393. display: inline-block;
  394. .form-button-big-box-me{
  395. display: flex;
  396. div{
  397. position: relative;
  398. height:40px;
  399. width:130px;
  400. line-height: 40px;
  401. text-align: center;
  402. color:#999;
  403. font-size:14px;
  404. border:1px solid #999;
  405. border-radius:4px;
  406. margin-left:10px;
  407. font-weight:500;
  408. cursor: pointer;
  409. .icon-p-me{
  410. width:15px;
  411. height:15px;
  412. line-height:15px;
  413. text-align: center;
  414. position: absolute;
  415. right:0;
  416. bottom:0;
  417. color:#fff;
  418. background: #0183fa;
  419. border-top-left-radius:4px;
  420. }
  421. }
  422. .checkDiv-me{
  423. color:#0183FA!important;
  424. border:1px solid #0183FA!important;
  425. }
  426. }
  427. }
  428. }
  429. .content-box{
  430. flex: 1;
  431. display: flex;
  432. flex-direction: column;
  433. padding:20px;
  434. overflow: hidden;
  435. }
  436. }
  437. }
  438. </style>