Przeglądaj źródła

Merge branch 'master' of http://git.dashitech.com/seimin/zy-pc

maotao 9 miesięcy temu
rodzic
commit
c811bbc01b
74 zmienionych plików z 9099 dodań i 57 usunięć
  1. 61 7
      package-lock.json
  2. 1 0
      package.json
  3. 5 0
      src/app/app-routing.module.ts
  4. 18 0
      src/app/pipes/data-to-name.pipe.ts
  5. 6 0
      src/app/services/main.service.ts
  6. 46 6
      src/app/services/tool.service.ts
  7. 86 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.html
  8. 159 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.less
  9. 169 0
      src/app/share/inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component.ts
  10. 28 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.html
  11. 128 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.less
  12. 121 0
      src/app/share/inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component.ts
  13. 85 0
      src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.html
  14. 211 0
      src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.less
  15. 193 0
      src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.ts
  16. 28 0
      src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.html
  17. 128 0
      src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.less
  18. 91 0
      src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.ts
  19. 145 0
      src/app/share/inspection-execute-detail/inspection-execute-detail.component.html
  20. 544 0
      src/app/share/inspection-execute-detail/inspection-execute-detail.component.less
  21. 110 0
      src/app/share/inspection-execute-detail/inspection-execute-detail.component.ts
  22. 87 0
      src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.html
  23. 190 0
      src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.less
  24. 225 0
      src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.ts
  25. 24 0
      src/app/share/share.module.ts
  26. 23 0
      src/app/share/template-name/template-name.component.html
  27. 129 0
      src/app/share/template-name/template-name.component.less
  28. 47 0
      src/app/share/template-name/template-name.component.ts
  29. 14 0
      src/app/views/inspection-address/inspection-address-routing.module.ts
  30. 211 0
      src/app/views/inspection-address/inspection-address.component.html
  31. 176 0
      src/app/views/inspection-address/inspection-address.component.less
  32. 668 0
      src/app/views/inspection-address/inspection-address.component.ts
  33. 19 0
      src/app/views/inspection-address/inspection-address.module.ts
  34. 14 0
      src/app/views/inspection-batch/inspection-batch-routing.module.ts
  35. 85 0
      src/app/views/inspection-batch/inspection-batch.component.html
  36. 173 0
      src/app/views/inspection-batch/inspection-batch.component.less
  37. 283 0
      src/app/views/inspection-batch/inspection-batch.component.ts
  38. 19 0
      src/app/views/inspection-batch/inspection-batch.module.ts
  39. 14 0
      src/app/views/inspection-configuration-item/inspection-configuration-item-routing.module.ts
  40. 254 0
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.html
  41. 246 0
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.less
  42. 574 0
      src/app/views/inspection-configuration-item/inspection-configuration-item.component.ts
  43. 19 0
      src/app/views/inspection-configuration-item/inspection-configuration-item.module.ts
  44. 14 0
      src/app/views/inspection-configuration/inspection-configuration-routing.module.ts
  45. 94 0
      src/app/views/inspection-configuration/inspection-configuration.component.html
  46. 173 0
      src/app/views/inspection-configuration/inspection-configuration.component.less
  47. 240 0
      src/app/views/inspection-configuration/inspection-configuration.component.ts
  48. 19 0
      src/app/views/inspection-configuration/inspection-configuration.module.ts
  49. 25 0
      src/app/views/inspection-execute/inspection-execute-routing.module.ts
  50. 129 0
      src/app/views/inspection-execute/inspection-execute.component.html
  51. 176 0
      src/app/views/inspection-execute/inspection-execute.component.less
  52. 327 0
      src/app/views/inspection-execute/inspection-execute.component.ts
  53. 19 0
      src/app/views/inspection-execute/inspection-execute.module.ts
  54. 18 0
      src/app/views/inspection-plan-config/inspection-plan-config-routing.module.ts
  55. 92 0
      src/app/views/inspection-plan-config/inspection-plan-config.component.html
  56. 138 0
      src/app/views/inspection-plan-config/inspection-plan-config.component.less
  57. 493 0
      src/app/views/inspection-plan-config/inspection-plan-config.component.ts
  58. 19 0
      src/app/views/inspection-plan-config/inspection-plan-config.module.ts
  59. 25 0
      src/app/views/inspection-plan/inspection-plan-routing.module.ts
  60. 213 0
      src/app/views/inspection-plan/inspection-plan.component.html
  61. 198 0
      src/app/views/inspection-plan/inspection-plan.component.less
  62. 531 0
      src/app/views/inspection-plan/inspection-plan.component.ts
  63. 19 0
      src/app/views/inspection-plan/inspection-plan.module.ts
  64. 31 1
      src/app/views/main/main-routing.module.ts
  65. 6 1
      src/app/views/main/main.component.html
  66. 141 26
      src/assets/iconfont/demo_index.html
  67. 27 7
      src/assets/iconfont/iconfont.css
  68. 1 1
      src/assets/iconfont/iconfont.js
  69. 42 7
      src/assets/iconfont/iconfont.json
  70. BIN
      src/assets/iconfont/iconfont.ttf
  71. BIN
      src/assets/iconfont/iconfont.woff
  72. BIN
      src/assets/iconfont/iconfont.woff2
  73. 31 0
      src/common.less
  74. 1 1
      src/main.ts

+ 61 - 7
package-lock.json

@@ -39,6 +39,7 @@
39 39
         "sortablejs": "^1.14.0",
40 40
         "swiper": "^6.8.4",
41 41
         "tslib": "^1.9.0",
42
+        "uuid": "^10.0.0",
42 43
         "viewerjs": "^0.10.0",
43 44
         "zone.js": "^0.9.1"
44 45
       },
@@ -302,6 +303,16 @@
302 303
         "npm": ">= 6.2.0"
303 304
       }
304 305
     },
306
+    "node_modules/@angular/cli/node_modules/uuid": {
307
+      "version": "3.4.0",
308
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
309
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
310
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
311
+      "dev": true,
312
+      "bin": {
313
+        "uuid": "bin/uuid"
314
+      }
315
+    },
305 316
     "node_modules/@angular/common": {
306 317
       "version": "8.1.3",
307 318
       "resolved": "https://registry.npmmirror.com/@angular/common/-/common-8.1.3.tgz",
@@ -13659,6 +13670,16 @@
13659 13670
         "node": ">=0.6"
13660 13671
       }
13661 13672
     },
13673
+    "node_modules/request/node_modules/uuid": {
13674
+      "version": "3.4.0",
13675
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
13676
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
13677
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
13678
+      "dev": true,
13679
+      "bin": {
13680
+        "uuid": "bin/uuid"
13681
+      }
13682
+    },
13662 13683
     "node_modules/require-directory": {
13663 13684
       "version": "2.1.1",
13664 13685
       "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",
@@ -14648,6 +14669,16 @@
14648 14669
         "node": ">=0.8.0"
14649 14670
       }
14650 14671
     },
14672
+    "node_modules/sockjs/node_modules/uuid": {
14673
+      "version": "3.4.0",
14674
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
14675
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
14676
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
14677
+      "dev": true,
14678
+      "bin": {
14679
+        "uuid": "bin/uuid"
14680
+      }
14681
+    },
14651 14682
     "node_modules/socks": {
14652 14683
       "version": "2.3.3",
14653 14684
       "resolved": "https://registry.npmmirror.com/socks/-/socks-2.3.3.tgz",
@@ -15955,6 +15986,16 @@
15955 15986
         "uuid": "^3.0.0"
15956 15987
       }
15957 15988
     },
15989
+    "node_modules/universal-analytics/node_modules/uuid": {
15990
+      "version": "3.4.0",
15991
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
15992
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
15993
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
15994
+      "dev": true,
15995
+      "bin": {
15996
+        "uuid": "bin/uuid"
15997
+      }
15998
+    },
15958 15999
     "node_modules/universalify": {
15959 16000
       "version": "0.1.2",
15960 16001
       "resolved": "https://registry.npmmirror.com/universalify/-/universalify-0.1.2.tgz",
@@ -16159,13 +16200,15 @@
16159 16200
       }
16160 16201
     },
16161 16202
     "node_modules/uuid": {
16162
-      "version": "3.4.0",
16163
-      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
16164
-      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
16165
-      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
16166
-      "dev": true,
16203
+      "version": "10.0.0",
16204
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-10.0.0.tgz",
16205
+      "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",
16206
+      "funding": [
16207
+        "https://github.com/sponsors/broofa",
16208
+        "https://github.com/sponsors/ctavan"
16209
+      ],
16167 16210
       "bin": {
16168
-        "uuid": "bin/uuid"
16211
+        "uuid": "dist/bin/uuid"
16169 16212
       }
16170 16213
     },
16171 16214
     "node_modules/validate-npm-package-license": {
@@ -16884,6 +16927,16 @@
16884 16927
         "node": ">=6"
16885 16928
       }
16886 16929
     },
16930
+    "node_modules/webpack-log/node_modules/uuid": {
16931
+      "version": "3.4.0",
16932
+      "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz",
16933
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
16934
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
16935
+      "dev": true,
16936
+      "bin": {
16937
+        "uuid": "bin/uuid"
16938
+      }
16939
+    },
16887 16940
     "node_modules/webpack-merge": {
16888 16941
       "version": "4.2.1",
16889 16942
       "resolved": "https://registry.npmmirror.com/webpack-merge/-/webpack-merge-4.2.1.tgz",
@@ -17314,7 +17367,8 @@
17314 17367
     "node_modules/zone.js": {
17315 17368
       "version": "0.9.1",
17316 17369
       "resolved": "https://registry.npmmirror.com/zone.js/-/zone.js-0.9.1.tgz",
17317
-      "integrity": "sha512-GkPiJL8jifSrKReKaTZ5jkhrMEgXbXYC+IPo1iquBjayRa0q86w3Dipjn8b415jpitMExe9lV8iTsv8tk3DGag=="
17370
+      "integrity": "sha512-GkPiJL8jifSrKReKaTZ5jkhrMEgXbXYC+IPo1iquBjayRa0q86w3Dipjn8b415jpitMExe9lV8iTsv8tk3DGag==",
17371
+      "dev": true
17318 17372
     },
17319 17373
     "node_modules/zrender": {
17320 17374
       "version": "4.3.2",

+ 1 - 0
package.json

@@ -47,6 +47,7 @@
47 47
     "sortablejs": "^1.14.0",
48 48
     "swiper": "^6.8.4",
49 49
     "tslib": "^1.9.0",
50
+    "uuid": "^10.0.0",
50 51
     "viewerjs": "^0.10.0",
51 52
     "zone.js": "^0.9.1"
52 53
   },

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

@@ -88,6 +88,11 @@ const routes: Routes = [
88 88
 	  path: 'dispensingDetail/:id',
89 89
 	  loadChildren: () => import('./views/dispensing-detail/dispensing-detail.module').then(m => m.DispensingDetailModule),
90 90
 	},
91
+  // 洗涤批次视图
92
+  {
93
+    path: 'inspectionPlanConfig/:id',
94
+    loadChildren: () => import('./views/inspection-plan-config/inspection-plan-config.module').then(m => m.InspectionPlanConfigModule),
95
+  },
91 96
   // 管理端首页
92 97
   {
93 98
     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
+}

+ 6 - 0
src/app/services/main.service.ts

@@ -805,6 +805,12 @@ export class MainService {
805 805
       responseType: "arraybuffer",
806 806
     });
807 807
   }
808
+  // 巡检相关接口
809
+  inspectionPost(type, data): any {
810
+    return this.http.post(host.host + "/inspection/" + type, data, {
811
+      headers: this.headers,
812
+    });
813
+  }
808 814
 	// 验证工单问卷二维码是否过期
809 815
 	verifyPastApi(data): any {
810 816
 	  return this.http.post(host.host + "/questionnaire/check", data, {

+ 46 - 6
src/app/services/tool.service.ts

@@ -150,8 +150,8 @@ export class ToolService {
150 150
           coopBtns.oneClickRecovery = true; //一键恢复
151 151
           break;
152 152
         case "view":
153
-            coopBtns.view = true; //查看视图
154
-            break;
153
+          coopBtns.view = true; //查看视图
154
+          break;
155 155
         case "recount":
156 156
           coopBtns.recount = true; //重新统计
157 157
           break;
@@ -167,10 +167,15 @@ export class ToolService {
167 167
 				case "batchPrint":
168 168
 				  coopBtns.batchPrint = true; //发药并打印
169 169
 				  break;
170
-				case "config":
171
-				  coopBtns.config = true; //配置
172
-				  break;
173
-					
170
+        case "config":
171
+          coopBtns.config = true; //配置
172
+          break;
173
+        case "publish":
174
+          coopBtns.publish = true; //发布
175
+          break;
176
+        case "reset":
177
+          coopBtns.reset = true; //重置
178
+          break;
174 179
       }
175 180
     });
176 181
     console.log(coopBtns);
@@ -189,4 +194,39 @@ export class ToolService {
189 194
       postData
190 195
     );
191 196
   }
197
+
198
+  /**
199
+   * @description: 扁平化结构转成树形结构
200
+   * @param {*} list 扁平化的数组
201
+   * @param {*} rootValue 顶级parentKeyName的值
202
+   * @param {*} parentKeyName 父级字段名称
203
+   * @param {*} keyName 字段名称
204
+   * @return {*} 返回树形结构
205
+   * @author: seimin
206
+   */
207
+  tranListToTreeData(list:Array<any>, rootValue:any, parentKeyName:string, keyName:string = 'id'):Array<any> {
208
+    return list.filter((t) =>
209
+      t[parentKeyName] === rootValue
210
+        ? (t.children = this.tranListToTreeData(list, t[keyName], parentKeyName, keyName))
211
+        : false
212
+    );
213
+  }
214
+
215
+  /**
216
+   * @description: 树形结构转扁平化结构
217
+   * @param {*} tree 树形结构
218
+   * @return {*} 返回扁平化结构
219
+   * @author: seimin
220
+   */
221
+  tranTreeToListData(tree: Array<any>): Array<any> {
222
+    let res: Array<any> = [];
223
+    for (const item of tree) {
224
+      const { children, ...i } = item;
225
+      if (children && children.length) {
226
+        res = res.concat(this.tranTreeToListData(children));
227
+      }
228
+      res.push(i);
229
+    }
230
+    return res;
231
+  }
192 232
 }

+ 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">批量关联科室<span class="red">(没有楼栋的科室无法查询到)</span><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
+}

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

@@ -0,0 +1,169 @@
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
+        bussType: 'inspection',
147
+        noBuilding: '查询无楼栋科室',
148
+      }
149
+    }
150
+    this.hsLoading = true;
151
+    this.mainService.getFetchDataList("data", "department", postData).subscribe(data => {
152
+      this.hsLoading = false;
153
+      this.historySpecimenList = data.list || [];
154
+      this.historySpecimenListLength = data.totalNum || 0;
155
+    })
156
+  }
157
+  // 添加表单提交
158
+  btnLoading: boolean = false; //提交按钮loading状态
159
+  submitForm(): void {
160
+    console.log(this.checkedDepIds);
161
+    if(this.checkedDepIds.length === 0){
162
+      this.message.warning('请选择科室');
163
+      return;
164
+    }
165
+    this.confirmModelHs.emit(this.checkedDepIds);//emits(向上弹射)事件
166
+  }
167
+}
168
+
169
+

+ 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
+}

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

@@ -0,0 +1,121 @@
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
+        modelType: { value: 'inspection' },
53
+      },
54
+      idx: 0,
55
+      sum: 50,
56
+    };
57
+    this.mainService
58
+      .getFetchDataList("simple/data", "tag", postData)
59
+      .subscribe((data) => {
60
+        this.tagList = data.list;
61
+        this.tagListCopy = JSON.parse(JSON.stringify(this.tagList));
62
+        this.isLoading = false;
63
+      });
64
+  }
65
+
66
+  // 选择标签
67
+  changeTags(tags){
68
+    if(tags.length){
69
+      let flag = tags.every(v => {
70
+        return this.tagListCopy.map(vv => vv.name).includes(v);
71
+      })
72
+
73
+      if(flag){
74
+        return;
75
+      }
76
+
77
+      let tagName = tags[tags.length - 1];
78
+      let postData = {
79
+        tag: {
80
+          name: tagName,
81
+          hosId: this.currentHospital.id,
82
+          modelType: { value: 'inspection' },
83
+        }
84
+      }
85
+      this.isLoading = true;
86
+      this.mainService
87
+      .coopData("addData", "tag", postData)
88
+      .subscribe((result) => {
89
+        this.isLoading = false;
90
+        console.log(result);
91
+        if(result.status == 200){
92
+          this.tagListCopy.unshift(result.data)
93
+          console.log(this.tagListCopy);
94
+        } else if (result.status == 10001){
95
+          // 名称重复
96
+          this.tagListCopy.unshift(result.data)
97
+          console.log(this.tagListCopy);
98
+        } else {
99
+          tags.pop();
100
+          this.message.warning(result.msg || '请求数据失败')
101
+        }
102
+      });
103
+    }
104
+  }
105
+  // 表单提交
106
+  submitForm(): void {
107
+    for (const i in this.validateForm.controls) {
108
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
109
+      this.validateForm.controls[i].updateValueAndValidity();
110
+    }
111
+    if (this.validateForm.invalid) return;
112
+
113
+    let tagNames = this.validateForm.value.tagIds;
114
+    let tags = this.tagListCopy;
115
+    let tagIds = tagNames.map(name =>{
116
+      return tags.find(v => v.name === name).id;
117
+    })
118
+    this.submitFormHand.emit(tagIds);
119
+  }
120
+}
121
+

+ 85 - 0
src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.html

@@ -0,0 +1,85 @@
1
+<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
2
+  <div class="modalBody">
3
+    <div class="title">
4
+      选择项配置
5
+      <button class="add" nz-button nzType="primary" nzGhost (click)="addField()">
6
+        添加
7
+      </button>
8
+      <i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
9
+    </div>
10
+    <div class="content">
11
+      <form nz-form [formGroup]="validateForm" class="w100">
12
+        <nz-table class="hospitalTable" [nzData]="historySpecimenList" nzSize="middle" [nzShowPagination]="false"
13
+          [nzLoading]="hsLoading">
14
+          <thead>
15
+            <tr class="thead">
16
+              <th nzWidth="30%">选项名称</th>
17
+              <th nzWidth="10%">排序号</th>
18
+              <th nzWidth="15%">默认选中</th>
19
+              <th nzWidth="30%">异常标记</th>
20
+              <th nzWidth="15%">操作</th>
21
+            </tr>
22
+          </thead>
23
+          <tbody>
24
+            <tr *ngFor="let data of historySpecimenList;let i = index;">
25
+              <td>
26
+                <nz-form-item>
27
+                  <nz-form-control [nzSpan]="24" nzErrorTip="请输入选项名称!">
28
+                    <nz-input-group>
29
+                      <input [formControlName]="'name_' + data.id" nz-input placeholder="请输入选项名称">
30
+                    </nz-input-group>
31
+                  </nz-form-control>
32
+                </nz-form-item>
33
+              </td>
34
+              <td>
35
+                <nz-form-item>
36
+                  <nz-form-control [nzSpan]="24" nzErrorTip="请输入排序号!">
37
+                    <nz-input-group>
38
+                      <nz-input-number [formControlName]="'orders_' + data.id" nzPlaceHolder="排序号"></nz-input-number>
39
+                    </nz-input-group>
40
+                  </nz-form-control>
41
+                </nz-form-item>
42
+              </td>
43
+              <td>
44
+                <nz-form-item>
45
+                  <nz-form-control [nzSpan]="24">
46
+                    <label nz-checkbox [formControlName]="'checkDefault_' + data.id"></label>
47
+                  </nz-form-control>
48
+                </nz-form-item>
49
+              </td>
50
+              <td>
51
+                <nz-form-item>
52
+                  <nz-form-control [nzSpan]="24" nzErrorTip="请选择异常标记!">
53
+                    <nz-radio-group [formControlName]="'exception_' + data.id">
54
+                      <label style="width: 130px;text-align: left;" nz-radio [nzValue]="1">选中标记异常</label>
55
+                      <label nz-radio [nzValue]="0">未选中标记异常</label>
56
+                    </nz-radio-group>
57
+                  </nz-form-control>
58
+                </nz-form-item>
59
+              </td>
60
+              <td>
61
+                <div class="coop">
62
+                  <span (click)="removeField(data, i)">删除</span>
63
+                </div>
64
+              </td>
65
+            </tr>
66
+          </tbody>
67
+        </nz-table>
68
+      </form>
69
+      <!-- <div class="pagination">
70
+        <nz-pagination [(nzPageIndex)]="historySpecimenPageIndex" [(nzTotal)]="historySpecimenListLength"
71
+          [(nzPageSize)]="historySpecimenPageSize" (nzPageIndexChange)="getList()"
72
+          (nzPageSizeChange)="getList()">
73
+        </nz-pagination>
74
+      </div> -->
75
+    </div>
76
+    <div class="display_flex justify-content_flex-center">
77
+      <button class="btn know" [nzLoading]="btnLoading" nz-button nzType="primary" (click)="submitForm()">
78
+        批量保存
79
+      </button>
80
+      <button class="btn know" nz-button nzType="primary" nzGhost (click)="hideModal()">
81
+        取消
82
+      </button>
83
+    </div>
84
+  </div>
85
+</div>

+ 211 - 0
src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.less

@@ -0,0 +1,211 @@
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
+  ::ng-deep .ant-form-item{
11
+    margin-bottom: 0;
12
+  }
13
+  ::ng-deep .ant-radio-group{
14
+    line-height: normal;
15
+  }
16
+  ::ng-deep .ant-form-item-control{
17
+    line-height: normal;
18
+  }
19
+  ::ng-deep .ant-input-number-input{
20
+    text-align: center;
21
+  }
22
+  .hospitalTable {
23
+    width: 100%;
24
+    .coop {
25
+      button{
26
+        color: #333;
27
+      }
28
+      span,button {
29
+        display: inline-block;
30
+        padding: 0 8px;
31
+        cursor: pointer;
32
+        position: relative;
33
+
34
+        &::after {
35
+          content: "|";
36
+          position: absolute;
37
+          top: 0;
38
+          right: 0;
39
+        }
40
+
41
+        &:hover,
42
+        &:active {
43
+          color: @primary-color;
44
+        }
45
+
46
+        &:nth-last-child(1) {
47
+          &::after {
48
+            content: "";
49
+          }
50
+        }
51
+      }
52
+    }
53
+    td {
54
+      text-align: center !important;
55
+    }
56
+    .thead {
57
+      background-image: linear-gradient(to right, @bg-start, @bg-end);
58
+      th {
59
+        text-align: center !important;
60
+        color: #fff;
61
+        background: transparent;
62
+      }
63
+    }
64
+  }
65
+
66
+  .modalBody {
67
+    width: 784px;
68
+    min-height: 220px;
69
+    background: #fff;
70
+    border-radius: 5px;
71
+    padding: 10px 20px;
72
+    color: #333;
73
+    &.modalBody-search {
74
+      width: 480px;
75
+      min-height: 250px;
76
+    }
77
+
78
+    .title {
79
+      width: 100%;
80
+      text-align: center;
81
+      font-size: 18px;
82
+      position: relative;
83
+
84
+      .add{
85
+        margin-top: 0;
86
+        position: absolute;
87
+        right: 46px;
88
+        top: 0;
89
+      }
90
+
91
+      i {
92
+        position: absolute;
93
+        right: 0;
94
+        top: 0;
95
+        font-size: 20px;
96
+        color: #666;
97
+        cursor: pointer;
98
+        padding: 0 5px;
99
+      }
100
+    }
101
+
102
+    .content {
103
+      min-height: 117px;
104
+      background: #f9fafb;
105
+      border: 1px solid #e5e9ed;
106
+      border-radius: 5px;
107
+      overflow: hidden;
108
+      margin-top: 12px;
109
+      display: flex;
110
+      flex-direction: column;
111
+      justify-content: center;
112
+      align-items: center;
113
+      &.content-search {
114
+        min-height: 147px;
115
+        justify-content: start;
116
+        .defeat-search {
117
+          width: 100%;
118
+          height: 52px;
119
+          display: flex;
120
+          justify-content: center;
121
+          align-items: center;
122
+          border-bottom: solid 1px #e5e9ed;
123
+          em {
124
+            color: #666;
125
+            font-style: normal;
126
+          }
127
+        }
128
+        .form {
129
+          width: 100%;
130
+          padding: 0 16px;
131
+          .ant-form-item-label,
132
+          .ant-form-explain {
133
+            text-align: left !important;
134
+          }
135
+        }
136
+      }
137
+
138
+      div {
139
+        text-align: center;
140
+        margin: 0;
141
+
142
+        &.defeat {
143
+          color: #333;
144
+          font-size: 28px;
145
+        }
146
+        &.countDown {
147
+          font-size: 14px;
148
+          color: 666;
149
+          em {
150
+            font-style: normal;
151
+            color: @primary-color;
152
+          }
153
+        }
154
+
155
+        &:nth-child(3) {
156
+          font-size: 14px;
157
+          color: #666;
158
+          padding-bottom: 10px;
159
+        }
160
+      }
161
+    }
162
+
163
+    button {
164
+      margin-top: 10px;
165
+
166
+      &.btn {
167
+        margin-left: 8px;
168
+      }
169
+    }
170
+  }
171
+
172
+  // 新增
173
+  &.add {
174
+    .modalBody {
175
+      width: 480px;
176
+      height: auto;
177
+
178
+      .content {
179
+        width: 100%;
180
+        height: auto;
181
+        padding: 18px 14px 0 14px;
182
+
183
+        .addForm {
184
+          .ant-form-item {
185
+            margin-bottom: 15px;
186
+
187
+            .ant-form-item-label {
188
+              line-height: 0;
189
+            }
190
+          }
191
+        }
192
+
193
+        .editForm {
194
+          .ant-form-item {
195
+            margin-bottom: 15px;
196
+
197
+            .ant-form-item-label {
198
+              line-height: 0;
199
+            }
200
+          }
201
+        }
202
+      }
203
+
204
+      button {
205
+        &:nth-child(1) {
206
+          margin-right: 20px;
207
+        }
208
+      }
209
+    }
210
+  }
211
+}

+ 193 - 0
src/app/share/inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component.ts

@@ -0,0 +1,193 @@
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 { FormGroup, Validators, FormBuilder, FormControl } from '@angular/forms';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import countBy from 'lodash-es/countBy';
7
+import { v4 as uuidv4 } from 'uuid';
8
+
9
+@Component({
10
+  selector: 'app-inspection-configuration-item-prompt-modal',
11
+  templateUrl: './inspection-configuration-item-prompt-modal.component.html',
12
+  styleUrls: ['./inspection-configuration-item-prompt-modal.component.less']
13
+})
14
+export class InspectionConfigurationItemPromptModalComponent implements OnInit {
15
+  // 切换科室,切换弹窗
16
+  hsLoading = false;
17
+  historySpecimenList: any = [];
18
+  historySpecimenPageIndex: number = 1;//表格当前页码
19
+  historySpecimenPageSize: number = 9999;//表格每页展示条数
20
+  historySpecimenListLength: number = 10;//表格总数据量
21
+
22
+  currentHospital; //当前院区
23
+  validateForm: FormGroup; //新增/编辑表单
24
+  @Input() show: Boolean;
25
+  @Input() coopData: any;
26
+
27
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
28
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
29
+
30
+  constructor(
31
+    private mainService: MainService,
32
+    private tool: ToolService,
33
+    private fb: FormBuilder,
34
+    private message: NzMessageService,
35
+  ) { }
36
+
37
+  ngOnInit() {
38
+    this.initForm();
39
+    this.currentHospital = this.tool.getCurrentHospital();
40
+    this.getList();
41
+  }
42
+
43
+  // 初始化新增form表单
44
+  initForm() {
45
+    this.validateForm = this.fb.group({
46
+      // name: [null, [Validators.required]],//选项名称
47
+      // orders: [null, [Validators.required]],//排序号
48
+      // checkDefault: [false],//是否默认选中
49
+      // exception: [null, [Validators.required]],//异常标记
50
+    });
51
+    console.log(this.validateForm.controls)
52
+  }
53
+
54
+  // 添加表单提交
55
+  btnLoading: boolean = false; //提交按钮loading状态
56
+  submitForm(): void {
57
+    console.log(this.coopData)
58
+    for (const i in this.validateForm.controls) {
59
+      this.validateForm.controls[i].markAsDirty();
60
+      this.validateForm.controls[i].updateValueAndValidity();
61
+    }
62
+    if (this.validateForm.invalid) {
63
+      return;
64
+    }
65
+    if(Object.keys(this.validateForm.value).length === 0){
66
+      this.message.warning('请至少填写一个选择项');
67
+      return;
68
+    }
69
+    console.log(this.validateForm.value);
70
+    let postData:any = {};
71
+
72
+    //增加
73
+    postData = {
74
+      itemId: this.coopData.id,
75
+      configList: [],
76
+    };
77
+    for (let i = 0; i < this.historySpecimenList.length; i++) {
78
+      postData.configList.push({
79
+        name: this.validateForm.value['name_' + this.historySpecimenList[i].id],
80
+        valuex: this.validateForm.value['name_' + this.historySpecimenList[i].id],
81
+        orders: this.validateForm.value['orders_' + this.historySpecimenList[i].id],
82
+        checkDefault: this.validateForm.value['checkDefault_' + this.historySpecimenList[i].id] ? 1 : 0,
83
+        checkException: this.validateForm.value['exception_' + this.historySpecimenList[i].id],
84
+        uncheckException: this.validateForm.value['exception_' + this.historySpecimenList[i].id] === 1 ? 0 : 1,
85
+      })
86
+    }
87
+    // 下拉框只允许勾选一个默认选中
88
+    if((this.coopData.type.value === '1' || this.coopData.type.value === '2') && countBy(postData.configList, 'checkDefault')[1] > 1){
89
+      this.message.warning(`${this.coopData.type.name}只允许勾选一个默认选中`);
90
+      return;
91
+    }
92
+    console.log(postData);
93
+    this.btnLoading = true;
94
+    this.mainService
95
+      .inspectionPost("bindFormItem", postData)
96
+      .subscribe((result) => {
97
+        this.btnLoading = false;
98
+        if (result.status == 200) {
99
+          this.hideModal();
100
+          this.initForm();
101
+          this.message.success('批量保存成功');
102
+          this.confirmModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
103
+        } else {
104
+          this.message.error(result.msg || '批量保存失败');
105
+        }
106
+      });
107
+  }
108
+
109
+  // 关闭弹窗
110
+  hideModal() {
111
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
112
+  }
113
+
114
+  // 添加
115
+  addField(): void {
116
+    let obj = {
117
+      id: uuidv4(),
118
+      name: null,
119
+      orders: null,
120
+      checkDefault: false,
121
+      exception: null,
122
+    };
123
+
124
+    // 动态添加表单
125
+    for (const key in obj) {
126
+      console.log(key + '_' + obj.id)
127
+      if(key === 'checkDefault'){
128
+        this.validateForm.addControl(key + '_' + obj.id, new FormControl(false))
129
+      }else if(key !== 'id'){
130
+        this.validateForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
131
+      }
132
+    }
133
+
134
+    this.historySpecimenList = [
135
+      ...this.historySpecimenList,
136
+      obj,
137
+    ]
138
+  }
139
+
140
+  // 删除
141
+  removeField(obj, i:number): void {
142
+    console.log(i);
143
+    this.historySpecimenList.splice(i, 1);
144
+    this.historySpecimenList = [...this.historySpecimenList];
145
+    // 动态删除表单
146
+    for (const key in obj) {
147
+      this.validateForm.removeControl(key + '_' + obj.id);
148
+    }
149
+  }
150
+
151
+  // 获取列表数据
152
+  getList(idx?) {
153
+    if (idx) {
154
+      this.historySpecimenPageIndex = 1;
155
+    }
156
+    let postData = {
157
+      idx: this.historySpecimenPageIndex - 1,
158
+      sum: this.historySpecimenPageSize,
159
+      inspectionFormItemConfig: {
160
+        itemId: this.coopData.id,
161
+        hosId: this.currentHospital.id,
162
+      }
163
+    }
164
+    this.hsLoading = true;
165
+    this.mainService.getFetchDataList('simple/data','inspectionFormItemConfig',postData).subscribe(data => {
166
+      this.hsLoading = false;
167
+      let list = data.list || [];
168
+      this.historySpecimenList = list.map(v => {
169
+        return {
170
+          id: uuidv4(),
171
+          name: v.name || null,
172
+          orders: v.orders || null,
173
+          checkDefault: v.checkDefault || false,
174
+          exception: v.checkException === 1 ? 1 : (v.uncheckException === 1 ? 0 : null),
175
+        }
176
+      });
177
+      console.log(this.historySpecimenList);
178
+      // 动态添加表单
179
+      this.historySpecimenList.forEach((obj, i) => {
180
+        for (const key in obj) {
181
+          if(key === 'checkDefault'){
182
+            this.validateForm.addControl(key + '_' + obj.id, new FormControl(obj[key]))
183
+          }else if(key !== 'id'){
184
+            this.validateForm.addControl(key + '_' + obj.id, new FormControl(obj[key], [Validators.required]))
185
+          }
186
+        }
187
+      })
188
+      this.historySpecimenListLength = data.totalNum || 0;
189
+    })
190
+  }
191
+}
192
+
193
+

