瀏覽代碼

巡检点开发

seimin 9 月之前
父節點
當前提交
5e45f6e61f
共有 22 個文件被更改,包括 1886 次插入46 次删除
  1. 0 5
      src/app/app-routing.module.ts
  2. 18 0
      src/app/pipes/data-to-name.pipe.ts
  3. 3 0
      src/app/services/tool.service.ts
  4. 86 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.html
  5. 159 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.less
  6. 167 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.ts
  7. 28 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.html
  8. 128 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.less
  9. 119 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.ts
  10. 9 0
      src/app/share/share.module.ts
  11. 14 0
      src/app/views/inspection-address/inspection-address-routing.module.ts
  12. 211 0
      src/app/views/inspection-address/inspection-address.component.html
  13. 176 0
      src/app/views/inspection-address/inspection-address.component.less
  14. 658 0
      src/app/views/inspection-address/inspection-address.component.ts
  15. 19 0
      src/app/views/inspection-address/inspection-address.module.ts
  16. 2 2
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.html
  17. 4 2
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.less
  18. 47 34
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.ts
  19. 1 1
      src/app/views/inspection-configuration/inspection-configuration.component.html
  20. 2 2
      src/app/views/inspection-configuration/inspection-configuration.component.ts
  21. 10 0
      src/app/views/main/main-routing.module.ts
  22. 25 0
      src/common.less

+ 0 - 5
src/app/app-routing.module.ts

@@ -83,11 +83,6 @@ const routes: Routes = [
83 83
     path: 'washingBatchView',
84 84
     loadChildren: () => import('./views/washing-batch-view/washing-batch-view.module').then(m => m.WashingBatchViewModule),
85 85
   },
86
-  // 巡检项配置
87
-  {
88
-    path: "inspectionConfigurationItem",
89
-    loadChildren: () => import("./views/inspection-configuration-item/inspection-configuration-item.module").then((m) => m.InspectionConfigurationItemModule),
90
-  },
91 86
   // 管理端首页
92 87
   {
93 88
     path: '**',

+ 18 - 0
src/app/pipes/data-to-name.pipe.ts

@@ -0,0 +1,18 @@
1
+import { Pipe, PipeTransform } from '@angular/core';
2
+
3
+@Pipe({
4
+  name: 'dataToName'
5
+})
6
+export class DataToNamePipe implements PipeTransform {
7
+
8
+  transform(value: any[], ...args: any[]): any {
9
+    console.log(args)
10
+    if(Array.isArray(value)){
11
+      return value.map(v => v[args[0]]).join(args[1]);
12
+    }else{
13
+      return '';
14
+    }
15
+
16
+  }
17
+
18
+}

+ 3 - 0
src/app/services/tool.service.ts

@@ -164,6 +164,9 @@ export class ToolService {
164 164
         case "publish":
165 165
           coopBtns.publish = true; //发布
166 166
           break;
167
+        case "reset":
168
+          coopBtns.reset = true; //重置
169
+          break;
167 170
       }
168 171
     });
169 172
     console.log(coopBtns);

+ 86 - 0
src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.html

@@ -0,0 +1,86 @@
1
+<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
2
+  <div class="modalBody">
3
+    <div class="title">批量关联科室<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="list-template content">
5
+      <div class="list-template__content">
6
+        <div class="list-template__top" nz-row>
7
+          <div nz-col nzXl='19' class="list-template__searchBox">
8
+            <div class="list-template__searchItem">
9
+              <span class="label">科室名称</span>:
10
+              <input nz-input class="formItem" placeholder="请输入科室名称" [(ngModel)]="searchDto.dept" />
11
+            </div>
12
+            <div class="list-template__searchItem">
13
+              <span class="label">科室类型</span>:
14
+              <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch
15
+                nzAllowClear nzPlaceHolder="请选择科室类型" [(ngModel)]="searchDto.deptTypeId">
16
+                <ng-container *ngFor="let option of deptTypeList">
17
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
18
+                </ng-container>
19
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
20
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
21
+                </nz-option>
22
+              </nz-select>
23
+            </div>
24
+            <div class="list-template__searchItem">
25
+              <span class="label">楼栋</span>:
26
+              <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
27
+                (nzOnSearch)="changeInp('search', 'building', $event)" nzAllowClear nzPlaceHolder="请选择楼栋" [(ngModel)]="searchDto.buildId">
28
+                <ng-container *ngFor="let option of buildingSearchList">
29
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
30
+                </ng-container>
31
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
32
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
33
+                </nz-option>
34
+              </nz-select>
35
+            </div>
36
+          </div>
37
+          <div nz-col nzLg="5" class="list-template__btns">
38
+            <button nz-button class="btn default mr8" (click)='search()'>搜索</button>
39
+            <button nz-button class="btn default mr8" (click)='reset()'>重置</button>
40
+          </div>
41
+        </div>
42
+        <div class="list-template__bottom">
43
+          <nz-table class="hospitalTable" [nzData]="historySpecimenList" nzSize="middle" [nzShowPagination]="false"
44
+            [nzLoading]="hsLoading" [nzScroll]="{ y: '506px' }">
45
+            <thead>
46
+              <tr class="thead">
47
+                <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" (nzCheckedChange)="checkAll($event)"></th>
48
+                <th nzWidth="19%">科室名称</th>
49
+                <th nzWidth="19%">父级科室</th>
50
+                <th nzWidth="18%">科室编码</th>
51
+                <th nzWidth="13%">科室类型</th>
52
+                <th nzWidth="13%">楼栋</th>
53
+                <th nzWidth="13%">楼层</th>
54
+              </tr>
55
+            </thead>
56
+            <tbody>
57
+              <tr *ngFor="let data of historySpecimenList;let i = index;" (click)="selectedListData(data)">
58
+                <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
59
+                <td>{{ data.dept }}</td>
60
+                <td>{{ data.parent?.dept }}</td>
61
+                <td>{{ data.pcode }}</td>
62
+                <td>{{ data.type?.name }}</td>
63
+                <td>{{ data.building?.buildingName }}</td>
64
+                <td>{{ data.floor?.floorName }}</td>
65
+              </tr>
66
+            </tbody>
67
+          </nz-table>
68
+          <div class="list-template__pagination">
69
+            <nz-pagination [(nzPageIndex)]="historySpecimenPageIndex" [(nzTotal)]="historySpecimenListLength"
70
+              [(nzPageSize)]="historySpecimenPageSize" (nzPageIndexChange)="getList()"
71
+              (nzPageSizeChange)="getList()" nzShowSizeChanger [nzPageSizeOptions]="[10,100]">
72
+            </nz-pagination>
73
+          </div>
74
+        </div>
75
+      </div>
76
+    </div>
77
+    <div class="display_flex justify-content_flex-center">
78
+      <button class="btn know" [nzLoading]="btnLoading" nz-button nzType="primary" (click)="submitForm()">
79
+        确认关联
80
+      </button>
81
+      <button class="btn know" nz-button nzType="primary" nzGhost (click)="hideModal()">
82
+        取消
83
+      </button>
84
+    </div>
85
+  </div>
86
+</div>

+ 159 - 0
src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.less

@@ -0,0 +1,159 @@
1
+@import "../../../../src/theme.less";
2
+.modal {
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  width: 100%;
7
+  height: 100%;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 999;
10
+  .hospitalTable {
11
+    width: 100%;
12
+    td {
13
+      text-align: center !important;
14
+    }
15
+    .thead {
16
+      background-image: linear-gradient(to right, @bg-start, @bg-end);
17
+      th {
18
+        text-align: center !important;
19
+        color: #fff;
20
+        background: transparent;
21
+      }
22
+    }
23
+  }
24
+
25
+  .modalBody {
26
+    width: 950px;
27
+    min-height: 220px;
28
+    background: #fff;
29
+    border-radius: 5px;
30
+    padding: 10px 20px;
31
+    color: #333;
32
+    &.modalBody-search {
33
+      width: 480px;
34
+      min-height: 250px;
35
+    }
36
+
37
+    .title {
38
+      width: 100%;
39
+      text-align: center;
40
+      font-size: 18px;
41
+      position: relative;
42
+
43
+      i {
44
+        position: absolute;
45
+        right: 0;
46
+        top: 0;
47
+        font-size: 20px;
48
+        color: #666;
49
+        cursor: pointer;
50
+        padding: 0 5px;
51
+      }
52
+    }
53
+
54
+    .list-template{
55
+      padding: 0!important;
56
+    }
57
+
58
+    .list-template__bottom{
59
+      border: none!important;
60
+    }
61
+
62
+    .content {
63
+      min-height: 117px;
64
+      background: #f9fafb;
65
+      border: 1px solid #e5e9ed;
66
+      border-radius: 5px;
67
+      overflow: hidden;
68
+      margin-top: 12px;
69
+      display: flex;
70
+      flex-direction: column;
71
+      justify-content: center;
72
+      // align-items: center;
73
+      &.content-search {
74
+        min-height: 147px;
75
+        justify-content: start;
76
+        .defeat-search {
77
+          width: 100%;
78
+          height: 52px;
79
+          display: flex;
80
+          justify-content: center;
81
+          align-items: center;
82
+          border-bottom: solid 1px #e5e9ed;
83
+          em {
84
+            color: #666;
85
+            font-style: normal;
86
+          }
87
+        }
88
+        .form {
89
+          width: 100%;
90
+          padding: 0 16px;
91
+          .ant-form-item-label,
92
+          .ant-form-explain {
93
+            text-align: left !important;
94
+          }
95
+        }
96
+      }
97
+
98
+      div {
99
+        text-align: right;
100
+        margin: 0;
101
+      }
102
+      button{
103
+        margin-top: 0!important;
104
+        margin-left: 0!important;
105
+      }
106
+      .formItem{
107
+        text-align: left!important;
108
+      }
109
+    }
110
+
111
+    button {
112
+      margin-top: 10px;
113
+
114
+      &.btn {
115
+        margin-left: 8px;
116
+      }
117
+    }
118
+  }
119
+
120
+  // 新增
121
+  &.add {
122
+    .modalBody {
123
+      width: 480px;
124
+      height: auto;
125
+
126
+      .content {
127
+        width: 100%;
128
+        height: auto;
129
+        padding: 18px 14px 0 14px;
130
+
131
+        .addForm {
132
+          .ant-form-item {
133
+            margin-bottom: 15px;
134
+
135
+            .ant-form-item-label {
136
+              line-height: 0;
137
+            }
138
+          }
139
+        }
140
+
141
+        .editForm {
142
+          .ant-form-item {
143
+            margin-bottom: 15px;
144
+
145
+            .ant-form-item-label {
146
+              line-height: 0;
147
+            }
148
+          }
149
+        }
150
+      }
151
+
152
+      button {
153
+        &:nth-child(1) {
154
+          margin-right: 20px;
155
+        }
156
+      }
157
+    }
158
+  }
159
+}

