index.vue 17 KB

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