seimin hace 2 años
padre
commit
16d843b134

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-    "target": "http://192.168.3.108",
3
+    "target": "http://192.168.4.190",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

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

@@ -654,4 +654,12 @@ export class MainService {
654 654
       }
655 655
     );
656 656
   }
657
+  //陪检配置保存接口
658
+  saveInspections(data) {
659
+    return this.http.post(
660
+      host.host + "/simple/data/addListData/workOrderInspectScore",
661
+      data,
662
+      { headers: this.headers }
663
+    );
664
+  }
657 665
 }

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

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

+ 43 - 0
src/app/views/inspection-distance/inspection-distance.component.html

@@ -0,0 +1,43 @@
1
+<div class="buildingDistance">
2
+  <div class="content" *ngIf="!loading2;else loadingBlock">
3
+    <div class="top display_flex align-items_center justify-content_space-between" nz-row>
4
+      <div nz-col nzLg='22' class="searchBox"></div>
5
+      <div nz-col nzLg="2" class="btns">
6
+        <button *ngIf="coopBtns.add" class="btn fr default" (click)="addBuilding()">新增</button>
7
+      </div>
8
+    </div>
9
+    <div class="bottom">
10
+      <div class="table">
11
+        <div class="box">
12
+          <div nz-row class="b_header">
13
+            <div nz-col nzSpan="22">陪检方式</div>
14
+            <div nz-col nzSpan="2">增加分数</div>
15
+          </div>
16
+          <div nz-row class="b_list" *ngFor="let building of buildings;trackBy:trackById">
17
+            <div nz-col nzSpan="22" nz-row class="b_list_content">
18
+              <input nz-input nz-col nzSpan="22" [disabled]="!coopBtns.edit" placeholder="请填写陪检方式" [(ngModel)]="building.inspectMode" [class.active]="building.border==='red'?'red':''" />
19
+            </div>
20
+            <div nz-col nzSpan="2" class="b_percent">
21
+              <nz-input-number [nzDisabled]="!coopBtns.edit" [(ngModel)]="building.increaseScore" [nzMin]="0" [nzStep]="1"></nz-input-number>
22
+              <i class="icon_transport transport-lajitong" (click)="delete(building)" *ngIf="coopBtns.del"></i>
23
+            </div>
24
+          </div>
25
+          <div class="b_save"><button nz-button nzType="primary" (click)="save()" *ngIf="buildings.length"
26
+              [nzLoading]="loading3">保存</button>
27
+          </div>
28
+        </div>
29
+      </div>
30
+    </div>
31
+  </div>
32
+  <ng-template #loadingBlock>
33
+    <div class="content loading display_flex justify-content_flex-center align-items_center">
34
+      <div class="txtC">
35
+        <img src="../../../assets/images/loading.gif" alt="">
36
+        <div>加载中...</div>
37
+      </div>
38
+    </div>
39
+  </ng-template>
40
+  <!-- 删除模态框 -->
41
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="loading4"
42
+    (confirmDelEvent)="confirmDel()" content="是否确认删除此配置?"></app-dialog-delete>
43
+</div>

+ 275 - 0
src/app/views/inspection-distance/inspection-distance.component.less

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

+ 130 - 0
src/app/views/inspection-distance/inspection-distance.component.ts