+ 167 - 0
src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.ts

@@ -0,0 +1,167 @@
1
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2
+import { MainService } from '../../services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { Subject } from 'rxjs';
5
+import { debounceTime } from 'rxjs/operators';
6
+import { NzMessageService } from 'ng-zorro-antd';
7
+
8
+@Component({
9
+  selector: 'app-inspection-address-department-prompt-modal',
10
+  templateUrl: './inspection-address-department-prompt-modal.component.html',
11
+  styleUrls: ['./inspection-address-department-prompt-modal.component.less']
12
+})
13
+export class InspectionAddressDepartmentPromptModalComponent implements OnInit {
14
+  // 切换科室,切换弹窗
15
+  hsLoading = false;
16
+  historySpecimenList: any = [];
17
+  historySpecimenPageIndex: number = 1;//表格当前页码
18
+  historySpecimenPageSize: number = 10;//表格每页展示条数
19
+  historySpecimenListLength: number = 0;//表格总数据量
20
+
21
+  currentHospital; //当前院区
22
+  searchDto: any = {};
23
+
24
+  changeInpSubject = new Subject(); //防抖
25
+
26
+  @Input() show: Boolean;
27
+
28
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
29
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
30
+
31
+  constructor(
32
+    private mainService: MainService,
33
+    private tool: ToolService,
34
+    private message: NzMessageService,
35
+  ) { }
36
+
37
+  ngOnInit() {
38
+    //防抖
39
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
40
+      if(v[1] === 'building'){
41
+        this.getBuildings(v[0], v[2]);
42
+      }
43
+    });
44
+    this.currentHospital = this.tool.getCurrentHospital();
45
+    this.getList();
46
+    this.getBuildings('search', '');
47
+    this.getDeptTypeList();
48
+  }
49
+
50
+  // 搜索
51
+  search() {
52
+    this.getList();
53
+  }
54
+  // 重置
55
+  reset() {
56
+    this.searchDto = {};
57
+    this.mapOfCheckedId = {};
58
+    this.checkedDepIds = [];
59
+    this.isAllDisplayDataChecked = false;
60
+    this.getList(1);
61
+  }
62
+
63
+  //获取科室类型
64
+  deptTypeList:any[] = [];
65
+  getDeptTypeList() {
66
+    this.mainService
67
+    .getDictionary('list', 'dept_type')
68
+    .subscribe((data) => {
69
+      this.deptTypeList = data || [];
70
+    });
71
+  }
72
+
73
+  // 边输边搜节流阀
74
+  isLoading = false;
75
+  changeInp(type, model, e) {
76
+    this.isLoading = true;
77
+    this.changeInpSubject.next([type, model, e]);
78
+  }
79
+
80
+  // 获取楼栋
81
+  buildingSearchList: any = [];
82
+  getBuildings(type, keyword, init = false) {
83
+    let postData = {
84
+      building: {
85
+        simpleQuery: true,
86
+        buildingName: keyword,
87
+        cascadeHosId: this.currentHospital.id,
88
+      },
89
+      idx: 0,
90
+      sum: 20,
91
+    };
92
+    this.mainService
93
+      .getFetchDataList("simple/data", "building", postData)
94
+      .subscribe((data) => {
95
+        this.buildingSearchList = data.list;
96
+        this.isLoading = false;
97
+      });
98
+  }
99
+
100
+  // 选中表格单列
101
+  mapOfCheckedId: { [key: string]: boolean } = {};
102
+  checkedDepIds = []; //已选中单列id
103
+  refreshStatus(): void {
104
+    let listOfData = this.historySpecimenList;
105
+    this.isAllDisplayDataChecked = listOfData.every(
106
+      (item) => this.mapOfCheckedId[item.id]
107
+    );
108
+    let arr = [];
109
+    for (var k in this.mapOfCheckedId) {
110
+      if (this.mapOfCheckedId[k]) {
111
+        arr.push(Number(k));
112
+      }
113
+    }
114
+    this.checkedDepIds = arr;
115
+  }
116
+  // 整行操作
117
+  selectedListData(data) {
118
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
119
+    this.refreshStatus();
120
+  }
121
+  // 全选
122
+  isAllDisplayDataChecked = false; //当前页是否全选
123
+  checkAll(value: boolean): void {
124
+    this.historySpecimenList.forEach((item) => {
125
+      this.mapOfCheckedId[item.id] = value;
126
+    });
127
+    this.refreshStatus();
128
+  }
129
+  // 关闭弹窗
130
+  hideModal() {
131
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
132
+  }
133
+  // 获取列表数据
134
+  getList(idx?) {
135
+    if (idx) {
136
+      this.historySpecimenPageIndex = 1;
137
+    }
138
+    let postData = {
139
+      idx: this.historySpecimenPageIndex - 1,
140
+      sum: this.historySpecimenPageSize,
141
+      department: {
142
+        dept: this.searchDto.dept || undefined,
143
+        type: this.searchDto.deptTypeId ? { id: this.searchDto.deptTypeId } : undefined,
144
+        buildIds: this.searchDto.buildId ? this.searchDto.buildId.toString() : undefined,
145
+        cascadeHosId: this.currentHospital.id,
146
+      }
147
+    }
148
+    this.hsLoading = true;
149
+    this.mainService.getFetchDataList("data", "department", postData).subscribe(data => {
150
+      this.hsLoading = false;
151
+      this.historySpecimenList = data.list || [];
152
+      this.historySpecimenListLength = data.totalNum || 0;
153
+    })
154
+  }
155
+  // 添加表单提交
156
+  btnLoading: boolean = false; //提交按钮loading状态
157
+  submitForm(): void {
158
+    console.log(this.checkedDepIds);
159
+    if(this.checkedDepIds.length === 0){
160
+      this.message.warning('请选择科室');
161
+      return;
162
+    }
163
+    this.confirmModelHs.emit(this.checkedDepIds);//emits(向上弹射)事件
164
+  }
165
+}
166
+
167
+

+ 28 - 0
src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-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
+      <p class="tips">您本次共选择了<span class="red">{{ checkedDepIdsModel.length }}</span>个科室,请选择对应的标签方便后续使用。</p>
7
+      <form nz-form [formGroup]="validateForm" class="addForm">
8
+        <nz-form-item>
9
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="tagIds">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签</nz-form-label>
10
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择标签!">
11
+            <nz-select (ngModelChange)="changeTags($event)" nzMode="tags" nzAllowClear formControlName="tagIds" nzPlaceHolder="请选择标签">
12
+              <ng-container *ngFor="let option of tagList">
13
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.name"></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-address-tag-prompt-modal/inspection-address-tag-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
+}

+ 119 - 0
src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.ts