+ 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
+

+ 145 - 0
src/app/share/inspection-execute-detail/inspection-execute-detail.component.html

@@ -0,0 +1,145 @@
1
+<div class="detail" *ngIf="!maskFlag">
2
+  <div class="title">
3
+    查看详情<i class="icon_transport transport-guanbi" (click)="close()"></i>
4
+  </div>
5
+  <div class="box">
6
+    <div class="tab display_flex">
7
+      <div
8
+        [ngClass]="{ item: true, flex_1: true, checked: tabType == 1 }"
9
+        (click)="checkTab(1)"
10
+      >
11
+        基础信息
12
+      </div>
13
+      <div [ngClass]="{ item: true, flex_1: true, checked: tabType == 2 }" (click)="checkTab(2)" *ngIf="orderInfo.status.value === '2'">
14
+        巡检信息
15
+      </div>
16
+      <div
17
+        [ngClass]="{ item: true, flex_1: true, checked: tabType == 4 }"
18
+        (click)="checkTab(4)"
19
+      >
20
+        日志
21
+      </div>
22
+    </div>
23
+
24
+    <!-- 基础信息 -->
25
+    <overlay-scrollbars
26
+      #osComponentRef1
27
+      style="flex: 1"
28
+      *ngIf="tabType == 1"
29
+    >
30
+      <div class="content orders">
31
+        <div class="inner">
32
+          <div class="top">
33
+            <div class="info" nz-row>
34
+              <div nz-col nzSpan="8">
35
+                单号:{{ orderInfo.code }}
36
+              </div>
37
+              <div nz-col nzSpan="8">
38
+                计划主题:{{ orderInfo.inspectionDTO?.name }}
39
+              </div>
40
+              <div nz-col nzSpan="8">
41
+                批次号:{{ orderInfo.batchNo }}
42
+              </div>
43
+            </div>
44
+          </div>
45
+          <div class="top">
46
+            <div class="info" nz-row>
47
+              <div nz-col nzSpan="8">
48
+                巡检点:{{ orderInfo.inspectionNodeDTO?.name }}
49
+              </div>
50
+              <div nz-col nzSpan="8">
51
+                巡检单:{{ orderInfo.inspectionDTO?.inspectionFormDTO?.name }}
52
+              </div>
53
+              <div nz-col nzSpan="8">
54
+                创建时间:{{ orderInfo.addTime | date:'yyyy-MM-dd HH:mm' }}
55
+              </div>
56
+            </div>
57
+          </div>
58
+          <div class="top">
59
+            <div class="info" nz-row>
60
+              <div nz-col nzSpan="8">
61
+                签到方式:{{ orderInfo.signType?.name }}
62
+              </div>
63
+              <div nz-col nzSpan="8">
64
+                执行人:{{ orderInfo.userDTO?.name || orderInfo.groupDTO?.groupName }}
65
+              </div>
66
+              <div nz-col nzSpan="8">
67
+                状态:{{ orderInfo.status?.name }}
68
+              </div>
69
+            </div>
70
+          </div>
71
+          <div class="top">
72
+            <div class="info" nz-row>
73
+              <div nz-col nzSpan="8">
74
+                截至时间:{{ orderInfo.overtime | date:'yyyy-MM-dd HH:mm' }}
75
+              </div>
76
+              <div nz-col nzSpan="8">
77
+                完成时间:{{ orderInfo.completeTime | date:'yyyy-MM-dd HH:mm' }}
78
+              </div>
79
+              <div nz-col nzSpan="8">
80
+                是否异常:<span [ngClass]="orderInfo.exception === 1 ? 'red': ''">{{ orderInfo.exception === 1 ? '是' : '否' }}</span>
81
+              </div>
82
+            </div>
83
+          </div>
84
+        </div>
85
+      </div>
86
+    </overlay-scrollbars>
87
+    <!-- 巡检信息 -->
88
+    <overlay-scrollbars
89
+      #osComponentRef2
90
+      style="flex: 1"
91
+      *ngIf="tabType == 2"
92
+    >
93
+      <div class="content orders">
94
+        <div class="inner">
95
+          <div class="top" *ngFor="let item of valueList">
96
+            <div class="info" nz-row>
97
+              <div nz-col nzSpan="8" *ngFor="let value of item">
98
+                {{ value.name }}:<span [ngClass]="value.exception === 1 ? 'red': ''">{{ getValuex(value) }}</span>
99
+              </div>
100
+            </div>
101
+          </div>
102
+        </div>
103
+      </div>
104
+    </overlay-scrollbars>
105
+    <!-- 日志 -->
106
+    <overlay-scrollbars
107
+      #osComponentRef4
108
+      style="flex:1;"
109
+      *ngIf="tabType == 4"
110
+    >
111
+      <div class="content jifen">
112
+        <div class="table">
113
+          <nz-table class="integralTable" [nzData]="list" nzSize="middle" [nzShowPagination]="null" [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
114
+            <thead>
115
+              <tr class="thead">
116
+                <th nzWidth="8%">序号</th>
117
+                <th nzWidth="23%">操作动作</th>
118
+                <th nzWidth="23%">操作时间</th>
119
+                <th nzWidth="23%">操作人</th>
120
+                <th nzWidth="23%">备注</th>
121
+              </tr>
122
+            </thead>
123
+            <tbody>
124
+              <tr *ngFor="let item of list; let i = index">
125
+                <td>{{ i + 1 }}</td>
126
+                <td>{{ item.operationType?.name }}</td>
127
+                <td>{{ item.operationTime | date:'yyyy-MM-dd HH:mm' }}</td>
128
+                <td>{{ item.username }}</td>
129
+                <td>{{ item.remarks }}</td>
130
+              </tr>
131
+            </tbody>
132
+          </nz-table>
133
+        </div>
134
+      </div>
135
+    </overlay-scrollbars>
136
+  </div>
137
+  <div class="btns">
138
+    <button class="btn cancel" nz-button nzType="default" (click)="close()">
139
+      关闭
140
+    </button>
141
+  </div>
142
+</div>
143
+
144
+<!-- 遮罩 -->
145
+<app-mask *ngIf="maskFlag"></app-mask>

+ 544 - 0
src/app/share/inspection-execute-detail/inspection-execute-detail.component.less

@@ -0,0 +1,544 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  height: 100%;
5
+  position: fixed;
6
+  left: 0;
7
+  top: 0;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 99;
10
+
11
+  display: flex;
12
+  justify-content: center;
13
+  align-items: center;
14
+}
15
+
16
+.detail {
17
+  display: flex;
18
+  flex-direction: column;
19
+  width: 1200px;
20
+  // min-height: 580px;
21
+  border-radius: 5px;
22
+  background: #fff;
23
+  color: #333;
24
+  font-size: 14px;
25
+  padding: 12px 20px;
26
+  position: relative;
27
+  padding-bottom: 70px;
28
+
29
+  .pagination{
30
+    margin: 8px;
31
+    text-align: right;
32
+  }
33
+
34
+  .title {
35
+    font-size: 18px;
36
+    text-align: center;
37
+    line-height: 24px;
38
+    margin: 0;
39
+    margin-bottom: 12px;
40
+    position: relative;
41
+
42
+    i {
43
+      position: absolute;
44
+      right: 0;
45
+      top: 0;
46
+      font-size: 20px;
47
+      color: #666;
48
+      cursor: pointer;
49
+      padding: 0 5px;
50
+    }
51
+  }
52
+
53
+  & > .box {
54
+    width: 1160px;
55
+    border: 1px solid #e5e9ed;
56
+    border-radius: 5px;
57
+    flex: 1;
58
+    overflow: hidden;
59
+    display: flex;
60
+    flex-direction: column;
61
+
62
+    .tab {
63
+      width: 100%;
64
+      height: 60px;
65
+      border-bottom: 1px solid #e5e9ed;
66
+
67
+      .item {
68
+        cursor: pointer;
69
+        text-align: center;
70
+        line-height: 60px;
71
+        height: 100%;
72
+        border-right: 1px solid #e5e9ed;
73
+
74
+        &:nth-last-child(1) {
75
+          border: none;
76
+        }
77
+
78
+        &.checked {
79
+          background: #F0F6ED;
80
+        }
81
+      }
82
+    }
83
+
84
+    .content {
85
+      width: 100%;
86
+      // min-height: 453px;
87
+      display: flex;
88
+      flex-direction: column;
89
+
90
+      &.orders {
91
+        background: #fff;
92
+        padding: 16px;
93
+        .inner{
94
+          background: #f9fafb;
95
+          border-radius: 8px;
96
+          width: 100%;
97
+          border: 1px solid #D9D9D9;
98
+          overflow: hidden;
99
+          padding: 10px 0;
100
+        }
101
+      }
102
+
103
+      & .top {
104
+        padding: 10px 32px;
105
+        overflow: hidden;
106
+
107
+        .num {
108
+          font-size: 16px;
109
+          overflow: hidden;
110
+          margin-bottom: 6px;
111
+
112
+          .left {
113
+            float: left;
114
+            font-weight: 600;
115
+          }
116
+
117
+          .right {
118
+            float: right;
119
+          }
120
+        }
121
+
122
+        .info {
123
+          color: #666;
124
+
125
+          .jiaji {
126
+            margin: 0;
127
+            margin-top: 8px;
128
+          }
129
+        }
130
+      }
131
+
132
+      & > .center {
133
+        padding: 27px 0 17px 0;
134
+        border-bottom: 1px solid #e5e9ed;
135
+        font-size: 12px;
136
+        background: #fff;
137
+
138
+        .box {
139
+          display: flex;
140
+          justify-content: center;
141
+
142
+          .steps {
143
+            &:nth-last-child(1) {
144
+              .line {
145
+                display: none !important;
146
+              }
147
+            }
148
+
149
+            .step {
150
+              .info {
151
+                width: 90px;
152
+                text-align: center;
153
+                display: inline-block;
154
+                vertical-align: top;
155
+
156
+                i {
157
+                  color: #e5e9ed;
158
+
159
+                  &.green {
160
+                    color: @primary-color;
161
+                  }
162
+                }
163
+              }
164
+
165
+              p {
166
+                margin: 0;
167
+              }
168
+
169
+              .line {
170
+                display: inline-block;
171
+                width: 60px;
172
+                height: 2px;
173
+                background: #e5e9ed;
174
+              }
175
+            }
176
+          }
177
+        }
178
+      }
179
+
180
+      & > .bottom {
181
+        flex: 1;
182
+        padding: 25px 32px;
183
+        background: #f9fafb;
184
+
185
+        .amplification {
186
+          display: flex;
187
+          justify-content: flex-end;
188
+          margin-bottom: 8px;
189
+        }
190
+
191
+        .urgent {
192
+          input {
193
+            width: 600px;
194
+          }
195
+
196
+          .candelBtn {
197
+            margin-left: 20px;
198
+          }
199
+        }
200
+
201
+        .table {
202
+          width: 100%;
203
+          height: 100%;
204
+          min-height: 160px;
205
+          background: #fff;
206
+          border-radius: 5px;
207
+
208
+          .thead {
209
+            background-image: repeating-linear-gradient(
210
+              to right,
211
+              @bg-start,
212
+              @bg-end 100%
213
+            ) !important;
214
+
215
+            th {
216
+              color: #fff !important;
217
+              text-align: center;
218
+              font-size: 12px;
219
+              border: none;
220
+            }
221
+          }
222
+
223
+          .detailDrugTable {
224
+            .thead {
225
+              background-image: repeating-linear-gradient(
226
+                to right,
227
+                @bg-start,
228
+                @bg-end 50%
229
+              ) !important;
230
+            }
231
+          }
232
+
233
+          .ant-table-tbody {
234
+            tr {
235
+              text-align: center;
236
+              font-size: 12px;
237
+              border: none;
238
+
239
+              td {
240
+                border: none;
241
+                position: relative;
242
+              }
243
+            }
244
+
245
+            tr:nth-child(2n) {
246
+              background: #f9fafb;
247
+            }
248
+          }
249
+        }
250
+
251
+        .info {
252
+          width: 100%;
253
+          height: 100%;
254
+          background: #fff;
255
+          border-radius: 5px;
256
+          border: 1px solid #e5e9ed;
257
+          padding: 24px 28px 14px 28px;
258
+          margin-bottom: 8px;
259
+
260
+          .top {
261
+            .left {
262
+              border-right: 1px dashed #e5e9ed;
263
+
264
+              p {
265
+                padding: 0 70px 0 102px;
266
+                overflow: hidden;
267
+
268
+                & > span:nth-child(1) {
269
+                  float: left;
270
+                }
271
+
272
+                & > span:nth-child(2) {
273
+                  float: right;
274
+                  color: #666;
275
+                  text-align: right;
276
+                  max-width: 175px;
277
+                }
278
+              }
279
+            }
280
+
281
+            .right {
282
+              p {
283
+                padding: 0 102px 0 70px;
284
+                overflow: hidden;
285
+
286
+                span:nth-child(1) {
287
+                  float: left;
288
+                }
289
+
290
+                span:nth-child(2) {
291
+                  float: right;
292
+                  color: #666;
293
+                  text-align: right;
294
+                }
295
+              }
296
+            }
297
+          }
298
+
299
+          .wait {
300
+            text-align: center;
301
+            margin-top: 7px;
302
+
303
+            i {
304
+              font-size: 24px;
305
+              color: #62c26d;
306
+            }
307
+
308
+            span {
309
+              color: #62c26d;
310
+            }
311
+          }
312
+        }
313
+      }
314
+
315
+      &.pingjia {
316
+        .msg {
317
+          width: 100%;
318
+          height: 50px;
319
+          line-height: 50px;
320
+          padding-left: 32px;
321
+          border-bottom: 1px solid #e5e9ed;
322
+
323
+          div {
324
+            display: inline-block;
325
+            margin-right: 100px;
326
+          }
327
+        }
328
+
329
+        .con {
330
+          padding: 16px 32px;
331
+          min-height: 360px;
332
+        }
333
+      }
334
+
335
+      & > .form {
336
+        .ant-form-item {
337
+          padding: 0 32px 13px 32px;
338
+          margin-bottom: 0;
339
+          border-bottom: 1px solid #e5e9ed;
340
+
341
+          &:nth-last-child(1) {
342
+            border: none;
343
+          }
344
+        }
345
+
346
+        .ant-form-item-label {
347
+          line-height: 34px;
348
+          text-align: left;
349
+        }
350
+      }
351
+
352
+      & > .mediation {
353
+        padding: 16px 32px;
354
+
355
+        .item {
356
+          border-bottom: 1px solid #e5e9ed;
357
+          padding-top: 10px;
358
+
359
+          .label {
360
+            line-height: 28px;
361
+            margin-top: 10px;
362
+          }
363
+
364
+          .info {
365
+            line-height: 28px;
366
+            color: #999;
367
+            padding-bottom: 20px;
368
+          }
369
+        }
370
+      }
371
+
372
+      &.jifen {
373
+        padding: 16px;
374
+
375
+        & > .table {
376
+          width: 100%;
377
+          height: 100%;
378
+          min-height: 160px;
379
+          padding: 6px;
380
+          background: #fff;
381
+          border: 1px solid #e5e9ed;
382
+          border-radius: 5px;
383
+          overflow: hidden;
384
+
385
+          .thead {
386
+            background-image: repeating-linear-gradient(
387
+              to right,
388
+              @bg-start,
389
+              @bg-end 100%
390
+            ) !important;
391
+
392
+            th {
393
+              color: #fff !important;
394
+              text-align: center;
395
+              font-size: 12px;
396
+              border: none;
397
+              background: transparent;
398
+            }
399
+          }
400
+
401
+          .ant-table-tbody {
402
+            tr {
403
+              text-align: center;
404
+              font-size: 12px;
405
+              border: none;
406
+
407
+              td {
408
+                border: none;
409
+              }
410
+            }
411
+
412
+            tr:nth-child(2n) {
413
+              background: #f9fafb;
414
+            }
415
+          }
416
+        }
417
+      }
418
+    }
419
+  }
420
+
421
+  .btns {
422
+    display: flex;
423
+    justify-content: center;
424
+    align-items: center;
425
+    width: 100%;
426
+    position: absolute;
427
+    left: 0;
428
+    bottom: 20px;
429
+
430
+    .btn {
431
+      margin: 9px;
432
+      margin-bottom: 0;
433
+    }
434
+  }
435
+
436
+  .ant-table {
437
+    border: none !important;
438
+  }
439
+}
440
+
441
+// 撤回工单
442
+.recallOrder {
443
+  position: fixed;
444
+  left: 0;
445
+  top: 0;
446
+  width: 100%;
447
+  height: 100%;
448
+
449
+  display: flex;
450
+  justify-content: center;
451
+  align-items: center;
452
+  background: rgba(0, 0, 0, 0.4);
453
+  z-index: 99;
454
+
455
+  .modalBody {
456
+    width: 350px;
457
+    height: 220px;
458
+    background: #fff;
459
+    border-radius: 5px;
460
+    padding: 10px 20px;
461
+    color: #333;
462
+
463
+    .title {
464
+      width: 100%;
465
+      text-align: center;
466
+      font-size: 18px;
467
+      position: relative;
468
+
469
+      i {
470
+        position: absolute;
471
+        right: 0;
472
+        top: 0;
473
+        font-size: 20px;
474
+        color: #666;
475
+        cursor: pointer;
476
+        padding: 0 5px;
477
+      }
478
+    }
479
+
480
+    .content {
481
+      width: 310px;
482
+      height: 117px;
483
+      background: #f9fafb;
484
+      border: 1px solid #e5e9ed;
485
+      border-radius: 5px;
486
+      overflow: hidden;
487
+      margin-top: 12px;
488
+
489
+      div {
490
+        text-align: center;
491
+        margin: 0;
492
+
493
+        &.icon {
494
+          margin-top: 17px;
495
+
496
+          i {
497
+            color: #ff3b53;
498
+            font-size: 30px !important;
499
+
500
+            &.transport-wenhao {
501
+              color: #f5a523;
502
+            }
503
+          }
504
+        }
505
+
506
+        &.defeat {
507
+          color: #333;
508
+          font-size: 18px;
509
+        }
510
+
511
+        &:nth-child(3) {
512
+          font-size: 14px;
513
+          color: #666;
514
+        }
515
+      }
516
+
517
+      .conditions {
518
+        padding: 16px 20px;
519
+
520
+        div {
521
+          text-align: left;
522
+        }
523
+      }
524
+    }
525
+
526
+    button {
527
+      margin-top: 10px;
528
+
529
+      &.btn {
530
+        margin-left: 8px;
531
+      }
532
+    }
533
+  }
534
+}
535
+
536
+.txtC {
537
+  text-align: center;
538
+}
539
+.ji {
540
+  position: absolute;
541
+  right: 0px;
542
+  top: -3px;
543
+  width: 30px;
544
+}

+ 110 - 0
src/app/share/inspection-execute-detail/inspection-execute-detail.component.ts

@@ -0,0 +1,110 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { MainService } from "../../services/main.service";
4
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
5
+import { NzMessageService } from "ng-zorro-antd";
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import chunk from 'lodash-es/chunk'
8
+@Component({
9
+  selector: "app-inspection-execute-detail",
10
+  templateUrl: "./inspection-execute-detail.component.html",
11
+  styleUrls: ["./inspection-execute-detail.component.less"],
12
+})
13
+export class InspectionExecuteDetailComponent implements OnInit {
14
+  @ViewChild("osComponentRef1", {
15
+    read: OverlayScrollbarsComponent,
16
+    static: false,
17
+  })
18
+  osComponentRef1: OverlayScrollbarsComponent;
19
+  @ViewChild("osComponentRef2", {
20
+    read: OverlayScrollbarsComponent,
21
+    static: false,
22
+  })
23
+  osComponentRef2: OverlayScrollbarsComponent;
24
+  @ViewChild("osComponentRef4", {
25
+    read: OverlayScrollbarsComponent,
26
+    static: false,
27
+  })
28
+  osComponentRef4: OverlayScrollbarsComponent;
29
+  constructor(
30
+    private message: NzMessageService,
31
+    private route: ActivatedRoute,
32
+    private mainService: MainService,
33
+    private tool: ToolService,
34
+  ) {}
35
+  maskFlag: any = false;
36
+  id: number; //id
37
+  orderInfo: any; //详情信息
38
+  hosId;
39
+
40
+  ngOnInit() {
41
+    this.hosId = this.tool.getCurrentHospital().id;
42
+    this.tabType = this.route.snapshot.params.type || 1;
43
+    this.getInfo();
44
+  }
45
+
46
+  getValuex(value){
47
+    return value.formItemConfigList ? value.formItemConfigList.map(v => v.valuex).toString() : value.valuex;
48
+  }
49
+
50
+  // 获取详情
51
+  hsLoading:boolean = false;
52
+  getInfo() {
53
+    this.id = +this.route.snapshot.paramMap.get("id");
54
+    this.maskFlag = this.message.loading("正在加载中..", {
55
+      nzDuration: 0,
56
+    }).messageId;
57
+    this.mainService
58
+      .getFetchData("simple/data", "inspectionTask", this.id)
59
+      .subscribe((data) => {
60
+        this.orderInfo = data.data || {};
61
+        this.list = this.orderInfo.logList || [];
62
+        this.message.remove(this.maskFlag);
63
+        this.maskFlag = false;
64
+      });
65
+  }
66
+
67
+  // 获取巡检信息
68
+  valueList:any[] = [];
69
+  getValue() {
70
+    this.id = +this.route.snapshot.paramMap.get("id");
71
+    this.maskFlag = this.message.loading("正在加载中..", {
72
+      nzDuration: 0,
73
+    }).messageId;
74
+    let postData = {
75
+      idx: 0,
76
+      sum: 9999,
77
+      inspectionFormValues: {
78
+        taskId: this.id,
79
+      }
80
+    }
81
+    this.mainService
82
+      .getFetchDataList("simple/data", "inspectionFormValues", postData)
83
+      .subscribe((data) => {
84
+        let valueList = data.list || [];
85
+        this.valueList = chunk(valueList, 3);
86
+        this.message.remove(this.maskFlag);
87
+        this.maskFlag = false;
88
+      });
89
+  }
90
+
91
+  // 获取列表
92
+  pageIndex: number = 1;//表格当前页码
93
+  pageSize: number = 10;//表格每页展示条数
94
+  total: number = 0;//表格总数据量
95
+  list: any = [];
96
+  // 切换tab栏
97
+  tabType: number = 1; //tab栏
98
+  checkTab(type) {
99
+    this.tabType = type;
100
+    if(type === 2){
101
+      this.getValue();
102
+    }
103
+  }
104
+
105
+  // 关闭弹框
106
+  close() {
107
+    history.go(-1);
108
+  }
109
+
110
+}

+ 87 - 0
src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.html

@@ -0,0 +1,87 @@
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="20%">模板名称</th>
48
+                <th nzWidth="60%">操作时间</th>
49
+                <th nzWidth="20%">操作</th>
50
+              </tr>
51
+            </thead>
52
+            <tbody>
53
+              <tr *ngFor="let data of historySpecimenList;let i = index;">
54
+                <td>{{ data.name }}</td>
55
+                <td>{{ data.addTime | date: 'yyyy-MM-dd HH:mm' }}</td>
56
+                <td>
57
+                  <div class="coop">
58
+                    <span (click)="bringIn(data)">引入</span>
59
+                    <span (click)="showDelModal(data,'您确认要删除此模板吗?','删除','del')">删除</span>
60
+                  </div>
61
+                </td>
62
+              </tr>
63
+            </tbody>
64
+          </nz-table>
65
+          <div class="list-template__pagination">
66
+            <nz-pagination [(nzPageIndex)]="historySpecimenPageIndex" [(nzTotal)]="historySpecimenListLength"
67
+              [(nzPageSize)]="historySpecimenPageSize" (nzPageIndexChange)="getList()"
68
+              (nzPageSizeChange)="getList()" nzShowSizeChanger [nzPageSizeOptions]="[10,100]">
69
+            </nz-pagination>
70
+          </div>
71
+        </div>
72
+      </div>
73
+    </div>
74
+    <div class="display_flex justify-content_flex-center">
75
+      <button class="btn know" nz-button nzType="primary" (click)="hideModal()">
76
+        知道了
77
+      </button>
78
+    </div>
79
+  </div>
80
+</div>
81
+<!-- 模态框 -->
82
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
83
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
84
+<!-- 操作成功/失败提示框 -->
85
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
86
+  [info]="promptInfo">
87
+</app-prompt-modal>

+ 190 - 0
src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.less

@@ -0,0 +1,190 @@
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
+  .coop {
26
+    text-align: center;
27
+    button{
28
+      color: #333;
29
+    }
30
+    span,button {
31
+      display: inline-block;
32
+      padding: 0 8px;
33
+      cursor: pointer;
34
+      position: relative;
35
+
36
+      &::after {
37
+        content: "|";
38
+        position: absolute;
39
+        top: 0;
40
+        right: 0;
41
+      }
42
+
43
+      &:hover,
44
+      &:active {
45
+        color: @primary-color;
46
+      }
47
+
48
+      &:nth-last-child(1) {
49
+        &::after {
50
+          content: "";
51
+        }
52
+      }
53
+    }
54
+  }
55
+
56
+  .modalBody {
57
+    width: 950px;
58
+    min-height: 220px;
59
+    background: #fff;
60
+    border-radius: 5px;
61
+    padding: 10px 20px;
62
+    color: #333;
63
+    &.modalBody-search {
64
+      width: 480px;
65
+      min-height: 250px;
66
+    }
67
+
68
+    .title {
69
+      width: 100%;
70
+      text-align: center;
71
+      font-size: 18px;
72
+      position: relative;
73
+
74
+      i {
75
+        position: absolute;
76
+        right: 0;
77
+        top: 0;
78
+        font-size: 20px;
79
+        color: #666;
80
+        cursor: pointer;
81
+        padding: 0 5px;
82
+      }
83
+    }
84
+
85
+    .list-template{
86
+      padding: 0!important;
87
+    }
88
+
89
+    .list-template__bottom{
90
+      border: none!important;
91
+    }
92
+
93
+    .content {
94
+      min-height: 117px;
95
+      background: #f9fafb;
96
+      border: 1px solid #e5e9ed;
97
+      border-radius: 5px;
98
+      overflow: hidden;
99
+      margin-top: 12px;
100
+      display: flex;
101
+      flex-direction: column;
102
+      justify-content: center;
103
+      // align-items: center;
104
+      &.content-search {
105
+        min-height: 147px;
106
+        justify-content: start;
107
+        .defeat-search {
108
+          width: 100%;
109
+          height: 52px;
110
+          display: flex;
111
+          justify-content: center;
112
+          align-items: center;
113
+          border-bottom: solid 1px #e5e9ed;
114
+          em {
115
+            color: #666;
116
+            font-style: normal;
117
+          }
118
+        }
119
+        .form {
120
+          width: 100%;
121
+          padding: 0 16px;
122
+          .ant-form-item-label,
123
+          .ant-form-explain {
124
+            text-align: left !important;
125
+          }
126
+        }
127
+      }
128
+
129
+      div {
130
+        text-align: right;
131
+        margin: 0;
132
+      }
133
+      button{
134
+        margin-top: 0!important;
135
+        margin-left: 0!important;
136
+      }
137
+      .formItem{
138
+        text-align: left!important;
139
+      }
140
+    }
141
+
142
+    button {
143
+      margin-top: 10px;
144
+
145
+      &.btn {
146
+        margin-left: 8px;
147
+      }
148
+    }
149
+  }
150
+
151
+  // 新增
152
+  &.add {
153
+    .modalBody {
154
+      width: 480px;
155
+      height: auto;
156
+
157
+      .content {
158
+        width: 100%;
159
+        height: auto;
160
+        padding: 18px 14px 0 14px;
161
+
162
+        .addForm {
163
+          .ant-form-item {
164
+            margin-bottom: 15px;
165
+
166
+            .ant-form-item-label {
167
+              line-height: 0;
168
+            }
169
+          }
170
+        }
171
+
172
+        .editForm {
173
+          .ant-form-item {
174
+            margin-bottom: 15px;
175
+
176
+            .ant-form-item-label {
177
+              line-height: 0;
178
+            }
179
+          }
180
+        }
181
+      }
182
+
183
+      button {
184
+        &:nth-child(1) {
185
+          margin-right: 20px;
186
+        }
187
+      }
188
+    }
189
+  }
190
+}

+ 225 - 0
src/app/share/inspection-template-prompt-modal/inspection-template-prompt-modal.component.ts

