瀏覽代碼

Merge branch 'lmm' into tj

seimin 3 年之前
父節點
當前提交
1fa7975b5b

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

@@ -518,4 +518,10 @@ export class MainService {
518 518
       headers: this.headers,
519 519
     });
520 520
   }
521
+  // 更新,新增,删除检查类型设置
522
+  upDictionary(data) {
523
+    return this.http.post(host.host + "/common/common/upDictionary", data, {
524
+      headers: this.headers,
525
+    });
526
+  }
521 527
 }

+ 1 - 0
src/app/share/detail-patients/detail-patients.component.html

@@ -23,6 +23,7 @@
23 23
           <div nz-col nzSpan="8">陪同情况:{{orderInfo.isAccompany==1?'需要医护陪同':'无需医护陪同'}}</div>
24 24
           <div nz-col nzSpan="8">预约时间:{{orderInfo.yyjdTime|date:'MM-dd HH:mm'}}</div>
25 25
           <div nz-col nzSpan="8" *ngIf="orderInfo.worker">支助人员信息:{{orderInfo.worker.name}}</div>
26
+          <div nz-col nzSpan="8">是否半程陪检:{{orderInfo.isHalfInspect===1?'是':'否'}}</div>
26 27
           <div nz-col nzSpan="24" *ngIf="orderInfo.specialCloseReason">
27 28
             特殊情况关闭原因:{{orderInfo.specialCloseReason}}
28 29
           </div>

+ 2 - 2
src/app/share/order-detail/order-detail.component.html

@@ -392,8 +392,8 @@
392 392
               陪同情况:{{orderInfo.isAccompany==1?'需要医护陪同':'无需医护陪同'}}</div>
393 393
             <div nz-col nzSpan="6" *ngIf="orderInfo.yyjdTime">
394 394
               预约时间:{{orderInfo.yyjdTime|date:'MM-dd HH:mm'}}</div>
395
-            <div nz-col nzSpan="6" *ngIf="orderInfo.taskType">
396
-              是否半程陪检:{{orderInfo.taskType.isHalfInspect===1?'是':'否'}}</div>
395
+            <div nz-col nzSpan="6">
396
+              是否半程陪检:{{orderInfo.isHalfInspect===1?'是':'否'}}</div>
397 397
           </div>
398 398
           <div class="info" nz-row *ngIf="orderInfo.urgentDetails">
399 399
             <div nz-col nzSpan="24" class="jiaji">加急原因:{{orderInfo.urgentDetails.urgentReason}}</div>

+ 3 - 3
src/app/views/fuwutai/fuwutai.component.html

@@ -108,7 +108,7 @@
108 108
                   <span class="left mr8"><label nz-checkbox [ngModel]="data.checked"
109 109
                       (ngModelChange)="batchDispatchSelect($event,data.id)"></label></span>
110 110
                   <span class="left gongdan_name" nz-tooltip
111
-                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.taskType.isHalfInspect ===
111
+                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.isHalfInspect ===
112 112
                     1?'半程陪检':data.taskType.taskName}}({{data.gdcode}})</span>
113 113
                   <span nz-tooltip
114 114
                     [nzTooltipTitle]="data.worker?data.worker.phone:''">{{data.worker?data.worker.name:''}}</span>
@@ -275,7 +275,7 @@
275 275
                   <span class="left mr8"><label nz-checkbox [ngModel]="data.checked"
276 276
                       (ngModelChange)="batchWithdrawalSelect($event,data.id)"></label></span>
277 277
                   <span class="left gongdan_name" nz-tooltip
278
-                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.taskType.isHalfInspect ===
278
+                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.isHalfInspect ===
279 279
                     1?'半程陪检':data.taskType.taskName}}({{data.gdcode}})</span>
280 280
                   <span nz-tooltip
281 281
                     [nzTooltipTitle]="data.worker?data.worker.phone:''">{{data.worker?data.worker.name:''}}</span>
@@ -440,7 +440,7 @@
440 440
                 <!-- 工单 -->
441 441
                 <div class="gongdan">
