Sfoglia il codice sorgente

大输液管理开发

maotao 9 mesi fa
parent
commit
9101845e32

+ 29 - 26
src/app/views/admin-office-prescription/admin-office-prescription.component.html

@@ -19,7 +19,7 @@
19 19
         </div>
20 20
         <div class="list-template__searchItem">
21 21
           <span class="label">创建时间:</span>
22
-          <nz-range-picker [(ngModel)]="dateRange" [nzShowTime]="{ nzFormat: 'HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
22
+          <nz-range-picker [(ngModel)]="dateRange" nzFormat="yyyy-MM-dd"
23 23
 					(ngModelChange)="changeDate($event)"></nz-range-picker>
24 24
         </div>
25 25
       </div>
@@ -46,18 +46,18 @@
46 46
             <th nzWidth="18%">操作</th>
47 47
           </tr>
48 48
         </thead>
49
-        <tbody>
49
+        <tbody v-if="listOfData && listOfData.length>0">
50 50
           <tr *ngFor="let data of listOfData" (click)="selectedListData(data.id)">
51 51
             <td>
52 52
 							<div>{{ data.packingNo}}</div>
53 53
 							<div>{{ data.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
54 54
 						</td>
55 55
             <td>{{ data.batch?data.batch.batchNo:'-' }}</td>
56
-            <td>{{ data.applyDept||'无' }}</td>
57
-            <td>{{ data.totalCount||'' }}</td>
58
-            <td>{{data.kindCount||''}}</td>
59
-            <td>{{ data.expendPrice }}</td>
60
-            <td>{{ data.actualPrice }}</td>
56
+            <td>{{ data.applyDeptDTO?data.applyDeptDTO.dept :'-' }}</td>
57
+            <td>{{ data.totalCount||'0' }}</td>
58
+            <td>{{data.kindCount||'0'}}</td>
59
+            <td>{{ data.expendPrice ||'0' }}</td>
60
+            <td>{{ data.actualPrice || '0'}}</td>
61 61
             <td>{{ data.pharmacyDTO?data.pharmacyDTO.dept:'-'}}</td>
62 62
 						<td>{{ data.createOrder==1?'是':'否'}}</td>
63 63
 						<td>{{ data.orderState.name}}</td>
@@ -65,7 +65,7 @@
65 65
               <div class="coop">
66 66
                 <span *ngIf="coopBtns.look" (click)="detail($event,data.id)">查看</span>
67 67
                 <span *ngIf="coopBtns.print" (click)="print($event, data, data.id)">打印</span>
68
-                <span *ngIf="coopBtns.establish && data.createOrder=='0'" (click)="addDateModal(data)">配送建单</span>
68
+                <span *ngIf="coopBtns.establish && ( data.createOrder=='0' || data.createOrder==null)" (click)="addDateModal(data)">配送建单</span>
69 69
               </div>
70 70
             </td>
71 71
           </tr>
@@ -90,8 +90,9 @@
90 90
             [nzLoading]="loading1">
91 91
             <thead>
92 92
               <tr class="thead">
93
-                <th nzWidth="15%">药品名称</th>
94
-                <th nzWidth="15%">规格</th>
93
+								<th nzWidth="10%">药品标识</th>
94
+                <th nzWidth="10%">药品名称</th>
95
+                <th nzWidth="10%">规格</th>
95 96
                 <th nzWidth="10%">消耗数量</th>
96 97
                 <th nzWidth="10%">实发数量</th>
97 98
                 <th nzWidth="10%">包装规格</th>
@@ -103,15 +104,16 @@
103 104
             </thead>
104 105
             <tbody>
105 106
               <tr *ngFor="let data of viewData">
107
+								<td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugCode:'无' }}</td>
106 108
                 <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'无' }}</td>
107 109
                 <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.specs:'无' }}</td>
108
-                <td>{{ data.expendCount||'' }}</td>
109
-                <td>{{ data.actualCount||'' }}</td>
110
-                <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.packingSpecs:'' }}</td>
111
-                <td>{{ data.cartonNum || '' }}</td>
112
-                <td>{{ data.formerInventory || '' }}</td>
113
-                <td>{{ data.afterInventory || '-'}}</td>
114
-        				<td>{{ data.addSub || '' }}</td>
110
+                <td>{{ data.expendCount||'0' }}</td>
111
+                <td>{{ data.actualCount||'0' }}</td>
112
+                <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.packingSpecs:'0' }}</td>
113
+                <td>{{ data.cartonNum || '0' }}</td>
114
+                <td>{{ data.formerInventory || '0' }}</td>
115
+                <td>{{ data.afterInventory || '0'}}</td>
116
+        				<td>{{ data.addSub || '0' }}</td>
115 117
               </tr>
116 118
             </tbody>
117 119
           </nz-table>
@@ -138,6 +140,7 @@
138 140
   <!-- 打印 -->
139 141
   <div id="report" style="display: none;">
140 142
 		<div class="monad" 
143
+				*ngIf="rowData"
141 144
 				style="padding: 10px;
142 145
 				border: 1px solid #e7e7e7;
143 146
 				border-radius: 5px;">
@@ -147,7 +150,7 @@
147 150
 				font-size: 16px;
148 151
 				border-bottom: 1px solid #e7e7e7;
149 152
 				padding-bottom: 10px;">
150
-				大输液发药单-{{rowData.pharmacyDTO?rowData.pharmacyDTO.dept:''}}
153
+				大输液发药单-{{rowData.applyDeptDTO?rowData.applyDeptDTO.dept:''}}
151 154
 			</div>
