toDoListBox.vue 13 KB

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