seimin 7 miesięcy temu
rodzic
commit
fa89d71c2f

+ 10 - 10
src/app/views/fuwutai/fuwutai.component.html

@@ -110,7 +110,7 @@
110 110
       <div class="cots_body weifenpai" *ngIf="(txtLabelCol == 1 && flagList.hsmsFlag1 && !flagList.itsmFlag1) || flagList.itsmFlag1" [ngClass]="{ top185: hurseInfoHiding != '1', top185_1: flagList.itsmFlag1 }">
111 111
         <virtual-scroller [items]="unassignedList" #osComponentRef2 [ngStyle]="{ height: '100%' }">
112 112
           <ng-container *ngIf="unassignedList.length && !loading1">
113
-            <div class="list listsTypeColor" *ngFor="let data of osComponentRef2.viewPortItems">
113
+            <div class="list listsTypeColor" *ngFor="let data of osComponentRef2.viewPortItems;trackBy:trackById">
114 114
               <!-- 配送 -->
115 115
               <ng-container *ngIf="data.type === 'hsms'">
116 116
                 <div class="left_cots" (click)="openDetails(data.data)">
@@ -265,7 +265,7 @@
265 265
       <div class="cots_body weifenpai twoCol" *ngIf="txtLabelCol == 2 && flagList.hsmsFlag1 && !flagList.itsmFlag1" [ngClass]="{ top185: hurseInfoHiding != '1' }">
266 266
         <virtual-scroller [items]="unassignedList" #osComponentRef1 [ngStyle]="{ height: '100%' }">
267 267
           <ng-container *ngIf="unassignedList.length && !loading1">
268
-            <div class="list listsTypeColor" *ngFor="let data of osComponentRef1.viewPortItems">
268
+            <div class="list listsTypeColor" *ngFor="let data of osComponentRef1.viewPortItems;trackBy:trackById">
269 269
               <div class="left_cots" (click)="openDetails(data.data)">
270 270
                 <!-- 工单 -->
271 271
                 <div class="gongdan">
@@ -323,7 +323,7 @@
323 323
       <div class="cots_body daidaoda" *ngIf="(txtLabelCol == 1 && flagList.hsmsFlag2 && !flagList.itsmFlag2) || flagList.itsmFlag2" [ngClass]="{ top185: hurseInfoHiding != '1', top185_1: flagList.itsmFlag2 }">
324 324
         <virtual-scroller [items]="arriveList" #osComponentRef3 [ngStyle]="{ height: '100%' }">
325 325
           <ng-container *ngIf="arriveList.length && !loading2">
326
-            <div class="list listsTypeColor" *ngFor="let data of osComponentRef3.viewPortItems">
326
+            <div class="list listsTypeColor" *ngFor="let data of osComponentRef3.viewPortItems;trackBy:trackById">
327 327
               <!-- 配送 -->
328 328
               <ng-container *ngIf="data.type === 'hsms'">
329 329
                 <div class="left_cots" (click)="openDetails(data.data)">
@@ -454,8 +454,8 @@
454 454
                   </div>
455 455
                 </div>
456 456
                 <div class="right_bots display_flex col-flex align-items_center justify-content_flex-center gap8">
457
-                  <input type="button" *ngIf="computedSubstitution(data.data)" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
458
-                  <input type="button" *ngIf="computedReceive(data.data)" class="top_bot" value="接单" (click)="showDelModal($event, data.data,'您确认要接单吗?','接单','receive')" />
457
+                  <input type="button" *ngIf="data.computedSubstitutionFlag" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
458
+                  <input type="button" *ngIf="data.computedReceiveFlag" class="top_bot" value="接单" (click)="showDelModal($event, data.data,'您确认要接单吗?','接单','receive')" />
459 459
                   <input type="button" *ngIf="coopBtns.del" class="btm_bot" value="删除" (click)="openDelModal(data.data.id, 'itsm')" />
460 460
                 </div>
461 461
                 <div *ngIf="data.data.overtimePercent <= 100" class="slider sgreen" [ngStyle]="{ width: data.data.overtimePercent + '%' }"></div>
