瀏覽代碼

修复工时管理bug

maotao 8 月之前
父節點
當前提交
2309e21ef2

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

@@ -105,7 +105,7 @@
105 105
            <nz-form-label nzRequired nzFor="handleGroup" [nzSpan]="6">处理组</nz-form-label>
106 106
            <nz-form-control nzErrorTip="请选择处理组!" [nzSpan]="18">
107 107
              <nz-input-group>
108
-           		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理组" formControlName="handleGroup">
108
+           		<nz-select class="formItem" (ngModelChange)="changeGroup($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理组" formControlName="handleGroup">
109 109
            		  <ng-container *ngFor="let option of allUserGroup">
110 110
            		    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
111 111
            		  </ng-container>
@@ -131,7 +131,7 @@
131 131
           <nz-form-label nzRequired nzFor="handleUser" [nzSpan]="6">处理人</nz-form-label>
132 132
           <nz-form-control nzErrorTip="请选择处理人!" [nzSpan]="18">
133 133
             <nz-input-group>
134
-          		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp3($event)" nzServerSearch nzShowSearch nzPlaceHolder="请选择处理人" formControlName="handleUser">
134
+          		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理人" formControlName="handleUser">
135 135
           		  <ng-container *ngFor="let option of userData">
136 136
           		    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
137 137
           		  </ng-container>

+ 16 - 11
src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.ts

@@ -44,8 +44,8 @@ export class ConfigurationDeptUserComponent implements OnInit {
44 44
 			this.getDeparts(e);
45 45
 		});
46 46
 		this.searchParentUserSubject.pipe(debounceTime(500)).subscribe((e) => {
47
-			this.isDeptLoading = true;
48
-			this.getUser(e);
47
+			// this.isDeptLoading = true;
48
+			// this.getUser(e);
49 49
 		});
50 50
 		
51 51
     // 优先级
@@ -57,7 +57,7 @@ export class ConfigurationDeptUserComponent implements OnInit {
57 57
     this.getPriorityList();
58 58
 		this.getMalfunction()
59 59
 		this.getDeparts('')
60
-		this.getUser('');
60
+		// this.getUser('');
61 61
 		this.getGrop()
62 62
   }
63 63
 
@@ -90,9 +90,7 @@ export class ConfigurationDeptUserComponent implements OnInit {
90 90
 	  let data = {
91 91
 	    department: {
92 92
 	      dept,
93
-	      hospital: {
94
-	        id: this.hosId
95
-	      },
93
+				cascadeHosId: this.currentHospital.id,
96 94
 	    },
97 95
 	    idx: 0,
98 96
 	    sum: 20,
@@ -136,6 +134,12 @@ export class ConfigurationDeptUserComponent implements OnInit {
136 134
 		})
137 135
 	}
138 136
 	
137
+	// 选择处理组
138
+	changeGroup(e){
139
+		this.validatePriorityForm.controls.handleUser.setValue(null)
140
+		this.getUser(e)
141
+	}
142
+	
139 143
 	// 获取处理组