@@ -0,0 +1,119 @@
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
+
8
+@Component({
9
+  selector: 'app-inspection-address-tag-prompt-modal',
10
+  templateUrl: './inspection-address-tag-prompt-modal.component.html',
11
+  styleUrls: ['./inspection-address-tag-prompt-modal.component.less']
12
+})
13
+export class InspectionAddressTagPromptModalComponent implements OnInit {
14
+  @Output() submitFormHand = new EventEmitter();
15
+  @Output() deptFlagHand = new EventEmitter();
16
+  @Input() deptFlag: boolean = false;//模态框
17
+  @Input() checkedDepIdsModel: any[] = [];//科室ids
18
+  loading = false;//获取科室的loading
19
+  validateForm: FormGroup;//表单
20
+  currentHospital; //当前院区
21
+  constructor(
22
+    private fb: FormBuilder,
23
+    private mainService: MainService,
24
+    private message: NzMessageService,
25
+    private tool: ToolService,
26
+  ) { }
27
+
28
+  ngOnInit() {
29
+    this.currentHospital = this.tool.getCurrentHospital();
30
+    this.getTags();
31
+    this.initForm()
32
+  }
33
+  // 隐藏模态框
34
+  hideModal() {
35
+    this.deptFlagHand.emit(false)
36
+    this.initForm()
37
+  }
38
+  // 初始化新增form表单
39
+  initForm() {
40
+    this.validateForm = this.fb.group({
41
+      tagIds: [[], [Validators.required]]
42
+    });
43
+  }
44
+  // 获取标签
45
+  isLoading = false;
46
+  tagList: any = [];
47
+  tagListCopy: any = [];
48
+  getTags() {
49
+    let postData = {
50
+      tag: {
51
+        hosId: this.currentHospital.id,
52
+      },
53
+      idx: 0,
54
+      sum: 50,
55
+    };
56
+    this.mainService
57
+      .getFetchDataList("simple/data", "tag", postData)
58
+      .subscribe((data) => {
59
+        this.tagList = data.list;
60
+        this.tagListCopy = JSON.parse(JSON.stringify(this.tagList));
61
+        this.isLoading = false;
62
+      });
63
+  }
64
+
65
+  // 选择标签
66
+  changeTags(tags){
67
+    if(tags.length){
68
+      let flag = tags.every(v => {
69
+        return this.tagListCopy.map(vv => vv.name).includes(v);
70
+      })
71
+
72
+      if(flag){
73
+        return;
74
+      }
75
+
76
+      let tagName = tags[tags.length - 1];
77
+      let postData = {
78
+        tag: {
79
+          name: tagName,
80
+          hosId: this.currentHospital.id,
81
+          modelType: { value: 'inspection' },
82
+        }
83
+      }
84
+      this.isLoading = true;
85
+      this.mainService
86
+      .coopData("addData", "tag", postData)
87
+      .subscribe((result) => {
88
+        this.isLoading = false;
89
+        console.log(result);
90
+        if(result.status == 200){
91
+
92
+        } else if (result.status == 10001){
93
+          // 名称重复
94
+          this.tagListCopy.unshift(result.data)
95
+          console.log(this.tagListCopy);
96
+        } else {
97
+          tags.pop();
98
+          this.message.warning(result.msg || '请求数据失败')
99
+        }
100
+      });
101
+    }
102
+  }
103
+  // 表单提交
104
+  submitForm(): void {
105
+    for (const i in this.validateForm.controls) {
106
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
107
+      this.validateForm.controls[i].updateValueAndValidity();
108
+    }
109
+    if (this.validateForm.invalid) return;
110
+
111
+    let tagNames = this.validateForm.value.tagIds;
112
+    let tags = this.tagListCopy;
113
+    let tagIds = tagNames.map(name =>{
114
+      return tags.find(v => v.name === name).id;
115
+    })
116
+    this.submitFormHand.emit(tagIds);
117
+  }
118
+}
119
+

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

@@ -11,12 +11,15 @@ import { ReplicationSchemeComponent } from './replication-scheme/replication-sch
11 11
 import { HsPromptModalComponent } from './hs-prompt-modal/hs-prompt-modal.component';
12 12
 import { HistoryPromptModalComponent } from './history-prompt-modal/history-prompt-modal.component';
13 13
 import { InspectionConfigurationItemPromptModalComponent } from './inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component';
14
+import { InspectionAddressDepartmentPromptModalComponent } from './inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component';
15
+import { InspectionAddressTagPromptModalComponent } from './inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component';
14 16
 import { DetailSampleComponent } from './detail-sample/detail-sample.component';
15 17
 import { DetailPatientsComponent } from './detail-patients/detail-patients.component';
16 18
 import { DetailDrugComponent } from './detail-drug/detail-drug.component';
17 19
 import { DetailOthersComponent } from './detail-others/detail-others.component';
18 20
 import { AllocationWorkerComponent } from './allocation-worker/allocation-worker.component';
19 21
 import { DateTransformPipe } from '../pipes/date-transform.pipe';
22
+import { DataToNamePipe } from '../pipes/data-to-name.pipe';
20 23
 import { AppraiseDetailComponent } from './appraise-detail/appraise-detail.component';
21 24
 import { OrderDetailComponent } from './order-detail/order-detail.component';
22 25
 import { DialogDeleteComponent } from './dialog-delete/dialog-delete.component';
@@ -61,6 +64,8 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
61 64
     HsPromptModalComponent,
62 65
     HistoryPromptModalComponent,
63 66
     InspectionConfigurationItemPromptModalComponent,
67
+    InspectionAddressDepartmentPromptModalComponent,
68
+    InspectionAddressTagPromptModalComponent,
64 69
     BusinessDataDetailModalComponent,
65 70
     RelationTransDetailModalComponent,
66 71
     BxPromptModalComponent,
@@ -68,6 +73,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
68 73
     OrderDetailComponent,
69 74
     OutgoingRecordDetailComponent,
70 75
     DateTransformPipe,
76
+    DataToNamePipe,
71 77
     DialogDeleteComponent,
72 78
     DialogBxComponent,
73 79
     DialogSurgeryComponent,
@@ -115,6 +121,8 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
115 121
     HsPromptModalComponent,
116 122
     HistoryPromptModalComponent,
117 123
     InspectionConfigurationItemPromptModalComponent,
124
+    InspectionAddressDepartmentPromptModalComponent,
125
+    InspectionAddressTagPromptModalComponent,
118 126
     BusinessDataDetailModalComponent,
119 127
     RelationTransDetailModalComponent,
120 128
     BxPromptModalComponent,
@@ -127,6 +135,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
127 135
     ReactiveFormsModule,
128 136
     OverlayscrollbarsModule,
129 137
     DateTransformPipe,
138
+    DataToNamePipe,
130 139
     DialogDeleteComponent,
131 140
     DialogBxComponent,
132 141
     DialogSurgeryComponent,

+ 14 - 0
src/app/views/inspection-address/inspection-address-routing.module.ts

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

+ 211 - 0
src/app/views/inspection-address/inspection-address.component.html

