Просмотр исходного кода

表单生成需要选择时间区间

seimin 1 год назад
Родитель
Сommit
95e86071a1

+ 47 - 40
src/app/views/form-management/form-management.component.html

@@ -2,7 +2,9 @@
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='15' class="list-template__searchBox"></div>
4
       <div nz-col nzXl='15' class="list-template__searchBox"></div>
5
-      <div nz-col nzXl="9" class="list-template__btns"></div>
5
+      <div nz-col nzXl="9" class="list-template__btns">
6
+        <button nz-button class="btn default ml8" (click)="checkFixedTab('formManagement')">表单生成</button>
7
+      </div>
6
     </div>
8
     </div>
7
     <div class="list-template__bottom">
9
     <div class="list-template__bottom">
8
       <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
10
       <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
@@ -10,12 +12,14 @@
10
         <thead>
12
         <thead>
11
           <tr class="thead">
13
           <tr class="thead">
12
             <th nzWidth="4%">序号</th>
14
             <th nzWidth="4%">序号</th>
13
-            <th nzWidth="16%">表单号</th>
14
-            <th nzWidth="16%">发起时间</th>
15
-            <th nzWidth="16%">发起人</th>
16
-            <th nzWidth="16%">包含类型</th>
17
-            <th nzWidth="16%">工单数</th>
18
-            <th nzWidth="16%">操作</th>
15
+            <th nzWidth="12%">表单号</th>
16
+            <th nzWidth="12%">发起时间</th>
17
+            <th nzWidth="12%">发起人</th>
18
+            <th nzWidth="12%">包含类型</th>
19
+            <th nzWidth="12%">工单数</th>
20
+            <th nzWidth="12%">开始时间</th>
21
+            <th nzWidth="12%">结束时间</th>
22
+            <th nzWidth="12%">操作</th>
19
           </tr>
23
           </tr>
20
         </thead>
24
         </thead>
21
         <tbody>
25
         <tbody>
@@ -26,6 +30,8 @@
26
             <td>{{ data.addUserDTO?data.addUserDTO.name:'无' }}</td>
30
             <td>{{ data.addUserDTO?data.addUserDTO.name:'无' }}</td>
27
             <td>{{ data.taskTypeDTO?data.taskTypeDTO.taskName:'无' }}</td>
31
             <td>{{ data.taskTypeDTO?data.taskTypeDTO.taskName:'无' }}</td>
28
             <td>{{data.total}}</td>
32
             <td>{{data.total}}</td>
33
+            <td>{{data.startTime?(data.startTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</td>
34
+            <td>{{data.endTime?(data.endTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</td>
29
             <td>
35
             <td>
30
               <div class="coop">
36
               <div class="coop">
31
                 <button nz-button nzType="link" (click)="lookView(data)">查看视图</button>
37
                 <button nz-button nzType="link" (click)="lookView(data)">查看视图</button>
@@ -43,50 +49,51 @@
43
   </div>
49
   </div>
44
 </div>
50
 </div>
45
 
51
 
46
-<!-- 右侧悬浮框 -->
47
-<div id="fixedMenu" class="fixed">
48
-  <div class="left" *ngIf="fixedTab == 'formManagement'">
49
-    <!-- 表单生成 -->
50
-    <div class="con" *ngIf="fixedTab == 'formManagement'">
51
-      <div class="title">表单生成</div>
52
+<!-- 表单生成按钮todo -->
53
+<div class="newOrder newOrder_todo display_flex justify-content_flex-center align-items_center" *ngIf="fixedTab == 'formManagement'">
54
+  <div class="modalBody">
55
+    <p class="title">
56
+      表单生成
57
+      <i class="icon_transport transport-guanbi" (click)="formManagementCancel()"></i>
58
+    </p>
59
+    <div class="content">
52
       <overlay-scrollbars [ngStyle]="{ height: '206px' }" class="conditions">
60
       <overlay-scrollbars [ngStyle]="{ height: '206px' }" class="conditions">
53
         <div nz-row>
61
         <div nz-row>
54
-          <div nz-col nzSpan="6">其他临床服务:</div>
55
-          <div nz-col nzSpan="18">
62
+          <div nz-col nzSpan="5">日期选择:</div>
63
+          <div nz-col nzSpan="19">
64
+              <nz-range-picker nzShowTime [nzAllowClear]="false" nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="dateRange"></nz-range-picker>
65
+          </div>
66
+        </div>
67
+        <div nz-row class="mt8">
68
+          <div nz-col nzSpan="5">其他临床服务:</div>
69
+          <div nz-col nzSpan="19">
56
             <nz-radio-group [(ngModel)]="tasktypeId">
70
             <nz-radio-group [(ngModel)]="tasktypeId">
57
               <label nz-radio [nzValue]="option.id" *ngFor="let option of taskTypes">{{option.taskName}}</label>
71
               <label nz-radio [nzValue]="option.id" *ngFor="let option of taskTypes">{{option.taskName}}</label>
58
             </nz-radio-group>
72
             </nz-radio-group>
59
           </div>
73
           </div>
60
         </div>
74
         </div>
61
       </overlay-scrollbars>
75
       </overlay-scrollbars>
62
-      <div class="btns display_flex justify-content_flex-center">
63
-        <button
64
-          nz-button
65
-          nzType="primary"
66
-          nzValue="small"
67
-          (click)="saveFormManagement()"
68
-        >
69
-          确认
70
-        </button>
71
-      </div>
72
     </div>
76
     </div>
73
-  </div>
74
-  <div class="right">
75
-    <div class="fixedMenu hujiaozhongxin">
76
-      <div class="menuItems">
77
-        <button
78
-          nz-button
79
-          nzType="link"
80
-          class="item itemLink"
81
-          (click)="checkFixedTab('formManagement')"
82
-        >
83
-          表单生成
84
-        </button>
85
-      </div>
77
+    <div class="btns display_flex justify-content_flex-center align-items_center">
78
+      <button
79
+        nz-button
80
+        class="btn"
81
+        nzType="primary"
82
+        (click)="saveFormManagement()"
83
+      >
84
+        确认
85
+      </button>
86
+      <button
87
+        class="btn cancel"
88
+        nz-button
89
+        nzType="default"
90
+        (click)="formManagementCancel()"
91
+      >
92
+        取消
93
+      </button>
86
     </div>
94
     </div>
87
   </div>
95
   </div>
88
-  <div *ngIf="fixedTab != ''" (click)="fixedTab = ''" class="fixedMark"></div>
89
-</div>
96
+  </div>
90
 
97
 
91
 <!-- 表单生成 -->
98
 <!-- 表单生成 -->
92
 <div class="newOrder display_flex justify-content_flex-center align-items_center" *ngIf="fixedTab == 'formManagementTable'">
99
 <div class="newOrder display_flex justify-content_flex-center align-items_center" *ngIf="fixedTab == 'formManagementTable'">

+ 31 - 53
src/app/views/form-management/form-management.component.less

@@ -388,59 +388,6 @@
388
       }
388
       }
389
     }
389
     }
390
   }
390
   }
