index.vue 17 KB

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