Explorar el Código

增加万能交接类型

seimin hace 2 años
padre
commit
a34f7e6199

+ 14 - 0
src/app/views/blood-products-config/blood-products-config-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { BloodProductsConfigComponent } from './blood-products-config.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: BloodProductsConfigComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class BloodProductsConfigRoutingModule { }

+ 58 - 0
src/app/views/blood-products-config/blood-products-config.component.html

@@ -0,0 +1,58 @@
1
+<div class="TaskTypeManagement">
2
+  <div class="taskTypeInfo">
3
+    <div class="top">
4
+      <div class="item" (click)="tabModal('characteristics')" [ngClass]="{'items':tabModalName=='characteristics'}">
5
+        特性配置
6
+      </div>
7
+      <div class="item" (click)="tabModal('automaticOrderCreation')" [ngClass]="{'items':tabModalName=='automaticOrderCreation'}">
8
+        自动建单配置
9
+      </div>
10
+    </div>
11
+    <div class="list" *ngIf="!loading">
12
+      <!-- 特性配置 -->
13
+      <div *ngIf="tabModalName=='characteristics'">
14
+        <!-- 交接方式 -->
15
+        <div class="display_flex align-items_center">
16
+          <nz-form-label class="label" nzRequired>交接方式</nz-form-label>
17
+          <nz-select class="w320px" nzPlaceHolder="请选择交接方式" [(ngModel)]="handoverMode">
18
+            <nz-option *ngFor="let handoverMode of handoverModes" [nzLabel]="handoverMode.name" [nzValue]="handoverMode.id"></nz-option>
19
+          </nz-select>
20
+        </div>
21
+        <!-- 核对方式 -->
22
+        <div class="display_flex align-items_center mb8">
23
+          <nz-form-label class="label" nzRequired>核对方式</nz-form-label>
24
+          <nz-checkbox-group class="w320px" [(ngModel)]="checkModes"></nz-checkbox-group>
25
+        </div>
26
+        <!-- 签到方式 -->
27
+        <div class="display_flex align-items_center mb8">
28
+          <nz-form-label class="label">签到方式</nz-form-label>
29
+          <nz-checkbox-group class="w320px" [(ngModel)]="checkInModes"></nz-checkbox-group>
30
+        </div>
31
+        <!-- 自动关单 -->
32
+        <div class="display_flex align-items_center mb8">
33
+          <nz-form-label class="label">自动关单</nz-form-label>
34
+          <nz-checkbox-group class="w320px" [(ngModel)]="automaticCustomsOrders"></nz-checkbox-group>
35
+        </div>
36
+      </div>
37
+      <!-- 自动建单配置 -->
38
+      <div *ngIf="tabModalName=='automaticOrderCreation'">
39
+        <!-- 自动建单 -->
40
+        <div class="display_flex align-items_center mb8">
41
+          <nz-form-label class="label">自动建单</nz-form-label>
42
+          <nz-checkbox-group class="w320px" [(ngModel)]="autoCreateOrders"></nz-checkbox-group>
43
+        </div>
44
+      </div>
45
+      <div class="bottom">
46
+        <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>
47
+      </div>
48
+    </div>
49
+    <div class="list" *ngIf="loading">
50
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
51
+        <div class="loadingFullInner">
52
+          <img src="../../../assets/images/loading.gif" alt="">
53
+          <div>加载中...</div>
54
+        </div>
55
+      </div>
56
+    </div>
57
+  </div>
58
+</div>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1251 - 0
src/app/views/blood-products-config/blood-products-config.component.less


+ 147 - 0
src/app/views/blood-products-config/blood-products-config.component.ts

