maotao 3 månader sedan
förälder
incheckning
9e752fcedb

+ 8 - 13
components/IncidentListFilter.vue

@@ -146,6 +146,7 @@
146
     category: {},
146
     category: {},
147
 		categoryValue:{},
147
 		categoryValue:{},
148
     acceptDate: [],
148
     acceptDate: [],
149
+		dept: {},
149
 		deptValue: {}
150
 		deptValue: {}
150
   })
151
   })
151
 
152
 
@@ -185,8 +186,8 @@
185
     searchData.category = {};
186
     searchData.category = {};
186
     searchData.acceptDate = [];
187
     searchData.acceptDate = [];
187
 		searchData.categoryValue = {};
188
 		searchData.categoryValue = {};
189
+		searchData.dept = {};
188
 		searchData.deptValue = {};
190
 		searchData.deptValue = {};
189
-    console.log(searchData.acceptDate)
190
   }
191
   }
191
 
192
 
192
   // 取消
193
   // 取消
@@ -218,7 +219,7 @@
218
 
219
 
219
 	// 选择维修科室
220
 	// 选择维修科室
220
 	function deptChange(val){
221
 	function deptChange(val){
221
-		searchData.deptValue = val.detail.value[val.detail.value.length-1]
222
+		searchData.dept = val.detail.value[val.detail.value.length-1]
222
 	}
223
 	}
223
 
224
 
224
 	// 选择故障现象
225
 	// 选择故障现象
@@ -339,16 +340,6 @@
339
   onLoad((option) => {
340
   onLoad((option) => {
340
 		getCategoryList()
341
 		getCategoryList()
341
     // searchData.hospital = evt.hospital;
342
     // searchData.hospital = evt.hospital;
342
-    for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
343
-      if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
344
-        let currentMenu = loginUserStore.loginUser.menu[i].children;
345
-        for (let j = 0; j < currentMenu; j++) {
346
-            if (currentMenu[j].link == "all") {
347
-              tabs.splice(0, 0 , { name: '全部事件', value: 'all' });
348
-            }
349
-        }
350
-      }
351
-    }
352
 		let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
343
 		let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
353
 		console.log(9555,menu)
344
 		console.log(9555,menu)
354
 		showDept.value = false
345
 		showDept.value = false
@@ -359,6 +350,8 @@
359
 						el.childrens.forEach(item =>{
350
 						el.childrens.forEach(item =>{
360
 							if(item.link=='strideLook'){
351
 							if(item.link=='strideLook'){
361
 								showDept.value = true
352
 								showDept.value = true
353
+							}else if(item.link=='all'){
354
+								tabs.splice(0, 0 , { name: '全部事件', value: 'all' });
362
 							}
355
 							}
363
 						})
356
 						})
364
 					}
357
 					}
@@ -374,8 +367,10 @@
374
 		searchData.categoryValue = evt.categoryValue;
367
 		searchData.categoryValue = evt.categoryValue;
375
     searchData.acceptDate = evt.acceptDate;
368
     searchData.acceptDate = evt.acceptDate;
376
 		if(showDept.value){
369
 		if(showDept.value){
377
-			searchData.deptValue = evt.deptValue?evt.deptValue.value:'';
370
+			searchData.deptValue = evt.deptValue;
371
+			searchData.dept = evt.dept;
378
 		}
372
 		}
373
+		console.log(2222,evt)
379
   })
374
   })
380
 </script>
375
 </script>
381
 
376
 

+ 2 - 2
pages/assign/assign.vue

@@ -1277,8 +1277,8 @@
1277
     let shijianliebiao_supplement = false;//故障处理权限
1277
     let shijianliebiao_supplement = false;//故障处理权限
1278
     for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
1278
     for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
1279
       if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
1279
       if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