@@ -0,0 +1,211 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='16' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">科室</span>:
7
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
8
+            (nzOnSearch)="changeInp('search', 'department', $event)" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="searchDto.deptId">
9
+            <ng-container *ngFor="let option of departmentSearchList">
10
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
11
+            </ng-container>
12
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
13
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
14
+            </nz-option>
15
+          </nz-select>
16
+        </div>
17
+        <div class="list-template__searchItem">
18
+          <span class="label">楼栋</span>:
19
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
20
+            (nzOnSearch)="changeInp('search', 'building', $event)" nzAllowClear nzPlaceHolder="请选择楼栋" [(ngModel)]="searchDto.buildId">
21
+            <ng-container *ngFor="let option of buildingSearchList">
22
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
23
+            </ng-container>
24
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
25
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
26
+            </nz-option>
27
+          </nz-select>
28
+        </div>
29
+        <div class="list-template__searchItem">
30
+          <span class="label">名称</span>:
31
+          <input nz-input class="formItem" placeholder="请输入名称" [(ngModel)]="searchDto.name" />
32
+        </div>
33
+      </div>
34
+      <div nz-col nzLg="8" class="list-template__btns">
35
+        <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="addModal()">新增</button>
36
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="showInspectionAddressDepartment()">批量关联科室</button>
37
+        <div class="dropdown">
38
+          <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>
39
+          <div class="dropdown-content" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
40
+            <div class="dropdownItem" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','delList')" *ngIf="coopBtns.del">批量删除</div>
41
+            <div class="dropdownItem" *ngIf="coopBtns.print" (click)="print($event,true)">批量打印</div>
42
+            <div class="dropdownItem" *ngIf="coopBtns.reset" (click)="showDelModal(data,'您确认要重置二维码吗?','重置','resetList')">批量重置</div>
43
+          </div>
44
+        </div>
45
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
46
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
47
+      </div>
48
+    </div>
49
+    <div class="list-template__bottom">
50
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
51
+        [nzLoading]="loading1">
52
+        <thead>
53
+          <tr class="thead">
54
+            <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" (nzCheckedChange)="checkAll($event)"></th>
55
+            <th nzWidth="14%">巡检点名称</th>
56
+            <th nzWidth="14%">关联科室</th>
57
+            <th nzWidth="14%">楼栋</th>
58
+            <th nzWidth="14%">楼层</th>
59
+            <th nzWidth="14%">标签</th>
60
+            <th nzWidth="14%">支持签到模式</th>
61
+            <th nzWidth="11%">操作</th>
62
+          </tr>
63
+        </thead>
64
+        <tbody>
65
+          <tr *ngFor="let data of listOfData;let i = index" (click)="selectedListData(data)">
66
+            <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
67
+            <td>{{data.name}}</td>
68
+            <td>{{data.departmentDTO?.dept}}</td>
69
+            <td>{{data.buildingDTO?.buildingName}}</td>
70
+            <td>{{data.floorDTO?.floorName}}</td>
71
+            <td>{{data.tagIdsList|dataToName:'name':' '}}</td>
72
+            <td>{{data.signType?.name}}</td>
73
+            <td>
74
+              <div class="coop">
75
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
76
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','del')">删除</span>
77
+              </div>
78
+            </td>
79
+          </tr>
80
+        </tbody>
81
+      </nz-table>
82
+      <div class="list-template__pagination">
83
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
84
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
85
+        </nz-pagination>
86
+      </div>
87
+    </div>
88
+  </div>
89
+
90
+  <!-- 新增/编辑模态框 -->
91
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
92
+    <div class="modalBody">
93
+      <div class="title">{{modelName}}巡检点<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
94
+      <div class="content">
95
+        <form nz-form [formGroup]="validateForm" class="addForm">
96
+          <nz-form-item>
97
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="name">名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称</nz-form-label>
98
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入名称!">
99
+              <nz-input-group>
100
+                  <input formControlName="name" nz-input placeholder="请输入名称">
101
+              </nz-input-group>
102
+            </nz-form-control>
103
+          </nz-form-item>
104
+          <nz-form-item>
105
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="deptId">关联科室</nz-form-label>
106
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择关联科室!">
107
+              <nz-select (nzOnSearch)="changeInp('add', 'department', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="deptId" nzPlaceHolder="请选择关联科室" (ngModelChange)="changeDepartment($event)" [nzDisabled]="!add">
108
+                <ng-container *ngFor="let option of departmentAddList">
109
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
110
+                </ng-container>
111
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
112
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
113
+                </nz-option>
114
+              </nz-select>
115
+            </nz-form-control>
116
+          </nz-form-item>
117
+          <nz-form-item>
118
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="buildId">楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;栋</nz-form-label>
119
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择楼栋!">
120
+              <nz-select (nzOnSearch)="changeInp('add', 'building', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="buildId" nzPlaceHolder="请选择楼栋" (ngModelChange)="changeBuilding($event)">
121
+                <ng-container *ngFor="let option of buildingAddList">
122
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
123
+                </ng-container>
124
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
125
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
126
+                </nz-option>
127
+              </nz-select>
128
+            </nz-form-control>
129
+          </nz-form-item>
130
+          <nz-form-item>
131
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="floorId">楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;层</nz-form-label>
132
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择楼层!">
133
+              <nz-select (nzOnSearch)="changeInp('add', 'floor', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="floorId" nzPlaceHolder="请选择楼层">
134
+                <ng-container *ngFor="let option of floorList">
135
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
136
+                </ng-container>
137
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
138
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
139
+                </nz-option>
140
+              </nz-select>
141
+            </nz-form-control>
142
+          </nz-form-item>
143
+          <nz-form-item>
144
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="tagIds">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签</nz-form-label>
145
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择标签!">
146
+              <nz-select (ngModelChange)="changeTags($event)" nzMode="tags" nzAllowClear formControlName="tagIds" nzPlaceHolder="请选择标签">
147
+                <ng-container *ngFor="let option of tagList">
148
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.name"></nz-option>
149
+                </ng-container>
150
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
151
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
152
+                </nz-option>
153
+              </nz-select>
154
+            </nz-form-control>
155
+          </nz-form-item>
156
+          <nz-form-item>
157
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="signType">签到模式</nz-form-label>
158
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择签到模式!">
159
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="signType" nzShowSearch
160
+                nzPlaceHolder="请选择签到模式" nzServerSearch>
161
+                <ng-container *ngFor="let data of dispatchMethods">
162
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.value"></nz-option>
163
+                </ng-container>
164
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
165
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
166
+                </nz-option>
167
+              </nz-select>
168
+            </nz-form-control>
169
+          </nz-form-item>
170
+        </form>
171
+      </div>
172
+      <div class="display_flex justify-content_flex-center">
173
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
174
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
175
+      </div>
176
+    </div>
177
+  </div>
178
+  <!-- 模态框 -->
179
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
180
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
181
+</div>
182
+<!-- 操作成功/失败提示框 -->
183
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
184
+  [info]="promptInfo">
185
+</app-prompt-modal>
186
+<!-- 二维码打印 -->
187
+<div id="report" style="display: none">
188
+  <div *ngFor="let img of codes" style="display: inline-block;">
189
+    <img style="width: 200px;height:200px;" [src]="img.base64" alt="">
190
+    <p style="margin: 0;text-align: center; font-size: 20px;width: 200px;">{{img.name}}</p>
191
+  </div>
192
+</div>
193
+<!-- 批量关联科室 -->
194
+<app-inspection-address-department-prompt-modal
195
+  *ngIf="inspectionAddressDepartmentPromptModalShow"
196
+  [show]="inspectionAddressDepartmentPromptModalShow"
197
+  (closeModelHs)="closeModelInspectionAddressDepartment($event)"
198
+  (confirmModelHs)="confirmModelInspectionAddressDepartment($event)"
199
+></app-inspection-address-department-prompt-modal>
200
+
201
+<!-- 批量关联科室-标签 -->
202
+<app-inspection-address-tag-prompt-modal
203
+  [deptFlag]="inspectionAddressTagPromptModalShow"
204
+  [checkedDepIdsModel]="checkedDepIdsModel"
205
+  (submitFormHand)="confirmModelInspectionAddressTag($event)"
206
+  (deptFlagHand)="closeModelInspectionAddressTag($event)"
207
+  *ngIf="inspectionAddressTagPromptModalShow"
208
+></app-inspection-address-tag-prompt-modal>
209
+
210
+<!-- 遮罩 -->
211
+<app-mask *ngIf="maskFlag"></app-mask>

+ 176 - 0
src/app/views/inspection-address/inspection-address.component.less

@@ -0,0 +1,176 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  ::ng-deep .ant-calendar-picker {
5
+    width: 100% !important;
6
+  }
7
+  .list-template__top{
8
+    overflow: visible!important;
9
+  }
10
+}
11
+.save {
12
+  position: fixed;
13
+  left: 0;
14
+  top: 0;
15
+  width: 100%;
16
+  height: 100%;
17
+  background: rgba(0, 0, 0, 0.4);
18
+  z-index: 99;
19
+
20
+  .modalBody {
21
+    width: 350px;
22
+    background: #fff;
23
+    border-radius: 5px;
24
+    padding: 10px 20px;
25
+    color: #333;
26
+
27
+    .title {
28
+      width: 100%;
29
+      text-align: center;
30
+      font-size: 18px;
31
+      position: relative;
32
+
33
+      i {
34
+        position: absolute;
35
+        right: 0;
36
+        top: 0;
37
+        font-size: 20px;
38
+        color: #666;
39
+        cursor: pointer;
40
+        padding: 0 5px;
41
+      }
42
+    }
43
+
44
+    .content {
45
+      width: 310px;
46
+      background: #f9fafb;
47
+      border: 1px solid #e5e9ed;
48
+      border-radius: 5px;
49
+      overflow: hidden;
50
+      margin-top: 12px;
51
+      padding: 16px 0;
52
+
53
+      .busyList{
54
+        display: flex;
55
+        margin-bottom: 8px;
56
+        .busyContent{
57
+          margin-right: 8px;
58
+          flex: 1;
59
+        }
60
+      }
61
+
62
+      & > div {
63
+        text-align: center;
64
+        margin: 0;
65
+
66
+        &.icon {
67
+          // margin-top: 17px;
68
+
69
+          i {
70
+            color: #34b349;
71
+            font-size: 30px !important;
72
+
73
+            &.transport-wenhao {
74
+              color: #f5a523;
75
+            }
76
+
77
+            &.transport-shibai {
78
+              color: #ff3a52;
79
+            }
80
+          }
81
+        }
82
+
83
+        &.defeat {
84
+          color: #333;
85
+          font-size: 14px;
86
+        }
87
+
88
+        &:nth-child(3) {
89
+          font-size: 14px;
90
+          color: #666;
91
+        }
92
+      }
93
+      .workAssignmentTips {
94
+        font-size: 12px;
95
+      }
96
+    }
97
+
98
+    button {
99
+      margin-top: 10px;
100
+
101
+      &.btn {
102
+        margin-left: 8px;
103
+      }
104
+    }
105
+  }
106
+
107
+  // 新增
108
+  &.add {
109
+    .modalBody {
110
+      width: 480px;
111
+      height: auto;
112
+
113
+      .content {
114
+        width: 100%;
115
+        height: auto;
116
+        padding: 16px;
117
+        max-height: 497px;
118
+        overflow-y: auto;
119
+
120
+        .addForm {
121
+          .ant-form-item {
122
+            margin-bottom: 0;
123
+
124
+            .ant-form-item-label {
125
+              text-align: left;
126
+            }
127
+
128
+            .desc {
129
+              margin-top: 5px;
130
+            }
131
+          }
132
+
133
+          .datesControl {
134
+            margin-top: -16px;
135
+
136
+            .ant-form-item-label {
137
+              line-height: 40px;
138
+            }
139
+          }
140
+
141
+          .timer {
142
+            .ant-form-item-label {
143
+              width: 100%;
144
+              text-align: left;
145
+            }
146
+
147
+            .numInp {
148
+              margin-right: 5px;
149
+            }
150
+
151
+            .line {
152
+              margin-right: 5px;
153
+            }
154
+          }
155
+
156
+          .timer2 {
157
+            .ant-form-item-label {
158
+              line-height: 20px;
159
+            }
160
+          }
161
+        }
162
+
163
+        .editForm {
164
+          .ant-form-item {
165
+            margin-bottom: 15px;
166
+
167
+            .ant-form-item-label {
168
+              line-height: 14px;
169
+              text-align: left;
170
+            }
171
+          }
172
+        }
173
+      }
174
+    }
175
+  }
176
+}

