seimin 9 mēneši atpakaļ
vecāks
revīzija
af014731c8

+ 28 - 0
src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.html

@@ -0,0 +1,28 @@
1
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="deptFlag">
2
+  <div class="modalBody">
3
+    <div class="title">指派<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
4
+    </div>
5
+    <div class="content">
6
+      <form nz-form [formGroup]="validateForm" class="addForm">
7
+        <nz-form-item>
8
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">处理人</nz-form-label>
9
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择处理人!">
10
+            <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
11
+              (nzOnSearch)="changeInp('user', $event)" nzAllowClear nzPlaceHolder="请选择处理人" formControlName="userId">
12
+              <ng-container *ngFor="let option of userList">
13
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
14
+              </ng-container>
15
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
16
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
17
+              </nz-option>
18
+            </nz-select>
19
+          </nz-form-control>
20
+        </nz-form-item>
21
+      </form>
22
+    </div>
23
+    <div class="display_flex justify-content_flex-center">
24
+      <button nzType="primary" nz-button (click)="submitForm()">确认</button>
25
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
26
+    </div>
27
+  </div>
28
+</div>

+ 128 - 0
src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.less

@@ -0,0 +1,128 @@
1
+.save {
2
+  position: fixed;
3
+  left: 0;
4
+  top: 0;
5
+  width: 100%;
6
+  height: 100%;
7
+  background: rgba(0, 0, 0, 0.4);
8
+  z-index: 999;
9
+
10
+  .modalBody {
11
+    width: 350px;
12
+    background: #fff;
13
+    border-radius: 5px;
14
+    padding: 10px 20px;
15
+    color: #333;
16
+
17
+    .title {
18
+      width: 100%;
19
+      text-align: center;
20
+      font-size: 18px;
21
+      position: relative;
22
+
23
+      i {
24
+        position: absolute;
25
+        right: 0;
26
+        top: 0;
27
+        font-size: 20px;
28
+        color: #666;
29
+        cursor: pointer;
30
+        padding: 0 5px;
31
+      }
32
+    }
33
+
34
+    .content {
35
+      width: 100%;
36
+      height: 117px;
37
+      background: #f9fafb;
38
+      border: 1px solid #e5e9ed;
39
+      border-radius: 5px;
40
+      overflow: hidden;
41
+      margin-top: 12px;
42
+
43
+      .tips{
44
+        text-indent: 2em;
45
+      }
46
+
47
+      div {
48
+        text-align: center;
49
+        margin: 0;
50
+
51
+        &.icon {
52
+          margin-top: 17px;
53
+
54
+          i {
55
+            color: #34b349;
56
+            font-size: 30px !important;
57
+
58
+            &.transport-wenhao {
59
+              color: #f5a523;
60
+            }
61
+
62
+            &.transport-shibai {
63
+              color: #ff3a52;
64
+            }
65
+          }
66
+        }
67
+
68
+        &.defeat {
69
+          color: #333;
70
+          font-size: 16px;
71
+        }
72
+
73
+        &:nth-child(3) {
74
+          font-size: 14px;
75
+          color: #666;
76
+        }
77
+      }
78
+    }
79
+
80
+    button {
81
+      margin-top: 10px;
82
+
83
+      &.btn {
84
+        margin-left: 8px;
85
+      }
86
+    }
87
+  }
88
+
89
+  // 新增
90
+  &.add {
91
+    .modalBody {
92
+      width: 480px;
93
+      height: auto;
94
+
95
+      .content {
96
+        width: 100%;
97
+        height: auto;
98
+        padding: 19px 14px 0 14px;
99
+        max-height: 500px;
100
+        overflow-y: auto;
101
+
102
+        .addForm {
103
+          .ant-form-item {
104
+            margin-bottom: 14px;
105
+
106
+            .ant-form-item-label {
107
+              text-align: left;
108
+            }
109
+          }
110
+        }
111
+
112
+        .editForm {
113
+          .ant-form-item {
114
+            margin-bottom: 14px;
115
+
116
+            .ant-form-item-label {
117
+              line-height: 0;
118
+            }
119
+          }
120
+        }
121
+      }
122
+
123
+      button:nth-child(1) {
124
+        margin-right: 20px;
125
+      }
126
+    }
127
+  }
128
+}

