瀏覽代碼

工时管理开发

maotao 9 月之前
父節點
當前提交
52ec0b67eb

+ 152 - 0
src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.html

@@ -0,0 +1,152 @@
1
+<div class="content priority">
2
+  <div class="contentInner">
3
+    <div class="list-template" id="priorityTable">
4
+      <div class="list-template__content">
5
+        <div class="list-template__bottom">
6
+         <div class="list-template__top" nz-row>
7
+            <div nz-col nzLg="24" class="list-template__btns">
8
+              <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
9
+            </div>
10
+          </div>
11
+          <nz-table class="list-template__nzTable" [nzData]="priorityList" nzSize="middle" [nzShowPagination]="false"
12
+            [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
13
+            <thead>
14
+              <tr class="thead">
15
+                <th nzWidth="35%">科室名称</th>
16
+                <th nzWidth="35%">故障现象</th>
17
+                <th nzWidth="10%">处理组</th>
18
+                <th nzWidth="10%">处理人</th>
19
+                <th nzWidth="10%">操作</th>
20
+              </tr>
21
+            </thead>
22
+            <tbody>
23
+              <tr *ngFor="let data of priorityList;let i = index">
24
+                <td>{{data.dept}}</td>
25
+                <td>{{data.category}}</td>
26
+                <td>{{data.handleGroupDTO?data.handleGroupDTO.groupName:''}}</td>
27
+                <td>{{data.handleUserDTO?data.handleUserDTO.name:''}}</td>
28
+                <td>
29
+                  <div class="coop">
30
+                    <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
31
+                    <span (click)="editPriority(data)">编辑</span>
32
+                  </div>
33
+                </td>
34
+              </tr>
35
+            </tbody>
36
+          </nz-table>
37
+					<div class="list-template__pagination">
38
+					  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
39
+					    (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
40
+					  </nz-pagination>
41
+					</div>
42
+        </div>
43
+      </div>
44
+    </div>
45
+  </div>
46
+</div>
47
+
48
+<!-- 操作成功/失败提示框 -->
49
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
50
+  [info]="promptInfo">
51
+</app-prompt-modal>
52
+
53
+<!-- 删除模态框 -->
54
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
55
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
56
+
57
+<!-- 新增/编辑模态框 -->
58
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
59
+  <div class="modalBody">
60
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
61
+    <div class="content">
62
+      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
63
+				<nz-form-item>
64
+				 <nz-form-label nzRequired nzFor="department" [nzSpan]="6">科室</nz-form-label>
65
+				 <nz-form-control nzErrorTip="请选择科室!" [nzSpan]="18">
66
+				   <nz-input-group>
67
+				 		<nz-select class="formItem" nzMode="multiple" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event)" nzServerSearch nzShowSearch nzPlaceHolder="请选择申请科室" formControlName="department">
68
+				 		  <ng-container *ngFor="let option of hospitals">
69
+				 		    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
70
+				 		  </ng-container>
71
+				 		  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
72
+				 		    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
73
+				 		  </nz-option>
74
+				 		</nz-select>
75
+				 	</nz-input-group>
76
+				 </nz-form-control>
77
+				</nz-form-item>
78
+				
79
+        <nz-form-item>
80
+          <nz-form-label nzFor="malfunction" [nzSpan]="6">故障现象</nz-form-label>
81
+          <nz-form-control [nzSpan]="18">
82
+          	<!-- <nz-cascader [nzOptions]="malfunctionData" nzMode="multiple"
83
+          		formControlName="malfunction" 
84
+          		nzPlaceHolder="请选择故障现象">
85
+          	</nz-cascader> -->
86
+						<!-- <nz-tree-select
87
+							nzPlaceHolder="请选择故障现象"
88
+							formControlName="malfunction" 
89
+							[nzNodes]="malfunctionData"
90
+							[nzMultiple]="true"
91
+						>
92
+						</nz-tree-select> -->
93
+						<nz-select class="formItem" nzMode="multiple" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择故障现象" formControlName="malfunction" >
94
+						  <ng-container *ngFor="let option of malfunctionData">
95
+						    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
96
+						  </ng-container>
97
+						  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
98
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
99
+						  </nz-option>
100
+						</nz-select>
101
+          </nz-form-control>
102
+        </nz-form-item>
103
+
104
+        <nz-form-item>
105
+           <nz-form-label nzRequired nzFor="handleGroup" [nzSpan]="6">处理组</nz-form-label>
106
+           <nz-form-control nzErrorTip="请选择处理组!" [nzSpan]="18">
107
+             <nz-input-group>
108
+           		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理组" formControlName="handleGroup">
109
+           		  <ng-container *ngFor="let option of allUserGroup">
110
+           		    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
111
+           		  </ng-container>
112
+           		  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
113
+           		    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
114
+           		  </nz-option>
115
+           		</nz-select>
116
+           	</nz-input-group>
117
+           </nz-form-control>
118
+        </nz-form-item>
119
+				
120
+				<nz-form-item>
121
+					<nz-form-label nzRequired nzFor="binding" [nzSpan]="7">是否绑定人员</nz-form-label>
122
+					<nz-form-control nzErrorTip="请选择!" [nzSpan]="17">
123
+						<nz-radio-group formControlName="binding" (ngModelChange)="changeRadio($event)">
124
+						  <label nz-radio nzValue="1">是</label>
125
+						  <label nz-radio nzValue="0">否</label>
126
+						</nz-radio-group>
127
+					</nz-form-control>
128
+				</nz-form-item>
129
+				
130
+        <nz-form-item *ngIf="validatePriorityForm.value.binding==1">
131
+          <nz-form-label nzRequired nzFor="handleUser" [nzSpan]="6">处理人</nz-form-label>
132
+          <nz-form-control nzErrorTip="请选择处理人!" [nzSpan]="18">
133
+            <nz-input-group>
134
+          		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp3($event)" nzServerSearch nzShowSearch nzPlaceHolder="请选择处理人" formControlName="handleUser">
135
+          		  <ng-container *ngFor="let option of userData">
136
+          		    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
137
+          		  </ng-container>
138
+          		  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
139
+          		    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
140
+          		  </nz-option>
141
+          		</nz-select>
142
+          	</nz-input-group>
143
+          </nz-form-control>
144
+        </nz-form-item>
145
+      </form>
146
+    </div>
147
+    <div class=" display_flex justify-content_flex-center">
148
+      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
149
+      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
150
+    </div>
151
+  </div>
152
+</div>

+ 290 - 0
src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.less

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

+ 382 - 0
src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.ts

@@ -0,0 +1,382 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { NzMessageService } from 'ng-zorro-antd';
9
+
10
+@Component({
11
+  selector: "app-configuration-deptUser",
12
+  templateUrl: "./configuration-deptUser.component.html",
13
+  styleUrls: ["./configuration-deptUser.component.less"],
14
+})
15
+export class ConfigurationDeptUserComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+
24
+  coopData: any = {}; //当前操作列
25
+	pageIndex: number = 1; //页码
26
+	listLength: number = 10; //总条数
27
+	pageSize: number = 10; //每页条数
28
+	hosId:any;
29
+	hospitals:any = [];
30
+	isDeptLoading: boolean = false;
31
+	searchParentDeptSubject = new Subject();
32
+	searchParentUserSubject = new Subject();
33
+	currentHospital:any;
34
+	malfunctionData:any = [];
35
+	allUserGroup:any = [];
36
+	userData:any = [];
37
+	
38
+  formatterMinute = (value: number) => `${value} 分钟`;
39
+  parserMinute = (value: string) => value.replace(' 分钟', '');
40
+
41
+  ngOnInit() {
42
+		this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
43
+			this.isDeptLoading = true;
44
+			this.getDeparts(e);
45
+		});
46
+		this.searchParentUserSubject.pipe(debounceTime(500)).subscribe((e) => {
47
+			this.isDeptLoading = true;
48
+			this.getUser(e);
49
+		});
50
+		
51
+    // 优先级
52
+    setTimeout(() => {
53
+      this.tablePriorityHeight = document.querySelector('#priorityTable').clientHeight - document.querySelector('#priorityTable .list-template__top').clientHeight - 8 - document.querySelector('#priorityTable .thead').clientHeight;
54
+    }, 100)
55
+		this.hosId = this.tool.getCurrentHospital().id;
56
+		this.currentHospital = this.tool.getCurrentHospital();
57
+    this.getPriorityList();
58
+		this.getMalfunction()
59
+		this.getDeparts('')
60
+		this.getUser('');
61
+		this.getGrop()
62
+  }
63
+
64
+  // 新增优先级弹框
65
+  modelName = ""; //模态框名称
66
+  modalPriority: boolean = false; //新增/编辑模态框
67
+  add: boolean; //true:新增;false:编辑
68
+  addPriorityModal() {
69
+    this.modelName = "新增";
70
+    this.add = true; //新增
71
+    this.modalPriority = true;
72
+    this.initPriorityForm();
73
+  }
74
+  //关闭新增/编辑弹框
75
+  hidePriorityModal() {
76
+    this.modalPriority = false;
77
+  }
78
+	
79
+	changeInp(e) {
80
+	  this.searchParentDeptSubject.next(e);
81
+	}
82
+	
83
+	changeInp3(e){
84
+		this.searchParentUserSubject.next(e);
85
+	}
86
+	
87
+	// 获取所有科室
88
+	getDeparts(dept) {
89
+	  var that = this;
90
+	  let data = {
91
+	    department: {
92
+	      dept,
93
+	      hospital: {
94
+	        id: this.hosId
95
+	      },
96
+	    },
97
+	    idx: 0,
98
+	    sum: 20,
99
+	  };
100
+		that.mainService
101
+		  .getFetchDataList("data", "department", data)
102
+		  .subscribe((data) => {
103
+				setTimeout(_=>{
104
+					this.hospitals = data.list
105
+					that.isDeptLoading = false;
106
+				},100)
107
+		  });
108
+	}
109
+	
110
+	// 获取故障现象数据
111
+	getMalfunction(){
112
+		if(!this.currentHospital.type || (this.currentHospital.type && this.currentHospital.type.value !== '6')){
113
+		  this.malfunctionData = [];
114
+		  return;
115
+		};
116
+		let postData = {
117
+			hasThird: 'true',
118
+		  category: {
119
+		    dutyIds: this.currentHospital.type.value === '6' ? this.currentHospital.id.toString()  : undefined,
120
+		  },
121
+		};
122
+		this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
123
+		  let incidentCategoryList = res.data || [];
124
+		  incidentCategoryList = incidentCategoryList.map(v => ({...v, parentId: v.parent ? v.parent.id : undefined, title: v.category, key: v.id, isLeaf: false}));
125
+		  let arr = this.tool.tranListToTreeDataLeaf(incidentCategoryList, undefined, "parentId");
126
+			for(let i of arr){
127
+				for(let t of i.children){
128
+					for(let x of t.children){
129
+						this.malfunctionData.push({
130
+							name:x.mutiCategory,
131
+							id:x.id
132
+						})
133
+					}
134
+				}
135
+			}
136
+		})
137
+	}
138
+	
139
+	// 获取处理组
140
+	getGrop(){
141
+		let groupData = {
142
+		  group2: {
143
+		    hospitals: this.hosId,
144
+		    type:1
145
+		  },
146
+		  idx: 0,
147
+		  sum: 9999,
148
+		};
149
+		this.mainService
150
+		  .getFetchDataList("data", "group2", groupData)
151
+		  .subscribe((data) => {
152
+		    this.allUserGroup = data.list;
153
+		  });
154
+	}
155
+	
156
+	// 获取处理人
157
+	getUser(name){
158
+		let data = {
159
+			idx: 0,
160
+			sum: 20,
161
+			user: {
162
+				name:name,
163
+				hospital: { id: this.hosId || "" },
164
+			},
165
+		};
166
+		this.mainService
167
+			.getFetchDataList("data", "user", data)
168
+			.subscribe((data) => {
169
+				setTimeout(_=>{
170
+					this.isDeptLoading = false
171
+					this.userData = data.list;
172
+				},100)
173
+			});
174
+	}
175
+	
176
+  // 编辑
177
+  editPriority(data) {
178
+    console.log(data);
179
+    this.modelName = "编辑";
180
+    this.add = false;
181
+    this.modalPriority = true;
182
+    this.initPriorityForm();
183
+    this.coopData = data;
184
+		let deptArr = []
185
+		for(let i of data.deptList){
186
+			deptArr.push(i.id)
187
+		}
188
+    this.validatePriorityForm.controls.department.setValue(deptArr);
189
+    this.validatePriorityForm.controls.handleGroup.setValue(data.handleGroupDTO.id);
190
+		this.validatePriorityForm.controls.binding.setValue(data.handleUserDTO?'1':'0')
191
+		if(data.handleUserDTO){
192
+			this.validatePriorityForm.controls.handleUser.setValue(data.handleUserDTO.id);
193
+		}
194
+		if(data.categoryList){
195
+			let malfunction = []
196
+			for(let i of data.categoryList){
197
+				malfunction.push(i.id)
198
+			}
199
+			this.validatePriorityForm.controls.malfunction.setValue(malfunction)
200
+			// let arr = []
201
+			// for(let i of this.coopData.categoryList){
202
+			// 	arr.push(this.tool.tranListToTreeDataFindIdsLeaf(this.malfunctionData,i.id))
203
+			// }
204
+			// this.validatePriorityForm.controls.malfunction.setValue(arr);
205
+		}
206
+  }
207
+
208
+  // 新增/编辑表单提交
209
+  btnLoading: boolean = false; //提交按钮loading状态
210
+  submitPriorityForm(): void {
211
+    for (const i in this.validatePriorityForm.controls) {
212
+      this.validatePriorityForm.controls[i].markAsDirty();
213
+      this.validatePriorityForm.controls[i].updateValueAndValidity();
214
+    }
215
+    if (this.validatePriorityForm.invalid) {
216
+      return;
217
+    }
218
+    console.log(this.validatePriorityForm.value);
219
+    this.btnLoading = true;
220
+    let postData:any = {};
221
+		let malfunction = this.validatePriorityForm.value.malfunction
222
+    if (this.add) {
223
+      //增加
224
+      postData = {
225
+				deptIds:this.validatePriorityForm.value.department.join(','), //科室
226
+				categoryIds: malfunction.join(','),//故障
227
+				handleGroup: this.validatePriorityForm.value.handleGroup,//处理组
228
+				handleUser: this.validatePriorityForm.value.handleUser,//处理人
229
+				hosId:this.hosId
230
+      };
231
+    } else {
232
+      //编辑
233
+      postData = {
234
+				...this.coopData,
235
+				deptIds:this.validatePriorityForm.value.department.join(','), //科室
236
+				categoryIds: malfunction.join(','),//故障
237
+				handleGroup: this.validatePriorityForm.value.handleGroup,//处理组
238
+				handleUser: this.validatePriorityForm.value.handleUser,//处理人
239
+				hosId:this.hosId
240
+      };
241
+    }
242
+    this.mainService
243
+      .simplePost("addData", "incidentAssignManager", postData)
244
+      .subscribe((result) => {
245
+        this.btnLoading = false;
246
+        this.hidePriorityModal();
247
+        let msg = "";
248
+        if (this.add) {
249
+          msg = "新增";
250
+        } else {
251
+          msg = "修改";
252
+        }
253
+        if (result.status == 200) {
254
+          this.showPromptModal(msg, true, '');
255
+        } else {
256
+          this.showPromptModal(msg, false, result.msg);
257
+        }
258
+      });
259
+  }
260
+	
261
+	changeRadio(e){
262
+		if(this.validatePriorityForm.value.binding=='1'){
263
+			this.validatePriorityForm = this.fb.group({
264
+			  department: [this.validatePriorityForm.value.department, [Validators.required]],//科室
265
+			  malfunction: [this.validatePriorityForm.value.malfunction, []],//故障
266
+			  handleGroup: [this.validatePriorityForm.value.handleGroup, [Validators.required]],//处理组
267
+				binding:['1',[Validators.required]],//是否绑定人员
268
+			  handleUser: [this.validatePriorityForm.value.handleUser, [Validators.required]],//处理人
269
+			});
270
+		}else{
271
+			this.validatePriorityForm = this.fb.group({
272
+			  department: [this.validatePriorityForm.value.department, [Validators.required]],//科室
273
+			  malfunction: [this.validatePriorityForm.value.malfunction, []],//故障
274
+			  handleGroup: [this.validatePriorityForm.value.handleGroup, [Validators.required]],//处理组
275
+				binding:['0',[Validators.required]],//是否绑定人员
276
+			  handleUser: [this.validatePriorityForm.value.handleUser, []],//处理人
277
+			});
278
+		}
279
+	}
280
+	
281
+  // 初始化新增form表单
282
+  validatePriorityForm: FormGroup; //新增/编辑表单
283
+  initPriorityForm() {
284
+    this.validatePriorityForm = this.fb.group({
285
+      department: [null, [Validators.required]],//科室
286
+      malfunction: [null, []],//故障
287
+      handleGroup: [null, [Validators.required]],//处理组
288
+			binding:['0',[Validators.required]],//是否绑定人员
289
+      handleUser: [null, []],//处理人
290
+    });
291
+    console.log(this.validatePriorityForm.controls)
292
+  }
293
+
294
+  // 获取列表
295
+  loading1:boolean = false;
296
+  priorityList: any[] = []; //表格数据
297
+  tablePriorityHeight:number = 0;
298
+  getPriorityList() {
299
+    let data = {
300
+			idx: this.pageIndex - 1,
301
+			sum: this.pageSize,
302
+			incidentAssignManager: {
303
+				hosId: this.hosId || "" ,
304
+			},
305
+		};
306
+		this.loading1 = true;
307
+		this.mainService
308
+			.getFetchDataList("data", "incidentAssignManager", data)
309
+			.subscribe((data) => {
310
+				this.loading1 = false;
311
+				for(let i of data.list){
312
+					i.dept = i.deptList.map(t=>{
313
+						return t.dept
314
+					})
315
+					if(i.categoryList){
316
+						i.category = i.categoryList.map(t=>{
317
+							return t.mutiCategory
318
+						})
319
+						i.category= i.category.join('、')
320
+					}
321
+					i.dept = i.dept.join('、')
322
+				}
323
+				this.priorityList = data.list
324
+				console.log(8888,this.priorityList)
325
+				this.listLength = data.totalNum;
326
+			});
327
+  }
328
+
329
+  delModal: boolean = false; //删除模态框
330
+  tipsMsg1: string; //提示框信息
331
+  tipsMsg2: string; //操作后信息
332
+  confirmDelType: string; //确认的类型(启用/停用,删除)
333
+  showDelModal(
334
+    data,
335
+    tipsMsg1: string,
336
+    tipsMsg2: string,
337
+    type: string,
338
+  ) {
339
+    this.confirmDelType = type;
340
+    this.delModal = true;
341
+    this.coopData = data;
342
+    this.tipsMsg1 = tipsMsg1;
343
+    this.tipsMsg2 = tipsMsg2;
344
+  }
345
+  // 隐藏删除框
346
+  hideDelModal() {
347
+    this.delModal = false;
348
+  }
349
+  // 确认删除
350
+  confirmDel() {
351
+		let ids = this.coopData.ids.split(',')
352
+    this.btnLoading = true;
353
+		//删除-优先级
354
+		this.mainService
355
+			.simplePost("rmvData", "incidentAssignManager", ids)
356
+			.subscribe((data) => {
357
+				this.btnLoading = false;
358
+				this.delModal = false;
359
+				if (data.status == 200) {
360
+					this.showPromptModal(this.tipsMsg2, true, "");
361
+				} else {
362
+					this.showPromptModal(this.tipsMsg2, false, data.msg);
363
+				}
364
+			});
365
+  }
366
+
367
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
368
+  promptContent: string; //操作提示框提示信息
369
+  ifSuccess: boolean; //操作成功/失败
370
+  promptInfo: string; //操作结果提示信息
371
+  promptModalShow: boolean; //操作提示框是否展示
372
+  showPromptModal(con, success, promptInfo?) {
373
+    this.promptModalShow = false;
374
+    this.promptContent = con;
375
+    this.ifSuccess = success;
376
+    this.promptInfo = promptInfo;
377
+    setTimeout(() => {
378
+      this.promptModalShow = true;
379
+    }, 100);
380
+    this.getPriorityList();
381
+  }
382
+}

