Browse Source

故障工单优化

maotao 3 months ago
parent
commit
a72cae900e

+ 3 - 1
components/IncidentListFilter.vue

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

+ 19 - 7
pages/incidentList/incidentList.vue

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

+ 3 - 0
share/useLoginSuccess.js

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