140 144
 	getGrop(){
141 145
 		let groupData = {
@@ -154,13 +158,14 @@ export class ConfigurationDeptUserComponent implements OnInit {
154 158
 	}
155 159
 	
156 160
 	// 获取处理人
157
-	getUser(name){
161
+	getUser(groupId){
158 162
 		let data = {
159 163
 			idx: 0,
160
-			sum: 20,
164
+			sum: 9999,
161 165
 			user: {
162
-				name:name,
166
+				// name:name,
163 167
 				hospital: { id: this.hosId || "" },
168
+				groupdata:{id:groupId || ""}
164 169
 			},
165 170
 		};
166 171
 		this.mainService
@@ -218,7 +223,7 @@ export class ConfigurationDeptUserComponent implements OnInit {
218 223
     console.log(this.validatePriorityForm.value);
219 224
     this.btnLoading = true;
220 225
     let postData:any = {};
221
-		let malfunction = this.validatePriorityForm.value.malfunction
226
+		let malfunction = this.validatePriorityForm.value.malfunction?this.validatePriorityForm.value.malfunction:[]
222 227
     if (this.add) {
223 228
       //增加
224 229
       postData = {
@@ -273,7 +278,7 @@ export class ConfigurationDeptUserComponent implements OnInit {
273 278
 			  malfunction: [this.validatePriorityForm.value.malfunction, []],//故障
274 279
 			  handleGroup: [this.validatePriorityForm.value.handleGroup, [Validators.required]],//处理组
275 280
 				binding:['0',[Validators.required]],//是否绑定人员
276
-			  handleUser: [this.validatePriorityForm.value.handleUser, []],//处理人
281
+			  handleUser: [null, []],//处理人
277 282
 			});
278 283
 		}
279 284
 	}

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

@@ -104,5 +104,5 @@
104 104
 
105 105
 <!-- 删除模态框 -->
106 106
 <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" 
107
-  (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="确定要删除吗?" confirmTxt="是" cancelTxt="否">
107
+  (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" [content]="delContent" confirmTxt="是" cancelTxt="否">
108 108
 </app-dialog-delete>

+ 18 - 3
src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.ts

@@ -95,9 +95,8 @@ export class ConfigurationManHourComponent implements OnInit {
95 95
   activeCategory1:any = {};
96 96
   activeCategory2:any = {};
97 97
   activeCategory3:any = {};
98
-	listType:any = 1;
99 98
   clickCategory(item, type:number){
100
-		this.listType = type
99
+		this.coopType = type
101 100
     switch(type){
102 101
       case 1:
103 102
         this.categoryList2 = [];
@@ -135,11 +134,21 @@ export class ConfigurationManHourComponent implements OnInit {
135 134
 	confirmDel() {
136 135
 	  let that = this;
137 136
 	  that.btnLoading = true;
137
+		let delId = null
138
+		console.log(222,this.coopType)
139
+		if(this.coopType==1){
140
+			delId = this.activeCategory1.id
141
+		}else{
142
+			delId = this.activeCategory2.id
143
+		}
138 144
 	  that.mainService
139
-	    .coopTypeConfig('rmvData', 'workHourManagement', [this['activeCategory' + this.listType].id])
145
+	    .coopTypeConfig('rmvData', 'workHourManagement', [delId])
140 146
 	    .subscribe((data) => {
141 147
 	      that.btnLoading = false;
142 148
 	      that.hideDelModal();
149
+				if(this.coopType==1){
150
+					this.categoryList2 = []
151
+				}
143 152
 	      if (data["status"] == 200) {
144 153
 	        that.showPromptModal("删除", true, "");
145 154
 	      } else {
@@ -198,7 +207,13 @@ export class ConfigurationManHourComponent implements OnInit {
198 207
 	
199 208
 	// 删除工时
200 209
 	delModal: boolean = false; //删除模态框
210
+	delContent: string = null; //删除模态框
201 211
 	delCategoryModal(type:number){
212
+		if(type==1){
213
+			this.delContent = '此操作会删除当前大类下的小类,确定要删除吗?'
214
+		}else{
215
+			this.delContent = '确定要删除吗?'
216
+		}
202 217
 		this.coopType = type;
203 218
 		this.delModal = true
204 219
 	}

+ 7 - 3
src/app/share/wang-editor/wang-editor.component.ts

@@ -71,6 +71,8 @@ export class wangEditorComponent implements OnInit {
71 71
 					this.isLoading = false
72 72
 					let url = location.origin + '/file' + res.body.data.relativeFilePath
73 73
 					insertImgFn(url,url,url)
74
+				}else if(res.status==500 && res.body){
75
+					this.message.error(res.body.error)
74 76
 				}
75 77
 			});
76 78
 		}
@@ -94,6 +96,8 @@ export class wangEditorComponent implements OnInit {
94 96
 					this.isLoading = false
95 97
 					let url = location.origin + '/file' + res.body.data.relativeFilePath
96 98
 					insertVideoFn(url)
99
+				}else if(res.status==500 && res.body){
100
+					this.message.error(res.body.error)
97 101
 				}
98 102
 			});
99 103
 		}
@@ -117,19 +121,19 @@ export class wangEditorComponent implements OnInit {
117 121
 	      'italic',  // 斜体
118 122
 	      'underline',  // 下划线
119 123
 	      'head',  // 标题
124
+				'image',  // 插入图片
125
+				'video',  // 插入视频
120 126
 	      'fontName',  // 字体
121 127
 	      'fontSize',  // 字号
122 128
 	      'strikeThrough',  // 删除线
123 129
 	      'foreColor',  // 文字颜色
124 130
 	      'backColor',  // 背景颜色
125
-	      'link',  // 插入链接
131
+	      // 'link',  // 插入链接
126 132
 	      'list',  // 列表
127 133
 	      'justify',  // 对齐方式
128 134
 	      'quote',  // 引用
129 135
 	      // 'emoticon',  // 表情
130 136
 	      // 'table',  // 表格
131
-	      'image',  // 插入图片
132
-	      'video',  // 插入视频
133 137
 	      // 'code',  // 插入代码
134 138
 	      'undo',  // 撤销
135 139
 	      'redo'  // 重复

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

@@ -9,19 +9,19 @@
9 9
 				</nz-form-item>
10 10
 				
11 11
 				<nz-form-item class="form-item">
12
-				  <nz-form-label nzRequired nzFor="title" [nzSm]="4" [nzXs]="24">标题</nz-form-label>
13
-				  <nz-form-control nzErrorTip="请输入标题!" [nzSm]="20" [nzXs]="24">
12
+				  <nz-form-label nzRequired nzFor="title" [nzSm]="2" [nzXs]="24">标题</nz-form-label>
13
+				  <nz-form-control nzErrorTip="请输入标题!" [nzSm]="22" [nzXs]="24">
14 14
 						<input nz-input formControlName="title"  placeholder="请输入标题" nzSize="default" />
15 15
 				  </nz-form-control>
16 16
 				</nz-form-item>
17 17
 				
18 18
 				<nz-form-item class="form-item" *ngIf="add">
19
-				  <nz-form-label nzFor="content" [nzSm]="4" [nzXs]="24">内容</nz-form-label>
19
+				  <nz-form-label nzFor="content" [nzSm]="2" [nzXs]="24">内容</nz-form-label>
20 20
 					<app-wang-editor (changeContent)="changeContent($event)"></app-wang-editor>
21 21
 				</nz-form-item>
22 22
 				
23 23
 				<nz-form-item class="form-item" *ngIf="!add && isContentShow">
24
-				  <nz-form-label nzFor="content" [nzSm]="4" [nzXs]="24">内容</nz-form-label>
24
+				  <nz-form-label nzFor="content" [nzSm]="2" [nzXs]="24">内容</nz-form-label>
25 25
 					<app-wang-editor (changeContent)="changeContent($event)" [content]="detailContent"></app-wang-editor>
26 26
 				</nz-form-item>
27 27
 			</div>
@@ -39,7 +39,7 @@
39 39
 				
40 40
 				<nz-form-item class="form-item">
41 41
 				  <nz-form-label nzRequired nzFor="knowledgeClass" [nzSm]="6" [nzXs]="24">知识分类</nz-form-label>
42
-					<nz-form-control nzErrorTip="请选择!" [nzSm]="16" [nzXs]="24">
42
+					<nz-form-control nzErrorTip="请选择!" [nzSm]="24" [nzXs]="24">
43 43
 						<nz-radio-group formControlName="knowledgeClass" (ngModelChange)="radioChnage($event)">
44 44
 						  <label nz-radio [nzValue]="item.id" *ngFor="let item of dicData">{{item.name}}</label>
45 45
 						</nz-radio-group>

+ 1 - 1
src/app/views/repository-manage-add/repository-manage-add.component.less

@@ -84,7 +84,7 @@ h3{
84 84
 		}
85 85
 		.form-title-box{
86 86
 			display: flex;
87
-			margin-left: 94px;
87
+			margin-left: 13px;
88 88
 			.form-title{
89 89
 				color: #000;
90 90
 				margin-right: 40px;

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

@@ -170,6 +170,9 @@ export class RepositoryManageAddComponent implements OnInit {
170 170
 							token:i.token
171 171
 						}
172 172
 					})
173
+				}else{
174
+					this.fileAllData = []
175
+					this.fileData = []
173 176
 				}
174 177
 			});
175 178
 	}
@@ -395,21 +398,16 @@ export class RepositoryManageAddComponent implements OnInit {
395 398
 	// 上传图片
396 399
 	uploadFile(id){
397 400
 		let url = `/service/common/common/uploadAttachment/solution/${id}/${id}`
398
-		const formData = new FormData()
399 401
 		for(let i of this.fileData){//新上传的附件
402
+			const formData = new FormData()
400 403
 			let item = this.fileAllData.find(t=>t.id == i.uid) //之前的附件
401 404
 			if(!item){
402
-				if(i.originFileObj){
403
-					formData.append('file', i.originFileObj);
404
-					formData.append('filename', i.originFileObj.name);
405
-				}else{
406
-					formData.append('file', i as any);
407
-					formData.append('filename', i.name);
408
-				}
405
+				formData.append('file', i as any);
406
+				formData.append('filename', i.name);
409 407
 				
410 408
 				const req = new HttpRequest('POST', url, formData, {
411
-					reportProgress: true,
412
-					withCredentials: true
409
+					reportProgress: false,
410
+					withCredentials: false
413 411
 				});
414 412
 				this.http.request(req).subscribe((res) => {
415 413
 				    
@@ -448,11 +446,12 @@ export class RepositoryManageAddComponent implements OnInit {
448 446
   }
449 447
 	
450 448
 	beforeUpload = (file: UploadFile) => {
451
-		console.log(888,file)
452
-		let type = file.name.split('.')
453
-		const isPic = (type[1] === 'xlsx' || type[1] === 'pdf' || 
454
-		type[1] === 'xls' || type[1] === 'ppt' || type[1] === 'pptx' ||
455
-		type[1] === 'txt' || type[1] === 'doc' || type[1] === 'docx');
449
+		let index = file.name.lastIndexOf('.')
450
+		let type = file.name.slice(index + 1)
451
+		console.log('type===',type)
452
+		const isPic = (type === 'xlsx' || type === 'pdf' || 
453
+		type === 'xls' || type === 'ppt' || type === 'pptx' ||
454
+		type === 'txt' || type === 'doc' || type === 'docx');
456 455
 		if (!isPic) {
457 456
 			this.message.error('只能上传PDF、word、ppt、excel、txt等文件类型格式!');
458 457
 			return false;
@@ -462,8 +461,7 @@ export class RepositoryManageAddComponent implements OnInit {
462 461
 	};
463 462
 	
464 463
 	// 删除附件
465
-	removeFile = (file) =>  {
466
-		console.log(111,file)
464
+	removeFile = (file:any) =>  {
467 465
 		let item = this.fileAllData.find(i=>i.id == file.uid)
468 466
 		let index = this.fileData.findIndex(i=>i.uid == file.uid)
469 467
 		if(item){ //附件在数据库
@@ -475,7 +473,6 @@ export class RepositoryManageAddComponent implements OnInit {
475 473
 					} 
476 474
 				});
477 475
 		}else{//附件不在数据库
478
-			console.log(555, index)
479 476
 			if(index!=-1){
480 477
 				this.fileData.splice(index, 1)
481 478
 			}

+ 4 - 4
src/app/views/repository-manage/repository-manage.component.html

@@ -101,15 +101,15 @@
101 101
 						 </div>
102 102
 					 </div>
103 103
 				 </div>
104
-				 <div class="view-item right-box" *ngIf="lookData&&lookData.title"> 
104
+				 <div class="view-item right-box" *ngIf="solutionLogs"> 
105 105
 					 <nz-steps [nzCurrent]="stepLength" nzDirection="vertical" nzSize="small">
106
-						<ng-container *ngFor="let item of lookData.solutionLogs; let index = index">
106
+						<ng-container *ngFor="let item of solutionLogs; let index = index">
107 107
 						    <nz-step
108 108
 						      [nzDescription]="tpl"
109 109
 						    >
110 110
 						    </nz-step>
111 111
 						    <ng-template #tpl>
112
-									<div *ngIf="index==lookData.solutionLogs.length-1" class="step-size">
112
+									<div *ngIf="index==solutionLogs.length-1" class="step-size">
113 113
 										<div>
114 114
 											<span style="color: #49B856;">{{item.operationStatus.name}}</span>
115 115
 											&nbsp;&nbsp;&nbsp;
@@ -118,7 +118,7 @@
118 118
 										<div style="color:#333;">{{ item.time }}</div>
119 119
 										<div class="back-class" nz-tooltip [nzTooltipTitle]="item.rejectedReason" *ngIf="item.operationStatus.name=='审核驳回'">(驳回原因)</div>
120 120
 									</div>
121
-									<div *ngIf="index!=lookData.solutionLogs.length-1" class="step-size">
121
+									<div *ngIf="index!=solutionLogs.length-1" class="step-size">
122 122
 										<div>
123 123
 											<span>{{item.operationStatus.name}}</span>
124 124
 											&nbsp;&nbsp;&nbsp;

+ 5 - 3
src/app/views/repository-manage/repository-manage.component.ts

@@ -84,6 +84,7 @@ export class RepositoryManageComponent implements OnInit {
84 84
 	editModal:boolean = false; //编辑时弹框
85 85
 	isSpinning: boolean = false; //页面loading状态
86 86
 	detailData:any;
87
+	solutionLogs:any;
87 88
 	lookData:any;
88 89
 	versionsData: any = []; //审核版本数据
89 90
 	fileData: any = []; //上传的附件数据
@@ -184,7 +185,6 @@ export class RepositoryManageComponent implements OnInit {
184 185
 	versionsClick(data, index){
185 186
 		this.vIndex = index
186 187
 		this.lookData = data
187
-		this.stepLength = this.lookData.solutionLogs.length
188 188
 		let content = data.content
189 189
 		if(content){
190 190
 			this.richText = this.sanitizer.bypassSecurityTrustHtml(content);
@@ -329,7 +329,8 @@ export class RepositoryManageComponent implements OnInit {
329 329
 					}
330 330
 				}
331 331
 				this.lookData = data[0]
332
-				this.stepLength = this.lookData.solutionLogs.length
332
+				this.solutionLogs = data[0].solutionLogs
333
+				this.stepLength = this.solutionLogs.length
333 334
 				this.isSpinning = false
334 335
 			});
335 336
 	}
@@ -377,7 +378,8 @@ export class RepositoryManageComponent implements OnInit {
377 378
 					i.time = format(i.operationTime, 'yyyy-MM-dd HH:mm') 
378 379
 				}
379 380
 				this.lookData = data[0]
380
-				this.stepLength = this.lookData.solutionLogs.length
381
+				this.solutionLogs = data[0].solutionLogs
382
+				this.stepLength = this.solutionLogs.length
381 383
 				this.isSpinning = false
382 384
 			});
383 385