+ 108 - 0
src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.html

@@ -0,0 +1,108 @@
1
+
2
+<div class="content">
3
+  <div class="contentInner">
4
+    <div class="address">
5
+      <div class="contentHead">工时大类
6
+				<div>
7
+					<button nz-button class="mar-rig-10 btn cancel" nzType="default" nzSize="small" *ngIf="activeCategory1.id" (click)="delCategoryModal(1)">删除</button>
8
+					<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button>
9
+				</div>
10
+			</div>
11
+      <overlay-scrollbars #osComponentRef1 class="contentBody">
12
+        <nz-spin nzSimple [nzSpinning]="categoryLoading1" class="mt8 text_align_center"></nz-spin>
13
+        <div [hidden]="categoryLoading1" class="contentItem" [title]="item.workName" [ngClass]="{ active: item.id === activeCategory1.id }" (click)="clickCategory(item, 1)" *ngFor="let item of categoryList1">{{ item.workName }}</div>
14
+      </overlay-scrollbars>
15
+    </div>
16
+    <div class="address">
17
+      <div class="contentHead">工时小类
18
+				<div>
19
+					<button nz-button class="mar-rig-10 btn cancel" *ngIf="activeCategory2.id && activeCategory1.id" nzType="default" nzSize="small" (click)="delCategoryModal(2)">删除</button>
20
+					<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button>
21
+				</div>
22
+			</div>
23
+      <overlay-scrollbars #osComponentRef2 class="contentBody">
24
+        <nz-spin nzSimple [nzSpinning]="categoryLoading2" class="mt8 text_align_center"></nz-spin>
25
+        <div [hidden]="categoryLoading2" class="contentItem" [title]="item.workName" [ngClass]="{ active: item.id === activeCategory2.id }" (click)="clickCategory(item, 2)" *ngFor="let item of categoryList2">{{ item.workName }}</div>
26
+      </overlay-scrollbars>
27
+    </div>
28
+  </div>
29
+</div>
30
+
31
+
32
+<!-- 新增-->
33
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalCategory">
34
+  <div class="modalBody">
35
+    <div class="title">新增<i class="icon_transport transport-guanbi" (click)="hideCategoryModal()"></i></div>
36
+    <div class="content">
37
+      <form nz-form [formGroup]="validateCategoryForm" class="addForm">
38
+				<nz-form-item *ngIf="coopType === 2">
39
+				  <nz-form-label [nzSpan]="6" nzFor="workName">大类工时名称</nz-form-label>
40
+				  <nz-form-control [nzSpan]="18">
41
+				    <nz-input-group>
42
+							<div>
43
+								{{activeCategory1.workName}}
44
+							</div>
45
+						</nz-input-group>
46
+				  </nz-form-control>
47
+				</nz-form-item>
48
+				
49
+				<nz-form-item>
50
+				  <nz-form-label [nzSpan]="5" nzRequired nzFor="workName">工时名称</nz-form-label>
51
+				  <nz-form-control [nzSpan]="19" nzErrorTip="请填写工时名称!">
52
+				    <nz-input-group>
53
+				      <input nz-input formControlName="workName" placeholder="请填写工时名称" />
54
+				    </nz-input-group>
55
+				  </nz-form-control>
56
+				</nz-form-item>
57
+				<nz-form-item>
58
+				  <nz-form-label [nzSpan]="5" nzRequired nzFor="workUnit">单位</nz-form-label>
59
+				  <nz-form-control [nzSpan]="19" nzErrorTip="请填写单位(2个字以内)!">
60
+				    <nz-input-group>
61
+				      <input nz-input (input)="handleInput($event)" formControlName="workUnit" placeholder="请填写单位(2个字以内)" />
62
+				    </nz-input-group>
63
+				  </nz-form-control>
64
+				</nz-form-item>
65
+				<nz-form-item>
66
+				  <nz-form-label [nzSpan]="5" nzRequired nzFor="wage">工价</nz-form-label>
67
+				  <nz-form-control [nzSpan]="19" nzErrorTip="请填写工价!">
68
+				   <nz-input-number
69
+							formControlName="wage"
70
+				    	[nzMin]="0"
71
+							[nzPrecision]="2"
72
+				    	[nzMax]="999999"
73
+				    	[nzStep]="0.1"
74
+				    	[nzPlaceHolder]="'请填写工价(保留2位小数)'"
75
+				    ></nz-input-number>
76
+				  </nz-form-control>
77
+				</nz-form-item>
78
+        <nz-form-item>
79
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="integral">工时积分</nz-form-label>
80
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择工时积分!">
81
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear formControlName="integral" nzPlaceHolder="请选择工时积分">
82
+              <ng-container *ngFor="let option of scoreList">
83
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
84
+              </ng-container>
85
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
86
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
87
+              </nz-option>
88
+            </nz-select>
89
+          </nz-form-control>
90
+        </nz-form-item>
91
+      </form>
92
+    </div>
93
+    <div class=" display_flex justify-content_flex-center">
94
+      <button nzType="primary" nz-button (click)="submitCategoryForm()" [nzLoading]="btnLoading">确认</button>
95
+      <button class="btn cancel" nz-button nzType="default" (click)="hideCategoryModal()">取消</button>
96
+    </div>
97
+  </div>
98
+</div>
99
+
100
+<!-- 操作成功/失败提示框 -->
101
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
102
+  [info]="promptInfo">
103
+</app-prompt-modal>
104
+
105
+<!-- 删除模态框 -->
106
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" 
107
+  (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="确定要删除吗?" confirmTxt="是" cancelTxt="否">
108
+</app-dialog-delete>

+ 303 - 0
src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.less

@@ -0,0 +1,303 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+  .list-template__nzTable,
9
+  .list-template__bottom{
10
+    padding: 0!important;
11
+    border: none!important;
12
+    background: #fff!important;
13
+  }
14
+  .list-template{
15
+    width: 100%!important;
16
+    height: 100%!important;
17
+  }
18
+
19
+  .hospitalConfig{
20
+    height: 60px;
21
+    display: flex;
22
+    justify-content: center;
23
+    align-items: center;
24
+    gap: 72px;
25
+  }
26
+  .content{
27
+    flex: 1;
28
+    min-height: 0;
29
+    display: flex;
30
+    flex-direction: column;
31
+    justify-content: space-between;
32
+    border: 1px solid #EEF3F9;
33
+		padding: 20px 300px;
34
+    &.priority{
35
+      margin: 24px 118px 0;
36
+      background-color: #fff;
37
+      .contentInner{
38
+        padding: 48px 206px;
39
+        border: 1px solid #E8EBEF;
40
+      }
41
+    }
42
+    .contentItem{
43
+      padding: 4px 16px;
44
+      cursor: pointer;
45
+      overflow: hidden;
46
+      text-overflow: ellipsis;
47
+      white-space: nowrap;
48
+      &.active{
49
+        color: @primary-color;
50
+        background-color: #F0F6ED;
51
+        border-radius: 4px;
52
+      }
53
+    }
54
+    .contentInner{
55
+      flex: 1;
56
+      display: flex;
57
+      justify-content: space-between;
58
+      align-items: center;
59
+      padding: 0 16px;
60
+      gap: 16px;
61
+      .contentHead{
62
+        height: 45px;
63
+        display: flex;
64
+        justify-content: space-between;
65
+        align-items: center;
66
+        gap: 16px;
67
+        padding: 0 16px;
68
+        font-size: 16px;
69
+        font-weight: bold;
70
+        border-bottom: 1px solid #D9D9D9;
71
+				.mar-rig-10{
72
+					margin-right: 10px;
73
+				}
74
+        .title{
75
+          overflow: hidden;
76
+          text-overflow: ellipsis;
77
+          white-space: nowrap;
78
+        }
79
+        .btns{
80
+          flex-shrink: 0;
81
+        }
82
+      }
83
+      .contentBody{
84
+        padding: 0 8px;
85
+        margin: 4px 0;
86
+        flex: 1;
87
+      }
88
+      .address{
89
+        flex: 1;
90
+        height: 100%;
91
+        background: #FFFFFF;
92
+        border: 1px solid #E8EBEF;
93
+        display: flex;
94
+        flex-direction: column;
95
+        width: 0;
96
+      }
97
+      .addressAssign{
98
+        flex: 3;
99
+        height: 100%;
100
+        background: #FFFFFF;
101
+        border: 1px solid #E8EBEF;
102
+        display: flex;
103
+        flex-direction: column;
104
+        width: 0;
105
+      }
106
+      .list-template__searchItem {
107
+        margin-bottom: 16px;
108
+        .label {
109
+          color: #333;
110
+          display: inline-block;
111
+          width: 70px;
112
+          text-align-last: justify;
113
+          text-align: justify;
114
+          &.label--big {
115
+            width: 100px;
116
+          }
117
+        }
118
+        .formItem {
119
+          width: 135px;
120
+        }
121
+      }
122
+    }
123
+    .contentBtns{
124
+      margin-bottom: 16px;
125
+      display: flex;
126
+      justify-content: center;
127
+      align-items: center;
128
+    }
129
+  }
130
+
131
+  .save {
132
+    position: fixed;
133
+    left: 0;
134
+    top: 0;
135
+    width: 100%;
136
+    height: 100%;
137
+    background: rgba(0, 0, 0, 0.4);
138
+    z-index: 99;
139
+
140
+    .tips{
141
+      margin-bottom: 16px!important;
142
+    }
143
+
144
+    .modalBody {
145
+      width: 350px;
146
+      background: #fff;
147
+      border-radius: 5px;
148
+      padding: 10px 20px;
149
+      color: #333;
150
+
151
+      .title {
152
+        width: 100%;
153
+        text-align: center;
154
+        font-size: 18px;
155
+        position: relative;
156
+
157
+        i {
158
+          position: absolute;
159
+          right: 0;
160
+          top: 0;
161
+          font-size: 20px;
162
+          color: #666;
163
+          cursor: pointer;
164
+          padding: 0 5px;
165
+        }
166
+      }
167
+
168
+      .content {
169
+        width: 310px;
170
+        background: #f9fafb;
171
+        border: 1px solid #e5e9ed;
172
+        border-radius: 5px;
173
+        overflow: hidden;
174
+        margin-top: 12px;
175
+        padding: 16px 0;
176
+
177
+        .busyList{
178
+          display: flex;
179
+          margin-bottom: 8px;
180
+          .busyContent{
181
+            margin-right: 8px;
182
+            flex: 1;
183
+          }
184
+        }
185
+
186
+        & > div {
187
+          text-align: center;
188
+          margin: 0;
189
+
190
+          &.icon {
191
+            // margin-top: 17px;
192
+
193
+            i {
194
+              color: #34b349;
195
+              font-size: 30px !important;
196
+
197
+              &.transport-wenhao {
198
+                color: #f5a523;
199
+              }
200
+
201
+              &.transport-shibai {
202
+                color: #ff3a52;
203
+              }
204
+            }
205
+          }
206
+
207
+          &.defeat {
208
+            color: #333;
209
+            font-size: 14px;
210
+          }
211
+
212
+          &:nth-child(3) {
213
+            font-size: 14px;
214
+            color: #666;
215
+          }
216
+        }
217
+        .workAssignmentTips {
218
+          font-size: 12px;
219
+        }
220
+      }
221
+
222
+      button {
223
+        margin-top: 10px;
224
+
225
+        &.btn {
226
+          margin-left: 8px;
227
+        }
228
+      }
229
+    }
230
+
231
+    // 新增
232
+    &.add {
233
+      .modalBody {
234
+        width: 480px;
235
+        height: auto;
236
+
237
+        .content {
238
+          width: 100%;
239
+          height: auto;
240
+          padding: 16px;
241
+          max-height: 497px;
242
+          overflow-y: auto;
243
+
244
+          .addForm {
245
+            .ant-form-item {
246
+              margin-bottom: 0;
247
+							.ant-input-number{
248
+								width: 100% !important;
249
+							}
250
+              .ant-form-item-label {
251
+                text-align: left;
252
+              }
253
+
254
+              .desc {
255
+                margin-top: 5px;
256
+              }
257
+            }
258
+
259
+            .datesControl {
260
+              margin-top: -16px;
261
+
262
+              .ant-form-item-label {
263
+                line-height: 40px;
264
+              }
265
+            }
266
+
267
+            .timer {
268
+              .ant-form-item-label {
269
+                width: 100%;
270
+                text-align: left;
271
+              }
272
+
273
+              .numInp {
274
+                margin-right: 5px;
275
+              }
276
+
277
+              .line {
278
+                margin-right: 5px;
279
+              }
280
+            }
281
+
282
+            .timer2 {
283
+              .ant-form-item-label {
284
+                line-height: 20px;
285
+              }
286
+            }
287
+          }
288
+
289
+          .editForm {
290
+            .ant-form-item {
291
+              margin-bottom: 15px;
292
+
293
+              .ant-form-item-label {
294
+                line-height: 14px;
295
+                text-align: left;
296
+              }
297
+            }
298
+          }
299
+        }
300
+      }
301
+    }
302
+  }
303
+}