@@ -0,0 +1,225 @@
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-template-prompt-modal',
10
+  templateUrl: './inspection-template-prompt-modal.component.html',
11
+  styleUrls: ['./inspection-template-prompt-modal.component.less']
12
+})
13
+export class InspectionTemplatePromptModalComponent 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
+      inspectionTemplate: {
142
+        hosId: this.currentHospital.id,
143
+      }
144
+    }
145
+    this.hsLoading = true;
146
+    this.mainService.getFetchDataList("simple/data", "inspectionTemplate", postData).subscribe(data => {
147
+      this.hsLoading = false;
148
+      this.historySpecimenList = data.list || [];
149
+      this.historySpecimenListLength = data.totalNum || 0;
150
+    })
151
+  }
152
+  // 添加表单提交
153
+  btnLoading: boolean = false; //提交按钮loading状态
154
+  submitForm(): void {
155
+    console.log(this.checkedDepIds);
156
+    if(this.checkedDepIds.length === 0){
157
+      this.message.warning('请选择科室');
158
+      return;
159
+    }
160
+    this.confirmModelHs.emit(this.checkedDepIds);//emits(向上弹射)事件
161
+  }
162
+
163
+  // 引入
164
+  bringIn(data){
165
+    this.confirmModelHs.emit(data.id);//emits(向上弹射)事件
166
+  }
167
+
168
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
169
+  promptContent: string; //操作提示框提示信息
170
+  ifSuccess: boolean; //操作成功/失败
171
+  promptInfo: string; //操作结果提示信息
172
+  promptModalShow: boolean; //操作提示框是否展示
173
+  showPromptModal(con, success, promptInfo?) {
174
+    this.promptModalShow = false;
175
+    this.promptContent = con;
176
+    this.ifSuccess = success;
177
+    this.promptInfo = promptInfo;
178
+    setTimeout(() => {
179
+      this.promptModalShow = true;
180
+    }, 100);
181
+    this.getList();
182
+  }
183
+
184
+  delModal: boolean = false; //删除模态框
185
+  tipsMsg1: string; //提示框信息
186
+  tipsMsg2: string; //操作后信息
187
+  confirmDelType: string; //确认的类型(启用/停用,删除)
188
+  coopData: any; //当前操作列
189
+  showDelModal(
190
+    data,
191
+    tipsMsg1: string,
192
+    tipsMsg2: string,
193
+    type: string,
194
+  ) {
195
+    this.confirmDelType = type;
196
+    this.delModal = true;
197
+    this.coopData = data;
198
+    this.tipsMsg1 = tipsMsg1;
199
+    this.tipsMsg2 = tipsMsg2;
200
+  }
201
+  // 隐藏删除框
202
+  hideDelModal() {
203
+    this.delModal = false;
204
+  }
205
+  // 确认删除
206
+  confirmDel() {
207
+    this.btnLoading = true;
208
+    if (this.confirmDelType === "del") {
209
+      //删除
210
+      this.mainService
211
+        .simplePost("rmvData", "inspectionTemplate", [this.coopData.id])
212
+        .subscribe((data) => {
213
+          this.btnLoading = false;
214
+          this.delModal = false;
215
+          if (data.status == 200) {
216
+            this.showPromptModal(this.tipsMsg2, true, "");
217
+          } else {
218
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
219
+          }
220
+        });
221
+    }
222
+  }
223
+}
224
+
225
+

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

@@ -6,16 +6,23 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6 6
 import { OverlayscrollbarsModule } from 'overlayscrollbars-ngx';
7 7
 import { SelectHospitalComponent } from './select-hospital/select-hospital.component';
8 8
 import { SelectDeptComponent } from './select-dept/select-dept.component';
9
+import { TemplateNameComponent } from './template-name/template-name.component';
9 10
 import { PromptModalComponent } from './prompt-modal/prompt-modal.component';
10 11
 import { ReplicationSchemeComponent } from './replication-scheme/replication-scheme.component';
11 12
 import { HsPromptModalComponent } from './hs-prompt-modal/hs-prompt-modal.component';
12 13
 import { HistoryPromptModalComponent } from './history-prompt-modal/history-prompt-modal.component';
14
+import { InspectionConfigurationItemPromptModalComponent } from './inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component';
15
+import { InspectionAddressDepartmentPromptModalComponent } from './inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component';
16
+import { InspectionTemplatePromptModalComponent } from './inspection-template-prompt-modal/inspection-template-prompt-modal.component';
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';
13 19
 import { DetailSampleComponent } from './detail-sample/detail-sample.component';
14 20
 import { DetailPatientsComponent } from './detail-patients/detail-patients.component';
15 21
 import { DetailDrugComponent } from './detail-drug/detail-drug.component';
16 22
 import { DetailOthersComponent } from './detail-others/detail-others.component';
17 23
 import { AllocationWorkerComponent } from './allocation-worker/allocation-worker.component';
18 24
 import { DateTransformPipe } from '../pipes/date-transform.pipe';
25
+import { DataToNamePipe } from '../pipes/data-to-name.pipe';
19 26
 import { AppraiseDetailComponent } from './appraise-detail/appraise-detail.component';
20 27
 import { OrderDetailComponent } from './order-detail/order-detail.component';
21 28
 import { DialogDeleteComponent } from './dialog-delete/dialog-delete.component';
@@ -44,6 +51,7 @@ import { BloodHistoryPromptModalComponent } from './blood-history-prompt-modal/b
44 51
 import { MedicalWasteHistoryPromptModalComponent } from './medical-waste-history-prompt-modal/medical-waste-history-prompt-modal.component';
45 52
 import { MedicalWasteLogPromptModalComponent } from './medical-waste-log-prompt-modal/medical-waste-log-prompt-modal.component';
46 53
 import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing-record-detail.component';
54
+import { InspectionExecuteDetailComponent } from './inspection-execute-detail/inspection-execute-detail.component';
47 55
 
48 56
 @NgModule({
49 57
   declarations: [
@@ -55,17 +63,25 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
55 63
     AllocationWorkerComponent,
56 64
     SelectHospitalComponent,
57 65
     SelectDeptComponent,
66
+    TemplateNameComponent,
58 67
     PromptModalComponent,
59 68
     ReplicationSchemeComponent,
60 69
     HsPromptModalComponent,
61 70
     HistoryPromptModalComponent,
71
+    InspectionConfigurationItemPromptModalComponent,
72
+    InspectionAddressDepartmentPromptModalComponent,
73
+    InspectionTemplatePromptModalComponent,
74
+    InspectionAddressTagPromptModalComponent,
75
+    InspectionExecuteAssignPromptModalComponent,
62 76
     BusinessDataDetailModalComponent,
63 77
     RelationTransDetailModalComponent,
64 78
     BxPromptModalComponent,
65 79
     AppraiseDetailComponent,
66 80
     OrderDetailComponent,
67 81
     OutgoingRecordDetailComponent,
82
+    InspectionExecuteDetailComponent,
68 83
     DateTransformPipe,
84
+    DataToNamePipe,
69 85
     DialogDeleteComponent,
70 86
     DialogBxComponent,
71 87
     DialogSurgeryComponent,
@@ -108,22 +124,30 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
108 124
     AllocationWorkerComponent,
109 125
     SelectHospitalComponent,
110 126
     SelectDeptComponent,
127
+    TemplateNameComponent,
111 128
     PromptModalComponent,
112 129
     ReplicationSchemeComponent,
113 130
     HsPromptModalComponent,
114 131
     HistoryPromptModalComponent,
132
+    InspectionConfigurationItemPromptModalComponent,
133
+    InspectionAddressDepartmentPromptModalComponent,
134
+    InspectionTemplatePromptModalComponent,
135
+    InspectionAddressTagPromptModalComponent,
136
+    InspectionExecuteAssignPromptModalComponent,
115 137
     BusinessDataDetailModalComponent,
116 138
     RelationTransDetailModalComponent,
117 139
     BxPromptModalComponent,
118 140
     AppraiseDetailComponent,
119 141
     OrderDetailComponent,
120 142
     OutgoingRecordDetailComponent,
143
+    InspectionExecuteDetailComponent,
121 144
     CommonModule,
122 145
     NgZorroAntdModule,
123 146
     FormsModule,
124 147
     ReactiveFormsModule,
125 148
     OverlayscrollbarsModule,
126 149
     DateTransformPipe,
150
+    DataToNamePipe,
127 151
     DialogDeleteComponent,
128 152
     DialogBxComponent,
129 153
     DialogSurgeryComponent,

+ 23 - 0
src/app/share/template-name/template-name.component.html

@@ -0,0 +1,23 @@
1
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="templateFlag">
2
+  <div class="modalBody">
3
+    <div class="title">保存并存为模板<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
4
+    </div>
5
+    <div class="content">
6
+      <div class="tips">您确认将本次相关配置存为模板吗?</div>
7
+      <form nz-form [formGroup]="validateForm" class="addForm">
8
+        <nz-form-item>
9
+          <nz-form-label class="line_height_normal" [nzSpan]="5" nzRequired nzFor="name">模板名称</nz-form-label>
10
+          <nz-form-control [nzSpan]="19" nzErrorTip="请输入模板名称!">
11
+            <nz-input-group>
12
+              <textarea formControlName="name" nz-input placeholder="请输入模板名称"></textarea>
13
+            </nz-input-group>
14
+          </nz-form-control>
15
+        </nz-form-item>
16
+      </form>
17
+    </div>
18
+    <div class="display_flex justify-content_flex-center">
19
+      <button nzType="primary" nz-button (click)="submitForm()">确认</button>
20
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
21
+    </div>
22
+  </div>
23
+</div>

+ 129 - 0
src/app/share/template-name/template-name.component.less

@@ -0,0 +1,129 @@
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
+        margin-bottom: 19px;
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
+              line-height: 14px;
108
+              text-align: left;
109
+            }
110
+          }
111
+        }
112
+
113
+        .editForm {
114
+          .ant-form-item {
115
+            margin-bottom: 14px;
116
+
117
+            .ant-form-item-label {
118
+              line-height: 0;
119
+            }
120
+          }
121
+        }
122
+      }
123
+
124
+      button:nth-child(1) {
125
+        margin-right: 20px;
126
+      }
127
+    }
128
+  }
129
+}

+ 47 - 0
src/app/share/template-name/template-name.component.ts

@@ -0,0 +1,47 @@
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 { NzMessageService } from 'ng-zorro-antd';
5
+
6
+@Component({
7
+  selector: 'app-template-name',
8
+  templateUrl: './template-name.component.html',
9
+  styleUrls: ['./template-name.component.less']
10
+})
11
+export class TemplateNameComponent implements OnInit {
12
+  @Output() submitFormHand = new EventEmitter();
13
+  @Output() cancelFlagHand = new EventEmitter();
14
+  @Input() templateFlag: boolean = false;//模态框
15
+  @Input() hosId: any;//院区id
16
+  loading = false;//获取科室的loading
17
+  validateForm: FormGroup;//表单
18
+  constructor(
19
+    private fb: FormBuilder,
20
+    private message: NzMessageService,
21
+  ) { }
22
+
23
+  ngOnInit() {
24
+    this.initForm()
25
+  }
26
+  // 隐藏模态框
27
+  hideModal() {
28
+    this.cancelFlagHand.emit(false)
29
+    this.initForm()
30
+  }
31
+  // 初始化新增form表单
32
+  initForm() {
33
+    this.validateForm = this.fb.group({
34
+      name: ['', [Validators.required]]
35
+    });
36
+  }
37
+  // 表单提交
38
+  submitForm(): void {
39
+    for (const i in this.validateForm.controls) {
40
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
41
+      this.validateForm.controls[i].updateValueAndValidity();
42
+    }
43
+    if (this.validateForm.invalid) return;
44
+    this.submitFormHand.emit(this.validateForm.value.name);
45
+  }
46
+}
47
+

+ 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)="showInspectionAddressDepartment()">批量关联科室</button>
36
+        <div class="dropdown">
37
+          <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>
38
+          <div class="dropdown-content" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
39
+            <div class="dropdownItem" (click)="showDelModal($event, data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','delList')" *ngIf="coopBtns.del">批量删除</div>
40
+            <div class="dropdownItem" *ngIf="coopBtns.print" (click)="print($event,true)">批量打印</div>
41
+            <div class="dropdownItem" *ngIf="coopBtns.reset" (click)="showDelModal($event, data,'您确认要重置二维码吗?','重置','resetList')">批量重置</div>
42
+          </div>
43
+        </div>
44
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
45
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
46
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</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($event, data)">编辑</span>
76
+                <span *ngIf="coopBtns.del" (click)="showDelModal($event, 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" (nzOpenChange)="changeInp('add', 'department', '')">
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
+}

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

@@ -0,0 +1,668 @@
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(1);
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:any = {
267
+      department: {
268
+        // searchType: 1,// 简单查询
269
+        dept: keyword,
270
+        cascadeHosId: this.currentHospital.id,
271
+      },
272
+      idx: 0,
273
+      sum: 20,
274
+    };
275
+    if(type === 'add'){
276
+      postData.department.bussType = 'inspection';
277
+    }
278
+    this.mainService
279
+      .getFetchDataList("data", "department", postData)
280
+      .subscribe((data) => {
281
+        if (type == "search") {
282
+          this.departmentSearchList = data.list;
283
+        } else if (type == "add") {
284
+          this.departmentAddList = data.list;
285
+        }
286
+
287
+        this.isLoading = false;
288
+
289
+        if(init && this.coopData && this.coopData.departmentDTO){
290
+          let deptId = this.coopData.departmentDTO.id;
291
+          let flag = this.departmentAddList.some(v => v.id == deptId);
292
+          if(!flag){
293
+            this.departmentAddList.unshift(this.coopData.departmentDTO)
294
+          }
295
+          this.validateForm.controls.deptId.setValue(this.coopData.departmentDTO.id);
296
+        }
297
+      });
298
+  }
299
+
300
+  // 获取标签
301
+  tagList: any = [];
302
+  tagListCopy: any = [];
303
+  getTags(type, keyword) {
304
+    let postData = {
305
+      tag: {
306
+        hosId: this.currentHospital.id,
307
+        modelType: { value: 'inspection' },
308
+      },
309
+      idx: 0,
310
+      sum: 50,
311
+    };
312
+    this.mainService
313
+      .getFetchDataList("simple/data", "tag", postData)
314
+      .subscribe((data) => {
315
+        this.tagList = data.list;
316
+        this.tagListCopy = JSON.parse(JSON.stringify(this.tagList));
317
+        this.isLoading = false;
318
+      });
319
+  }
320
+
321
+  // 获取楼栋
322
+  buildingAddList: any = [];
323
+  buildingSearchList: any = [];
324
+  getBuildings(type, keyword, init = false) {
325
+    let postData = {
326
+      building: {
327
+        simpleQuery: true,
328
+        buildingName: keyword,
329
+        cascadeHosId: this.currentHospital.id,
330
+      },
331
+      idx: 0,
332
+      sum: 20,
333
+    };
334
+    this.mainService
335
+      .getFetchDataList("simple/data", "building", postData)
336
+      .subscribe((data) => {
337
+        if (type == "search") {
338
+          this.buildingSearchList = data.list;
339
+        } else if (type == "add") {
340
+          this.buildingAddList = data.list;
341
+        }
342
+        this.isLoading = false;
343
+
344
+        if(init && this.coopData && this.coopData.buildingDTO){
345
+          let buildId = this.coopData.buildingDTO.id;
346
+          let flag = this.buildingAddList.some(v => v.id == buildId);
347
+          if(!flag){
348
+            this.buildingAddList.unshift(this.coopData.buildingDTO)
349
+          }
350
+          this.validateForm.controls.buildId.setValue(this.coopData.buildingDTO.id);
351
+        } else if (this.deptDto && this.deptDto.building){
352
+          let buildId = this.deptDto.building.id;
353
+          let flag = this.buildingAddList.some(v => v.id == buildId);
354
+          if(!flag){
355
+            this.buildingAddList.unshift(this.deptDto.building)
356
+          }
357
+          this.validateForm.controls.buildId.setValue(this.deptDto.building.id);
358
+        }
359
+      });
360
+  }
361
+
362
+  // 修改关联科室
363
+  deptDto:any = null;
364
+  changeDepartment(deptId){
365
+    if(this.add){
366
+      console.log(deptId)
367
+      this.deptDto = this.departmentAddList.find(v => v.id == deptId);
368
+      console.log(this.deptDto);
369
+      if(this.deptDto && this.deptDto.dept && !this.validateForm.value.name){
370
+        this.validateForm.controls.name.setValue(this.deptDto.dept);
371
+      }
372
+
373
+      if(this.deptDto && this.deptDto.building){
374
+        this.getBuildings('add', '');
375
+      }
376
+
377
+      if(this.deptDto && this.deptDto.floor){
378
+        this.noChangeBuilding = true;
379
+        this.getFloors('add', '', this.deptDto.building.id, false, true);
380
+      }
381
+    }
382
+  }
383
+
384
+  // 修改楼栋
385
+  noChangeBuilding:boolean = false;
386
+  changeBuilding(buildId?){
387
+    console.log(buildId)
388
+    if(!this.noChangeBuilding){
389
+      this.validateForm.controls.floorId.setValue(null);
390
+      this.getFloors('add', '', this.validateForm.value.buildId);
391
+    }
392
+    this.noChangeBuilding = false;
393
+  }
394
+
395
+  // 获取楼层
396
+  floorList: any = [];
397
+  getFloors(type, keyword, buildId, init = false, isNoChangeBuilding = false) {
398
+    console.log(isNoChangeBuilding)
399
+    if(!buildId){
400
+      this.floorList = [];
401
+      return;
402
+    }
403
+    let postData = {
404
+      floor: {
405
+        floorName: keyword,
406
+        buildId,
407
+        // hosId: this.currentHospital.id,
408
+      },
409
+      idx: 0,
410
+      sum: 20,
411
+    };
412
+    this.mainService
413
+      .getFetchDataList("simple/data", "floor", postData)
414
+      .subscribe((data) => {
415
+        this.floorList = data.list;
416
+        this.isLoading = false;
417
+
418
+        if(init && this.coopData && this.coopData.floorDTO){
419
+          let floorId = this.coopData.floorDTO.id;
420
+          let flag = this.floorList.some(v => v.id == floorId);
421
+          if(!flag){
422
+            this.floorList.unshift(this.coopData.floorDTO)
423
+          }
424
+          this.validateForm.controls.floorId.setValue(this.coopData.floorDTO.id);
425
+        } else if (isNoChangeBuilding && this.deptDto && this.deptDto.floor){
426
+          let floorId = this.deptDto.floor.id;
427
+          let flag = this.floorList.some(v => v.id == floorId);
428
+          if(!flag){
429
+            this.floorList.unshift(this.deptDto.floor)
430
+          }
431
+          this.validateForm.controls.floorId.setValue(this.deptDto.floor.id);
432
+        }
433
+      });
434
+  }
435
+
436
+  // 选择标签
437
+  changeTags(tags){
438
+    if(tags.length){
439
+      let flag = tags.every(v => {
440
+        return this.tagListCopy.map(vv => vv.name).includes(v);
441
+      })
442
+
443
+      if(flag){
444
+        return;
445
+      }
446
+
447
+      let tagName = tags[tags.length - 1];
448
+      let postData = {
449
+        tag: {
450
+          name: tagName,
451
+          hosId: this.currentHospital.id,
452
+          modelType: { value: 'inspection' },
453
+        }
454
+      }
455
+      this.isLoading = true;
456
+      this.mainService
457
+      .coopData("addData", "tag", postData)
458
+      .subscribe((result) => {
459
+        this.isLoading = false;
460
+        console.log(result);
461
+        if(result.status == 200){
462
+          this.tagListCopy.unshift(result.data)
463
+          console.log(this.tagListCopy);
464
+        } else if (result.status == 10001){
465
+          // 名称重复
466
+          this.tagListCopy.unshift(result.data)
467
+          console.log(this.tagListCopy);
468
+        } else {
469
+          tags.pop();
470
+          this.message.warning(result.msg || '请求数据失败')
471
+        }
472
+      });
473
+    }
474
+  }
475
+
476
+  //获取填写方式
477
+  dispatchMethods:any[] = [];
478
+  getDispatchMethods() {
479
+    this.isLoading = true;
480
+    this.mainService.getDictionary("list", "inspection_node_sign_type").subscribe((data) => {
481
+      this.isLoading = false;
482
+      this.dispatchMethods = data || [];
483
+    });
484
+  }
485
+
486
+  // 新增/编辑表单提交
487
+  submitForm(): void {
488
+    for (const i in this.validateForm.controls) {
489
+      this.validateForm.controls[i].markAsDirty();
490
+      this.validateForm.controls[i].updateValueAndValidity();
491
+    }
492
+    if (this.validateForm.invalid) {
493
+      return;
494
+    }
495
+
496
+    console.log(this.validateForm.value)
497
+    console.log(this.tagListCopy);
498
+
499
+    this.btnLoading = true;
500
+    let postData:any = {};
501
+
502
+    let tagNames = this.validateForm.value.tagIds;
503
+    let tags = this.tagListCopy;
504
+    let tagIds = tagNames.map(name =>{
505
+      return tags.find(v => v.name === name).id;
506
+    })
507
+
508
+    if (this.add) {
509
+      //增加
510
+      postData = {
511
+        inspectionNode: {
512
+          name: this.validateForm.value.name,
513
+          deptId: this.validateForm.value.deptId,
514
+          buildId: this.validateForm.value.buildId,
515
+          floorId: this.validateForm.value.floorId,
516
+          tagIds: tagIds.toString(),
517
+          signType: this.dispatchMethods.find(v => v.value === this.validateForm.value.signType),
518
+          hosId: this.currentHospital.id,
519
+        }
520
+      };
521
+    } else {
522
+      //编辑
523
+      postData = {
524
+        inspectionNode:{
525
+          ...this.coopData,
526
+          ...{
527
+            name: this.validateForm.value.name,
528
+            deptId: this.validateForm.value.deptId,
529
+            buildId: this.validateForm.value.buildId,
530
+            floorId: this.validateForm.value.floorId,
531
+            tagIds: tagIds.toString(),
532
+            signType: this.dispatchMethods.find(v => v.value === this.validateForm.value.signType),
533
+          }
534
+        }
535
+      };
536
+    }
537
+    this.mainService
538
+      .coopData("addData", "inspectionNode", postData)
539
+      .subscribe((result) => {
540
+        this.btnLoading = false;
541
+        this.hideAddModal();
542
+        let msg = "";
543
+        if (this.add) {
544
+          msg = "新增";
545
+        } else {
546
+          msg = "修改";
547
+        }
548
+        if (result.status == 200) {
549
+          this.showPromptModal(msg, true, "");
550
+        } else if (result.status == 10001) {
551
+          this.showPromptModal(msg, false, "关联科室重复");
552
+        } else {
553
+          this.showPromptModal(msg, false, result.msg);
554
+        }
555
+      });
556
+  }
557
+
558
+  // 编辑
559
+  edit(e, data) {
560
+    e.stopPropagation();
561
+    console.log(data);
562
+    this.initForm();
563
+    this.modelName = "编辑";
564
+    this.add = false;
565
+    this.modal = true;
566
+    this.coopData = data;
567
+    this.validateForm.controls.name.setValue(data.name); //名称
568
+    this.validateForm.controls.deptId.setValue(data.deptId);
569
+    this.validateForm.controls.tagIds.setValue(data.tagIdsList.map(v => v.name));
570
+    this.validateForm.controls.signType.setValue(data.signType.value);
571
+
572
+    if(data.deptId){
573
+      this.getDeparts('add', '', true);
574
+    }
575
+
576
+    if(data.buildId){
577
+      this.getBuildings('add', '', true);
578
+    }
579
+
580
+    if(data.floorId){
581
+      this.noChangeBuilding = true;
582
+      this.getFloors('add', '', data.buildId, true, true);
583
+    }
584
+  }
585
+
586
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
587
+  showPromptModal(con, success, promptInfo?) {
588
+    this.promptModalShow = false;
589
+    this.promptContent = con;
590
+    this.ifSuccess = success;
591
+    this.promptInfo = promptInfo;
592
+    setTimeout(() => {
593
+      this.promptModalShow = true;
594
+    }, 100);
595
+    this.getList(0);
596
+    this.getTags('add', '');
597
+  }
598
+
599
+  delModal: boolean = false; //删除模态框
600
+  tipsMsg1: string; //提示框信息
601
+  tipsMsg2: string; //操作后信息
602
+  confirmDelType: string; //确认的类型(启用/停用,删除)
603
+  showDelModal(
604
+    e,
605
+    data,
606
+    tipsMsg1: string,
607
+    tipsMsg2: string,
608
+    type: string,
609
+  ) {
610
+    e.stopPropagation();
611
+    this.confirmDelType = type;
612
+    this.delModal = true;
613
+    this.coopData = data;
614
+    this.tipsMsg1 = tipsMsg1;
615
+    this.tipsMsg2 = tipsMsg2;
616
+  }
617
+  // 隐藏删除框
618
+  hideDelModal() {
619
+    this.delModal = false;
620
+  }
621
+  // 确认删除
622
+  confirmDel() {
623
+    this.btnLoading = true;
624
+    if (this.confirmDelType === "del") {
625
+      //删除
626
+      this.mainService
627
+        .simplePost("rmvData", "inspectionNode", [this.coopData.id])
628
+        .subscribe((data) => {
629
+          this.btnLoading = false;
630
+          this.delModal = false;
631
+          if (data.status == 200) {
632
+            this.showPromptModal(this.tipsMsg2, true, "");
633
+          } else {
634
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
635
+          }
636
+        });
637
+    } else if (this.confirmDelType === "delList") {
638
+      //批量删除
639
+      this.mainService
640
+        .simplePost("rmvData", "inspectionNode", this.checkedDepIds)
641
+        .subscribe((data) => {
642
+          this.btnLoading = false;
643
+          this.delModal = false;
644
+          if (data.status == 200) {
645
+            this.showPromptModal(this.tipsMsg2, true, "");
646
+          } else {
647
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
648
+          }
649
+        });
650
+    } else if (this.confirmDelType === "resetList") {
651
+      //批量重置
652
+      let postData = {
653
+        nodeIds: this.checkedDepIds.toString(),
654
+      }
655
+      this.mainService
656
+        .inspectionPost("batchResetNodeCode", postData)
657
+        .subscribe((data) => {
658
+          this.btnLoading = false;
659
+          this.delModal = false;
660
+          if (data.status == 200) {
661
+            this.showPromptModal(this.tipsMsg2, true, "");
662
+          } else {
663
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
664
+          }
665
+        });
666
+    }
667
+  }
668
+}

+ 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 { }

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

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

+ 85 - 0
src/app/views/inspection-batch/inspection-batch.component.html

@@ -0,0 +1,85 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='17' 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', 'inspectionPlan', $event)" nzAllowClear nzPlaceHolder="请选择计划主题" [(ngModel)]="searchDto.inspectionId">
9
+            <ng-container *ngFor="let option of inspectionPlanSearchList">
10
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)"></nz-range-picker>
20
+        </div>
21
+        <div class="list-template__searchItem">
22
+          <span class="label">状态</span>:
23
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" [(ngModel)]="searchDto.statusId">
24
+            <ng-container *ngFor="let option of statusSearchList">
25
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
26
+            </ng-container>
27
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
28
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
29
+            </nz-option>
30
+          </nz-select>
31
+        </div>
32
+      </div>
33
+      <div nz-col nzXl="7" class="list-template__btns">
34
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
35
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
36
+      </div>
37
+    </div>
38
+    <div class="list-template__bottom">
39
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
40
+        [nzLoading]="loading1">
41
+        <thead>
42
+          <tr class="thead">
43
+            <th nzWidth="14%">计划主题</th>
44
+            <th nzWidth="14%">批次号</th>
45
+            <th nzWidth="14%">创建时间</th>
46
+            <th nzWidth="14%">生成人</th>
47
+            <th nzWidth="14%">状态</th>
48
+            <th nzWidth="14%">完成百分比</th>
49
+            <th nzWidth="16%">操作</th>
50
+          </tr>
51
+        </thead>
52
+        <tbody>
53
+          <tr *ngFor="let data of listOfData;let i = index">
54
+            <td>{{data.inspectionDTO?.name}}</td>
55
+            <td>{{data.batchNo}}</td>
56
+            <td>{{data.addTime | date:'yyyy-MM-dd HH:mm'}}</td>
57
+            <td>{{data.addUserDTO?.name}}</td>
58
+            <td>{{data.status?.name}}</td>
59
+            <td><nz-progress [nzPercent]="data.percent" nzStatus="active" nzStrokeColor="#49b856"></nz-progress></td>
60
+            <td>
61
+              <div class="coop">
62
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'删除批次同时会删除相关巡检任务,您确认要删除吗?','删除','del')">删除</span>
63
+              </div>
64
+            </td>
65
+          </tr>
66
+        </tbody>
67
+      </nz-table>
68
+      <div class="list-template__pagination">
69
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
70
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
71
+        </nz-pagination>
72
+      </div>
73
+    </div>
74
+  </div>
75
+</div>
76
+<!-- 模态框 -->
77
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
78
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
79
+<!-- 操作成功/失败提示框 -->
80
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
81
+  [info]="promptInfo">
82
+</app-prompt-modal>
83
+
84
+<!-- 遮罩 -->
85
+<app-mask *ngIf="maskFlag"></app-mask>

+ 173 - 0
src/app/views/inspection-batch/inspection-batch.component.less

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

+ 283 - 0
src/app/views/inspection-batch/inspection-batch.component.ts