152 155
 			<div class="monad-sign" style="display: flex;line-height: 40px;font-size: 14px;">
153 156
 				<div style="margin-right: 15px;">日期:{{rowData.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
@@ -156,7 +159,7 @@
156 159
 			</div>
157 160
 			<div style="border: 1px solid #e7e7e7;border-bottom: none;font-size: 14px;">
158 161
 				<div class="thead" style="display: flex;">
159
-					<div style="text-align: center;width: 20%;height: 40px;
162
+					<div style="text-align: center;width: 40%;height: 40px;
160 163
 					line-height: 40px;
161 164
 					border-right: 1px solid #e7e7e7;
162 165
 					border-bottom: 1px solid #e7e7e7;">药品名称</div>
@@ -166,21 +169,21 @@
166 169
 					border-right: 1px solid #e7e7e7;
167 170
 					border-bottom: 1px solid #e7e7e7;">规格</div>
168 171
 					
169
-					<div style="text-align: center;width: 20%;height: 40px;
172
+					<div style="text-align: center;width: 10%;height: 40px;
170 173
 					line-height: 40px;
171 174
 					border-right: 1px solid #e7e7e7;
172
-					border-bottom: 1px solid #e7e7e7;">总量(实发数量)</div>
175
+					border-bottom: 1px solid #e7e7e7;">总量</div>
173 176
 					
174
-					<div style="text-align: center;width: 20%;height: 40px;
177
+					<div style="text-align: center;width: 10%;height: 40px;
175 178
 					line-height: 40px;
176 179
 					border-right: 1px solid #e7e7e7;
177
-					border-bottom: 1px solid #e7e7e7;">箱数(发药箱数)</div>
180
+					border-bottom: 1px solid #e7e7e7;">箱数</div>
178 181
 					
179 182
 					<div style="text-align: center;width: 20%;height: 40px;
180 183
 					line-height: 40px;border-bottom: 1px solid #e7e7e7;">取药药房</div>
181 184
 				</div>
182 185
 				<div *ngFor="let data of codes" style="display: flex;">
183
-					<div style="text-align: center;width: 20%;height: 40px;
186
+					<div style="text-align: center;width: 40%;height: 40px;
184 187
 					line-height: 40px;
185 188
 					border-right: 1px solid #e7e7e7;
186 189
 					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.drugName }}</div>
@@ -190,12 +193,12 @@
190 193
 					border-right: 1px solid #e7e7e7;
191 194
 					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.specs }}</div>
192 195
 					
193
-					<div style="text-align: center;width: 20%;height: 40px;
196
+					<div style="text-align: center;width: 10%;height: 40px;
194 197
 					line-height: 40px;
195 198
 					border-right: 1px solid #e7e7e7;
196 199
 					border-bottom: 1px solid #e7e7e7;">{{ data.actualCount }}</div>
197 200
 					
198
-					<div style="text-align: center;width: 20%;height: 40px;
201
+					<div style="text-align: center;width: 10%;height: 40px;
199 202
 					line-height: 40px;
200 203
 					border-right: 1px solid #e7e7e7;
201 204
 					border-bottom: 1px solid #e7e7e7;">{{ data.cartonNum }}</div>

+ 4 - 18
src/app/views/admin-office-prescription/admin-office-prescription.component.ts

@@ -10,7 +10,7 @@ import {
10 10
 import { MainService } from "../../services/main.service";
11 11
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12 12
 import { ToolService } from "../../services/tool.service";
13
-import { format } from "date-fns";
13
+import { format, startOfDay, endOfDay } from "date-fns";
14 14
 import { NzMessageService } from "ng-zorro-antd";
15 15
 import { Subject } from "rxjs";
16 16
 import { debounceTime, filter } from "rxjs/operators";
@@ -315,22 +315,8 @@ export class AdminOfficePrescriptionComponent implements OnInit{
315 315
 	    this.startDate = this.endDate = "";
316 316
 	    return;
317 317
 	  }
318
-	  this.startDate =
319
-	    result[0].getFullYear() +
320
-	    "-" +
321
-	    (result[0].getMonth() + 1) +
322
-	    "-" +
323
-	    result[0].getDate() +
324
-	    " " +
325
-	    "00:00:00";
326
-	  this.endDate =
327
-	    result[1].getFullYear() +
328
-	    "-" +
329
-	    (result[1].getMonth() + 1) +
330
-	    "-" +
331
-	    result[1].getDate() +
332
-	    " " +
333
-	    "23:59:59";
318
+	  this.startDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
319
+	  this.endDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
334 320
 	}
335 321
 	
336 322
 	// 获取所有科室
@@ -870,7 +856,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
870 856
         that.printLoading = false;