@@ -474,7 +474,7 @@
474 474
       <div class="cots_body daidaoda twoCol" *ngIf="txtLabelCol == 2 && flagList.hsmsFlag2 && !flagList.itsmFlag2" [ngClass]="{ top185: hurseInfoHiding != '1' }">
475 475
         <virtual-scroller [items]="arriveList" #osComponentRef4 [ngStyle]="{ height: '100%' }">
476 476
           <ng-container *ngIf="arriveList.length && !loading2">
477
-            <div class="list listsTypeColor" *ngFor="let data of osComponentRef4.viewPortItems">
477
+            <div class="list listsTypeColor" *ngFor="let data of osComponentRef4.viewPortItems;trackBy:trackById">
478 478
               <div class="left_cots" (click)="openDetails(data)">
479 479
                 <!-- 工单 -->
480 480
                 <div class="gongdan">
@@ -527,7 +527,7 @@
527 527
       <div class="cots_body zhixingzhong" *ngIf="(txtLabelCol == 1 && flagList.hsmsFlag3 && !flagList.itsmFlag3) || flagList.itsmFlag3" [ngClass]="{ top185: hurseInfoHiding != '1', top185_1: flagList.itsmFlag3 }">
528 528
         <virtual-scroller [items]="executionList" #osComponentRef5 [ngStyle]="{ height: '100%' }">
529 529
           <ng-container *ngIf="executionList.length && !loading3">
530
-            <div class="list" *ngFor="let data of osComponentRef5.viewPortItems">
530
+            <div class="list" *ngFor="let data of osComponentRef5.viewPortItems;trackBy:trackById">
531 531
               <!-- 配送 -->
532 532
               <ng-container *ngIf="data.type === 'hsms'">
533 533
                 <div class="left_cots" (click)="openDetails(data.data)">
@@ -658,8 +658,8 @@
658 658
                   </div>
659 659
                 </div>
660 660
                 <div class="right_bots display_flex col-flex align-items_center justify-content_flex-center gap8">
661
-                  <input type="button" *ngIf="computedSubstitution(data.data)" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
662
-                  <input type="button" *ngIf="computedHandle(data.data)" class="top_bot" value="处理" (click)="handle(data.data)" />
661
+                  <input type="button" *ngIf="data.computedSubstitutionFlag" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
662
+                  <input type="button" *ngIf="data.computedHandleFlag" class="top_bot" value="处理" (click)="handle(data.data)" />
663 663
                   <input type="button" *ngIf="coopBtns.del" class="btm_bot" value="删除" (click)="openDelModal(data.data.id, 'itsm')" />
664 664
                 </div>
665 665
                 <div *ngIf="data.data.overtimePercent <= 100" class="slider sgreen" [ngStyle]="{ width: data.data.overtimePercent + '%' }"></div>
@@ -678,7 +678,7 @@
678 678
       <div class="cots_body zhixingzhong twoCol" *ngIf="txtLabelCol == 2 && flagList.hsmsFlag3 && !flagList.itsmFlag3" [ngClass]="{ top185: hurseInfoHiding != '1' }">
679 679
         <virtual-scroller [items]="executionList" #osComponentRef6 [ngStyle]="{ height: '100%' }">
680 680
           <ng-container *ngIf="executionList.length && !loading3">
681
-            <div class="list" *ngFor="let data of osComponentRef6.viewPortItems">
681
+            <div class="list" *ngFor="let data of osComponentRef6.viewPortItems;trackBy:trackById">
682 682
               <div class="left_cots" (click)="openDetails(data)">
683 683
                 <!-- 工单 -->
684 684
                 <div class="gongdan">

+ 86 - 48
src/app/views/fuwutai/fuwutai.component.ts

@@ -17,7 +17,7 @@ import { NzMessageService } from "ng-zorro-antd/message";
17 17
 import { NzNotificationService } from "ng-zorro-antd/notification";
18 18
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
19 19
 import { Subject, forkJoin } from "rxjs";
20
-import { debounceTime, filter } from "rxjs/operators";
20
+import { debounceTime, filter, map } from "rxjs/operators";
21 21
 import { SourceId } from "src/app/type/types";