@@ -0,0 +1,283 @@
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
+import { format } from 'date-fns';
11
+@Component({
12
+  selector: "app-inspection-batch",
13
+  templateUrl: "./inspection-batch.component.html",
14
+  styleUrls: ["./inspection-batch.component.less"],
15
+})
16
+export class InspectionBatchComponent implements OnInit {
17
+  constructor(
18
+    private fb: FormBuilder,
19
+    private mainService: MainService,
20
+    private route: ActivatedRoute,
21
+    private router: Router,
22
+    private tool: ToolService,
23
+    private message: NzMessageService,
24
+  ) {}
25
+
26
+  listOfData: any[] = []; //表格数据
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 10; //表格每页展示条数
29
+  listLength: number = 10; //表格总数据量
30
+  modal: boolean = false; //新增/编辑模态框
31
+  add: boolean; //true:新增;false:编辑
32
+  validateForm: FormGroup; //新增/编辑表单
33
+  coopData: any; //当前操作列
34
+  currentHospital; //当前院区
35
+
36
+  btnLoading: boolean = false; //提交按钮loading状态
37
+
38
+  promptContent: string; //操作提示框提示信息
39
+  ifSuccess: boolean; //操作成功/失败
40
+  promptInfo: string; //操作结果提示信息
41
+  promptModalShow: boolean; //操作提示框是否展示
42
+  nextSchemeName = ""; //下一个开启的方案名称
43
+  modelName = ""; //模态框名称
44
+
45
+  changeInpSubject = new Subject(); //防抖
46
+  showDropdown:boolean = false;
47
+
48
+  ngOnInit() {
49
+    //防抖
50
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
51
+      if(v[1] === 'inspectionPlan'){
52
+        this.getInspectionPlans(v[0], v[2]);
53
+      }
54
+    });
55
+    this.currentHospital = this.tool.getCurrentHospital();
56
+    this.coopBtns = this.tool.initCoopBtns(this.route);
57
+    this.getList(1);
58
+    this.getInspectionPlans('search', '');
59
+    this.getStatus();
60
+  }
61
+
62
+  // 初始化增删改按钮
63
+  coopBtns: any = {};
64
+
65
+  // 批量关联科室
66
+  inspectionAddressDepartmentPromptModalShow = false; //标本历史记录弹窗开关
67
+  showInspectionAddressDepartment() {
68
+    this.inspectionAddressDepartmentPromptModalShow = true;
69
+  }
70
+  // 关闭弹窗
71
+  closeModelInspectionAddressDepartment(e) {
72
+    this.inspectionAddressDepartmentPromptModalShow = JSON.parse(e).show;
73
+  }
74
+  // 确认弹窗
75
+  checkedDepIdsModel = [];
76
+  confirmModelInspectionAddressDepartment(checkedDepIds) {
77
+    this.inspectionAddressDepartmentPromptModalShow = true;
78
+    this.checkedDepIdsModel = checkedDepIds;
79
+    console.log(checkedDepIds)
80
+    this.showInspectionAddressTag();
81
+  }
82
+
83
+  // 批量关联科室-标签
84
+  inspectionAddressTagPromptModalShow = false; //标本历史记录弹窗开关
85
+  showInspectionAddressTag() {
86
+    this.inspectionAddressTagPromptModalShow = true;
87
+  }
88
+  // 关闭弹窗
89
+  closeModelInspectionAddressTag(e) {
90
+    this.inspectionAddressTagPromptModalShow = JSON.parse(e).show;
91
+  }
92
+  // 确认弹窗
93
+  maskFlag: any = false;
94
+  confirmModelInspectionAddressTag(tags) {
95
+    this.maskFlag = this.message.loading("正在加载中..", {
96
+      nzDuration: 0,
97
+    }).messageId;
98
+    this.inspectionAddressTagPromptModalShow = true;
99
+    console.log(this.checkedDepIdsModel, tags);
100
+    let postData:any = {
101
+      deptIds: this.checkedDepIdsModel.toString(),
102
+      hosId: this.currentHospital.id,
103
+      tagIds: tags.toString(),
104
+    };
105
+    console.log(postData);
106
+    this.btnLoading = true;
107
+    this.mainService
108
+      .inspectionPost("batchBindFormNode", postData)
109
+      .subscribe((result) => {
110
+        this.message.remove(this.maskFlag);
111
+        this.maskFlag = false;
112
+        this.btnLoading = false;
113
+        if (result.status == 200) {
114
+          this.inspectionAddressDepartmentPromptModalShow = false;
115
+          this.inspectionAddressTagPromptModalShow = false;
116
+          this.showPromptModal('操作', true, '');
117
+        } else if (result.status == 501) {
118
+          this.inspectionAddressDepartmentPromptModalShow = false;
119
+          this.inspectionAddressTagPromptModalShow = false;
120
+          this.showPromptModal('操作', true, result.msg);
121
+        } else {
122
+          this.showPromptModal('操作', false, result.msg);
123
+        }
124
+      });
125
+  }
126
+
127
+  // 搜索
128
+  search() {
129
+    this.getList(1);
130
+  }
131
+  // 重置
132
+  reset() {
133
+    this.dateRange = [];
134
+    this.changeDate();
135
+    this.searchDto = {};
136
+    this.getList(1);
137
+  }
138
+
139
+  // 表格数据
140
+  searchDto: any = {};
141
+  loading1 = false;
142
+  getList(type) {
143
+    if (type == 1) {
144
+      this.pageIndex = 1;
145
+    }
146
+    let data:any = {
147
+      idx: this.pageIndex - 1,
148
+      sum: this.pageSize,
149
+      inspectionBatch: {
150
+        hosId: this.currentHospital.id,
151
+        inspectionId: this.searchDto.inspectionId || undefined,
152
+        status: this.searchDto.statusId ? { id: this.searchDto.statusId } : undefined,
153
+      },
154
+    };
155
+    if (this.startDate && this.endDate) {
156
+      data.inspectionBatch.addTimeStart = this.startDate;
157
+      data.inspectionBatch.addTimeEnd = this.endDate;
158
+    }
159
+    this.loading1 = true;
160
+    this.mainService
161
+      .getFetchDataList("simple/data", "inspectionBatch", data)
162
+      .subscribe((data) => {
163
+        this.loading1 = false;
164
+        if (data.status == 200) {
165
+          this.listOfData = data.list;
166
+          this.listLength = data.totalNum;
167
+        }else{
168
+          this.message.error(data.msg || "请求数据失败");
169
+        }
170
+      });
171
+  }
172
+
173
+  // 边输边搜节流阀
174
+  isLoading = false;
175
+  changeInp(type, model, e) {
176
+    this.isLoading = true;
177
+    this.changeInpSubject.next([type, model, e]);
178
+  }
179
+
180
+  // 获取巡检计划
181
+  inspectionPlanSearchList: any = [];
182
+  getInspectionPlans(type, keyword, init = false) {
183
+    let postData = {
184
+      inspection: {
185
+        name: keyword,
186
+        hosId: this.currentHospital.id,
187
+      },
188
+      idx: 0,
189
+      sum: 20,
190
+    };
191
+    this.mainService
192
+      .getFetchDataList("data", "inspection", postData)
193
+      .subscribe((data) => {
194
+        this.inspectionPlanSearchList = data.list;
195
+        this.isLoading = false;
196
+      });
197
+  }
198
+
199
+  // 获取状态
200
+  statusSearchList: any = [];
201
+  getStatus() {
202
+    this.mainService
203
+    .getDictionary('list', 'inspection_batch_status')
204
+    .subscribe((data) => {
205
+      this.statusSearchList = data || [];
206
+    });
207
+  }
208
+
209
+  dateRange: any = []; //时间范围
210
+  onCalendarChangeDate(dateArr){
211
+    console.log(dateArr)
212
+    if(dateArr.length == 2){
213
+      let dateStart = new Date(dateArr[0]);
214
+      let dateEnd = new Date(dateArr[1]);
215
+      dateStart.setHours(0,0,0);
216
+      dateEnd.setHours(23,59,59);
217
+      this.dateRange = [dateStart,dateEnd];
218
+    }
219
+  }
220
+
221
+  // 日期选择
222
+  startDate: string; //发起时间开始
223
+  endDate: string; //发起时间结束
224
+  changeDate(result?): void {
225
+    if (!result) {
226
+      this.startDate = this.endDate = "";
227
+      return;
228
+    }
229
+    this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
230
+    this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
231
+  }
232
+
233
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
234
+  showPromptModal(con, success, promptInfo?) {
235
+    this.promptModalShow = false;
236
+    this.promptContent = con;
237
+    this.ifSuccess = success;
238
+    this.promptInfo = promptInfo;
239
+    setTimeout(() => {
240
+      this.promptModalShow = true;
241
+    }, 100);
242
+    this.getList(0);
243
+  }
244
+
245
+  delModal: boolean = false; //删除模态框
246
+  tipsMsg1: string; //提示框信息
247
+  tipsMsg2: string; //操作后信息
248
+  confirmDelType: string; //确认的类型(启用/停用,删除)
249
+  showDelModal(
250
+    data,
251
+    tipsMsg1: string,
252
+    tipsMsg2: string,
253
+    type: string,
254
+  ) {
255
+    this.confirmDelType = type;
256
+    this.delModal = true;
257
+    this.coopData = data;
258
+    this.tipsMsg1 = tipsMsg1;
259
+    this.tipsMsg2 = tipsMsg2;
260
+  }
261
+  // 隐藏删除框
262
+  hideDelModal() {
263
+    this.delModal = false;
264
+  }
265
+  // 确认删除
266
+  confirmDel() {
267
+    this.btnLoading = true;
268
+    if (this.confirmDelType === "del") {
269
+      //删除
270
+      this.mainService
271
+        .simplePost("rmvData", "inspectionBatch", [this.coopData.id])
272
+        .subscribe((data) => {
273
+          this.btnLoading = false;
274
+          this.delModal = false;
275
+          if (data.status == 200) {
276
+            this.showPromptModal(this.tipsMsg2, true, "");
277
+          } else {
278
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
279
+          }
280
+        });
281
+    }
282
+  }
283
+}

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

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

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

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

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

