seimin 9 місяців тому
батько
коміт
74e35b6e2b

+ 2 - 2
src/app/views/inspection-batch/inspection-batch.component.html

@@ -5,8 +5,8 @@
5 5
         <div class="list-template__searchItem">
6 6
           <span class="label">计划主题</span>:
7 7
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
8
-            (nzOnSearch)="changeInp('search', 'incidentPlan', $event)" nzAllowClear nzPlaceHolder="请选择计划主题" [(ngModel)]="searchDto.inspectionId">
9
-            <ng-container *ngFor="let option of incidentPlanSearchList">
8
+            (nzOnSearch)="changeInp('search', 'inspectionPlan', $event)" nzAllowClear nzPlaceHolder="请选择计划主题" [(ngModel)]="searchDto.inspectionId">
9
+            <ng-container *ngFor="let option of inspectionPlanSearchList">
10 10
               <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
11 11
             </ng-container>
12 12
             <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>

+ 6 - 6
src/app/views/inspection-batch/inspection-batch.component.ts

@@ -48,14 +48,14 @@ export class InspectionBatchComponent implements OnInit {
48 48
   ngOnInit() {
49 49
     //防抖
50 50
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
51
-      if(v[1] === 'incidentPlan'){
52
-        this.getIncidentPlans(v[0], v[2]);
51
+      if(v[1] === 'inspectionPlan'){
52
+        this.getInspectionPlans(v[0], v[2]);
53 53
       }
54 54
     });
55 55
     this.currentHospital = this.tool.getCurrentHospital();
56 56
     this.coopBtns = this.tool.initCoopBtns(this.route);
57 57
     this.getList(1);
58
-    this.getIncidentPlans('search', '');
58
+    this.getInspectionPlans('search', '');
59 59
     this.getStatus();
60 60
   }
61 61
 
@@ -178,8 +178,8 @@ export class InspectionBatchComponent implements OnInit {
178 178
   }
179 179
 
180 180
   // 获取巡检计划
