index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <!--巡查管理-->-
  2. <template>
  3. <div class="app-container inspectionManagement">
  4. <div class="page-container" v-if="pageType == 1">
  5. <div class="page-form-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">
  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="" style="margin-left:10px;" 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" 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. <p class="page-inquire-common-style-button" @click="handleQuery" style="margin-right:10px;">查询</p>
  57. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  58. </el-form>
  59. </div>
  60. <div class="page-content-box">
  61. <el-table class="table-box" border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  62. <el-table-column label="序号" align="center" type="index" width="60" fixed/>
  63. <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip width="250" fixed/>
  64. <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="220" fixed>
  65. <template slot-scope="scope">{{scope.row.roomNumber?scope.row.subjectName+'-'+scope.row.roomNumber:scope.row.subjectName}}</template>
  66. </el-table-column>
  67. <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="150"/>
  68. <el-table-column label="检查类型" align="center" prop="checkRange" show-overflow-tooltip width="120">
  69. <template slot-scope="scope">
  70. <p>{{scope.row.checkCategory==1?'综合检查':(scope.row.checkCategory==2?'专项检查':'-')}}</p>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="检查状态" align="center" prop="manageStatus" show-overflow-tooltip width="90">
  74. <template slot-scope="scope">
  75. <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>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
  79. <el-table-column label="检查结果" align="center" prop="checkResult" show-overflow-tooltip width="80">
  80. <template slot-scope="scope">
  81. <p>{{scope.row.checkResult==0?'不符合':(scope.row.checkResult==1?'符合':'')}}</p>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="隐患数" align="center" prop="dangerNum" show-overflow-tooltip width="80"/>
  85. <el-table-column label="整改进度" align="center" prop="rectifySchedule" show-overflow-tooltip width="200"/>
  86. <el-table-column label="计划周期" align="center" prop="startTime" show-overflow-tooltip width="270">
  87. <template slot-scope="scope">
  88. <p>{{scope.row.cycleStartTime}} 至 {{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="157"/>
  92. <el-table-column label="操作" align="center" prop="deptName" width="280">
  93. <template slot-scope="scope">
  94. <div class="table-button-box">
  95. <p class="table-button-null"></p>
  96. <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:detail']"
  97. v-show="scope.row.manageStatus==0||scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
  98. <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
  99. v-show="scope.row.manageStatus==1 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">编辑</p>
  100. <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
  101. v-show="scope.row.manageStatus==0 && scope.row.isCheck==1 && scope.row.isSelfData==1" @click="goAddPage(2,scope.row.id)">开始检查</p>
  102. <p class="table-button-p" v-hasPermiRouter="['safety:checkManage:edit']"
  103. style="color:#999" v-show="scope.row.manageStatus==0 && scope.row.isCheck==0 && scope.row.isSelfData==1">开始检查</p>
  104. <p class="table-button-p" v-show="scope.row.isEndProcess==1 && scope.row.checkResult==0" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  105. <p class="table-button-p" v-show="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
  106. <p class="table-button-null"></p>
  107. </div>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <pagination :page-sizes="[20, 30, 40, 50]"
  112. v-show="total>0"
  113. :total="total"
  114. :page.sync="queryParams.page"
  115. :limit.sync="queryParams.pageSize"
  116. @pagination="getList"
  117. />
  118. </div>
  119. </div>
  120. <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
  121. <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
  122. <lookDocumentDataDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDataDialog>
  123. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  124. </div>
  125. </template>
  126. <script>
  127. import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
  128. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  129. import lookDocumentDataDialog from '@/components/lookDocumentDialog/lookDocumentDataDialog.vue'
  130. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  131. // V3
  132. import {
  133. getDeptDropList
  134. } from '@/api/commonality/permission'
  135. import {
  136. checkManageList, getFindByCheckPlanId
  137. } from '@/api/safetyCheck/indexTow'
  138. export default {
  139. name: 'index',
  140. components: {
  141. addPage,
  142. infoPage,
  143. lookDocumentDataDialog,
  144. lookDocumentListDialog
  145. },
  146. data(){
  147. return{
  148. //子组件数据
  149. lookDocumentType:false,
  150. propsLookDocumentData:{},
  151. lookDocumentListType:false,
  152. propsLookDocumentListData:{},
  153. propsAddData:{},
  154. propsInfoData:{},
  155. //学院列表
  156. deptSelectList:[],
  157. pageType:1,
  158. queryParams:{
  159. page:1,
  160. pageSize:20,
  161. checkType:1,
  162. manageStatus:'-1',
  163. checkTimeSort:0,
  164. searchValue:"",
  165. deptId:"",
  166. myRelated:1,
  167. },
  168. dateRange:[],
  169. tableList:[],
  170. total:0,
  171. correlationNum:'',
  172. }
  173. },
  174. created(){
  175. if(this.$route.query.id){
  176. this.goAddPage(2,this.$route.query.id);
  177. }
  178. },
  179. mounted(){
  180. this.getDeptDropList();
  181. this.getList();
  182. },
  183. methods:{
  184. //获取相关数量
  185. getCorrelationNum(){
  186. checkManageList({
  187. page:1,
  188. pageSize:20,
  189. checkType:1,
  190. checkTimeSort:0,
  191. myRelated:1,
  192. manageStatus:this.queryParams.manageStatus,
  193. searchValue:this.queryParams.searchValue,
  194. deptId:this.queryParams.deptId,
  195. startTime:this.dateRange[0]?this.dateRange[0]+'T00:00:00':'',
  196. endTime:this.dateRange[1]?this.dateRange[1]+'T23:59:59':'',
  197. }).then(response => {
  198. this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
  199. });
  200. },
  201. //开始检查
  202. goAddPage(type,id){
  203. if(this.pageType != type){
  204. if(type == 1){
  205. //返回
  206. this.$set(this,'pageType',type);
  207. }else if(type == 2){
  208. //开始检查/编辑
  209. this.$set(this,'propsAddData',{
  210. id:id,
  211. title:'校院巡查',
  212. });
  213. this.$set(this,'pageType',type);
  214. }else if(type == 3){
  215. //详情
  216. this.$set(this,'propsInfoData',{id:id});
  217. this.$set(this,'pageType',type);
  218. }else if(type == 4){
  219. //返回并刷新
  220. this.getList();
  221. this.$set(this,'pageType',1);
  222. }
  223. }
  224. },
  225. //时间排序方法
  226. sortChange(val){
  227. if(val.prop == 'checkTime'){
  228. this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
  229. this.handleQuery();
  230. }
  231. },
  232. //范围选择
  233. topLeftClickType(type){
  234. if(this.queryParams.manageStatus != type){
  235. this.$set(this.queryParams,'manageStatus',type);
  236. this.handleQuery();
  237. }
  238. },
  239. //与我相关按钮
  240. topRightClickType(){
  241. this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
  242. this.handleQuery();
  243. },
  244. //获取数据列表
  245. getList(){
  246. let obj = JSON.parse(JSON.stringify(this.queryParams))
  247. if(this.dateRange[0]){
  248. obj.startTime = this.dateRange[0]+'T00:00:00';
  249. obj.endTime = this.dateRange[1]+'T23:59:59';
  250. }else{
  251. obj.startTime = "";
  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,'page',1);
  266. this.getList();
  267. },
  268. /** 重置按钮操作 */
  269. resetQuery() {
  270. this.$set(this,'dateRange',[]);
  271. this.$set(this,'queryParams',{
  272. page: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. getDeptDropList(){
  321. getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
  322. this.$set(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. .page-container{
  347. .page-form-title-box{
  348. .form-button-max-big-box{
  349. display: inline-block;
  350. overflow: hidden;
  351. .form-button-big-box{
  352. display: flex;
  353. p:nth-child(1){
  354. border-top-left-radius: 4px;
  355. border-bottom-left-radius: 4px;
  356. border-top:1px solid #E0E0E0;
  357. border-bottom:1px solid #E0E0E0;
  358. }
  359. p:nth-child(2){
  360. border-top:1px solid #E0E0E0;
  361. border-bottom:1px solid #E0E0E0;
  362. }
  363. p:nth-child(3){
  364. border-top:1px solid #E0E0E0;
  365. border-bottom:1px solid #E0E0E0;
  366. }
  367. p:nth-child(4){
  368. border-top-right-radius: 4px;
  369. border-bottom-right-radius: 4px;
  370. border-top:1px solid #E0E0E0;
  371. border-bottom:1px solid #E0E0E0;
  372. border-right:1px solid #E0E0E0;
  373. }
  374. p{
  375. height:40px;
  376. width:80px;
  377. line-height: 40px;
  378. text-align: center;
  379. color:#666666;
  380. font-size:14px;
  381. font-weight:500;
  382. cursor: pointer;
  383. border-left:1px solid #E0E0E0;
  384. }
  385. .checkDiv{
  386. color:#fff!important;
  387. border:1px solid #0183FA!important;
  388. background-color: #0183FA;
  389. }
  390. }
  391. }
  392. .form-button-max-big-box-me{
  393. display: inline-block;
  394. overflow: hidden;
  395. .form-button-big-box-me{
  396. display: flex;
  397. div{
  398. position: relative;
  399. height:40px;
  400. width:130px;
  401. line-height: 40px;
  402. text-align: center;
  403. color:#999;
  404. font-size:14px;
  405. border:1px solid #999;
  406. border-radius:4px;
  407. margin-left:10px;
  408. font-weight:500;
  409. cursor: pointer;
  410. .icon-p-me{
  411. width:15px;
  412. height:15px;
  413. line-height:15px;
  414. text-align: center;
  415. position: absolute;
  416. right:0;
  417. bottom:0;
  418. color:#fff;
  419. background: #0183fa;
  420. border-top-left-radius:4px;
  421. }
  422. }
  423. .checkDiv-me{
  424. color:#0183FA!important;
  425. border:1px solid #0183FA!important;
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. </style>