+ 91 - 0
src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.ts

@@ -0,0 +1,91 @@
1
+import { Component, OnInit, Output, Input } from '@angular/core';
2
+import { FormGroup, FormBuilder, Validators } from '@angular/forms';
3
+import { EventEmitter } from '@angular/core';
4
+import { MainService } from '../../services/main.service';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import { Subject } from 'rxjs';
8
+import { debounceTime } from 'rxjs/operators';
9
+
10
+@Component({
11
+  selector: 'app-inspection-execute-assign-prompt-modal',
12
+  templateUrl: './inspection-execute-assign-prompt-modal.component.html',
13
+  styleUrls: ['./inspection-execute-assign-prompt-modal.component.less']
14
+})
15
+export class InspectionExecuteAssignPromptModalComponent implements OnInit {
16
+  @Output() submitFormHand = new EventEmitter();
17
+  @Output() deptFlagHand = new EventEmitter();
18
+  @Input() deptFlag: boolean = false;//模态框
19
+  loading = false;//获取科室的loading
20
+  validateForm: FormGroup;//表单
21
+  currentHospital; //当前院区
22
+
23
+  changeInpSubject = new Subject(); //防抖
24
+  constructor(
25
+    private fb: FormBuilder,
26
+    private mainService: MainService,
27
+    private message: NzMessageService,
28
+    private tool: ToolService,
29
+  ) { }
30
+
31
+  ngOnInit() {
32
+    //防抖
33
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
34
+      if(v[0] === 'user'){
35
+        this.getUsers(v[1]);
36
+      }
37
+    });
38
+    this.currentHospital = this.tool.getCurrentHospital();
39
+    this.getUsers();
40
+    this.initForm()
41
+  }
42
+  // 隐藏模态框
43
+  hideModal() {
44
+    this.deptFlagHand.emit(false)
45
+    this.initForm()
46
+  }
47
+  // 初始化新增form表单
48
+  initForm() {
49
+    this.validateForm = this.fb.group({
50
+      userId: [null, [Validators.required]]
51
+    });
52
+  }
53
+  // 边输边搜节流阀
54
+  changeInp(model, e) {
55
+    this.isLoading = true;
56
+    this.changeInpSubject.next([model, e]);
57
+  }
58
+  // 获取处理人
59
+  isLoading = false;
60
+  userList: any = [];
61
+  getUsers(keyword = '') {
62
+    let postData = {
63
+      user: {
64
+        hospital: { id: this.currentHospital.id },
65
+        name: keyword,
66
+        simpleQuery: true,
67
+        menuId: 414,
68
+      },
69
+      idx: 0,
70
+      sum: 20,
71
+    };
72
+    this.mainService
73
+      .getFetchDataList("simple/data", "user", postData)
74
+      .subscribe((data) => {
75
+        this.userList = data.list;
76
+        this.isLoading = false;
77
+      });
78
+  }
79
+
80
+  // 表单提交
81
+  submitForm(): void {
82
+    for (const i in this.validateForm.controls) {
83
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
84
+      this.validateForm.controls[i].updateValueAndValidity();
85
+    }
86
+    if (this.validateForm.invalid) return;
87
+
88
+    this.submitFormHand.emit(this.validateForm.value.userId);
89
+  }
90
+}
91
+

+ 3 - 0
src/app/share/share.module.ts

@@ -15,6 +15,7 @@ import { InspectionConfigurationItemPromptModalComponent } from './inspection-co
15 15
 import { InspectionAddressDepartmentPromptModalComponent } from './inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component';
16 16
 import { InspectionTemplatePromptModalComponent } from './inspection-template-prompt-modal/inspection-template-prompt-modal.component';
17 17
 import { InspectionAddressTagPromptModalComponent } from './inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component';
