index.vue 17 KB

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