871 857
         setTimeout(() => {
872 858
           const printContent = document.getElementById("report");
873
-          const WindowPrt = window.open("", "", "width=800,height=900");
859
+          const WindowPrt = window.open("", "", "width=1000,height=900");
874 860
           WindowPrt.document.write(printContent.innerHTML);
875 861
           WindowPrt.document.close();
876 862
           WindowPrt.focus();

+ 10 - 38
src/app/views/big-transfusion-set/big-transfusion-set.component.ts

@@ -19,7 +19,7 @@ export class BigTransfusionSetComponent implements OnInit {
19 19
   // 接手术关联任务类型
20 20
   infusionSolutionsTypeId:Number;
21 21
   taskTypes1:any[] = [];
22
-  taskTypeData:any[] = [];
22
+  taskTypeData:{id:''};
23 23
   // 苏醒室科室
24 24
   recoveryDeptId:any;
25 25
   recoveryDepts:any[] = [];
@@ -75,7 +75,6 @@ export class BigTransfusionSetComponent implements OnInit {
75 75
       fun.call(this, v[1], v[2], v[3]);
76 76
     });
77 77
     this.getTaskTypes('', true);
78
-		this.getTaskTypesId(true);
79 78
   }
80 79
 
81 80
   // 切换tab
@@ -91,7 +90,7 @@ export class BigTransfusionSetComponent implements OnInit {
91 90
     }
92 91
     let editData = {
93 92
 			id:'',
94
-			taskType:this.taskTypeData[0].id,
93
+			taskType:this.taskTypeData.id,
95 94
 			hosId: this.hosId,
96 95
 			infusionSolutionsTypeId:this.infusionSolutionsTypeId, //任务类型参数
97 96
 			autoCreate:0
@@ -156,37 +155,17 @@ export class BigTransfusionSetComponent implements OnInit {
156 155
         this.isLoading = false;
157 156
         if (result.status == 200) {
158 157
           this.taskTypes1 = result.list || [];
159
-          isFirst && this.getConfig();
158
+					this.getTaskTypesId();
160 159
         }
161 160
       });
162 161
   }
163 162
 	
164 163
 	// 获取任务id
165
-	getTaskTypesId( isFirst:boolean = false) {
166
-	  isFirst && (this.loading = true);
167
-	  let postData:any = {
168
-	    idx: 0,
169
-	    sum: 9999,
170
-	    taskType: {
171
-	      simpleQuery: true,
172
-				ordinaryField: {
173
-					key: 'ordinary_field',
174
-					value: 'infusionSolutions'
175
-				},
176
-	      hosId: {
177
-	        id: this.hosId
178
-	      }
179
-	    }
180
-	  };
181
-	  this.isLoading = true;
182
-	  this.mainService
183
-	    .getFetchDataList("simple/data", "taskType", postData)
184
-	    .subscribe((result) => {
185
-	      this.isLoading = false;
186
-	      if (result.status == 200) {
187
-	        this.taskTypeData = result.list || [];
188
-	      }
189
-	    });
164
+	getTaskTypesId() {
165
+		this.mainService.getDictionary("list", "ordinary_field").subscribe((data) => {
166
+			this.taskTypeData = data.find(i=>i.value=='infusionSolutions')
167
+			this.getConfig();
168
+		});
190 169
 	}
191 170
 	
192 171
   // 获取配置
@@ -196,15 +175,8 @@ export class BigTransfusionSetComponent implements OnInit {
196 175
       idx: 0,
197 176
       sum: 10,
198 177
       taskTypeConfig: {
199
-				taskTypeDTO: {
200
-				  hosId: {
201
-				    id: this.hosId
202
-				  },
203
-				  ordinaryField: {
204
-				    key: 'ordinary_field',
205
-				    value: 'infusionSolutions'
206
-				  }
207
-				}
178
+				hosId:this.hosId,
179
+				taskType:this.taskTypeData.id
208 180
       }
209 181
     };
210 182
     this.mainService

+ 19 - 15
src/app/views/dispensing-batch/dispensing-batch.component.html

@@ -8,7 +8,7 @@
8 8
         </div>
9 9
         <div class="list-template__searchItem">
10 10
           <span class="label">创建时间:</span>
11
-          <nz-range-picker [(ngModel)]="dateRange" [nzShowTime]="{ nzFormat: 'HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
11
+          <nz-range-picker [(ngModel)]="dateRange" nzFormat="yyyy-MM-dd"
12 12
 					(ngModelChange)="changeDate($event)"></nz-range-picker>
13 13
         </div>
14 14
       </div>
@@ -44,17 +44,17 @@
44 44
 							<div>{{ data.endTime|date:'yyyy-MM-dd HH:mm' }}</div>
45 45
 						</td>
46 46
             <td>{{ data.pharmacyDTO?data.pharmacyDTO.dept:'-' }}</td>
47
-            <td>{{ data.deptNum || '-' }}</td>
48
-            <td>{{ data.drugNum || '-'}}</td>
49
-						<td>{{ data.cartonNum || '-' }}</td>
50
-						<td>{{ data.totalPrice || '-' }}</td>
47
+            <td>{{ data.deptNum || '0' }}</td>
48
+            <td>{{ data.drugNum || '0'}}</td>
49
+						<td>{{ data.cartonNum || '0' }}</td>
50
+						<td>{{ data.totalPrice || '0' }}</td>
51 51
 						<td>{{ data.batchState?data.batchState.name : '-' }}</td>
52 52
             <td>
53 53
               <div class="coop">
54 54
 								<span *ngIf="coopBtns.edit && data.batchState.name=='未发药'" (click)="edit($event,data)">编辑</span>
55 55
 								<span *ngIf="coopBtns.del && data.batchState.name=='未发药'" (click)="showDelModal($event,data.id)">删除</span>
56 56
                 <span *ngIf="coopBtns.config && data.batchState.name=='未发药'" (click)="detail($event,data)">配置</span>
57
-                <span *ngIf="coopBtns.print && data.batchState.name=='已发药'" (click)="dispensingPrint($event,data, data.id)">打印</span>
57
+                <span *ngIf="coopBtns.print && data.batchState.name=='已发药'" (click)="print($event,data, data.id)">打印</span>
58 58
                 <span *ngIf="coopBtns.batchPrint && data.batchState.name=='未发药'" (click)="dispensingPrint($event, data, data.id)">发药并打印</span>
59 59
               </div>
60 60
             </td>
@@ -129,7 +129,7 @@
129 129
 				font-size: 16px;
130 130
 				border-bottom: 1px solid #e7e7e7;
131 131
 				padding-bottom: 10px;">
132
-				大输液发药单-{{item.pharmacyDTO.dept}}
132
+				大输液发药单-{{item.applyDeptDTO.dept}}
133 133
 			</div>
134 134
 			<div class="monad-sign" style="display: flex;line-height: 40px;font-size: 14px;">
135 135
 				<div style="margin-right: 15px;">日期:{{item.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
@@ -138,7 +138,7 @@
138 138
 			</div>
139 139
 			<div style="border: 1px solid #e7e7e7;border-bottom: none;font-size: 14px;">
140 140
 				<div class="thead" style="display: flex;">
141
-					<div style="text-align: center;width: 20%;height: 40px;
141
+					<div style="text-align: center;width: 40%;height: 40px;
142 142
 					line-height: 40px;
143 143
 					border-right: 1px solid #e7e7e7;
144 144
 					border-bottom: 1px solid #e7e7e7;">药品名称</div>
@@ -148,21 +148,21 @@
148 148
 					border-right: 1px solid #e7e7e7;
149 149
 					border-bottom: 1px solid #e7e7e7;">规格</div>
150 150
 					
151
-					<div style="text-align: center;width: 20%;height: 40px;
151
+					<div style="text-align: center;width: 10%;height: 40px;
152 152
 					line-height: 40px;
153 153
 					border-right: 1px solid #e7e7e7;
154
-					border-bottom: 1px solid #e7e7e7;">总量(实发数量)</div>
154
+					border-bottom: 1px solid #e7e7e7;">总量</div>
155 155
 					
156
-					<div style="text-align: center;width: 20%;height: 40px;
156
+					<div style="text-align: center;width: 10%;height: 40px;
157 157
 					line-height: 40px;
158 158
 					border-right: 1px solid #e7e7e7;
159
-					border-bottom: 1px solid #e7e7e7;">箱数(发药箱数)</div>
159
+					border-bottom: 1px solid #e7e7e7;">箱数</div>
160 160
 					
161 161
 					<div style="text-align: center;width: 20%;height: 40px;
162 162
 					line-height: 40px;border-bottom: 1px solid #e7e7e7;">取药药房</div>
163 163
 				</div>
164 164
 				<div *ngFor="let data of item.drugsConfigureDTOS" style="display: flex;">
165
-					<div style="text-align: center;width: 20%;height: 40px;
165
+					<div style="text-align: center;width: 40%;height: 40px;
166 166
 					line-height: 40px;
167 167
 					border-right: 1px solid #e7e7e7;
168 168
 					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.drugName }}</div>
@@ -172,12 +172,12 @@
172 172
 					border-right: 1px solid #e7e7e7;
173 173
 					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.specs }}</div>