+ 311 - 0
src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.ts

@@ -0,0 +1,311 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
9
+import { NzMessageService } from "ng-zorro-antd";
10
+
11
+@Component({
12
+  selector: "app-configuration-manHour",
13
+  templateUrl: "./configuration-manHour.component.html",
14
+  styleUrls: ["./configuration-manHour.component.less"],
15
+})
16
+export class ConfigurationManHourComponent implements OnInit {
17
+  constructor(
18
+    private route: ActivatedRoute,
19
+    private mainService: MainService,
20
+    private fb: FormBuilder,
21
+    private tool: ToolService,
22
+		private message: NzMessageService,
23
+  ) {}
24
+
25
+  @ViewChild("osComponentRef1", {
26
+    read: OverlayScrollbarsComponent,
27
+    static: false,
28
+  })
29
+  osComponentRef1: OverlayScrollbarsComponent;
30
+  @ViewChild("osComponentRef2", {
31
+    read: OverlayScrollbarsComponent,
32
+    static: false,
33
+  })
34
+  osComponentRef2: OverlayScrollbarsComponent;
35
+  @ViewChild("osComponentRef3", {
36
+    read: OverlayScrollbarsComponent,
37
+    static: false,
38
+  })
39
+  osComponentRef3: OverlayScrollbarsComponent;
40
+
41
+  coopData: any = {}; //当前操作列
42
+  currentHospital; //当前院区
43
+  // 部门设置、全院设置
44
+  hospitalConfig:any = 2;
45
+  hospitalConfigList:any = [
46
+    // { id: 1, name: '部门设置',},
47
+    { id: 2, name: '全院设置',},
48
+  ];
49
+	hosId:any;
50
+  debounceSubject = new Subject(); //防抖
51
+
52
+  ngOnInit() {
53
+    this.debounceSubject.pipe(debounceTime(500)).subscribe((v) => {
54
+      if(v[0]){
55
+        this.getCategoryList(v[0], v[1].id);
56
+      }
57
+    });
58
+
59
+    this.currentHospital = this.tool.getCurrentHospital();
60
+		this.hosId = this.tool.getCurrentHospital().id;
61
+    this.getCategoryList(1);
62
+    this.getScores();
63
+  }
64
+
65
+	
66
+	// 监听单位输入
67
+	workUnitshow:boolean = false;
68
+	handleInput(event: KeyboardEvent){
69
+		const input = event.target as HTMLInputElement;
70
+		if (input.value.length>2) {
71
+			this.workUnitshow = true
72
+		} else{
73
+			this.workUnitshow = false
74
+		}
75
+	}
76
+	
77
+  // 获取积分
78
+  scoreList: any = [];
79
+  getScores() {
80
+    let postData = {
81
+      dictionary: {
82
+        key: "incident_category_score"
83
+      },
84
+      idx: 0,
85
+      sum: 10,
86
+    };
87
+    this.mainService
88
+      .getFetchDataList("simple/data", "dictionary", postData)
89
+      .subscribe((data) => {
90
+        this.scoreList = data.list || [];
91
+      });
92
+  }
93
+
94
+  // 点击故障现象
95
+  activeCategory1:any = {};
96
+  activeCategory2:any = {};
97
+  activeCategory3:any = {};
98
+	listType:any = 1;
99
+  clickCategory(item, type:number){
100
+		this.listType = type
101
+    switch(type){
102
+      case 1:
103
+        this.categoryList2 = [];
104
+        this.categoryList3 = [];
105
+        this.activeCategory2 = {};
106
+        this.activeCategory3 = {};
107
+        break;
108
+      case 2:
109
+        this.categoryList3 = [];
110
+        this.activeCategory3 = {};
111
+        break;
112
+    }
113
+    this['activeCategory' + type] = item;
114
+    console.log(this['activeCategory' + type])
115
+    switch(type){
116
+      case 1:
117
+        this.categoryLoading2 = true;
118
+        this.loading1 = true;
119
+        this.debounceSubject.next([2, item]);
120
+        break;
121
+      case 2:
122
+        this.categoryLoading3 = true;
123
+        this.loading1 = true;
124
+        this.debounceSubject.next([3, item]);
125
+        break;
126
+    }
127
+  }
128
+	
129
+	// 取消删除弹框
130
+	cancelDel(){
131
+		this.hideDelModal();
132
+	}
133
+	
134
+	// 确认删除
135
+	confirmDel() {
136
+	  let that = this;
137
+	  that.btnLoading = true;
138
+	  that.mainService
139
+	    .coopTypeConfig('rmvData', 'workHourManagement', [this['activeCategory' + this.listType].id])
140
+	    .subscribe((data) => {
141
+	      that.btnLoading = false;
142
+	      that.hideDelModal();
143
+	      if (data["status"] == 200) {
144
+	        that.showPromptModal("删除", true, "");
145
+	      } else {
146
+	        that.showPromptModal("删除", false, data["msg"]);
147
+	      }
148
+	    });
149
+	}
150
+	
151
+	// 关闭删除模态框
152
+	hideDelModal() {
153
+	  this.delModal = false;
154
+	}
155
+
156
+  // 获取工时
157
+  loading1:boolean = false;
158
+  tableCategoryHeight:number = 0;
159
+  categoryList1: any[] = [];
160
+  categoryList2: any[] = [];
161
+  categoryList3: any[] = [];
162
+  categoryLoading1:boolean = false;
163
+  categoryLoading2:boolean = false;
164
+  categoryLoading3:boolean = false;
165
+  getCategoryList(type:number, parentId = 0) {
166
+    setTimeout(() => {
167
+      this['categoryLoading' + type] = true;
168
+    }, 0)
169
+    let postData = {
170
+			idx: 0,
171
+			sum: 99999,
172
+			workHourManagement: {
173
+				hosId: this.hosId,
174
+				treeLevel: type,
175
+				parent: type === 1 ? null : { id: parentId }
176
+			}
177
+    };
178
+		this.mainService
179
+		  .getFetchDataList("data", "workHourManagement", postData)
180
+		  .subscribe((res) => {
181
+		    this['categoryLoading' + type] = false;
182
+		    this['categoryList' + type] = res.list || [];
183
+		  });
184
+  }
185
+
186
+  // 新增故障现象弹框
187
+  modelName = ""; //模态框名称
188
+  add: boolean; //true:新增;false:编辑
189
+  modalCategory: boolean = false; //新增/编辑模态框
190
+  coopType: number = 0;
191
+  addCategoryModal(type:number) {
192
+    this.coopType = type;
193
+    this.modelName = "新增";
194
+    this.add = true; //新增
195
+    this.modalCategory = true;
196
+    this.initCategoryForm();
197
+  }
198
+	
199
+	// 删除工时
200
+	delModal: boolean = false; //删除模态框
201
+	delCategoryModal(type:number){
202
+		this.coopType = type;
203
+		this.delModal = true
204
+	}
205
+	
206
+  //关闭新增/编辑弹框
207
+  hideCategoryModal() {
208
+    this.modalCategory = false;
209
+  }
210
+
211
+  // 初始化新增form表单
212
+  validateCategoryForm: FormGroup; //新增/编辑表单
213
+  initCategoryForm() {
214
+    this.validateCategoryForm = this.fb.group({
215
+      workName: [null, [Validators.required]],//名称
216
+			workUnit: [null, [Validators.required]],//单位
217
+			wage: [null, [Validators.required]],//工价
218
+			integral: [null, [Validators.required]],//工时积分
219
+    });
220
+  }
221
+
222
+
223
+  // 新增/编辑表单提交
224
+  btnLoading: boolean = false; //提交按钮loading状态
225
+  submitCategoryForm(): void {
226
+    for (const i in this.validateCategoryForm.controls) {
227
+      this.validateCategoryForm.controls[i].markAsDirty();
228
+      this.validateCategoryForm.controls[i].updateValueAndValidity();
229
+    }
230
+    if (this.validateCategoryForm.invalid) {
231
+      return;
232
+    }
233
+		if(this.workUnitshow){
234
+			this.message.error('单位长度不能多于2位')
235
+			return;
236
+		}
237
+    console.log(this.validateCategoryForm.value);
238
+    this.btnLoading = true;
239
+    // -----------------------------------
240
+    let postData:any = {
241
+			...this.validateCategoryForm.value,
242
+			integral:{
243
+				id:this.validateCategoryForm.value.integral
244
+			},
245
+			hosId: this.hosId,
246
+			treeLevel: this.coopType,
247
+			parent: this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)],
248
+    };
249
+			
250
+		this.mainService
251
+			.simplePost("addData", "workHourManagement", postData)
252
+			.subscribe((data) => {
253
+				this.btnLoading = false;
254
+				if (data.status == 200) {
255
+					this.modalCategory = false
256
+					this.showPromptModal("新增", true, "");
257
+				} else {
258
+					this.showPromptModal("新增", false, data.msg);
259
+				}
260
+			});
261
+    // -----------------------------------
262
+  }
263
+
264
+  // 初始化新增form表单
265
+  validateConfigForm: FormGroup; //新增/编辑表单
266
+  initConfigForm() {
267
+    this.validateConfigForm = this.fb.group({
268
+      hosId: [null, [Validators.required]],//院区
269
+      dutyId: [null, [Validators.required]],//责任部门
270
+      priority: [null, [Validators.required]],//优先级
271
+      score: [null, [Validators.required]],//积分
272
+      userGroup: [1, [Validators.required]],//分配方式
273
+      userId: [null],//维修人
274
+      groupId: [null, [Validators.required]],//维修组
275
+    });
276
+    console.log(this.validateConfigForm.controls)
277
+  }
278
+	
279
+	// 获取当前选中的故障现象索引
280
+	get currentCategoryIndex(){
281
+	  if(this.activeCategory3.id){
282
+	    return 3;
283
+	  }
284
+	  if(this.activeCategory2.id){
285
+	    return 2;
286
+	  }
287
+	  if(this.activeCategory1.id){
288
+	    return 1;
289
+	  }
290
+	}
291
+	
292
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
293
+  promptContent: string; //操作提示框提示信息
294
+  ifSuccess: boolean; //操作成功/失败
295
+  promptInfo: string; //操作结果提示信息
296
+  promptModalShow: boolean; //操作提示框是否展示
297
+  showPromptModal(con, success, promptInfo?) {
298
+    this.promptModalShow = false;
299
+    this.promptContent = con;
300
+    this.ifSuccess = success;
301
+    this.promptInfo = promptInfo;
302
+    setTimeout(() => {
303
+      this.promptModalShow = true;
304
+    }, 100);
305
+    if(this.coopType !== 0){
306
+      this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
307
+    }else{
308
+      this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
309
+    }
310
+  }
311
+}