18
+import { InspectionExecuteAssignPromptModalComponent } from './inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component';
18 19
 import { DetailSampleComponent } from './detail-sample/detail-sample.component';
19 20
 import { DetailPatientsComponent } from './detail-patients/detail-patients.component';
20 21
 import { DetailDrugComponent } from './detail-drug/detail-drug.component';
@@ -70,6 +71,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
70 71
     InspectionAddressDepartmentPromptModalComponent,
71 72
     InspectionTemplatePromptModalComponent,
72 73
     InspectionAddressTagPromptModalComponent,
74
+    InspectionExecuteAssignPromptModalComponent,
73 75
     BusinessDataDetailModalComponent,
74 76
     RelationTransDetailModalComponent,
75 77
     BxPromptModalComponent,
@@ -129,6 +131,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
129 131
     InspectionAddressDepartmentPromptModalComponent,
130 132
     InspectionTemplatePromptModalComponent,
131 133
     InspectionAddressTagPromptModalComponent,
134
+    InspectionExecuteAssignPromptModalComponent,
132 135
     BusinessDataDetailModalComponent,
133 136
     RelationTransDetailModalComponent,
134 137
     BxPromptModalComponent,

+ 12 - 34
src/app/views/inspection-execute/inspection-execute.component.html

@@ -43,18 +43,10 @@
43 43
         </div>
44 44
       </div>
45 45
       <div nz-col nzLg="8" class="list-template__btns">
46
-        <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="showInspectionAddressDepartment()">批量关联科室</button>
47
-        <div class="dropdown">
48
-          <button [disabled]="!checkedDepIds.length" nz-button class="btn default ml8" *ngIf="coopBtns.del || coopBtns.print || coopBtns.reset" (mouseenter)="showDropdown = (checkedDepIds.length ? true : false)" (mouseleave)="showDropdown = false">批量操作</button>
49
-          <div class="dropdown-content" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
50
-            <div class="dropdownItem" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','delList')" *ngIf="coopBtns.del">批量删除</div>
51
-            <div class="dropdownItem" *ngIf="coopBtns.print" (click)="print($event,true)">批量打印</div>
52
-            <div class="dropdownItem" *ngIf="coopBtns.reset" (click)="showDelModal(data,'您确认要重置二维码吗?','重置','resetList')">批量重置</div>
53
-          </div>
54
-        </div>
46
+        <button nz-button *ngIf="coopBtns.del" class="btn default" (click)="showDelModal(data,'您确认要删除选中的巡检任务吗?','删除','delList')">批量删除</button>
47
+        <button nz-button *ngIf="coopBtns.designate" class="btn default ml8" (click)="showInspectionExecuteAssign()">批量指派</button>
55 48
         <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
56 49
         <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
57
-        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
58 50
       </div>
59 51
     </div>
60 52
     <div class="list-template__bottom">
@@ -87,8 +79,9 @@
87 79
             <td>{{data.status?.name}}</td>
88 80
             <td>
89 81
               <div class="coop">
90
-                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
91
-                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','del')">删除</span>
82
+                <span *ngIf="coopBtns.look" (click)="edit(data)">查看</span>
83
+                <span *ngIf="coopBtns.designate && data.status.value == 1" (click)="showInspectionExecuteAssign(data)">指派</span>
84
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'您确认要删除选中的巡检任务吗?','删除','del')">删除</span>
92 85
               </div>
93 86
             </td>
94 87
           </tr>
@@ -109,29 +102,14 @@
109 102
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
110 103
   [info]="promptInfo">
111 104
 </app-prompt-modal>
112
-<!-- 二维码打印 -->
113
-<div id="report" style="display: none">
114
-  <div *ngFor="let img of codes" style="display: inline-block;">
115
-    <img style="width: 200px;height:200px;" [src]="img.base64" alt="">
116
-    <p style="margin: 0;text-align: center; font-size: 20px;width: 200px;">{{img.name}}</p>
117
-  </div>
118
-</div>
119
-<!-- 批量关联科室 -->
120
-<app-inspection-address-department-prompt-modal
121
-  *ngIf="inspectionAddressDepartmentPromptModalShow"
122
-  [show]="inspectionAddressDepartmentPromptModalShow"
123
-  (closeModelHs)="closeModelInspectionAddressDepartment($event)"
124
-  (confirmModelHs)="confirmModelInspectionAddressDepartment($event)"
125
-></app-inspection-address-department-prompt-modal>
126 105
 