174 174
 					
175
-					<div style="text-align: center;width: 20%;height: 40px;
175
+					<div style="text-align: center;width: 10%;height: 40px;
176 176
 					line-height: 40px;
177 177
 					border-right: 1px solid #e7e7e7;
178 178
 					border-bottom: 1px solid #e7e7e7;">{{ data.actualCount }}</div>
179 179
 					
180
-					<div style="text-align: center;width: 20%;height: 40px;
180
+					<div style="text-align: center;width: 10%;height: 40px;
181 181
 					line-height: 40px;
182 182
 					border-right: 1px solid #e7e7e7;
183 183
 					border-bottom: 1px solid #e7e7e7;">{{ data.cartonNum }}</div>
@@ -194,6 +194,10 @@
194 194
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
195 195
   [info]="promptInfo"></app-prompt-modal>
196 196
 
197
+ <!-- 模态框 -->
198
+<app-dialog-delete [delModal]="printModal" (hideDelModalEvent)="hidePrintModal()" [btnLoading]="btnLoading"
199
+  (confirmDelEvent)="confirmPrintDel()" [content]="'您确认发药并打印吗?打印同时会更新云库存并建立配送工单?'"></app-dialog-delete>
200
+		
197 201
 <!-- 遮罩 -->
198 202
 <app-mask *ngIf="maskFlag"></app-mask>
199 203
 <app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 59 - 17
src/app/views/dispensing-batch/dispensing-batch.component.ts

@@ -10,7 +10,7 @@ import {
10 10
 import { MainService } from "../../services/main.service";
11 11
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12 12
 import { ToolService } from "../../services/tool.service";
13
-import { format, startOfDay, endOfDay } from "date-fns";
13
+import { format, startOfDay, endOfDay, subDays} from "date-fns";
14 14
 import { NzMessageService } from "ng-zorro-antd";
15 15
 import { Subject } from "rxjs";
16 16
 import { debounceTime, filter } from "rxjs/operators";
@@ -200,8 +200,8 @@ export class DispensingBatchComponent implements OnInit {
200 200
 		}
201 201
 		if (that.validateForm.invalid) return;
202 202
     let data: any = {
203
-			startTime:this.formStartDate,//发起时间开始
204
-			endTime:this.formEndDate,//发起时间结束
203
+			startTime:this.formStartDate?this.formStartDate:this.loadStartTime,//发起时间开始
204
+			endTime:this.formEndDate?this.formEndDate:this.loadEndTime,//发起时间结束
205 205
 			hosId:this.hosId,
206 206
 			pharmacy:this.validateForm.value.department,
207 207
 			id:that.coopId
@@ -327,8 +327,8 @@ export class DispensingBatchComponent implements OnInit {
327 327
 		  this.formStartDate = this.formEndDate = "";
328 328
 		  return;
329 329
 		}
330
-		this.formStartDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
331
-		this.formEndDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
330
+		this.formStartDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
331
+		this.formEndDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
332 332
 	}
333 333
 	
334 334
 	// 获取所有科室
@@ -340,18 +340,27 @@ export class DispensingBatchComponent implements OnInit {
340 340
         hospital: {
341 341
           id: this.hosId
342 342
         },
343
+				type:{
344
+					id:''
345
+				}
343 346
       },
344 347
       idx: 0,
345 348
       sum: 20,
346 349
     };
