Explorar el Código

工单日志完善

seimin hace 1 año
padre
commit
70b74adde9

+ 4 - 4
src/app/share/order-detail/order-detail.component.html

@@ -79,11 +79,11 @@
79 79
             </div>
80 80
           </div>
81 81
           <div class="info" nz-row>
82
-            <div nz-col nzSpan="6" *ngIf="orderInfo.inspectScore">
83
-              陪检方式:{{ orderInfo.inspectScore.inspectMode }}
84
-            </div>
85 82
             <div nz-col nzSpan="6" *ngIf="orderInfo.inspectUsers">
86
-              陪检人员:{{ orderInfo.inspectUsers }}
83
+              执行人员:{{ orderInfo.inspectUsers }}
84
+            </div>
85
+            <div nz-col nzSpan="6" *ngIf="orderInfo.inspectUsersNum">
86
+              执行人数:{{ orderInfo.inspectUsersNum }}
87 87
             </div>
88 88
           </div>
89 89
           <div class="info" nz-row *ngIf="orderInfo.urgentDetails">

+ 8 - 0
src/app/views/work-order-log/work-order-log-routing.module.ts

@@ -1,11 +1,19 @@
1 1
 import { NgModule } from '@angular/core';
2 2
 import { Routes, RouterModule } from '@angular/router';
3 3
 import { WorkOrderLogComponent } from './work-order-log.component';
4
+import { OrderDetailComponent } from 'src/app/share/order-detail/order-detail.component';
4 5
 
5 6
 
6 7
 const routes: Routes = [{
7 8
   path: '',
8 9
   component: WorkOrderLogComponent,
10
+  children: [
11
+    {
12
+      // 查看详情
13
+      path: 'orderDetail/:id',
14
+      component: OrderDetailComponent,
15
+    }
16
+  ]
9 17
 }];
10 18
 
11 19
 @NgModule({

+ 5 - 2
src/app/views/work-order-log/work-order-log.component.html

@@ -19,7 +19,8 @@
19 19
         </div>
20 20
       </div>
21 21
       <div nz-col nzXl='7' class="list-template__btns">
22
-        <button nz-button class="btn default" (click)='search()'>搜索</button>
22
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
23
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
23 24
       </div>
24 25
     </div>
25 26
     <div class="list-template__bottom">
@@ -50,7 +51,7 @@
50 51
             <td><button *ngIf="data.attachments" (click)="previewImageHandler(data.attachments)">查看图片</button><span *ngIf="!data.attachments">无</span></td>
51 52
             <td>
52 53
               <div class="coop">
53
-                <span (click)="del(data)">查看</span>
54
+                <span *ngIf="coopBtns.look" (click)="detail($event,data.workOrderId)">查看</span>
54 55
               </div>
55 56
             </td>
56 57
           </tr>
@@ -65,3 +66,5 @@
65 66
   </div>
66 67
 </div>
67 68
 <app-image-viewer [imageUrl]="imgs" hidden *ngIf="isPreview" [isPreviewNow]="true"></app-image-viewer>
69
+<!-- 查看详情 -->
70
+<router-outlet></router-outlet>

+ 18 - 5
src/app/views/work-order-log/work-order-log.component.ts

@@ -1,10 +1,10 @@
1 1
 import { Component, OnInit, ViewChild } from "@angular/core";
2
-import { ActivatedRoute } from "@angular/router";
2
+import { ActivatedRoute, Router } from "@angular/router";
3 3
 
4 4
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
5 5
 import { ToolService } from "../../services/tool.service";
6 6
 import { WorkOrderLogService } from './work-order-log.service';
7
-import { format } from 'date-fns';
7
+import { format, startOfDay, endOfDay } from 'date-fns';
8 8
 
9 9
 @Component({
10 10
   selector: "app-work-order-log",
@@ -18,6 +18,7 @@ export class WorkOrderLogComponent implements OnInit {
18 18
   })
19 19
   osComponentRef1: OverlayScrollbarsComponent;
20 20
   constructor(
21
+    private router: Router,
21 22
     private route: ActivatedRoute,
22 23
     private tool: ToolService,
23 24
     private workOrderLogService: WorkOrderLogService,
@@ -57,7 +58,7 @@ export class WorkOrderLogComponent implements OnInit {
57 58
   previewImageHandler(data) {
58 59
     this.isPreview = false;
59 60
     data = data || [];
60
-    this.imgs = data.map((v) => 'http://192.168.3.108/file' + v.relativeFilePath);
61
+    this.imgs = data.map((v) => location.origin + '/file' + v.relativeFilePath);
61 62
     this.isPreview = true;
62 63
   }
63 64
 
@@ -65,13 +66,25 @@ export class WorkOrderLogComponent implements OnInit {
65 66
   search() {
66 67
     this.getList(true);
67 68
   }
69
+  // 重置
70
+  reset() {
71
+    this.searchDto = {
72
+      dateRange: [],
73
+    }
74
+    this.search();
75
+  }
76
+  // 查看
77
+  detail(e, id) {
78
+    e.stopPropagation();
79
+    this.router.navigateByUrl("/main/workOrderLog/orderDetail/" + id);
80
+  }
68 81
   // 表格数据
69 82
   loading1 = false;
70 83
   getList(isResetPageIndex = false) {
71 84
     isResetPageIndex && (this.pageIndex = 1);
72 85
     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,
86
+      startTime: this.searchDto.dateRange[0] ? format(startOfDay(this.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : undefined,
87
+      endTime: this.searchDto.dateRange[1] ? format(endOfDay(this.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : undefined,
75 88
       logRemarks: this.searchDto.logRemarks,
76 89
       operation: this.operationList.find(v => v.id == this.searchDto.operation),
77 90
     }