+ 658 - 0
src/app/views/inspection-address/inspection-address.component.ts

@@ -0,0 +1,658 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { ToolService } from "../../services/tool.service";
7
+import { NzMessageService } from 'ng-zorro-antd';
8
+import { Subject } from 'rxjs';
9
+import { debounceTime } from 'rxjs/operators';
10
+@Component({
11
+  selector: "app-inspection-address",
12
+  templateUrl: "./inspection-address.component.html",
13
+  styleUrls: ["./inspection-address.component.less"],
14
+})
15
+export class InspectionAddressComponent implements OnInit {
16
+  constructor(
17
+    private fb: FormBuilder,
18
+    private mainService: MainService,
19
+    private route: ActivatedRoute,
20
+    private router: Router,
21
+    private tool: ToolService,
22
+    private message: NzMessageService,
23
+  ) {}
24
+
25
+  listOfData: any[] = []; //表格数据
26
+  pageIndex: number = 1; //表格当前页码
27
+  pageSize: number = 10; //表格每页展示条数
28
+  listLength: number = 10; //表格总数据量
29
+  modal: boolean = false; //新增/编辑模态框
30
+  add: boolean; //true:新增;false:编辑
31
+  validateForm: FormGroup; //新增/编辑表单
32
+  coopData: any; //当前操作列
33
+  currentHospital; //当前院区
34
+
35
+  btnLoading: boolean = false; //提交按钮loading状态
36
+
37
+  promptContent: string; //操作提示框提示信息
38
+  ifSuccess: boolean; //操作成功/失败
39
+  promptInfo: string; //操作结果提示信息
40
+  promptModalShow: boolean; //操作提示框是否展示
41
+  nextSchemeName = ""; //下一个开启的方案名称
42
+  modelName = ""; //模态框名称
43
+
44
+  changeInpSubject = new Subject(); //防抖
45
+  showDropdown:boolean = false;
46
+
47
+  ngOnInit() {
48
+    //防抖
49
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
50
+      if(v[1] === 'department'){
51
+        this.getDeparts(v[0], v[2]);
52
+      } else if(v[1] === 'building'){
53
+        this.getBuildings(v[0], v[2]);
54
+      } else if(v[1] === 'floor'){
55
+        this.getFloors(v[0], v[2], this.validateForm.value.buildId);
56
+      }
57
+    });
58
+    this.currentHospital = this.tool.getCurrentHospital();
59
+    this.coopBtns = this.tool.initCoopBtns(this.route);
60
+    this.getList(1);
61
+    this.getDeparts('search', '');
62
+    this.getDeparts('add', '');
63
+    this.getTags('add', '');
64
+    this.getBuildings('add', '');
65
+    this.getBuildings('search', '');
66
+    this.getDispatchMethods();
67
+  }
68
+
69
+  // 初始化增删改按钮
70
+  coopBtns: any = {};
71
+
72
+  // 批量关联科室
73
+  inspectionAddressDepartmentPromptModalShow = false; //标本历史记录弹窗开关
74
+  showInspectionAddressDepartment() {
75
+    this.inspectionAddressDepartmentPromptModalShow = true;
76
+  }
77
+  // 关闭弹窗
78
+  closeModelInspectionAddressDepartment(e) {
79
+    this.inspectionAddressDepartmentPromptModalShow = JSON.parse(e).show;
80
+  }
81
+  // 确认弹窗
82
+  checkedDepIdsModel = [];
83
+  confirmModelInspectionAddressDepartment(checkedDepIds) {
84
+    this.inspectionAddressDepartmentPromptModalShow = true;
85
+    this.checkedDepIdsModel = checkedDepIds;
86
+    console.log(checkedDepIds)
87
+    this.showInspectionAddressTag();
88
+  }
89
+
90
+  // 批量关联科室-标签
91
+  inspectionAddressTagPromptModalShow = false; //标本历史记录弹窗开关
92
+  showInspectionAddressTag() {
93
+    this.inspectionAddressTagPromptModalShow = true;
94
+  }
95
+  // 关闭弹窗
96
+  closeModelInspectionAddressTag(e) {
97
+    this.inspectionAddressTagPromptModalShow = JSON.parse(e).show;
98
+  }
99
+  // 确认弹窗
100
+  maskFlag: any = false;
101
+  confirmModelInspectionAddressTag(tags) {
102
+    this.maskFlag = this.message.loading("正在加载中..", {
103
+      nzDuration: 0,
104
+    }).messageId;
105
+    this.inspectionAddressTagPromptModalShow = true;
106
+    console.log(this.checkedDepIdsModel, tags);
107
+    let postData:any = {
108
+      deptIds: this.checkedDepIdsModel.toString(),
109
+      hosId: this.currentHospital.id,
110
+      tagIds: tags.toString(),
111
+    };
112
+    console.log(postData);
113
+    this.btnLoading = true;
114
+    this.mainService
115
+      .inspectionPost("batchBindFormNode", postData)
116
+      .subscribe((result) => {
117
+        this.message.remove(this.maskFlag);
118
+        this.maskFlag = false;
119
+        this.btnLoading = false;
120
+        if (result.status == 200) {
121
+          this.inspectionAddressDepartmentPromptModalShow = false;
122
+          this.inspectionAddressTagPromptModalShow = false;
123
+          this.showPromptModal('操作', true, '');
124
+        } else if (result.status == 501) {
125
+          this.inspectionAddressDepartmentPromptModalShow = false;
126
+          this.inspectionAddressTagPromptModalShow = false;
127
+          this.showPromptModal('操作', true, result.msg);
128
+        } else {
129
+          this.showPromptModal('操作', false, result.msg);
130
+        }
131
+      });
132
+  }
133
+
134
+  // 打印
135
+  codes = []; //二维码
136
+  printLoading: boolean = false; //批量打印按钮loading状态
137
+  print(e, batch, id?) {
138
+    e.stopPropagation();
139
+    this.printLoading = true;
140
+    this.mainService
141
+      .inspectionPost("getNodeQrCode", batch ? { nodeIds: this.checkedDepIds.toString() } : [id])
142
+      .subscribe((data) => {
143
+        this.codes = data.data;
144
+        this.printLoading = false;
145
+        setTimeout(() => {
146
+          const printContent = document.getElementById("report");
147
+          const WindowPrt = window.open("", "", "width=700,height=900");
148
+          WindowPrt.document.write(printContent.innerHTML);
149
+          WindowPrt.document.close();
150
+          WindowPrt.focus();
151
+          WindowPrt.print();
152
+          WindowPrt.close();
153
+        }, 100);
154
+      });
155
+  }
156
+
157
+  // 选中表格单列
158
+  mapOfCheckedId: { [key: string]: boolean } = {};
159
+  checkedDepIds = []; //已选中单列id
160
+  refreshStatus(): void {
161
+    let listOfData = this.listOfData;
162
+    this.isAllDisplayDataChecked = listOfData.every(
163
+      (item) => this.mapOfCheckedId[item.id]
164
+    );
165
+    let arr = [];
166
+    for (var k in this.mapOfCheckedId) {
167
+      if (this.mapOfCheckedId[k]) {
168
+        arr.push(Number(k));
169
+      }
170
+    }
171
+    this.checkedDepIds = arr;
172
+  }
173
+  // 整行操作
174
+  selectedListData(data) {
175
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
176
+    this.refreshStatus();
177
+  }
178
+  // 全选
179
+  isAllDisplayDataChecked = false; //当前页是否全选
180
+  checkAll(value: boolean): void {
181
+    this.listOfData.forEach((item) => {
182
+      this.mapOfCheckedId[item.id] = value;
183
+    });
184
+    this.refreshStatus();
185
+  }
186
+
187
+  // 搜索
188
+  search() {
189
+    this.getList(0);
190
+  }
191
+  // 重置
192
+  reset() {
193
+    this.searchDto = {};
194
+    this.getList(1);
195
+  }
196
+
197
+  // 表格数据
198
+  searchDto: any = {};
199
+  loading1 = false;
200
+  getList(type) {
201
+    if (type == 1) {
202
+      this.pageIndex = 1;
203
+    }
204
+    let data = {
205
+      idx: this.pageIndex - 1,
206
+      sum: this.pageSize,
207
+      inspectionNode: {
208
+        hosId: this.currentHospital.id,
209
+        ...this.searchDto,
210
+      },
211
+    };
212
+    this.mapOfCheckedId = {};
213
+    this.checkedDepIds = [];
214
+    this.isAllDisplayDataChecked = false;
215
+    this.loading1 = true;
216
+    this.mainService
217
+      .getFetchDataList("simple/data", "inspectionNode", data)
218
+      .subscribe((data) => {
219
+        this.loading1 = false;
220
+        if (data.status == 200) {
221
+          this.listOfData = data.list;
222
+          this.listLength = data.totalNum;
223
+        }else{
224
+          this.message.error(data.msg || "请求数据失败");
225
+        }
226
+      });
227
+  }
228
+
229
+  // 新增弹框
230
+  addModal() {
231
+    this.modelName = "新增";
232
+    this.add = true; //新增
233
+    this.modal = true;
234
+    this.initForm();
235
+  }
236
+  //关闭新增/编辑弹框
237
+  hideAddModal() {
238
+    this.modal = false;
239
+    this.initForm();
240
+  }
241
+
242
+  // 初始化新增form表单
243
+  initForm() {
244
+    this.floorList = [];
245
+    this.validateForm = this.fb.group({
246
+      name: ['', [Validators.required, Validators.pattern(/\S/)]],
247
+      deptId: [null, [Validators.required]],
248
+      buildId: [null, [Validators.required]],
249
+      floorId: [null, [Validators.required]],
250
+      tagIds: [[], [Validators.required]],
251
+      signType: [null, [Validators.required]],
252
+    });
253
+  }
254
+
255
+  // 边输边搜节流阀
256
+  isLoading = false;
257
+  changeInp(type, model, e) {
258
+    this.isLoading = true;
259
+    this.changeInpSubject.next([type, model, e]);
260
+  }
261
+
262
+  // 获取所有科室
263
+  departmentAddList: any = []; //所有所属科室
264
+  departmentSearchList: any = []; //所有所属科室(搜索)
265
+  getDeparts(type, keyword, init = false) {
266
+    let postData = {
267
+      department: {
268
+        // searchType: 1,// 简单查询
269
+        dept: keyword,
270
+        cascadeHosId: this.currentHospital.id,
271
+      },
272
+      idx: 0,
273
+      sum: 20,
274
+    };
275
+    this.mainService
276
+      .getFetchDataList("data", "department", postData)
277
+      .subscribe((data) => {
278
+        if (type == "search") {
279
+          this.departmentSearchList = data.list;
280
+        } else if (type == "add") {
281
+          this.departmentAddList = data.list;
282
+        }
283
+
284
+        this.isLoading = false;
285
+
286
+        if(init && this.coopData && this.coopData.departmentDTO){
287
+          let deptId = this.coopData.departmentDTO.id;
288
+          let flag = this.departmentAddList.some(v => v.id == deptId);
289
+          if(!flag){
290
+            this.departmentAddList.unshift(this.coopData.departmentDTO)
291
+          }
292
+          this.validateForm.controls.deptId.setValue(this.coopData.departmentDTO.id);
293
+        }
294
+      });
295
+  }
296
+
297
+  // 获取标签
298
+  tagList: any = [];
299
+  tagListCopy: any = [];
300
+  getTags(type, keyword) {
301
+    let postData = {
302
+      tag: {
303
+        hosId: this.currentHospital.id,
304
+      },
305
+      idx: 0,
306
+      sum: 50,
307
+    };
308
+    this.mainService
309
+      .getFetchDataList("simple/data", "tag", postData)
310
+      .subscribe((data) => {
311
+        this.tagList = data.list;
312
+        this.tagListCopy = JSON.parse(JSON.stringify(this.tagList));
313
+        this.isLoading = false;
314
+      });
315
+  }
316
+
317
+  // 获取楼栋
318
+  buildingAddList: any = [];
319
+  buildingSearchList: any = [];
320
+  getBuildings(type, keyword, init = false) {
321
+    let postData = {
322
+      building: {
323
+        simpleQuery: true,
324
+        buildingName: keyword,
325
+        cascadeHosId: this.currentHospital.id,
326
+      },
327
+      idx: 0,
328
+      sum: 20,
329
+    };
330
+    this.mainService
331
+      .getFetchDataList("simple/data", "building", postData)
332
+      .subscribe((data) => {
333
+        if (type == "search") {
334
+          this.buildingSearchList = data.list;
335
+        } else if (type == "add") {
336
+          this.buildingAddList = data.list;
337
+        }
338
+        this.isLoading = false;
339
+
340
+        if(init && this.deptDto && this.deptDto.building && !this.validateForm.value.buildId){
341
+          let buildId = this.deptDto.building.id;
342
+          let flag = this.buildingAddList.some(v => v.id == buildId);
343
+          if(!flag){
344
+            this.buildingAddList.unshift(this.deptDto.building)
345
+          }
346
+          this.validateForm.controls.buildId.setValue(this.deptDto.building.id);
347
+        } else if(init && this.coopData && this.coopData.buildingDTO){
348
+          let buildId = this.coopData.buildingDTO.id;
349
+          let flag = this.buildingAddList.some(v => v.id == buildId);
350
+          if(!flag){
351
+            this.buildingAddList.unshift(this.coopData.buildingDTO)
352
+          }
353
+          this.validateForm.controls.buildId.setValue(this.coopData.buildingDTO.id);
354
+        }
355
+      });
356
+  }
357
+
358
+  // 修改关联科室
359
+  deptDto:any = null;
360
+  changeDepartment(deptId){
361
+    if(this.add){
362
+      console.log(deptId)
363
+      this.deptDto = this.departmentAddList.find(v => v.id == deptId);
364
+      console.log(this.deptDto);
365
+      if(this.deptDto && this.deptDto.dept && !this.validateForm.value.name){
366
+        this.validateForm.controls.name.setValue(this.deptDto.dept);
367
+      }
368
+
369
+      if(this.deptDto && this.deptDto.building && !this.validateForm.value.buildId){
370
+        this.getBuildings('add', '', true);
371
+      }
372
+
373
+      if(this.deptDto && this.deptDto.floor && !this.validateForm.value.floorId){
374
+        this.noChangeBuilding = true;
375
+        this.getFloors('add', '', this.deptDto.building.id, true);
376
+      }
377
+    }
378
+  }
379
+
380
+  // 修改楼栋
381
+  noChangeBuilding:boolean = false;
382
+  changeBuilding(buildId?){
383
+    console.log(buildId)
384
+    if(!this.noChangeBuilding){
385
+      this.validateForm.controls.floorId.setValue(null);
386
+      this.getFloors('add', '', this.validateForm.value.buildId);
387
+    }
388
+    this.noChangeBuilding = false;
389
+  }
390
+
391
+  // 获取楼层
392
+  floorList: any = [];
393
+  getFloors(type, keyword, buildId, init = false) {
394
+    if(!buildId){
395
+      this.floorList = [];
396
+      return;
397
+    }
398
+    let postData = {
399
+      floor: {
400
+        floorName: keyword,
401
+        buildId,
402
+        // hosId: this.currentHospital.id,
403
+      },
404
+      idx: 0,
405
+      sum: 20,
406
+    };
407
+    this.mainService
408
+      .getFetchDataList("simple/data", "floor", postData)
409
+      .subscribe((data) => {
410
+        this.floorList = data.list;
411
+        this.isLoading = false;
412
+
413
+        if(init && this.deptDto && this.deptDto.floor && !this.validateForm.value.floorId){
414
+          let floorId = this.deptDto.floor.id;
415
+          let flag = this.floorList.some(v => v.id == floorId);
416
+          if(!flag){
417
+            this.floorList.unshift(this.deptDto.floor)
418
+          }
419
+          this.validateForm.controls.floorId.setValue(this.deptDto.floor.id);
420
+        } else if(init && this.coopData && this.coopData.floorDTO){
421
+          let floorId = this.coopData.floorDTO.id;
422
+          let flag = this.floorList.some(v => v.id == floorId);
423
+          if(!flag){
424
+            this.floorList.unshift(this.coopData.floorDTO)
425
+          }
426
+          this.validateForm.controls.floorId.setValue(this.coopData.floorDTO.id);
427
+        }
428
+      });
429
+  }
430
+
431
+  // 选择标签
432
+  changeTags(tags){
433
+    if(tags.length){
434
+      let flag = tags.every(v => {
435
+        return this.tagListCopy.map(vv => vv.name).includes(v);
436
+      })
437
+
438
+      if(flag){
439
+        return;
440
+      }
441
+
442
+      let tagName = tags[tags.length - 1];
443
+      let postData = {
444
+        tag: {
445
+          name: tagName,
446
+          hosId: this.currentHospital.id,
447
+          modelType: { value: 'inspection' },
448
+        }
449
+      }
450
+      this.isLoading = true;
451
+      this.mainService
452
+      .coopData("addData", "tag", postData)
453
+      .subscribe((result) => {
454
+        this.isLoading = false;
455
+        console.log(result);
456
+        if(result.status == 200){
457
+
458
+        } else if (result.status == 10001){
459
+          // 名称重复
460
+          this.tagListCopy.unshift(result.data)
461
+          console.log(this.tagListCopy);
462
+        } else {
463
+          tags.pop();
464
+          this.message.warning(result.msg || '请求数据失败')
465
+        }
466
+      });
467
+    }
468
+  }
469
+
470
+  //获取填写方式
471
+  dispatchMethods:any[] = [];
472
+  getDispatchMethods() {
473
+    this.isLoading = true;
474
+    this.mainService.getDictionary("list", "inspection_node_sign_type").subscribe((data) => {
475
+      this.isLoading = false;
476
+      this.dispatchMethods = data || [];
477
+    });
478
+  }
479
+
480
+  // 新增/编辑表单提交
481
+  submitForm(): void {
482
+    for (const i in this.validateForm.controls) {
483
+      this.validateForm.controls[i].markAsDirty();
484
+      this.validateForm.controls[i].updateValueAndValidity();
485
+    }
486
+    if (this.validateForm.invalid) {
487
+      return;
488
+    }
489
+
490
+    console.log(this.validateForm.value)
491
+    console.log(this.tagListCopy);
492
+
493
+    this.btnLoading = true;
494
+    let postData:any = {};
495
+
496
+    let tagNames = this.validateForm.value.tagIds;
497
+    let tags = this.tagListCopy;
498
+    let tagIds = tagNames.map(name =>{
499
+      return tags.find(v => v.name === name).id;
500
+    })
501
+
502
+    if (this.add) {
503
+      //增加
504
+      postData = {
505
+        inspectionNode: {
506
+          name: this.validateForm.value.name,
507
+          deptId: this.validateForm.value.deptId,
508
+          buildId: this.validateForm.value.buildId,
509
+          floorId: this.validateForm.value.floorId,
510
+          tagIds: tagIds.toString(),
511
+          signType: this.dispatchMethods.find(v => v.value === this.validateForm.value.signType),
512
+          hosId: this.currentHospital.id,
513
+        }
514
+      };
515
+    } else {
516
+      //编辑
517
+      postData = {
518
+        inspectionNode:{
519
+          ...this.coopData,
520
+          ...{
521
+            name: this.validateForm.value.name,
522
+            deptId: this.validateForm.value.deptId,
523
+            buildId: this.validateForm.value.buildId,
524
+            floorId: this.validateForm.value.floorId,
525
+            tagIds: tagIds.toString(),
526
+            signType: this.dispatchMethods.find(v => v.value === this.validateForm.value.signType),
527
+          }
528
+        }
529
+      };
530
+    }
531
+    this.mainService
532
+      .coopData("addData", "inspectionNode", postData)
533
+      .subscribe((result) => {
534
+        this.btnLoading = false;
535
+        this.hideAddModal();
536
+        let msg = "";
537
+        if (this.add) {
538
+          msg = "新增";
539
+        } else {
540
+          msg = "修改";
541
+        }
542
+        if (result.status == 200) {
543
+          this.showPromptModal(msg, true, "");
544
+        } else if (result.status == 10001) {
545
+          this.showPromptModal(msg, false, "关联科室重复");
546
+        } else {
547
+          this.showPromptModal(msg, false, result.msg);
548
+        }
549
+      });
550
+  }
551
+
552
+  // 编辑
553
+  edit(data) {
554
+    console.log(data);
555
+    this.initForm();
556
+    this.modelName = "编辑";
557
+    this.add = false;
558
+    this.modal = true;
559
+    this.coopData = data;
560
+    this.validateForm.controls.name.setValue(data.name); //名称
561
+    this.validateForm.controls.deptId.setValue(data.deptId);
562
+    this.validateForm.controls.tagIds.setValue(data.tagIdsList.map(v => v.name));
563
+    this.validateForm.controls.signType.setValue(data.signType.value);
564
+
565
+    if(data.deptId){
566
+      this.getDeparts('add', '', true);
567
+    }
568
+
569
+    if(data.buildId){
570
+      this.getBuildings('add', '', true);
571
+    }
572
+
573
+    if(data.floorId){
574
+      this.noChangeBuilding = true;
575
+      this.getFloors('add', '', data.buildId, true);
576
+    }
577
+  }
578
+
579
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
580
+  showPromptModal(con, success, promptInfo?) {
581
+    this.promptModalShow = false;
582
+    this.promptContent = con;
583
+    this.ifSuccess = success;
584
+    this.promptInfo = promptInfo;
585
+    setTimeout(() => {
586
+      this.promptModalShow = true;
587
+    }, 100);
588
+    this.getList(0);
589
+  }
590
+
591
+  delModal: boolean = false; //删除模态框
592
+  tipsMsg1: string; //提示框信息
593
+  tipsMsg2: string; //操作后信息
594
+  confirmDelType: string; //确认的类型(启用/停用,删除)
595
+  showDelModal(
596
+    data,
597
+    tipsMsg1: string,
598
+    tipsMsg2: string,
599
+    type: string,
600
+  ) {
601
+    this.confirmDelType = type;
602
+    this.delModal = true;
603
+    this.coopData = data;
604
+    this.tipsMsg1 = tipsMsg1;
605
+    this.tipsMsg2 = tipsMsg2;
606
+  }
607
+  // 隐藏删除框
608
+  hideDelModal() {
609
+    this.delModal = false;
610
+  }
611
+  // 确认删除
612
+  confirmDel() {
613
+    this.btnLoading = true;
614
+    if (this.confirmDelType === "del") {
615
+      //删除
616
+      this.mainService
617
+        .simplePost("rmvData", "inspectionNode", [this.coopData.id])
618
+        .subscribe((data) => {
619
+          this.btnLoading = false;
620
+          this.delModal = false;
621
+          if (data.status == 200) {
622
+            this.showPromptModal(this.tipsMsg2, true, "");
623
+          } else {
624
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
625
+          }
626
+        });
627
+    } else if (this.confirmDelType === "delList") {
628
+      //批量删除
629
+      this.mainService
630
+        .simplePost("rmvData", "inspectionNode", this.checkedDepIds)
631
+        .subscribe((data) => {
632
+          this.btnLoading = false;
633
+          this.delModal = false;
634
+          if (data.status == 200) {
635
+            this.showPromptModal(this.tipsMsg2, true, "");
636
+          } else {
637
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
638
+          }
639
+        });
640
+    } else if (this.confirmDelType === "resetList") {
641
+      //批量重置
642
+      let postData = {
643
+        nodeIds: this.checkedDepIds.toString(),
644
+      }
645
+      this.mainService
646
+        .inspectionPost("batchResetNodeCode", postData)
647
+        .subscribe((data) => {
648
+          this.btnLoading = false;
649
+          this.delModal = false;
650
+          if (data.status == 200) {
651
+            this.showPromptModal(this.tipsMsg2, true, "");
652
+          } else {
653
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
654
+          }
655
+        });
656
+    }
657
+  }
658
+}

