index.vue 17 KB

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