瀏覽代碼

工单日志

seimin 1 年之前
父節點
當前提交
7479e6041f

+ 26 - 10
src/app/views/work-order-log/work-order-log.component.html

@@ -1,9 +1,24 @@
1
 <div class="list-template">
1
 <div class="list-template">
2
   <div class="list-template__content">
2
   <div class="list-template__content">
3
     <div class="list-template__top" nz-row>
3
     <div class="list-template__top" nz-row>
4
-      <div nz-col nzXl='6' class="list-template__searchBox">
4
+      <div nz-col nzXl='17' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">备注</span>:
7
+          <input nz-input class="formItem" placeholder="请输入备注" [(ngModel)]="searchDto.logRemarks" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">操作类型</span>:
11
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
12
+            nzPlaceHolder="请选择操作类型" [(ngModel)]="searchDto.operation">
13
+            <nz-option *ngFor="let option of operationList" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
14
+          </nz-select>
15
+        </div>
16
+        <div class="list-template__searchItem">
17
+          <span class="label">操作时间</span>:
18
+          <nz-range-picker [(ngModel)]="searchDto.dateRange"></nz-range-picker>
19
+        </div>
5
       </div>
20
       </div>
6
-      <div nz-col nzXl='18' class="list-template__btns">
21
+      <div nz-col nzXl='7' class="list-template__btns">
7
         <button nz-button class="btn default" (click)='search()'>搜索</button>
22
         <button nz-button class="btn default" (click)='search()'>搜索</button>
8
       </div>
23
       </div>
9
     </div>
24
     </div>
@@ -25,14 +40,14 @@
25
         </thead>
40
         </thead>
26
         <tbody>
41
         <tbody>
27
           <tr *ngFor="let data of listOfData;let index=index;">
42
           <tr *ngFor="let data of listOfData;let index=index;">
28
-            <td>{{ data.title }}</td>
29
-            <td>{{ data.taskNames }}</td>
30
-            <td>{{ data.deptNames }}</td>
31
-            <td>{{ data.type?.name }}</td>
32
-            <td>{{ data.type?.name }}</td>
33
-            <td>{{ data.type?.name }}</td>
34
-            <td>{{ data.type?.name }}</td>
35
-            <td>{{ data.type?.name }}</td>
43
+            <td>{{ data.gdcode }}</td>
44
+            <td>{{ data.createDept?.dept }}</td>
45
+            <td>{{ data.operation?.name }}</td>
46
+            <td>{{ data.username }}</td>
47
+            <td>{{ data.handoverUserid?.name }}</td>
48
+            <td>{{ data.operationTime }}</td>
49
+            <td>{{ data.logRemarks }}</td>
50
+            <td><button *ngIf="data.attachments" (click)="previewImageHandler(data.attachments)">查看图片</button><span *ngIf="!data.attachments">无</span></td>
36
             <td>
51
             <td>
37
               <div class="coop">
52
               <div class="coop">
38
                 <span (click)="del(data)">查看</span>
53
                 <span (click)="del(data)">查看</span>
@@ -49,3 +64,4 @@
49
     </div>
64
     </div>
50
   </div>
65
   </div>
51
 </div>
66
 </div>
67
+<app-image-viewer [imageUrl]="imgs" hidden *ngIf="isPreview" [isPreviewNow]="true"></app-image-viewer>

+ 30 - 0
src/app/views/work-order-log/work-order-log.component.ts

@@ -4,6 +4,7 @@ import { ActivatedRoute } from "@angular/router";
4
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
4
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
5
 import { ToolService } from "../../services/tool.service";
5
 import { ToolService } from "../../services/tool.service";
6
 import { WorkOrderLogService } from './work-order-log.service';
6
 import { WorkOrderLogService } from './work-order-log.service';
7
+import { format } from 'date-fns';
7
 
8
 
