index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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. this.getCorrelationNum();
  255. checkManageList(obj).then(response => {
  256. this.total = response.data.total;
  257. this.tableList = response.data.records;
  258. });
  259. },
  260. /** 搜索按钮操作 */
  261. handleQuery() {
  262. this.$set(this.queryParams,'pageNum',1);
  263. this.getList();
  264. },
  265. /** 重置按钮操作 */
  266. resetQuery() {
  267. this.$set(this,'dateRange',[]);
  268. this.$set(this,'queryParams',{
  269. pageNum:1,
  270. pageSize:20,
  271. checkType:1,
  272. manageStatus:'-1',
  273. checkTimeSort:0,
  274. searchValue:"",
  275. deptId:"",
  276. myRelated:1,
  277. });
  278. this.handleQuery();
  279. },
  280. //查看单个文档
  281. lookDocumentButton(type,row){
  282. if(type==1){
  283. this.$set(this,'propsLookDocumentData',{
  284. title:"整改报告",
  285. type:1,
  286. id:row.id,
  287. name:row.title
  288. });
  289. this.$set(this,'lookDocumentType',true);
  290. }else{
  291. this.$set(this,'lookDocumentType',false);
  292. }
  293. },
  294. //查看多个文档
  295. lookDocumentListButton(type,row){
  296. if(type==1){
  297. getFindByCheckPlanId({checkPlanId:row.checkPlanId}).then(response => {
  298. let list = [];
  299. for(let i=0;i<response.data.length;i++){
  300. let obj = {
  301. name:response.data[i].fileName,
  302. url:response.data[i].fileUrl,
  303. }
  304. list.push(obj);
  305. }
  306. this.$set(this,'propsLookDocumentListData',{
  307. title:"查看附件",
  308. list:list
  309. });
  310. this.$set(this,'lookDocumentListType',true);
  311. });
  312. }else{
  313. this.$set(this,'lookDocumentListType',false);
  314. }
  315. },
  316. //获取学院列表
  317. listDepartments(){
  318. listDepartments().then(response => {
  319. this.deptSelectList = response.data;
  320. });
  321. },
  322. }
  323. }
  324. </script>
  325. <style scoped lang="scss">
  326. ::v-deep .el-table__body-wrapper{
  327. padding-bottom: 8px;
  328. }
  329. ::v-deep .el-table__fixed{
  330. margin-top:-1px;
  331. margin-left:-1px;
  332. height:calc(100% - 8px)!important;
  333. }
  334. ::v-deep .el-table__fixed-body-wrapper{
  335. height: calc(100% - 48px);
  336. overflow-y: auto;
  337. }
  338. .inspectionManagement{
  339. flex: 1;
  340. display: flex !important;
  341. flex-direction: column;
  342. overflow: hidden;
  343. .inspectionManagement-page{
  344. flex: 1;
  345. display: flex !important;
  346. flex-direction: column;
  347. overflow: hidden;
  348. .title-box{
  349. padding-top:20px;
  350. border-bottom:1px solid #dedede;
  351. .form-button-max-big-box{
  352. display: inline-block;
  353. margin-left:10px;
  354. .form-button-big-box{
  355. display: flex;
  356. p:nth-child(1){
  357. border-top-left-radius: 4px;
  358. border-bottom-left-radius: 4px;
  359. border-top:1px solid #E0E0E0;
  360. border-bottom:1px solid #E0E0E0;
  361. }
  362. p:nth-child(2){
  363. border-top:1px solid #E0E0E0;
  364. border-bottom:1px solid #E0E0E0;
  365. }
  366. p:nth-child(3){
  367. border-top:1px solid #E0E0E0;
  368. border-bottom:1px solid #E0E0E0;
  369. }
  370. p:nth-child(4){
  371. border-top-right-radius: 4px;
  372. border-bottom-right-radius: 4px;
  373. border-top:1px solid #E0E0E0;
  374. border-bottom:1px solid #E0E0E0;
  375. border-right:1px solid #E0E0E0;
  376. }
  377. p{
  378. height:40px;
  379. width:80px;
  380. line-height: 40px;
  381. text-align: center;
  382. color:#666666;
  383. font-size:14px;
  384. font-weight:500;
  385. cursor: pointer;
  386. border-left:1px solid #E0E0E0;
  387. }
  388. .checkDiv{
  389. color:#fff!important;
  390. border:1px solid #0183FA!important;
  391. background-color: #0183FA;
  392. }
  393. }
  394. }
  395. .form-button-max-big-box-me{
  396. display: inline-block;
  397. .form-button-big-box-me{
  398. display: flex;
  399. div{
  400. position: relative;
  401. height:40px;
  402. width:130px;
  403. line-height: 40px;
  404. text-align: center;
  405. color:#999;
  406. font-size:14px;
  407. border:1px solid #999;
  408. border-radius:4px;
  409. margin-left:10px;
  410. font-weight:500;
  411. cursor: pointer;
  412. .icon-p-me{
  413. width:15px;
  414. height:15px;
  415. line-height:15px;
  416. text-align: center;
  417. position: absolute;
  418. right:0;
  419. bottom:0;
  420. color:#fff;
  421. background: #0183fa;
  422. border-top-left-radius:4px;
  423. }
  424. }
  425. .checkDiv-me{
  426. color:#0183FA!important;
  427. border:1px solid #0183FA!important;
  428. }
  429. }
  430. }
  431. }
  432. .content-box{
  433. flex: 1;
  434. display: flex;
  435. flex-direction: column;
  436. padding:20px;
  437. overflow: hidden;
  438. }
  439. }
  440. }
  441. </style>