347
-    that.mainService
348
-      .getFetchDataList("data", "department", data)
349
-      .subscribe((data) => {
350
-				setTimeout(_=>{
351
-					this.hospitals1 = data.list
352
-					that.isDeptLoading = false;
353
-				},500)
354
-      });
350
+		that.mainService.getDictionary("list", "dept_type").subscribe((res) => {
351
+		  let typeData = res.find(i=>i.value=='pharmacyRoom');
352
+			if(typeData){
353
+				data.department.type.id = typeData.id
354
+			}
355
+			that.mainService
356
+			  .getFetchDataList("data", "department", data)
357
+			  .subscribe((data) => {
358
+					setTimeout(_=>{
359
+						this.hospitals1 = data.list
360
+						that.isDeptLoading = false;
361
+					},500)
362
+			  });
363
+		});
355 364
   }
356 365
 	
357 366
   // 获取所有院区
@@ -485,11 +494,17 @@ export class DispensingBatchComponent implements OnInit {
485 494
     this.initForm();
486 495
   }
487 496
   // 初始化新增form表单
497
+	loadStartTime = '';
498
+	loadEndTime = '';
488 499
   initForm() {
489 500
     this.validateForm = this.fb.group({
490 501
       dispensingTime: [null, [Validators.required]],
491 502
       department: [null, [Validators.required]]
492 503
     });
504
+		let date = new Date();
505
+		this.loadStartTime = format(subDays(date, 1), "yyyy-MM-dd") +' '+'08:00:00'
506
+		this.loadEndTime = format(date, "yyyy-MM-dd") +' '+'08:00:00'
507
+		this.validateForm.controls.dispensingTime.setValue([this.loadStartTime, this.loadEndTime]);
493 508
   }
494 509
   // 科室位置必填
495 510
   buildValidator = (control: FormControl): { [s: string]: boolean } => {
@@ -567,8 +582,8 @@ export class DispensingBatchComponent implements OnInit {
567 582
 		}
568 583
 		if (that.validateForm.invalid) return;
569 584
     let data: any = {
570
-			startTime:this.formStartDate,//发起时间开始
571
-			endTime:this.formEndDate,//发起时间结束
585
+			startTime:this.formStartDate?this.formStartDate:this.loadStartTime,//发起时间开始
586
+			endTime:this.formEndDate?this.formEndDate:this.loadEndTime,//发起时间结束
572 587
 			hosId:this.hosId,
573 588
 			pharmacy:this.validateForm.value.department
574 589
     };
@@ -601,6 +616,8 @@ export class DispensingBatchComponent implements OnInit {
601 616
     this.coopItem = data;
602 617
     this.validateForm.controls.department.setValue(data.pharmacy);
603 618
     this.validateForm.controls.dispensingTime.setValue([data.startTime,data.endTime]);
619
+		this.loadStartTime = data.startTime
620
+		this.loadEndTime = data.endTime
604 621
 		this.modal = true
605 622
   }
606 623
 
@@ -689,7 +706,7 @@ export class DispensingBatchComponent implements OnInit {
689 706
 
690 707
 	// 发药并打印
691 708
 	printData = []; 
692
-	dispensingPrint(e, data, id?){
709
+	print(e, data, id){
693 710
 		this.rowData = data
694 711
 		e.stopPropagation();
695 712
 		let that = this;
@@ -714,15 +731,40 @@ export class DispensingBatchComponent implements OnInit {
714 731
 				}
715 732
 		    that.printData = arr;
716 733
 		    that.printLoading = false;
734
+				that.btnLoading = false;
735
+				that.printModal = false;
717 736
 		    setTimeout(() => {
718 737
 		      const printContent = document.getElementById("report");
719
-		      const WindowPrt = window.open("", "", "width=800,height=900");
738
+		      const WindowPrt = window.open("", "", "width=1000,height=900");
720 739
 		      WindowPrt.document.write(printContent.innerHTML);
721 740
 		      WindowPrt.document.close();
722 741
 		      WindowPrt.focus();
723 742
 		      WindowPrt.print();
724 743
 		      WindowPrt.close();
744
+					setTimeout(()=>{
745
+						this.getList();
746
+					},200)
725 747
 		    }, 500);
726 748
 		  });
727 749
 	}
750
+	
751
+	printModal = false;
752
+	printE = '';
753
+	printItemData = '';
754
+	printItemId = '';
755
+	dispensingPrint(e, data, id){
756
+		this.printModal = true
757
+		this.printE = e
758
+		this.printItemData = data
759
+		this.printItemId = id
760
+	}
761
+	
762
+	confirmPrintDel(){
763
+		this.btnLoading = true;
764
+		this.print(this.printE, this.printItemData, this.printItemId)
765
+	}
766
+	
767
+	hidePrintModal(){
768
+		this.printModal = false
769
+	}
728 770
 }

+ 17 - 14
src/app/views/dispensing-detail/dispensing-detail.component.html