+ 19 - 0
src/app/views/inspection-address/inspection-address.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { InspectionAddressRoutingModule } from './inspection-address-routing.module';
5
+import { InspectionAddressComponent } from './inspection-address.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    InspectionAddressComponent
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    InspectionAddressRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class InspectionAddressModule { }

+ 2 - 2
src/app/views/inspection-configuration-item/inspection-configuration-item.component.html

@@ -11,7 +11,7 @@
11 11
           </div>
12 12
         </div>
13 13
         <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
14
-          [nzLoading]="loading1"  [nzScroll]="{ y: tableHeight + 'px' }">
14
+          [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }">
15 15
           <thead>
16 16
             <tr class="thead">
17 17
               <th nzWidth="13%">巡检项</th>
@@ -209,7 +209,7 @@
209 209
       <div class="head">
210 210
         <button nz-button class="btn default" (click)="addPageModal()">新增</button>
211 211
       </div>
212
-      <overlay-scrollbars #osComponentRef1 class="content" [ngStyle]="{height: tableHeight + 46 + 'px'}">
212
+      <overlay-scrollbars #osComponentRef1 class="content" [ngStyle]="{height: pageHeight + 'px'}">
213 213
         <div class="contentItem active" [ngClass]="{ active: pageActiveId == data.id }" (click)="clickPage(data)"