@@ -0,0 +1,147 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { MainService } from 'src/app/services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { NzMessageService } from 'ng-zorro-antd';
5
+
6
+@Component({
7
+  selector: "app-blood-products-config",
8
+  templateUrl: "./blood-products-config.component.html",
9
+  styleUrls: ["./blood-products-config.component.less"],
10
+})
11
+export class BloodProductsConfigComponent implements OnInit {
12
+  loading:boolean = false; //页面加载的loading
13
+  btnLoading:boolean = false; //提交按钮的loading
14
+  tabModalName:string = 'characteristics'; //当前选中的tab
15
+  hosId = this.tool.getCurrentHospital().id; //当前院区
16
+  // 交接方式
17
+  handoverMode:any;
18
+  handoverModes:any[] = [];
19
+  // 核对方式
20
+  checkModes:any[] = [];
21
+  // 签到方式
22
+  checkInModes:any[] = [];
23
+  // 自动关单
24
+  automaticCustomsOrders:any[] = [];
25
+  // 自动建单
26
+  autoCreateOrders:any[] = [
27
+    {label:'是否开启',value: 0}
28
+  ];
29
+  // 配置
30
+  configs:any = {};
31
+  constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
32
+
33
+  ngOnInit():void {
34
+    // todo
35
+    this.getHandoverModes();
36
+    this.getCheckModes();
37
+    this.getCheckInModes();
38
+
39
+  }
40
+
41
+  // 切换tab
42
+  tabModal(tabModalName:string){
43
+    this.tabModalName = tabModalName;
44
+  }
45
+  // 保存
46
+  submitForm() {
47
+    if(!this.handoverMode){
48
+      this.msg.create("warning", "请选择交接方式!");
49
+      return;
50
+    }
51
+    let checkType = this.checkModes.find(v => v.checked);
52
+    if(!checkType){
53
+      this.msg.create("warning", "请选择核对方式!");
54
+      return;
55
+    }
56
+    let signTypeIds = this.checkInModes.filter(v => v.checked).map(v => v.value).toString();
57
+    let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
58
+    let postData = {
59
+      id: this.configs.id,
60
+      taskType: this.configs.taskType,
61
+      hosId: this.hosId,
62
+      autoCreate: this.autoCreateOrders[0].checked?1:0,
63
+      handoverType: {id:this.handoverMode},
64
+      checkType: {id:checkType.value},
65
+      signTypeIds: signTypeIds || undefined,
66
+      closeTypeIds: closeTypeIds || undefined,
67
+    };
68
+    this.btnLoading = true;
69
+    this.mainService
70
+      .simplePost("addData", "taskTypeConfig", postData)
71
+      .subscribe((result) => {
72
+        this.btnLoading = false;
73
+        if (result.status == 200) {
74
+          this.getConfig();
75
+        }
76
+      });
77
+  }
78
+
79
+  //获取交接方式
80
+  getHandoverModes() {
81
+    this.mainService.getDictionary("list", "ttconfig_handover_type").subscribe((data) => {
82
+      this.handoverModes = data;
83
+      this.handoverMode = data[0].id;
84
+    });
85
+  }
86
+  //获取核对方式
87
+  getCheckModes() {
88
+    this.mainService.getDictionary("list", "ttconfig_check_type").subscribe((data) => {
89
+      this.checkModes = data.map(v => ({label:v.name, value: v.id}));
90
+    });
91
+  }
92
+  //获取签到方式
93
+  getCheckInModes() {
94
+    this.loading = true;
95
+    this.mainService.getDictionary("list", "ttconfig_sign_type").subscribe((data) => {
96
+      this.checkInModes = data.map(v => ({label:v.name, value: v.id}));
97
+      this.getAutomaticCustomsOrders();
98
+    });
99
+  }
100
+  //获取自动关单
101
+  getAutomaticCustomsOrders() {
102
+    this.mainService.getDictionary("list", "ttconfig_close_type").subscribe((data) => {
103
+      this.automaticCustomsOrders = data.map(v => ({label:v.name, value: v.id}));
104
+      this.getConfig();
105
+    });
106
+  }
107
+  // 获取配置
108
+  getConfig() {
109
+    this.loading = true;
110
+    let postData = {
111
+      idx: 0,
112
+      sum: 10,
113
+      taskTypeConfig: {
114
+        taskTypeDTO: {
115
+          hosId: {
116
+            id: this.hosId
117
+          },
118
+          ordinaryField: {
119
+            value: 'blood'
120
+          }
121
+        }
122
+      }
123
+    };
124
+    this.mainService
125
+      .getFetchDataList("simple/data", "taskTypeConfig", postData)
126
+      .subscribe((result) => {
127
+        this.loading = false;
128
+        if (result.status == 200) {
129
+          this.configs = result.list[0];
130
+          this.handoverMode = this.configs.handoverType?this.configs.handoverType.id:undefined;
131
+          this.checkModes = this.configs.checkType?[{label:this.configs.checkType.name, value: this.configs.checkType.id, checked: true}]:[];
132
+          this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
133
+
134
+          if(this.configs.signTypeIds){
135
+            let ids = this.configs.signTypeIds.split(',');
136
+            this.checkInModes = this.checkInModes.map(v => ({...v, checked: ids.includes(v.value.toString())}));
137
+          }
138
+
139
+          if(this.configs.closeTypeIds){
140
+            let ids = this.configs.closeTypeIds.split(',');
141
+            this.automaticCustomsOrders = this.automaticCustomsOrders.map(v => ({...v, checked: ids.includes(v.value.toString())}));
142
+          }
143
+        }
144
+      });
145
+  }
146
+}
147
+