@@ -9,29 +9,31 @@
9 9
         [nzLoading]="loading1">
10 10
         <thead>
11 11
           <tr class="thead">
12
-            <th nzWidth="10%">药品名称</th>
13
-            <th nzWidth="10%">规格</th>
12
+						<th nzWidth="9%">药品标识</th>
13
+            <th nzWidth="9%">药品名称</th>
14
+            <th nzWidth="9%">规格</th>
14 15
 						<th nzWidth="9%">消耗数量</th>
15 16
 						<th nzWidth="9%">原库存数</th>
16
-						<th nzWidth="10%">包装规格</th>
17
+						<th nzWidth="9%">包装规格</th>
17 18
 						<th nzWidth="9%">发药箱数</th>
18 19
 						<th nzWidth="9%">实发数量</th>
19
-            <th nzWidth="10%">计算后库存</th>
20
-						<th nzWidth="10%">增减</th>
21
-            <th nzWidth="14%">操作</th>
20
+            <th nzWidth="9%">计算后库存</th>
21
+						<th nzWidth="7%">增减</th>
22
+            <th nzWidth="11%">操作</th>
22 23
           </tr>
23 24
         </thead>
24 25
         <tbody>
25 26
           <tr *ngFor="let data of listOfData">
27
+						<td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugCode:'-' }}</td>
26 28
             <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'-' }}</td>
27 29
             <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.specs:'-' }}</td>
28
-            <td>{{ data.expendCount||'-' }}</td>
29
-            <td>{{ data.formerInventory || '-' }}</td>
30
-            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.packingSpecs:'-' }}</td>
31
-						<td>{{ data.cartonNum||'-' }}</td>
32
-						<td>{{ data.actualCount||'-' }}</td>
33
-						<td>{{ data.afterInventory||'-' }}</td>
34
-						<td>{{ data.addSub||'-' }}</td>
30
+            <td>{{ data.expendCount||'0' }}</td>
31
+            <td>{{ data.formerInventory || '0' }}</td>
32
+            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.packingSpecs:'0' }}</td>
33
+						<td>{{ data.cartonNum||'0' }}</td>
34
+						<td>{{ data.actualCount||'0' }}</td>
35
+						<td>{{ data.afterInventory||'0' }}</td>
36
+						<td>{{ data.addSub||'0' }}</td>
35 37
             <td>
36 38
               <div class="coop">
37 39
                 <span (click)="itemClick($event,data.id, 'add')">增加</span>
@@ -45,7 +47,7 @@
45 47
   </div>
46 48
 	<div class="right-content">
47 49
 		<div class="right-top">
48
-			<h3 class="title">快速搜索发药科室</h3>
50
+			<h3 class="title">快速添加发药科室</h3>
49 51
 			<div class="right-template">
50 52
 			  <span class="label">科室:</span>
51 53
 			  <nz-select class="formItem" (ngModelChange)="deptChange($event)" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event, 'dept')" nzServerSearch nzShowSearch nzPlaceHolder="请选择科室" [(ngModel)]="department">
@@ -56,6 +58,7 @@
56 58
 			      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
57 59
 			    </nz-option>
58 60
 			  </nz-select>
61
+				<span (click)='addDept()' class="icon_transport transport-tag27fuben add-class"></span>
59 62
 			</div>
60 63
 		</div>
61 64
 		<div class="right-bottom">

+ 6 - 1
src/app/views/dispensing-detail/dispensing-detail.component.less

@@ -83,11 +83,16 @@ h3{
83 83
 				align-items: center;
84 84
 				margin-top: 10px;
85 85
 				.label{
86
-					width:50px;
86
+					width:55px;
87 87
 				}
88 88
 				.ant-select{
89 89
 					width: 100%;
90 90
 				}
91
+				.add-class{
92
+					margin-left: 10px;
93
+					cursor: pointer;
94
+					color: #34b349;
95
+				}
91 96
 			}
92 97
 			
93 98
 		}

+ 28 - 10
src/app/views/dispensing-detail/dispensing-detail.component.ts

@@ -104,7 +104,7 @@ export class DispensingDetailComponent implements OnInit {
104 104
     	sum: 9999,
105 105
     	drugsConfigure: {
106 106
     	  hosId: this.hosId,
107
-				deptId :this.deptId,
107
+				deptId :this.deptId?this.deptId:null,
108 108
     	  batchId: this.detailId
109 109
     	}
110 110
     };
@@ -134,10 +134,14 @@ export class DispensingDetailComponent implements OnInit {
134 134
 		}else{
135 135
 			delete data.drugsConfigure.batchId
136 136
 		}
137
+		let deptData = this.hospitals1.find(i=>i.id==e)
137 138
 		that.mainService
138 139
 		  .getFetchDataList("data", "drugsConfigure", data)
139 140
 		  .subscribe((res) => {
140
-				this.getDeptData(e,'all','')
141
+				if(res.list.length==0){
142
+					this.message.error(`您选择的科室“	${deptData.dept}”时间段内没有消耗药品无法添加发药单。`)
143
+				}
144
+				this.getDeptData(e,'all','load')
141 145
 		  });
142 146
 	}
143 147
 	