8
 @Component({
9
 @Component({
9
   selector: "app-work-order-log",
10
   selector: "app-work-order-log",
@@ -23,6 +24,9 @@ export class WorkOrderLogComponent implements OnInit {
23
   ) {}
24
   ) {}
24
 
25
 
25
   listOfData: any[] = []; //表格数据
26
   listOfData: any[] = []; //表格数据
27
+  searchDto: any = {
28
+    dateRange: [],
29
+  }
26
 
30
 
27
   hosId: any; //院区(搜索)
31
   hosId: any; //院区(搜索)
28
   pageIndex: number = 1; //页码
32
   pageIndex: number = 1; //页码
@@ -36,6 +40,25 @@ export class WorkOrderLogComponent implements OnInit {
36
     this.coopBtns = this.tool.initCoopBtns(this.route);
40
     this.coopBtns = this.tool.initCoopBtns(this.route);
37
     this.hosId = this.tool.getCurrentHospital().id;
41
     this.hosId = this.tool.getCurrentHospital().id;
38
     this.getList(true);
42
     this.getList(true);
43
+    this.getOperationList();
44
+  }
45
+
46
+  // 获取快捷类型
47
+  operationList: any[] = [];
48
+  getOperationList() {
49
+    this.workOrderLogService.getDictionary("gdOperate").subscribe((res) => {
50
+      this.operationList = res || [];
51
+    });
52
+  }
53
+
54
+  // 预览图片
55
+  imgs = [];
56
+  isPreview = false;
57
+  previewImageHandler(data) {
58
+    this.isPreview = false;
59
+    data = data || [];
60
+    this.imgs = data.map((v) => 'http://192.168.3.108/file' + v.relativeFilePath);
61
+    this.isPreview = true;
39
   }
62
   }
40
 
63
 
41
   // 搜索
64
   // 搜索
@@ -46,10 +69,17 @@ export class WorkOrderLogComponent implements OnInit {
46
   loading1 = false;
69
   loading1 = false;
47
   getList(isResetPageIndex = false) {
70
   getList(isResetPageIndex = false) {
48
     isResetPageIndex && (this.pageIndex = 1);
71
     isResetPageIndex && (this.pageIndex = 1);
72
+    let searchDto = {
73
+      startTime: this.searchDto.dateRange[0] ? format(this.searchDto.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
74
+      endTime: this.searchDto.dateRange[1] ? format(this.searchDto.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
75
+      logRemarks: this.searchDto.logRemarks,
76
+      operation: this.operationList.find(v => v.id == this.searchDto.operation),
77
+    }
49
     let data = {
78
     let data = {
50
       pageIndex: this.pageIndex,
79
       pageIndex: this.pageIndex,
51
       pageSize: this.pageSize,
80
       pageSize: this.pageSize,
52
       hosId: this.hosId,
81
       hosId: this.hosId,
82
+      searchDto,
53
     };
83
     };
54
     this.loading1 = true;
84
     this.loading1 = true;
55
     this.workOrderLogService
85
     this.workOrderLogService

+ 7 - 22
src/app/views/work-order-log/work-order-log.service.ts

@@ -1,6 +1,5 @@
1
 import { Injectable } from '@angular/core';
1
 import { Injectable } from '@angular/core';
2
 import { MainService } from 'src/app/services/main.service';
2
 import { MainService } from 'src/app/services/main.service';
3
-import { map } from 'rxjs/operators';
4
 
3
 
5
 @Injectable({
4
 @Injectable({
6
   providedIn: 'root'
5
   providedIn: 'root'
@@ -11,37 +10,23 @@ export class WorkOrderLogService {
11
   ) { }
10
   ) { }
12
 
11
 
13
   // 列表-查
12
   // 列表-查
14
-  query({pageIndex, pageSize, hosId}) {
13
+  query({pageIndex, pageSize, hosId, searchDto}) {
14
+    console.log(searchDto);
15
     let data = {
15
     let data = {
16
       idx: pageIndex - 1,
16
       idx: pageIndex - 1,
17
       sum: pageSize,
17
       sum: pageSize,
18
       record: {
18
       record: {
19
         hosId,
19
         hosId,
20
+        ...searchDto,
20
       },
21
       },
21
     };
22
     };
22
     return this.mainService.getFetchDataList("simple/data", "record", data);
23
     return this.mainService.getFetchDataList("simple/data", "record", data);
23
   }
24
   }
24
 
25
 
25
-  // 查询科室
26
-  // queryDept({hosId, keywords}){
27
-  //   let postData = {
28
-  //     department: {
29
-  //       simpleQuery: true,
30
-  //       hospital: {id: hosId},
31
-  //       dept: keywords,
32
-  //     },
33
-  //     idx: 0,
34
-  //     sum: 9999,
35
-  //   };
36
-  //   return this.mainService.getFetchDataList("data", "department", postData).pipe(map((v:any) => {
37
-  //     if(Array.isArray(v.list)){
38
-  //       v.list = v.list.map(vv => ({id: vv.id, name: vv.dept}));
39
-  //     }else{
40
-  //       v.list = [];
41
-  //     }
42
-  //     return v;
43
-  //   }));
44
-  // }
26
+  // 字典
27
+  getDictionary(type) {
28
+    return this.mainService.getDictionary("list", type);
29
+  }
45
 }
30
 }
46
 
31
 
47
 
32