seimin пре 1 година
родитељ
комит
b9c9cf61b4

+ 1 - 1
src/app/views/quilt-washing-search/quilt-washing-search.component.ts

@@ -117,7 +117,7 @@ export class QuiltWashingSearchComponent implements OnInit {
117 117
       },
118 118
     };
119 119
     if (this.searchCriteria.relatedDept) {
120
-      postData.clothesWashing.relatedDept = { id: this.searchCriteria.relatedDept };
120
+      postData.clothesWashing.relatedDept = this.searchCriteria.relatedDept;
121 121
     }
122 122
     this.loading1 = true;
123 123
     this.mainService

+ 34 - 10
src/app/views/washing-batch-view/washing-batch-view.component.html

@@ -9,19 +9,19 @@
9 9
     <div class="search top display_flex justify-content_space-between align-items_center">
10 10
       <div class="flex_1 display_flex">
11 11
         <div class="searchItem">
12
-          <span class="label">父级被服分类</span>:
12
+          <span class="label">被服科室绑定分类</span>:
13 13
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
14
-            nzPlaceHolder="请选择父级被服分类" [(ngModel)]="searchDto.parent">
15
-            <ng-container *ngFor="let data of parentList">
16
-              <nz-option [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
14
+            nzPlaceHolder="请选择被服科室绑定分类" [(ngModel)]="searchDto.child">
15
+            <ng-container *ngFor="let data of childList">
16
+              <nz-option [nzLabel]="data.typeName" [nzValue]="data.id"></nz-option>
17 17
             </ng-container>
18 18
           </nz-select>
19 19
         </div>
20 20
         <div class="searchItem">
21
-          <span class="label">被服分类</span>:
21
+          <span class="label">父级被服分类</span>:
22 22
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
23
-            nzPlaceHolder="请选择被服分类" [(ngModel)]="searchDto.child">
24
-            <ng-container *ngFor="let data of childList">
23
+            nzPlaceHolder="请选择父级被服分类" [(ngModel)]="searchDto.parent">
24
+            <ng-container *ngFor="let data of parentList">
25 25
               <nz-option [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
26 26
             </ng-container>
27 27
           </nz-select>
@@ -30,7 +30,7 @@
30 30
       <div class="display_flex align-items_center">
31 31
         <button nzType="primary" nz-button (click)="getList()">搜索</button>
32 32
         <button nzType="primary" nz-button (click)="reset()">重置</button>
33
-        <button nzType="primary" nz-button>打印功能</button>
33
+        <button nzType="primary" nz-button (click)="printAll()">打印功能</button>
34 34
         <button nzType="primary" nz-button (click)="viewDetail()">查看异常</button>
35 35
         <button nzType="primary" nz-button (click)="showDelModal()" [disabled]="checkedDepIds.length === 0">批量送回</button>
36 36
       </div>
@@ -53,7 +53,7 @@
53 53
         </thead>
54 54
         <tbody>
55 55
           <tr *ngFor="let data of listOfData" (click)="selectedListData(data)">
56
-            <td nzLeft="0px" nzAlign="center" nzShowCheckbox [nzDisabled]="data[0][1] == 5" [(nzChecked)]="mapOfCheckedId[data[0][0]]" (nzCheckedChange)="refreshStatus()"></td>
56
+            <td nzLeft="0px" nzAlign="center" nzShowCheckbox [nzDisabled]="data[0][1] != 4" [(nzChecked)]="mapOfCheckedId[data[0][0]]" (nzCheckedChange)="refreshStatus()"></td>
57 57
             <td nzLeft="40px" nzAlign="center"><span>{{ data[0][data[0].length - 1] }}</span></td>
58 58
             <td nzAlign="center" *ngFor="let row of data[1];let index = index;"><span (click)="clickNum($event, row)" class="table_hover" [ngClass]="{ red: row.exception == 1 }">{{ row.sendBackNum }}</span></td>
59 59
             <td [nzRight]="last ? '0px' : (first ? null : '100px')" nzAlign="center" *ngFor="let row of data[2];let first = first;let last = last;"><span>{{ row }}</span></td>
@@ -61,7 +61,7 @@
61 61
         </tbody>
62 62
       </nz-table>
63 63
     </div>
64
-    <div class="bottom">
64
+    <div class="bottom" *ngIf="listOfData.length">
65 65
       <strong>总件数:{{totalData.totalNum}}件</strong>
66 66
       <strong>总费用:{{totalData.totalPrice}}元</strong>
67 67
     </div>
@@ -125,3 +125,27 @@
125 125
   [orderId]="route.snapshot.paramMap.get('id')"
126 126
   (closeModelHs)="closeModelWashingException($event)"
127 127
 ></app-businessData-detail-modal>
128
+
129
+<!-- 打印的内容 -->
130
+<div id="print-section" hidden>
131
+  <table style="overflow: hidden;">
132
+    <thead>
133
+      <tr style="display: flex;justify-content: center;text-align: center;font-weight: bold;page-break-inside: avoid;" *ngIf="listOfData.length">
134
+        <td style="flex: 2; border: 1px solid #ccc;">科室名称</td>
135
+        <td style="flex: 1; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;border-top: 1px solid #ccc;" *ngFor="let item of rows[1]">{{item}}</td>
136
+        <td style="flex: 1; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;border-top: 1px solid #ccc;">件数</td>
137
+        <td style="flex: 1; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;border-top: 1px solid #ccc;">费用/元</td>
138
+      </tr>
139
+    </thead>
140
+    <tbody *ngFor="let item of listOfData">
141
+      <tr style="display: flex;justify-content: center;text-align: center;page-break-inside: avoid;">
142
+        <td style="flex: 2;word-break: break-all; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;" [ngStyle]="{'border-left':'1px solid #ccc'}">{{item[0][item[0].length - 1]}}</td>
143
+        <td style="flex: 1; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;" *ngFor="let v of item[1]">{{v.sendBackNum}}</td>
144
+        <ng-container *ngFor="let v of item[2];let first = first;">
145
+          <td style="flex: 1; border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;" *ngIf="!first">{{v}}</td>
146
+        </ng-container>
147
+      </tr>
148
+    </tbody>
149
+  </table>
150
+</div>
151
+<button ngxPrint printSectionId="print-section" #printBtn hidden [printStyle]="{ '@page': { size: 'landscape !important' } }">打印</button>

+ 23 - 20
src/app/views/washing-batch-view/washing-batch-view.component.less

@@ -10,7 +10,8 @@
10 10
     flex-direction: column;
11 11
     // 头部
12 12
     .head{
13
-      height: 130px;
13
+      // height: 130px;
14
+      height: 88px;
14 15
       flex-shrink: 0;
15 16
       background-color: #fff;
16 17
       display: flex;
@@ -30,7 +31,8 @@
30 31
       }
31 32
 
32 33
       .title{
33
-        font-size: 30px;
34
+        // font-size: 30px;
35
+        font-size: 22px;
34 36
         font-weight: bold;
35 37
         color: @primary-color;
36 38
         margin-left: 30px;
@@ -64,14 +66,14 @@
64 66
 
65 67
             button {
66 68
               margin-left: 8px;
67
-              width: 117px;
68
-              height: 45px;
69
-              font-size: 20px;
69
+              // width: 117px;
70
+              // height: 45px;
71
+              // font-size: 20px;
70 72
             }
71 73
           }
72 74
         }
73 75
         .searchItem {
74
-          font-size: 20px;
76
+          // font-size: 20px;
75 77
           .label {
76 78
             margin-left: 16px;
77 79
             color: #333;
@@ -81,7 +83,7 @@
81 83
           }
82 84
           .formItem {
83 85
             width: 150px;
84
-            font-size: 18px;
86
+            // font-size: 18px;
85 87
           }
86 88
         }
87 89
       }
