Ver código fonte

优化功能

seimin 5 meses atrás
pai
commit
3ab3038738

+ 33 - 6
src/app/components/configurationCenter/configuration-category/configuration-category.component.html

@@ -7,21 +7,21 @@
7 7
 <div class="content">
8 8
   <div class="contentInner">
9 9
     <div class="address">
10
-      <div class="contentHead">一级故障现象<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button></div>
10
+      <div class="contentHead">一级故障现象<div><button nz-button nzType="primary" nzSize="small" (click)="editCategory(1, activeCategory1)" class="mr8" *ngIf="activeCategory1.id && hospitalConfig === 2">编辑</button><button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button></div></div>
11 11
       <overlay-scrollbars #osComponentRef1 class="contentBody">
12 12
         <nz-spin nzSimple [nzSpinning]="categoryLoading1" class="mt8 text_align_center"></nz-spin>
13 13
         <div [hidden]="categoryLoading1" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory1.id }" (click)="clickCategory(item, 1)" *ngFor="let item of categoryList1">{{ item.category }}</div>
14 14
       </overlay-scrollbars>
15 15
     </div>
16 16
     <div class="address">
17
-      <div class="contentHead">二级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button></div>
17
+      <div class="contentHead">二级故障现象<div><button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id && hospitalConfig === 2" (click)="editCategory(2, activeCategory2)" class="mr8">编辑</button><button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button></div></div>
18 18
       <overlay-scrollbars #osComponentRef2 class="contentBody">
19 19
         <nz-spin nzSimple [nzSpinning]="categoryLoading2" class="mt8 text_align_center"></nz-spin>
20 20
         <div [hidden]="categoryLoading2" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory2.id }" (click)="clickCategory(item, 2)" *ngFor="let item of categoryList2">{{ item.category }}</div>
21 21
       </overlay-scrollbars>
22 22
     </div>
23 23
     <div class="address">
24
-      <div class="contentHead">三级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id" (click)="addCategoryModal(3)">新增</button></div>
24
+      <div class="contentHead">三级故障现象<div><button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory3.id && hospitalConfig === 2" (click)="editCategory(3, activeCategory3)" class="mr8">编辑</button><button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id" (click)="addCategoryModal(3)">新增</button></div></div>
25 25
       <overlay-scrollbars #osComponentRef3 class="contentBody">
26 26
         <nz-spin nzSimple [nzSpinning]="categoryLoading3" class="mt8 text_align_center"></nz-spin>
27 27
         <div [hidden]="categoryLoading3" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory3.id }" (click)="clickCategory(item, 3)" *ngFor="let item of categoryList3">{{ item.category }}</div>
@@ -186,11 +186,38 @@
186 186
   <div class="modalBody">
187 187
     <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideCategoryModal()"></i></div>
188 188
     <div class="content">
189
-      <div class="tips" *ngIf="coopType === 1">您将添加一级故障现象,请输入故障现象</div>
190
-      <div class="tips" *ngIf="coopType === 2">您将在“<span class="red">{{activeCategory1.category}}</span>”下新增故障现象,请输入故障现象</div>
191
-      <div class="tips" *ngIf="coopType === 3">您将在“<span class="red">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}</span>”下新增故障现象,请输入故障现象</div>
189
+      <div class="tips" *ngIf="coopType === 1 && add">您将添加一级故障现象,请输入故障现象</div>
190
+      <div class="tips" *ngIf="coopType === 2 && add">您将在“<span class="red">{{activeCategory1.category}}</span>”下新增故障现象,请输入故障现象</div>
191
+      <div class="tips" *ngIf="coopType === 3 && add">您将在“<span class="red">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}</span>”下新增故障现象,请输入故障现象</div>
192 192
       <form nz-form [formGroup]="validateCategoryForm" class="addForm">