442 442
                   <span class="left gongdan_name" nz-tooltip
443
-                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.taskType.isHalfInspect ===
443
+                    [nzTooltipTitle]="data.taskType.taskName+'('+data.gdcode+')'">{{data.isHalfInspect ===
444 444
                     1?'半程陪检':data.taskType.taskName}}({{data.gdcode}})</span>
445 445
                   <span nz-tooltip
446 446
                     [nzTooltipTitle]="data.worker?data.worker.phone:''">{{data.worker?data.worker.name:''}}</span>

+ 3 - 3
src/app/views/hushijiandan/hushijiandan.component.html

@@ -8,7 +8,7 @@
8 8
         </div>
9 9
       </div>
10 10
       <div class="notAvailable display_flex align-items_center justify-content_flex-center"
11
-        *ngIf="!deptTaskTypeRules.openInspection">
11
+        *ngIf="!deptTaskTypeRules.openInspection&&!deptTaskTypeRules.openPatientTransport">
12 12
         <div>
13 13
           <img src="../../assets/images/icon_jianchakong.png" alt="">
14 14
           <div>暂未开通</div>
@@ -25,7 +25,7 @@
25 25
         <div class="checkedInfo patient" style="padding-bottom:0;">
26 26
           <overlay-scrollbars #osComponentRef4 class="box">
27 27
             <div class="loading display_flex align-items_center justify-content_flex-center"
28
-              *ngIf="pLoading&&deptTaskTypeRules.openInspection">
28
+              *ngIf="pLoading&&(deptTaskTypeRules.openInspection||deptTaskTypeRules.openPatientTransport)">
29 29
               <div>
30 30
                 <img src="../../assets/images/loading.gif" alt="">
31 31
                 <div>加载中...</div>
@@ -649,7 +649,7 @@
649 649
                         <div class="info">
650 650
                           <div class="row" nz-row>
651 651
                             <div nz-col nzSpan="12" class="col txtL">
