seimin 1 год назад
Родитель
Сommit
211ceb3829

+ 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.240",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 11 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config-routing.module.ts

@@ -0,0 +1,11 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { CheckAndExcludeConfigComponent } from './check-and-exclude-config.component';
4
+
5
+const routes: Routes = [{ path: "", component: CheckAndExcludeConfigComponent }];
6
+
7
+@NgModule({
8
+  imports: [RouterModule.forChild(routes)],
9
+  exports: [RouterModule]
10
+})
11
+export class CheckAndExcludeConfigRoutingModule { }

+ 96 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config.component.html

@@ -0,0 +1,96 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='12' class="list-template__searchBox">
5
+      </div>
6
+      <div nz-col nzXl="12" class="list-template__btns">
7
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
8
+      </div>
9
+    </div>
10
+    <div class="list-template__bottom">
11
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
12
+        [nzLoading]="loading">
13
+        <thead>
14
+          <tr class="thead">
15
+            <th nzWidth="7%">序号</th>
16
+            <th nzWidth="31%">文字描述</th>
17
+            <th nzWidth="31%">匹配方式</th>
18
+            <th nzWidth="31%">操作</th>
19
+          </tr>
20
+        </thead>
21
+        <tbody>
22
+          <tr *ngFor="let data of listOfData;let i = index">
23
+            <td>{{ i+1 }}</td>
24
+            <td>{{ data.key1 }}</td>
25
+            <td>
26
+              <ng-container *ngIf="data.matchType == 1">
27
+                模糊匹配
28
+              </ng-container>
29
+              <ng-container *ngIf="data.matchType == 2">
30
+                完全匹配
31
+              </ng-container>
32
+            </td>
33
+            <td>
34
+              <div class="coop">
35
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">修改</span>
36
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data.id, '您确认要删除吗?')">删除</span>
37
+              </div>
38
+            </td>
39
+          </tr>
40
+        </tbody>
41
+      </nz-table>
42
+      <div class="list-template__pagination">
43
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
44
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
45
+        </nz-pagination>
46
+      </div>
47
+    </div>
48
+  </div>
49
+
50
+  <!-- 新增/编辑模态框 -->
51
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
52
+    <div class="modalBody">
53
+      <div class="title">{{add?"新增":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
54
+      </div>
55
+      <div class="content">
56
+        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
57
+          <nz-form-item>
58
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="key1">检查文字描述</nz-form-label>
59
+            <nz-form-control nzErrorTip="请输入检查文字描述!">
60
+              <nz-input-group>
61
+                <input nz-input formControlName="key1" placeholder="请输入检查文字描述" />
62
+              </nz-input-group>
63
+            </nz-form-control>
64
+          </nz-form-item>
65
+          <nz-form-item>
66
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="matchType">匹配方式</nz-form-label>
67
+            <nz-form-control nzErrorTip="请选择匹配方式!">
68
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="matchType" nzShowSearch nzAllowClear
69
+                nzPlaceHolder="请选择匹配方式" nzServerSearch (nzOpenChange)="changeFormEnd($event)">
70
+                <ng-container *ngFor="let data of matchTypes">
71
+                  <nz-option *ngIf="!isLoading" nzLabel="{{data.name}}" nzValue="{{data.id}}">
72
+                  </nz-option>
73
+                </ng-container>
74
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
75
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
76
+                </nz-option>
77
+              </nz-select>
78
+            </nz-form-control>
79
+          </nz-form-item>
80
+        </form>
81
+      </div>
82
+      <div class=" display_flex justify-content_flex-center">
83
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
84
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
85
+      </div>
86
+    </div>
87
+  </div>
88
+
89
+  <!-- 删除模态框 -->
90
+  <app-dialog-delete [delModal]="dialogDelete.delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="dialogDelete.btnLoading"
91
+    (confirmDelEvent)="confirmDel()" [content]="dialogDelete.content"></app-dialog-delete>
92
+</div>
93
+<!-- 操作成功/失败提示框 -->
94
+<app-prompt-modal [content]="promptModal.content" [success]="promptModal.success" [show]="promptModal.show"
95
+  [info]="promptInfo">
96
+</app-prompt-modal>

+ 176 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config.component.less

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

+ 194 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config.component.ts

@@ -0,0 +1,194 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { ToolService } from "../../services/tool.service";
6
+import { CheckAndExcludeConfigService } from './check-and-exclude-config.service';
7
+@Component({
8
+  selector: "app-check-and-exclude-config",
9
+  templateUrl: "./check-and-exclude-config.component.html",
10
+  styleUrls: ["./check-and-exclude-config.component.less"],
11
+})
12
+export class CheckAndExcludeConfigComponent implements OnInit {
13
+  constructor(
14
+    private fb: FormBuilder,
15
+    private checkAndExcludeConfigService: CheckAndExcludeConfigService,
16
+    private route: ActivatedRoute,
17
+    private tool: ToolService
18
+  ) {}
19
+
20
+  hosId: any; //当前选中院区
21
+  listOfData: any[] = []; //表格数据
22
+  pageIndex: number = 1; //表格当前页码
23
+  pageSize: number = 10; //表格每页展示条数
24
+  listLength: number = 0; //表格总数据量
25
+  modal: boolean = false; //新增/编辑模态框
26
+  add: boolean; //true:新增;false:编辑
27
+  validateForm: FormGroup; //新增/编辑表单
28
+  coopId: number; //当前操作列id
29
+
30
+  btnLoading: boolean = false; //提交按钮loading状态
31
+
32
+  promptModal:any = {
33
+    content : '', //操作提示框提示信息
34
+    success : false, //操作成功/失败
35
+    show : '', //操作结果提示信息
36
+  }
37
+  //匹配方式
38
+  matchTypes: any[] = [
39
+    {id: 1, name: '模糊匹配'},
40
+    {id: 2, name: '完全匹配'},
41
+  ];
42
+
43
+  ngOnInit() {
44
+    this.coopBtns = this.tool.initCoopBtns(this.route);
45
+    this.hosId = this.tool.getCurrentHospital().id;
46
+    this.getList(true);
47
+  }
48
+
49
+  // 初始化增删改按钮
50
+  coopBtns: any = {};
51
+
52
+  // 表格数据
53
+  loading = false;
54
+  getList(isInit = false) {
55
+    isInit && (this.pageIndex = 1);
56
+    let postData = {
57
+      idx: this.pageIndex - 1,
58
+      sum: this.pageSize,
59
+      dataFieldRule: {
60
+        hosId: this.hosId,
61
+      },
62
+    };
63
+    this.loading = true;
64
+    this.checkAndExcludeConfigService
65
+      .query(postData)
66
+      .subscribe((result: any) => {
67
+        this.loading = false;
68
+        if (result.status == 200) {
69
+          this.listOfData = result.list;
70
+          this.listLength = result.totalNum;
71
+        }
72
+      });
73
+  }
74
+
75
+  // 新增/编辑弹框
76
+  addModal() {
77
+    this.add = true; //新增
78
+    this.modal = true;
79
+    this.initForm();
80
+  }
81
+  //关闭新增/编辑弹框
82
+  hideAddModal() {
83
+    this.modal = false;
84
+    this.initForm();
85
+  }
86
+  // 初始化新增form表单
87
+  initForm() {
88
+    this.validateForm = this.fb.group({
89
+      key1: [null, [Validators.required]],
90
+      matchType: [null, [Validators.required]],
91
+    });
92
+  }
93
+
94
+  // 新增/编辑表单提交
95
+  submitForm(): void {
96
+    this.btnLoading = true;
97
+    for (const i in this.validateForm.controls) {
98
+      this.validateForm.controls[i].markAsDirty();
99
+      this.validateForm.controls[i].updateValueAndValidity();
100
+    }
101
+    if (this.validateForm.invalid) {
102
+      this.btnLoading = false;
103
+      return;
104
+    }
105
+    let postData = {};
106
+
107
+    if (this.add) {
108
+      //新增
109
+      postData = {
110
+        hosId: this.hosId,
111
+        key1: this.validateForm.controls.key1.value,
112
+        matchType: this.validateForm.controls.matchType.value,
113
+      };
114
+    } else {
115
+      //编辑
116
+      postData = {
117
+        id: this.coopId,
118
+        hosId: this.hosId,
119
+        key1: this.validateForm.controls.key1.value,
120
+        matchType: this.validateForm.controls.matchType.value,
121
+      };
122
+    }
123
+    this.checkAndExcludeConfigService
124
+      .add(postData)
125
+      .subscribe((result: any) => {
126
+        this.btnLoading = false;
127
+        this.hideAddModal();
128
+        if (result.status == 200) {
129
+          this.showPromptModal(this.add ? "新增" : "修改", true);
130
+        } else {
131
+          this.showPromptModal(this.add ? "新增" : "修改", false);
132
+        }
133
+      });
134
+  }
135
+
136
+  // 编辑
137
+  edit(data) {
138
+    this.coopId = data.id;
139
+
140
+    this.add = false;
141
+    this.modal = true;
142
+    this.initForm();
143
+
144
+    this.validateForm.controls.key1.setValue(data.key1);
145
+    this.validateForm.controls.matchType.setValue(data.matchType.toString());
146
+  }
147
+
148
+  // 展示信息提示框(content:提示信息,success:操作是否成功,show:操作结果提示信息)
149
+  showPromptModal(content, success, show = '') {
150
+    this.promptModal = {
151
+      content,
152
+      success,
153
+      show,
154
+    }
155
+
156
+    this.getList();
157
+  }
158
+
159
+  // 删除快捷建单
160
+  dialogDelete:any = {
161
+    delModal: false, //删除模态框
162
+    content: '', //提示框信息
163
+  }
164
+  showDelModal(id: number, content: string) {
165
+    this.coopId = id;
166
+
167
+    this.dialogDelete = {
168
+      delModal: true,
169
+      content,
170
+    }
171
+  }
172
+  // 隐藏删除框
173
+  hideDelModal() {
174
+    this.dialogDelete.delModal = false;
175
+  }
176
+  // 确认删除
177
+  confirmDel() {
178
+    this.dialogDelete.btnLoading = true;
179
+    //删除
180
+    let postData = [this.coopId];
181
+    this.checkAndExcludeConfigService
182
+      .delete(postData)
183
+      .subscribe((data: any) => {
184
+        this.dialogDelete.btnLoading = false;
185
+        this.dialogDelete.delModal = false;
186
+        if (data.status == 200) {
187
+          this.showPromptModal('删除', true);
188
+        } else {
189
+          this.showPromptModal('删除', false, data.msg);
190
+        }
191
+      });
192
+  }
193
+}
194
+

+ 17 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config.module.ts

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

+ 26 - 0
src/app/views/check-and-exclude-config/check-and-exclude-config.service.ts

@@ -0,0 +1,26 @@
1
+import { Injectable } from '@angular/core';
2
+import { MainService } from 'src/app/services/main.service';
3
+
4
+@Injectable({
5
+  providedIn: 'root'
6
+})
7
+export class CheckAndExcludeConfigService {
8
+  constructor(
9
+    private mainService: MainService,
10
+  ) { }
11
+
12
+  // 列表-查
13
+  query(postData) {
14
+    return this.mainService.getFetchDataList("simple/data", "dataFieldRule", postData);
15
+  }
16
+
17
+  // 列表-删
18
+  delete(postData) {
19
+    return this.mainService.simplePost("rmvData", "dataFieldRule", postData);
20
+  }
21
+
22
+  // 列表-增
23
+  add(postData) {
24
+    return this.mainService.simplePost("addData", "dataFieldRule", postData);
25
+  }
26
+}

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

@@ -278,6 +278,11 @@ const routes: Routes = [
278 278
         path: "checkDeptException",
279 279
         loadChildren: () => import("../check-dept-exception/check-dept-exception.module").then((m) => m.CheckDeptExceptionModule),
280 280
       },
281
+      // 检查排除
282
+      {
283
+        path: "checkAndExcludeConfig",
284
+        loadChildren: () => import("../check-and-exclude-config/check-and-exclude-config.module").then((m) => m.CheckAndExcludeConfigModule),
285
+      },
281 286
       // 工单消息设置
282 287
       {
283 288
         path: "workorderMessage",