193
+        <nz-form-item *ngIf="!add && (coopType === 2 || coopType === 3)">
194
+          <nz-form-label nzFor="category1" nzRequired [nzSpan]="6">一级故障现象</nz-form-label>
195
+          <nz-form-control [nzSpan]="24" nzErrorTip="请选择一级故障现象!">
196
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择一级故障现象" formControlName="category1" (ngModelChange)="changeOneCategory($event)">
197
+						  <ng-container *ngFor="let option of categoryList1">
198
+						    <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
199
+						  </ng-container>
200
+						  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
201
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
202
+						  </nz-option>
203
+						</nz-select>
204
+          </nz-form-control>
205
+        </nz-form-item>
206
+        <nz-form-item *ngIf="!add && coopType === 3">
207
+          <nz-form-label nzFor="category2" nzRequired [nzSpan]="6">二级故障现象</nz-form-label>
208
+          <nz-form-control [nzSpan]="24" nzErrorTip="请选择二级故障现象!">
209
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择二级故障现象" formControlName="category2">
210
+						  <ng-container *ngFor="let option of categoryList2">
211
+						    <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
212
+						  </ng-container>
213
+						  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
214
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
215
+						  </nz-option>
216
+						</nz-select>
217
+          </nz-form-control>
218
+        </nz-form-item>
193 219
         <nz-form-item>
220
+          <nz-form-label nzFor="category" nzRequired [nzSpan]="6" *ngIf="!add">故障现象名称</nz-form-label>
194 221
           <nz-form-control [nzSpan]="24" nzErrorTip="请输入故障现象名称!">
195 222
             <nz-input-group>
196 223
               <textarea formControlName="name" nz-input placeholder="请输入故障现象名称" [nzAutosize]="{minRows: 3}"></textarea>

+ 120 - 46
src/app/components/configurationCenter/configuration-category/configuration-category.component.ts