+ 17 - 0
src/app/views/blood-products-config/blood-products-config.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { BloodProductsConfigRoutingModule } from './blood-products-config-routing.module';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { BloodProductsConfigComponent } from './blood-products-config.component';
7
+
8
+
9
+@NgModule({
10
+  declarations: [BloodProductsConfigComponent],
11
+  imports: [
12
+    CommonModule,
13
+    BloodProductsConfigRoutingModule,
14
+    ShareModule
15
+  ]
16
+})
17
+export class BloodProductsConfigModule { }

+ 8 - 0
src/app/views/main/main-routing.module.ts

@@ -92,6 +92,14 @@ const routes: Routes = [
92 92
           ),
93 93
       },
94 94
       {
95
+        // 血制品页面控制
96
+        path: "bloodProductsConfig",
97
+        loadChildren: () =>
98
+          import("../blood-products-config/blood-products-config.module").then(
99
+            (m) => m.BloodProductsConfigModule
100
+          ),
101
+      },
102
+      {
95 103
         // 工作分配方案列表
96 104
         path: "workAssignment",
97 105
         loadChildren: () =>

+ 14 - 6
src/app/views/task-type-management/task-type-management.component.html

@@ -56,6 +56,13 @@
56 56
           (ngModelChange)="asso(association)" [nzDisabled]="!add">
57 57
           <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of allAssociation"></nz-option>
58 58
         </nz-select>
59
+        <ng-container *ngIf="association.id == 20044">
60
+          <nz-form-label class="label" nzRequired>关联业务</nz-form-label>
61
+          <!-- 关联业务禁止修改 -->
62
+          <nz-select class="mb8 w100" nzShowSearch nzAllowClear nzPlaceHolder="请选择关联业务" [(ngModel)]="relatedBusiness.id" [nzDisabled]="!add">
63
+            <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of allRelatedBusiness"></nz-option>
64
+          </nz-select>
65
+        </ng-container>
59 66
         <nz-form-label *ngIf="association['id'] == 256" class="label" nzRequired>空单默认科室</nz-form-label>
60 67
         <nz-select *ngIf="association['id'] == 256" class="mb8 w100" [ngClass]="{remandTypeId:!defaultNullDeptId}"
61 68
           [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeSearchDeptList($event)"
@@ -686,12 +693,13 @@
686 693
               </nz-option>
687 694
             </nz-select>
688 695
           </div>
689
-
690
-          <nz-form-label class="label" nzRequired>检验方式</nz-form-label>
691
-          <nz-select class="mb8 w100" nzShowSearch nzAllowClear nzPlaceHolder="请选择检验方式" [(ngModel)]="checkoutMethod.id"
692
-            [nzLoading]="yLoading">
693
-            <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of checkoutData"></nz-option>
694
-          </nz-select>
696
+          <ng-container *ngIf="currentChoice.associationType.value != 'ordinary'">
697
+            <nz-form-label class="label" nzRequired>检验方式</nz-form-label>
698
+            <nz-select class="mb8 w100" nzShowSearch nzAllowClear nzPlaceHolder="请选择检验方式" [(ngModel)]="checkoutMethod.id"
699
+              [nzLoading]="yLoading">
700
+              <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of checkoutData"></nz-option>
701
+            </nz-select>
702
+          </ng-container>
695 703
           <!-- 是否必填交接人信息 -->
696 704
           <div class="turnoff">
697 705
             <label nz-checkbox [(ngModel)]="carryingCourses[indexs].handoverSwitch">是否必填交接人信息</label>

+ 40 - 2
src/app/views/task-type-management/task-type-management.component.ts

@@ -75,6 +75,7 @@ export class TaskTypeManagementComponent implements OnInit {
75 75
   //基础信息请求参数
76 76
   hosId; //当前院区
77 77
   allAssociation: Array<any>; //关联类型
78
+  allRelatedBusiness: Array<any>; //关联业务
78 79
   allTaskType = []; //任务类型列表
79 80
   allTaskTypeShow; //任务类型列表选择标识
80 81
   allGoods: Array<any>; //携带设备
@@ -85,6 +86,10 @@ export class TaskTypeManagementComponent implements OnInit {
85 86
     id: "",
86 87
     value: "",
87 88
   }; //关联类型
89
+  relatedBusiness: any = {
90
+    id: "",
91
+    value: "",
92
+  }; //关联业务
88 93
   simultaneousNumber; //同时接单数
89 94
   carryEquipmentIds; //携带设备
90 95
   allowUrgent = "1"; //是否加急
@@ -287,6 +292,7 @@ export class TaskTypeManagementComponent implements OnInit {
287 292
 
288 293
     this.getAllHospital(); // 获取所有院区
289 294
     this.getAllAssociation(); // 获取所有关联类型
295
+    this.getAllRelatedBusiness(); // 获取所有关联业务
290 296
     this.getAllGoods(); //获取携带设备
291 297
     this.getAllScheduleClass(); //获取班次列表
292 298
     this.getAllTaskType(); //任务类型列表
@@ -409,6 +415,14 @@ export class TaskTypeManagementComponent implements OnInit {
409 415
         that.allAssociation = data;
410 416
       });
411 417
   }
418
+  // 获取所有关联业务
419
+  getAllRelatedBusiness() {
420
+    this.mainService
421
+      .getDictionary("list", "ordinary_field")
422
+      .subscribe((data) => {
423
+        this.allRelatedBusiness = data;
424
+      });
425
+  }
412 426
   //任务类型列表
413 427
   getAllTaskType() {
414 428
     let list = {
@@ -555,6 +569,10 @@ export class TaskTypeManagementComponent implements OnInit {
555 569
   }
556 570
   //类型选择
557 571
   asso(data): void {
572
+    this.relatedBusiness = {
573
+      id:'',
574
+      value:''
575
+    }
558 576
     if (data.id == 260 || data.id == 255) {
559 577
       this.carryShow = true;
560 578
     } else {
@@ -619,6 +637,10 @@ export class TaskTypeManagementComponent implements OnInit {
619 637
     this.taskName = data.taskName;
620 638
     this.association.id = data.associationType.id + "";
621 639
     this.association.value = data.associationType.value;
640
+    if(data.ordinaryField){
641
+      this.relatedBusiness.id = data.ordinaryField.id + "";
642
+      this.relatedBusiness.value = data.ordinaryField.value;
643
+    }
622 644
     if (data.deptIds) {
623 645
       this.deptIds = data.deptIds;
624 646
     } else {
@@ -906,7 +928,7 @@ export class TaskTypeManagementComponent implements OnInit {
906 928
         );
907 929
         return;
908 930
       }
909
-      if (this.checkoutMethod.id) {
931
+      if (this.checkoutMethod.id || this.taskData.taskType.associationType.value == 'ordinary') {
910 932
       } else {
911 933
         that.showPromptModal(
912 934
           that.add ? "新增" : "编辑",
@@ -999,6 +1021,19 @@ export class TaskTypeManagementComponent implements OnInit {
999 1021
         dept: arr[1],
1000 1022
       };
1001 1023
     }
1024
+    // 万能交接服务
1025
+    if (this.association.id == 20044) {
1026
+      console.log(this.relatedBusiness, this.allRelatedBusiness);
1027
+      if(this.relatedBusiness.id){
1028
+        let relatedBusiness = this.allRelatedBusiness.find(v => v.id == this.relatedBusiness.id);
1029
+        this.taskData.taskType["ordinaryField"] = relatedBusiness;
1030
+      }else{
1031
+        this.showPromptModal(this.add ? "新增" : "编辑", false, "请选择关联业务");
1032
+        return;
1033
+      }
1034
+    }else{
1035
+      delete this.taskData.taskType["ordinaryField"];
1036
+    }
1002 1037
     this.taskData.taskType["specialCloseButton"] = this.specialCloseButton;
1003 1038
     if (this.departmentStrategy.idv) {
1004 1039
       this.taskData.taskType.carryingCourses[this.indexs].departmentStrategy = {
@@ -1181,7 +1216,6 @@ export class TaskTypeManagementComponent implements OnInit {
1181 1216
     this.departmentStrategy.idv = null;
1182 1217
     this.departmentIds = "";
1183 1218
     this.departmentTypeIds = "";
1184
-    this.allAssociation; //关联类型
1185 1219
     this.taskName = ""; //任务名称
1186 1220
     this.association.id = null; //关联类型
1187 1221
     this.getAllGoods(); //获取携带设备
@@ -1621,6 +1655,10 @@ export class TaskTypeManagementComponent implements OnInit {
1621 1655
     if (this.association.value == "patientTransport") {
1622 1656
       this.mrksType = "department_strategy_other";
1623 1657
     }
1658
+    //万能交接服务
1659
+    if (this.association.value == "ordinary") {
1660
+      this.mrksType = "ordinary_strategy";
1661
+    }
1624 1662
 
1625 1663
     return that.mainService.getDictionary("list", this.mrksType);
1626 1664
   }

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8 8
   enableProdMode();
9 9
   if (window) {
10 10
     window.console.log = function () { };
11
-    console.info('v2.4.13');
11
+    console.info('v2.4.14');
12 12
   }
13 13
 }
14 14
 platformBrowserDynamic().bootstrapModule(AppModule)