@@ -0,0 +1,254 @@
1
+<div class="inspectionConfigurationItem">
2
+  <div class="list-template inspectionConfigurationItemTable">
3
+    <div class="list-template__content">
4
+      <div class="list-template__bottom">
5
+        <div class="list-template__top" nz-row>
6
+          <div nz-col nzXl='18' class="list-template__searchBox">
7
+            <button nz-button class="btn default" (click)="goBack()">返回</button>
8
+          </div>
9
+          <div nz-col nzLg="6" class="list-template__btns">
10
+            <button nz-button class="btn default" (click)="addModal()" *ngIf="pageList.length">新增巡检项</button>
11
+          </div>
12
+        </div>
13
+        <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
14
+          [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }">
15
+          <thead>
16
+            <tr class="thead">
17
+              <th nzWidth="13%">巡检项</th>
18
+              <th nzWidth="13%">是否必填</th>
19
+              <th nzWidth="13%">默认值</th>
20
+              <th nzWidth="13%">排序号</th>
21
+              <th nzWidth="13%">填写方式</th>
22
+              <th nzWidth="13%">异常显示</th>
23
+              <th nzWidth="22%">操作</th>
24
+            </tr>
25
+          </thead>
26
+          <tbody>
27
+            <tr *ngFor="let data of listOfData;let i = index">
28
+              <td>{{data.name}}</td>
29
+              <td>{{data.required === 1 ? '是' : (data.required === 0 ? '否' : '')}}</td>
30
+              <td>{{data.defaultValue}}</td>
31
+              <td>{{data.orders}}</td>
32
+              <td>{{data.type?.name}}</td>
33
+              <td>{{data.showError === 1 ? '是' : (data.showError === 0 ? '否' : '')}}</td>
34
+              <td>
35
+                <div class="coop">
36
+                  <span (click)="showDelModal(data,'您确认要删除吗?','删除','del')" *ngIf="inspectionConfigurationDetail.status.value === '0'">删除</span>
37
+                  <span (click)="edit(data)">编辑</span>
38
+                  <span (click)="showModelInspectionConfigurationItem(data)" *ngIf="data.type.value === '1' || data.type.value === '2' || data.type.value === '3'">选择项配置</span>
39
+                  <span (click)="showDelModal(data,'您确认要隐藏吗?','隐藏','hidden')" *ngIf="inspectionConfigurationDetail.status.value === '1' && data.display === 1">隐藏</span>
40
+                  <span (click)="showDelModal(data,'您确认要显示吗?','显示','show')" *ngIf="inspectionConfigurationDetail.status.value === '1' && data.display === 0">显示</span>
41
+                </div>
42
+              </td>
43
+            </tr>
44
+          </tbody>
45
+        </nz-table>
46
+      </div>
47
+    </div>
48
+
49
+    <!-- 新增/编辑巡检项模态框 -->
50
+    <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
51
+      <div class="modalBody">
52
+        <div class="title">{{modelName}}巡检项<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
53
+        <div class="content">
54
+          <form nz-form [formGroup]="validateForm" class="addForm">
55
+            <nz-form-item>
56
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="name">巡检项名称</nz-form-label>
57
+              <nz-form-control [nzSpan]="18" nzErrorTip="请输入巡检项名称!">
58
+                <nz-input-group>
59
+                  <input formControlName="name" nz-input placeholder="请输入巡检项名称">
60
+                </nz-input-group>
61
+              </nz-form-control>
62
+            </nz-form-item>
63
+            <nz-form-item>
64
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="orders">排&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;&nbsp;号</nz-form-label>
65
+              <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
66
+                <nz-input-group>
67
+                  <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
68
+                </nz-input-group>
69
+              </nz-form-control>
70
+            </nz-form-item>
71
+            <nz-form-item>
72
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="type">填&nbsp;写&nbsp;方&nbsp;式</nz-form-label>
73
+              <nz-form-control [nzSpan]="18" nzErrorTip="请选择填写方式!">
74
+                <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="type" nzShowSearch
75
+                  nzPlaceHolder="请选择填写方式" nzServerSearch (ngModelChange)="changeType($event)" [nzDisabled]="inspectionConfigurationDetail.status.value !== '0' && !add">
76
+                  <ng-container *ngFor="let data of dispatchMethods">
77
+                    <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.value"></nz-option>
78
+                  </ng-container>
79
+                  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
80
+                    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
81
+                  </nz-option>
82
+                </nz-select>
83
+              </nz-form-control>
84
+            </nz-form-item>
85
+            <nz-form-item *ngIf="validateForm.value.type !== null && validateForm.value.type !== '8'">
86
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="required">是&nbsp;否&nbsp;必&nbsp;填</nz-form-label>
87
+              <nz-form-control [nzSpan]="18" nzErrorTip="请选择是否必填!">
88
+                <nz-radio-group formControlName="required">
89
+                  <label nz-radio [nzValue]="1">是</label>
90
+                  <label nz-radio [nzValue]="0">否</label>
91
+                </nz-radio-group>
92
+              </nz-form-control>
93
+            </nz-form-item>
94
+            <!-- 数值 -->
95
+            <ng-container *ngIf="validateForm.value.type === '4'">
96
+              <nz-form-item>
97
+                <nz-form-label [nzSpan]="6" nzRequired nzFor="checkType">判&nbsp;断&nbsp;形&nbsp;式</nz-form-label>
98
+                <nz-form-control [nzSpan]="18" nzErrorTip="请选择判断形式!">
99
+                  <nz-radio-group formControlName="checkType" (ngModelChange)="changeCheckType($event)">
100
+                    <label nz-radio [nzValue]="1">标准正负值</label>
101
+                    <label nz-radio [nzValue]="2">范围值</label>
102
+                  </nz-radio-group>
103
+                </nz-form-control>
104
+              </nz-form-item>
105
+              <!-- 标准正负值 -->
106
+              <ng-container *ngIf="validateForm.value.checkType == 1">
107
+                <nz-form-item>
108
+                  <nz-form-label [nzSpan]="6" nzRequired nzFor="valuex">标&nbsp;&nbsp;&nbsp;准&nbsp;&nbsp;&nbsp;值</nz-form-label>
109
+                  <nz-form-control [nzSpan]="18" nzErrorTip="请输入标准值!">
110
+                    <nz-input-group>
111
+                      <nz-input-number class="w100" formControlName="valuex" nzPlaceHolder="请输入标准值"></nz-input-number>
112
+                    </nz-input-group>
113
+                  </nz-form-control>
114
+                </nz-form-item>
115
+                <nz-form-item>
116
+                  <nz-form-label [nzSpan]="6" nzRequired nzFor="valueGap">正负范围值</nz-form-label>
117
+                  <nz-form-control [nzSpan]="18" nzErrorTip="请输入正负范围值!">
118
+                    <nz-input-group>
119
+                      <nz-input-number class="w100" formControlName="valueGap" nzPlaceHolder="请输入正负范围值"></nz-input-number>
120
+                    </nz-input-group>
121
+                  </nz-form-control>
122
+                </nz-form-item>
123
+              </ng-container>
124
+              <!-- 范围值 -->
125
+              <ng-container *ngIf="validateForm.value.checkType == 2">
126
+                <div class="form_item_wrap" nz-row>
127
+                  <nz-form-item nz-col [nzSpan]="12">
128
+                    <nz-form-label [nzSpan]="12" nzRequired nzFor="valueLow">范&nbsp;&nbsp;&nbsp;围&nbsp;&nbsp;&nbsp;值</nz-form-label>
129
+                    <nz-form-control [nzSpan]="12" nzErrorTip="请输入最小值!">
130
+                      <nz-input-group>
131
+                        <nz-input-number formControlName="valueLow" nzPlaceHolder="最小值"></nz-input-number>
132
+                      </nz-input-group>
133
+                    </nz-form-control>
134
+                  </nz-form-item>
135
+                  <span nz-col [nzSpan]="2" style="display: flex;padding-top: 10px;justify-content: center;padding-right: 12px;">至</span>
136
+                  <nz-form-item nz-col [nzSpan]="10">
137
+                    <nz-form-label [nzSpan]="10" nzRequired nzFor="valueUp" hidden>范&nbsp;&nbsp;&nbsp;围&nbsp;&nbsp;&nbsp;值</nz-form-label>
138
+                    <nz-form-control [nzSpan]="14" nzErrorTip="请输入最大值!">
139
+                      <nz-input-group>
140
+                        <nz-input-number formControlName="valueUp" nzPlaceHolder="最大值"></nz-input-number>
141
+                      </nz-input-group>
142
+                    </nz-form-control>
143
+                  </nz-form-item>
144
+                </div>
145
+              </ng-container>
146
+              <nz-form-item *ngIf="validateForm.value.checkType !== null">
147
+                <nz-form-label [nzSpan]="6" nzRequired nzFor="defaultValueNumber">默&nbsp;&nbsp;&nbsp;认&nbsp;&nbsp;&nbsp;值</nz-form-label>
148
+                <nz-form-control [nzSpan]="18" nzErrorTip="请输入默认值!">
149
+                  <nz-input-group>
150
+                    <nz-input-number class="w100" formControlName="defaultValueNumber" nzPlaceHolder="请输入默认值"></nz-input-number>
151
+                  </nz-input-group>
152
+                </nz-form-control>
153
+              </nz-form-item>
154
+            </ng-container>
155
+
156
+            <nz-form-item *ngIf="validateForm.value.type === '5' || validateForm.value.type === '6'">
157
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="defaultValueString">默&nbsp;&nbsp;&nbsp;认&nbsp;&nbsp;&nbsp;值</nz-form-label>
158
+              <nz-form-control [nzSpan]="18" nzErrorTip="请输入默认值!">
159
+                <nz-input-group>
160
+                  <input formControlName="defaultValueString" nz-input placeholder="请输入默认值">
161
+                </nz-input-group>
162
+              </nz-form-control>
163
+            </nz-form-item>
164
+            <nz-form-item *ngIf="validateForm.value.type === '5' || validateForm.value.type === '6' || validateForm.value.type === '7'">
165
+              <nz-form-label [nzSpan]="6" nzRequired nzFor="showError">异&nbsp;常&nbsp;显&nbsp;示</nz-form-label>
166
+              <nz-form-control [nzSpan]="18" nzErrorTip="请选择异常显示!">
167
+                <nz-radio-group formControlName="showError">
168
+                  <label nz-radio [nzValue]="1">是</label>
169
+                  <label nz-radio [nzValue]="0">否</label>
170
+                </nz-radio-group>
171
+              </nz-form-control>
172
+            </nz-form-item>
173
+          </form>
174
+        </div>
175
+        <div class=" display_flex justify-content_flex-center">
176
+          <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
177
+          <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
178
+        </div>
179
+      </div>
180
+    </div>
181
+    <!-- 新增/编辑巡检项页码模态框 -->
182
+    <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="pageModal">
183
+      <div class="modalBody">
184
+        <div class="title">{{modelName}}巡检项页码<i class="icon_transport transport-guanbi" (click)="hideAddPageModal()"></i></div>
185
+        <div class="content">
186
+          <form nz-form [formGroup]="validatePageForm" class="addForm">
187
+            <nz-form-item>
188
+              <nz-form-label [nzSpan]="4" nzRequired nzFor="name">标题</nz-form-label>
189
+              <nz-form-control [nzSpan]="20" nzErrorTip="请输入标题!">
190
+                <nz-input-group>
191
+                  <input formControlName="name" nz-input placeholder="请输入标题">
192
+                </nz-input-group>
193
+              </nz-form-control>
194
+            </nz-form-item>
195
+            <nz-form-item>
196
+              <nz-form-label [nzSpan]="4" nzRequired nzFor="orders">页码</nz-form-label>
197
+              <nz-form-control [nzSpan]="20" nzErrorTip="请输入页码!">
198
+                <nz-input-group>
199
+                  <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入页码" [nzMin]="1" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
200
+                </nz-input-group>
201
+              </nz-form-control>
202
+            </nz-form-item>
203
+          </form>
204
+        </div>
205
+        <div class=" display_flex justify-content_flex-center">
206
+          <button nzType="primary" nz-button (click)="submitPageForm()" [nzLoading]="btnLoading">确认</button>
207
+          <button class="btn cancel" nz-button nzType="default" (click)="hideAddPageModal()">取消</button>
208
+        </div>
209
+      </div>
210
+    </div>
211
+    <!-- 模态框 -->
212
+    <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
213
+      (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
214
+  </div>
215
+  <div class="inspectionConfigurationItemPage">
216
+    <div class="inspectionConfigurationItemPageBox">
217
+      <div class="head">
218
+        <button nz-button class="btn default" (click)="addPageModal()">新增</button>
219
+      </div>
220
+      <overlay-scrollbars #osComponentRef1 class="content" [ngStyle]="{height: pageHeight + 'px'}">
221
+        <div class="contentItem active" [ngClass]="{ active: pageActiveId == data.id }" (click)="clickPage(data)"
222
+          *ngFor="let data of pageList">
223
+          <div class="title">
224
+            <span class="name">标题:</span>
225
+            <span class="value">{{ data.name }}</span>
226
+          </div>
227
+          <div class="contentPage">
228
+            <div class="title">
229
+              <span class="name">页码:</span>
230
+              <span class="value">{{ data.orders }}</span>
231
+            </div>
232
+            <div class="btns">
233
+              <span class="icon_transport transport-weibiaoti2010104" (click)="editPage(data)"></span>
234
+              <span class="icon_transport transport-shanchu1" (click)="showDelModal(data,'删除会同步删除关联的巡检项,您确认要删除吗?','删除','delPage')"></span>
235
+            </div>
236
+          </div>
237
+        </div>
238
+      </overlay-scrollbars>
239
+    </div>
240
+  </div>
241
+</div>
242
+<!-- 操作成功/失败提示框 -->
243
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
244
+  [info]="promptInfo">
245
+</app-prompt-modal>
246
+
247
+<!-- 选择项配置 -->
248
+<app-inspection-configuration-item-prompt-modal
249
+  *ngIf="inspectionConfigurationItemPromptModalShow"
250
+  [show]="inspectionConfigurationItemPromptModalShow"
251
+  [coopData]="coopData"
252
+  (closeModelHs)="closeModelInspectionConfigurationItem($event)"
253
+  (confirmModelHs)="confirmModelInspectionConfigurationItem($event)"
254
+></app-inspection-configuration-item-prompt-modal>

+ 246 - 0
src/app/views/inspection-configuration-item/inspection-configuration-item.component.less

@@ -0,0 +1,246 @@
1
+@import "../../../../src/theme.less";
2
+:host{
3
+  width: 100%;
4
+}
5
+
6
+.inspectionConfigurationItem{
7
+  height: 100%;
8
+  width: 100%;
9
+  display: flex;
10
+  justify-content: space-between;
11
+  .inspectionConfigurationItemTable{
12
+    flex: 3;
13
+    .list-template__top{
14
+      padding: 8px 16px;
15
+    }
16
+    .list-template__nzTable{
17
+      padding-top: 0;
18
+    }
19
+    ::ng-deep .list-template__nzTable .ant-table-body{
20
+      border: none!important;
21
+    }
22
+    .list-template__content{
23
+      height: 100%;
24
+    }
25
+    .list-template__bottom{
26
+      height: 100%;
27
+      padding-bottom: 0;
28
+    }
29
+  }
30
+  .inspectionConfigurationItemPage{
31
+    flex: 1;
32
+    height: 100%;
33
+    padding: 8px 0;
34
+    .inspectionConfigurationItemPageBox{
35
+      height: 100%;
36
+      background: #f9fafb;
37
+      border: 1px solid #e5e9ed;
38
+      border-radius: 8px;
39
+      .head{
40
+        padding: 8px 16px;
41
+        display: flex;
42
+        justify-content: flex-end;
43
+        align-items: center;
44
+      }
45
+      .content{
46
+        .contentItem{
47
+          margin: 0 8px 8px;
48
+          padding: 8px;
49
+          background-color: #fff;
50
+          border: 1px solid #F5F5F5;
51
+          font-size: 14px;
52
+          cursor: pointer;
53
+          &.active{
54
+            border: 1px solid #64BD7B;
55
+            background: #E9F7E9;
56
+          }
57
+          .title{
58
+            .value{
59
+              margin-left: 16px;
60
+            }
61
+          }
62
+          .contentPage{
63
+            display: flex;
64
+            justify-content: space-between;
65
+            align-items: center;
66
+            margin-top: 8px;
67
+            .icon_transport{
68
+              font-size: 20px;
69
+              margin-left: 16px;
70
+              color: @primary-color;
71
+            }
72
+          }
73
+        }
74
+      }
75
+    }
76
+  }
77
+  .form_item_wrap{
78
+    display: flex;
79
+  }
80
+}
81
+.save {
82
+  position: fixed;
83
+  left: 0;
84
+  top: 0;
85
+  width: 100%;
86
+  height: 100%;
87
+  background: rgba(0, 0, 0, 0.4);
88
+  z-index: 99;
89
+
90
+  .modalBody {
91
+    width: 350px;
92
+    background: #fff;
93
+    border-radius: 5px;
94
+    padding: 10px 20px;
95
+    color: #333;
96
+
97
+    .title {
98
+      width: 100%;
99
+      text-align: center;
100
+      font-size: 18px;
101
+      position: relative;
102
+
103
+      i {
104
+        position: absolute;
105
+        right: 0;
106
+        top: 0;
107
+        font-size: 20px;
108
+        color: #666;
109
+        cursor: pointer;
110
+        padding: 0 5px;
111
+      }
112
+    }
113
+
114
+    .content {
115
+      width: 310px;
116
+      background: #f9fafb;
117
+      border: 1px solid #e5e9ed;
118
+      border-radius: 5px;
119
+      overflow: hidden;
120
+      margin-top: 12px;
121
+      padding: 16px 0;
122
+
123
+      .busyList{
124
+        display: flex;
125
+        margin-bottom: 8px;
126
+        .busyContent{
127
+          margin-right: 8px;
128
+          flex: 1;
129
+        }
130
+      }
131
+
132
+      & > div {
133
+        text-align: center;
134
+        margin: 0;
135
+
136
+        &.icon {
137
+          // margin-top: 17px;
138
+
139
+          i {
140
+            color: #34b349;
141
+            font-size: 30px !important;
142
+
143
+            &.transport-wenhao {
144
+              color: #f5a523;
145
+            }
146
+
147
+            &.transport-shibai {
148
+              color: #ff3a52;
149
+            }
150
+          }
151
+        }
152
+
153
+        &.defeat {
154
+          color: #333;
155
+          font-size: 14px;
156
+        }
157
+
158
+        &:nth-child(3) {
159
+          font-size: 14px;
160
+          color: #666;
161
+        }
162
+      }
163
+      .workAssignmentTips {
164
+        font-size: 12px;
165
+      }
166
+    }
167
+
168
+    button {
169
+      margin-top: 10px;
170
+
171
+      &.btn {
172
+        margin-left: 8px;
173
+      }
174
+    }
175
+  }
176
+
177
+  // 新增
178
+  &.add {
179
+    .modalBody {
180
+      width: 480px;
181
+      height: auto;
182
+
183
+      .content {
184
+        width: 100%;
185
+        height: auto;
186
+        padding: 16px;
187
+        max-height: 497px;
188
+        overflow-y: auto;
189
+
190
+        .addForm {
191
+          .ant-form-item {
192
+            margin-bottom: 0;
193
+
194
+            .ant-form-item-label {
195
+              text-align: left;
196
+            }
197
+
198
+            .desc {
199
+              margin-top: 5px;
200
+            }
201
+          }
202
+
203
+          .datesControl {
204
+            margin-top: -16px;
205
+
206
+            .ant-form-item-label {
207
+              line-height: 40px;
208
+            }
209
+          }
210
+
211
+          .timer {
212
+            .ant-form-item-label {
213
+              width: 100%;
214
+              text-align: left;
215
+            }
216
+
217
+            .numInp {
218
+              margin-right: 5px;
219
+            }
220
+
221
+            .line {
222
+              margin-right: 5px;
223
+            }
224
+          }
225
+
226
+          .timer2 {
227
+            .ant-form-item-label {
228
+              line-height: 20px;
229
+            }
230
+          }
231
+        }
232
+
233
+        .editForm {
234
+          .ant-form-item {
235
+            margin-bottom: 15px;
236
+
237
+            .ant-form-item-label {
238
+              line-height: 14px;
239
+              text-align: left;
240
+            }
241
+          }
242
+        }
243
+      }
244
+    }
245
+  }
246
+}

+ 574 - 0
src/app/views/inspection-configuration-item/inspection-configuration-item.component.ts

@@ -0,0 +1,574 @@
1
+import { Component, OnInit, ViewChild, AfterViewInit } 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 difference from 'lodash-es/difference'
8
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
9
+import { NzMessageService } from 'ng-zorro-antd';
10
+@Component({
11
+  selector: "app-inspection-configuration-item",
12
+  templateUrl: "./inspection-configuration-item.component.html",
13
+  styleUrls: ["./inspection-configuration-item.component.less"],
14
+})
15
+export class InspectionConfigurationItemComponent implements OnInit, AfterViewInit {
16
+  @ViewChild("osComponentRef1", {
17
+    read: OverlayScrollbarsComponent,
18
+    static: false,
19
+  })
20
+  osComponentRef1: OverlayScrollbarsComponent;
21
+  constructor(
22
+    private fb: FormBuilder,
23
+    private mainService: MainService,
24
+    private route: ActivatedRoute,
25
+    private router: Router,
26
+    private tool: ToolService,
27
+    private message: NzMessageService,
28
+  ) {}
29
+
30
+  listOfData: any[] = []; //表格数据
31
+  pageIndex: number = 1; //表格当前页码
32
+  pageSize: number = 10; //表格每页展示条数
33
+  listLength: number = 10; //表格总数据量
34
+  modal: boolean = false; //新增/编辑模态框
35
+  add: boolean; //true:新增;false:编辑
36
+  validateForm: FormGroup; //新增/编辑表单
37
+  coopData: any = {}; //当前操作列
38
+  currentHospital; //当前院区
39
+
40
+  btnLoading: boolean = false; //提交按钮loading状态
41
+
42
+  promptContent: string; //操作提示框提示信息
43
+  ifSuccess: boolean; //操作成功/失败
44
+  promptInfo: string; //操作结果提示信息
45
+  promptModalShow: boolean; //操作提示框是否展示
46
+  nextSchemeName = ""; //下一个开启的方案名称
47
+  modelName = ""; //模态框名称
48
+  tableHeight:number = 0;
49
+  pageHeight:number = 0;
50
+
51
+  ngOnInit() {
52
+    this.currentHospital = this.tool.getCurrentHospital();
53
+    this.coopBtns = this.tool.initCoopBtns(this.route);
54
+    this.getInspectionConfigurationDetail(+this.route.snapshot.paramMap.get("id"))
55
+  }
56
+
57
+  ngAfterViewInit(){
58
+    setTimeout(() => {
59
+      this.pageHeight = document.querySelector('.list-template__bottom').clientHeight - document.querySelector('.list-template__top').clientHeight - 8;
60
+      this.tableHeight = this.pageHeight - document.querySelector('.thead').clientHeight;
61
+    }, 0)
62
+  }
63
+
64
+  // 初始化增删改按钮
65
+  coopBtns: any = {};
66
+
67
+  // 获取巡检单详情
68
+  inspectionConfigurationDetail:any = {};
69
+  getInspectionConfigurationDetail(id){
70
+    this.mainService.getFetchData('simple/data','inspectionForm', id).subscribe(result => {
71
+      console.log(result);
72
+      this.inspectionConfigurationDetail = result.data || {};
73
+      this.initForm();
74
+      this.initPageForm();
75
+      this.getDispatchMethods();
76
+      this.getPageList();
77
+    })
78
+  }
79
+
80
+  // 表格数据
81
+  loading1 = false;
82
+  getList() {
83
+    let data = {
84
+      idx: 0,
85
+      sum: 9999,
86
+      inspectionFormItem: {
87
+        hosId: this.currentHospital.id,
88
+        pageId: this.pageActiveId,
89
+        formId: +this.route.snapshot.paramMap.get("id"),
90
+      },
91
+    };
92
+    this.loading1 = true;
93
+    this.mainService
94
+      .getFetchDataList("simple/data", "inspectionFormItem", data)
95
+      .subscribe((data) => {
96
+        this.loading1 = false;
97
+        if (data.status == 200) {
98
+          let list = data.list || [];
99
+          this.listOfData = list.map(v => ({...v, defaultValue: v.defaultValue || ((v.formItemConfigList || []).map(vv => vv.valuex).toString())}));
100
+          this.listLength = data.totalNum;
101
+        }else{
102
+          this.message.error(data.msg || "请求数据失败");
103
+        }
104
+      });
105
+  }
106
+
107
+  // 页码数据
108
+  maskFlag: any = false;
109
+  pageList:any[] = [];
110
+  getPageList() {
111
+    let postData = {
112
+      idx: 0,
113
+      sum: 9999,
114
+      inspectionFormPage: {
115
+        hosId: this.currentHospital.id,
116
+        formId: +this.route.snapshot.paramMap.get("id"),
117
+      },
118
+    };
119
+    this.maskFlag = this.message.loading("正在加载中..", {
120
+      nzDuration: 0,
121
+    }).messageId;
122
+    this.mainService
123
+      .getFetchDataList("simple/data", "inspectionFormPage", postData)
124
+      .subscribe((data) => {
125
+        this.message.remove(this.maskFlag);
126
+          this.maskFlag = false;
127
+        if (data.status == 200) {
128
+          this.pageList = data.list || [];
129
+          if(!this.pageActiveId && this.pageList.length){
130
+            this.pageActiveId = this.pageList[0].id;
131
+            this.getList();
132
+          }
133
+        }else{
134
+          this.message.error(data.msg || "请求数据失败");
135
+        }
136
+      });
137
+  }
138
+
139
+  // 新增弹框
140
+  addModal() {
141
+    this.modelName = "新增";
142
+    this.add = true; //新增
143
+    this.modal = true;
144
+    this.initForm();
145
+  }
146
+  //关闭新增/编辑弹框
147
+  hideAddModal() {
148
+    this.modal = false;
149
+    this.initForm();
150
+  }
151
+
152
+  // 新增弹框
153
+  pageModal:boolean = false;
154
+  addPageModal() {
155
+    this.modelName = "新增";
156
+    this.add = true; //新增
157
+    this.pageModal = true;
158
+    this.initPageForm();
159
+  }
160
+  //关闭新增/编辑弹框
161
+  hideAddPageModal() {
162
+    this.pageModal = false;
163
+    this.initPageForm();
164
+  }
165
+
166
+  // 初始化新增form表单
167
+  validatePageForm: FormGroup; //新增/编辑表单
168
+  initPageForm() {
169
+    this.validatePageForm = this.fb.group({
170
+      name: [null, [Validators.required, Validators.pattern(/\S/)]],//标题
171
+      orders: [null, [Validators.required]],//页码
172
+    });
173
+  }
174
+
175
+  // 返回
176
+  goBack(){
177
+    this.router.navigateByUrl(`/main/inspectionConfiguration`);
178
+  }
179
+
180
+  // 初始化新增form表单
181
+  formArray:string[] = [];
182
+  initForm() {
183
+    this.validateForm = this.fb.group({
184
+      name: [null, [Validators.required]],//巡检项名称
185
+      orders: [null, [Validators.required]],//排序号
186
+      type: [null, [Validators.required]],//填写方式
187
+      valuex: [null],//数值-标准正负值-标准值
188
+      valueGap: [null],//数值-标准正负值-正负范围值
189
+      valueLow: [null],//数值-范围值-最小值
190
+      valueUp: [null],//数值-范围值-最大值
191
+      defaultValueNumber: [null],//数值-默认值
192
+      defaultValueString: [null],//单行/多行-默认值
193
+      required: [null],//是否必填
194
+      checkType: [null],//判断形式
195
+      showError: [null],//异常显示
196
+    });
197
+    console.log(this.validateForm.controls)
198
+    this.formArray = Object.keys(this.validateForm.controls).filter(v => v != 'name' && v != 'orders' && v != 'type');
199
+  }
200
+
201
+  // 动态表单验证
202
+  requiredChange(formItemNames: string[] = []): void {
203
+    // 必填项
204
+    formItemNames.forEach(v => {
205
+      this.validateForm.get(v)!.setValidators(Validators.required);
206
+      this.validateForm.get(v)!.markAsDirty();
207
+      this.validateForm.get(v)!.updateValueAndValidity();
208
+      if(this.validateForm.value.type !== '4'){
209
+        // 除了数值,都要清空
210
+        this.validateForm.controls[v].setValue(null);
211
+      }
212
+    })
213
+
214
+    // 不必填项
215
+    let arr = difference(this.formArray, formItemNames);
216
+    arr.forEach(v => {
217
+      this.validateForm.get(v)!.clearValidators();
218
+      this.validateForm.get(v)!.markAsPristine();
219
+      this.validateForm.get(v)!.updateValueAndValidity();
220
+      this.validateForm.controls[v].setValue(null);
221
+    })
222
+
223
+    console.log(this.validateForm);
224
+  }
225
+
226
+  // 修改填写方式
227
+  changeType(value){
228
+    switch(value){
229
+      case '1':
230
+        this.requiredChange(['required']);
231
+        break;
232
+      case '2':
233
+        this.requiredChange(['required']);
234
+        break;
235
+      case '3':
236
+        this.requiredChange(['required']);
237
+        break;
238
+      case '4':
239
+        this.requiredChange(['required', 'checkType', 'defaultValueNumber']);
240
+        break;
241
+      case '5':
242
+        this.requiredChange(['required', 'defaultValueString', 'showError']);
243
+        break;
244
+      case '6':
245
+        this.requiredChange(['required', 'defaultValueString', 'showError']);
246
+        break;
247
+      case '7':
248
+        this.requiredChange(['required', 'showError']);
249
+        break;
250
+      case '8':
251
+        this.requiredChange();
252
+        break;
253
+    }
254
+  }
255
+
256
+  // 修改判断形式
257
+  changeCheckType(value){
258
+    this.validateForm.controls.defaultValueNumber.setValue(null);
259
+    switch(value){
260
+      case 1:
261
+        this.requiredChange(['required', 'checkType', 'defaultValueNumber', 'valuex', 'valueGap']);
262
+        break;
263
+      case 0:
264
+        this.requiredChange(['required', 'checkType', 'defaultValueNumber', 'valueLow', 'valueUp']);
265
+        break;
266
+    }
267
+  }
268
+
269
+  // 选择项配置
270
+  inspectionConfigurationItemPromptModalShow = false;
271
+  showModelInspectionConfigurationItem(data) {
272
+    this.coopData = data;
273
+    this.inspectionConfigurationItemPromptModalShow = true;
274
+  }
275
+  // 确认选择项配置
276
+  confirmModelInspectionConfigurationItem(e) {
277
+    this.inspectionConfigurationItemPromptModalShow = JSON.parse(e).show;
278
+    this.getList();
279
+  }
280
+  // 关闭选择项配置
281
+  closeModelInspectionConfigurationItem(e) {
282
+    this.inspectionConfigurationItemPromptModalShow = JSON.parse(e).show;
283
+  }
284
+
285
+  //获取填写方式
286
+  isLoading:boolean = false;
287
+  dispatchMethods:any[] = [];
288
+  getDispatchMethods() {
289
+    this.isLoading = true;
290
+    this.mainService.getDictionary("list", "inspection_form_item").subscribe((data) => {
291
+      this.isLoading = false;
292
+      this.dispatchMethods = data || [];
293
+    });
294
+  }
295
+
296
+  // 新增/编辑表单提交
297
+  submitForm(): void {
298
+    for (const i in this.validateForm.controls) {
299
+      this.validateForm.controls[i].markAsDirty();
300
+      this.validateForm.controls[i].updateValueAndValidity();
301
+    }
302
+    if (this.validateForm.invalid) {
303
+      return;
304
+    }
305
+    console.log(this.validateForm.value);
306
+    this.btnLoading = true;
307
+    let postData:any = {};
308
+
309
+    if (this.add) {
310
+      //增加
311
+      postData = {
312
+        inspectionFormItem: {
313
+          name: this.validateForm.value.name,
314
+          valuex: this.validateForm.value.valuex,
315
+          valueGap: this.validateForm.value.valueGap,
316
+          valueLow: this.validateForm.value.valueLow,
317
+          valueUp: this.validateForm.value.valueUp,
318
+          orders: this.validateForm.value.orders,
319
+          defaultValue: this.validateForm.value.defaultValueString || this.validateForm.value.defaultValueNumber,
320
+          required: this.validateForm.value.required,
321
+          checkType: this.validateForm.value.checkType,
322
+          showError: this.validateForm.value.showError,
323
+          type: this.dispatchMethods.find(v => v.value == this.validateForm.value.type),
324
+          hosId: this.currentHospital.id,
325
+          formId: +this.route.snapshot.paramMap.get("id"),
326
+          pageId: this.pageActiveId,
327
+          display: 1,
328
+        }
329
+      };
330
+    } else {
331
+      //编辑
332
+      postData = {
333
+        inspectionFormItem: {
334
+          ...this.coopData,
335
+          ...{
336
+            name: this.validateForm.value.name,
337
+            valuex: this.validateForm.value.valuex,
338
+            valueGap: this.validateForm.value.valueGap,
339
+            valueLow: this.validateForm.value.valueLow,
340
+            valueUp: this.validateForm.value.valueUp,
341
+            orders: this.validateForm.value.orders,
342
+            defaultValue: this.validateForm.value.defaultValueString || this.validateForm.value.defaultValueNumber,
343
+            required: this.validateForm.value.required,
344
+            checkType: this.validateForm.value.checkType,
345
+            showError: this.validateForm.value.showError,
346
+            type: this.dispatchMethods.find(v => v.value == this.validateForm.value.type),
347
+          }
348
+        }
349
+      };
350
+    }
351
+    this.mainService
352
+      .coopData("addData", "inspectionFormItem", postData)
353
+      .subscribe((result) => {
354
+        this.btnLoading = false;
355
+        this.hideAddModal();
356
+        this.initForm();
357
+        let msg = "";
358
+        if (this.add) {
359
+          msg = "新增";
360
+        } else {
361
+          msg = "修改";
362
+        }
363
+        if (result.status == 200) {
364
+          this.showPromptModal(msg, true, '');
365
+        } else {
366
+          this.showPromptModal(msg, false, result.msg);
367
+        }
368
+      });
369
+  }
370
+
371
+  // 编辑
372
+  edit(data) {
373
+    console.log(data);
374
+    this.modelName = "编辑";
375
+    this.add = false;
376
+    this.modal = true;
377
+    this.coopData = data;
378
+    this.validateForm.controls.name.setValue(data.name);
379
+    this.validateForm.controls.valuex.setValue(data.valuex);
380
+    this.validateForm.controls.valueGap.setValue(data.valueGap);
381
+    this.validateForm.controls.valueLow.setValue(data.valueLow);
382
+    this.validateForm.controls.valueUp.setValue(data.valueUp);
383
+    this.validateForm.controls.orders.setValue(data.orders);
384
+    this.validateForm.controls.required.setValue(data.required);
385
+    this.validateForm.controls.checkType.setValue(data.checkType);
386
+    this.validateForm.controls.showError.setValue(data.showError);
387
+    this.validateForm.controls.type.setValue(data.type.value);
388
+    if(data.type.value === '5' || data.type.value === '6'){
389
+      this.validateForm.controls.defaultValueString.setValue(data.defaultValue);
390
+    }
391
+    if(data.type.value === '4'){
392
+      this.validateForm.controls.defaultValueNumber.setValue(data.defaultValue);
393
+    }
394
+  }
395
+
396
+  // 新增/编辑表单提交-页码
397
+  submitPageForm(): void {
398
+    for (const i in this.validatePageForm.controls) {
399
+      this.validatePageForm.controls[i].markAsDirty();
400
+      this.validatePageForm.controls[i].updateValueAndValidity();
401
+    }
402
+    if (this.validatePageForm.invalid) {
403
+      return;
404
+    }
405
+
406
+    this.btnLoading = true;
407
+    let postData:any = {};
408
+
409
+    if (this.add) {
410
+      //增加
411
+      postData = {
412
+        name: this.validatePageForm.value.name,
413
+        orders: this.validatePageForm.value.orders,
414
+        hosId: this.currentHospital.id,
415
+        formId: +this.route.snapshot.paramMap.get("id"),
416
+      };
417
+    } else {
418
+      //编辑
419
+      postData = {
420
+        ...this.coopData,
421
+        ...{
422
+          name: this.validatePageForm.value.name,
423
+          orders: this.validatePageForm.value.orders,
424
+        }
425
+      };
426
+    }
427
+    this.mainService
428
+      .simplePost("addData", "inspectionFormPage", postData)
429
+      .subscribe((result) => {
430
+        this.btnLoading = false;
431
+        this.hideAddPageModal();
432
+        this.initPageForm();
433
+        let msg = "";
434
+        if (this.add) {
435
+          msg = "新增";
436
+        } else {
437
+          msg = "修改";
438
+        }
439
+        if (result.status == 200) {
440
+          if(this.add){
441
+            this.pageActiveId = result.data.id;
442
+          }
443
+          this.showPromptModal(msg, true, '');
444
+        } else {
445
+          this.showPromptModal(msg, false, result.msg);
446
+        }
447
+      });
448
+  }
449
+
450
+  // 编辑
451
+  editPage(data) {
452
+    console.log(data);
453
+    this.modelName = "编辑";
454
+    this.add = false;
455
+    this.pageModal = true;
456
+    this.coopData = data;
457
+    this.validatePageForm.controls.name.setValue(data.name); //名称
458
+    this.validatePageForm.controls.orders.setValue(data.orders); //页码
459
+  }
460
+
461
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
462
+  showPromptModal(con, success, promptInfo?) {
463
+    this.promptModalShow = false;
464
+    this.promptContent = con;
465
+    this.ifSuccess = success;
466
+    this.promptInfo = promptInfo;
467
+    setTimeout(() => {
468
+      this.promptModalShow = true;
469
+    }, 100);
470
+    this.getList();
471
+    this.getPageList();
472
+  }
473
+
474
+  delModal: boolean = false; //删除模态框
475
+  tipsMsg1: string; //提示框信息
476
+  tipsMsg2: string; //操作后信息
477
+  confirmDelType: string; //确认的类型(启用/停用,删除)
478
+  showDelModal(
479
+    data,
480
+    tipsMsg1: string,
481
+    tipsMsg2: string,
482
+    type: string,
483
+  ) {
484
+    this.confirmDelType = type;
485
+    this.delModal = true;
486
+    this.coopData = data;
487
+    this.tipsMsg1 = tipsMsg1;
488
+    this.tipsMsg2 = tipsMsg2;
489
+  }
490
+  // 隐藏删除框
491
+  hideDelModal() {
492
+    this.delModal = false;
493
+  }
494
+  // 确认删除
495
+  confirmDel() {
496
+    this.btnLoading = true;
497
+    if (this.confirmDelType === "del") {
498
+      //删除-巡检项
499
+      this.mainService
500
+        .simplePost("rmvData", "inspectionFormItem", [this.coopData.id])
501
+        .subscribe((data) => {
502
+          this.btnLoading = false;
503
+          this.delModal = false;
504
+          if (data.status == 200) {
505
+            this.showPromptModal(this.tipsMsg2, true, "");
506
+          } else {
507
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
508
+          }
509
+        });
510
+    } else if (this.confirmDelType === "show") {
511
+      //显示-巡检项
512
+      let postData = {
513
+        inspectionFormItem: {
514
+          ...this.coopData,
515
+          ...{
516
+            display: 1,
517
+          }
518
+        }
519
+      }
520
+      this.mainService
521
+        .coopData("addData", "inspectionFormItem", postData)
522
+        .subscribe((data) => {
523
+          this.btnLoading = false;
524
+          this.delModal = false;
525
+          if (data.status == 200) {
526
+            this.showPromptModal(this.tipsMsg2, true, "");
527
+          } else {
528
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
529
+          }
530
+        });
531
+    } else if (this.confirmDelType === "hidden") {
532
+      //隐藏-巡检项
533
+      let postData = {
534
+        inspectionFormItem: {
535
+          ...this.coopData,
536
+          ...{
537
+            display: 0,
538
+          }
539
+        }
540
+      }
541
+      this.mainService
542
+        .coopData("addData", "inspectionFormItem", postData)
543
+        .subscribe((data) => {
544
+          this.btnLoading = false;
545
+          this.delModal = false;
546
+          if (data.status == 200) {
547
+            this.showPromptModal(this.tipsMsg2, true, "");
548
+          } else {
549
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
550
+          }
551
+        });
552
+    } else if (this.confirmDelType === "delPage") {
553
+      //删除-页码
554
+      this.mainService
555
+        .simplePost("rmvData", "inspectionFormPage", [this.coopData.id])
556
+        .subscribe((data) => {
557
+          this.btnLoading = false;
558
+          this.delModal = false;
559
+          if (data.status == 200) {
560
+            this.showPromptModal(this.tipsMsg2, true, "");
561
+          } else {
562
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
563
+          }
564
+        });
565
+    }
566
+  }
567
+
568
+  // 点击页码
569
+  pageActiveId;
570
+  clickPage(data) {
571
+    this.pageActiveId = data.id;
572
+    this.getList();
573
+  }
574
+}

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

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

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

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

+ 94 - 0
src/app/views/inspection-configuration/inspection-configuration.component.html

@@ -0,0 +1,94 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox"></div>
5
+      <div nz-col nzLg="6" class="list-template__btns">
6
+        <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="addModal()">新增</button>
7
+      </div>
8
+    </div>
9
+    <div class="list-template__bottom">
10
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
11
+        [nzLoading]="loading1">
12
+        <thead>
13
+          <tr class="thead">
14
+            <th nzWidth="20%">表单名称</th>
15
+            <th nzWidth="20%">是否显示生成维修单</th>
16
+            <th nzWidth="20%">是否自动生成维修单</th>
17
+            <th nzWidth="20%">状态</th>
18
+            <th nzWidth="20%">操作</th>
19
+          </tr>
20
+        </thead>
21
+        <tbody>
22
+          <tr *ngFor="let data of listOfData;let i = index">
23
+            <td>{{data.name}}</td>
24
+            <td>{{data.showOrder ? '是' : '否'}}</td>
25
+            <td>{{data.createOrder ? '是' : '否'}}</td>
26
+            <td>{{data.status.name}}</td>
27
+            <td>
28
+              <div class="coop">
29
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
30
+                <span *ngIf="coopBtns.publish && data.status.value === '0'" (click)="showDelModal(data,'您确认要发布吗?','发布','publish')">发布</span>
31
+                <span *ngIf="coopBtns.config" (click)="toItem(data)">配置巡检项</span>
32
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'删除后您将无法引用此表单,现有关联的计划可继续使用','删除','del')">删除</span>
33
+              </div>
34
+            </td>
35
+          </tr>
36
+        </tbody>
37
+      </nz-table>
38
+      <div class="list-template__pagination">
39
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
40
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
41
+        </nz-pagination>
42
+      </div>
43
+    </div>
44
+  </div>
45
+
46
+  <!-- 新增/编辑模态框 -->
47
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
48
+    <div class="modalBody">
49
+      <div class="title">{{modelName}}巡检单<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
50
+      <div class="content">
51
+        <form nz-form [formGroup]="validateForm" class="addForm">
52
+          <nz-form-item>
53
+            <nz-form-label class="line_height_normal" [nzSpan]="5" nzRequired nzFor="name">表单名称</nz-form-label>
54
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入表单名称!">
55
+              <nz-input-group>
56
+                <textarea formControlName="name" nz-input
57
+                  placeholder="请输入表单名称"></textarea>
58
+              </nz-input-group>
59
+            </nz-form-control>
60
+          </nz-form-item>
61
+          <nz-form-item>
62
+            <nz-form-label [nzSpan]="9" nzRequired nzFor="showOrder">是否显示生成维修单</nz-form-label>
63
+            <nz-form-control [nzSpan]="15" nzErrorTip="请选择是否显示生成维修单!">
64
+              <nz-radio-group formControlName="showOrder">
65
+                <label nz-radio [nzValue]="1">是</label>
66
+                <label nz-radio [nzValue]="0">否</label>
67
+              </nz-radio-group>
68
+            </nz-form-control>
69
+          </nz-form-item>
70
+          <nz-form-item>
71
+            <nz-form-label [nzSpan]="9" nzRequired nzFor="createOrder">是否自动生成维修单</nz-form-label>
72
+            <nz-form-control [nzSpan]="15" nzErrorTip="请选择是否自动生成维修单!">
73
+              <nz-radio-group formControlName="createOrder">
74
+                <label nz-radio [nzValue]="1">是</label>
75
+                <label nz-radio [nzValue]="0">否</label>
76
+              </nz-radio-group>
77
+            </nz-form-control>
78
+          </nz-form-item>
79
+        </form>
80
+      </div>
81
+      <div class=" display_flex justify-content_flex-center">
82
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">{{add ? '保存并配置' : '保存'}}</button>
83
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
84
+      </div>
85
+    </div>
86
+  </div>
87
+  <!-- 模态框 -->
88
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
89
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
90
+</div>
91
+<!-- 操作成功/失败提示框 -->
92
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
93
+  [info]="promptInfo">
94
+</app-prompt-modal>

+ 173 - 0
src/app/views/inspection-configuration/inspection-configuration.component.less

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

+ 240 - 0
src/app/views/inspection-configuration/inspection-configuration.component.ts

@@ -0,0 +1,240 @@
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
+@Component({
9
+  selector: "app-inspection-configuration",
10
+  templateUrl: "./inspection-configuration.component.html",
11
+  styleUrls: ["./inspection-configuration.component.less"],
12
+})
13
+export class InspectionConfigurationComponent implements OnInit {
14
+  constructor(
15
+    private fb: FormBuilder,
16
+    private mainService: MainService,
17
+    private route: ActivatedRoute,
18
+    private router: Router,
19
+    private tool: ToolService,
20
+    private message: NzMessageService,
21
+  ) {}
22
+
23
+  listOfData: any[] = []; //表格数据
24
+  pageIndex: number = 1; //表格当前页码
25
+  pageSize: number = 10; //表格每页展示条数
26
+  listLength: number = 10; //表格总数据量
27
+  modal: boolean = false; //新增/编辑模态框
28
+  add: boolean; //true:新增;false:编辑
29
+  validateForm: FormGroup; //新增/编辑表单
30
+  coopData: any; //当前操作列
31
+  currentHospital; //当前院区
32
+
33
+  btnLoading: boolean = false; //提交按钮loading状态
34
+
35
+  promptContent: string; //操作提示框提示信息
36
+  ifSuccess: boolean; //操作成功/失败
37
+  promptInfo: string; //操作结果提示信息
38
+  promptModalShow: boolean; //操作提示框是否展示
39
+  nextSchemeName = ""; //下一个开启的方案名称
40
+  modelName = ""; //模态框名称
41
+
42
+  ngOnInit() {
43
+    this.currentHospital = this.tool.getCurrentHospital();
44
+    this.coopBtns = this.tool.initCoopBtns(this.route);
45
+    this.initForm();
46
+    this.getList(1);
47
+  }
48
+
49
+  // 初始化增删改按钮
50
+  coopBtns: any = {};
51
+
52
+  // 表格数据
53
+  loading1 = false;
54
+  getList(type) {
55
+    if (type == 1) {
56
+      this.pageIndex = 1;
57
+    }
58
+    let data = {
59
+      idx: this.pageIndex - 1,
60
+      sum: this.pageSize,
61
+      inspectionForm: {
62
+        hosId: this.currentHospital.id,
63
+      },
64
+    };
65
+    this.loading1 = true;
66
+    this.mainService
67
+      .getFetchDataList("simple/data", "inspectionForm", data)
68
+      .subscribe((data) => {
69
+        this.loading1 = false;
70
+        if (data.status == 200) {
71
+          this.listOfData = data.list;
72
+          this.listLength = data.totalNum;
73
+        }else{
74
+          this.message.error(data.msg || "请求数据失败");
75
+        }
76
+      });
77
+  }
78
+
79
+  // 新增弹框
80
+  addModal() {
81
+    this.modelName = "新增";
82
+    this.add = true; //新增
83
+    this.modal = true;
84
+    this.initForm();
85
+  }
86
+  //关闭新增/编辑弹框
87
+  hideAddModal() {
88
+    this.modal = false;
89
+    this.initForm();
90
+  }
91
+
92
+  // 初始化新增form表单
93
+  initForm() {
94
+    this.validateForm = this.fb.group({
95
+      name: ['', [Validators.required, Validators.pattern(/\S/)]],
96
+      showOrder: [0, [Validators.required]],
97
+      createOrder: [0, [Validators.required]],
98
+    });
99
+  }
100
+
101
+  // 新增/编辑表单提交
102
+  submitForm(): void {
103
+    for (const i in this.validateForm.controls) {
104
+      this.validateForm.controls[i].markAsDirty();
105
+      this.validateForm.controls[i].updateValueAndValidity();
106
+    }
107
+    if (this.validateForm.invalid) {
108
+      return;
109
+    }
110
+    this.btnLoading = true;
111
+    let data:any = {};
112
+
113
+    if (this.add) {
114
+      //增加
115
+      data = {
116
+        name: this.validateForm.value.name,
117
+        showOrder: this.validateForm.value.showOrder,
118
+        createOrder: this.validateForm.value.createOrder,
119
+        hosId: this.currentHospital.id,
120
+      };
121
+    } else {
122
+      //编辑
123
+      data = {
124
+        ...this.coopData,
125
+        ...{
126
+          name: this.validateForm.value.name,
127
+          showOrder: this.validateForm.value.showOrder,
128
+          createOrder: this.validateForm.value.createOrder,
129
+        }
130
+      };
131
+    }
132
+    this.mainService
133
+      .simplePost("addData", "inspectionForm", data)
134
+      .subscribe((result) => {
135
+        this.btnLoading = false;
136
+        this.hideAddModal();
137
+        this.initForm();
138
+        if (result.status == 200) {
139
+          if (this.add) {
140
+            this.listLength++;
141
+            this.router.navigateByUrl(`/main/inspectionConfigurationItem/${result.data.id}`);
142
+          } else {
143
+            this.showPromptModal("编辑", true, "");
144
+          }
145
+        } else {
146
+          let msg = "";
147
+          if (this.add) {
148
+            msg = "新增";
149
+          } else {
150
+            msg = "修改";
151
+          }
152
+          this.showPromptModal(msg, false, result.msg);
153
+        }
154
+      });
155
+  }
156
+
157
+  // 编辑
158
+  edit(data) {
159
+    console.log(data);
160
+    this.modelName = "编辑";
161
+    this.add = false;
162
+    this.modal = true;
163
+    this.coopData = data;
164
+    this.validateForm.controls.name.setValue(data.name); //名称
165
+    this.validateForm.controls.showOrder.setValue(data.showOrder);
166
+    this.validateForm.controls.createOrder.setValue(data.createOrder);
167
+  }
168
+
169
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
170
+  showPromptModal(con, success, promptInfo?) {
171
+    this.promptModalShow = false;
172
+    this.promptContent = con;
173
+    this.ifSuccess = success;
174
+    this.promptInfo = promptInfo;
175
+    setTimeout(() => {
176
+      this.promptModalShow = true;
177
+    }, 100);
178
+    this.getList(0);
179
+  }
180
+
181
+  // 跳转到配置项
182
+  toItem(data){
183
+    this.router.navigateByUrl(`/main/inspectionConfigurationItem/${data.id}`);
184
+  }
185
+
186
+  delModal: boolean = false; //删除模态框
187
+  tipsMsg1: string; //提示框信息
188
+  tipsMsg2: string; //操作后信息
189
+  confirmDelType: string; //确认的类型(启用/停用,删除)
190
+  showDelModal(
191
+    data,
192
+    tipsMsg1: string,
193
+    tipsMsg2: string,
194
+    type: string,
195
+  ) {
196
+    this.confirmDelType = type;
197
+    this.delModal = true;
198
+    this.coopData = data;
199
+    this.tipsMsg1 = tipsMsg1;
200
+    this.tipsMsg2 = tipsMsg2;
201
+  }
202
+  // 隐藏删除框
203
+  hideDelModal() {
204
+    this.delModal = false;
205
+  }
206
+  // 确认删除
207
+  confirmDel() {
208
+    this.btnLoading = true;
209
+    if (this.confirmDelType === "del") {
210
+      //删除
211
+      this.mainService
212
+        .simplePost("rmvData", "inspectionForm", [this.coopData.id])
213
+        .subscribe((data) => {
214
+          this.btnLoading = false;
215
+          this.delModal = false;
216
+          if (data.status == 200) {
217
+            this.showPromptModal(this.tipsMsg2, true, "");
218
+          } else {
219
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
220
+          }
221
+        });
222
+    } else if (this.confirmDelType === "publish") {
223
+      //发布
224
+      let data = {
225
+        formId: this.coopData.id,
226
+      };
227
+      this.mainService
228
+        .inspectionPost("formPublish", data)
229
+        .subscribe((result) => {
230
+          this.btnLoading = false;
231
+          this.delModal = false;
232
+          if (result.status == 200) {
233
+            this.showPromptModal(this.tipsMsg2, true, "");
234
+          } else {
235
+            this.showPromptModal(this.tipsMsg2, false, result.msg);
236
+          }
237
+        });
238
+    }
239
+  }
240
+}

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

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