391
-
392
-  .right {
393
-    // opacity: .5;
394
-    width: 80px;
395
-    float: left;
396
-    background: rgba(255, 255, 255, 0.5);
397
-    border-radius: 5px 0 0 5px;
398
-    position: relative;
399
-    z-index: 8;
400
-
401
-    .fixedMenu {
402
-      border: 1px solid #e5e9ed;
403
-      color: @primary-color;
404
-      background: rgba(255, 255, 255, 0.5);
405
-      text-align: center;
406
-      border-radius: 5px 0 0 5px;
407
-      // box-shadow: -3px 4px 15px rgba(234, 233, 233, .5);
408
-
409
-      &.hujiaozhongxin {
410
-        margin-bottom: 5px;
411
-      }
412
-
413
-      .menuItems {
414
-        .item {
415
-          height: 35px;
416
-          line-height: 35px;
417
-          padding: 0 6px;
418
-          cursor: default;
419
-          border-bottom: 1px solid #e5e9ed;
420
-          user-select: none;
421
-          &.itemLink {
422
-            border-bottom: none;
423
-          }
424
-
425
-          &.checked {
426
-            background: #fff;
427
-            color: #52ab77;
428
-            opacity: 1;
429
-            box-shadow: -3px 4px 7px #eae9e9;
430
-          }
431
-        }
432
-
433
-        .others {
434
-          transition: height 0.4s linear;
435
-          overflow: hidden;
436
-        }
437
-      }
438
-
439
-      .arrow {
440
-        cursor: pointer;
441
-      }
442
-    }
443
-  }
444
 }
391
 }
445
 
392
 
446
 // 表单生成弹框
393
 // 表单生成弹框
@@ -452,6 +399,37 @@
452
   height: 100%;
399
   height: 100%;
453
   background: rgba(0, 0, 0, 0.5);
400
   background: rgba(0, 0, 0, 0.5);
454
   z-index: 999;
401
   z-index: 999;
402
+  &.newOrder_todo{
403
+    .modalBody{
404
+      width: 625px;
405
+      height: auto;
406
+    }
407
+    .content{
408
+      padding: 16px;
409
+    }
410
+    .btns{
411
+      margin-top: 0;
412
+    }
413
+    .conditions {
414
+      & > .ant-row {
415
+        margin: 8px 0;
416
+        display: flex;
417
+        align-items: center;
418
+
419
+        .ant-row {
420
+          .ant-col-6 {
421
+            margin: 2px 0;
422
+          }
423
+        }
424
+
425
+        .checkAll {
426
+          width: 100%;
427
+          border-bottom: 1px solid rgb(233, 233, 233);
428
+          color: @primary-color;
429
+        }
430
+      }
431
+    }
432
+  }
455
 