@@ -349,7 +349,7 @@ export class ConfigurationCategoryComponent implements OnInit {
349 349
   categoryLoading1:boolean = false;
350 350
   categoryLoading2:boolean = false;
351 351
   categoryLoading3:boolean = false;
352
-  getCategoryList(type:number, parentId = 0) {
352
+  getCategoryList(type:number, parentId = 0, isEdit = false, isOnly = false) {
353 353
     setTimeout(() => {
354 354
       this['categoryLoading' + type] = true;
355 355
     }, 0)
@@ -363,6 +363,13 @@ export class ConfigurationCategoryComponent implements OnInit {
363 363
     this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
364 364
       this['categoryLoading' + type] = false;
365 365
       this['categoryList' + type] = res.data || [];
366
+      if(isEdit){
367
+        this['activeCategory' + type] = this['categoryList' + type].find(v => v.id == this['activeCategory' + type].id);
368
+      }
369
+
370
+      if(isOnly){
371
+        this['activeCategory' + type] = this['categoryList' + type].find(v => v.id == this.validateCategoryForm.value['category' + type]);
372
+      }
366 373
     })
367 374
   }
368 375
 
@@ -385,23 +392,51 @@ export class ConfigurationCategoryComponent implements OnInit {
385 392
 
386 393
   // 初始化新增form表单
387 394
   validateCategoryForm: FormGroup; //新增/编辑表单
388
-  initCategoryForm() {
389
-    this.validateCategoryForm = this.fb.group({
390
-      name: [null, [Validators.required]],//名称
391
-    });
395
+  initCategoryForm(isEdit = false) {
396
+    if(isEdit){
397
+      if(this.coopType === 1){
398
+        this.validateCategoryForm = this.fb.group({
399
+          name: [null, [Validators.required]],//名称
400
+        });
401
+      }else if(this.coopType === 2){
402
+        this.validateCategoryForm = this.fb.group({
403
+          category1: [null, [Validators.required]],//一级故障现象
404
+          name: [null, [Validators.required]],//名称
405
+        });
406
+      }else if(this.coopType === 3){
407
+        this.validateCategoryForm = this.fb.group({
408
+          category1: [null, [Validators.required]],//一级故障现象
409
+          category2: [null, [Validators.required]],//二级故障现象
410
+          name: [null, [Validators.required]],//名称
411
+        });
412
+      }
413
+    }else{
414
+      this.validateCategoryForm = this.fb.group({
415
+        name: [null, [Validators.required]],//名称
416
+      });
417
+    }
418
+
392 419
     console.log(this.validateCategoryForm.controls)
393 420
   }
394 421
 
395 422
   // 编辑
396
-  // editCategory(data) {
397
-  //   console.log(data);
398
-  //   this.modelName = "编辑";
399
-  //   this.add = false;
400
-  //   this.modalCategory = true;
401
-  //   this.initCategoryForm();
402
-  //   this.coopData = data;
403
-  //   this.validateCategoryForm.controls.name.setValue(data.name);
404
-  // }
423
+  editCategory(type, data) {
424
+    console.log(data);
425
+    this.coopType = type;
426
+    this.modelName = "编辑";
427
+    this.add = false;
428
+    this.modalCategory = true;
429
+    this.initCategoryForm(true);
430
+    this.coopData = data;
431
+
432
+    this.validateCategoryForm.controls.name.setValue(data.category);
433
+    if(type === 2){
434
+      this.validateCategoryForm.controls.category1.setValue(this.activeCategory1.id);
435
+    }else if(type === 3){
436
+      this.validateCategoryForm.controls.category1.setValue(this.activeCategory1.id);
437
+      this.validateCategoryForm.controls.category2.setValue(this.activeCategory2.id);
438
+    }
439
+  }
405 440
 
406 441
   // 新增/编辑表单提交
407 442
   btnLoading: boolean = false; //提交按钮loading状态
@@ -416,34 +451,52 @@ export class ConfigurationCategoryComponent implements OnInit {
416 451
     console.log(this.validateCategoryForm.value);
417 452
     this.btnLoading = true;
418 453
     // -----------------------------------
419
-    let postData:any = {
420
-      category: {
421
-        hosId: this.currentHospital.id,
422
-        parent: this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)],
454
+    if(this.add){
455
+      // 新增
456
+      let postData:any = {
457
+        category: {
458
+          hosId: this.currentHospital.id,
459
+          parent: this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)],
460
+          category: this.validateCategoryForm.value.name,
461
+          hierarchy: this.coopType,
462
+          dutyIds: this.hospitalConfig === 1 ? this.currentHospital.id.toString() : undefined,
463
+        },
464
+      };
465
+      this.mainService
466
+        .incidentPost("checkIncidentCategory", postData)
467
+        .subscribe((result) => {
468
+          if (result.status == 200) {
469
+            this.submitCategoryAddForm();
470
+          } else if(result.status == 502) {
471
+            this.btnLoading = false;
472
+            this.showDelModal(null, result.msg, '', 'relevance');
473
+          } else {
474
+            this.btnLoading = false;
475
+            this.showPromptModal('新增', false, result.msg);
476
+          }
477
+        });
478
+    }else{
479
+      // 编辑
480
+      console.log(this['activeCategory' + this.coopType])
481
+      //编辑
482
+      let postData = {
483
+        ...this.coopData,
484
+        parent: this.coopType === 1 ? undefined : (this.coopType === 2 ? { id: this.validateCategoryForm.value.category1 } : { id: this.validateCategoryForm.value.category2 }),
423 485
         category: this.validateCategoryForm.value.name,
424
-        hierarchy: this.coopType,
425
-        dutyIds: this.hospitalConfig === 1 ? this.currentHospital.id.toString() : undefined,
426
-      },
427
-    };
428
-    this.mainService
429
-      .incidentPost("checkIncidentCategory", postData)
430
-      .subscribe((result) => {
431
-        let msg = "";
432
-        if (this.add) {
433
-          msg = "新增";
434
-        } else {
435
-          msg = "修改";
436
-        }
437
-        if (result.status == 200) {
438
-          this.submitCategoryAddForm();
439
-        } else if(result.status == 502) {
440
-          this.btnLoading = false;
441
-          this.showDelModal(null, result.msg, '', 'relevance');
442
-        } else {
486
+      };
487
+      console.log(postData);
488
+      this.mainService
489
+        .simplePost("addData", "incidentCategory", postData)
490
+        .subscribe((result) => {
443 491
           this.btnLoading = false;
444
-          this.showPromptModal(msg, false, result.msg);
445
-        }
446
-      });
492
+          this.hideCategoryModal();
493
+          if (result.status == 200) {
494
+            this.showPromptModal('编辑', true, '');
495
+          } else {
496
+            this.showPromptModal('编辑', false, result.msg);
497
+          }
498
+        });
499
+    }
447 500
     // -----------------------------------