+ 25 - 0
src/app/views/inspection-execute/inspection-execute-routing.module.ts

@@ -0,0 +1,25 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { InspectionExecuteComponent } from './inspection-execute.component';
4
+import { InspectionExecuteDetailComponent } from 'src/app/share/inspection-execute-detail/inspection-execute-detail.component';
5
+
6
+
7
+const routes: Routes = [
8
+  {
9
+    path: '',
10
+    component: InspectionExecuteComponent,
11
+    children: [
12
+      {
13
+        // 查看详情
14
+        path: 'inspectionExecuteDetail/:id',
15
+        component: InspectionExecuteDetailComponent,
16
+      }
17
+    ]
18
+  }
19
+];
20
+
21
+@NgModule({
22
+  imports: [RouterModule.forChild(routes)],
23
+  exports: [RouterModule]
24
+})
25
+export class InspectionExecuteRoutingModule { }

+ 129 - 0
src/app/views/inspection-execute/inspection-execute.component.html

@@ -0,0 +1,129 @@
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
+          <input nz-input class="formItem" placeholder="请输入单号" [(ngModel)]="searchDto.code" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">计划主题</span>:
11
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
12
+            (nzOnSearch)="changeInp('search', 'inspectionPlan', $event)" nzAllowClear nzPlaceHolder="请选择计划主题" [(ngModel)]="searchDto.inspectionId" (ngModelChange)="changeInspection($event)">
13
+            <ng-container *ngFor="let option of inspectionPlanSearchList">
14
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
15
+            </ng-container>
16
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
17
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
18
+            </nz-option>
19
+          </nz-select>
20
+        </div>
21
+        <div class="list-template__searchItem">
22
+          <span class="label">批次号</span>:
23
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
24
+            (nzOnSearch)="changeInp('search', 'inspectionBatch', $event)" nzAllowClear nzPlaceHolder="请选择批次号" [(ngModel)]="searchDto.batchId">
25
+            <ng-container *ngFor="let option of inspectionBatchSearchList">
26
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.batchNo" [nzValue]="option.id"></nz-option>
27
+            </ng-container>
28
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
29
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
30
+            </nz-option>
31
+          </nz-select>
32
+        </div>
33
+        <div class="list-template__searchItem">
34
+          <span class="label">状态</span>:
35
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" [(ngModel)]="searchDto.statusId">
36
+            <ng-container *ngFor="let option of statusSearchList">
37
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
38
+            </ng-container>
39
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
40
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
41
+            </nz-option>
42
+          </nz-select>
43
+        </div>
44
+        <div class="list-template__searchItem">
45
+          <span class="label">是否异常</span>:
46
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择" [(ngModel)]="searchDto.exceptionId">
47
+            <ng-container *ngFor="let option of exceptionList">
48
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
49
+            </ng-container>
50
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
51
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
52
+            </nz-option>
53
+          </nz-select>
54
+        </div>
55
+      </div>
56
+      <div nz-col nzLg="8" class="list-template__btns">
57
+        <button nz-button *ngIf="coopBtns.del" [disabled]="!checkedDepIds.length" class="btn default" (click)="showDelModal(data,'您确认要删除选中的巡检任务吗?','删除','delList')">批量删除</button>
58
+        <button nz-button *ngIf="coopBtns.designate" [disabled]="!checkedDepIds.length" class="btn default ml8" (click)="showInspectionExecuteAssign()">批量指派</button>
59
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
60
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
61
+      </div>
62
+    </div>
63
+    <div class="list-template__bottom">
64
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
65
+        [nzLoading]="loading1">
66
+        <thead>
67
+          <tr class="thead">
68
+            <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" (nzCheckedChange)="checkAll($event)"></th>
69
+            <th nzWidth="10%">单号</th>
70
+            <th nzWidth="10%">计划主题|批次号</th>
71
+            <th nzWidth="10%">巡检点|巡检单</th>
72
+            <th nzWidth="10%">截至时间</th>
73
+            <th nzWidth="10%">签到方式</th>
74
+            <th nzWidth="10%">执行人|组</th>
75
+            <th nzWidth="10%">是否异常</th>
76
+            <th nzWidth="10%">状态</th>
77
+            <th nzWidth="15%">操作</th>
78
+          </tr>
79
+        </thead>
80
+        <tbody>
81
+          <tr *ngFor="let data of listOfData;let i = index" (click)="selectedListData(data)">
82
+            <td nzShowCheckbox [nzDisabled]="data.status.value != 1" [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
83
+            <td>{{data.code}}</td>
84
+            <td>{{data.inspectionDTO?.name}}<br>{{data.batchNo}}</td>
85
+            <td>{{data.inspectionNodeDTO?.name}}<br>{{data.inspectionDTO?.inspectionFormDTO?.name}}</td>
86
+            <td>{{data.overtime | date:'yyyy-MM-dd HH:mm'}}</td>
87
+            <td>{{data.signType?.name}}</td>
88
+            <td>{{data.userDTO?.name || data.groupDTO?.groupName}}</td>
89
+            <td [ngClass]="{ red: data.exception === 1 }">{{data.exception === 1 ? '是' : '否'}}</td>
90
+            <td>{{data.status?.name}}</td>
91
+            <td>
92
+              <div class="coop">
93
+                <span *ngIf="coopBtns.look" (click)="detail($event,data.id)">查看</span>
94
+                <span *ngIf="coopBtns.designate && data.status.value == 1" (click)="showInspectionExecuteAssign(data)">指派</span>
95
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'您确认要删除选中的巡检任务吗?','删除','del')">删除</span>
96
+              </div>
97
+            </td>
98
+          </tr>
99
+        </tbody>
100
+      </nz-table>
101
+      <div class="list-template__pagination">
102
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
103
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
104
+        </nz-pagination>
105
+      </div>
106
+    </div>
107
+  </div>
108
+</div>
109
+<!-- 模态框 -->
110
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
111
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
112
+<!-- 操作成功/失败提示框 -->
113
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
114
+  [info]="promptInfo">
115
+</app-prompt-modal>
116
+
117
+<!-- 指派 -->
118
+<app-inspection-execute-assign-prompt-modal
119
+  [deptFlag]="inspectionExecuteAssignPromptModalShow"
120
+  (submitFormHand)="confirmModelInspectionExecuteAssign($event)"
121
+  (deptFlagHand)="closeModelInspectionExecuteAssign($event)"
122
+  *ngIf="inspectionExecuteAssignPromptModalShow"
123
+></app-inspection-execute-assign-prompt-modal>
124
+
125
+<!-- 遮罩 -->
126
+<app-mask *ngIf="maskFlag"></app-mask>
127
+
128
+<!-- 查看详情 -->
129
+<router-outlet></router-outlet>

+ 176 - 0
src/app/views/inspection-execute/inspection-execute.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
+}

+ 327 - 0
src/app/views/inspection-execute/inspection-execute.component.ts

@@ -0,0 +1,327 @@
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-execute",
12
+  templateUrl: "./inspection-execute.component.html",
13
+  styleUrls: ["./inspection-execute.component.less"],
14
+})
15
+export class InspectionExecuteComponent 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] === 'inspectionPlan'){
51
+        this.getIncidentPlans(v[0], v[2]);
52
+      } else if(v[1] === 'inspectionBatch'){
53
+        this.getInspectionBatchs(v[0], v[2]);
54
+      }
55
+    });
56
+    this.currentHospital = this.tool.getCurrentHospital();
57
+    this.coopBtns = this.tool.initCoopBtns(this.route);
58
+    this.getList(1);
59
+    this.getIncidentPlans('search', '');
60
+    this.getStatus();
61
+  }
62
+
63
+  // 初始化增删改按钮
64
+  coopBtns: any = {};
65
+
66
+  // 查看
67
+  detail(e, id) {
68
+    e.stopPropagation();
69
+    this.router.navigateByUrl("/main/inspectionExecute/inspectionExecuteDetail/" + id);
70
+  }
71
+
72
+  // 派单给人
73
+  inspectionExecuteAssignPromptModalShow = false;
74
+  showInspectionExecuteAssign(data?) {
75
+    this.coopData = data;
76
+    this.inspectionExecuteAssignPromptModalShow = true;
77
+  }
78
+  // 关闭弹窗
79
+  closeModelInspectionExecuteAssign(e) {
80
+    this.inspectionExecuteAssignPromptModalShow = JSON.parse(e).show;
81
+  }
82
+  // 确认弹窗
83
+  maskFlag: any = false;
84
+  confirmModelInspectionExecuteAssign(userId) {
85
+    this.maskFlag = this.message.loading("正在加载中..", {
86
+      nzDuration: 0,
87
+    }).messageId;
88
+    this.inspectionExecuteAssignPromptModalShow = true;
89
+    console.log(userId);
90
+    let postData:any = {
91
+      taskIds: this.coopData ? this.coopData.id.toString() : this.checkedDepIds.toString(),
92
+      userId,
93
+    };
94
+    console.log(postData);
95
+    this.btnLoading = true;
96
+    this.mainService
97
+      .inspectionPost("batchAssignTask", postData)
98
+      .subscribe((result) => {
99
+        this.message.remove(this.maskFlag);
100
+        this.maskFlag = false;
101
+        this.btnLoading = false;
102
+        if (result.status == 200) {
103
+          this.inspectionExecuteAssignPromptModalShow = false;
104
+          this.showPromptModal('操作', true, '');
105
+        } else {
106
+          this.showPromptModal('操作', false, result.msg);
107
+        }
108
+      });
109
+  }
110
+
111
+  // 选中表格单列
112
+  mapOfCheckedId: { [key: string]: boolean } = {};
113
+  checkedDepIds:any[] = []; //已选中单列id
114
+  refreshStatus(): void {
115
+    let listOfData = this.listOfData.filter(
116
+      (item) => item.status.value == 1
117
+    );
118
+    this.isAllDisplayDataChecked = listOfData.every(
119
+      (item) => this.mapOfCheckedId[item.id]
120
+    );
121
+    let arr:any[] = [];
122
+    for (var k in this.mapOfCheckedId) {
123
+      if (this.mapOfCheckedId[k]) {
124
+        arr.push(Number(k));
125
+      }
126
+    }
127
+    this.checkedDepIds = arr;
128
+  }
129
+  // 整行操作
130
+  selectedListData(data) {
131
+    if (data.status.value != 1) {
132
+      return;
133
+    }
134
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
135
+    this.refreshStatus();
136
+  }
137
+  // 全选
138
+  isAllDisplayDataChecked = false; //当前页是否全选
139
+  checkAll(value: boolean): void {
140
+    this.listOfData.forEach((item) => {
141
+      if (item.status.value == 1) {
142
+        this.mapOfCheckedId[item.id] = value;
143
+      }
144
+    });
145
+    this.refreshStatus();
146
+  }
147
+
148
+  // 搜索
149
+  search() {
150
+    this.getList(1);
151
+  }
152
+  // 重置
153
+  reset() {
154
+    this.inspectionBatchSearchList = [];
155
+    this.searchDto = {};
156
+    this.getList(1);
157
+  }
158
+
159
+  // 表格数据
160
+  searchDto: any = {};
161
+  loading1 = false;
162
+  getList(type) {
163
+    if (type == 1) {
164
+      this.pageIndex = 1;
165
+    }
166
+    let data = {
167
+      idx: this.pageIndex - 1,
168
+      sum: this.pageSize,
169
+      inspectionTask: {
170
+        hosId: this.currentHospital.id,
171
+        code: this.searchDto.code || undefined,
172
+        inspectionId: this.searchDto.inspectionId || undefined,
173
+        batchId: this.searchDto.batchId || undefined,
174
+        status: this.searchDto.statusId ? { id: this.searchDto.statusId } : undefined,
175
+        exception: this.searchDto.exceptionId === undefined ? undefined : this.searchDto.exceptionId,
176
+      },
177
+    };
178
+    this.mapOfCheckedId = {};
179
+    this.checkedDepIds = [];
180
+    this.isAllDisplayDataChecked = false;
181
+    this.loading1 = true;
182
+    this.mainService
183
+      .getFetchDataList("simple/data", "inspectionTask", data)
184
+      .subscribe((data) => {
185
+        this.loading1 = false;
186
+        if (data.status == 200) {
187
+          this.listOfData = data.list;
188
+          this.listLength = data.totalNum;
189
+        }else{
190
+          this.message.error(data.msg || "请求数据失败");
191
+        }
192
+      });
193
+  }
194
+
195
+  // 边输边搜节流阀
196
+  isLoading = false;
197
+  changeInp(type, model, e) {
198
+    this.isLoading = true;
199
+    this.changeInpSubject.next([type, model, e]);
200
+  }
201
+
202
+  // 获取巡检计划
203
+  inspectionPlanSearchList: any = []; //所有所属科室(搜索)
204
+  getIncidentPlans(type, keyword, init = false) {
205
+    let postData = {
206
+      inspection: {
207
+        name: keyword,
208
+        hosId: this.currentHospital.id,
209
+      },
210
+      idx: 0,
211
+      sum: 20,
212
+    };
213
+    this.mainService
214
+      .getFetchDataList("data", "inspection", postData)
215
+      .subscribe((data) => {
216
+        this.inspectionPlanSearchList = data.list;
217
+        this.isLoading = false;
218
+      });
219
+  }
220
+
221
+  // 获取批次
222
+  inspectionBatchSearchList: any = [];
223
+  getInspectionBatchs(type, keyword, init = false) {
224
+    let postData = {
225
+      inspectionBatch: {
226
+        name: keyword,
227
+        hosId: this.currentHospital.id,
228
+        inspectionId: this.searchDto.inspectionId || undefined,
229
+      },
230
+      idx: 0,
231
+      sum: 20,
232
+    };
233
+    this.mainService
234
+      .getFetchDataList("simple/data", "inspectionBatch", postData)
235
+      .subscribe((data) => {
236
+        this.inspectionBatchSearchList = data.list;
237
+        this.isLoading = false;
238
+      });
239
+  }
240
+
241
+  // 修改巡检计划
242
+  changeInspection(e){
243
+    this.inspectionBatchSearchList = [];
244
+    this.searchDto.inspectionBatchId = null;
245
+    this.getInspectionBatchs('search', '');
246
+  }
247
+
248
+  //获取状态
249
+  statusSearchList:any[] = [];
250
+  getStatus() {
251
+    this.mainService
252
+    .getDictionary('list', 'inspection_task_status')
253
+    .subscribe((data) => {
254
+      this.statusSearchList = data || [];
255
+    });
256
+  }
257
+
258
+  // 是否异常
259
+  exceptionList:any[] = [
260
+    { id: 0, name: "否" },
261
+    { id: 1, name: "是" },
262
+  ];
263
+
264
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
265
+  showPromptModal(con, success, promptInfo?) {
266
+    this.promptModalShow = false;
267
+    this.promptContent = con;
268
+    this.ifSuccess = success;
269
+    this.promptInfo = promptInfo;
270
+    setTimeout(() => {
271
+      this.promptModalShow = true;
272
+    }, 100);
273
+    this.getList(0);
274
+  }
275
+
276
+  delModal: boolean = false; //删除模态框
277
+  tipsMsg1: string; //提示框信息
278
+  tipsMsg2: string; //操作后信息
279
+  confirmDelType: string; //确认的类型(启用/停用,删除)
280
+  showDelModal(
281
+    data,
282
+    tipsMsg1: string,
283
+    tipsMsg2: string,
284
+    type: string,
285
+  ) {
286
+    this.confirmDelType = type;
287
+    this.delModal = true;
288
+    this.coopData = data;
289
+    this.tipsMsg1 = tipsMsg1;
290
+    this.tipsMsg2 = tipsMsg2;
291
+  }
292
+  // 隐藏删除框
293
+  hideDelModal() {
294
+    this.delModal = false;
295
+  }
296
+  // 确认删除
297
+  confirmDel() {
298
+    this.btnLoading = true;
299
+    if (this.confirmDelType === "del") {
300
+      //删除
301
+      this.mainService
302
+        .simplePost("rmvData", "inspectionTask", [this.coopData.id])
303
+        .subscribe((data) => {
304
+          this.btnLoading = false;
305
+          this.delModal = false;
306
+          if (data.status == 200) {
307
+            this.showPromptModal(this.tipsMsg2, true, "");
308
+          } else {
309
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
310
+          }
311
+        });
312
+    } else if (this.confirmDelType === "delList") {
313
+      //批量删除
314
+      this.mainService
315
+        .simplePost("rmvData", "inspectionTask", this.checkedDepIds)
316
+        .subscribe((data) => {
317
+          this.btnLoading = false;
318
+          this.delModal = false;
319
+          if (data.status == 200) {
320
+            this.showPromptModal(this.tipsMsg2, true, "");
321
+          } else {
322
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
323
+          }
324
+        });
325
+    }
326
+  }
327
+}

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

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

+ 18 - 0
src/app/views/inspection-plan-config/inspection-plan-config-routing.module.ts

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

+ 92 - 0
src/app/views/inspection-plan-config/inspection-plan-config.component.html

@@ -0,0 +1,92 @@
1
+<div class="inspectionPlanConfig">
2
+  <div class="tagsAndTemplete">
3
+    <div class="tags">
4
+      <i class="icon_transport transport-24gf-tags"></i>
5
+      <span *ngFor="let tag of tagList" (click)="clickTag(tag)">{{ tag.name }}</span>
6
+    </div>
7
+    <div class="template">
8
+      <button nz-button class="btn default" (click)="showInspectionTemplate()">引入模板</button>
9
+    </div>
10
+  </div>
11
+
12
+  <div class="content">
13
+    <div class="contentInner">
14
+      <div class="address">
15
+        <div class="contentHead">选择巡检点</div>
16
+        <overlay-scrollbars #osComponentRef1 class="contentBody">
17
+          <nz-tree
18
+            #nzTreeComponent
19
+            [nzData]="buildingAndAddressList"
20
+            nzCheckable
21
+            [nzCheckedKeys]="defaultCheckedKeys"
22
+            [nzExpandedKeys]="defaultExpandedKeys"
23
+            [nzSelectedKeys]="defaultSelectedKeys"
24
+            (nzCheckBoxChange)="nzCheck($event)"
25
+          >
26
+          </nz-tree>
27
+        </overlay-scrollbars>
28
+      </div>
29
+      <div class="addressCopy">
30
+        <div class="contentHead">选中巡检点</div>
31
+        <overlay-scrollbars #osComponentRef2 class="contentBody">
32
+          <nz-tree #nzTreeComponentCopy [nzData]="buildingAndAddressListCopy" (nzClick)="nzClick($event)"></nz-tree>
33
+        </overlay-scrollbars>
34
+      </div>
35
+      <div class="addressAssign">
36
+        <div class="contentHead">巡检点分配</div>
37
+        <div class="contentBody" *ngIf="activeAddressId">
38
+          <div class="list-template__searchItem">
39
+            <nz-radio-group [(ngModel)]="activeAddress.origin.radioValue">
40
+              <label nz-radio [nzValue]="1">派单给人</label>
41
+              <label nz-radio [nzValue]="2">派单给组</label>
42
+            </nz-radio-group>
43
+          </div>
44
+          <div class="list-template__searchItem" *ngIf="activeAddress.origin.radioValue == 1">
45
+            <span class="label"><span class="red">*</span>处理人</span>:
46
+            <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
47
+              (nzOnSearch)="changeInp('user', $event)" nzAllowClear nzPlaceHolder="请选择处理人" [(ngModel)]="activeAddress.origin.userId" (ngModelChange)="changeUser($event)">
48
+              <ng-container *ngFor="let option of userList">
49
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
50
+              </ng-container>
51
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
52
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
53
+              </nz-option>
54
+            </nz-select>
55
+          </div>
56
+          <div class="list-template__searchItem" *ngIf="activeAddress.origin.radioValue == 2">
57
+            <span class="label"><span class="red">*</span>处理组</span>:
58
+            <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
59
+              (nzOnSearch)="changeInp('group', $event)" nzAllowClear nzPlaceHolder="请选择处理组" [(ngModel)]="activeAddress.origin.groupId" (ngModelChange)="changeGroup($event)">
60
+              <ng-container *ngFor="let option of groupList">
61
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
62
+              </ng-container>
63
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
64
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
65
+              </nz-option>
66
+            </nz-select>
67
+          </div>
68
+        </div>
69
+      </div>
70
+    </div>
71
+    <div class="contentBtns">
72
+      <button nz-button class="btn cancel" (click)="goBack()">返回</button>
73
+      <button nz-button nzType="primary" class="ml8" (click)="saveToTemplate()">保存并存为模板</button>
74
+      <button nz-button nzType="primary" class="ml8" (click)="save()">保存</button>
75
+    </div>
76
+  </div>
77
+</div>
78
+<!-- 模板名称 -->
79
+<app-template-name [templateFlag]="templateFlag"
80
+(submitFormHand)="submitFormHand($event)"
81
+(cancelFlagHand)="cancelFlagHand($event)"
82
+*ngIf="templateFlag"></app-template-name>
83
+
84
+<!-- 引入模板 -->
85
+<app-inspection-template-prompt-modal
86
+  *ngIf="inspectionTemplatePromptModalShow"
87
+  [show]="inspectionTemplatePromptModalShow"
88
+  (closeModelHs)="closeModelInspectionTemplate($event)"
89
+  (confirmModelHs)="confirmModelInspectionTemplate($event)"
90
+></app-inspection-template-prompt-modal>
91
+<!-- 遮罩 -->
92
+<app-mask *ngIf="maskFlag"></app-mask>

+ 138 - 0
src/app/views/inspection-plan-config/inspection-plan-config.component.less

@@ -0,0 +1,138 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  .inspectionPlanConfig{
5
+    padding: 16px;
6
+    height: 100%;
7
+    display: flex;
8
+    flex-direction: column;
9
+    justify-content: space-between;
10
+    .tagsAndTemplete{
11
+      height: 88px;
12
+      display: flex;
13
+      justify-content: space-between;
14
+      align-items: center;
15
+      .tags{
16
+        height: 100%;
17
+        background: #F9FAFB;
18
+        border-radius: 16px;
19
+        border: 1px solid #E8EBEF;
20
+        flex: 1;
21
+        padding: 16px 64px;
22
+        display: flex;
23
+        align-items: center;
24
+        flex-wrap: wrap;
25
+        gap: 16px;
26
+        position: relative;
27
+        overflow: hidden;
28
+        .transport-24gf-tags{
29
+          width: 64px;
30
+          height: 86px;
31
+          position: absolute;
32
+          left: 0;
33
+          top: 50%;
34
+          transform: translateY(-50%);
35
+          font-size: 30px;
36
+          color: @primary-color;
37
+          display: flex;
38
+          justify-content: center;
39
+          align-items: center;
40
+        }
41
+        span{
42
+          cursor: pointer;
43
+          &:hover{
44
+            color: @primary-color;
45
+          }
46
+        }
47
+      }
48
+      .template{
49
+        height: 100%;
50
+        display: flex;
51
+        align-items: center;
52
+        margin-left: 16px;
53
+      }
54
+    }
55
+    .content{
56
+      flex: 1;
57
+      min-height: 0;
58
+      display: flex;
59
+      flex-direction: column;
60
+      justify-content: space-between;
61
+      background: #F9FAFB;
62
+      border: 1px solid #EEF3F9;
63
+      border-radius: 16px;
64
+      margin-top: 16px;
65
+      .contentInner{
66
+        flex: 1;
67
+        display: flex;
68
+        justify-content: space-between;
69
+        align-items: center;
70
+        padding: 16px;
71
+        gap: 16px;
72
+        .contentHead{
73
+          height: 45px;
74
+          display: flex;
75
+          align-items: center;
76
+          padding: 0 16px;
77
+          font-size: 16px;
78
+          color: @primary-color;
79
+          font-weight: bold;
80
+          border-bottom: 1px solid #D9D9D9;
81
+        }
82
+        .contentBody{
83
+          padding: 16px 32px;
84
+          flex: 1;
85
+        }
86
+        .address{
87
+          flex: 1;
88
+          height: 100%;
89
+          background: #FFFFFF;
90
+          border-radius: 16px;
91
+          border: 1px solid #E8EBEF;
92
+          display: flex;
93
+          flex-direction: column;
94
+        }
95
+        .addressCopy{
96
+          flex: 1;
97
+          height: 100%;
98
+          background: #FFFFFF;
99
+          border-radius: 16px;
100
+          border: 1px solid #E8EBEF;
101
+          display: flex;
102
+          flex-direction: column;
103
+        }
104
+        .addressAssign{
105
+          flex: 2;
106
+          height: 100%;
107
+          background: #FFFFFF;
108
+          border-radius: 16px;
109
+          border: 1px solid #E8EBEF;
110
+          display: flex;
111
+          flex-direction: column;
112
+        }
113
+        .list-template__searchItem {
114
+          margin-bottom: 16px;
115
+          .label {
116
+            color: #333;
117
+            display: inline-block;
118
+            width: 70px;
119
+            text-align-last: justify;
120
+            text-align: justify;
121
+            &.label--big {
122
+              width: 100px;
123
+            }
124
+          }
125
+          .formItem {
126
+            width: 135px;
127
+          }
128
+        }
129
+      }
130
+      .contentBtns{
131
+        margin-bottom: 16px;
132
+        display: flex;
133
+        justify-content: center;
134
+        align-items: center;
135
+      }
136
+    }
137
+  }
138
+}

+ 493 - 0
src/app/views/inspection-plan-config/inspection-plan-config.component.ts

