|
@@ -17,12 +17,13 @@ import http from "../../../assets/js/http";
|
17
|
17
|
import { MainService } from "../../services/main.service";
|
18
|
18
|
import { WebsocketNurseService } from "../../services/websocket-nurse.service";
|
19
|
19
|
|
20
|
|
-import { NzMessageService } from "ng-zorro-antd";
|
|
20
|
+import { NzMessageService, UploadFile } from "ng-zorro-antd";
|
21
|
21
|
import { NzNotificationService } from "ng-zorro-antd/notification";
|
22
|
22
|
import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
|
23
|
23
|
import { ToolService } from "../../services/tool.service";
|
24
|
24
|
import { Subject } from "rxjs";
|
25
|
|
-import { debounceTime } from "rxjs/operators";
|
|
25
|
+import { debounceTime, filter } from "rxjs/operators";
|
|
26
|
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
|
26
|
27
|
import {
|
27
|
28
|
format,
|
28
|
29
|
getMinutes,
|
|
@@ -127,7 +128,9 @@ export class HushijiandanComponent implements OnInit {
|
127
|
128
|
private mainService: MainService,
|
128
|
129
|
private notification: NzNotificationService,
|
129
|
130
|
private webs: WebsocketNurseService,
|
130
|
|
- public tool: ToolService
|
|
131
|
+ public tool: ToolService,
|
|
132
|
+ public http: HttpClient
|
|
133
|
+
|
131
|
134
|
) {
|
132
|
135
|
this.othersListOptions = {
|
133
|
136
|
onUpdate: (event: any) => {
|
|
@@ -310,7 +313,78 @@ export class HushijiandanComponent implements OnInit {
|
310
|
313
|
this.coopBtns = coopBtns;
|
311
|
314
|
console.log(this.coopBtns);
|
312
|
315
|
}
|
313
|
|
-
|
|
316
|
+
|
|
317
|
+ // 预览图片
|
|
318
|
+ imgs = [];
|
|
319
|
+ isPreview = false;
|
|
320
|
+ initialViewIndex:number = 0;
|
|
321
|
+ previewImageHandler(data = [], index = 0) {
|
|
322
|
+ this.initialViewIndex = index;
|
|
323
|
+ console.log(index)
|
|
324
|
+ this.isPreview = false;
|
|
325
|
+ data = data || [];
|
|
326
|
+ this.imgs = data.map((v) => location.origin + '/file' + v.relativeFilePath);
|
|
327
|
+ setTimeout(() => {
|
|
328
|
+ this.isPreview = true;
|
|
329
|
+ }, 0)
|
|
330
|
+ }
|
|
331
|
+
|
|
332
|
+ // 图片相关
|
|
333
|
+ showUploadList = {
|
|
334
|
+ showPreviewIcon: true,
|
|
335
|
+ showRemoveIcon: true,
|
|
336
|
+ hidePreviewIconInNonImage: true
|
|
337
|
+ };
|
|
338
|
+ fileList = [
|
|
339
|
+ // {
|
|
340
|
+ // uid: -1,
|
|
341
|
+ // name: 'xxx.png',
|
|
342
|
+ // status: '1',
|
|
343
|
+ // url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
|
|
344
|
+ // }
|
|
345
|
+ ];
|
|
346
|
+ previewImage: string | undefined = '';
|
|
347
|
+ previewVisible = false;
|
|
348
|
+ repairImgs:any[] = [];//报修图片
|
|
349
|
+ handlePreview = (file: UploadFile) => {
|
|
350
|
+ console.log('file1:', file)
|
|
351
|
+ this.previewImage = file.url || file.thumbUrl;
|
|
352
|
+ this.previewVisible = true;
|
|
353
|
+ };
|
|
354
|
+
|
|
355
|
+ beforeUpload = (file: UploadFile): boolean => {
|
|
356
|
+ console.log('file2:', file)
|
|
357
|
+ this.fileList = [...this.fileList, file];
|
|
358
|
+ setTimeout(async () => {
|
|
359
|
+ file.url = await this.getBase64(file);
|
|
360
|
+ }, 0);
|
|
361
|
+ console.log('this.fileList:', this.fileList)
|
|
362
|
+ return true;
|
|
363
|
+ };
|
|
364
|
+
|
|
365
|
+ getBase64(file: any): Promise<any> {
|
|
366
|
+ return new Promise((resolve, reject) => {
|
|
367
|
+ const reader = new FileReader();
|
|
368
|
+ reader.readAsDataURL(file);
|
|
369
|
+ reader.onload = () => resolve(reader.result);
|
|
370
|
+ reader.onerror = error => reject(error);
|
|
371
|
+ });
|
|
372
|
+ }
|
|
373
|
+
|
|
374
|
+ // 临时上传图片
|
|
375
|
+ temporarilyUrl = this.mainService.returnUploadUrl('wechatRequesterIncident', 0);
|
|
376
|
+
|
|
377
|
+ // 图片上传
|
|
378
|
+ uploadImages(file, id){
|
|
379
|
+ const formData = new FormData();
|
|
380
|
+ formData.append('file', file);
|
|
381
|
+ formData.append('fileName', file.name);
|
|
382
|
+ const req = new HttpRequest('Post', this.mainService.returnUploadUrl('wechatRequesterIncident', id), formData, {
|
|
383
|
+ reportProgress: true
|
|
384
|
+ });
|
|
385
|
+ return this.http.request(req).pipe(filter(e => e instanceof HttpResponse)).toPromise();
|
|
386
|
+ }
|
|
387
|
+
|
314
|
388
|
// 获取任务类型(病理标本)
|
315
|
389
|
taskTypeData:any;
|
316
|
390
|
getTaskTypesId() {
|
|
@@ -1489,11 +1563,13 @@ export class HushijiandanComponent implements OnInit {
|
1489
|
1563
|
}).messageId;
|
1490
|
1564
|
this.bxModal = true;
|
1491
|
1565
|
this.coopBx = data || {};
|
|
1566
|
+ this.fileList = [];
|
1492
|
1567
|
this.initBxForm(this.coopBx.content);
|
1493
|
1568
|
}
|
1494
|
1569
|
// 隐藏模态框
|
1495
|
1570
|
hideBxModal() {
|
1496
|
1571
|
this.bxModal = false;
|
|
1572
|
+ this.fileList = [];
|
1497
|
1573
|
}
|
1498
|
1574
|
// 确认
|
1499
|
1575
|
confirmBx() {
|
|
@@ -1554,7 +1630,7 @@ export class HushijiandanComponent implements OnInit {
|
1554
|
1630
|
}
|
1555
|
1631
|
this.mainService.getDictionary("list", "incident_source").subscribe((source:any) => {
|
1556
|
1632
|
let incidentSourceList = source || [];
|
1557
|
|
- let im = incidentSourceList.find(v => v.value === 'im');
|
|
1633
|
+ let pc = incidentSourceList.find(v => v.value === 'pc');
|
1558
|
1634
|
this.mainService.getDictionary("list", "repair_incident_type").subscribe((result) => {
|
1559
|
1635
|
let repairIncidentTypeList = result || [];
|
1560
|
1636
|
let repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
|
|
@@ -1569,7 +1645,7 @@ export class HushijiandanComponent implements OnInit {
|
1569
|
1645
|
contacts: this.validateBxForm.value.contacts,
|
1570
|
1646
|
contactsInformation: this.validateBxForm.value.contactsInformation,
|
1571
|
1647
|
hosId: this.deptDto.hospital.id,
|
1572
|
|
- source: im,
|
|
1648
|
+ source: pc,
|
1573
|
1649
|
fromWx: true,
|
1574
|
1650
|
requester: this.loginUser,
|
1575
|
1651
|
acceptUser: this.loginUser,
|
|
@@ -1587,6 +1663,13 @@ export class HushijiandanComponent implements OnInit {
|
1587
|
1663
|
this.bxModal = false;
|
1588
|
1664
|
this.hideReqModal();
|
1589
|
1665
|
if ((res as any).state == 200) {
|
|
1666
|
+ // 图片上传
|
|
1667
|
+ if(this.fileList.length){
|
|
1668
|
+ console.log(this.fileList.map(v => v.originFileObj));
|
|
1669
|
+ this.fileList.map(v => v.originFileObj).forEach(async file => {
|
|
1670
|
+ await this.uploadImages(file, res.data.id);
|
|
1671
|
+ })
|
|
1672
|
+ }
|
1590
|
1673
|
this.showPromptModal("提交", true, "");
|
1591
|
1674
|
this.checkTable("bxlb");
|
1592
|
1675
|
} else {
|
|
@@ -2975,6 +3058,8 @@ export class HushijiandanComponent implements OnInit {
|
2975
|
3058
|
currentTasktype; //当前选中的任务类型对象
|
2976
|
3059
|
cLoading = false;
|
2977
|
3060
|
historyCustomRemarks2 = [];
|
|
3061
|
+ isStartFixedType:boolean = false;
|
|
3062
|
+ isEndFixedType:boolean = false;
|
2978
|
3063
|
changeCheckedType(isInit = false) {
|
2979
|
3064
|
isInit && (this.inspectToday = new Date());
|
2980
|
3065
|
this.customRemarks2 = [];
|
|
@@ -3038,6 +3123,20 @@ export class HushijiandanComponent implements OnInit {
|
3038
|
3123
|
this.maskFlag = false;
|
3039
|
3124
|
this.patientModal = true;
|
3040
|
3125
|
that.checkedShowMsg = data;
|
|
3126
|
+ if(data.end){
|
|
3127
|
+ if(data.end.end.departmentStrategy==202){
|
|
3128
|
+ this.isEndFixedType = true
|
|
3129
|
+ }else{
|
|
3130
|
+ this.isEndFixedType = false
|
|
3131
|
+ }
|
|
3132
|
+ }
|
|
3133
|
+ if(data.start){
|
|
3134
|
+ if(data.start.start.departmentStrategy==202){
|
|
3135
|
+ this.isStartFixedType = true
|
|
3136
|
+ }else{
|
|
3137
|
+ this.isStartFixedType = false
|
|
3138
|
+ }
|
|
3139
|
+ }
|
3041
|
3140
|
if (that.checkedShowMsg.status != 200) {
|
3042
|
3141
|
that.isRemand = data.isRemand == 1 ? true : false;
|
3043
|
3142
|
}
|
|
@@ -3305,6 +3404,20 @@ export class HushijiandanComponent implements OnInit {
|
3305
|
3404
|
.subscribe((result) => {
|
3306
|
3405
|
this.buildMsg = result;
|
3307
|
3406
|
if (result.remarksSwitch == 1) {
|
|
3407
|
+ if(result.end){
|
|
3408
|
+ if(result.end.end.departmentStrategy==202){
|
|
3409
|
+ this.isEndFixedType = true
|
|
3410
|
+ }else{
|
|
3411
|
+ this.isEndFixedType = false
|
|
3412
|
+ }
|
|
3413
|
+ }
|
|
3414
|
+ if(result.start){
|
|
3415
|
+ if(result.start.start.departmentStrategy==202){
|
|
3416
|
+ this.isStartFixedType = true
|
|
3417
|
+ }else{
|
|
3418
|
+ this.isStartFixedType = false
|
|
3419
|
+ }
|
|
3420
|
+ }
|
3308
|
3421
|
if (result.customRemarks === null || result.customRemarks === "") {
|
3309
|
3422
|
this.customRemarks = [];
|
3310
|
3423
|
} else {
|