@@ -175,7 +179,10 @@ export class DispensingDetailComponent implements OnInit {
175 179
 		  .subscribe((res) => {
176 180
 				that.btnLoading = false;
177 181
 				that.delModal = false;
178
-				this.getDispensingDept('','')
182
+				this.deptId = null
183
+				this.deptName = null
184
+				this.deptIndex = null
185
+				this.getDeptData('','all','load')
179 186
 				if (res.status==200) {
180 187
 				  that.showPromptModal("删除", true, "");
181 188
 				} else {
@@ -185,6 +192,10 @@ export class DispensingDetailComponent implements OnInit {
185 192
 	}
186 193
 	// 选择楼栋
187 194
 	buildingChange(e){
195
+		this.deptId = null
196
+		this.deptName = null
197
+		this.deptIndex = null
198
+		this.listOfData=[]
188 199
 		this.getDeptData(e,'','')
189 200
 	}
190 201
 	
@@ -210,24 +221,31 @@ export class DispensingDetailComponent implements OnInit {
210 221
 		that.mainService
211 222
 		  .getFetchDataList("data", "drugsList", data)
212 223
 		  .subscribe((res) => {
213
-				// this.deptId = null
214
-				// this.deptName = null
215
-				// this.deptIndex = null
216 224
 		    that.deptList = res.list;
217 225
 				if(initial=='load'){
218 226
 					if(res.list.length>0){
219
-						this.deptId = res.list[0].id
227
+						this.deptId = res.list[0].applyDeptDTO.id
220 228
 						this.deptName = res.list[0].applyDeptDTO.dept
221 229
 						this.deptIndex = 0
222
-						this.getList()
223 230
 					}
231
+					this.getList()
224 232
 				}
225 233
 		  });
226 234
 	}
227 235
 	
228 236
 	// 选择科室
237
+	addDeptId=''
229 238
 	deptChange(e){
230
-		this.getDispensingDept(e,'dept')
239
+		this.addDeptId = e
240
+		
241
+	}
242
+	// 添加科室
243
+	addDept(){
244
+		if(this.addDeptId){
245
+			this.getDispensingDept(this.addDeptId,'dept')
246
+		}else{
247
+			this.message.error('请先选择发药科室')
248
+		}
231 249
 	}
232 250
 	
233 251
 	// 获取楼栋
@@ -313,6 +331,7 @@ export class DispensingDetailComponent implements OnInit {
313 331
 	    .subscribe((data) => {
314 332
 	      that.btnLoading = false;
315 333
 	      that.hideModal();
334
+				this.getList()
316 335
 	      if (data.status == 200) {
317 336
 	        that.showPromptModal(that.add ? "增加" : "减少", true, "");
318 337
 	      } else {
@@ -358,7 +377,6 @@ export class DispensingDetailComponent implements OnInit {
358 377
     setTimeout(() => {
359 378
       this.promptModalShow = true;
360 379
     }, 100);
361
-    this.getList();
362 380
   }
363 381
 
364 382
   delModal: boolean = false; //删除模态框

+ 17 - 16
src/app/views/drug-cloud/drug-cloud.component.html

@@ -35,7 +35,8 @@
35 35
         [nzLoading]="loading1">
36 36
         <thead>
37 37
           <tr class="thead">
38
-						<th nzWidth="20%">科室名称</th>
38
+						<th nzWidth="10%">科室名称</th>
39
+						<th nzWidth="10%">药品标识</th>
39 40
             <th nzWidth="20%">药品名称</th>
40 41
             <th nzWidth="10%">规格</th>
41 42
             <th nzWidth="20%">库存数量(正负值)</th>
@@ -45,14 +46,15 @@
45 46
         </thead>
46 47
         <tbody>
47 48
           <tr *ngFor="let data of listOfData" (click)="selectedListData(data.id)">
48
-            <td>{{ data.departmentDTO?data.departmentDTO.dept:'无' }}</td>
49
-            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'无' }}</td>
50
-            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.specs:'无' }}</td>
51
-            <td>{{ data.inventoryNum || '无' }}</td>
52
-            <td>{{ data.inventoryPrice || '无' }}</td>
49
+            <td>{{ data.departmentDTO?data.departmentDTO.dept:'-' }}</td>
50
+						<td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugCode:'-' }}</td>
51
+            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'-' }}</td>
52
+            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.specs:'0' }}</td>
53
+            <td>{{ data.inventoryNum || '0' }}</td>
54
+            <td>{{ data.inventoryPrice || '0' }}</td>
53 55
             <td>
54 56
               <div class="coop">
55
-                <span *ngIf="coopBtns.historyRecord" (click)="detail($event,data.id)">历史记录</span>
57
+                <span *ngIf="coopBtns.historyRecord" (click)="detail($event,data)">历史记录</span>
56 58
               </div>
57 59
             </td>
58 60
           </tr>
@@ -94,13 +96,13 @@
94 96
                 <td>{{ data.createTime|date:'yyyy-MM-dd HH:mm'}}</td>
95 97
                 <td>{{ data.drugsList?data.drugsList.batch.batchNo : '无' }}</td>
96 98
                 <td>{{ data.drugsList?data.drugsList.packingNo : '无' }}</td>