@@ -0,0 +1,493 @@
1
+import { Component, OnInit, ViewChild, AfterViewInit } from "@angular/core";
2
+import { NzFormatEmitEvent, NzTreeNodeOptions, NzTreeComponent, NzMessageService } from 'ng-zorro-antd';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { MainService } from 'src/app/services/main.service';
5
+import uniqBy from 'lodash-es/uniqBy'
6
+import cloneDeep from 'lodash-es/cloneDeep'
7
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
8
+import { Router, ActivatedRoute } from '@angular/router';
9
+import { Subject, forkJoin } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
11
+
12
+@Component({
13
+  selector: "app-inspection-plan-config",
14
+  templateUrl: "./inspection-plan-config.component.html",
15
+  styleUrls: ["./inspection-plan-config.component.less"],
16
+})
17
+export class InspectionPlanConfigComponent implements OnInit, AfterViewInit {
18
+  constructor(
19
+    private tool: ToolService,
20
+    private mainService: MainService,
21
+    private message: NzMessageService,
22
+    private router: Router,
23
+    private route: ActivatedRoute,
24
+  ){}
25
+  @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent: NzTreeComponent;
26
+  @ViewChild('nzTreeComponentCopy', { static: false }) nzTreeComponentCopy: NzTreeComponent;
27
+  @ViewChild("osComponentRef1", {
28
+    read: OverlayScrollbarsComponent,
29
+    static: false,
30
+  })
31
+  osComponentRef1: OverlayScrollbarsComponent;
32
+  @ViewChild("osComponentRef2", {
33
+    read: OverlayScrollbarsComponent,
34
+    static: false,
35
+  })
36
+  osComponentRef2: OverlayScrollbarsComponent;
37
+  defaultCheckedKeys = [];
38
+  defaultSelectedKeys = [];
39
+  defaultExpandedKeys = [];
40
+  nodes: NzTreeNodeOptions[] = [];
41
+  currentHospital; //当前院区
42
+
43
+  changeInpSubject = new Subject(); //防抖
44
+
45
+  ngOnInit(): void {
46
+    //防抖
47
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
48
+      if(v[0] === 'user'){
49
+        this.getUsers(v[1]);
50
+      } else if(v[0] === 'group'){
51
+        this.getGroups(v[1]);
52
+      }
53
+    });
54
+    this.currentHospital = this.tool.getCurrentHospital();
55
+    this.getUsers();
56
+    this.getGroups();
57
+    this.getInfo();
58
+  }
59
+
60
+  getInfo(){
61
+    let getPlanDetail$ = this.getPlanDetail();
62
+    let getAddressList$ = this.getAddressList();
63
+    let getTagList$ = this.getTagList();
64
+    this.maskFlag = this.message.loading("正在加载中..", {
65
+      nzDuration: 0,
66
+    }).messageId;
67
+    forkJoin(getPlanDetail$, getAddressList$, getTagList$).subscribe((res:any) => {
68
+      this.message.remove(this.maskFlag);
69
+      this.maskFlag = false;
70
+      // getPlanDetail
71
+      {
72
+        this.planDetail = res[0].data || {};
73
+        let nodeList = res[0].data ? (res[0].data.nodeList || []) : [];
74
+        this.generateTree(nodeList);
75
+      }
76
+      // getAddressList
77
+      {
78
+        if (res[1].status == 200) {
79
+          let addressList = res[1].list || [];
80
+          let buildingAndAddressList = this.generateList(addressList);
81
+          this.buildingAndAddressList = this.tool.tranListToTreeData(buildingAndAddressList, undefined, "parentId", "key");
82
+          console.log(this.buildingAndAddressList);
83
+        }else{
84
+          this.message.error(res[1].msg || "请求数据失败");
85
+        }
86
+      }
87
+      // getTagList
88
+      {
89
+        if (res[2].status == 200) {
90
+          this.tagList = res[2].list || [];
91
+        }
92
+      }
93
+    });
94
+  }
95
+
96
+  // 表格数据
97
+  isLoading = false;
98
+  buildingAndAddressList: NzTreeNodeOptions[] = [];
99
+  buildingAndAddressListCopy: NzTreeNodeOptions[] = [];
100
+  getAddressList() {
101
+    let data = {
102
+      idx: 0,
103
+      sum: 9999,
104
+      inspectionNode: {
105
+        hosId: this.currentHospital.id,
106
+      },
107
+    };
108
+
109
+    return this.mainService.getFetchDataList("simple/data", "inspectionNode", data)
110
+  }
111
+
112
+  nzCheck(event: NzFormatEmitEvent): void {
113
+    console.log(event);
114
+    console.log(event.node);
115
+    console.log(event.node.parentNode);
116
+    let buildingAndAddressListCopy = cloneDeep(this.buildingAndAddressListCopy);
117
+    if(event.eventName === 'check'){
118
+      if(event.node.isChecked){
119
+        // 选中
120
+        if(event.node.isLeaf){
121
+          // 叶子节点
122
+          let parent = buildingAndAddressListCopy.find(v => v.key === event.node.parentNode.key);
123
+          if(parent){
124
+            parent.children.push({ ...event.node.origin, selectable: true, checked: false });
125
+          }else{
126
+            let parent = cloneDeep({ ...event.node.parentNode.origin, selectable: true, checked: false });
127
+            parent.children = [{ ...event.node.origin, selectable: true, checked: false }];
128
+            buildingAndAddressListCopy.push(parent);
129
+          }
130
+          console.log("选中叶子节点");
131
+        }else{
132
+          // 非叶子节点
133
+          buildingAndAddressListCopy = buildingAndAddressListCopy.filter(v => v.key !== event.node.key);
134
+          event.node.origin.children.forEach( v => {
135
+            v.selectable = true;
136
+            v.checked = false;
137
+          })
138
+          buildingAndAddressListCopy.push({ ...event.node.origin, selectable: true, checked: false });
139
+          console.log("选中非叶子节点");
140
+        }
141
+      } else {
142
+        // 未选中
143
+        if(event.node.isLeaf){
144
+          // 叶子节点
145
+          let parent = buildingAndAddressListCopy.find(v => v.key === event.node.parentNode.key);
146
+          parent.children = parent.children.filter(v => v.key !== event.node.key);
147
+          if(!parent.children.length){
148
+            buildingAndAddressListCopy = [];
149
+          }
150
+          console.log("未选中叶子节点");
151
+        }else{
152
+          // 非叶子节点
153
+          buildingAndAddressListCopy = buildingAndAddressListCopy.filter(v => v.key !== event.node.key);
154
+          console.log("未选中非叶子节点");
155
+        }
156
+      }
157
+    }
158
+    this.buildingAndAddressListCopy = buildingAndAddressListCopy;
159
+    console.log('buildingAndAddressListCopy', this.buildingAndAddressListCopy);
160
+  }
161
+
162
+  // 边输边搜节流阀
163
+  changeInp(model, e) {
164
+    this.isLoading = true;
165
+    this.changeInpSubject.next([model, e]);
166
+  }
167
+
168
+  // 修改处理人
169
+  changeUser(userId){
170
+    this.activeAddress.origin.userId = userId;
171
+  }
172
+
173
+  // 修改处理组
174
+  changeGroup(groupId){
175
+    this.activeAddress.origin.groupId = groupId;
176
+  }
177
+
178
+  searchDto:any = {};
179
+  // 搜索
180
+  // 获取所有科室
181
+  userList: any = []; //所有所属科室(搜索)
182
+  getUsers(keyword = '') {
183
+    let postData = {
184
+      user: {
185
+        hospital: { id: this.currentHospital.id },
186
+        name: keyword,
187
+        simpleQuery: true,
188
+        menuId: 414,
189
+      },
190
+      idx: 0,
191
+      sum: 10,
192
+    };
193
+    this.mainService
194
+      .getFetchDataList("data", "user", postData)
195
+      .subscribe((data) => {
196
+        this.isLoading = false;
197
+        this.userList = data.list || [];
198
+      });
199
+  }
200
+
201
+  // 获取组
202
+  groupList: any = []; //所有所属科室(搜索)
203
+  getGroups(keyword = '') {
204
+    let postData = {
205
+      group2: {
206
+        groupName: keyword,
207
+        hospitals: this.currentHospital.id,
208
+        type: 1,
209
+      },
210
+      idx: 0,
211
+      sum: 10,
212
+    };
213
+    this.mainService
214
+      .getFetchDataList("data", "group2", postData)
215
+      .subscribe((data) => {
216
+        this.isLoading = false;
217
+        this.groupList = data.list || [];
218
+      });
219
+  }
220
+
221
+  // 选择单个巡检点
222
+  activeAddress:any;
223
+  activeAddressId:any;
224
+  nzClick(event: NzFormatEmitEvent): void {
225
+    console.log(event);
226
+    this.activeAddress = event.node;
227
+    this.activeAddressId = event.selectedKeys[0];
228
+    this.activeAddress.origin.radioValue = event.node.origin.userId ? 1 : (event.node.origin.groupId ? 2 : undefined);
229
+    if(event.node.origin.userId){
230
+      let flag = this.userList.find(v => v.id === event.node.origin.userId);
231
+      if(!flag){
232
+        this.userList.unshift({ id: event.node.origin.userId, name: event.node.origin.userName })
233
+      }
234
+    }
235
+
236
+    if(event.node.origin.groupId){
237
+      let flag = this.groupList.find(v => v.id === event.node.origin.groupId);
238
+      if(!flag){
239
+        this.groupList.unshift({ id: event.node.origin.groupId, groupName: event.node.origin.groupName })
240
+      }
241
+    }
242
+  }
243
+
244
+  // 计划详情
245
+  planDetail:any = {};
246
+  getPlanDetail(){
247
+    return this.mainService.getFetchData("simple/data", "inspection", +this.route.snapshot.paramMap.get('id'));
248
+  }
249
+
250
+  // 标签
251
+  tagList:any = [];
252
+  getTagList(){
253
+    let postData = {
254
+      idx: 0,
255
+      sum: 99,
256
+      tag: {
257
+        hosId: this.currentHospital.id,
258
+        onlyBind: 1,
259
+        modelType: { value: 'inspection' },
260
+      }
261
+    }
262
+    return this.mainService.getFetchDataList("simple/data", "tag", postData)
263
+  }
264
+
265
+  // 点击标签
266
+  clickTag(tag){
267
+    this.maskFlag = this.message.loading("正在加载中..", {
268
+      nzDuration: 0,
269
+    }).messageId;
270
+    let postData = {
271
+      inspectionNode: {
272
+        hosId: this.currentHospital.id,
273
+        tagIds: tag.id.toString(),
274
+      },
275
+      idx: 0,
276
+      sum: 9999,
277
+    };
278
+    this.mainService
279
+      .getFetchDataList("simple/data", "inspectionNode", postData)
280
+      .subscribe((result) => {
281
+        this.message.remove(this.maskFlag);
282
+        this.maskFlag = false;
283
+        let addressList = result.list || [];
284
+        let buildingAndAddressListCopy = this.generateList(addressList, true);
285
+        console.log(buildingAndAddressListCopy);
286
+        this.defaultCheckedKeys = buildingAndAddressListCopy.map(v => v.key).filter(v => !(/b-/.test(v)));
287
+        this.buildingAndAddressListCopy = this.tool.tranListToTreeData(buildingAndAddressListCopy, undefined, "parentId", "key");
288
+        console.log(this.buildingAndAddressListCopy);
289
+      });
290
+  }
291
+
292
+  // 回显树形结构
293
+  generateTree(nodeList){
294
+    console.log('nodeList:', nodeList);
295
+    let buildingAndAddressList = nodeList.map(v => ({
296
+      title: v.nodeId ? v.inspectionNodeDTO.name : v.buildingDTO.buildingName,
297
+      key: v.nodeId ? `${v.nodeId}` : `b-${v.buildId}`,
298
+      parentId: v.nodeId ? `b-${v.buildId}` : undefined,
299
+      hosId: v.hosId,
300
+      children: [],
301
+      selectable: false,
302
+      isLeaf: Boolean(v.nodeId),
303
+      checked: false,
304
+    }));
305
+    this.defaultCheckedKeys = buildingAndAddressList.map(v => v.key).filter(v => !(/b-/.test(v)));
306
+    let buildingAndAddressListCopy = nodeList.map(v => ({
307
+      title: v.nodeId ? v.inspectionNodeDTO.name : v.buildingDTO.buildingName,
308
+      key: v.nodeId ? `${v.nodeId}` : `b-${v.buildId}`,
309
+      parentId: v.nodeId ? `b-${v.buildId}` : undefined,
310
+      userId: v.userId,
311
+      userName: v.userDTO ? v.userDTO.name : undefined,
312
+      groupId: v.groupId,
313
+      groupName: v.groupDTO ? v.groupDTO.name : undefined,
314
+      hosId: v.hosId,
315
+      children: [],
316
+      selectable: true,
317
+      isLeaf: Boolean(v.nodeId),
318
+      checked: false,
319
+    }));
320
+    console.log('buildingAndAddressList:', buildingAndAddressList);
321
+    this.buildingAndAddressListCopy = this.tool.tranListToTreeData(buildingAndAddressListCopy, undefined, "parentId", "key");
322
+    console.log('this.buildingAndAddressListCopy', this.buildingAndAddressListCopy);
323
+  }
324
+
325
+  // 处理巡检点数据
326
+  generateList(addressList, selectableFlag = false){
327
+    // 楼栋
328
+    let buildingList = addressList.map((item) => {
329
+      return {
330
+        title: item.buildingDTO.buildingName,
331
+        key: 'b-' + item.buildingDTO.id,
332
+        children: [],
333
+        selectable: selectableFlag,
334
+        hosId: this.currentHospital.id,
335
+      }
336
+    })
337
+    buildingList = uniqBy(buildingList, "key");
338
+    // 巡检点
339
+    addressList = addressList.map((item) => {
340
+      return {
341
+        title: item.name,
342
+        key: item.id.toString(),
343
+        parentId: 'b-' + item.buildingDTO.id,
344
+        isLeaf: true,
345
+        selectable: selectableFlag,
346
+        hosId: this.currentHospital.id,
347
+      }
348
+    })
349
+    let buildingAndAddressList = buildingList.concat(addressList);
350
+    console.log(buildingAndAddressList);
351
+    return buildingAndAddressList;
352
+  }
353
+
354
+  // 填写模板名称-确定
355
+  templateLoading = false;
356
+  templateFlag = false;
357
+  submitFormHand(name){
358
+    this.maskFlag = this.message.loading("正在加载中..", {
359
+      nzDuration: 0,
360
+    }).messageId;
361
+    let nodeList = this.tool.tranTreeToListData(this.buildingAndAddressListCopy).map(v => ({
362
+      nodeId: v.parentId ? Number(v.key) : undefined,
363
+      userId: v.userId,
364
+      groupId: v.groupId,
365
+      hosId: v.hosId,
366
+      buildId: v.parentId ? Number(v.parentId.replace(/b-/, '')): Number(v.key.replace(/b-/, '')),
367
+    }));
368
+    console.log(name);
369
+    console.log(nodeList);
370
+    console.log('保存并存为模板');
371
+    let postData = {
372
+      inspection: {
373
+        ...this.planDetail,
374
+        nodeList,
375
+      },
376
+      template: {
377
+        hosId: this.currentHospital.id,
378
+        name,
379
+      },
380
+    };
381
+    console.log(postData);
382
+    this.mainService
383
+      .inspectionPost("templateToInspection", postData)
384
+      .subscribe((result) => {
385
+        this.message.remove(this.maskFlag);
386
+        this.maskFlag = false;
387
+        if (result.status == 200) {
388
+          this.message.success("保存成功");
389
+          this.router.navigateByUrl("/main/inspectionPlan");
390
+        } else {
391
+          this.message.error(result.msg || '保存失败');
392
+        }
393
+      });
394
+  }
395
+
396
+  // 填写模板名称-取消
397
+  cancelFlagHand(e) {
398
+    this.templateFlag = false;
399
+  }
400
+
401
+  // 返回
402
+  goBack(){
403
+    this.router.navigateByUrl("/main/inspectionPlan");
404
+  }
405
+
406
+  // 保存并存为模板
407
+  maskFlag: any = false;
408
+  saveToTemplate(){
409
+    let nodeList = this.tool.tranTreeToListData(this.buildingAndAddressListCopy);
410
+    console.log(nodeList);
411
+    if(!nodeList.length){
412
+      this.message.warning('请选择至少一个巡检点');
413
+      return;
414
+    }
415
+    this.templateFlag = true;
416
+  }
417
+
418
+  // 保存
419
+  save(){
420
+    this.maskFlag = this.message.loading("正在加载中..", {
421
+      nzDuration: 0,
422
+    }).messageId;
423
+    let nodeList = this.tool.tranTreeToListData(this.buildingAndAddressListCopy).map(v => ({
424
+      nodeId: v.parentId ? Number(v.key) : undefined,
425
+      userId: v.userId,
426
+      groupId: v.groupId,
427
+      hosId: v.hosId,
428
+      buildId: v.parentId ? Number(v.parentId.replace(/b-/, '')): Number(v.key.replace(/b-/, '')),
429
+    }));
430
+    console.log(nodeList);
431
+    console.log('保存');
432
+    let postData = {
433
+      ...this.planDetail,
434
+      nodeList,
435
+      saveButton: '启动',
436
+    };
437
+    console.log(postData);
438
+    this.mainService
439
+      .simplePost("addData", "inspection", postData)
440
+      .subscribe((result) => {
441
+        this.message.remove(this.maskFlag);
442
+        this.maskFlag = false;
443
+        if (result.status == 200) {
444
+          this.message.success("保存成功");
445
+          this.router.navigateByUrl("/main/inspectionPlan");
446
+        } else {
447
+          this.message.error(result.msg || '保存失败');
448
+        }
449
+      });
450
+  }
451
+
452
+  // 引入模板
453
+  inspectionTemplatePromptModalShow = false;
454
+  showInspectionTemplate() {
455
+    this.inspectionTemplatePromptModalShow = true;
456
+  }
457
+  // 关闭弹窗
458
+  closeModelInspectionTemplate(e) {
459
+    this.inspectionTemplatePromptModalShow = JSON.parse(e).show;
460
+  }
461
+  // 确认弹窗
462
+  confirmModelInspectionTemplate(tempId) {
463
+    this.inspectionTemplatePromptModalShow = false;
464
+    this.maskFlag = this.message.loading("正在加载中..", {
465
+      nzDuration: 0,
466
+    }).messageId;
467
+    let postData = {
468
+      idx: 0,
469
+      sum: 9999,
470
+      inspectionTempNodes: {
471
+        tempId,
472
+      }
473
+    }
474
+    this.mainService.getFetchDataList("simple/data", "inspectionTempNodes", postData).subscribe((result:any) => {
475
+      this.message.remove(this.maskFlag);
476
+      this.maskFlag = false;
477
+      let nodeList = result.list || [];
478
+      this.generateTree(nodeList);
479
+    })
480
+  }
481
+
482
+  ngAfterViewInit(): void {
483
+    // get node by key: '10011'
484
+    console.log(this.nzTreeComponent.getTreeNodeByKey('10011'));
485
+    // use tree methods
486
+    console.log(
487
+      this.nzTreeComponent.getTreeNodes(),
488
+      this.nzTreeComponent.getCheckedNodeList(),
489
+      this.nzTreeComponent.getSelectedNodeList(),
490
+      this.nzTreeComponent.getExpandedNodeList()
491
+    );
492
+  }
493
+}

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

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

+ 25 - 0
src/app/views/inspection-plan/inspection-plan-routing.module.ts

@@ -0,0 +1,25 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { InspectionPlanComponent } from './inspection-plan.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: InspectionPlanComponent,
10
+    // children: [
11
+    //   {
12
+    //     // 查看详情
13
+    //     path: 'roundRobinDetail/:id',
14
+    //     loadChildren: () => import('../round-robin-detail/round-robin-detail.module').then(m => m.InspectionPlanDetailModule),
15
+    //   }
16
+    // ]
17
+  }
18
+];
19
+
20
+@NgModule({
21
+  imports: [RouterModule.forChild(routes)],
22
+  exports: [RouterModule]
23
+})
24
+export class InspectionPlanRoutingModule { }
25
+

+ 213 - 0
src/app/views/inspection-plan/inspection-plan.component.html

@@ -0,0 +1,213 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='15' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label label--big">计划主题:</span>
7
+          <input nz-input class="formItem" placeholder="请输入关键字" [(ngModel)]="searchCriteria.name" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label label--big">重复策略:</span>
11
+          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzAllowClear nzPlaceHolder="请选择重复策略" [(ngModel)]="searchCriteria.planTypeId">
12
+            <ng-container *ngFor="let data of planTypes">
13
+              <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.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
+        </div>
20
+      </div>
21
+      <div nz-col nzXl="9" class="list-template__btns">
22
+        <button nz-button class="btn default" (click)='getList(1)'>搜索</button>
23
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
24
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
25
+      </div>
26
+    </div>
27
+    <div class="list-template__bottom">
28
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
29
+        [nzLoading]="loading1">
30
+        <thead>
31
+          <tr class="thead">
32
+            <th nzWidth="10%">计划主题</th>
33
+            <th nzWidth="8%">重复策略</th>
34
+            <th nzWidth="12%">执行时间</th>
35
+            <th nzWidth="10%">执行时长(天)</th>
36
+            <th nzWidth="10%">巡检表</th>
37
+            <th nzWidth="10%">签到方式</th>
38
+            <th nzWidth="10%">巡检类型</th>
39
+            <th nzWidth="10%">状态</th>
40
+            <th nzWidth="20%">操作</th>
41
+          </tr>
42
+        </thead>
43
+        <tbody>
44
+          <tr *ngFor="let data of listOfData;let i = index">
45
+            <td>{{ data.name }}</td>
46
+            <td>{{ data.planType?.name }}</td>
47
+            <td [ngSwitch]="data.planType.value">
48
+              <ng-container *ngSwitchCase="'none'">{{ data.execTime|date:'yyyy年MM月dd日HH时mm分' }}</ng-container>
49
+              <ng-container *ngSwitchCase="'day'">{{ data.execTime|date:'HH时mm分' }}</ng-container>
50
+              <ng-container *ngSwitchCase="'week'">{{data.weekName}} {{ data.execTime|date:'HH时mm分' }}</ng-container>
51
+              <ng-container *ngSwitchCase="'month'">{{data.planDay}}日 {{ data.execTime|date:'HH时mm分' }}</ng-container>
52
+              <ng-container *ngSwitchCase="'year'">{{ data.execTime|date:'MM月dd日HH时mm分' }}</ng-container>
53
+            </td>
54
+            <td>{{ data.execDay }}</td>
55
+            <td>{{ data.inspectionFormDTO?.name }}</td>
56
+            <td>{{ data.signType?.name }}</td>
57
+            <td>{{ data.type?.name }}</td>
58
+            <td>{{ data.status?.name }}</td>
59
+            <td>
60
+              <div class="coop">
61
+                <!-- <span *ngIf="coopBtns.look" (click)="detail(data.id)">查看</span> -->
62
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data.id,'您确认要删除吗?','删除','del')">删除</span>
63
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
64
+                <span *ngIf="coopBtns.edit" (click)="planConfig(data)">配置</span>
65
+                <span *ngIf="coopBtns.isStartUp && data.planType.value != 'none' && (data.status.value == '2' || data.status.value == '3')" (click)="showDelModal(data.id, data.status.value == 2 ? '您确认要停止巡检计划吗?' : '您确认要启动巡检计划吗?', data.status.value == 2 ? '停用' : '启用', 'switch', data.status.value == 2)">{{data.status.value == 2 ? '停用' : '启用'}}</span>
66
+                <span *ngIf="coopBtns.executeNow && data.status.value != '1'" (click)="showDelModal(data.id, '您确认立即执行计划一次吗?确认后会立即生成计划内配置的巡检任务', '执行一次', 'once')">执行一次</span>
67
+              </div>
68
+            </td>
69
+          </tr>
70
+        </tbody>
71
+      </nz-table>
72
+      <div class="list-template__pagination">
73
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
74
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
75
+        </nz-pagination>
76
+      </div>
77
+    </div>
78
+  </div>
79
+
80
+  <!-- 新增/编辑模态框 -->
81
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
82
+    <div class="modalBody">
83
+      <div class="title">{{add?"新增":"编辑"}}巡检计划<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
84
+      </div>
85
+      <overlay-scrollbars #osComponentRef1 class="content">
86
+        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
87
+          <nz-form-item>
88
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="name">计划主题</nz-form-label>
89
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入计划主题!">
90
+              <nz-input-group>
91
+                <input nz-input formControlName="name" placeholder="请输入计划主题" />
92
+              </nz-input-group>
93
+            </nz-form-control>
94
+          </nz-form-item>
95
+          <nz-form-item>
96
+            <nz-form-label class="line_height_normal" [nzSpan]="5" nzRequired nzFor="content">计划内容</nz-form-label>
97
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入计划内容!">
98
+              <nz-input-group>
99
+                <textarea formControlName="content" nz-input placeholder="请输入计划内容"></textarea>
100
+              </nz-input-group>
101
+            </nz-form-control>
102
+          </nz-form-item>
103
+          <nz-form-item>
104
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="formId">巡&nbsp;&nbsp;检&nbsp;&nbsp;单</nz-form-label>
105
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择巡检单!">
106
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="formId" nzShowSearch nzAllowClear
107
+                nzPlaceHolder="请选择巡检单" nzServerSearch (nzOnSearch)="changeFormId($event)">
108
+                <ng-container *ngFor="let data of formIds">
109
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
110
+                  </nz-option>
111
+                </ng-container>
112
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
113
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
114
+                </nz-option>
115
+              </nz-select>
116
+            </nz-form-control>
117
+          </nz-form-item>
118
+          <nz-form-item>
119
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="type">巡检类型</nz-form-label>
120
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择巡检类型!">
121
+              <nz-select formControlName="type" nzPlaceHolder="请选择巡检类型">
122
+                <nz-option [nzValue]="data.value" [nzLabel]="data.name" *ngFor="let data of types"></nz-option>
123
+              </nz-select>
124
+            </nz-form-control>
125
+          </nz-form-item>
126
+          <nz-form-item>
127
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="execDay">执行时长</nz-form-label>
128
+            <nz-form-control [nzSpan]="19" nzErrorTip="请填写执行时长!">
129
+              <nz-input-number nzPlaceHolder="请填写执行时长" class="w100" formControlName="execDay" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterExecDay" [nzParser]="parserExecDay"></nz-input-number>
130
+            </nz-form-control>
131
+          </nz-form-item>
132
+          <nz-form-item>
133
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="planType">重复策略</nz-form-label>
134
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择重复策略!">
135
+              <nz-select formControlName="planType" nzPlaceHolder="请选择重复策略" (ngModelChange)="planTypeChange($event)">
136
+                <nz-option [nzValue]="data.value" [nzLabel]="data.name" *ngFor="let data of planTypes"></nz-option>
137
+              </nz-select>
138
+            </nz-form-control>
139
+          </nz-form-item>
140
+          <div style="display: flex;justify-content: space-between;">
141
+            <nz-form-item *ngIf="validateForm.value.planType == 'week'" style="flex: 1;" class="mr8">
142
+              <nz-form-label [nzSpan]="24" nzRequired nzFor="doWeek">执行时间(选择周)</nz-form-label>
143
+              <nz-form-control [nzSpan]="24" nzErrorTip="请选择周!">
144
+                <nz-select formControlName="doWeek" nzPlaceHolder="请选择周">
145
+                  <nz-option [nzValue]="1" nzLabel="周一"></nz-option>
146
+                  <nz-option [nzValue]="2" nzLabel="周二"></nz-option>
147
+                  <nz-option [nzValue]="3" nzLabel="周三"></nz-option>
148
+                  <nz-option [nzValue]="4" nzLabel="周四"></nz-option>
149
+                  <nz-option [nzValue]="5" nzLabel="周五"></nz-option>
150
+                  <nz-option [nzValue]="6" nzLabel="周六"></nz-option>
151
+                  <nz-option [nzValue]="7" nzLabel="周日"></nz-option>
152
+                </nz-select>
153
+              </nz-form-control>
154
+            </nz-form-item>
155
+            <nz-form-item *ngIf="validateForm.value.planType == 'month'" style="flex: 1;" class="mr8">
156
+              <nz-form-label [nzSpan]="24" nzRequired nzFor="doMonth">执行时间(选择日)</nz-form-label>
157
+              <nz-form-control [nzSpan]="24" nzErrorTip="请选择日!">
158
+                <nz-select formControlName="doMonth" nzPlaceHolder="请选择日">
159
+                  <nz-option [nzValue]="item" [nzLabel]="item + '号'" *ngFor="let item of months">
160
+                  </nz-option>
161
+                </nz-select>
162
+              </nz-form-control>
163
+            </nz-form-item>
164
+            <nz-form-item *ngIf="validateForm.value.planType == 'year'" style="flex: 1;" class="mr8">
165
+              <nz-form-label [nzSpan]="24" nzRequired nzFor="doYear">执行时间(选择月日)</nz-form-label>
166
+              <nz-form-control [nzSpan]="24" nzErrorTip="请选择月日!">
167
+                <nz-date-picker nzFormat="MM-dd" formControlName="doYear" nzPlaceHolder="请选择月日"></nz-date-picker>
168
+              </nz-form-control>
169
+            </nz-form-item>
170
+            <nz-form-item *ngIf="validateForm.value.planType == 'none'" style="flex: 1;" class="mr8">
171
+              <nz-form-label [nzSpan]="24" nzRequired nzFor="doNone">执行时间(选择年月日)</nz-form-label>
172
+              <nz-form-control [nzSpan]="24" nzErrorTip="请选择年月日!">
173
+                <nz-date-picker nzFormat="yyyy-MM-dd" formControlName="doNone" nzPlaceHolder="请选择年月日"></nz-date-picker>
174
+              </nz-form-control>
175
+            </nz-form-item>
176
+            <nz-form-item *ngIf="validateForm.value.planType" style="flex: 1;">
177
+              <nz-form-label [nzSpan]="validateForm.value.planType == 'day' ? 5 : 24" nzRequired nzFor="execTime">执行时间{{validateForm.value.planType == 'day' ? '' : '(选择时分)'}}</nz-form-label>
178
+              <nz-form-control [nzSpan]="validateForm.value.planType == 'day' ? 19 : 24" nzErrorTip="请选择时分!">
179
+                <nz-time-picker nzFormat="HH:mm" formControlName="execTime" class="w100" nzPlaceHolder="请选择时分"
180
+                  [nzAllowEmpty]="false">
181
+                </nz-time-picker>
182
+              </nz-form-control>
183
+            </nz-form-item>
184
+          </div>
185
+          <nz-form-item>
186
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="signType">签到方式</nz-form-label>
187
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择签到方式!">
188
+              <nz-select formControlName="signType" nzPlaceHolder="请选择签到方式">
189
+                <nz-option [nzValue]="data.value" [nzLabel]="data.name" *ngFor="let data of signTypes"></nz-option>
190
+              </nz-select>
191
+            </nz-form-control>
192
+          </nz-form-item>
193
+        </form>
194
+      </overlay-scrollbars>
195
+      <div class=" display_flex justify-content_flex-center">
196
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
197
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
198
+      </div>
199
+    </div>
200
+  </div>
201
+
202
+  <!-- 删除模态框 -->
203
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
204
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
205
+</div>
206
+<!-- 操作成功/失败提示框 -->
207
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
208
+  [info]="promptInfo">
209
+</app-prompt-modal>
210
+<!-- 查看详情 -->
211
+<router-outlet></router-outlet>
212
+<!-- 遮罩 -->
213
+<app-mask *ngIf="maskFlag"></app-mask>

+ 198 - 0
src/app/views/inspection-plan/inspection-plan.component.less

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

+ 531 - 0
src/app/views/inspection-plan/inspection-plan.component.ts