214 214
           *ngFor="let data of pageList">
215 215
           <div class="title">

+ 4 - 2
src/app/views/inspection-configuration-item/inspection-configuration-item.component.less

@@ -1,7 +1,6 @@
1 1
 @import "../../../../src/theme.less";
2 2
 :host{
3 3
   width: 100%;
4
-  padding: 0 8px;
5 4
 }
6 5
 
7 6
 .inspectionConfigurationItem{
@@ -16,13 +15,16 @@
16 15
     }
17 16
     .list-template__nzTable{
18 17
       padding-top: 0;
19
-      padding-bottom: 16px;
18
+    }
19
+    ::ng-deep .list-template__nzTable .ant-table-body{
20
+      border: none!important;
20 21
     }
21 22
     .list-template__content{
22 23
       height: 100%;
23 24
     }
24 25
     .list-template__bottom{
25 26
       height: 100%;
27
+      padding-bottom: 0;
26 28
     }
27 29
   }
28 30
   .inspectionConfigurationItemPage{

+ 47 - 34
src/app/views/inspection-configuration-item/inspection-configuration-item.component.ts

@@ -1,4 +1,4 @@
1
-import { Component, OnInit, ViewChild } from "@angular/core";
1
+import { Component, OnInit, ViewChild, AfterViewInit } from "@angular/core";
2 2
 import { ActivatedRoute, Router } from "@angular/router";
3 3
 import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4 4
 
@@ -12,7 +12,7 @@ import { NzMessageService } from 'ng-zorro-antd';
12 12
   templateUrl: "./inspection-configuration-item.component.html",
13 13
   styleUrls: ["./inspection-configuration-item.component.less"],
14 14
 })
