index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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. manageStatus:'-1',
  197. checkTimeSort:0,
  198. searchValue:"",
  199. deptId:"",
  200. myRelated:1,
  201. }).then(response => {
  202. this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
  203. });
  204. },
  205. //与我相关按钮
  206. topRightClickType(){
  207. this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
  208. this.handleQuery();
  209. },
  210. //开始检查
  211. goAddPage(type,id){
  212. if(this.pageType != type){
  213. if(type == 1){
  214. //返回
  215. this.$set(this,'pageType',type);
  216. }else if(type == 2){
  217. //开始检查/编辑
  218. this.$set(this,'propsAddData',{
  219. id:id,
  220. title:'实验室自查',
  221. });
  222. this.$set(this,'pageType',type);
  223. }else if(type == 3){
  224. //详情
  225. this.$set(this,'propsInfoData',{id:id});
  226. this.$set(this,'pageType',type);
  227. }else if(type == 4){
  228. //返回并刷新
  229. this.getList();
  230. this.$set(this,'pageType',1);
  231. }
  232. }
  233. },
  234. //时间排序方法
  235. sortChange(val){
  236. if(val.prop == 'checkTime'){
  237. this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
  238. this.handleQuery();
  239. }
  240. },
  241. //范围选择
  242. topLeftClickType(type){
  243. if(this.queryParams.manageStatus != type){
  244. this.$set(this.queryParams,'manageStatus',type);
  245. this.handleQuery();
  246. }
  247. },
  248. //获取数据列表
  249. getList(){
  250. let obj = JSON.parse(JSON.stringify(this.queryParams))
  251. if(this.dateRange[0]){
  252. obj.startTime = this.dateRange[0];
  253. }else{
  254. obj.startTime = "";
  255. }
  256. if(this.dateRange[1]){
  257. obj.endTime = this.dateRange[1];
  258. }else{
  259. obj.endTime = "";
  260. }
  261. this.getCorrelationNum();
  262. checkManageList(obj).then(response => {
  263. this.total = response.data.total;
  264. this.tableList = response.data.records;
  265. });
  266. },
  267. /** 搜索按钮操作 */
  268. handleQuery() {
  269. this.$set(this.queryParams,'pageNum',1);
  270. this.getList();
  271. },
  272. /** 重置按钮操作 */
  273. resetQuery() {
  274. this.$set(this,'dateRange',[]);
  275. this.$set(this,'queryParams',{
  276. pageNum:1,
  277. pageSize:20,
  278. checkType:2,
  279. manageStatus:'-1',
  280. checkTimeSort:0,
  281. searchValue:"",
  282. deptId:"",
  283. myRelated:1,
  284. });
  285. this.handleQuery();
  286. },
  287. //查看单个文档
  288. lookDocumentButton(type,row){
  289. if(type==1){
  290. this.$set(this,'propsLookDocumentData',{
  291. title:"整改报告",
  292. type:1,
  293. id:row.id,
  294. name:row.title
  295. });
  296. this.$set(this,'lookDocumentType',true);
  297. }else{
  298. this.$set(this,'lookDocumentType',false);
  299. }
  300. },
  301. //查看多个文档
  302. lookDocumentListButton(type,row){
  303. if(type==1){
  304. getFindByCheckPlanId({checkPlanId:row.checkPlanId}).then(response => {
  305. let list = [];
  306. for(let i=0;i<response.data.length;i++){
  307. let obj = {
  308. name:response.data[i].fileName,
  309. url:response.data[i].fileUrl,
  310. }
  311. list.push(obj);
  312. }
  313. this.$set(this,'propsLookDocumentListData',{
  314. title:"查看附件",
  315. list:list
  316. });
  317. this.$set(this,'lookDocumentListType',true);
  318. });
  319. }else{
  320. this.$set(this,'lookDocumentListType',false);
  321. }
  322. },
  323. //获取学院列表
  324. listDepartments(){
  325. listDepartments().then(response => {
  326. this.deptSelectList = response.data;
  327. });
  328. },
  329. },
  330. }
  331. </script>
  332. <style scoped lang="scss">
  333. ::v-deep .el-table__body-wrapper{
  334. padding-bottom: 8px;
  335. }
  336. ::v-deep .el-table__fixed{
  337. margin-top:-1px;
  338. margin-left:-1px;
  339. height:calc(100% - 8px)!important;
  340. }
  341. ::v-deep .el-table__fixed-body-wrapper{
  342. height: calc(100% - 48px);
  343. overflow-y: auto;
  344. }
  345. .selfInspectionManagement{
  346. flex: 1;
  347. display: flex !important;
  348. flex-direction: column;
  349. overflow: hidden;
  350. .selfInspectionManagement-page{
  351. flex: 1;
  352. display: flex !important;
  353. flex-direction: column;
  354. overflow: hidden;
  355. .title-box{
  356. padding-top:20px;
  357. border-bottom:1px solid #dedede;
  358. .form-button-max-big-box{
  359. display: inline-block;
  360. .form-button-big-box{
  361. display: flex;
  362. div{
  363. position: relative;
  364. height:40px;
  365. width:80px;
  366. line-height: 40px;
  367. text-align: center;
  368. color:#999;
  369. font-size:14px;
  370. border:1px solid #999;
  371. border-radius:4px;
  372. margin-left:10px;
  373. font-weight:500;
  374. cursor: pointer;
  375. .icon-p{
  376. width:15px;
  377. height:15px;
  378. line-height:15px;
  379. text-align: center;
  380. position: absolute;
  381. right:0;
  382. bottom:0;
  383. color:#fff;
  384. background: #0183fa;
  385. border-top-left-radius:4px;
  386. }
  387. }
  388. .checkDiv{
  389. color:#0183FA;
  390. border:1px solid #0183FA;
  391. }
  392. }
  393. }
  394. .form-button-max-big-box-me{
  395. display: inline-block;
  396. .form-button-big-box-me{
  397. display: flex;
  398. div{
  399. position: relative;
  400. height:40px;
  401. width:130px;
  402. line-height: 40px;
  403. text-align: center;
  404. color:#999;
  405. font-size:14px;
  406. border:1px solid #999;
  407. border-radius:4px;
  408. margin-left:10px;
  409. font-weight:500;
  410. cursor: pointer;
  411. .icon-p-me{
  412. width:15px;
  413. height:15px;
  414. line-height:15px;
  415. text-align: center;
  416. position: absolute;
  417. right:0;
  418. bottom:0;
  419. color:#fff;
  420. background: #0183fa;
  421. border-top-left-radius:4px;
  422. }
  423. }
  424. .checkDiv-me{
  425. color:#0183FA!important;
  426. border:1px solid #0183FA!important;
  427. }
  428. }
  429. }
  430. }
  431. .content-box{
  432. flex: 1;
  433. display: flex;
  434. flex-direction: column;
  435. padding:20px;
  436. overflow: hidden;
  437. }
  438. }
  439. }
  440. </style>