toDoListBox.vue 13 KB

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