+ 1 - 1
src/app/services/tool.service.ts

@@ -257,7 +257,7 @@ export class ToolService {
257 257
   tranListToTreeDataLeaf(list:Array<any>, rootValue:any, parentKeyName:string, keyName:string = 'id'):Array<any> {
258 258
     return list.filter((t) => {
259 259
       let children = this.tranListToTreeData(list, t[keyName], parentKeyName, keyName);
260
-      if(!children.length){
260
+			if(!children.length){
261 261
         t.isLeaf = true;
262 262
       }
263 263
       return t[parentKeyName] === rootValue

+ 3 - 0
src/app/share/wang-editor/wang-editor.component.html

@@ -1,4 +1,7 @@
1 1
 <div class="wangeditor-box">
2 2
 	<div id="editorMenu" class="editor-class"></div>
3 3
 	<div id="editor"></div>
4
+	<div class="mask-style" *ngIf="isLoading">
5
+		<nz-spin nzSimple class="spin-style"></nz-spin>
6
+	</div>
4 7
 </div>

+ 15 - 1
src/app/share/wang-editor/wang-editor.component.less

@@ -16,5 +16,19 @@
16 16
 		  border: 1px solid #ccc !important;
17 17
 		}
18 18
 	}
19
-
19
+	.mask-style{
20
+		width: 100%;
21
+		height: 100%;
22
+		position: fixed;
23
+		top: 0;
24
+		left: 0;
25
+		z-index: 99999;
26
+		display: flex;
27
+		background: rgba(0,0,0,0.5);
28
+		align-items: center;
29
+		justify-content: center;
30
+		.spin-style{
31
+			z-index:9999;
32
+		}
33
+	}
20 34
 }

+ 88 - 16
src/app/share/wang-editor/wang-editor.component.ts

@@ -1,48 +1,115 @@
1 1
 import { Component, ElementRef, Output, Input, OnInit, EventEmitter } from '@angular/core';
2 2
 import WangEditor from 'wangeditor';
3
+import { HttpHeaders, HttpRequest, HttpClient  } from "@angular/common/http";
4
+import host from "../../../assets/js/http";
5
+import { NzMessageService } from "ng-zorro-antd";
6
+
3 7
 @Component({
4 8
   selector: 'app-wang-editor',
5 9
   templateUrl: './wang-editor.component.html',
6 10
   styleUrls: ['./wang-editor.component.less']
7 11
 })
8 12
 export class wangEditorComponent implements OnInit {
13
+	
9 14
 	@Output() changeContent = new EventEmitter();
10 15
 	@Input() content: string;
11 16
 	editor: any;
17
+	isLoading:boolean=false;
12 18
 	constructor(
13
-
19
+		private http: HttpClient,
20
+		private message: NzMessageService
14 21
 	) { }
15 22
 	
16 23
   ngOnInit() {
24
+		// if(this.editor){
25
+		// 	this.editors()
26
+		// }
17 27
 		this.editor = new WangEditor('#editorMenu', '#editor');
18 28
 		this.setEditorConfig()
19
-		this.editor.create();
20
-		// 设置内容
21
-		this.setContent()
22 29
   }
23 30
 	
24 31
 	// 编辑器相关配置设置
25 32
 	setEditorConfig () {
26 33
 		// 使用 base64 保存图片
27
-		this.editor.config.uploadImgShowBase64 = true;
34
+		this.editor.config.uploadImgShowBase64 = false;
28 35
 		// 菜单展示项配置
29
-		// this.editor.config.menus = this.getMenuConfig();
36
+		this.editor.config.menus = this.getMenuConfig();
30 37
 		// 自定义配置颜色(字体颜色、背景色)
31 38
 		this.editor.config.colors = this.getColorConfig();
32 39
 		// 表情面板可以有多个 tab ,因此要配置成一个数组。数组每个元素代表一个 tab 的配置
33
-		this.editor.config.emotions = this.getEmotionsConfig();
40
+		// this.editor.config.emotions = this.getEmotionsConfig();
34 41
 		// 自定义字体
35 42
 		this.editor.config.fontNames = this.getFontFamilyConfig();
36
-		// 编辑区域的z-index默认为10000
37
-		// this.editor.config.zIndex = 100;
43
+
44
+		// 上传图片大小 20M 
45
+		this.editor.config.uploadImgMaxSize = 20 * 1024 * 1024
46
+		// // 隐藏插入网络图片的功能
47
+		this.editor.config.showLinkImg = false
48
+		
49
+		// 上传视频大小 50M
50
+		this.editor.config.uploadVideoMaxSize = 50 * 1024 * 1024
51
+		this.editor.config.showLinkVideo = false
52
+		
53
+		// // 配置触发 onchange 的时间频率,默认为 200ms
54
+		this.editor.config.onchangeTimeout = 500 // 修改为 500ms
55
+		this.editor.config.customUploadImg = (resultFiles, insertImgFn) =>{
56
+			if(resultFiles[0].size > this.editor.config.uploadImgMaxSize){
57
+				this.message.error('图片大小不能超过20M')
58
+				return
59
+			}
60
+			let url = `/service/common/common/uploadAttachment/solutionContent/0/0`
61
+			const formData = new FormData()
62
+			formData.append('file', resultFiles[0]);
63
+			formData.append('filename', resultFiles[0].name);
64
+			const req = new HttpRequest('POST', url, formData, {
65
+				reportProgress: false,
66
+				withCredentials: false
67
+			});
68
+			this.isLoading = true
69
+			this.http.request(req).subscribe((res:any) => {
70
+				if(res.status==200 && res.body){
71
+					this.isLoading = false
72
+					let url = location.origin + '/file' + res.body.data.relativeFilePath
73
+					insertImgFn(url,url,url)
74
+				}
75
+			});
76
+		}
77
+		
78
+		this.editor.config.customUploadVideo = (resultFiles, insertVideoFn) =>{
79
+			if(resultFiles[0].size > this.editor.config.uploadVideoMaxSize){
80
+				this.message.error('视频大小不能超过50M')
81
+				return
82
+			}
83
+			let url = `/service/common/common/uploadAttachment/solutionContent/0/0`
84
+			const formData = new FormData()
85
+			formData.append('file', resultFiles[0]);
86
+			formData.append('filename', resultFiles[0].name);
87
+			const req = new HttpRequest('POST', url, formData, {
88
+				reportProgress: false,
89
+				withCredentials: false
90
+			});
91
+			this.isLoading = true
92
+			this.http.request(req).subscribe((res:any) => {
93
+				if(res.status==200 && res.body){
94
+					this.isLoading = false
95
+					let url = location.origin + '/file' + res.body.data.relativeFilePath
96
+					insertVideoFn(url)
97
+				}
98
+			});
99
+		}
100
+		
38 101
 		// 配置编辑器内容改变触发方法
39 102
 		this.editor.config.onchange = this.editorContentChange;
40 103
 		// 编辑器获取到焦点触发方法
41 104
 		this.editor.config.onfocus = this.editorOnFocus;
42 105
 		// 编辑器失去焦点触发方法
43 106
 		this.editor.config.onblur = this.editorOnBlur;
107
+		
108
+		this.editor.create();
109
+		// 设置内容
110
+		this.setContent()
44 111
 	}
45
-	
112
+			
46 113
 	  // 获取显示菜单项
47 114
 	  getMenuConfig (): string[] {
48 115
 	    return [
@@ -59,11 +126,11 @@ export class wangEditorComponent implements OnInit {
59 126
 	      'list',  // 列表
60 127
 	      'justify',  // 对齐方式
61 128
 	      'quote',  // 引用
62
-	      'emoticon',  // 表情
63
-	      'table',  // 表格
129
+	      // 'emoticon',  // 表情
130
+	      // 'table',  // 表格
64 131
 	      'image',  // 插入图片
65 132
 	      'video',  // 插入视频
66
-	      'code',  // 插入代码
133
+	      // 'code',  // 插入代码
67 134
 	      'undo',  // 撤销
68 135
 	      'redo'  // 重复
69 136
 	    ];
@@ -126,11 +193,11 @@ export class wangEditorComponent implements OnInit {
126 193
 	      'Verdana'
127 194
 	    ];
128 195
 	  }
129
-	
196
+		
130 197
 	  // 富文本编辑器内容变化触发方法
131 198
 	  editorContentChange = (html) => {
132
-	    console.log(html);
133 199
 			this.changeContent.emit(html)
200
+	    console.log(222,html);
134 201
 	  }
135 202
 	
136 203
 	  // 编辑器获取到焦点触发事件
@@ -145,9 +212,14 @@ export class wangEditorComponent implements OnInit {
145 212
 	
146 213
 	  // 设置编辑器显示内容
147 214
 	  setContent() {
215
+			console.log(7777,this.content)
148 216
 	    this.editor.txt.html(this.content);
149 217
 	  }
150
-	
218
+		
219
+		editors(){
220
+			this.editor.destroy()//销毁组件
221
+			this.editor = null
222
+		}
151 223
 	//   // 获取编辑器内容,带html
152 224
 	//   getContent() {
153 225
 	//     this.showMessage = this.editor.txt.html();

+ 8 - 0
src/app/views/incident-config/incident-config.component.html

@@ -20,6 +20,14 @@
20 20
   <ng-container *ngIf="activeTagId === 3">
21 21
     <app-configuration-dictionary></app-configuration-dictionary>
22 22
   </ng-container>
23
+	<!-- 工时管理 -->
24
+	<ng-container *ngIf="activeTagId === 4">
25
+	  <app-configuration-manHour></app-configuration-manHour>
26
+	</ng-container>
27
+	<!-- 科室绑定人员 -->
28
+	<ng-container *ngIf="activeTagId === 5">
29
+	  <app-configuration-deptUser></app-configuration-deptUser>
30
+	</ng-container>
23 31
 </div>
24 32
 
25 33
 

+ 2 - 0
src/app/views/incident-config/incident-config.component.ts

@@ -16,6 +16,8 @@ export class IncidentConfigComponent implements OnInit, AfterViewInit {
16 16
     { id: 1, name: '故障现象',},
17 17
     { id: 2, name: '优先级',},
18 18
     { id: 3, name: '数据字典',},
19
+		{ id: 4, name: '工时管理',},
20
+		{ id: 5, name: '科室绑定人员',},
19 21
   ];
20 22
 
21 23
   ngOnInit(): void {}

+ 4 - 0
src/app/views/incident-config/incident-config.module.ts

@@ -7,6 +7,8 @@ import { ShareModule } from 'src/app/share/share.module';
7 7
 import { ConfigurationCategoryComponent } from 'src/app/components/configurationCenter/configuration-category/configuration-category.component';
8 8
 import { ConfigurationPriorityComponent } from 'src/app/components/configurationCenter/configuration-priority/configuration-priority.component';
9 9
 import { ConfigurationDictionaryComponent } from 'src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component';
10
+import { ConfigurationManHourComponent } from 'src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component';
11
+import { ConfigurationDeptUserComponent } from 'src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component';
10 12
 
11 13
 
12 14
 @NgModule({
@@ -15,6 +17,8 @@ import { ConfigurationDictionaryComponent } from 'src/app/components/configurati
15 17
     ConfigurationCategoryComponent,
16 18
     ConfigurationPriorityComponent,
17 19
     ConfigurationDictionaryComponent,
20
+		ConfigurationManHourComponent,
21
+		ConfigurationDeptUserComponent
18 22
   ],
19 23
   imports: [
20 24
     CommonModule,

+ 4 - 1
src/app/views/other-config/other-config.module.ts

@@ -7,7 +7,8 @@ import { ShareModule } from 'src/app/share/share.module';
7 7
 import { ConfigurationCategoryComponent } from 'src/app/components/configurationCenter/configuration-category/configuration-category.component';
8 8
 import { ConfigurationPriorityComponent } from 'src/app/components/configurationCenter/configuration-priority/configuration-priority.component';
9 9
 import { ConfigurationDictionaryComponent } from 'src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component';
10
-
10
+import { ConfigurationManHourComponent } from 'src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component';
11
+import { ConfigurationDeptUserComponent } from 'src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component';
11 12
 
12 13
 @NgModule({
13 14
   declarations: [
@@ -15,6 +16,8 @@ import { ConfigurationDictionaryComponent } from 'src/app/components/configurati
15 16
     ConfigurationCategoryComponent,
16 17
     ConfigurationPriorityComponent,
17 18
     ConfigurationDictionaryComponent,
19
+		ConfigurationManHourComponent,
20
+		ConfigurationDeptUserComponent,
18 21
   ],
19 22
   imports: [
20 23
     CommonModule,

+ 19 - 6
src/app/views/repository-manage-add/repository-manage-add.component.html

@@ -14,10 +14,15 @@
14 14
 						<input nz-input formControlName="title"  placeholder="请输入标题" nzSize="default" />
15 15
 				  </nz-form-control>
16 16
 				</nz-form-item>
17
-				<nz-form-item class="form-item">
17
+				
18
+				<nz-form-item class="form-item" *ngIf="add">
19
+				  <nz-form-label nzFor="content" [nzSm]="4" [nzXs]="24">内容</nz-form-label>
20
+					<app-wang-editor (changeContent)="changeContent($event)"></app-wang-editor>
21
+				</nz-form-item>
22
+				
23
+				<nz-form-item class="form-item" *ngIf="!add && isContentShow">
18 24
 				  <nz-form-label nzFor="content" [nzSm]="4" [nzXs]="24">内容</nz-form-label>
19
-					<app-wang-editor *ngIf="add || detailContent==''" (changeContent)="changeContent($event)"></app-wang-editor>
20
-					<app-wang-editor *ngIf="!add && detailContent" (changeContent)="changeContent($event)" [content]="detailContent"></app-wang-editor>
25
+					<app-wang-editor (changeContent)="changeContent($event)" [content]="detailContent"></app-wang-editor>
21 26
 				</nz-form-item>
22 27
 			</div>
23 28
 			
@@ -60,10 +65,18 @@
60 65
 				<nz-form-item class="form-item" *ngIf="classItem==1">
61 66
 				  <nz-form-label nzRequired nzFor="malfunction" [nzSm]="6" [nzXs]="24">关联故障现象</nz-form-label>
62 67
 				  <nz-form-control nzErrorTip="请选择关联故障现象!" [nzSm]="16" [nzXs]="24">
63
-						<nz-cascader [nzOptions]="malfunctionData" 
68
+					<!-- 	<nz-cascader [nzOptions]="malfunctionData" 
64 69
 							formControlName="malfunction" 
65 70
 							nzPlaceHolder="请选择关联故障现象">
66
-						</nz-cascader>
71
+						</nz-cascader> -->
72
+						<nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择故障现象" formControlName="malfunction" >
73
+						  <ng-container *ngFor="let option of malfunctionData">
74
+						    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
75
+						  </ng-container>
76
+						  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
77
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
78
+						  </nz-option>
79
+						</nz-select>
67 80
 				  </nz-form-control>
68 81
 				</nz-form-item>
69 82
 				
@@ -73,7 +86,7 @@
73 86
 				    <nz-input-group>
74 87
 							<nz-select (nzOnSearch)="changeInp($event)" nzServerSearch nzShowSearch nzPlaceHolder="请选择关联产品" formControlName="assetProductId">
75 88
 							  <ng-container *ngFor="let option of productData">
76
-							    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
89
+							    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name + '(' + option.brand + ')' + '(' + option.model + ')'" [nzValue]="option.id"></nz-option>
77 90
 							  </ng-container>
78 91
 							  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
79 92
 							    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...

+ 25 - 15
src/app/views/repository-manage-add/repository-manage-add.component.ts

@@ -68,6 +68,7 @@ export class RepositoryManageAddComponent implements OnInit {
68 68
   promptInfo: string; //操作结果提示信息
69 69
   promptModalShow: boolean; //操作提示框是否展示
70 70
   modal: boolean = false; //新增/编辑模态框
71
+	isContentShow: boolean = false; //显示富文本
71 72
   add: boolean; //true:新增;false:编辑
72 73
   validateForm: FormGroup; //新增/编辑表单
73 74
   coopId: number; //表格中执行操作的id
@@ -138,8 +139,8 @@ export class RepositoryManageAddComponent implements OnInit {
138 139
 				this.detailData = data
139 140
 				this.solutionNumber = data.solutionNumber
140 141
 				this.versionNumber = data.versionNumber
141
-				this.detailContent = data.content || null
142
-				this.editOrData = data.content || null
142
+				this.detailContent = data.content || ''
143
+				this.editOrData = data.content || ''
143 144
 				let item = this.dicData.find(i=>i.id == this.detailData.type.id)
144 145
 				if(item){
145 146
 					this.classItem = item.value
@@ -153,6 +154,7 @@ export class RepositoryManageAddComponent implements OnInit {
153 154
 				}
154 155
 				this.validateForm.controls.assetProductId.setValue(data.assetProductId || '');
155 156
 				this.isSpinning = false
157
+				this.isContentShow = true
156 158
 			});
157 159
 	}
158 160
 	getFile(){
@@ -218,11 +220,22 @@ export class RepositoryManageAddComponent implements OnInit {
218 220
 		this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
219 221
 		  let incidentCategoryList = res.data || [];
220 222
 		  incidentCategoryList = incidentCategoryList.map(v => ({...v, parentId: v.parent ? v.parent.id : undefined, label: v.category, value: v.id}));
221
-		  this.malfunctionData = this.tool.tranListToTreeDataLeaf(incidentCategoryList, undefined, "parentId");
223
+		  let arr = this.tool.tranListToTreeDataLeaf(incidentCategoryList, undefined, "parentId");
224
+			
225
+			for(let i of arr){
226
+				for(let t of i.children){
227
+					for(let x of t.children){
228
+						this.malfunctionData.push({
229
+							name:x.mutiCategory,
230
+							id:x.id
231
+						})
232
+					}
233
+				}
234
+			}
222 235
 			
223 236
 			if(this.detailData && this.detailData.categoryId){
224
-				let malfunctionId = this.tool.tranListToTreeDataFindIdsLeaf(this.malfunctionData,this.detailData.categoryId);
225
-				this.validateForm.controls.malfunction.setValue(malfunctionId);
237
+				// let malfunctionId = this.tool.tranListToTreeDataFindIdsLeaf(this.malfunctionData,this.detailData.categoryId);
238
+				this.validateForm.controls.malfunction.setValue(this.detailData.categoryId);
226 239
 			}
227 240
 		})
228 241
 	}
@@ -233,7 +246,7 @@ export class RepositoryManageAddComponent implements OnInit {
233 246
 		let data = {
234 247
 		  idx: 0,
235 248
 		  sum: 9999,
236
-		  inspection: {
249
+		  inspectionForm: {
237 250
 		    hosId: this.hosId
238 251
 		  },
239 252
 		};
@@ -253,6 +266,8 @@ export class RepositoryManageAddComponent implements OnInit {
253 266
 			this.dicData = res
254 267
 			if(!this.add){
255 268
 				this.getDetail()
269
+			}else{
270
+				this.isContentShow = true
256 271
 			}
257 272
 			if(this.optType=='upgrade'){
258 273
 				this.getDetail()
@@ -326,7 +341,7 @@ export class RepositoryManageAddComponent implements OnInit {
326 341
 			operationType: operationType
327 342
 	  };
328 343
 		if(this.classItem==1){
329
-			data.categoryId = this.validateForm.value.malfunction[2]
344
+			data.categoryId = this.validateForm.value.malfunction
330 345
 			delete data.inspectionForm
331 346
 		}else if(this.classItem==2){
332 347
 			data.inspectionForm.id = this.validateForm.value.polling
@@ -436,17 +451,12 @@ export class RepositoryManageAddComponent implements OnInit {
436 451
 		console.log(888,file)
437 452
 		let type = file.name.split('.')
438 453
 		const isPic = (type[1] === 'xlsx' || type[1] === 'pdf' || 
439
-		type[1] === 'xls' || type[1] === 'ppt' || type[1] === 'txt' ||
440
-		type[1] === 'doc' || type[1] === 'docx');
454
+		type[1] === 'xls' || type[1] === 'ppt' || type[1] === 'pptx' ||
455
+		type[1] === 'txt' || type[1] === 'doc' || type[1] === 'docx');
441 456
 		if (!isPic) {
442 457
 			this.message.error('只能上传PDF、word、ppt、excel、txt等文件类型格式!');
443
-			return;
458
+			return false;
444 459
 		}
445
-		const isLt4M = file.size / 1024 / 1024 < 10;
446
-		if (!isLt4M) {
447
-			this.message.error('图片大小不能大于10MB!');
448
-			return;
449
-		} 
450 460
 		this.fileData = this.fileData.concat(file);
451 461
 		return false;
452 462
 	};

+ 2 - 0
src/app/views/repository-manage/repository-manage.component.less

@@ -135,6 +135,7 @@
135 135
 					flex: 1;
136 136
 					font-size: 14px;
137 137
 					border-right: 1px solid #E9E9E9;
138
+					overflow-y: auto;
138 139
 					.item-left-list{
139 140
 						display: flex;
140 141
 						align-items: center;
@@ -191,6 +192,7 @@
191 192
 					flex: 1.6;
192 193
 					padding: 10px;
193 194
 					font-size: 14px;
195
+					overflow-y: auto;
194 196
 					.back-class{
195 197
 						color: red;
196 198
 						cursor: pointer;