15
-export class InspectionConfigurationItemComponent implements OnInit {
15
+export class InspectionConfigurationItemComponent implements OnInit, AfterViewInit {
16 16
   @ViewChild("osComponentRef1", {
17 17
     read: OverlayScrollbarsComponent,
18 18
     static: false,
@@ -46,14 +46,19 @@ export class InspectionConfigurationItemComponent implements OnInit {
46 46
   nextSchemeName = ""; //下一个开启的方案名称
47 47
   modelName = ""; //模态框名称
48 48
   tableHeight:number = 0;
49
+  pageHeight:number = 0;
49 50
 
50 51
   ngOnInit() {
51
-    this.tableHeight = document.body.clientHeight - 128;
52 52
     this.currentHospital = this.tool.getCurrentHospital();
53 53
     this.coopBtns = this.tool.initCoopBtns(this.route);
54 54
     this.getInspectionConfigurationDetail(+this.route.snapshot.paramMap.get("id"))
55 55
   }
56 56
 
57
+  ngAfterViewInit(){
58
+    this.pageHeight = document.querySelector('.list-template__bottom').clientHeight - document.querySelector('.list-template__top').clientHeight - 8;
59
+    this.tableHeight = this.pageHeight - document.querySelector('.thead').clientHeight;
60
+  }
61
+
57 62
   // 初始化增删改按钮
58 63
   coopBtns: any = {};
59 64
 
@@ -299,27 +304,7 @@ export class InspectionConfigurationItemComponent implements OnInit {
299 304
     if (this.add) {
300 305
       //增加
301 306
       postData = {
302
-        name: this.validateForm.value.name,
303
-        valuex: this.validateForm.value.valuex,
304
-        valueGap: this.validateForm.value.valueGap,
305
-        valueLow: this.validateForm.value.valueLow,
306
-        valueUp: this.validateForm.value.valueUp,
307
-        orders: this.validateForm.value.orders,
308
-        defaultValue: this.validateForm.value.defaultValueString || this.validateForm.value.defaultValueNumber,
309
-        required: this.validateForm.value.required,
310
-        checkType: this.validateForm.value.checkType,
311
-        showError: this.validateForm.value.showError,
312
-        type: this.dispatchMethods.find(v => v.value == this.validateForm.value.type),
313
-        hosId: this.currentHospital.id,
314
-        formId: +this.route.snapshot.paramMap.get("id"),
315
-        pageId: this.pageActiveId,
316
-        display: 1,
317
-      };
318
-    } else {
319
-      //编辑
320
-      postData = {
321
-        ...this.coopData,
322
-        ...{
307
+        inspectionFormItem: {
323 308
           name: this.validateForm.value.name,
324 309
           valuex: this.validateForm.value.valuex,
325 310
           valueGap: this.validateForm.value.valueGap,
@@ -331,11 +316,35 @@ export class InspectionConfigurationItemComponent implements OnInit {
331 316
           checkType: this.validateForm.value.checkType,
332 317
           showError: this.validateForm.value.showError,
333 318
           type: this.dispatchMethods.find(v => v.value == this.validateForm.value.type),
319
+          hosId: this.currentHospital.id,
320
+          formId: +this.route.snapshot.paramMap.get("id"),
321
+          pageId: this.pageActiveId,
322
+          display: 1,
323
+        }
324
+      };
325
+    } else {
326
+      //编辑
327
+      postData = {
328
+        inspectionFormItem: {
329
+          ...this.coopData,
330
+          ...{
331
+            name: this.validateForm.value.name,
332
+            valuex: this.validateForm.value.valuex,
333
+            valueGap: this.validateForm.value.valueGap,
334
+            valueLow: this.validateForm.value.valueLow,
335
+            valueUp: this.validateForm.value.valueUp,
336
+            orders: this.validateForm.value.orders,
337
+            defaultValue: this.validateForm.value.defaultValueString || this.validateForm.value.defaultValueNumber,
338
+            required: this.validateForm.value.required,
339
+            checkType: this.validateForm.value.checkType,
340
+            showError: this.validateForm.value.showError,
341
+            type: this.dispatchMethods.find(v => v.value == this.validateForm.value.type),
342
+          }
334 343
         }
335 344
       };
336 345
     }
337 346
     this.mainService
338
-      .simplePost("addData", "inspectionFormItem", postData)
347
+      .coopData("addData", "inspectionFormItem", postData)
339 348
       .subscribe((result) => {
340 349
         this.btnLoading = false;
341 350
         this.hideAddModal();
@@ -421,10 +430,10 @@ export class InspectionConfigurationItemComponent implements OnInit {
421 430
           msg = "修改";
422 431
         }
423 432
         if (result.status == 200) {
424
-          this.showPromptModal(msg, true, '');
425 433
           if(this.add){
426 434
             this.pageActiveId = result.data.id;
427 435
           }
436
+          this.showPromptModal(msg, true, '');
428 437
         } else {
429 438
           this.showPromptModal(msg, false, result.msg);
430 439
         }
@@ -493,13 +502,15 @@ export class InspectionConfigurationItemComponent implements OnInit {
493 502
     } else if (this.confirmDelType === "show") {
494 503
       //显示-巡检项
495 504
       let postData = {
496
-        ...this.coopData,
497
-        ...{
498
-          display: 1,
505
+        inspectionFormItem: {
506
+          ...this.coopData,
507
+          ...{
508
+            display: 1,
509
+          }
499 510
         }
500 511
       }
501 512
       this.mainService
502
-        .simplePost("addData", "inspectionFormItem", postData)
513
+        .coopData("addData", "inspectionFormItem", postData)
503 514
         .subscribe((data) => {
504 515
           this.btnLoading = false;
505 516
           this.delModal = false;
@@ -512,13 +523,15 @@ export class InspectionConfigurationItemComponent implements OnInit {
512 523
     } else if (this.confirmDelType === "hidden") {
513 524
       //隐藏-巡检项
514 525
       let postData = {
515
-        ...this.coopData,
516
-        ...{
517
-          display: 0,
526
+        inspectionFormItem: {
527
+          ...this.coopData,
528
+          ...{
529
+            display: 0,
530
+          }
518 531
         }
519 532
       }
520 533
       this.mainService
521
-        .simplePost("addData", "inspectionFormItem", postData)
534
+        .coopData("addData", "inspectionFormItem", postData)
522 535
         .subscribe((data) => {
523 536
           this.btnLoading = false;
524 537
           this.delModal = false;

+ 1 - 1
src/app/views/inspection-configuration/inspection-configuration.component.html

@@ -36,7 +36,7 @@
36 36
         </tbody>
37 37
       </nz-table>
38 38
       <div class="list-template__pagination">
39
-        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
39
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
40 40
           (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
41 41
         </nz-pagination>
42 42
       </div>

+ 2 - 2
src/app/views/inspection-configuration/inspection-configuration.component.ts

@@ -138,7 +138,7 @@ export class InspectionConfigurationComponent implements OnInit {
138 138
         if (result.status == 200) {
139 139
           if (this.add) {
140 140
             this.listLength++;
141
-            this.router.navigateByUrl(`/inspectionConfigurationItem/${result.data.id}`);
141
+            this.router.navigateByUrl(`/main/inspectionConfigurationItem/${result.data.id}`);
142 142
           } else {
143 143
             this.showPromptModal("编辑", true, "");
144 144
           }
@@ -180,7 +180,7 @@ export class InspectionConfigurationComponent implements OnInit {
180 180
 
181 181
   // 跳转到配置项
182 182
   toItem(data){
183
-    this.router.navigateByUrl(`/inspectionConfigurationItem/${data.id}`);
183
+    this.router.navigateByUrl(`/main/inspectionConfigurationItem/${data.id}`);
184 184
   }
185 185
 
186 186
   delModal: boolean = false; //删除模态框

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

@@ -508,6 +508,16 @@ const routes: Routes = [
508 508
         path: "inspectionConfiguration",
509 509
         loadChildren: () => import("../inspection-configuration/inspection-configuration.module").then((m) => m.InspectionConfigurationModule),
510 510
       },
511
+      // 巡检项配置
512
+      {
513
+        path: "inspectionConfigurationItem",
514
+        loadChildren: () => import("../inspection-configuration-item/inspection-configuration-item.module").then((m) => m.InspectionConfigurationItemModule),
515
+      },
516
+      // 巡检点
517
+      {
518
+        path: "inspectionAddress",
519
+        loadChildren: () => import("../inspection-address/inspection-address.module").then((m) => m.InspectionAddressModule),
520
+      },
511 521
     ],
512 522
   },
513 523
 ];

+ 25 - 0
src/common.less

@@ -267,6 +267,31 @@
267 267
         align-items: center;
268 268
         flex-wrap: wrap;
269 269
         row-gap: 8px;
270
+
271
+        .dropdown{
272
+          position: relative;
273
+          .dropdown-content {
274
+            position: absolute;
275
+            left: 8px;
276
+            background-color: #fff;
277
+            width: 80px;
278
+            box-shadow: 0px 0px 4px 1px #D9D9D9;
279
+            z-index: 999;
280
+            border-radius: 4px;
281
+            border: 1px solid rgba(0,0,0,0.15);
282
+            color: rgba(0,0,0,0.65);
283
+          }
284
+
285
+          .dropdown-content .dropdownItem {
286
+            padding: 4px 0;
287
+            text-align: center;
288
+            cursor: pointer;
289
+          }
290
+
291
+          .dropdown-content .dropdownItem:hover {
292
+            background-color: #e9f7e9;
293
+          }
294
+        }
270 295
       }
271 296
     }
272 297
     .list-template__checkBoxes {