97
-								<td>{{ data.drugsConfig?data.drugsConfig.expendCount:'' }}</td>
98
-								<td>{{ data.drugsConfig?data.drugsConfig.formerInventory:'无' }}</td>
99
-								<td>{{ data.drugsConfig?data.drugsConfig.addSub:'无' }}</td>
100
-                <td>{{ data.drugsInfo?data.drugsInfo.packingSpecs:'' }}</td>
101
-                <td>{{ data.drugsConfig?data.drugsConfig.cartonNum : '' }}</td>
102
-                <td>{{ data.drugsConfig?data.drugsConfig.actualCount : ''}}</td>
103
-        				<td>{{ data.drugsConfig?data.drugsConfig.afterInventory : '' }}</td>
99
+								<td>{{ data.drugsConfig?data.drugsConfig.expendCount:'0' }}</td>
100
+								<td>{{ data.drugsConfig&&data.drugsConfig.formerInventory?data.drugsConfig.formerInventory:'0' }}</td>
101
+								<td>{{ data.drugsConfig&&data.drugsConfig.addSub?data.drugsConfig.addSub:'0' }}</td>
102
+                <td>{{ data.drugsInfo?data.drugsInfo.packingSpecs:'0' }}</td>
103
+                <td>{{ data.drugsConfig?data.drugsConfig.cartonNum : '0' }}</td>
104
+                <td>{{ data.drugsConfig?data.drugsConfig.actualCount : '0'}}</td>
105
+        				<td>{{ data.drugsConfig?data.drugsConfig.afterInventory : '0' }}</td>
104 106
               </tr>
105 107
             </tbody>
106 108
           </nz-table>
@@ -121,6 +123,5 @@
121 123
 <!-- 操作成功/失败提示框 -->
122 124
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
123 125
   [info]="promptInfo"></app-prompt-modal>
124
-<!-- 遮罩 -->
125
-<app-mask *ngIf="maskFlag"></app-mask>
126
+
126 127
 <app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 3 - 2
src/app/views/drug-cloud/drug-cloud.component.ts

@@ -298,7 +298,7 @@ export class DrugCloudComponent implements OnInit {
298 298
   }
299 299
 
300 300
   // 查看
301
-  detail(e, id) {
301
+  detail(e, item) {
302 302
     e.stopPropagation();
303 303
 		var that = this;
304 304
 		let data = {
@@ -306,7 +306,8 @@ export class DrugCloudComponent implements OnInit {
306 306
 			sum: 9999,
307 307
 			drugsLog: {
308 308
 			  hosId: this.hosId,
309
-			  drugListId: id
309
+			  drugId: item.drugId,
310
+				deptId: item.deptId
310 311
 			}
311 312
 		};
312 313
 		this.loading1 = true;

+ 11 - 11
src/app/views/drug-info/drug-info.component.html

@@ -24,14 +24,14 @@
24 24
           <tr class="thead">
25 25
             <th nzWidth="5%">序号</th>
26 26
             <th nzWidth="10%">药品标识</th>
27
-            <th nzWidth="10%">药品名称</th>
28
-            <th nzWidth="5%">规格</th>
29
-            <th nzWidth="10%">单位</th>
30
-            <th nzWidth="15%">单价</th>
31
-            <th nzWidth="15%">包装规格</th>
32
-            <th nzWidth="10%">低舍</th>
33
-						<th nzWidth="10%">高入</th>
34
-            <th nzWidth="20%">操作</th>
27
+            <th nzWidth="20%">药品名称</th>
28
+            <th nzWidth="10%">规格</th>
29
+            <th nzWidth="9%">单位</th>
30
+            <th nzWidth="9%">单价</th>
31
+            <th nzWidth="9%">包装规格</th>
32
+            <th nzWidth="9%">低舍</th>
33
+						<th nzWidth="9%">高入</th>
34
+            <th nzWidth="10%">操作</th>
35 35
           </tr>
36 36
         </thead>
37 37
         <tbody>
@@ -135,6 +135,7 @@
135 135
 				  <nz-form-control nzErrorTip="请填写低舍!">
136 136
 				    <nz-input-group>
137 137
 							<nz-input-number
138
+								(ngModelChange)="lowerChange($event)"
138 139
 								formControlName="lowerRound"
139 140
 								[nzMin]="0"
140 141
 								[nzPrecision]="0"
@@ -151,6 +152,7 @@
151 152
 				    <nz-input-group>
152 153
 							<nz-input-number
153 154
 								formControlName="upperRound"
155
+								[nzDisabled]="true"
154 156
 								[nzMin]="0"
155 157
 								[nzPrecision]="0"
156 158
 								[nzMax]="999999"
@@ -169,7 +171,7 @@
169 171
   </div>
170 172
 </div>
171 173
 <!-- 删除模态框 -->
172
-<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" [cancenlLoading]="cancenlLoading"
174
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" 
173 175
   (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="是否删除药品信息?" confirmTxt="是" cancelTxt="否">
174 176
 </app-dialog-delete>
175 177
 
@@ -180,5 +182,3 @@
180 182
 <!-- 查看详情 -->
181 183
 <router-outlet (deactivate)="getList()"></router-outlet>
182 184
 
183
-<!-- 遮罩 -->
184
-<app-mask *ngIf="maskFlag"></app-mask>

+ 5 - 1
src/app/views/drug-info/drug-info.component.ts

@@ -63,7 +63,6 @@ export class DrugInfoComponent implements OnInit {
63 63
   wxRequired = false; //新增或编辑用户的时候,微信号是否必填
64 64
   changeInpSubject = new Subject(); //防抖
65 65
   changeInpHospitalSubject = new Subject(); //防抖
66
-	
67 66
   ngOnInit() {
68 67
     this.coopBtns = this.tool.initCoopBtns(this.route);
69 68
 		this.hosId = this.tool.getCurrentHospital().id;
@@ -117,6 +116,11 @@ export class DrugInfoComponent implements OnInit {
117 116
 			this.getList();
118 117
 		});
119 118
 	}
119
+	
120
+	lowerChange(e){
121
+		this.validateForm.controls.upperRound.setValue(e+1);
122
+	}
123
+	
120 124
 	// 监听标识输入
121 125
 	handleInput(event: KeyboardEvent){
122 126
 		const input = event.target as HTMLInputElement;