22 22
 import { ToolService } from 'src/app/services/tool.service';
23 23
 import { addDays, differenceInCalendarDays, getHours, getMinutes, setMinutes, parse, format, addHours } from 'date-fns';
@@ -692,7 +692,6 @@ export class FuwutaiComponent implements OnInit {
692 692
       workOrderRemark: [null], //工单备注
693 693
     });
694 694
 
695
-
696 695
     this.getWebsocketSer();
697 696
     this.initRole();
698 697
     this.initLogin();
@@ -713,10 +712,23 @@ export class FuwutaiComponent implements OnInit {
713 712
     this.getInspectAndPatientTransportConfigTasktype();
714 713
   }
715 714
   ngOnDestroy() {
715
+    document.removeEventListener("keydown", this.quickShowNewOrder.bind(this));
716
+    this.quickShowNewOrder = null;
716 717
     clearTimeout(this.refreshTimerId);
717 718
     this.phones.closeWs(true);
718 719
     this.sers.closeWs(true);
719 720
   }
721
+  ngAfterViewInit() {
722
+    // 快捷键打开新建工单
723
+    document.addEventListener("keydown", this.quickShowNewOrder.bind(this));
724
+  }
725
+  // 快捷键打开新建工单
726
+  quickShowNewOrder(e){
727
+    if (e.ctrlKey && e.key == "s") {
728
+      this.showNewOrder();
729
+      e.preventDefault();
730
+    }
731
+  }
720 732
   unassignedSearchCon: string = ""; //未分派搜索框内容
721 733
   arriveSearchCon: string = ""; //待到达搜索框内容
722 734
   executionSearchCon: string = ""; //执行中搜索框内容
@@ -843,6 +855,8 @@ export class FuwutaiComponent implements OnInit {
843 855
     this.flagList.itsmFlag2 = this.itsmData.mdv2Switch;
844 856
     this.flagList.itsmFlag3 = this.itsmData.mdv2Switch;
845 857
     this.getHospitalConfigList('allowNucleicAcidPrinting');
858
+    this.getConfigTasktype();
859
+    this.patientLogTasktype();
846 860
   }
847 861
 
848 862
   // 保存工单信息
