seimin лет назад: 2
Родитель
Сommit
b1d76bcef9

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-    "target": "http://192.168.4.190",
3
+    "target": "http://192.168.4.240",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

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

@@ -45,6 +45,20 @@
45 45
           <nz-checkbox-group [(ngModel)]="autoCreateOrders" (ngModelChange)="changeAutoCreateOrders($event)"></nz-checkbox-group>
46 46
           <nz-checkbox-group [(ngModel)]="autoDepts" *ngIf="autoCreateOrders[0].checked"></nz-checkbox-group>
47 47
         </div>
48
+        <div class="display_flex align-items_center mb8" *ngIf="autoCreateOrders[0].checked">
49
+          <nz-form-label class="label" style="visibility: hidden;">自动建单</nz-form-label><!-- 暂时占位 -->
50
+          <nz-checkbox-group [(ngModel)]="autoCreateOrders" (ngModelChange)="changeAutoCreateOrders($event)" style="visibility: hidden;"></nz-checkbox-group><!-- 暂时占位 -->
51
+          <nz-checkbox-group [(ngModel)]="autoDeptLimits" (ngModelChange)="changeAutoDeptLimits($event)"></nz-checkbox-group>
52
+          <nz-select class="w320px" [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择起点科室" nzServerSearch
53
+            (nzOnSearch)="searchDeptList($event)" (nzOpenChange)="getDeptList($event)" [(ngModel)]="limitDeptIds" *ngIf="autoDeptLimits[0].checked">
54
+            <ng-container *ngFor="let data of deptList">
55
+              <nz-option *ngIf="!dLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
56
+            </ng-container>
57
+            <nz-option *ngIf="dLoading" nzDisabled nzCustomContent>
58
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
59
+            </nz-option>
60
+          </nz-select>
61
+        </div>
48 62
       </div>
49 63
       <div class="bottom">
50 64
         <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>

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

@@ -30,6 +30,12 @@ export class BloodProductsConfigComponent implements OnInit {
30 30
   autoDepts:any[] = [
31 31
     {label:'是否根据开通科室建单',value: 0}
32 32
   ];
33
+  // 是否根据起点科室建单
34
+  autoDeptLimits:any[] = [
35
+    {label:'是否根据起点科室建单',value: 0}
36
+  ];
37
+  // 选择起点科室
38
+  limitDeptIds:any = [];
33 39
   // 配置
34 40
   configs:any = {};
35 41
   // 血制品任务类型
@@ -43,6 +49,42 @@ export class BloodProductsConfigComponent implements OnInit {
43 49
     this.getCheckInModes();
44 50
   }
45 51
 
52
+  deptList = []; //科室列表
53
+  dLoading = false;
54
+  dSearchText = '';
55
+  //获取科室列表
56
+  getDeptList(flag?, search = "", isInit = false) {
57
+    if (!flag) {
58
+      return;
59
+    }
60
+    let hosIds = this.hosId;
61
+    let postData = {
62
+      idx: 0,
63
+      sum: 9999,
64
+      department: { hospital: { id: hosIds }, dept: search, searchType: 1 },
65
+    };
66
+    this.dLoading = true;
67
+    this.dSearchText = search;
68
+    this.mainService
69
+      .getFetchDataList("data", "department", postData)
70
+      .subscribe((data) => {
71
+        if (this.dSearchText == search) {
72
+          this.dLoading = false;
73
+          if (data.status == 200) {
74
+            this.deptList = data.list;
75
+            if(isInit){
76
+              this.limitDeptIds = this.configs.limitDeptIds ? this.configs.limitDeptIds.split(',') : [];
77
+            }
78
+          }
79
+        }
80
+      });
81
+  }
82
+
83
+  // 搜索科室列表
84
+  searchDeptList(e) {
85
+    this.getDeptList(true, e);
86
+  }
87
+
46 88
   // 切换tab
47 89
   tabModal(tabModalName:string){
48 90
     this.tabModalName = tabModalName;
@@ -52,10 +94,20 @@ export class BloodProductsConfigComponent implements OnInit {
52 94
     console.log(e);
53 95
     if(!e[0].checked){
54 96
       this.autoDepts[0].checked = false;
97
+      this.autoDeptLimits[0].checked = false;
98
+      this.limitDeptIds = [];
99
+    }
100
+  }
101
+  // 修改changeAutoDeptLimits
102
+  changeAutoDeptLimits(e){
103
+    console.log(e);
104
+    if(!e[0].checked){
105
+      this.limitDeptIds = [];
55 106
     }
56 107
   }
57 108
   // 保存
58 109
   submitForm() {
110
+    console.log(this.limitDeptIds)
59 111
     if(!this.tasktype.id){
60 112
       this.msg.create("warning", "请先配置血制品任务类型!");
61 113
       return;
@@ -68,6 +120,10 @@ export class BloodProductsConfigComponent implements OnInit {
68 120
       this.msg.create("warning", "请选择核对方式!");
69 121
       return;
70 122
     }
123
+    if(this.autoDeptLimits[0].checked && !this.limitDeptIds.length){
124
+      this.msg.create("warning", "请选择起点科室!");
125
+      return;
126
+    }
71 127
     let signTypeIds = this.checkInModes.filter(v => v.checked).map(v => v.value).toString();
72 128
     let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
73 129
     let postData:any = {
@@ -76,11 +132,14 @@ export class BloodProductsConfigComponent implements OnInit {
76 132
       hosId: this.hosId,
77 133
       autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
78 134
       autoDept: this.autoDepts[0].checked ? 1 : 0,
135
+      autoDeptLimit: this.autoDeptLimits[0].checked ? 1 : 0,
136
+      limitDeptIds: String(this.limitDeptIds),
79 137
       handoverType: {id: this.handoverMode},
80 138
       checkType: {id: this.radioCheckModesValue},
81 139
       signTypeIds: signTypeIds || undefined,
82 140
       closeTypeIds: closeTypeIds || undefined,
83 141
     };
142
+    console.log(postData);
84 143
     this.btnLoading = true;
85 144
     this.mainService
86 145
       .simplePost("addData", "taskTypeConfig", postData)
@@ -174,6 +233,8 @@ export class BloodProductsConfigComponent implements OnInit {
174 233
           this.radioCheckModesValue = this.configs.checkType.id;
175 234
           this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
176 235
           this.autoDepts[0].checked = this.configs.autoDept == 1;
236
+          this.autoDeptLimits[0].checked = this.configs.autoDeptLimit == 1;
237
+          this.getDeptList(true, '', true);
177 238
 
178 239
           if(this.configs.signTypeIds){
179 240
             let ids = this.configs.signTypeIds.split(',');