448 501
   }
449 502
 
@@ -704,6 +757,12 @@ export class ConfigurationCategoryComponent implements OnInit {
704 757
     this.validateConfigForm.get(name)!.updateValueAndValidity();
705 758
   }
706 759
 
760
+  // 修改故障现象
761
+  changeOneCategory(id){
762
+    this.validateCategoryForm.controls.category2.setValue(null);
763
+    this.getCategoryList(2, id);
764
+  }
765
+
707 766
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
708 767
   promptContent: string; //操作提示框提示信息
709 768
   ifSuccess: boolean; //操作成功/失败
@@ -717,13 +776,28 @@ export class ConfigurationCategoryComponent implements OnInit {
717 776
     setTimeout(() => {
718 777
       this.promptModalShow = true;
719 778
     }, 100);
720
-    if(this.coopType !== 0){
721
-      this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
779
+    if(con === '编辑'){
780
+      if(success){
781
+        if(this.coopType === 1){
782
+          this.getCategoryList(1, 0, true);
783
+        }else if(this.coopType === 2){
784
+          this.getCategoryList(1, 0, false, true);
785
+          this.getCategoryList(2, this.validateCategoryForm.value.category1, true);
786
+        }else if(this.coopType === 3){
787
+          this.getCategoryList(1, 0, false, true);
788
+          this.getCategoryList(2, this.validateCategoryForm.value.category1, false, true);
789
+          this.getCategoryList(3, this.validateCategoryForm.value.category2, true);
790
+        }
791
+      }
722 792
     }else{
723
-      this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
724
-    }
725
-    if(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id){
726
-      this.getCategoryConfigList(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id);
793
+      if(this.coopType !== 0){
794
+        this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
795
+      }else{
796
+        this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
797
+      }
798
+      if(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id){
799
+        this.getCategoryConfigList(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id);
800
+      }
727 801
     }
728 802
   }
729 803
 }

+ 6 - 38
src/app/views/fuwutai/fuwutai.component.html

@@ -1263,26 +1263,10 @@
1263 1263
                               nzErrorTip="请选择类型!"
1264 1264
                             >
1265 1265
                               <div class="radios">
1266
-                                <overlay-scrollbars
1267
-                                  #osComponentRef10
1268
-                                  [ngStyle]="{ height: '100%' }"
1269
-                                >
1270
-                                  <nz-radio-group
1271
-                                    formControlName="taskType"
1272
-                                    nz-row
1273
-                                    [(ngModel)]="radioValueZy"
1274
-                                    (ngModelChange)="radioChangeZy(radioValueZy)"
1275
-                                  >
1266
+                                <overlay-scrollbars #osComponentRef10 [ngStyle]="{ height: '100%' }">
1267
+                                  <nz-radio-group formControlName="taskType" nz-row [(ngModel)]="radioValueZy" (ngModelChange)="radioChangeZy(radioValueZy)">
1276 1268
                                     <div nz-row>
1277
-                                      <label
1278
-                                        nz-col
1279
-                                        nz-radio
1280
-                                        [nzValue]="item1.id"
1281
-                                        *ngFor="
1282
-                                          let item1 of workTypesArrange[item.key]
1283
-                                        "
1284
-                                        >{{ item1.taskTypeName }}</label
1285
-                                      >
1269
+                                      <label [title]="item1.taskTypeName" nz-col nz-radio [nzValue]="item1.id" *ngFor="let item1 of workTypesArrange[item.key]">{{ item1.taskTypeName }}</label>
1286 1270
                                     </div>
1287 1271
                                   </nz-radio-group>
1288 1272
                                 </overlay-scrollbars>
@@ -1596,26 +1580,10 @@
1596 1580
                               nzErrorTip="请选择类型!"
1597 1581
                             >
1598 1582
                               <div class="radios" style="height: 225px">