127
-<!-- 批量关联科室-标签 -->
128
-<app-inspection-address-tag-prompt-modal
129
-  [deptFlag]="inspectionAddressTagPromptModalShow"
130
-  [checkedDepIdsModel]="checkedDepIdsModel"
131
-  (submitFormHand)="confirmModelInspectionAddressTag($event)"
132
-  (deptFlagHand)="closeModelInspectionAddressTag($event)"
133
-  *ngIf="inspectionAddressTagPromptModalShow"
134
-></app-inspection-address-tag-prompt-modal>
106
+<!-- 指派 -->
107
+<app-inspection-execute-assign-prompt-modal
108
+  [deptFlag]="inspectionExecuteAssignPromptModalShow"
109
+  (submitFormHand)="confirmModelInspectionExecuteAssign($event)"
110
+  (deptFlagHand)="closeModelInspectionExecuteAssign($event)"
111
+  *ngIf="inspectionExecuteAssignPromptModalShow"
112
+></app-inspection-execute-assign-prompt-modal>
135 113
 
136 114
 <!-- 遮罩 -->
137 115
 <app-mask *ngIf="maskFlag"></app-mask>

+ 16 - 78
src/app/views/inspection-execute/inspection-execute.component.ts

@@ -63,100 +63,54 @@ export class InspectionExecuteComponent implements OnInit {
63 63
   // 初始化增删改按钮
64 64
   coopBtns: any = {};
65 65
 
66
-  // 批量关联科室
67
-  inspectionAddressDepartmentPromptModalShow = false; //标本历史记录弹窗开关
68
-  showInspectionAddressDepartment() {
69
-    this.inspectionAddressDepartmentPromptModalShow = true;
70
-  }
71
-  // 关闭弹窗
72
-  closeModelInspectionAddressDepartment(e) {
73
-    this.inspectionAddressDepartmentPromptModalShow = JSON.parse(e).show;
74
-  }
75
-  // 确认弹窗
76
-  checkedDepIdsModel = [];
77
-  confirmModelInspectionAddressDepartment(checkedDepIds) {
78
-    this.inspectionAddressDepartmentPromptModalShow = true;
79
-    this.checkedDepIdsModel = checkedDepIds;
80
-    console.log(checkedDepIds)
81
-    this.showInspectionAddressTag();
82
-  }
83
-
84
-  // 批量关联科室-标签
85
-  inspectionAddressTagPromptModalShow = false; //标本历史记录弹窗开关
86
-  showInspectionAddressTag() {
87
-    this.inspectionAddressTagPromptModalShow = true;
66
+  // 派单给人
67
+  inspectionExecuteAssignPromptModalShow = false;
68
+  showInspectionExecuteAssign(data?) {
69
+    this.coopData = data;
70
+    this.inspectionExecuteAssignPromptModalShow = true;
88 71
   }
89 72
   // 关闭弹窗
90
-  closeModelInspectionAddressTag(e) {
91
-    this.inspectionAddressTagPromptModalShow = JSON.parse(e).show;
73
+  closeModelInspectionExecuteAssign(e) {
74
+    this.inspectionExecuteAssignPromptModalShow = JSON.parse(e).show;
92 75
   }
93 76
   // 确认弹窗
94 77
   maskFlag: any = false;
95
-  confirmModelInspectionAddressTag(tags) {
78
+  confirmModelInspectionExecuteAssign(userId) {
96 79
     this.maskFlag = this.message.loading("正在加载中..", {
97 80
       nzDuration: 0,
98 81
     }).messageId;
99
-    this.inspectionAddressTagPromptModalShow = true;
100
-    console.log(this.checkedDepIdsModel, tags);
82
+    this.inspectionExecuteAssignPromptModalShow = true;
83
+    console.log(userId);
101 84
     let postData:any = {
102
-      deptIds: this.checkedDepIdsModel.toString(),
103
-      hosId: this.currentHospital.id,
104
-      tagIds: tags.toString(),
85
+      taskIds: this.coopData ? this.coopData.id.toString() : this.checkedDepIds.toString(),
86
+      userId,
105 87
     };
106 88
     console.log(postData);
107 89
     this.btnLoading = true;
108 90
     this.mainService
109
-      .inspectionPost("batchBindFormNode", postData)
91
+      .inspectionPost("batchAssignTask", postData)
110 92
       .subscribe((result) => {
111 93
         this.message.remove(this.maskFlag);
112 94
         this.maskFlag = false;
113 95
         this.btnLoading = false;
114 96
         if (result.status == 200) {
115
-          this.inspectionAddressDepartmentPromptModalShow = false;
116
-          this.inspectionAddressTagPromptModalShow = false;
97
+          this.inspectionExecuteAssignPromptModalShow = false;
117 98
           this.showPromptModal('操作', true, '');
118
-        } else if (result.status == 501) {
119
-          this.inspectionAddressDepartmentPromptModalShow = false;
120
-          this.inspectionAddressTagPromptModalShow = false;
121
-          this.showPromptModal('操作', true, result.msg);
122 99
         } else {
123 100
           this.showPromptModal('操作', false, result.msg);
124 101
         }
125 102
       });
126 103
   }
127 104
 
128
-  // 打印
129
-  codes = []; //二维码
130
-  printLoading: boolean = false; //批量打印按钮loading状态
131
-  print(e, batch, id?) {
132
-    e.stopPropagation();
133
-    this.printLoading = true;
134
-    this.mainService
135
-      .inspectionPost("getNodeQrCode", batch ? { nodeIds: this.checkedDepIds.toString() } : [id])
136
-      .subscribe((data) => {
137
-        this.codes = data.data;
138
-        this.printLoading = false;
139
-        setTimeout(() => {
140
-          const printContent = document.getElementById("report");
141
-          const WindowPrt = window.open("", "", "width=700,height=900");
142
-          WindowPrt.document.write(printContent.innerHTML);
143
-          WindowPrt.document.close();
144
-          WindowPrt.focus();
145
-          WindowPrt.print();
146
-          WindowPrt.close();
147
-        }, 100);
148
-      });
149
-  }
150
-
151 105
   // 选中表格单列
152 106
   mapOfCheckedId: { [key: string]: boolean } = {};
153
-  checkedDepIds = []; //已选中单列id
107
+  checkedDepIds:any[] = []; //已选中单列id
154 108
   refreshStatus(): void {
155 109
     let listOfData = this.listOfData;
156 110
     this.isAllDisplayDataChecked = listOfData.every(
157 111
       (item) => this.mapOfCheckedId[item.id]
158 112
     );
159
-    let arr = [];
113
+    let arr:any[] = [];
160 114
     for (var k in this.mapOfCheckedId) {
161 115
       if (this.mapOfCheckedId[k]) {
162 116
         arr.push(Number(k));
@@ -348,22 +302,6 @@ export class InspectionExecuteComponent implements OnInit {
348 302
             this.showPromptModal(this.tipsMsg2, false, data.msg);
349 303
           }
350 304
         });
351
-    } else if (this.confirmDelType === "resetList") {
352
-      //批量重置
353
-      let postData = {
354
-        nodeIds: this.checkedDepIds.toString(),
355
-      }
356
-      this.mainService
357
-        .inspectionPost("batchResetNodeCode", postData)
358
-        .subscribe((data) => {
359
-          this.btnLoading = false;
360
-          this.delModal = false;
361
-          if (data.status == 200) {
362
-            this.showPromptModal(this.tipsMsg2, true, "");
363
-          } else {
364
-            this.showPromptModal(this.tipsMsg2, false, data.msg);
365
-          }
366
-        });
367 305
     }
368 306
   }
369 307
 }