1280
-        let currentMenu = loginUserStore.loginUser.menu[i].children;
1281
-        for (let j = 0; j < currentMenu; j++) {
1280
+        let currentMenu = loginUserStore.loginUser.menu[i].childrens;
1281
+        for (let j = 0; j < currentMenu.length; j++) {
1282
             if (currentMenu[j].link == "replenishment") {
1282
             if (currentMenu[j].link == "replenishment") {
1283
               shijianliebiao_supplement = true
1283
               shijianliebiao_supplement = true
1284
             }
1284
             }

+ 2 - 2
pages/changeUser/changeUser.vue

@@ -200,8 +200,8 @@
200
         let assignFlag = false;//指派权限
200
         let assignFlag = false;//指派权限
201
         for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
201
         for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
202
           if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
202
           if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
203
-            let currentMenu = loginUserStore.loginUser.menu[i].children;
204
-            for (let j = 0; j < currentMenu; j++) {
203
+            let currentMenu = loginUserStore.loginUser.menu[i].childrens;
204
+            for (let j = 0; j < currentMenu.length; j++) {
205
                 if (currentMenu[j].link == "assign") {
205
                 if (currentMenu[j].link == "assign") {
206
                     assignFlag = true
206
                     assignFlag = true
207
                 }
207
                 }

+ 2 - 2
pages/handler/handler.vue

@@ -584,8 +584,8 @@
584
           let chuli = false;//故障处理权限
584
           let chuli = false;//故障处理权限
585
           for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
585
           for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
586
             if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
586
             if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
587
-              let currentMenu = loginUserStore.loginUser.menu[i].children;
588
-              for (let j = 0; j < currentMenu; j++) {
587
+              let currentMenu = loginUserStore.loginUser.menu[i].childrens;
588
+              for (let j = 0; j < currentMenu.length; j++) {
589
                 if (currentMenu[j].link == "handle") {
589
                 if (currentMenu[j].link == "handle") {
590
                   chuli = true
590
                   chuli = true
591
                 }
591
                 }

+ 67 - 25
pages/incidentList/incidentList.vue

@@ -16,7 +16,7 @@
16
 
16
 
17
         <view class="body_item_content">
17
         <view class="body_item_content">
18
           <view class="body_item_content_p">
18
           <view class="body_item_content_p">
19
-            <text class="name ellipsis" v-if="data.repairIncidentType.value === 'dept'">报修科室:{{data.department.dept}}</text>
19
+            <text class="name ellipsis" v-if="data.repairIncidentType.value === 'dept'">报修科室:{{data.department?data.department.dept:''}}</text>
20
             <text class="name ellipsis" v-if="data.repairIncidentType.value === 'public'">报修类型:{{data.repairIncidentType.name}}</text>
20
             <text class="name ellipsis" v-if="data.repairIncidentType.value === 'public'">报修类型:{{data.repairIncidentType.name}}</text>
21
             <view class="status" :style="stateStyle(data.state)">{{data.state ? data.state.name : ''}}</view>
21
             <view class="status" :style="stateStyle(data.state)">{{data.state ? data.state.name : ''}}</view>
22
           </view>
22
           </view>
@@ -104,7 +104,7 @@
104
 
104
 
105
   const assignFlag = ref(false);//指派权限
105
   const assignFlag = ref(false);//指派权限
106
   const qiangdan = ref(false);//接单权限
106
   const qiangdan = ref(false);//接单权限
107
-
107
+	const showDept = ref(false);//跨科权限
108
   // 判断是否显示接单按钮
108
   // 判断是否显示接单按钮
109
   const computedReceive = computed(() => (data) => {
109
   const computedReceive = computed(() => (data) => {
110
     let inUser = data.handlingPersonnelUser && data.handlingPersonnelUser.id == loginUserStore.loginUser.user.id;
110
     let inUser = data.handlingPersonnelUser && data.handlingPersonnelUser.id == loginUserStore.loginUser.user.id;
@@ -145,6 +145,7 @@
145
       area: {id: 0, area: '全部'},
145
       area: {id: 0, area: '全部'},
146
       category: {id: 0, category: '全部'},
146
       category: {id: 0, category: '全部'},
147
       acceptDate: [],
147
       acceptDate: [],
148
+			dept: {text: '全部', value: 0},
148
     },//筛选框数据
149
     },//筛选框数据
149
   })
150
   })
150
 
151
 
@@ -305,23 +306,50 @@
305
 		let hospital = loginUserStore.loginUser.user.currentHospital?
306
 		let hospital = loginUserStore.loginUser.user.currentHospital?
306
 		loginUserStore.loginUser.user.currentHospital:
307
 		loginUserStore.loginUser.user.currentHospital:
307
 		loginUserStore.loginUser.hospital[0]
308
 		loginUserStore.loginUser.hospital[0]
308
-    if(postData.incident.queryTask === 'all' || postData.incident.queryTask === 'callback'){
309
-			if(hospital.type && hospital.type.value == 6){ // 当前是责任科室
310
-        postData.incident.duty = hospital;
311
-      }else{ // 当前是院区
312
-				postData.incident.hosId = hospital.id;
313
-			}
314
-    }else{
315
-      delete postData.incident.duty;
316
-      delete postData.incident.hosId;
317
-    }
318
-
319
-		if(postData.incident.queryTask!='todo' && postData.incident.queryTask!='doing' && postData.incident.queryTask!='storage'){
320
-			if(dataInfo.evtFilter.deptValue && dataInfo.evtFilter.deptValue.value){
321
-				let infoPermission = loginUserStore.loginUser.infoPermission
322
-				let itemDept = infoPermission.dutyList.find(i=>i.id == dataInfo.evtFilter.deptValue.value)
323
-				postData.incident.duty = itemDept;
324
-				delete postData.incident.hosId;
309
+   //  if(postData.incident.queryTask === 'all' || postData.incident.queryTask === 'callback'){
310
+			// if(hospital.type && hospital.type.value == 6){ // 当前是责任科室
311
+   //      postData.incident.duty = hospital;
312
+   //    }else{ // 当前是院区
313
+			// 	postData.incident.hosId = hospital.id;
314
+			// }
315
+   //  }else{
316
+   //    delete postData.incident.duty;
317
+   //    delete postData.incident.hosId;
318
+   //  }
319
+
320
+		// if(postData.incident.queryTask!='todo' && postData.incident.queryTask!='doing' && postData.incident.queryTask!='storage'){
321
+		// 	if(dataInfo.evtFilter.deptValue && dataInfo.evtFilter.deptValue.value){
322
+		// 		let infoPermission = loginUserStore.loginUser.infoPermission
323
+		// 		let itemDept = infoPermission.dutyList.find(i=>i.id == dataInfo.evtFilter.deptValue.value)
324
+		// 		postData.incident.duty = itemDept;
325
+		// 		delete postData.incident.hosId;
326
+		// 	}
327
+		// }
328
+		
329
+		if(postData.incident.queryTask != 'todoingAll'){
330
+			if(showDept.value){
331
+				if(dataInfo.evtFilter.deptValue && dataInfo.evtFilter.deptValue.value){
332
+					let infoPermission = loginUserStore.loginUser.infoPermission
333
+					let itemDept = infoPermission.dutyList.find(i=>i.id == dataInfo.evtFilter.deptValue.value)
334
+					postData.incident.duty = itemDept;
335
+					delete postData.incident.hosId;
336
+				}else{
337
+					if(hospital.type && hospital.type.value == 6){ // 当前是责任科室
338
+						 postData.incident.duty = hospital;
339
+						 delete postData.incident.hosId
340
+					 }else{ // 当前是院区
341
+						postData.incident.hosId = hospital.id;
342
+						delete postData.incident.duty
343
+					}
344
+				}
345
+			}else{
346
+				if(hospital.type && hospital.type.value == 6){ // 当前是责任科室
347
+					 postData.incident.duty = hospital;
348
+					 delete postData.incident.hosId
349
+				 }else{ // 当前是院区
350
+					postData.incident.hosId = hospital.id;
351
+					delete postData.incident.duty
352
+				}
325
 			}
353
 			}
326
 		}
354
 		}
327
 
355
 
@@ -353,6 +381,7 @@
353
       uni.hideLoading();
381
       uni.hideLoading();
354
       uni.stopPullDownRefresh();
382
       uni.stopPullDownRefresh();
355
       if(res.status == 200){
383
       if(res.status == 200){
384
+				console.log(6666,incidentListSearchStore.incidentListSearch.data)
356
         let list = res.list || [];
385
         let list = res.list || [];
357
         if(list.length){
386
         if(list.length){
358
           dataInfo.hasMore = true;
387
           dataInfo.hasMore = true;
@@ -399,25 +428,38 @@
399
   // 初始化
428
   // 初始化
400
   function onLoadFn(){
429
   function onLoadFn(){
401
     // 我的-数量跳转
430
     // 我的-数量跳转
431
+		let storeData = incidentListSearchStore.incidentListSearch.data
432
+		let hospital = loginUserStore.loginUser.user.currentHospital
402
     if(incidentNumStore.incidentNum.data){
433
     if(incidentNumStore.incidentNum.data){
434
+			console.log(111)
403
       dataInfo.evtFilter.selected = incidentNumStore.incidentNum.data.queryTask;
435
       dataInfo.evtFilter.selected = incidentNumStore.incidentNum.data.queryTask;
404
       dataInfo.tabActiveId = incidentNumStore.incidentNum.data.statusId;
436
       dataInfo.tabActiveId = incidentNumStore.incidentNum.data.statusId;
405
       incidentNumStore.clearIncidentNumData();
437
       incidentNumStore.clearIncidentNumData();
406
-    }else if(incidentListSearchStore.incidentListSearch.data){
407
-      // 缓存的搜索条件
408
-      Object.assign(dataInfo, incidentListSearchStore.incidentListSearch.data);
409
-    }
438
+    }else if(storeData){
439
+			console.log(222)
440
+			Object.assign(dataInfo, storeData);
441
+    }else{
442
+			console.log(333)
443
+			// if(Object.keys(dataInfo.evtFilter.dept).length == 0){
444
+				dataInfo.evtFilter.dept.text = hospital.hosName
445
+				dataInfo.evtFilter.dept.value = hospital.id
446
+				dataInfo.evtFilter.deptValue = hospital.id
447
+			// }
448
+		}
410
 
449
 
411
     for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
450
     for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
412
       if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
451
       if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
413
-        let currentMenu = loginUserStore.loginUser.menu[i].children;
414
-        for (let j = 0; j < currentMenu; j++) {
452
+        let currentMenu = loginUserStore.loginUser.menu[i].childrens;
453
+        for (let j = 0; j < currentMenu.length; j++) {
415
           if (currentMenu[j].link == "assign") {
454
           if (currentMenu[j].link == "assign") {
416
             assignFlag.value = true;
455
             assignFlag.value = true;
417
           }
456
           }
418
           if (currentMenu[j].link == "receive") {
457
           if (currentMenu[j].link == "receive") {
419
             qiangdan.value = true
458
             qiangdan.value = true
420
           }
459
           }
460
+					if (currentMenu[j].link == "strideLook") {
461
+					  showDept.value = true
462
+					}
421
         }
463
         }
422
       }
464
       }
423
     }
465
     }