1599
-                                <overlay-scrollbars
1600
-                                  #osComponentRef11
1601
-                                  [ngStyle]="{ height: '100%' }"
1602
-                                >
1603
-                                  <nz-radio-group
1604
-                                    formControlName="taskTypeQt"
1605
-                                    nz-row
1606
-                                    [(ngModel)]="radioValueQt"
1607
-                                    (ngModelChange)="radioChangeQt(radioValueQt)"
1608
-                                  >
1583
+                                <overlay-scrollbars #osComponentRef11 [ngStyle]="{ height: '100%' }">
1584
+                                  <nz-radio-group formControlName="taskTypeQt" nz-row [(ngModel)]="radioValueQt" (ngModelChange)="radioChangeQt(radioValueQt)">
1609 1585
                                     <div nz-row>
1610
-                                      <label
1611
-                                        nz-col
1612
-                                        nz-radio
1613
-                                        [nzValue]="item1.id"
1614
-                                        *ngFor="
1615
-                                          let item1 of workTypesArrange[item.key]
1616
-                                        "
1617
-                                        >{{ item1.taskTypeName }}</label
1618
-                                      >
1586
+                                      <label [title]="item1.taskTypeName" nz-col nz-radio [nzValue]="item1.id" *ngFor="let item1 of workTypesArrange[item.key]">{{ item1.taskTypeName }}</label>
1619 1587
                                     </div>
1620 1588
                                   </nz-radio-group>
1621 1589
                                 </overlay-scrollbars>

+ 6 - 11
src/app/views/fuwutai/fuwutai.component.less

@@ -2374,7 +2374,7 @@
2374 2374
                   height: 267px;
2375 2375
                   width: 100%;
2376 2376
                   overflow-y: auto;
2377
-                  padding: 10px 18px;
2377
+                  padding: 8px;
2378 2378
                   background: #fff;
2379 2379
                   border: 1px solid #e6dede;
2380 2380
                   border-radius: 5px;
@@ -2383,19 +2383,14 @@
2383 2383
                     display: flex;
2384 2384
                     flex-wrap: wrap;
2385 2385
                     .ant-radio-wrapper {
2386
-                      // flex: 1;
2387
-                      // max-width: 100%;
2388
-                      // width: 160px;
2386
+                      width: 16.66%;
2389 2387
                       display: flex;
2390 2388
                       align-items: center;
2389
+                      margin-right: 0;
2391 2390
                       ::ng-deep span.ant-radio + * {
2392
-                        // min-width: 110px;
2393
-                        white-space: normal;
2394
-                        float: left;
2395
-                        padding-right: 0;
2396
-                      }
2397
-                      ::ng-deep span.ant-radio {
2398
-                        float: left;
2391
+                        overflow: hidden;
2392
+                        text-overflow: ellipsis;
2393
+                        white-space: inherit;
2399 2394
                       }
2400 2395
                     }
2401 2396
                   }

+ 2 - 1
src/app/views/hushijiandan/hushijiandan.component.html

@@ -425,7 +425,7 @@
425 425
             </div>
426 426
           </div>
427 427
           <div class="userInfo">
428
-            <div class="wel">欢迎您:</div>
428
+            <div class="wel">欢迎您<strong>{{tool.getCurrentUserInfo().name}}</strong>:</div>
429 429
             <div class="user">
430 430
               <img src="../../assets/images/icon_keshi.png" alt="" />
431 431
               <span *ngIf="deptDisplay" [title]="deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept">{{deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept}}</span>
@@ -3695,6 +3695,7 @@
3695 3695
   </div>
3696 3696
   <div class="dialog-operate">
3697 3697
     <strong class="dialog-refresh" (click)="showNurseCode()">刷新</strong>
3698
+    <strong>{{tool.getCurrentUserInfo().name}}</strong>
3698 3699
     <span>{{ refreshQRCodeTime }}s</span>
3699 3700
   </div>
3700 3701
 </div>

+ 2 - 0
src/app/views/hushijiandan/hushijiandan.component.less

@@ -168,6 +168,8 @@
168 168
         right: 0;
169 169
         bottom: 0;
170 170
         left: 0;
171
+        display: flex;
172
+        align-items: center;
171 173
 
172 174
         img {
173 175
           width: 100%;