181
-  incidentPlanSearchList: any = [];
182
-  getIncidentPlans(type, keyword, init = false) {
181
+  inspectionPlanSearchList: any = [];
182
+  getInspectionPlans(type, keyword, init = false) {
183 183
     let postData = {
184 184
       inspection: {
185 185
         name: keyword,
@@ -191,7 +191,7 @@ export class InspectionBatchComponent implements OnInit {
191 191
     this.mainService
192 192
       .getFetchDataList("data", "inspection", postData)
193 193
       .subscribe((data) => {
194
-        this.incidentPlanSearchList = data.list;
194
+        this.inspectionPlanSearchList = data.list;
195 195
         this.isLoading = false;
196 196
       });
197 197
   }

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

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

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

@@ -0,0 +1,137 @@
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>
45
+      <div nz-col nzLg="8" class="list-template__btns">
46
+        <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="showInspectionAddressDepartment()">批量关联科室</button>
47
+        <div class="dropdown">
48
+          <button [disabled]="!checkedDepIds.length" nz-button class="btn default ml8" *ngIf="coopBtns.del || coopBtns.print || coopBtns.reset" (mouseenter)="showDropdown = (checkedDepIds.length ? true : false)" (mouseleave)="showDropdown = false">批量操作</button>
49
+          <div class="dropdown-content" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
50
+            <div class="dropdownItem" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','delList')" *ngIf="coopBtns.del">批量删除</div>
51
+            <div class="dropdownItem" *ngIf="coopBtns.print" (click)="print($event,true)">批量打印</div>
52
+            <div class="dropdownItem" *ngIf="coopBtns.reset" (click)="showDelModal(data,'您确认要重置二维码吗?','重置','resetList')">批量重置</div>
53
+          </div>
54
+        </div>
55
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
56
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
57
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
58
+      </div>
59
+    </div>
60
+    <div class="list-template__bottom">
61
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
62
+        [nzLoading]="loading1">
63
+        <thead>
64
+          <tr class="thead">
65
+            <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" (nzCheckedChange)="checkAll($event)"></th>
66
+            <th nzWidth="10%">单号</th>
67
+            <th nzWidth="10%">计划主题|批次号</th>
68
+            <th nzWidth="10%">巡检点|巡检单</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="15%">操作</th>
75
+          </tr>
76
+        </thead>
77
+        <tbody>
78
+          <tr *ngFor="let data of listOfData;let i = index" (click)="selectedListData(data)">
79
+            <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
80
+            <td>{{data.code}}</td>
81
+            <td>{{data.inspectionDTO?.name}}<br>{{data.batchNo}}</td>
82
+            <td>{{data.inspectionNodeDTO?.name}}<br>{{data.inspectionFormDTO?.inspectionFormDTO?.name}}</td>
83
+            <td>{{data.overtime | date:'yyyy-MM-dd HH:mm'}}</td>
84
+            <td>{{data.signType?.name}}</td>
85
+            <td>{{data.userDTO?.name || data.groupDTO?.groupName}}</td>
86
+            <td>{{data.exception === 1 ? '是' : '否'}}</td>
87
+            <td>{{data.status?.name}}</td>
88
+            <td>
89
+              <div class="coop">
90
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
91
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'删除后您配置的相关巡检计划,下次执行时不在生成巡检任务,您确认要删除吗?','删除','del')">删除</span>
92
+              </div>
93
+            </td>
94
+          </tr>
95
+        </tbody>
96
+      </nz-table>
97
+      <div class="list-template__pagination">
98
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
99
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
100
+        </nz-pagination>
101
+      </div>
102
+    </div>
103
+  </div>
104
+</div>
105
+<!-- 模态框 -->
106
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
107
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
108
+<!-- 操作成功/失败提示框 -->
109
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
110
+  [info]="promptInfo">
111
+</app-prompt-modal>
112
+<!-- 二维码打印 -->
113
+<div id="report" style="display: none">
114
+  <div *ngFor="let img of codes" style="display: inline-block;">
115
+    <img style="width: 200px;height:200px;" [src]="img.base64" alt="">
116
+    <p style="margin: 0;text-align: center; font-size: 20px;width: 200px;">{{img.name}}</p>
117
+  </div>
118
+</div>
119
+<!-- 批量关联科室 -->
120
+<app-inspection-address-department-prompt-modal
121
+  *ngIf="inspectionAddressDepartmentPromptModalShow"
122
+  [show]="inspectionAddressDepartmentPromptModalShow"
123
+  (closeModelHs)="closeModelInspectionAddressDepartment($event)"
124
+  (confirmModelHs)="confirmModelInspectionAddressDepartment($event)"
125
+></app-inspection-address-department-prompt-modal>
126
+
127
+<!-- 批量关联科室-标签 -->
128
+<app-inspection-address-tag-prompt-modal
129
+  [deptFlag]="inspectionAddressTagPromptModalShow"
130
+  [checkedDepIdsModel]="checkedDepIdsModel"
131
+  (submitFormHand)="confirmModelInspectionAddressTag($event)"
132
+  (deptFlagHand)="closeModelInspectionAddressTag($event)"
133
+  *ngIf="inspectionAddressTagPromptModalShow"
134
+></app-inspection-address-tag-prompt-modal>
135
+
136
+<!-- 遮罩 -->
137
+<app-mask *ngIf="maskFlag"></app-mask>

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

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

@@ -0,0 +1,369 @@
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
+  inspectionAddressDepartmentPromptModalShow = false; //标本历史记录弹窗开关
68
+  showInspectionAddressDepartment() {
69
+    this.inspectionAddressDepartmentPromptModalShow = true;
70
+  }
71
+  // 关闭弹窗
72
+  closeModelInspectionAddressDepartment(e) {
73
+    this.inspectionAddressDepartmentPromptModalShow = JSON.parse(e).show;
74
+  }
75
+  // 确认弹窗
76
+  checkedDepIdsModel = [];
77
+  confirmModelInspectionAddressDepartment(checkedDepIds) {
78
+    this.inspectionAddressDepartmentPromptModalShow = true;
79
+    this.checkedDepIdsModel = checkedDepIds;
80
+    console.log(checkedDepIds)
81
+    this.showInspectionAddressTag();
82
+  }
83
+
84
+  // 批量关联科室-标签
85
+  inspectionAddressTagPromptModalShow = false; //标本历史记录弹窗开关
86
+  showInspectionAddressTag() {
87
+    this.inspectionAddressTagPromptModalShow = true;
88
+  }
89
+  // 关闭弹窗
90
+  closeModelInspectionAddressTag(e) {
91
+    this.inspectionAddressTagPromptModalShow = JSON.parse(e).show;
92
+  }
93
+  // 确认弹窗
94
+  maskFlag: any = false;
95
+  confirmModelInspectionAddressTag(tags) {
96
+    this.maskFlag = this.message.loading("正在加载中..", {
97
+      nzDuration: 0,
98
+    }).messageId;
99
+    this.inspectionAddressTagPromptModalShow = true;
100
+    console.log(this.checkedDepIdsModel, tags);
101
+    let postData:any = {
102
+      deptIds: this.checkedDepIdsModel.toString(),
103
+      hosId: this.currentHospital.id,
104
+      tagIds: tags.toString(),
105
+    };
106
+    console.log(postData);
107
+    this.btnLoading = true;
108
+    this.mainService
109
+      .inspectionPost("batchBindFormNode", postData)
110
+      .subscribe((result) => {
111
+        this.message.remove(this.maskFlag);
112
+        this.maskFlag = false;
113
+        this.btnLoading = false;
114
+        if (result.status == 200) {
115
+          this.inspectionAddressDepartmentPromptModalShow = false;
116
+          this.inspectionAddressTagPromptModalShow = false;
117
+          this.showPromptModal('操作', true, '');
118
+        } else if (result.status == 501) {
119
+          this.inspectionAddressDepartmentPromptModalShow = false;
120
+          this.inspectionAddressTagPromptModalShow = false;
121
+          this.showPromptModal('操作', true, result.msg);
122
+        } else {
123
+          this.showPromptModal('操作', false, result.msg);
124
+        }
125
+      });
126
+  }
127
+
128
+  // 打印
129
+  codes = []; //二维码
130
+  printLoading: boolean = false; //批量打印按钮loading状态
131
+  print(e, batch, id?) {
132
+    e.stopPropagation();
133
+    this.printLoading = true;
134
+    this.mainService
135
+      .inspectionPost("getNodeQrCode", batch ? { nodeIds: this.checkedDepIds.toString() } : [id])
136
+      .subscribe((data) => {
137
+        this.codes = data.data;
138
+        this.printLoading = false;
139
+        setTimeout(() => {
140
+          const printContent = document.getElementById("report");
141
+          const WindowPrt = window.open("", "", "width=700,height=900");
142
+          WindowPrt.document.write(printContent.innerHTML);
143
+          WindowPrt.document.close();
144
+          WindowPrt.focus();
145
+          WindowPrt.print();
146
+          WindowPrt.close();
147
+        }, 100);
148
+      });
149
+  }
150
+
151
+  // 选中表格单列
152
+  mapOfCheckedId: { [key: string]: boolean } = {};
153
+  checkedDepIds = []; //已选中单列id
154
+  refreshStatus(): void {
155
+    let listOfData = this.listOfData;
156
+    this.isAllDisplayDataChecked = listOfData.every(
157
+      (item) => this.mapOfCheckedId[item.id]
158
+    );
159
+    let arr = [];
160
+    for (var k in this.mapOfCheckedId) {
161
+      if (this.mapOfCheckedId[k]) {
162
+        arr.push(Number(k));
163
+      }
164
+    }
165
+    this.checkedDepIds = arr;
166
+  }
167
+  // 整行操作
168
+  selectedListData(data) {
169
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
170
+    this.refreshStatus();
171
+  }
172
+  // 全选
173
+  isAllDisplayDataChecked = false; //当前页是否全选
174
+  checkAll(value: boolean): void {
175
+    this.listOfData.forEach((item) => {
176
+      this.mapOfCheckedId[item.id] = value;
177
+    });
178
+    this.refreshStatus();
179
+  }
180
+
181
+  // 搜索
182
+  search() {
183
+    this.getList(0);
184
+  }
185
+  // 重置
186
+  reset() {
187
+    this.inspectionBatchSearchList = [];
188
+    this.searchDto = {};
189
+    this.getList(1);
190
+  }
191
+
192
+  // 表格数据
193
+  searchDto: any = {};
194
+  loading1 = false;
195
+  getList(type) {
196
+    if (type == 1) {
197
+      this.pageIndex = 1;
198
+    }
199
+    let data = {
200
+      idx: this.pageIndex - 1,
201
+      sum: this.pageSize,
202
+      inspectionTask: {
203
+        hosId: this.currentHospital.id,
204
+        code: this.searchDto.code || undefined,
205
+        inspectionId: this.searchDto.inspectionId || undefined,
206
+        batchId: this.searchDto.batchId || undefined,
207
+        status: this.searchDto.statusId ? { id: this.searchDto.statusId } : undefined,
208
+      },
209
+    };
210
+    this.mapOfCheckedId = {};
211
+    this.checkedDepIds = [];
212
+    this.isAllDisplayDataChecked = false;
213
+    this.loading1 = true;
214
+    this.mainService
215
+      .getFetchDataList("simple/data", "inspectionTask", data)
216
+      .subscribe((data) => {
217
+        this.loading1 = false;
218
+        if (data.status == 200) {
219
+          this.listOfData = data.list;
220
+          this.listLength = data.totalNum;
221
+        }else{
222
+          this.message.error(data.msg || "请求数据失败");
223
+        }
224
+      });
225
+  }
226
+
227
+  // 边输边搜节流阀
228
+  isLoading = false;
229
+  changeInp(type, model, e) {
230
+    this.isLoading = true;
231
+    this.changeInpSubject.next([type, model, e]);
232
+  }
233
+
234
+  // 获取巡检计划
235
+  inspectionPlanSearchList: any = []; //所有所属科室(搜索)
236
+  getIncidentPlans(type, keyword, init = false) {
237
+    let postData = {
238
+      inspection: {
239
+        name: keyword,
240
+        hosId: this.currentHospital.id,
241
+      },
242
+      idx: 0,
243
+      sum: 20,
244
+    };
245
+    this.mainService
246
+      .getFetchDataList("data", "inspection", postData)
247
+      .subscribe((data) => {
248
+        this.inspectionPlanSearchList = data.list;
249
+        this.isLoading = false;
250
+      });
251
+  }
252
+
253
+  // 获取批次
254
+  inspectionBatchSearchList: any = [];
255
+  getInspectionBatchs(type, keyword, init = false) {
256
+    let postData = {
257
+      inspectionBatch: {
258
+        name: keyword,
259
+        hosId: this.currentHospital.id,
260
+        inspectionId: this.searchDto.inspectionId || undefined,
261
+      },
262
+      idx: 0,
263
+      sum: 20,
264
+    };
265
+    this.mainService
266
+      .getFetchDataList("simple/data", "inspectionBatch", postData)
267
+      .subscribe((data) => {
268
+        this.inspectionBatchSearchList = data.list;
269
+        this.isLoading = false;
270
+      });
271
+  }
272
+
273
+  // 修改巡检计划
274
+  changeInspection(e){
275
+    this.inspectionBatchSearchList = [];
276
+    this.searchDto.inspectionBatchId = null;
277
+    this.getInspectionBatchs('search', '');
278
+  }
279
+
280
+  //获取状态
281
+  statusSearchList:any[] = [];
282
+  getStatus() {
283
+    this.mainService
284
+    .getDictionary('list', 'inspection_task_status')
285
+    .subscribe((data) => {
286
+      this.statusSearchList = data || [];
287
+    });
288
+  }
289
+
290
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
291
+  showPromptModal(con, success, promptInfo?) {
292
+    this.promptModalShow = false;
293
+    this.promptContent = con;
294
+    this.ifSuccess = success;
295
+    this.promptInfo = promptInfo;
296
+    setTimeout(() => {
297
+      this.promptModalShow = true;
298
+    }, 100);
299
+    this.getList(0);
300
+  }
301
+
302
+  delModal: boolean = false; //删除模态框
303
+  tipsMsg1: string; //提示框信息
304
+  tipsMsg2: string; //操作后信息
305
+  confirmDelType: string; //确认的类型(启用/停用,删除)
306
+  showDelModal(
307
+    data,
308
+    tipsMsg1: string,
309
+    tipsMsg2: string,
310
+    type: string,
311
+  ) {
312
+    this.confirmDelType = type;
313
+    this.delModal = true;
314
+    this.coopData = data;
315
+    this.tipsMsg1 = tipsMsg1;
316
+    this.tipsMsg2 = tipsMsg2;
317
+  }
318
+  // 隐藏删除框
319
+  hideDelModal() {
320
+    this.delModal = false;
321
+  }
322
+  // 确认删除
323
+  confirmDel() {
324
+    this.btnLoading = true;
325
+    if (this.confirmDelType === "del") {
326
+      //删除
327
+      this.mainService
328
+        .simplePost("rmvData", "inspectionTask", [this.coopData.id])
329
+        .subscribe((data) => {
330
+          this.btnLoading = false;
331
+          this.delModal = false;
332
+          if (data.status == 200) {
333
+            this.showPromptModal(this.tipsMsg2, true, "");
334
+          } else {
335
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
336
+          }
337
+        });
338
+    } else if (this.confirmDelType === "delList") {
339
+      //批量删除
340
+      this.mainService
341
+        .simplePost("rmvData", "inspectionTask", this.checkedDepIds)
342
+        .subscribe((data) => {
343
+          this.btnLoading = false;
344
+          this.delModal = false;
345
+          if (data.status == 200) {
346
+            this.showPromptModal(this.tipsMsg2, true, "");
347
+          } else {
348
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
349
+          }
350
+        });
351
+    } else if (this.confirmDelType === "resetList") {
352
+      //批量重置
353
+      let postData = {
354
+        nodeIds: this.checkedDepIds.toString(),
355
+      }
356
+      this.mainService
357
+        .inspectionPost("batchResetNodeCode", postData)
358
+        .subscribe((data) => {
359
+          this.btnLoading = false;
360
+          this.delModal = false;
361
+          if (data.status == 200) {
362
+            this.showPromptModal(this.tipsMsg2, true, "");
363
+          } else {
364
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
365
+          }
366
+        });
367
+    }
368
+  }
369
+}

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

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

@@ -528,6 +528,11 @@ const routes: Routes = [
528 528
         path: "inspectionBatch",
529 529
         loadChildren: () => import("../inspection-batch/inspection-batch.module").then((m) => m.InspectionBatchModule),
530 530
       },
531
+      // 巡检执行
532
+      {
533
+        path: "inspectionExecute",
534
+        loadChildren: () => import("../inspection-execute/inspection-execute.module").then((m) => m.InspectionExecuteModule),
535
+      },
531 536
     ],
532 537
   },
533 538
 ];