@@ -0,0 +1,531 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { Subject } from "rxjs";
14
+import { debounceTime } from "rxjs/operators";
15
+import { NzMessageService } from "ng-zorro-antd";
16
+import { format, startOfMinute } from "date-fns";
17
+@Component({
18
+  selector: "app-inspection-plan",
19
+  templateUrl: "./inspection-plan.component.html",
20
+  styleUrls: ["./inspection-plan.component.less"],
21
+})
22
+export class InspectionPlanComponent implements OnInit {
23
+  @ViewChild("osComponentRef1", {
24
+    read: OverlayScrollbarsComponent,
25
+    static: false,
26
+  })
27
+  osComponentRef1: OverlayScrollbarsComponent;
28
+  constructor(
29
+    private message: NzMessageService,
30
+    private fb: FormBuilder,
31
+    private mainService: MainService,
32
+    private route: ActivatedRoute,
33
+    private router: Router,
34
+    private tool: ToolService
35
+  ) {}
36
+
37
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
38
+
39
+  searchCriteria = {
40
+    //搜索条件
41
+    name: "",
42
+    planTypeId: null,
43
+  };
44
+  formIds = []; //巡检单
45
+  planTypes = []; //重复策略
46
+  types = []; //巡检类型
47
+  signTypes = []; //签到方式
48
+  department = []; // 院区下的科室列表
49
+  departmentSearch = []; // 院区下的科室列表(搜索框)
50
+  listOfData: any[] = []; //表格数据
51
+  pageIndex: number = 1; //表格当前页码
52
+  pageSize: number = 10; //表格每页展示条数
53
+  listLength: number = 10; //表格总数据量
54
+  tableHeight: number; //表格动态高
55
+  modal: boolean = false; //新增/编辑模态框
56
+  add: boolean; //true:新增;false:编辑
57
+  validateForm: FormGroup; //新增/编辑表单
58
+  coopId: number; //当前操作列id
59
+  coopData: any = {}; //当前操作列
60
+
61
+  hosId: any; //当前院区id
62
+  btnLoading: boolean = false; //提交按钮loading状态
63
+
64
+  promptContent: string; //操作提示框提示信息
65
+  ifSuccess: boolean; //操作成功/失败
66
+  promptInfo: string; //操作结果提示信息
67
+  promptModalShow: boolean; //操作提示框是否展示
68
+  demoValue: number = 0;
69
+  changeFormIdSubject = new Subject();
70
+  ngOnInit() {
71
+    this.changeFormIdSubject
72
+      .pipe(debounceTime(500))
73
+      .subscribe((v: any) => {
74
+        this.getFormId(v);
75
+      });
76
+    this.coopBtns = this.tool.initCoopBtns(this.route);
77
+    this.hosId = this.tool.getCurrentHospital().id;
78
+    this.getList(1);
79
+    this.initForm();
80
+    this.getPlanTypes();
81
+    this.getTypes();
82
+    this.getSignTypes();
83
+    this.getFormId();
84
+  }
85
+  // 重置
86
+  reset() {
87
+    this.searchCriteria = {
88
+      //搜索条件
89
+      name: "",
90
+      planTypeId: null,
91
+    };
92
+    this.getList(1);
93
+  }
94
+
95
+  // 选择轮巡类型
96
+  selectedTasktype = null; //当前选中的轮巡类型
97
+  // 任务类型防抖搜索
98
+  isLoading = false;
99
+  changeFormId(keyWord = "") {
100
+    this.isLoading = true;
101
+    this.changeFormIdSubject.next(keyWord);
102
+  }
103
+
104
+  // 初始化增删改按钮
105
+  coopBtns: any = {};
106
+
107
+  // 表格数据
108
+  loading1 = false;
109
+  getList(type) {
110
+    if (type == 1) {
111
+      this.pageIndex = 1;
112
+    }
113
+    let data = {
114
+      idx: this.pageIndex - 1,
115
+      sum: this.pageSize,
116
+      inspection: {
117
+        hosId: this.hosId,
118
+        planType: this.searchCriteria.planTypeId ? { id: this.searchCriteria.planTypeId } : undefined,
119
+        name: this.searchCriteria.name || undefined,
120
+      },
121
+    };
122
+    this.loading1 = true;
123
+    this.mainService
124
+      .getFetchDataList("simple/data", "inspection", data)
125
+      .subscribe((data) => {
126
+        this.loading1 = false;
127
+        if (data.status == 200) {
128
+          this.listOfData = data.list;
129
+          this.listLength = data.totalNum;
130
+          this.listOfData.forEach((item) => {
131
+            if (item.planType.value == "week") {
132
+              let weeks = [
133
+                "周一",
134
+                "周二",
135
+                "周三",
136
+                "周四",
137
+                "周五",
138
+                "周六",
139
+                "周日",
140
+              ];
141
+              item.weekName = weeks[item.planDay - 1];
142
+            }
143
+          });
144
+        }
145
+      });
146
+  }
147
+  //获取巡检单
148
+  getFormId(keyWord = "") {
149
+    let postData = {
150
+      idx: 0,
151
+      sum: 20,
152
+      inspectionForm: {
153
+        hosId: this.hosId,
154
+        name: keyWord,
155
+        status: { value: '1' },
156
+      },
157
+    };
158
+    this.mainService
159
+      .getFetchDataList("simple/data", "inspectionForm", postData)
160
+      .subscribe((result) => {
161
+        if (result.status == 200) {
162
+          this.isLoading = false;
163
+          this.formIds = result.list;
164
+        }
165
+      });
166
+  }
167
+  //获取重复策略
168
+  getPlanTypes() {
169
+    this.mainService
170
+    .getDictionary('list', 'inspection_plan_type')
171
+    .subscribe((data) => {
172
+      this.planTypes = data || [];
173
+    });
174
+  }
175
+  //获取巡检类型
176
+  getTypes() {
177
+    this.mainService
178
+    .getDictionary('list', 'inspection_type')
179
+    .subscribe((data) => {
180
+      this.types = data || [];
181
+    });
182
+  }
183
+  //获取签到方式
184
+  getSignTypes() {
185
+    this.mainService
186
+    .getDictionary('list', 'inspection_sign_type')
187
+    .subscribe((data) => {
188
+      this.signTypes = data || [];
189
+    });
190
+  }
191
+  // 新增/编辑弹框
192
+  addModal() {
193
+    this.add = true; //新增
194
+    this.modal = true;
195
+    this.initForm();
196
+  }
197
+  //关闭新增/编辑弹框
198
+  hideAddModal() {
199
+    this.modal = false;
200
+    this.initForm();
201
+  }
202
+  // 初始化新增form表单
203
+  initForm() {
204
+    this.validateForm = this.fb.group({
205
+      name: [null, [Validators.required]],
206
+      content: [null, [Validators.required]],
207
+      formId: [null, [Validators.required]],
208
+      planType: [null, [Validators.required]],
209
+      type: [null, [Validators.required]],
210
+      signType: [null, [Validators.required]],
211
+      execDay: [null, [Validators.required]],
212
+      execTime: [null, [Validators.required]],
213
+    });
214
+  }
215
+  // 修改轮巡策略
216
+  months = [...Array(32).keys()].slice(1);
217
+  planTypeChange(e) {
218
+    this.validateForm.controls.execTime.setValue(null);
219
+    switch (e) {
220
+      case "none":
221
+        this.validateForm.addControl("doNone", new FormControl(null, Validators.required));
222
+        this.validateForm.removeControl("doWeek");
223
+        this.validateForm.removeControl("doMonth");
224
+        this.validateForm.removeControl("doYear");
225
+        break;
226
+      case "day":
227
+        this.validateForm.removeControl("doWeek");
228
+        this.validateForm.removeControl("doMonth");
229
+        this.validateForm.removeControl("doYear");
230
+        this.validateForm.removeControl("doNone");
231
+        break;
232
+      case "week":
233
+        this.validateForm.addControl(
234
+          "doWeek",
235
+          new FormControl(null, Validators.required)
236
+        );
237
+        this.validateForm.removeControl("doMonth");
238
+        this.validateForm.removeControl("doYear");
239
+        this.validateForm.removeControl("doNone");
240
+        break;
241
+      case "month":
242
+        this.validateForm.addControl(
243
+          "doMonth",
244
+          new FormControl(null, Validators.required)
245
+        );
246
+        this.validateForm.removeControl("doWeek");
247
+        this.validateForm.removeControl("doYear");
248
+        this.validateForm.removeControl("doNone");
249
+        break;
250
+      case "year":
251
+        this.validateForm.addControl(
252
+          "doYear",
253
+          new FormControl(null, Validators.required)
254
+        );
255
+        this.validateForm.removeControl("doWeek");
256
+        this.validateForm.removeControl("doMonth");
257
+        this.validateForm.removeControl("doNone");
258
+        break;
259
+    }
260
+  }
261
+
262
+  // 新增/编辑表单提交
263
+  submitForm(): void {
264
+    this.btnLoading = true;
265
+    for (const i in this.validateForm.controls) {
266
+      this.validateForm.controls[i].markAsDirty();
267
+      this.validateForm.controls[i].updateValueAndValidity();
268
+    }
269
+    if (this.validateForm.invalid) {
270
+      this.btnLoading = false;
271
+      return;
272
+    }
273
+    let postData: any = {};
274
+
275
+    if (this.add) {
276
+      //增加
277
+      postData = {
278
+        name: this.validateForm.value.name,
279
+        content: this.validateForm.value.content,
280
+        hosId: this.hosId,
281
+        formId: this.validateForm.value.formId,
282
+        planType: this.planTypes.find(v => v.value == this.validateForm.value.planType),
283
+        type: this.types.find(v => v.value == this.validateForm.value.type),
284
+        signType: this.signTypes.find(v => v.value == this.validateForm.value.signType),
285
+        execDay: this.validateForm.value.execDay,
286
+        execTime: format(startOfMinute(this.validateForm.value.execTime), 'yyyy-MM-dd HH:mm:ss'),
287
+      };
288
+      if (this.validateForm.value.planType == "day") {
289
+        delete postData.planDay;
290
+      } else if (this.validateForm.value.planType == "week") {
291
+        postData.planDay = this.validateForm.value.doWeek;
292
+      } else if (this.validateForm.value.planType == "month") {
293
+        postData.planDay = this.validateForm.value.doMonth;
294
+      } else if (this.validateForm.value.planType == "year") {
295
+        delete postData.planDay;
296
+        postData.execTime =  format(this.validateForm.value.doYear, "yyyy-MM-dd") + " " + format(startOfMinute(this.validateForm.value.execTime), "HH:mm:ss");
297
+      } else if (this.validateForm.value.planType == "none") {
298
+        delete postData.planDay;
299
+        postData.execTime = format(this.validateForm.value.doNone, "yyyy-MM-dd") + " " + format(startOfMinute(this.validateForm.value.execTime), "HH:mm:ss");
300
+      }
301
+    } else {
302
+      //编辑
303
+      postData = {
304
+        // deleteFlag: this.coopData.deleteFlag,
305
+        ...this.coopData,
306
+        id: this.coopId,
307
+        name: this.validateForm.value.name,
308
+        content: this.validateForm.value.content,
309
+        hosId: this.hosId,
310
+        formId: this.validateForm.value.formId,
311
+        planType: this.planTypes.find(v => v.value == this.validateForm.value.planType),
312
+        type: this.types.find(v => v.value == this.validateForm.value.type),
313
+        signType: this.signTypes.find(v => v.value == this.validateForm.value.signType),
314
+        execDay: this.validateForm.value.execDay,
315
+        execTime: format(startOfMinute(this.validateForm.value.execTime), 'yyyy-MM-dd HH:mm:ss'),
316
+      };
317
+      if (this.validateForm.value.planType == "day") {
318
+        delete postData.planDay;
319
+      } else if (this.validateForm.value.planType == "week") {
320
+        postData.planDay = this.validateForm.value.doWeek;
321
+      } else if (this.validateForm.value.planType == "month") {
322
+        postData.planDay = this.validateForm.value.doMonth;
323
+      } else if (this.validateForm.value.planType == "year") {
324
+        delete postData.planDay;
325
+        postData.execTime = format(this.validateForm.value.doYear, "yyyy-MM-dd") + " " + format(startOfMinute(this.validateForm.value.execTime), "HH:mm:ss");
326
+      } else if (this.validateForm.value.planType == "none") {
327
+        delete postData.planDay;
328
+        postData.execTime = format(this.validateForm.value.doNone, "yyyy-MM-dd") + " " + format(startOfMinute(this.validateForm.value.execTime), "HH:mm:ss");
329
+      }
330
+    }
331
+    console.log(postData);
332
+    this.mainService
333
+      .simplePost("addData", 'inspection', postData)
334
+      .subscribe((data) => {
335
+        this.btnLoading = false;
336
+        this.hideAddModal();
337
+        this.initForm();
338
+        if (data.status == 200) {
339
+          this.listLength++;
340
+          this.showPromptModal(this.add ? "新增" : "修改", true, "");
341
+        } else {
342
+          this.showPromptModal(this.add ? "新增" : "修改", false, data.msg);
343
+        }
344
+      });
345
+  }
346
+
347
+  // 编辑
348
+  executionTimeTemporaryStorage; //暂存执行时间
349
+  maskFlag: any = false;
350
+  edit(data) {
351
+    this.initForm();
352
+    this.add = false;
353
+    this.modal = true;
354
+    this.coopId = data.id;
355
+    this.coopData = data;
356
+    this.validateForm.controls.name.setValue(data.name);
357
+    this.validateForm.controls.content.setValue(data.content);
358
+    this.validateForm.controls.planType.setValue(data.planType ? data.planType.value : null);
359
+    this.validateForm.controls.type.setValue(data.type ? data.type.value : null);
360
+    this.validateForm.controls.signType.setValue(data.signType ? data.signType.value : null);
361
+    this.validateForm.controls.execDay.setValue(data.execDay);
362
+
363
+    if(data.formId){
364
+      let obj = this.formIds.find(v => v.id == data.formId);
365
+      if(!obj){
366
+        this.formIds.unshift(obj);
367
+      }
368
+      this.validateForm.controls.formId.setValue(data.formId);
369
+
370
+    }
371
+
372
+    //执行时间 start
373
+    this.planTypeChange(data.planType.value);
374
+    if (data.planType.value == "year") {
375
+      this.validateForm.controls.doYear.setValue(new Date(data.execTime));
376
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
377
+    } else if (data.planType.value == "month") {
378
+      this.validateForm.controls.doMonth.setValue(data.planDay);
379
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
380
+    } else if (data.planType.value == "week") {
381
+      this.validateForm.controls.doWeek.setValue(data.planDay);
382
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
383
+    } else if (data.planType.value == "day") {
384
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
385
+    } else if (data.planType.value == "none") {
386
+      this.validateForm.controls.doNone.setValue(new Date(data.execTime));
387
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
388
+    }
389
+    //执行时间 end
390
+  }
391
+  coopItem: any = {};
392
+  execModal: boolean = false;
393
+  // 打开立即执行模态框
394
+  openExecModal(item) {
395
+    this.coopItem = item;
396
+    this.execModal = true;
397
+  }
398
+  // 确认立即执行
399
+  confirmExec() {
400
+    this.btnLoading = true;
401
+    this.mainService
402
+      .executeNowOrderPlan(this.coopItem.id)
403
+      .subscribe((result: any) => {
404
+        this.closeExecModal();
405
+        this.btnLoading = false;
406
+        if (result.status == 200) {
407
+          this.showPromptModal("立即执行", true, "");
408
+        } else {
409
+          this.showPromptModal("立即执行", false, result.msg);
410
+        }
411
+      });
412
+  }
413
+  // 关闭立即执行模态框
414
+  closeExecModal() {
415
+    this.execModal = false;
416
+  }
417
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
418
+  showPromptModal(con, success, promptInfo?) {
419
+    this.promptModalShow = false;
420
+    this.promptContent = con;
421
+    this.ifSuccess = success;
422
+    this.promptInfo = promptInfo;
423
+    setTimeout(() => {
424
+      this.promptModalShow = true;
425
+    }, 100);
426
+    this.getList(0);
427
+  }
428
+
429
+  // 删除轮巡计划
430
+  delModal: boolean = false; //删除模态框
431
+  tipsMsg1: string; //提示框信息
432
+  tipsMsg2: string; //操作后信息
433
+  confirmDelType: string; //确认的类型(启用/停用,删除)
434
+  confirmDelIsSwitch: boolean; //启用/停用
435
+  showDelModal(
436
+    id: number,
437
+    tipsMsg1: string,
438
+    tipsMsg2: string,
439
+    type: string,
440
+    isSwitch?: boolean
441
+  ) {
442
+    this.confirmDelIsSwitch = isSwitch;
443
+    this.confirmDelType = type;
444
+    this.delModal = true;
445
+    this.coopId = id;
446
+    this.tipsMsg1 = tipsMsg1;
447
+    this.tipsMsg2 = tipsMsg2;
448
+  }
449
+  // 隐藏删除框
450
+  hideDelModal() {
451
+    this.delModal = false;
452
+  }
453
+  // 确认删除
454
+  confirmDel() {
455
+    this.btnLoading = true;
456
+    if (this.confirmDelType === "del") {
457
+      //删除
458
+      this.mainService.simplePost("rmvData", "inspection", [this.coopId]).subscribe((data) => {
459
+        this.btnLoading = false;
460
+        this.delModal = false;
461
+        if (data.status == 200) {
462
+          if (
463
+            this.listOfData.length == 1 &&
464
+            this.pageIndex == Math.ceil(this.listLength / this.pageSize)
465
+          ) {
466
+            this.listLength--;
467
+            if (this.listLength === 0) {
468
+              this.pageIndex = 1;
469
+            } else {
470
+              this.pageIndex = Math.ceil(this.listLength / this.pageSize);
471
+            }
472
+          }
473
+          this.showPromptModal(this.tipsMsg2, true, "");
474
+        } else {
475
+          this.showPromptModal(this.tipsMsg2, false, data.msg);
476
+        }
477
+      });
478
+    } else if (this.confirmDelType === "switch") {
479
+      //启用/停用
480
+      this.mainService
481
+        .inspectionPost(
482
+          'inspectionPublish',
483
+          {
484
+            inspectionId: this.coopId,
485
+            type: this.confirmDelIsSwitch ? "disable" : "active",
486
+          }
487
+        )
488
+        .subscribe((data) => {
489
+          this.btnLoading = false;
490
+          this.delModal = false;
491
+          if (data.status == 200) {
492
+            this.showPromptModal(this.tipsMsg2, true, "");
493
+          } else {
494
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
495
+          }
496
+        });
497
+    } else if (this.confirmDelType === "once") {
498
+      //执行一次
499
+      this.mainService
500
+        .inspectionPost(
501
+          'inspectionPublish',
502
+          {
503
+            inspectionId: this.coopId,
504
+            type: "executeOnece",
505
+          }
506
+        )
507
+        .subscribe((data) => {
508
+          this.btnLoading = false;
509
+          this.delModal = false;
510
+          if (data.status == 200) {
511
+            this.showPromptModal(this.tipsMsg2, true, "");
512
+          } else {
513
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
514
+          }
515
+        });
516
+    }
517
+  }
518
+
519
+  // 查看
520
+  // detail(id) {
521
+  //   this.router.navigateByUrl("/main/roundRobin/roundRobinDetail/" + id);
522
+  // }
523
+  // -----------------------------------------------------------------------
524
+  //配置
525
+  planConfig(data) {
526
+    this.router.navigateByUrl("inspectionPlanConfig/" + data.id);
527
+  }
528
+
529
+  formatterExecDay = (value: number) => value ? `${value} 天` : '';
530
+  parserExecDay = (value: string) => value.replace(' 天', '');
531
+}

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

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

+ 31 - 1
src/app/views/main/main-routing.module.ts

@@ -532,7 +532,37 @@ const routes: Routes = [
532 532
 			{
533 533
 			  path: "dispensingBatch",
534 534
 			  loadChildren: () => import("../dispensing-batch/dispensing-batch.module").then((m) => m.DispensingBatchModule),
535
-			}
535
+			},
536
+      // 巡检单配置
537
+      {
538
+        path: "inspectionConfiguration",
539
+        loadChildren: () => import("../inspection-configuration/inspection-configuration.module").then((m) => m.InspectionConfigurationModule),
540
+      },
541
+      // 巡检项配置
542
+      {
543
+        path: "inspectionConfigurationItem",
544
+        loadChildren: () => import("../inspection-configuration-item/inspection-configuration-item.module").then((m) => m.InspectionConfigurationItemModule),
545
+      },
546
+      // 巡检点
547
+      {
548
+        path: "inspectionAddress",
549
+        loadChildren: () => import("../inspection-address/inspection-address.module").then((m) => m.InspectionAddressModule),
550
+      },
551
+      // 巡检计划
552
+      {
553
+        path: "inspectionPlan",
554
+        loadChildren: () => import("../inspection-plan/inspection-plan.module").then((m) => m.InspectionPlanModule),
555
+      },
556
+      // 巡检批次
557
+      {
558
+        path: "inspectionBatch",
559
+        loadChildren: () => import("../inspection-batch/inspection-batch.module").then((m) => m.InspectionBatchModule),
560
+      },
561
+      // 巡检执行
562
+      {
563
+        path: "inspectionExecute",
564
+        loadChildren: () => import("../inspection-execute/inspection-execute.module").then((m) => m.InspectionExecuteModule),
565
+      },
536 566
     ],
537 567
   },
538 568
 ];

Plik diff jest za duży
+ 6 - 1
src/app/views/main/main.component.html


+ 141 - 26
src/assets/iconfont/demo_index.html

@@ -55,6 +55,42 @@
55 55
           <ul class="icon_lists dib-box">
56 56
           
57 57
             <li class="dib">
58
+              <span class="icon icon_transport">&#xe885;</span>
59
+                <div class="name">24gf-tags</div>
60
+                <div class="code-name">&amp;#xe885;</div>
61
+              </li>
62
+          
63
+            <li class="dib">
64
+              <span class="icon icon_transport">&#xe644;</span>
65
+                <div class="name">修改</div>
66
+                <div class="code-name">&amp;#xe644;</div>
67
+              </li>
68
+          
69
+            <li class="dib">
70
+              <span class="icon icon_transport">&#xe74b;</span>
71
+                <div class="name">删除</div>
72
+                <div class="code-name">&amp;#xe74b;</div>
73
+              </li>
74
+          
75
+            <li class="dib">
76
+              <span class="icon icon_transport">&#xe627;</span>
77
+                <div class="name">输液</div>
78
+                <div class="code-name">&amp;#xe627;</div>
79
+              </li>
80
+          
81
+            <li class="dib">
82
+              <span class="icon icon_transport">&#xe62c;</span>
83
+                <div class="name">输液</div>
84
+                <div class="code-name">&amp;#xe62c;</div>
85
+              </li>
86
+          
87
+            <li class="dib">
88
+              <span class="icon icon_transport">&#xe6c6;</span>
89
+                <div class="name">巡检</div>
90
+                <div class="code-name">&amp;#xe6c6;</div>
91
+              </li>
92
+          
93
+            <li class="dib">
58 94
               <span class="icon icon_transport">&#xe719;</span>
59 95
                 <div class="name">订单—列表</div>
60 96
                 <div class="code-name">&amp;#xe719;</div>
@@ -667,12 +703,6 @@
667 703
               </li>
668 704
           
669 705
             <li class="dib">
670
-              <span class="icon icon_transport">&#xe635;</span>
671
-                <div class="name">icon_zhengzaijinx</div>
672
-                <div class="code-name">&amp;#xe635;</div>
673
-              </li>
674
-          
675
-            <li class="dib">
676 706
               <span class="icon icon_transport">&#xe662;</span>
677 707
                 <div class="name">xiala02</div>
678 708
                 <div class="code-name">&amp;#xe662;</div>
@@ -720,9 +750,9 @@
720 750
 <pre><code class="language-css"
721 751
 >@font-face {
722 752
   font-family: 'icon_transport';
723
-  src: url('iconfont.woff2?t=1715570700362') format('woff2'),
724
-       url('iconfont.woff?t=1715570700362') format('woff'),
725
-       url('iconfont.ttf?t=1715570700362') format('truetype');
753
+  src: url('iconfont.woff2?t=1719826829751') format('woff2'),
754
+       url('iconfont.woff?t=1719826829751') format('woff'),
755
+       url('iconfont.ttf?t=1719826829751') format('truetype');
726 756
 }
727 757
 </code></pre>
728 758
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -749,6 +779,60 @@
749 779
         <ul class="icon_lists dib-box">
750 780
           
751 781
           <li class="dib">
782
+            <span class="icon icon_transport transport-24gf-tags"></span>
783
+            <div class="name">
784
+              24gf-tags
785
+            </div>
786
+            <div class="code-name">.transport-24gf-tags
787
+            </div>
788
+          </li>
789
+          
790
+          <li class="dib">
791
+            <span class="icon icon_transport transport-weibiaoti2010104"></span>
792
+            <div class="name">
793
+              修改
794
+            </div>
795
+            <div class="code-name">.transport-weibiaoti2010104
796
+            </div>
797
+          </li>
798
+          
799
+          <li class="dib">
800
+            <span class="icon icon_transport transport-shanchu1"></span>
801
+            <div class="name">
802
+              删除
803
+            </div>
804
+            <div class="code-name">.transport-shanchu1
805
+            </div>
806
+          </li>
807
+          
808
+          <li class="dib">
809
+            <span class="icon icon_transport transport-shuye"></span>
810
+            <div class="name">
811
+              输液
812
+            </div>
813
+            <div class="code-name">.transport-shuye
814
+            </div>
815
+          </li>
816
+          
817
+          <li class="dib">
818
+            <span class="icon icon_transport transport-shuye1"></span>
819
+            <div class="name">
820
+              输液
821
+            </div>
822
+            <div class="code-name">.transport-shuye1
823
+            </div>
824
+          </li>
825
+          
826
+          <li class="dib">
827
+            <span class="icon icon_transport transport-xunjian"></span>
828
+            <div class="name">
829
+              巡检
830
+            </div>
831
+            <div class="code-name">.transport-xunjian
832
+            </div>
833
+          </li>
834
+          
835
+          <li class="dib">
752 836
             <span class="icon icon_transport transport-dingdanliebiao"></span>
753 837
             <div class="name">
754 838
               订单—列表
@@ -1667,15 +1751,6 @@
1667 1751
           </li>
1668 1752
           
1669 1753
           <li class="dib">
1670
-            <span class="icon icon_transport transport-icon_zhengzaijinx"></span>
1671
-            <div class="name">
1672
-              icon_zhengzaijinx
1673
-            </div>
1674
-            <div class="code-name">.transport-icon_zhengzaijinx
1675
-            </div>
1676
-          </li>
1677
-          
1678
-          <li class="dib">
1679 1754
             <span class="icon icon_transport transport-xiala1"></span>
1680 1755
             <div class="name">
1681 1756
               xiala02
@@ -1749,6 +1824,54 @@
1749 1824
           
1750 1825
             <li class="dib">
1751 1826
                 <svg class="icon svg-icon" aria-hidden="true">
1827
+                  <use xlink:href="#transport-24gf-tags"></use>
1828
+                </svg>
1829
+                <div class="name">24gf-tags</div>
1830
+                <div class="code-name">#transport-24gf-tags</div>
1831
+            </li>
1832
+          
1833
+            <li class="dib">
1834
+                <svg class="icon svg-icon" aria-hidden="true">
1835
+                  <use xlink:href="#transport-weibiaoti2010104"></use>
1836
+                </svg>
1837
+                <div class="name">修改</div>
1838
+                <div class="code-name">#transport-weibiaoti2010104</div>
1839
+            </li>
1840
+          
1841
+            <li class="dib">
1842
+                <svg class="icon svg-icon" aria-hidden="true">
1843
+                  <use xlink:href="#transport-shanchu1"></use>
1844
+                </svg>
1845
+                <div class="name">删除</div>
1846
+                <div class="code-name">#transport-shanchu1</div>
1847
+            </li>
1848
+          
1849
+            <li class="dib">
1850
+                <svg class="icon svg-icon" aria-hidden="true">
1851
+                  <use xlink:href="#transport-shuye"></use>
1852
+                </svg>
1853
+                <div class="name">输液</div>
1854
+                <div class="code-name">#transport-shuye</div>
1855
+            </li>
1856
+          
1857
+            <li class="dib">
1858
+                <svg class="icon svg-icon" aria-hidden="true">
1859
+                  <use xlink:href="#transport-shuye1"></use>
1860
+                </svg>
1861
+                <div class="name">输液</div>
1862
+                <div class="code-name">#transport-shuye1</div>
1863
+            </li>
1864
+          
1865
+            <li class="dib">
1866
+                <svg class="icon svg-icon" aria-hidden="true">
1867
+                  <use xlink:href="#transport-xunjian"></use>
1868
+                </svg>
1869
+                <div class="name">巡检</div>
1870
+                <div class="code-name">#transport-xunjian</div>
1871
+            </li>
1872
+          
1873
+            <li class="dib">
1874
+                <svg class="icon svg-icon" aria-hidden="true">
1752 1875
                   <use xlink:href="#transport-dingdanliebiao"></use>
1753 1876
                 </svg>
1754 1877
                 <div class="name">订单—列表</div>
@@ -2565,14 +2688,6 @@
2565 2688
           
2566 2689
             <li class="dib">
2567 2690
                 <svg class="icon svg-icon" aria-hidden="true">
2568
-                  <use xlink:href="#transport-icon_zhengzaijinx"></use>
2569
-                </svg>
2570
-                <div class="name">icon_zhengzaijinx</div>
2571
-                <div class="code-name">#transport-icon_zhengzaijinx</div>
2572
-            </li>
2573
-          
2574
-            <li class="dib">
2575
-                <svg class="icon svg-icon" aria-hidden="true">
2576 2691
                   <use xlink:href="#transport-xiala1"></use>
2577 2692
                 </svg>
2578 2693
                 <div class="name">xiala02</div>

+ 27 - 7
src/assets/iconfont/iconfont.css

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "icon_transport"; /* Project id 4543613 */
3
-  src: url('iconfont.woff2?t=1715570700362') format('woff2'),
4
-       url('iconfont.woff?t=1715570700362') format('woff'),
5
-       url('iconfont.ttf?t=1715570700362') format('truetype');
3
+  src: url('iconfont.woff2?t=1719826829751') format('woff2'),
4
+       url('iconfont.woff?t=1719826829751') format('woff'),
5
+       url('iconfont.ttf?t=1719826829751') format('truetype');
6 6
 }
7 7
 
8 8
 .icon_transport {
@@ -13,6 +13,30 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.transport-24gf-tags:before {
17
+  content: "\e885";
18
+}
19
+
20
+.transport-weibiaoti2010104:before {
21
+  content: "\e644";
22
+}
23
+
24
+.transport-shanchu1:before {
25
+  content: "\e74b";
26
+}
27
+
28
+.transport-shuye:before {
29
+  content: "\e627";
30
+}
31
+
32
+.transport-shuye1:before {
33
+  content: "\e62c";
34
+}
35
+
36
+.transport-xunjian:before {
37
+  content: "\e6c6";
38
+}
39
+
16 40
 .transport-dingdanliebiao:before {
17 41
   content: "\e719";
18 42
 }
@@ -421,10 +445,6 @@
421 445
   content: "\e61a";
422 446
 }
423 447
 
424
-.transport-icon_zhengzaijinx:before {
425
-  content: "\e635";
426
-}
427
-
428 448
 .transport-xiala1:before {
429 449
   content: "\e662";
430 450
 }

Plik diff jest za duży
+ 1 - 1
src/assets/iconfont/iconfont.js


+ 42 - 7
src/assets/iconfont/iconfont.json

@@ -6,6 +6,48 @@
6 6
   "description": "",
7 7
   "glyphs": [
8 8
     {
9
+      "icon_id": "7542757",
10
+      "name": "24gf-tags",
11
+      "font_class": "24gf-tags",
12
+      "unicode": "e885",
13
+      "unicode_decimal": 59525
14
+    },
15
+    {
16
+      "icon_id": "1069107",
17
+      "name": "修改",
18
+      "font_class": "weibiaoti2010104",
19
+      "unicode": "e644",
20
+      "unicode_decimal": 58948
21
+    },
22
+    {
23
+      "icon_id": "577357",
24
+      "name": "删除",
25
+      "font_class": "shanchu1",
26
+      "unicode": "e74b",
27
+      "unicode_decimal": 59211
28
+    },
29
+    {
30
+      "icon_id": "20274523",
31
+      "name": "输液",
32
+      "font_class": "shuye",
33
+      "unicode": "e627",
34
+      "unicode_decimal": 58919
35
+    },
36
+    {
37
+      "icon_id": "31359573",
38
+      "name": "输液",
39
+      "font_class": "shuye1",
40
+      "unicode": "e62c",
41
+      "unicode_decimal": 58924
42
+    },
43
+    {
44
+      "icon_id": "18616187",
45
+      "name": "巡检",
46
+      "font_class": "xunjian",
47
+      "unicode": "e6c6",
48
+      "unicode_decimal": 59078
49
+    },
50
+    {
9 51
       "icon_id": "8348114",
10 52
       "name": "订单—列表",
11 53
       "font_class": "dingdanliebiao",
@@ -720,13 +762,6 @@
720 762
       "unicode_decimal": 58906
721 763
     },
722 764
     {
723
-      "icon_id": "4852661",
724
-      "name": "icon_zhengzaijinx",
725
-      "font_class": "icon_zhengzaijinx",
726
-      "unicode": "e635",
727
-      "unicode_decimal": 58933
728
-    },
729
-    {
730 765
       "icon_id": "5933299",
731 766
       "name": "xiala02",
732 767
       "font_class": "xiala1",

BIN
src/assets/iconfont/iconfont.ttf


BIN
src/assets/iconfont/iconfont.woff


BIN
src/assets/iconfont/iconfont.woff2


+ 31 - 0
src/common.less

@@ -1,3 +1,6 @@
1
+.ant-table-tbody tr:nth-of-type(2n){
2
+  background-color: #e9f7e9!important;
3
+}
1 4
 .ml8 {
2 5
   margin-left: 8px !important;
3 6
 }
@@ -13,6 +16,9 @@
13 16
 .ml16 {
14 17
   margin-left: 16px !important;
15 18
 }
19
+.line_height_normal{
20
+  line-height: normal !important;
21
+}
16 22
 .w100 {
17 23
   width: 100% !important;
18 24
 }
@@ -261,6 +267,31 @@
261 267
         align-items: center;
262 268
         flex-wrap: wrap;
263 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
+        }
264 295
       }
265 296
     }
266 297
     .list-template__checkBoxes {

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8 8
   enableProdMode();
9 9
   if (window) {
10 10
     window.console.log = function () { };
11
-    console.info(`%c%c v2.4.62 %c 武汉大势恒通科技有限责任公司 `,
11
+    console.info(`%c%c v2.4.63 %c 武汉大势恒通科技有限责任公司 `,
12 12
       'color: #3eaf7c; font-size: 16px;line-height:30px;',
13 13
       'background: #35495e; padding: 4px; border-radius: 3px 0 0 3px; color: #fff',
14 14
       'background: #41b883; padding: 4px; border-radius: 0 3px 3px 0; color: #fff',