433
 
456
   .modalBody {
434
   .modalBody {
457
     width: 1200px;
435
     width: 1200px;

+ 11 - 30
src/app/views/form-management/form-management.component.ts

@@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from "@angular/router";
4
 import { MainService } from "../../services/main.service";
4
 import { MainService } from "../../services/main.service";
5
 import { ToolService } from "../../services/tool.service";
5
 import { ToolService } from "../../services/tool.service";
6
 import { NzMessageService } from 'ng-zorro-antd';
6
 import { NzMessageService } from 'ng-zorro-antd';
7
+import { subDays, startOfHour, format } from 'date-fns';
7
 @Component({
8
 @Component({
8
   selector: "app-form-management",
9
   selector: "app-form-management",
9
   templateUrl: "./form-management.component.html",
10
   templateUrl: "./form-management.component.html",
@@ -26,11 +27,12 @@ export class FormManagementComponent implements OnInit {
26
   pageSize: number = 10; //表格每页展示条数
27
   pageSize: number = 10; //表格每页展示条数
27
   listLength: number = 10; //表格总数据量
28
   listLength: number = 10; //表格总数据量
28
 
29
 
30
+  dateRange: any = [startOfHour(subDays(new Date().setHours(9), 1)), startOfHour(new Date().setHours(9))]; //日期选择
31
+
29
   ngOnInit() {
32
   ngOnInit() {
30
     this.hosId = this.tool.getCurrentHospital().id;
33
     this.hosId = this.tool.getCurrentHospital().id;
31
     this.getList();
34
     this.getList();
32
     this.coopBtns = this.tool.initCoopBtns(this.route);
35
     this.coopBtns = this.tool.initCoopBtns(this.route);
33
-    this.moveMenu();
34
     this.getTaskTypes();
36
     this.getTaskTypes();
35
   }
37
   }
36
 
38
 
@@ -54,6 +56,9 @@ export class FormManagementComponent implements OnInit {
54
         gdState: {id: "433"},
56
         gdState: {id: "433"},
55
         serTaskTypes: this.tasktypeId,
57
         serTaskTypes: this.tasktypeId,
56
         time: 0,
58
         time: 0,
59
+        reserveDate: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
60
+        startTime1: this.dateRange[0] ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
61
+        endTime1:  this.dateRange[1] ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
57
       },
62
       },
58
     };
63
     };
59
     this.mainService.getFetchDataList("simple/data", "workOrder", postData).subscribe((data:any) => {
64
     this.mainService.getFetchDataList("simple/data", "workOrder", postData).subscribe((data:any) => {
@@ -112,35 +117,9 @@ export class FormManagementComponent implements OnInit {
112
   // 切换右侧菜单Tab
117
   // 切换右侧菜单Tab
113
   fixedTab: string = "";
118
   fixedTab: string = "";
114
   checkFixedTab(type: string) {
119
   checkFixedTab(type: string) {
115
-    if (this.fixedTab == type) {
116
-      this.fixedTab = "";
117
-    } else {
118
-      this.fixedTab = type;
119
-    }
120
-  }
121
-
122
-  // 菜单拖拽
123
-  moveMenu() {
124
-    let fixedMenu = document.getElementById("fixedMenu");
125
-    if (!fixedMenu) return;
126
-    fixedMenu.onmousedown = function (e) {
127
-      fixedMenu.style.cursor = "move";
128
-      let y = e.clientY - fixedMenu.offsetTop;
129
-      document.onmousemove = function (ev) {
130
-        var _y = ev.clientY - y > 0 ? ev.clientY - y : 0;
131
-        var wh = window.innerHeight;
132
-        if (_y > wh - fixedMenu.clientHeight) {
133
-          _y = wh - fixedMenu.clientHeight;
134
-        }
135
-        fixedMenu.style.top = _y + "px";
136
-      };
137
-      document.onmouseup = function () {
138
-        fixedMenu.style.cursor = "default";
139
-        this.onmousemove = null;
140
-        this.onmouseup = null;
141
-      };
142
-      // return false;
143
-    };
120
+    this.dateRange = [startOfHour(subDays(new Date().setHours(9), 1)), startOfHour(new Date().setHours(9))];
121
+    this.tasktypeId = undefined;
122
+    this.fixedTab = type;
144
   }
123
   }
145
 
124
 
146
   // 表格数据
125
   // 表格数据
@@ -173,6 +152,8 @@ export class FormManagementComponent implements OnInit {
173
       taskType: this.tasktypeId,
152
       taskType: this.tasktypeId,
174
       hosId: this.hosId,
153
       hosId: this.hosId,
175
       deleteFlag: 0,
154
       deleteFlag: 0,
155
+      startTime: this.dateRange[0] ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
156
+      endTime:  this.dateRange[1] ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
176
     };
157
     };
177
     this.isOkLoading = true;
158
     this.isOkLoading = true;
178
     this.mainService
159
     this.mainService