seimin 2 тижнів тому
батько
коміт
fc6d20f020

+ 6 - 0
src/app/services/main.service.ts

@@ -516,6 +516,12 @@ export class MainService {
516 516
       headers: this.headers,
517 517
     });
518 518
   }
519
+  //数据核对-原始数据
520
+  queryDataSource(data = {}) {
521
+    return this.http.post(host.host + "/testData/queryDataSource", data, {
522
+      headers: this.headers,
523
+    });
524
+  }
519 525
   // 更新,新增,删除检查类型设置
520 526
   upDictionary(data) {
521 527
     return this.http.post(host.host + "/common/common/upDictionary", data, {

+ 11 - 3
src/app/views/info-search/info-search.component.html

@@ -1,7 +1,7 @@
1 1
 <div class="list-template">
2 2
   <div class="list-template__content">
3 3
     <div class="list-template__top" nz-row>
4
-      <div nz-col nzXl='16' class="list-template__searchBox">
4
+      <div nz-col nzXl='17' class="list-template__searchBox">
5 5
         <div class="list-template__searchItem">
6 6
           <span class="label">编码:</span>
7 7
           <input nz-input class="formItem" placeholder="请输入编码" [(ngModel)]="searchCriteria.id" />
@@ -9,7 +9,7 @@
9 9
         <div class="list-template__searchItem">
10 10
           <span class="label">类型:</span>
11 11
           <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzPlaceHolder="请选择类型"
12
-            [(ngModel)]="searchCriteria.target">
12
+            [(ngModel)]="searchCriteria.target" (ngModelChange)="changeTarget($event)">
13 13
             <ng-container *ngFor="let data of typeList">
14 14
               <nz-option *ngIf="!isLoading" nzLabel="{{data.name}}" nzValue="{{data.type}}"></nz-option>
15 15
             </ng-container>
@@ -18,8 +18,16 @@
18 18
             </nz-option>
19 19
           </nz-select>
20 20
         </div>
21
+        <div class="list-template__searchItem" *ngIf="searchCriteria.target === 'dataSource'">
22
+          <span class="label">时间范围</span>:
23
+          <nz-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
24
+        </div>
25
+        <div class="list-template__searchItem" *ngIf="searchCriteria.target === 'dataSource'">
26
+          <span class="label">业务标识:</span>
27
+          <input nz-input class="formItem" placeholder="请输入业务标识" [(ngModel)]="searchCriteria.busiType" />
28
+        </div>
21 29
       </div>
22
-      <div nz-col nzXl="8" class="list-template__btns">
30
+      <div nz-col nzXl="7" class="list-template__btns">
23 31
         <button nz-button class="btn default" (click)='reset()'>重置</button>
24 32
         <button nz-button class="btn default ml8" (click)='getList()'>搜索</button>
25 33
       </div>

+ 50 - 11
src/app/views/info-search/info-search.component.ts

@@ -2,6 +2,7 @@ import { Component, OnInit } from "@angular/core";
2 2
 import { MainService } from "src/app/services/main.service";
3 3
 import { ToolService } from "src/app/services/tool.service";
4 4
 import { NzModalService, NzMessageService } from "ng-zorro-antd";
5
+import { startOfDay, endOfDay, format } from 'date-fns';
5 6
 
6 7
 @Component({
7 8
   selector: "app-info-search",
@@ -16,10 +17,13 @@ export class InfoSearchComponent implements OnInit {
16 17
     private message: NzMessageService,
17 18
   ) {}
18 19
 
20
+  dateRange: any = []; //时间范围
21
+
19 22
   searchCriteria = {
20 23
     //搜索条件
21 24
     id: "", //编码
22 25
     target: "order", //类型
26
+    busiType: "", //业务标识
23 27
   };
24 28
   typeList = [
25 29
     {
@@ -57,12 +61,20 @@ export class InfoSearchComponent implements OnInit {
57 61
       panel.active = !panel.active;
58 62
     }
59 63
   }
64
+  // 日期选择
65
+  onCalendarChangeDate(dateArr){
66
+    if(dateArr.length == 2){
67
+      this.dateRange = [startOfDay(dateArr[0]), endOfDay(dateArr[1])];
68
+    }
69
+  }
60 70
   // 重置
61 71
   reset() {
72
+    this.dateRange = [];
62 73
     this.searchCriteria = {
63 74
       //搜索条件
64 75
       id: "",
65 76
       target: "order",
77
+      busiType: "",
66 78
     };
67 79
     this.getList();
68 80
   }
@@ -167,21 +179,48 @@ export class InfoSearchComponent implements OnInit {
167 179
       list: [],
168 180
     },
169 181
   ];
182
+  // 修改类型
183
+  changeTarget(e){
184
+    this.searchCriteria.id = '';
185
+    this.searchCriteria.busiType = '';
186
+    this.dateRange = [];
187
+  }
170 188
   // 获取数据
171 189
   getList() {
172 190
     this.loading1 = true;
173
-    let id = this.searchCriteria.id || "dsadmin";
174
-    console.log(id);
175
-    this.mainService
176
-      .infoSearch(this.searchCriteria.target, id)
177
-      .subscribe((result) => {
178
-        this.panels = this.panelsClone;
179
-        this.loading1 = false;
180
-        this.panels.forEach((item) => {
181
-          item.list = result[item.extra] || [];
191
+    console.log(this.dateRange)
192
+    if(this.searchCriteria.target == 'dataSource'){
193
+      // 原始数据
194
+      let postData = {
195
+        content: this.searchCriteria.id,
196
+        busiType: this.searchCriteria.busiType,
197
+        startTime: this.dateRange.length ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
198
+        endTime: this.dateRange.length ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
199
+      }
200
+      this.mainService
201
+        .queryDataSource(postData)
202
+        .subscribe((result) => {
203
+          this.panels = this.panelsClone;
204
+          this.loading1 = false;
205
+          this.panels.forEach((item) => {
206
+            item.list = result[item.extra] || [];
207
+          });
208
+          this.panels = this.panels.filter((item) => item.list.length > 0);
209
+        });
210
+    }else{
211
+      let id = this.searchCriteria.id || "dsadmin";
212
+      console.log(id);
213
+      this.mainService
214
+        .infoSearch(this.searchCriteria.target, id)
215
+        .subscribe((result) => {
216
+          this.panels = this.panelsClone;
217
+          this.loading1 = false;
218
+          this.panels.forEach((item) => {
219
+            item.list = result[item.extra] || [];
220
+          });
221
+          this.panels = this.panels.filter((item) => item.list.length > 0);
182 222
         });
183
-        this.panels = this.panels.filter((item) => item.list.length > 0);
184
-      });
223
+    }
185 224
   }
186 225
   // json弹窗
187 226
   toJson(json) {

+ 5 - 2
src/app/views/specimen-search/specimen-search.component.ts

@@ -123,12 +123,13 @@ export class SpecimenSearchComponent implements OnInit {
123 123
   startDate: string; //发起时间开始
124 124
   endDate: string; //发起时间结束
125 125
 	changeDate(result?): void {
126
-	  if (!result) {
127
-	    this.startDate = this.endDate = "";
126
+	  if (result.length==0) {
127
+	    this.startDate = this.endDate = null;
128 128
 	    return;
129 129
 	  }
130 130
 	  this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
131 131
 	  this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
132
+    this.searchCriteria.dateRange = [this.startDate, this.endDate];
132 133
 	}
133 134
 	onCalendarChangeDate(dateArr){
134 135
 	  console.log(dateArr)
@@ -313,6 +314,8 @@ export class SpecimenSearchComponent implements OnInit {
313 314
         speState: this.searchCriteria.speState
314 315
           ? { id: this.searchCriteria.speState }
315 316
           : undefined,
317
+        startArriveTime: this.startDate || undefined,
318
+        endArriveTime: this.endDate || undefined,
316 319
       },
317 320
     };
318 321
     if (field && sort) {