@@ -0,0 +1,130 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { NzMessageService } from "ng-zorro-antd";
4
+import { MainService } from "src/app/services/main.service";
5
+import { ToolService } from "src/app/services/tool.service";
6
+
7
+@Component({
8
+  selector: "app-inspection-distance",
9
+  templateUrl: "./inspection-distance.component.html",
10
+  styleUrls: ["./inspection-distance.component.less"],
11
+})
12
+export class InspectionDistanceComponent implements OnInit {
13
+  coopBtns: any = {};
14
+  id: number = 0; //id
15
+  hosId; //当前院区id
16
+  buildings = []; //所有楼栋距离组合
17
+  loading2: boolean = false; //获取所有楼栋配置的loading
18
+  loading3: boolean = false; //保存所有楼栋配置的loading
19
+  loading4: boolean = false; //删除楼栋配置的loading
20
+  delModal: boolean = false; //删除的模态框
21
+  delObj; //要删除的元素
22
+  constructor(
23
+    private route: ActivatedRoute,
24
+    private mainService: MainService,
25
+    private tool: ToolService,
26
+    private message: NzMessageService
27
+  ) {}
28
+  ngOnInit() {
29
+    this.hosId = this.tool.getCurrentHospital().id;
30
+    this.coopBtns = this.tool.initCoopBtns(this.route);
31
+    this.getBuildingConfig(this.hosId);
32
+  }
33
+
34
+  //获取楼栋距离配置
35
+  getBuildingConfig(hosId) {
36
+    let postData = { idx: 0, sum: 9999, workOrderInspectScore: { hosId } };
37
+    this.loading2 = true;
38
+    this.mainService
39
+      .getFetchDataList("simple/data", "workOrderInspectScore", postData)
40
+      .subscribe((result) => {
41
+        this.loading2 = false;
42
+        if (result.status == 200) {
43
+          this.buildings = result.list.map((item) => {
44
+            return {
45
+              id: item.id,
46
+              inspectMode: item.inspectMode,
47
+              increaseScore: item.increaseScore,
48
+              border: "none",
49
+            };
50
+          });
51
+        } else {
52
+          this.message.error("请求数据失败");
53
+        }
54
+      });
55
+  }
56
+  //新增
57
+  addBuilding() {
58
+    this.buildings.push({
59
+      id: --this.id,
60
+      inspectMode: '',
61
+      buildingStart: null,
62
+      buildingEnd: null,
63
+      increaseScore: 0,
64
+      border: "none",
65
+    });
66
+  }
67
+  // 删除
68
+  delete(obj) {
69
+    this.delModal = true;
70
+    this.delObj = obj;
71
+  }
72
+  //隐藏删除模态框
73
+  hideDelModal() {
74
+    this.delModal = false;
75
+  }
76
+  // 确定删除
77
+  confirmDel() {
78
+    this.loading4 = true;
79
+    this.mainService.delBuildings([this.delObj.id]).subscribe((result) => {
80
+      this.loading4 = false;
81
+      if (result["status"] == 200) {
82
+        this.message.success("删除成功");
83
+        this.buildings = this.buildings.filter(
84
+          (item) => item.id !== this.delObj.id
85
+        );
86
+      } else {
87
+        this.message.error("删除失败");
88
+      }
89
+      this.hideDelModal();
90
+    });
91
+  }
92
+  //保存
93
+  save() {
94
+    this.buildings = this.buildings.filter(
95
+      (item) => item.inspectMode && (item.increaseScore || item.increaseScore === 0)
96
+    );
97
+    let postData = this.buildings.map((item) => {
98
+      return {
99
+        id: item.id,
100
+        inspectMode: item.inspectMode,
101
+        increaseScore: item.increaseScore,
102
+        hosId: this.hosId,
103
+      };
104
+    });
105
+    postData.forEach((item) => {
106
+      if (item.id < 0) {
107
+        delete item.id;
108
+      }
109
+    });
110
+    this.loading3 = true;
111
+    this.mainService.saveInspections(postData).subscribe((result) => {
112
+      this.loading3 = false;
113
+      if (result["status"] == 200) {
114
+        this.message.success("保存成功");
115
+        this.getBuildingConfig(this.hosId);
116
+      } else {
117
+        this.message.error("保存失败");
118
+        result["data"].forEach((item) => {
119
+          let i = this.buildings.findIndex((v) => v.id === item.id);
120
+          this.buildings[i].border = "red";
121
+        });
122
+      }
123
+    });
124
+  }
125
+  //trackBy
126
+  trackById(index, item) {
127
+    return item.id;
128
+  }
129
+}
130
+

+ 17 - 0
src/app/views/inspection-distance/inspection-distance.module.ts

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

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

@@ -310,7 +310,7 @@ const routes: Routes = [
310 310
           ),
311 311
       },
312 312
       {
313
-        // 楼栋距离绩效配置
313
+        // 楼栋绩效
314 314
         path: "buildingDistance",
315 315
         loadChildren: () =>
316 316
           import("../building-distance/building-distance.module").then(
@@ -318,6 +318,14 @@ const routes: Routes = [
318 318
           ),
319 319
       },
320 320
       {
321
+        // 陪检绩效
322
+        path: "inspectionDistance",
323
+        loadChildren: () =>
324
+          import("../inspection-distance/inspection-distance.module").then(
325
+            (m) => m.InspectionDistanceModule
326
+          ),
327
+      },
328
+      {
321 329
         // 检查类型配置
322 330
         path: "inspectTypeConfig",
323 331
         loadChildren: () =>