@@ -90,14 +92,14 @@
90 92
         th{
91 93
           background-color: #7FD98A!important;
92 94
           color: #fff!important;
93
-          font-size: 22px;
94
-        }
95
-        td{
96
-          font-size: 20px;
97
-          &:first-of-type{
98
-            font-size: 22px;
99
-          }
95
+          // font-size: 22px;
100 96
         }
97
+        // td{
98
+        //   font-size: 20px;
99
+        //   &:first-of-type{
100
+        //     font-size: 22px;
101
+        //   }
102
+        // }
101 103
         .table_hover:hover{
102 104
           text-decoration: underline;
103 105
           cursor: pointer;
@@ -110,7 +112,8 @@
110 112
         display: flex;
111 113
         justify-content: flex-end;
112 114
         strong{
113
-          font-size: 22px;
115
+          // font-size: 22px;
116
+          font-size: 18px;
114 117
           margin-right: 25px;
115 118
           color: @primary-color;
116 119
         }
@@ -137,14 +140,14 @@
137 140
       .title {
138 141
         width: 100%;
139 142
         text-align: center;
140
-        font-size: 18px;
143
+        // font-size: 18px;
141 144
         position: relative;
142 145
 
143 146
         i {
144 147
           position: absolute;
145 148
           right: 0;
146 149
           top: 0;
147
-          font-size: 20px;
150
+          // font-size: 20px;
148 151
           color: #666;
149 152
           cursor: pointer;
150 153
           padding: 0 5px;
@@ -169,7 +172,7 @@
169 172
 
170 173
             i {
171 174
               color: #34b349;
172
-              font-size: 30px !important;
175
+              // font-size: 30px !important;
173 176
 
174 177
               &.transport-wenhao {
175 178
                 color: #f5a523;
@@ -183,11 +186,11 @@
183 186
 
184 187
           &.defeat {
185 188
             color: #333;
186
-            font-size: 18px;
189
+            // font-size: 18px;
187 190
           }
188 191
 
189 192
           &:nth-child(3) {
190
-            font-size: 14px;
193
+            // font-size: 14px;
191 194
             color: #666;
192 195
           }
193 196
         }

+ 51 - 11
src/app/views/washing-batch-view/washing-batch-view.component.ts

@@ -1,4 +1,4 @@
1
-import { Component, OnInit, AfterViewInit, HostListener } from "@angular/core";
1
+import { Component, OnInit, AfterViewInit, HostListener, ElementRef, ViewChild } from "@angular/core";
2 2
 import { ToolService } from 'src/app/services/tool.service';
3 3
 import { MainService } from 'src/app/services/main.service';
4 4
 import { ActivatedRoute } from '@angular/router';
@@ -10,6 +10,7 @@ import { FormGroup, Validators, FormBuilder } from '@angular/forms';
10 10
   styleUrls: ["./washing-batch-view.component.less"],
11 11
 })
12 12
 export class WashingBatchViewComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('printBtn', { static: false }) printBtn: ElementRef<HTMLElement>;
13 14
   constructor(
14 15
     public tool: ToolService,
15 16
     private mainService: MainService,
@@ -50,7 +51,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
50 51
   }
51 52
   parentList: Array<any> = []; //父级分类数据字典信息
52 53
   childList: Array<any> = []; //分类数据字典信息
53
-  rows:any[] = [];
54
+  rows:any[] = [['id', 'clothesState', ''], [], ['','件数', '费用/元']];
54 55
   totalData:any = {};
55 56
 
56 57
   // 查看业务数据
@@ -66,7 +67,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
66 67
   // 全选
67 68
   checkAll(value: boolean): void {
68 69
     this.listOfData.forEach((item) => {
69
-      if (item[0][1] != 5) {
70
+      if (item[0][1] == 4) {
70 71
         this.mapOfCheckedId[item[0][0]] = value;
71 72
       }
72 73
     });
@@ -76,7 +77,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
76 77
   // 单选
77 78
   refreshStatus(): void {
78 79
     let listOfData = this.listOfData.filter(
79
-      (item) => item[0][1] != 5
80
+      (item) => item[0][1] == 4
80 81
     );
81 82
     this.isAllDisplayDataChecked = listOfData.every(
82 83
       (item) => this.mapOfCheckedId[item[0][0]]
@@ -92,7 +93,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
92 93
 
93 94
   // 整行操作
94 95
   selectedListData(data) {
95
-    if (data[0][1] == 5) {
96
+    if (data[0][1] != 4) {
96 97
       return;
97 98
     }
98 99
     this.mapOfCheckedId[data[0][0]] = !this.mapOfCheckedId[data[0][0]];
@@ -133,15 +134,12 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
133 134
     let postData = {
134 135
       idx: 0,
135 136
       sum: 9999,
136
-      dictionaryTree: {
137
+      clothesDept: {
137 138
         hosId: this.hosId,
138
-        level: 2,
139
-        key: 'clothes_type',
140
-        deleted: 0,
141 139
       },
142 140
     };
143 141
     this.mainService
144
-      .getFetchDataList("simple/data", "dictionaryTree", postData)
142
+      .getFetchDataList("simple/data", "clothesDept", postData)
145 143
       .subscribe((result) => {
146 144
         if(result.status == 200){
147 145
           this.childList = result.list || [];
@@ -257,15 +255,31 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
257 255
     })
258 256
   }
259 257
 
258
+  // 打印
259
+  printAll(){
260
+    setTimeout(()=>{
261
+      this.printBtn.nativeElement.click();
262
+    },0)
263
+  }
264
+
260 265
   // 表格数据
261 266
   getList() {
267
+    if(!this.searchDto.parent && !this.searchDto.child){
268
+      this.rows = [['id', 'clothesState', ''], [], ['','件数', '费用/元']];
269
+      this.listOfData = [];
270
+      this.totalData = {};
271
+      return;
272
+    }
262 273
     let postData: any = {
263 274
       hosId: this.hosId,
264 275
       batchId: this.route.snapshot.paramMap.get("id"),
265 276
       clothesTypeParent: this.searchDto.parent,
266
-      clothesType: this.searchDto.child,
277
+      clothesDeptId: this.searchDto.child,
267 278
     };
268 279
     this.loading = true;
280
+    this.mapOfCheckedId = {};
281
+    this.checkedDepIds = [];
282
+    this.isAllDisplayDataChecked = false;
269 283
     this.mainService
270 284
       .clothesWashing(postData, 'view')
271 285
       .subscribe((result) => {
@@ -274,6 +288,32 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
274 288
           let rows = result.head || [];
275 289
           this.rows = [['id', 'clothesState', ''], rows.map(v => v.name), ['','件数', '费用/元']];
276 290
           let listOfData_res = result.data || [];
291
+          listOfData_res = [
292
+            ...listOfData_res,
293
+            ...listOfData_res,
294
+            ...listOfData_res,
295
+            ...listOfData_res,
296
+            ...listOfData_res,
297
+            ...listOfData_res,
298
+            ...listOfData_res,
299
+            ...listOfData_res,
300
+            ...listOfData_res,
301
+            ...listOfData_res,
302
+            ...listOfData_res,
303
+            ...listOfData_res,
304
+            ...listOfData_res,
305
+            ...listOfData_res,
306
+            ...listOfData_res,
307
+            ...listOfData_res,
308
+            ...listOfData_res,
309
+            ...listOfData_res,
310
+            ...listOfData_res,
311
+            ...listOfData_res,
312
+            ...listOfData_res,
313
+            ...listOfData_res,
314
+            ...listOfData_res,
315
+            ...listOfData_res,
316
+          ]
277 317
           this.listOfData = listOfData_res.map(v => ([
278 318
             [v.id, v.clothesState.value, v.dept],
279 319
             v.clothesWashingDTOS,

+ 3 - 1
src/app/views/washing-batch-view/washing-batch-view.module.ts

@@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common';
4 4
 import { WashingBatchViewRoutingModule } from './washing-batch-view-routing.module';
5 5
 import { ShareModule } from 'src/app/share/share.module';
6 6
 import { WashingBatchViewComponent } from './washing-batch-view.component';
7
+import { NgxPrintModule } from 'ngx-print';
7 8
 
8 9
 
9 10
 @NgModule({
@@ -11,7 +12,8 @@ import { WashingBatchViewComponent } from './washing-batch-view.component';
11 12
   imports: [
12 13
     CommonModule,
13 14
     WashingBatchViewRoutingModule,
14
-    ShareModule
15
+    ShareModule,
16
+    NgxPrintModule,
15 17
   ]
16 18
 })
17 19
 export class WashingBatchViewModule { }