652
-                              {{item.taskType.isHalfInspect ===
652
+                              {{item.isHalfInspect ===
653 653
                               1?'半程陪检':item.taskType.taskName}}
654 654
                               <span
655 655
                                 *ngIf="item.patient&&(item.taskType.associationType.value=='patientTransport'||item.taskType.associationType.value=='inspect')">

+ 26 - 8
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -630,8 +630,11 @@ export class HushijiandanComponent implements OnInit {
630 630
         if (search === undefined) {
631 631
           that.deptTaskTypeRules = data.data;
632 632
           that.getOrderList();
633
-          if (that.deptTaskTypeRules.openInspection) {
634
-            // 陪检权限
633
+          if (
634
+            that.deptTaskTypeRules.openInspection ||
635
+            that.deptTaskTypeRules.openPatientTransport
636
+          ) {
637
+            // 陪检权限或转科权限
635 638
             if (this.tabFlag) {
636 639
               this.tabFlag = false;
637 640
               this.getTaskTypeByInspection().subscribe((result) => {
@@ -992,13 +995,24 @@ export class HushijiandanComponent implements OnInit {
992 995
       .postCustom("configuration", "deptTSPTaskType", {})
993 996
       .subscribe((data) => {
994 997
         that.checkTypeLis = data.data;
995
-        // 默认选中患者陪检
996
-        that.checkTypeLis.forEach((e) => {
997
-          if (e.associationType.value == "inspect") {
998
-            that.patientForm.controls.checkedType.setValue(e.id);
999
-            that.patientForm.value.checkedType = e.id;
998
+        // 默认选中患者陪检,没有患者陪检,则选择第一个患者其他服务的任务类型
999
+        for (let i = 0; i < that.checkTypeLis.length; i++) {
1000
+          if (that.checkTypeLis[i].associationType.value == "inspect") {
1001
+            that.patientForm.controls.checkedType.setValue(
1002
+              that.checkTypeLis[i].id
1003
+            );
1004
+            that.patientForm.value.checkedType = that.checkTypeLis[i].id;
1005
+            break;
1006
+          } else if (
1007
+            that.checkTypeLis[i].associationType.value == "patientTransport"
1008
+          ) {
1009
+            that.patientForm.controls.checkedType.setValue(
1010
+              that.checkTypeLis[i].id
1011
+            );
1012
+            that.patientForm.value.checkedType = that.checkTypeLis[i].id;
1013
+            break;
1000 1014
           }
1001
-        });
1015
+        }
1002 1016
         this.changeCheckedType();
1003 1017
       });
1004 1018
   }
@@ -1131,6 +1145,10 @@ export class HushijiandanComponent implements OnInit {
1131 1145
         },
1132 1146
       },
1133 1147
     };
1148
+    if (!flag) {
1149
+      postData.workOrder.taskType.isHalfInspect =
1150
+        this.currentTasktype.isHalfInspect === 1 ? 1 : 0; //半程陪检
1151
+    }
1134 1152
     if (
1135 1153
       (that.checkedShowMsg.status == 100013 ||
1136 1154
         that.checkedShowMsg.status == 100015) &&

+ 13 - 14
src/app/views/inspect-type-config/inspect-type-config.component.html

@@ -8,7 +8,7 @@
8 8
     </div>
9 9
     <div class="groups" [ngStyle]="{display:!buildingsLoading?'block':'none'}">
10 10
       <overlay-scrollbars #osComponentRef1 [ngStyle]="{ height:'100%' }">
11
-        <div [ngClass]="{'item':true,'checked':data.id==checkedBuilding.id}" *ngFor="let data of inspectTypeList"
11
+        <div [ngClass]="{'item':true,'checked':data.id==checkedInspectType.id}" *ngFor="let data of inspectTypeList"
12 12
           (click)="checkBuilding(data)" [title]="data.name">{{data.name}}</div>
13 13
       </overlay-scrollbars>
14 14
     </div>
@@ -28,11 +28,11 @@
28 28
         <button class="btn default" *ngIf="coopBtns.add&&inspectTypeList.length" nzType="primary" nz-button
29 29
           (click)="showFloorModal($event,'add')">新增</button>
30 30
         <button class="btn default" *ngIf="coopBtns.del&&inspectTypeList.length" nzType="primary" nz-button
31
-          (click)="showDelFloorModal($event)" [disabled]="allFloorList.length===0">批量删除</button>
31
+          (click)="showDelFloorModal($event)" [disabled]="allKeyword.length===0">批量删除</button>
32 32
       </div>
33 33
     </div>
34 34
     <div class="table" *ngIf="!buildingsLoading">
35
-      <nz-table class="groupManagementTable" #rowSelectionTable [nzPageSize]="9999" [nzData]="allFloorList"
35
+      <nz-table class="groupManagementTable" #rowSelectionTable [nzPageSize]="9999" [nzData]="allKeyword"
36 36
         [nzShowPagination]="false" [nzScroll]="{ y: tableHeight+'px' }" [nzLoading]="floorsLoading">
37 37
         <thead>
38 38
           <tr class="thead">
@@ -46,7 +46,7 @@
46 46
           <tr *ngFor="let data of rowSelectionTable.data" (click)="selectedUser(data)">
47 47
             <td nzShowCheckbox [(nzDisabled)]="!coopBtns.edit" [(nzChecked)]="mapOfCheckedId[data.id]"
48 48
               (nzCheckedChange)="refreshStatus()"></td>
49
-            <td>{{ data.floorName }}</td>
49
+            <td>{{ data.keyword }}</td>
50 50
             <td>
51 51
               <button nz-button nzType="primary" nzSize="small" (click)="showFloorModal($event,'edit',data)">编辑</button>
52 52
               <button nz-button nzType="primary" nzSize="small" class="ml8"
@@ -67,10 +67,10 @@
67 67
       <div class="content">
68 68
         <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
69 69
           <nz-form-item>
70
-            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="buildingName">检查类型名称</nz-form-label>
70
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="inspectTypeName">检查类型名称</nz-form-label>
71 71
             <nz-form-control nzErrorTip="请输入检查类型名称!">
72 72
               <nz-input-group>
73
-                <input nz-input formControlName="buildingName" placeholder="请输入楼栋名称" />
73
+                <input nz-input formControlName="inspectTypeName" placeholder="请输入检查类型名称" />
74 74
               </nz-input-group>
75 75
             </nz-form-control>
76 76
           </nz-form-item>
@@ -91,19 +91,18 @@
91 91
       <div class="content">
92 92
         <form nz-form [formGroup]="validateFloorForm" class="addForm" (ngSubmit)="submitFormFloor()">
93 93
           <nz-form-item>
94
-            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="buildId">检查类型</nz-form-label>
94
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="inspectTypeName">检查类型</nz-form-label>
95 95
             <nz-form-control nzErrorTip="请选择检查类型!">
96
-              <nz-select formControlName="buildId" nzPlaceHolder="请选择检查类型" nzDisabled>
97
-                <nz-option *ngFor="let option of inspectTypeList" [nzLabel]="option.value" [nzValue]="option.id">
98
-                </nz-option>
99
-              </nz-select>
96
+              <nz-input-group>
97
+                <input nz-input disabled formControlName="inspectTypeName" placeholder="请输入检查类型名称" />
98
+              </nz-input-group>
100 99
             </nz-form-control>
101 100
           </nz-form-item>
102 101
           <nz-form-item>
103
-            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="floorName">关键字名称</nz-form-label>
102
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="keyword">关键字名称</nz-form-label>
104 103
             <nz-form-control nzErrorTip="请输入关键字名称!">
105 104
               <nz-input-group>
106
-                <input nz-input formControlName="floorName" placeholder="请输入关键字名称" />
105
+                <input nz-input formControlName="keyword" placeholder="请输入关键字名称" />
107 106
               </nz-input-group>
108 107
             </nz-form-control>
109 108
           </nz-form-item>
@@ -117,7 +116,7 @@
117 116
   </div>
118 117
   <!-- 删除检查类型模态框 -->
119 118
   <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
120
-    (confirmDelEvent)="confirmDel()" content="您确认要删除检查类型吗?" tips="删除后对应的检查类型积分配置也会删除"></app-dialog-delete>
119
+    (confirmDelEvent)="confirmDel()" content="您确认要删除检查类型吗?"></app-dialog-delete>
121 120
   <!-- 删除关键字模态框 -->
122 121
   <app-dialog-delete [delModal]="delFloorModal" (hideDelModalEvent)="hideDelFloorModal()" [btnLoading]="btnLoading"
123 122
     (confirmDelEvent)="confirmFloorDel()" content="您确认要删除关键字吗?"></app-dialog-delete>

+ 138 - 112
src/app/views/inspect-type-config/inspect-type-config.component.ts

@@ -17,9 +17,9 @@ export class InspectTypeConfigComponent implements OnInit {
17 17
   tableHeight;
18 18
   validateForm: FormGroup;
19 19
   validateFloorForm: FormGroup;
20
-  allFloorList: any[] = []; //当前选中的检查类型包含的所有关键字
20
+  allKeyword: any[] = []; //当前选中的检查类型包含的所有关键字
21 21
   mapOfCheckedId: { [key: string]: boolean } = {};
22
-  checkedBuilding: any = {}; //选中检查类型
22
+  checkedInspectType: any = {}; //选中检查类型
23 23
   inspectTypeList: Array<any> = []; //检查类型信息
24 24
   hosId: any; //当前选择的院区id
25 25
   promptContent: string; //操作提示框提示信息
@@ -67,47 +67,55 @@ export class InspectTypeConfigComponent implements OnInit {
67 67
   // 检查类型列表
68 68
   getBuildingList() {
69 69
     this.buildingsLoading = true;
70
+    let postData = {
71
+      idx: 0,
72
+      sum: 9999,
73
+      dictionary: {
74
+        key: "inspect_check_type",
75
+      },
76
+    };
70 77
     this.mainService
71
-      .getDictionary("list", "inspect_check_type")
78
+      .getFetchDataList("simple/data", "dictionary", postData)
72 79
       .subscribe((result) => {
73 80
         this.buildingsLoading = false;
74
-        this.inspectTypeList = result;
75
-        if (Object.keys(this.checkedBuilding).length) {
76
-          result.list.forEach((item) => {
77
-            if (item.id == this.checkedBuilding.id) {
78
-              this.checkBuilding(item);
81
+        if (result.status == 200) {
82
+          this.inspectTypeList = result.list;
83
+          this.inspectTypeList.forEach((item) => {
84
+            if (!item.extra2) {
85
+              item.extra2 = "";
79 86
             }
80 87
           });
81
-        } else {
82
-          this.checkBuilding(result[0]);
88
+          if (Object.keys(this.checkedInspectType).length) {
89
+            result.list.forEach((item) => {
90
+              if (item.id == this.checkedInspectType.id) {
91
+                this.checkBuilding(item);
92
+              }
93
+            });
94
+          } else {
95
+            this.checkBuilding(result.list[0]);
96
+          }
83 97
         }
84 98
       });
85 99
   }
86 100
 
87 101
   // 获取选中检查类型下关键字列表
102
+  id: number = 0;
88 103
   getAllFloor() {
89
-    // 初始化的时候搜索一次,然后前端过滤
90
-    let postData = {
91
-      idx: 0,
92
-      sum: 9999,
93
-      floor: { hosId: this.hosId, buildId: this.checkedBuilding.id },
94
-    };
95
-    this.floorsLoading = true;
96
-    this.mainService
97
-      .getFetchDataList("simple/data", "floor", postData)
98
-      .subscribe((result) => {
99
-        this.floorsLoading = false;
100
-        if (result.status == 200) {
101
-          this.allFloorList = result.list;
102
-          this.refreshStatus();
103
-        }
104
-      });
104
+    console.log(this.checkedInspectType, "baba");
105
+    if (this.checkedInspectType.extra2) {
106
+      this.allKeyword = this.checkedInspectType.extra2
107
+        .split(",")
108
+        .map((item) => ({ id: ++this.id, keyword: item }));
109
+    } else {
110
+      this.allKeyword = [];
111
+    }
112
+    this.refreshStatus();
105 113
   }
106 114
 
107 115
   // 选中检查类型
108 116
   checkBuilding(data) {
109 117
     this.positionY = this.osComponentRef1.osInstance().scroll().position.y; //内容滚动的距离
110
-    this.checkedBuilding = data ? data : {};
118
+    this.checkedInspectType = data ? data : {};
111 119
     this.mapOfCheckedId = {};
112 120
     this.getAllFloor();
113 121
   }
@@ -119,8 +127,8 @@ export class InspectTypeConfigComponent implements OnInit {
119 127
   // 选中列表中关键字
120 128
   refreshStatus(): void {
121 129
     let arr = [];
122
-    if (this.allFloorList.length) {
123
-      this.isAllDisplayDataChecked = this.allFloorList.every(
130
+    if (this.allKeyword.length) {
131
+      this.isAllDisplayDataChecked = this.allKeyword.every(
124 132
         (item) => this.mapOfCheckedId[item.id]
125 133
       );
126 134
     } else {
@@ -137,7 +145,7 @@ export class InspectTypeConfigComponent implements OnInit {
137 145
 
138 146
   // 新增/编辑检查类型模态框
139 147
   showCoopModal(type) {
140
-    if (type == "edit" && !this.checkedBuilding.id) {
148
+    if (type == "edit" && !this.checkedInspectType.id) {
141 149
       this.msg.create("warning", "请选择需要编辑的检查类型!");
142 150
       return;
143 151
     }
@@ -145,8 +153,8 @@ export class InspectTypeConfigComponent implements OnInit {
145 153
     this.add = type == "add";
146 154
     if (type == "edit") {
147 155
       this.initForm();
148
-      this.validateForm.controls.buildingName.setValue(
149
-        this.checkedBuilding.name
156
+      this.validateForm.controls.inspectTypeName.setValue(
157
+        this.checkedInspectType.name
150 158
       );
151 159
     } else {
152 160
       this.initForm();
@@ -157,11 +165,13 @@ export class InspectTypeConfigComponent implements OnInit {
157 165
   showFloorModal(e, type, data?) {
158 166
     this.floorModal = true;
159 167
     this.addFloor = type == "add";
168
+    this.floorDataEdit = data;
160 169
     if (type == "edit") {
161 170
       this.initFormFloor();
162
-      this.floorDataEdit = data;
163
-      this.validateFloorForm.controls.buildId.setValue(data.buildId);
164
-      this.validateFloorForm.controls.floorName.setValue(data.floorName);
171
+      this.validateFloorForm.controls.inspectTypeName.setValue(
172
+        this.checkedInspectType.name
173
+      );
174
+      this.validateFloorForm.controls.keyword.setValue(data.keyword);
165 175
     } else {
166 176
       this.initFormFloor();
167 177
     }
@@ -181,15 +191,15 @@ export class InspectTypeConfigComponent implements OnInit {
181 191
   // 初始化新增form表单
182 192
   initForm() {
183 193
     this.validateForm = this.fb.group({
184
-      buildingName: [null, [Validators.required]],
194
+      inspectTypeName: [null, [Validators.required]],
185 195
     });
186 196
   }
187 197
 
188 198
   // 初始化新增form表单floor
189 199
   initFormFloor() {
190 200
     this.validateFloorForm = this.fb.group({
191
-      buildId: [this.checkedBuilding.id, [Validators.required]],
192
-      floorName: [null, [Validators.required]],
201
+      inspectTypeName: [this.checkedInspectType.name, [Validators.required]],
202
+      keyword: [null, [Validators.required]],
193 203
     });
194 204
   }
195 205
 
@@ -203,7 +213,7 @@ export class InspectTypeConfigComponent implements OnInit {
203 213
     this.btnLoading = true;
204 214
     let postData;
205 215
     let arr = this.inspectTypeList.filter(
206
-      (item) => item.value == this.validateForm.value.buildingName
216
+      (item) => item.name == this.validateForm.value.inspectTypeName
207 217
     );
208 218
     //有重复名称
209 219
     if (arr.length > 0) {
@@ -211,39 +221,41 @@ export class InspectTypeConfigComponent implements OnInit {
211 221
       this.showPromptModal(
212 222
         "新增",
213 223
         false,
214
-        `存在重复的检查类型名称【${this.validateForm.value.buildingName}】请修改后再保存!`
224
+        `存在重复的检查类型名称【${this.validateForm.value.inspectTypeName}】请修改后再保存!`
215 225
       );
216 226
       return;
217 227
     }
218 228
     if (this.add) {
229
+      let n = 0;
230
+      if (this.inspectTypeList.length > 0) {
231
+        let sortArr = this.inspectTypeList.map((item) => Number(item.value));
232
+        n = Math.max.apply(null, sortArr);
233
+      } else {
234
+        n = 0;
235
+      }
219 236
       postData = {
220
-        buildingName: this.validateForm.value.buildingName,
221
-        deleted: false,
222
-        hosId: this.hosId,
237
+        key: "inspect_check_type",
238
+        name: this.validateForm.value.inspectTypeName,
239
+        value: n + 1,
240
+        orders: n + 1,
241
+        desc: "检查类型",
223 242
       };
224 243
     } else {
225 244
       postData = {
226
-        buildingName: this.validateForm.value.buildingName,
227
-        deleted: false,
228
-        hosId: this.hosId,
229
-        id: this.checkedBuilding.id,
245
+        extra2: this.checkedInspectType.extra2,
246
+        name: this.validateForm.value.inspectTypeName,
247
+        id: this.checkedInspectType.id,
230 248
       };
231 249
     }
232
-    this.mainService
233
-      .simplePost("addData", "building", postData)
234
-      .subscribe((result) => {
235
-        this.hideCoopModal();
236
-        this.btnLoading = false;
237
-        if (result["status"] == 200) {
238
-          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
239
-        } else {
240
-          this.showPromptModal(
241
-            this.add ? "新增" : "编辑",
242
-            false,
243
-            result["msg"]
244
-          );
245
-        }
246
-      });
250
+    this.mainService.upDictionary(postData).subscribe((result) => {
251
+      this.hideCoopModal();
252
+      this.btnLoading = false;
253
+      if (result["status"] == 200) {
254
+        this.showPromptModal(this.add ? "新增" : "编辑", true, "");
255
+      } else {
256
+        this.showPromptModal(this.add ? "新增" : "编辑", false, result["msg"]);
257
+      }
258
+    });
247 259
   }
248 260
 
249 261
   // 新增/编辑关键字提交
@@ -254,9 +266,8 @@ export class InspectTypeConfigComponent implements OnInit {
254 266
     }
255 267
     if (this.validateFloorForm.invalid) return;
256 268
     this.btnLoading = true;
257
-    let postData;
258
-    let arr = this.allFloorList.filter(
259
-      (item) => item.floorName == this.validateFloorForm.value.floorName
269
+    let arr = this.allKeyword.filter(
270
+      (item) => item.keyword == this.validateFloorForm.value.keyword
260 271
     );
261 272
     //有重复名称
262 273
     if (arr.length > 0) {
@@ -264,52 +275,50 @@ export class InspectTypeConfigComponent implements OnInit {
264 275
       this.showPromptModal(
265 276
         "新增",
266 277
         false,
267
-        `同一个检查类型存在重复的关键字名称【${this.validateFloorForm.value.floorName}】请修改后再保存!`
278
+        `同一个检查类型存在重复的关键字名称【${this.validateFloorForm.value.keyword}】请修改后再保存!`
268 279
       );
269 280
       return;
270 281
     }
271 282
     if (this.addFloor) {
272
-      postData = {
273
-        buildId: this.validateFloorForm.value.buildId,
274
-        floorName: this.validateFloorForm.value.floorName,
275
-        deleted: false,
276
-        hosId: this.hosId,
277
-      };
283
+      this.allKeyword.push({
284
+        keyword: this.validateFloorForm.value.keyword,
285
+        id: ++this.id,
286
+      });
278 287
     } else {
279
-      postData = {
280
-        buildId: this.validateFloorForm.value.buildId,
281
-        floorName: this.validateFloorForm.value.floorName,
282
-        deleted: false,
283
-        hosId: this.hosId,
284
-        id: this.floorDataEdit.id,
285
-      };
288
+      this.allKeyword.forEach((item) => {
289
+        if (item.id === this.floorDataEdit.id) {
290
+          item.keyword = this.validateFloorForm.value.keyword;
291
+        }
292
+      });
286 293
     }
287
-    this.addFloorHandler(postData, false);
294
+    this.addFloorHandler();
288 295
   }
289 296
 
290
-  //新增关键字
291
-  addFloorHandler(postData, flag) {
292
-    this.mainService
293
-      .simplePost(flag ? "addListData" : "addData", "floor", postData)
294
-      .subscribe((result) => {
295
-        this.hideFloorModal();
296
-        this.generate1 && (this.generate1.delModal = false);
297
-        this.btnLoading = false;
298
-        if (result["status"] == 200) {
299
-          this.showPromptModal(this.addFloor ? "新增" : "编辑", true, "");
300
-        } else {
301
-          this.showPromptModal(
302
-            this.addFloor ? "新增" : "编辑",
303
-            false,
304
-            result["msg"]
305
-          );
306
-        }
307
-      });
297
+  //新增关键字baba
298
+  addFloorHandler() {
299
+    let postData = {
300
+      id: this.checkedInspectType.id,
301
+      extra2: this.allKeyword.map((item) => item.keyword).toString(),
302
+    };
303
+    this.mainService.upDictionary(postData).subscribe((result) => {
304
+      this.hideFloorModal();
305
+      this.generate1 && (this.generate1.delModal = false);
306
+      this.btnLoading = false;
307
+      if (result["status"] == 200) {
308
+        this.showPromptModal(this.addFloor ? "新增" : "编辑", true, "");
309
+      } else {
310
+        this.showPromptModal(
311
+          this.addFloor ? "新增" : "编辑",
312
+          false,
313
+          result["msg"]
314
+        );
315
+      }
316
+    });
308 317
   }
309 318
 
310 319
   //删除检查类型
311 320
   showDelModal() {
312
-    if (!this.checkedBuilding.id) {
321
+    if (!this.checkedInspectType.id) {
313 322
       this.msg.create("warning", "请选择需要删除的检查类型!");
314 323
       return;
315 324
     }
@@ -318,18 +327,21 @@ export class InspectTypeConfigComponent implements OnInit {
318 327
   hideDelModal() {
319 328
     this.delModal = false;
320 329
   }
321
-  // 确认删除
330
+  // 确认删除baba
322 331
   confirmDel() {
323 332
     this.btnLoading = true;
324
-    let postData = [this.checkedBuilding["id"]];
325
-    this.mainService.delBuildingList(postData).subscribe((result) => {
333
+    let postData = {
334
+      deleted: true,
335
+      id: this.checkedInspectType.id,
336
+    };
337
+    this.mainService.upDictionary(postData).subscribe((result) => {
326 338
       this.hideDelModal();
327 339
       this.btnLoading = false;
328
-      if (result["status"] == 200 && !result["data"][0].msg) {
340
+      if (result["status"] == 200) {
329 341
         this.showPromptModal("删除", true, "");
330
-        this.checkedBuilding = {};
342
+        this.checkedInspectType = {};
331 343
       } else {
332
-        this.showPromptModal("删除", false, result["data"][0].msg);
344
+        this.showPromptModal("删除", false, "");
333 345
       }
334 346
     });
335 347
   }
@@ -351,25 +363,39 @@ export class InspectTypeConfigComponent implements OnInit {
351 363
   hideDelFloorModal() {
352 364
     this.delFloorModal = false;
353 365
   }
354
-  // 确认删除
366
+  // 确认删除baba
355 367
   confirmFloorDel() {
368
+    let allKeyword = JSON.parse(JSON.stringify(this.allKeyword));
356 369
     this.btnLoading = true;
357 370
     let selectedFloor = this.selectedFloor.map((item) => item.id);
358
-    let postData = this.isDelSingle ? [this.floorDataEdit.id] : selectedFloor;
359
-    this.mainService.delFloorList(postData).subscribe((result) => {
371
+    if (this.isDelSingle) {
372
+      allKeyword = allKeyword.filter(
373
+        (item) => item.id != this.floorDataEdit.id
374
+      );
375
+    } else {
376
+      allKeyword = allKeyword.filter(
377
+        (item) => !selectedFloor.includes(item.id + "")
378
+      );
379
+    }
380
+    let postData = {
381
+      id: this.checkedInspectType.id,
382
+      extra2: allKeyword.map((v) => v.keyword).toString(),
383
+    };
384
+    this.mainService.upDictionary(postData).subscribe((result) => {
360 385
       this.hideDelFloorModal();
361 386
       this.btnLoading = false;
362
-      if (result["status"] == 200 && !result["data"][0].msg) {
387
+      if (result["status"] == 200) {
388
+        this.allKeyword = allKeyword;
363 389
         this.showPromptModal("删除", true, "");
364 390
       } else {
365
-        this.showPromptModal("删除", false, result["data"][0].msg);
391
+        this.showPromptModal("删除", false, "");
366 392
       }
367 393
     });
368 394
   }
369 395
   // 全选
370 396
   checkAll(value: boolean): void {
371
-    console.log(this.allFloorList);
372
-    this.allFloorList.forEach((item) => {
397
+    console.log(this.allKeyword);
398
+    this.allKeyword.forEach((item) => {
373 399
       this.mapOfCheckedId[item.id] = value;
374 400
     });
375 401
     this.refreshStatus();