@@ -1296,7 +1310,7 @@ export class FuwutaiComponent implements OnInit {
1296 1310
   getVisitList(){
1297 1311
     let postData: any = {
1298 1312
       idx: 0,
1299
-      sum: 9999,
1313
+      sum: 1,
1300 1314
       incident: {
1301 1315
         "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
1302 1316
         "hosIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
@@ -1319,7 +1333,7 @@ export class FuwutaiComponent implements OnInit {
1319 1333
   getMessageList(){
1320 1334
     let postData: any = {
1321 1335
       idx: 0,
1322
-      sum: 9999,
1336
+      sum: 1,
1323 1337
       hjzxRecord: {},
1324 1338
     };
1325 1339
 
@@ -1330,6 +1344,11 @@ export class FuwutaiComponent implements OnInit {
1330 1344
       });
1331 1345
   }
1332 1346
 
1347
+  //trackBy
1348
+  trackById(index, item) {
1349
+    return item.type + item.data.id;
1350
+  }
1351
+
1333 1352
   // 获取三个状态数据数据
1334 1353
   loading1 = true;
1335 1354
   loading2 = true;
@@ -1414,18 +1433,33 @@ export class FuwutaiComponent implements OnInit {
1414 1433
     }
1415 1434
 
1416 1435
     console.log(postData);
1417
-    this.mainService.orderList(postData).subscribe((data:any) => {
1436
+    this.mainService.orderList(postData).pipe(map((v:any) => {
1437
+      if(Array.isArray(v.data)){
1438
+        v.data.map(vv => {
1439
+          if(vv.type === 'mdv2' && vv.data.department){
1440
+            vv.data.department = {
1441
+              id: vv.data.department.id,
1442
+              dept: vv.data.department.dept,
1443
+              manyPhone: vv.data.department.manyPhone,
1444
+            }
1445
+          }
1446
+          return vv;
1447
+        })
1448
+      }else{
1449
+        v = [];
1450
+      }
1451
+      return v;
1452
+    })).subscribe((data:any) => {
1418 1453
         if (stateId == 1) {
1419 1454
           // 未分派
1420
-          this.unassignedList = data.data || [];
1421
-          this.unassignedList.forEach((item) => {
1455
+          let unassignedList = data.data || [];
1456
+          unassignedList.forEach((item) => {
1422 1457
             item.checked = false;
1423 1458
           });
1459
+          this.unassignedList = unassignedList;
1424 1460
           this.batchType = false;
1425 1461
           this.allUnassignedList = false;
1426
-          this.unassignedListClone = JSON.parse(
1427
-            JSON.stringify(this.unassignedList)
1428
-          );
1462
+          this.unassignedListClone = cloneDeep(this.unassignedList);
1429 1463
 
1430 1464
           if (this.audioNotDispatched && this.unassignedList.length > 0 && isAudio) {
1431 1465
             //语音播报开启
@@ -1439,17 +1473,29 @@ export class FuwutaiComponent implements OnInit {
1439 1473
           this.loading1 = false;
1440 1474
         } else if (stateId == 2) {
1441 1475
           // 待到达
1442
-          this.arriveList = data.data || [];
1443
-          this.arriveList.forEach((item) => {
1476
+          let arriveList = data.data || [];
1477
+          arriveList.forEach((item) => {
1444 1478
             item.checked = false;
1479
+            if(item.type === 'mdv2'){
1480
+              item.computedSubstitutionFlag = this.computedSubstitution(item.data)
1481
+              item.computedReceiveFlag = this.computedReceive(item.data)
1482
+            }
1445 1483
           });
1484
+          this.arriveList = arriveList;
1446 1485
           this.batchType1 = false;
1447 1486
           this.allArriveList = false;
1448
-          this.arriveListClone = JSON.parse(JSON.stringify(this.arriveList));
1487
+          this.arriveListClone = cloneDeep(this.arriveList);
1449 1488
           this.loading2 = false;
1450 1489
         } else if (stateId == 3) {
1451 1490
           // 执行中
1452
-          this.executionList = data.data || [];
1491
+          let executionList = data.data || [];
1492
+          executionList.forEach((item) => {
1493
+            if(item.type === 'mdv2'){
1494
+              item.computedSubstitutionFlag = this.computedSubstitution(item.data)
1495
+              item.computedHandleFlag = this.computedHandle(item.data)
1496
+            }
1497
+          });
1498
+          this.executionList = executionList;
1453 1499
           this.loading3 = false;
1454 1500
         }
1455 1501
 
@@ -1463,7 +1509,6 @@ export class FuwutaiComponent implements OnInit {
1463 1509
   windowResize() {
1464 1510
     let fixedMenu = document.getElementById("fixedMenu");
1465 1511
     if (!fixedMenu) return;
1466
-    let top = document.querySelector("#top");
1467 1512
     window.addEventListener("resize", () => {
1468 1513
       let wh = window.innerHeight;
1469 1514
       let _y = parseFloat(fixedMenu.style.top);
@@ -1546,22 +1591,16 @@ export class FuwutaiComponent implements OnInit {
1546 1591
   }
1547 1592
   // 未分派搜索
1548 1593
   searchUnassigned() {
1549
-    // let that = this;
1550
-    // if (!that.unassignedSearchCon) return;
1551 1594
     this.getOrderList(1);
1552 1595
   }
1553 1596
 
1554 1597
   // 待到达搜索
1555 1598
   searchArrive() {
1556
-    // let that = this;
1557
-    // if (!that.arriveSearchCon) return;
1558 1599
     this.getOrderList(2);
1559 1600
   }
1560 1601
 
1561 1602
   // 执行中搜索
1562 1603
   searchExecution() {
1563
-    // let that = this;
1564
-    // if (!that.executionSearchCon) return;
1565 1604
     this.getOrderList(3);
1566 1605
   }
1567 1606
 
@@ -1667,15 +1706,6 @@ export class FuwutaiComponent implements OnInit {
1667 1706
     this.initTopCount();
1668 1707
   }
1669 1708
 
1670
-  ngAfterViewInit() {
1671
-    // 快捷键打开新建工单
1672
-    document.addEventListener("keydown", (e) => {
1673
-      if (e.ctrlKey && e.key == "s") {
1674
-        this.showNewOrder();
1675
-        e.preventDefault();
1676
-      }
1677
-    });
1678
-  }
1679 1709
   // 获取配置文件写死的任务类型ID(送病人回病房9),选择此任务类型的话,患者信息从终点科室获取
1680 1710
   getConfigTasktypeLoading: boolean = false;
1681 1711
   getConfigTasktype() {
@@ -1691,13 +1721,21 @@ export class FuwutaiComponent implements OnInit {
1691 1721
       },
1692 1722
     };
1693 1723
     this.getConfigTasktypeLoading = true;
1694
-    return this.mainService
1695
-      .getFetchDataList("simple/data", "hospitalConfig", postData)
1696
-      .toPromise();
1724
+    this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe(res => {
1725
+      this.getConfigTasktypeLoading = false;
1726
+        if (res && res.status == 200) {
1727
+          this.deathTasktypeId = res.list.length ? res.list[0].value : undefined;
1728
+        } else {
1729
+          this.msg.error('请求数据失败');
1730
+        }
1731
+    });
1697 1732
   }
1698 1733
   // 获取配置文件写死的任务类型ID(转科,给转出院记录用6)
1699 1734
   patientLogTasktypeLoading: boolean = false;
1700 1735
   patientLogTasktype() {
1736
+    if(!this.hsmsData.hsmsSwitch){
1737
+      return;
1738
+    }
1701 1739
     let postData = {
1702 1740
       idx: 0,
1703 1741
       sum: 1,
@@ -1706,9 +1744,14 @@ export class FuwutaiComponent implements OnInit {
1706 1744
       },
1707 1745
     };
1708 1746
     this.patientLogTasktypeLoading = true;
1709
-    return this.mainService
1710
-      .getFetchDataList("simple/data", "systemConfiguration", postData)
1711
-      .toPromise();
1747
+    this.mainService.getFetchDataList("simple/data", "systemConfiguration", postData).subscribe(res => {
1748
+      this.patientLogTasktypeLoading = false;
1749
+      if (res.status == 200) {
1750
+        this.deathTasktypeIdPatient = res.list.length ? res.list[0].valueconfig : undefined;
1751
+      } else {
1752
+        this.msg.error('请求数据失败');
1753
+      }
1754
+    });
1712 1755
   }
1713 1756
   // 打开新建工单
1714 1757
   deathTasktypeId; //获取这个写死的任务类型的id,送病人回病房
@@ -1752,20 +1795,15 @@ export class FuwutaiComponent implements OnInit {
1752 1795
     this.clickYYFlag = false;
1753 1796
 
1754 1797
     if(!isInit && this.hsmsData.hsmsSwitch){
1755
-      // 送病人回病房
1756
-      let deathTasktypeResult: any = await this.getConfigTasktype();
1757
-      this.getConfigTasktypeLoading = false;
1758
-      if (deathTasktypeResult && deathTasktypeResult.status == 200) {
1759
-        this.deathTasktypeId = deathTasktypeResult.list[0].value;
1760
-      } else {
1798
+      if(!this.deathTasktypeId){
1799
+        // 送病人回病房
1800
+        this.msg.error('【送病人回病房】未配置');
1761 1801
         return;
1762 1802
       }
1763
-      // 转出院记录
1764
-      let deathTasktypePatientResult: any = await this.patientLogTasktype();
1765
-      this.patientLogTasktypeLoading = false;
1766
-      if (deathTasktypePatientResult.status == 200) {
1767
-        this.deathTasktypeIdPatient = deathTasktypePatientResult.list[0].valueconfig;
1768
-      } else {
1803
+
1804
+      if(!this.deathTasktypeIdPatient){
1805
+        // 转出院记录
1806
+        this.msg.error('【转出院记录】未配置');
1769 1807
         return;
1770 1808
       }
1771 1809
     }