toDoListBox.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <div class="toDoListBox">
  3. <div class="toDoListBox-form-box">
  4. <div class="form-button-box">
  5. <p :class="queryParams.manageStatus == 0?'check-p':''" @click="titleClickButton(0)">待检查</p>
  6. <p :class="queryParams.manageStatus == 1?'check-p':''" @click="titleClickButton(1)">检查中</p>
  7. <p :class="queryParams.manageStatus == 2?'check-p':''" @click="titleClickButton(2)">待复核</p>
  8. </div>
  9. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
  10. <el-form-item label="" prop="searchValue" label-width="80px">
  11. <el-input
  12. maxLength="30"
  13. v-model="queryParams.searchValue"
  14. placeholder="搜索实验室/房间号"
  15. style="width: 186px">
  16. <p slot="append" class="el-icon-search" @click="handleQuery"></p>
  17. </el-input>
  18. </el-form-item>
  19. </el-form>
  20. </div>
  21. <div class="toDoListBox-list-box scrollbar-box"
  22. @mouseleave="tableTimerFun"
  23. @mouseenter="tableTimerOff"
  24. ref="scrollDiv">
  25. <div class="for-list-box"
  26. v-for="(item,index) in tableList" :key="index">
  27. <div class="for-name-box">
  28. <p class="name-p">{{item.subjectName}}-{{item.roomNumber}}</p>
  29. <p class="type-p" v-if="item.isOverdue == 1">已逾期</p>
  30. <p class="null-p"></p>
  31. <img v-if="item.isAttachment == 1" @click="lookDocumentListButton(1,item)"
  32. src="@/assets/ZDimages/safetyCheck/icon_gzt_bg.png">
  33. </div>
  34. <div class="for-title-box">
  35. <p>{{item.title}}</p>
  36. </div>
  37. <div class="for-button-box">
  38. <p>{{item.manageStatus==0?'待检查':(item.manageStatus==1?'检查中':(item.manageStatus==2?'待复核':''))}}</p>
  39. <p>{{item.checkType==1?'校院巡查':(item.checkType==2?'实验室自查':'')}}</p>
  40. <p>{{item.collegeName}}</p>
  41. </div>
  42. <div class="for-time-box">
  43. <p>计划周期:{{item.cycleStartTime}} 至 {{item.cycleEndTime}}</p>
  44. <p v-if="queryParams.manageStatus == 0" :class="item.checkIsStatus?'':'noButton'" @click="goPage(item)">{{item.checkIsStatus?'开始检查':'计划未开始'}}</p>
  45. <p v-if="queryParams.manageStatus == 1" @click="goPage(item)">编辑</p>
  46. <p v-if="queryParams.manageStatus == 2" @click="addDialogOpen(true,item)">复核</p>
  47. </div>
  48. <img class="position-img" v-if="item.checkRange == 1" src="@/assets/ZDimages/safetyCheck/icon_xyxc_qx.png">
  49. <img class="position-img" v-if="item.checkRange == 2" src="@/assets/ZDimages/safetyCheck/icon_xyxc_xy.png">
  50. <img class="position-img" v-if="item.checkRange == 3" src="@/assets/ZDimages/safetyCheck/icon_xyxc_sys.png">
  51. </div>
  52. <img v-if="!tableList[0]" class="null-img" src="@/assets/ZDimages/null-data-1.png">
  53. </div>
  54. <infoDialog v-if="infoDialogType" :propsInfoDialogData="propsInfoDialogData"></infoDialog>
  55. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  56. </div>
  57. </template>
  58. <script>
  59. import { todoList, tobeReviewed,getFindByCheckPlanId } from '@/api/safetyCheck/index'
  60. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  61. import infoDialog from '@/views/safetyCheck/components/infoDialog/infoDialog.vue'
  62. export default {
  63. name: 'toDoListBox',
  64. components: {
  65. infoDialog,
  66. lookDocumentListDialog
  67. },
  68. data(){
  69. return{
  70. //子组件数据
  71. infoDialogType:false,
  72. propsInfoDialogData:{},
  73. lookDocumentListType:false,
  74. propsLookDocumentListData:{},
  75. queryParams:{
  76. manageStatus:0,
  77. searchValue:"",
  78. },
  79. tableList:[],
  80. total:0,
  81. //跳转巡查权限
  82. goInspectionManagement:false,
  83. //跳转自查权限
  84. goSelfInspectionManagement:false,
  85. /*****************数据滚动相关*****************/
  86. tableTimer: null,
  87. }
  88. },
  89. created(){
  90. this.getList();
  91. this.setButtonList();
  92. },
  93. mounted(){
  94. },
  95. methods:{
  96. //滚动方法
  97. tableActionFun() {
  98. this.$refs.scrollDiv.scrollTop = 0;
  99. this.tableTimerFun();
  100. },
  101. //开始滚动
  102. tableTimerFun() {
  103. if(this.tableList[3]){
  104. this.tableTimer = window.setInterval(() => {
  105. let csrollTop = this.$refs.scrollDiv.scrollTop
  106. let maxHeight = this.$refs.scrollDiv.scrollHeight - this.$refs.scrollDiv.offsetHeight
  107. if (csrollTop >= maxHeight) {
  108. this.$refs.scrollDiv.scrollTop = 0;
  109. } else {
  110. this.$refs.scrollDiv.scrollTop += 1;
  111. }
  112. }, 30);
  113. }
  114. },
  115. //停止滚动
  116. tableTimerOff(){
  117. window.clearInterval(this.tableTimer)
  118. },
  119. //跳转
  120. goPage(item){
  121. //跳转 巡查/自查页面
  122. if(item.checkType == 1){
  123. //巡查
  124. if(this.goInspectionManagement){
  125. this.$router.push({
  126. path: `/safetyCheck/schoolInspection/inspectionManagement`,
  127. query:{
  128. id:item.id
  129. }
  130. })
  131. }else{
  132. this.msgError('没有相关权限,请联系管理员')
  133. }
  134. }else if(item.checkType == 2){
  135. //自查
  136. if(this.goSelfInspectionManagement){
  137. this.$router.push({
  138. path: `/safetyCheck/laboratorySelfTest/selfInspectionManagement`,
  139. query:{
  140. id:item.id
  141. }
  142. })
  143. }else{
  144. this.msgError('没有相关权限,请联系管理员')
  145. }
  146. }
  147. },
  148. //开关详情页面
  149. addDialogOpen(type,data){
  150. if(this.infoDialogType != type){
  151. if(type){
  152. let obj = {
  153. id:data.hazardId
  154. }
  155. this.$set(this,'propsInfoDialogData',obj);
  156. this.$set(this,'infoDialogType',type);
  157. }else{
  158. this.$set(this,'infoDialogType',type);
  159. }
  160. }
  161. },
  162. titleClickButton(type){
  163. if(this.queryParams.manageStatus != type){
  164. this.$set(this.queryParams,'manageStatus',type);
  165. this.getList();
  166. }
  167. },
  168. //获取数据列表
  169. getList(){
  170. clearInterval(this.tableTimer);
  171. if(this.queryParams.manageStatus == 2){
  172. tobeReviewed(this.queryParams.searchValue).then(response => {
  173. this.$set(this,'tableList',response.rows);
  174. this.tableActionFun();
  175. });
  176. }else{
  177. todoList(this.queryParams).then(response => {
  178. this.$set(this,'tableList',response.rows);
  179. this.tableActionFun();
  180. });
  181. }
  182. },
  183. /** 搜索按钮操作 */
  184. handleQuery() {
  185. this.getList();
  186. },
  187. //查看多个文档
  188. lookDocumentListButton(type,item){
  189. if(type==1){
  190. getFindByCheckPlanId({checkPlanId:item.checkPlanId}).then(response => {
  191. let list = [];
  192. for(let i=0;i<response.data.length;i++){
  193. let obj = {
  194. name:response.data[i].fileName,
  195. url:response.data[i].fileUrl,
  196. }
  197. list.push(obj);
  198. }
  199. this.$set(this,'propsLookDocumentListData',{
  200. title:"查看附件",
  201. list:list
  202. });
  203. this.$set(this,'lookDocumentListType',true);
  204. });
  205. }else{
  206. this.$set(this,'lookDocumentListType',false);
  207. }
  208. },
  209. //权限查找
  210. setButtonList() {
  211. let localRoute = JSON.parse(localStorage.getItem("routeData"))
  212. this.forRouteData('inspectionManagement',localRoute);
  213. this.forRouteData('selfInspectionManagement',localRoute);
  214. },
  215. forRouteData(item,list){
  216. let self = this;
  217. for(let i=0;i<list.length;i++){
  218. if(item == list[i].path){
  219. if(item == 'inspectionManagement'){
  220. self.$set(self,'goInspectionManagement',true);
  221. }else if(item == 'selfInspectionManagement'){
  222. self.$set(self,'goSelfInspectionManagement',true);
  223. }
  224. }else{
  225. if(list[i].children){
  226. self.forRouteData(item,list[i].children)
  227. }
  228. }
  229. }
  230. },
  231. },
  232. beforeDestroy() {
  233. //清除定时器
  234. window.clearInterval(this.tableTimer);
  235. this.$set(this,'tableTimer',null);
  236. this.$set(this,'tableList',[]);
  237. },
  238. destroyed() {
  239. //清除定时器
  240. window.clearInterval(this.tableTimer);
  241. this.$set(this,'tableTimer',null);
  242. this.$set(this,'tableList',[]);
  243. }
  244. }
  245. </script>
  246. <style scoped lang="scss">
  247. .toDoListBox{
  248. height:676px;
  249. display: flex;
  250. flex-direction: column;
  251. overflow: hidden;
  252. .toDoListBox-form-box{
  253. display: flex;
  254. padding:30px 20px 0;
  255. .form-button-box{
  256. display: flex;
  257. p{
  258. cursor: pointer;
  259. width:80px;
  260. height:30px;
  261. font-size:14px;
  262. color:#333;
  263. border:1px solid #E0E0E0;
  264. border-radius:4px;
  265. line-height:28px;
  266. text-align: center;
  267. margin-right:10px;
  268. }
  269. .check-p{
  270. color:#fff;
  271. border-color: #0183FA;
  272. background-color: #0183FA;
  273. }
  274. }
  275. ::v-deep .el-input__inner{
  276. height:30px;
  277. border: 1px solid #DCDFE6;
  278. border-right:none;
  279. padding-right:0;
  280. }
  281. ::v-deep .el-input-group__append{
  282. padding:0 11px;
  283. background-color: #fff;
  284. cursor: pointer;
  285. }
  286. }
  287. .toDoListBox-list-box{
  288. position: relative;
  289. padding:0 20px 20px;
  290. flex:1;
  291. .null-img{
  292. width:160px;
  293. margin:160px 0 0 170px;
  294. }
  295. .for-list-box{
  296. height:190px;
  297. border-radius:20px;
  298. border:1px solid rgba(0,0,0,0.1);
  299. margin-top:20px;
  300. position: relative;
  301. .for-name-box{
  302. overflow: hidden;
  303. padding:0 20px 0 58px;
  304. display: flex;
  305. margin:20px 0 12px;
  306. .name-p{
  307. height:24px;
  308. line-height:24px;
  309. font-size:16px;
  310. color:#333;
  311. max-width:280px;
  312. display:block;
  313. overflow: hidden;
  314. text-overflow:ellipsis;
  315. white-space:nowrap;
  316. }
  317. .type-p{
  318. border-radius:4px;
  319. text-align: center;
  320. width:60px;
  321. margin:2px 0 2px 10px;
  322. height:20px;
  323. line-height:20px;
  324. color:#FF3131;
  325. font-size:14px;
  326. background-color: rgba(255,49,49,0.2);
  327. }
  328. .null-p{
  329. flex:1;
  330. }
  331. img{
  332. width:15px;
  333. height:16px;
  334. margin:4px 0 0 10px;
  335. cursor: pointer;
  336. }
  337. }
  338. .for-title-box{
  339. overflow: hidden;
  340. padding:0 20px 0 58px;
  341. display: flex;
  342. margin-bottom:18px;
  343. p{
  344. height:20px;
  345. line-height:20px;
  346. font-size:14px;
  347. color:#333;
  348. max-width:375px;
  349. display:block;
  350. overflow: hidden;
  351. text-overflow:ellipsis;
  352. white-space:nowrap;
  353. }
  354. }
  355. .for-button-box{
  356. display: flex;
  357. margin:0 20px 20px 58px;
  358. font-size:14px;
  359. p:nth-child(1){
  360. width:80px;
  361. line-height:30px;
  362. background: rgba(1,131,250,0.1);
  363. margin-right:13px;
  364. border-radius:80px;
  365. text-align: center;
  366. color:#0183FA;
  367. }
  368. p:nth-child(2){
  369. padding:0 12px;
  370. line-height:30px;
  371. border:1px solid #E0E0E0;
  372. border-radius:80px;
  373. text-align: center;
  374. color:#666666;
  375. }
  376. p:nth-child(3){
  377. width:165px;
  378. line-height:30px;
  379. color:#333;
  380. margin-left:22px;
  381. display:block;
  382. overflow: hidden;
  383. text-overflow:ellipsis;
  384. white-space:nowrap;
  385. }
  386. }
  387. .for-time-box{
  388. display: flex;
  389. height:42px;
  390. border-top:1px dashed #D8D8D8;
  391. line-height: 42px;
  392. p:nth-child(1){
  393. margin-left:20px;
  394. font-size:14px;
  395. flex:1;
  396. overflow: hidden;
  397. }
  398. p:nth-child(2){
  399. padding:0 20px;
  400. text-align: center;
  401. cursor: pointer;
  402. color:#0183FA;
  403. font-size:14px;
  404. }
  405. .noButton{
  406. color:#999!important;
  407. cursor: inherit!important;
  408. }
  409. }
  410. .position-img{
  411. width:80px;
  412. height:80px;
  413. position: absolute;
  414. left:0;
  415. top:0;
  416. }
  417. }
  418. .null-p{
  419. text-align: center;
  420. color:#999;
  421. line-height:100px;
  422. }
  423. }
  424. }
  425. </style>