maotao пре 3 месеци
родитељ
комит
a72cae900e
3 измењених фајлова са 25 додато и 8 уклоњено
  1. 3 1
      components/IncidentListFilter.vue
  2. 19 7
      pages/incidentList/incidentList.vue
  3. 3 0
      share/useLoginSuccess.js

+ 3 - 1
components/IncidentListFilter.vue

@@ -369,8 +369,10 @@
369 369
 		if(showDept.value){
370 370
 			searchData.deptValue = evt.deptValue;
371 371
 			searchData.dept = evt.dept;
372
+		}else{
373
+			searchData.deptValue = {};
374
+			searchData.dept = {};
372 375
 		}
373
-		console.log(2222,evt)
374 376
   })
375 377
 </script>
376 378
 

+ 19 - 7
pages/incidentList/incidentList.vue

@@ -72,7 +72,7 @@
72 72
   import RequireAttachment from '@/components/RequireAttachment.vue';
73 73
   import { startOfDay, endOfDay, format, add } from 'date-fns'
74 74
   import { ref, reactive, computed } from 'vue'
75
-  import { onLoad, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
75
+  import { onLoad, onUnload, onHide, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
76 76
   import { api_getDictionary, api_incident, api_incident_count, api_incidentTask } from "@/http/api.js"
77 77
   import { filterFormatDate } from '@/filters/filterFormatDate.js'
78 78
   import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
@@ -328,9 +328,9 @@
328 328
 		
329 329
 		if(postData.incident.queryTask != 'todoingAll'){
330 330
 			if(showDept.value){
331
-				if(dataInfo.evtFilter.deptValue && dataInfo.evtFilter.deptValue.value){
331
+				if(dataInfo.evtFilter.dept && dataInfo.evtFilter.dept.value){
332 332
 					let infoPermission = loginUserStore.loginUser.infoPermission
333
-					let itemDept = infoPermission.dutyList.find(i=>i.id == dataInfo.evtFilter.deptValue.value)
333
+					let itemDept = infoPermission.dutyList.find(i=>i.id == dataInfo.evtFilter.dept.value)
334 334
 					postData.incident.duty = itemDept;
335 335
 					delete postData.incident.hosId;
336 336
 				}else{
@@ -381,7 +381,6 @@
381 381
       uni.hideLoading();
382 382
       uni.stopPullDownRefresh();
383 383
       if(res.status == 200){
384
-				console.log(6666,incidentListSearchStore.incidentListSearch.data)
385 384
         let list = res.list || [];
386 385
         if(list.length){
387 386
           dataInfo.hasMore = true;
@@ -436,8 +435,13 @@
436 435
       dataInfo.tabActiveId = incidentNumStore.incidentNum.data.statusId;
437 436
       incidentNumStore.clearIncidentNumData();
438 437
     }else if(storeData){
439
-			console.log(222)
440 438
 			Object.assign(dataInfo, storeData);
439
+			if(Object.keys(dataInfo.evtFilter.dept).length == 0){
440
+				dataInfo.evtFilter.dept.text = hospital.hosName
441
+				dataInfo.evtFilter.dept.value = hospital.id
442
+				dataInfo.evtFilter.deptValue = hospital.id
443
+			}
444
+			console.log(222,dataInfo.evtFilter)
441 445
     }else{
442 446
 			console.log(333)
443 447
 			// if(Object.keys(dataInfo.evtFilter.dept).length == 0){
@@ -471,9 +475,17 @@
471 475
     }
472 476
     onLoadFn();
473 477
   })
474
-
478
+	
479
+	onUnload(() => {
480
+    dataInfo.isFilter = false;
481
+  })
482
+	
483
+	onHide(() => {
484
+	  dataInfo.isFilter = false;
485
+	})
486
+	
475 487
   onTabItemTap(e => {
476
-    onLoadFn();
488
+    // onLoadFn();
477 489
   })
478 490
 
479 491
   onPullDownRefresh(() => {

+ 3 - 0
share/useLoginSuccess.js

@@ -1,5 +1,7 @@
1 1
 import { useLoginUserStore } from '@/stores/loginUser'
2
+import { useIncidentListSearchStore } from '@/stores/incidentListSearch'
2 3
 const loginUserStore = useLoginUserStore()
4
+const incidentListSearchStore = useIncidentListSearchStore();
3 5
 export function useLoginSuccess() {
4 6
   /**
5 7
    * 登录成功后的操作
@@ -9,6 +11,7 @@ export function useLoginSuccess() {
9 11
     loginUserStore.setLoginUser(user.user);
10 12
     loginUserStore.setLoginUserMenu(user.menu);
11 13
 		loginUserStore.setInfoPermission(user.infoPermission);
14
+		incidentListSearchStore.clearIncidentListSearchData();
12 15
 		let loginType = uni.getStorageSync('loginType'); //1:处理 2:报修
13 16
     // 判断用户标识是否为处理人
14 17
     if (user.user.engineer === 1) {