maotao 9 månader sedan
förälder
incheckning
0c12cc10e3
37 ändrade filer med 5341 tillägg och 3 borttagningar
  1. 5 0
      src/app/app-routing.module.ts
  2. 17 0
      src/app/services/main.service.ts
  3. 13 0
      src/app/services/tool.service.ts
  4. 24 0
      src/app/views/admin-office-prescription/admin-office-prescription-routing.module.ts
  5. 219 0
      src/app/views/admin-office-prescription/admin-office-prescription.component.html
  6. 233 0
      src/app/views/admin-office-prescription/admin-office-prescription.component.less
  7. 882 0
      src/app/views/admin-office-prescription/admin-office-prescription.component.ts
  8. 19 0
      src/app/views/admin-office-prescription/admin-office-prescription.module.ts
  9. 14 0
      src/app/views/big-transfusion-set/big-transfusion-set-routing.module.ts
  10. 49 0
      src/app/views/big-transfusion-set/big-transfusion-set.component.html
  11. 94 0
      src/app/views/big-transfusion-set/big-transfusion-set.component.less
  12. 223 0
      src/app/views/big-transfusion-set/big-transfusion-set.component.ts
  13. 17 0
      src/app/views/big-transfusion-set/big-transfusion-set.module.ts
  14. 20 0
      src/app/views/dispensing-batch/dispensing-batch-routing.module.ts
  15. 199 0
      src/app/views/dispensing-batch/dispensing-batch.component.html
  16. 260 0
      src/app/views/dispensing-batch/dispensing-batch.component.less
  17. 728 0
      src/app/views/dispensing-batch/dispensing-batch.component.ts
  18. 19 0
      src/app/views/dispensing-batch/dispensing-batch.module.ts
  19. 17 0
      src/app/views/dispensing-detail/dispensing-detail-routing.module.ts
  20. 139 0
      src/app/views/dispensing-detail/dispensing-detail.component.html
  21. 380 0
      src/app/views/dispensing-detail/dispensing-detail.component.less
  22. 368 0
      src/app/views/dispensing-detail/dispensing-detail.component.ts
  23. 19 0
      src/app/views/dispensing-detail/dispensing-detail.module.ts
  24. 17 0
      src/app/views/drug-cloud/drug-cloud-routing.module.ts
  25. 126 0
      src/app/views/drug-cloud/drug-cloud.component.html
  26. 251 0
      src/app/views/drug-cloud/drug-cloud.component.less
  27. 322 0
      src/app/views/drug-cloud/drug-cloud.component.ts
  28. 19 0
      src/app/views/drug-cloud/drug-cloud.module.ts
  29. 15 0
      src/app/views/drug-info/drug-info-routing.module.ts
  30. 184 0
      src/app/views/drug-info/drug-info.component.html
  31. 130 0
      src/app/views/drug-info/drug-info.component.less
  32. 267 0
      src/app/views/drug-info/drug-info.component.ts
  33. 19 0
      src/app/views/drug-info/drug-info.module.ts
  34. 25 0
      src/app/views/main/main-routing.module.ts
  35. 5 0
      src/app/views/main/main.component.html
  36. 2 2
      src/app/views/office-detail/office-detail.component.html
  37. 1 1
      src/app/views/office-detail/office-detail.component.ts

+ 5 - 0
src/app/app-routing.module.ts

@@ -83,6 +83,11 @@ const routes: Routes = [
83 83
     path: 'washingBatchView',
84 84
     loadChildren: () => import('./views/washing-batch-view/washing-batch-view.module').then(m => m.WashingBatchViewModule),
85 85
   },
86
+	{
87
+	  // 发药批次-配置
88
+	  path: 'dispensingDetail/:id',
89
+	  loadChildren: () => import('./views/dispensing-detail/dispensing-detail.module').then(m => m.DispensingDetailModule),
90
+	},
86 91
   // 管理端首页
87 92
   {
88 93
     path: '**',

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

@@ -811,4 +811,21 @@ export class MainService {
811 811
 	    headers: this.headers,
812 812
 	  });
813 813
 	}
814
+	// 科室发药单打印
815
+	transfusionPrint(model, id): any {
816
+	  return this.http.get(host.host + `/simple/data/fetchData/${model}/${id}`);
817
+	}
818
+	// 科室发药配送建单
819
+	transfusionBuildOrder(data): any {
820
+	  return this.http.post(host.host + "/infusion/solutions/createOrTakeOrder", data, {
821
+	    headers: this.headers,
822
+	  });
823
+	}
824
+	// 发药批次-配置科室删除
825
+	transfusionConfigDeptDel(data): any {
826
+	  return this.http.post(host.host + "/infusion/solutions/remove", data, {
827
+	    headers: this.headers,
828
+	  });
829
+	}
830
+	
814 831
 }

+ 13 - 0
src/app/services/tool.service.ts

@@ -158,6 +158,19 @@ export class ToolService {
158 158
         case "editNum":
159 159
           coopBtns.editNum = true; //矫正重量
160 160
           break;
161
+				case "establish":
162
+				  coopBtns.establish = true; //配送建单
163
+				  break;
164
+				case "historyRecord":
165
+				  coopBtns.historyRecord = true; //历史记录
166
+				  break;
167
+				case "batchPrint":
168
+				  coopBtns.batchPrint = true; //发药并打印
169
+				  break;
170
+				case "config":
171
+				  coopBtns.config = true; //配置
172
+				  break;
173
+					
161 174
       }
162 175
     });
163 176
     console.log(coopBtns);

+ 24 - 0
src/app/views/admin-office-prescription/admin-office-prescription-routing.module.ts

@@ -0,0 +1,24 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { AdminOfficePrescriptionComponent } from './admin-office-prescription.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: AdminOfficePrescriptionComponent,
10
+    children: [
11
+      {
12
+        // 查看详情
13
+        path: 'officeDetail/:id',
14
+        loadChildren: () => import('../office-detail/office-detail.module').then(m => m.OfficeDetailModule),
15
+      }
16
+    ]
17
+  }
18
+];
19
+
20
+@NgModule({
21
+  imports: [RouterModule.forChild(routes)],
22
+  exports: [RouterModule]
23
+})
24
+export class AdminOfficePrescriptionRoutingModule { }

+ 219 - 0
src/app/views/admin-office-prescription/admin-office-prescription.component.html

@@ -0,0 +1,219 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzLg='20' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">申请科室:</span>
7
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event)" nzServerSearch nzShowSearch nzAllowClear nzPlaceHolder="请选择申请科室" [(ngModel)]="department">
8
+            <ng-container *ngFor="let option of hospitals1">
9
+              <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
10
+            </ng-container>
11
+            <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
12
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
13
+            </nz-option>
14
+          </nz-select>
15
+        </div>
16
+        <div class="list-template__searchItem">
17
+          <span class="label">批次号:</span>
18
+          <input nz-input class="formItem" [(ngModel)]="batchNumber" placeholder="请输入批次号" nzSize="default" />
19
+        </div>
20
+        <div class="list-template__searchItem">
21
+          <span class="label">创建时间:</span>
22
+          <nz-range-picker [(ngModel)]="dateRange" [nzShowTime]="{ nzFormat: 'HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
23
+					(ngModelChange)="changeDate($event)"></nz-range-picker>
24
+        </div>
25
+      </div>
26
+      <div nz-col nzLg="4" class="list-template__btns">
27
+        <button class="btn default" (click)='search()'>搜索</button>
28
+        <button class="btn default ml8" (click)='reset()'>重置</button>
29
+      </div>
30
+    </div>
31
+    <div class="list-template__bottom">
32
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
33
+        [nzLoading]="loading1">
34
+        <thead>
35
+          <tr class="thead">
36
+            <th nzWidth="10%">单号|创建时间</th>
37
+            <th nzWidth="10%">批次号</th>
38
+            <th nzWidth="10%">申请科室</th>
39
+            <th nzWidth="7%">总件数</th>
40
+            <th nzWidth="7%">品类数</th>
41
+            <th nzWidth="7%">消耗总价</th>
42
+            <th nzWidth="7%">实发总价</th>
43
+            <th nzWidth="10%">取药药房</th>
44
+						<th nzWidth="7%">是否已建单</th>
45
+						<th nzWidth="6%">状态</th>
46
+            <th nzWidth="18%">操作</th>
47
+          </tr>
48
+        </thead>
49
+        <tbody>
50
+          <tr *ngFor="let data of listOfData" (click)="selectedListData(data.id)">
51
+            <td>
52
+							<div>{{ data.packingNo}}</div>
53
+							<div>{{ data.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
54
+						</td>
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>
61
+            <td>{{ data.pharmacyDTO?data.pharmacyDTO.dept:'-'}}</td>
62
+						<td>{{ data.createOrder==1?'是':'否'}}</td>
63
+						<td>{{ data.orderState.name}}</td>
64
+            <td>
65
+              <div class="coop">
66
+                <span *ngIf="coopBtns.look" (click)="detail($event,data.id)">查看</span>
67
+                <span *ngIf="coopBtns.print" (click)="print($event, data, data.id)">打印</span>
68
+                <span *ngIf="coopBtns.establish && data.createOrder=='0'" (click)="addDateModal(data)">配送建单</span>
69
+              </div>
70
+            </td>
71
+          </tr>
72
+        </tbody>
73
+      </nz-table>
74
+      <div class="list-template__pagination">
75
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
76
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
77
+        </nz-pagination>
78
+      </div>
79
+    </div>
80
+  </div>
81
+
82
+  <!-- 新增/编辑模态框 -->
83
+  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
84
+    <div class="modalBody">
85
+      <div class="title">科室发药单-查看<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
86
+      </div>
87
+      <overlay-scrollbars #osComponentRef1 class="content">
88
+        <div class="list-template__bottom">
89
+          <nz-table class="list-template__nzTable" [nzData]="viewData" nzSize="middle" [nzShowPagination]="false"
90
+            [nzLoading]="loading1">
91
+            <thead>
92
+              <tr class="thead">
93
+                <th nzWidth="15%">药品名称</th>
94
+                <th nzWidth="15%">规格</th>
95
+                <th nzWidth="10%">消耗数量</th>
96
+                <th nzWidth="10%">实发数量</th>
97
+                <th nzWidth="10%">包装规格</th>
98
+                <th nzWidth="10%">发药药箱</th>
99
+                <th nzWidth="10%">原库存数</th>
100
+                <th nzWidth="10%">计算后库存</th>
101
+        				<th nzWidth="10%">增减</th>
102
+              </tr>
103
+            </thead>
104
+            <tbody>
105
+              <tr *ngFor="let data of viewData">
106
+                <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'无' }}</td>
107
+                <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>
115
+              </tr>
116
+            </tbody>
117
+          </nz-table>
118
+        <!--  <div class="list-template__pagination">
119
+            <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
120
+              (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
121
+            </nz-pagination>
122
+          </div> -->
123
+        </div>
124
+      </overlay-scrollbars>
125
+      <div class="display_flex justify-content_flex-center">
126
+        <button class="btn" nz-button nzType="primary" (click)="hideModal()">知道了</button>
127
+      </div>
128
+    </div>
129
+  </div>
130
+  <!-- 删除模态框 -->
131
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
132
+    (confirmDelEvent)="confirmDel()" content="您确认要删除科室吗?"></app-dialog-delete>
133
+
134
+  <!-- 启用停用模态框 -->
135
+  <app-dialog-delete [delModal]="delModal1" (hideDelModalEvent)="hideDelModal1()" [btnLoading]="btnLoading"
136
+    (confirmDelEvent)="confirmDel1()" [content]="'您确认要建立配送工单吗?'"></app-dialog-delete>
137
+
138
+  <!-- 打印 -->
139
+  <div id="report" style="display: none;">
140
+		<div class="monad" 
141
+				style="padding: 10px;
142
+				border: 1px solid #e7e7e7;
143
+				border-radius: 5px;">
144
+			<div class="monad-title" 
145
+				style="text-align: center;
146
+				font-weight: 700;
147
+				font-size: 16px;
148
+				border-bottom: 1px solid #e7e7e7;
149
+				padding-bottom: 10px;">
150
+				大输液发药单-{{rowData.pharmacyDTO?rowData.pharmacyDTO.dept:''}}
151
+			</div>
152
+			<div class="monad-sign" style="display: flex;line-height: 40px;font-size: 14px;">
153
+				<div style="margin-right: 15px;">日期:{{rowData.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
154
+				<div style="margin-right: 15px;">批次号:{{rowData.batch?rowData.batch.batchNo:'-'}}</div>
155
+				<div style="margin-right: 15px;">单号:{{rowData.packingNo}}</div>
156
+			</div>
157
+			<div style="border: 1px solid #e7e7e7;border-bottom: none;font-size: 14px;">
158
+				<div class="thead" style="display: flex;">
159
+					<div style="text-align: center;width: 20%;height: 40px;
160
+					line-height: 40px;
161
+					border-right: 1px solid #e7e7e7;
162
+					border-bottom: 1px solid #e7e7e7;">药品名称</div>
163
+					
164
+					<div style="text-align: center;width: 20%;height: 40px;
165
+					line-height: 40px;
166
+					border-right: 1px solid #e7e7e7;
167
+					border-bottom: 1px solid #e7e7e7;">规格</div>
168
+					
169
+					<div style="text-align: center;width: 20%;height: 40px;
170
+					line-height: 40px;
171
+					border-right: 1px solid #e7e7e7;
172
+					border-bottom: 1px solid #e7e7e7;">总量(实发数量)</div>
173
+					
174
+					<div style="text-align: center;width: 20%;height: 40px;
175
+					line-height: 40px;
176
+					border-right: 1px solid #e7e7e7;
177
+					border-bottom: 1px solid #e7e7e7;">箱数(发药箱数)</div>
178
+					
179
+					<div style="text-align: center;width: 20%;height: 40px;
180
+					line-height: 40px;border-bottom: 1px solid #e7e7e7;">取药药房</div>
181
+				</div>
182
+				<div *ngFor="let data of codes" style="display: flex;">
183
+					<div style="text-align: center;width: 20%;height: 40px;
184
+					line-height: 40px;
185
+					border-right: 1px solid #e7e7e7;
186
+					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.drugName }}</div>
187
+					
188
+					<div style="text-align: center;width: 20%;height: 40px;
189
+					line-height: 40px;
190
+					border-right: 1px solid #e7e7e7;
191
+					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.specs }}</div>
192
+					
193
+					<div style="text-align: center;width: 20%;height: 40px;
194
+					line-height: 40px;
195
+					border-right: 1px solid #e7e7e7;
196
+					border-bottom: 1px solid #e7e7e7;">{{ data.actualCount }}</div>
197
+					
198
+					<div style="text-align: center;width: 20%;height: 40px;
199
+					line-height: 40px;
200
+					border-right: 1px solid #e7e7e7;
201
+					border-bottom: 1px solid #e7e7e7;">{{ data.cartonNum }}</div>
202
+					
203
+					<div style="text-align: center;width: 20%;height: 40px;
204
+					line-height: 40px;border-bottom: 1px solid #e7e7e7;">{{ data.deptName }}</div>
205
+				</div>
206
+			</div>
207
+		</div>
208
+  </div>
209
+
210
+</div>
211
+<!-- 操作成功/失败提示框 -->
212
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
213
+  [info]="promptInfo"></app-prompt-modal>
214
+
215
+<!-- 查看详情 -->
216
+<router-outlet></router-outlet>
217
+<!-- 遮罩 -->
218
+<app-mask *ngIf="maskFlag"></app-mask>
219
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 233 - 0
src/app/views/admin-office-prescription/admin-office-prescription.component.less

@@ -0,0 +1,233 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  .add-button {
4
+    margin: 0 auto 16px !important;
5
+  }
6
+  .targetDept {
7
+    overflow: hidden;
8
+    // width: 90px;
9
+    text-overflow: ellipsis;
10
+    white-space: nowrap;
11
+  }
12
+  .dynamic {
13
+    margin-bottom: 16px;
14
+    display: flex;
15
+    align-items: center;
16
+    input {
17
+      width: 90%;
18
+    }
19
+    i {
20
+      margin-left: 8px;
21
+      cursor: pointer;
22
+      font-size: 18px;
23
+    }
24
+  }
25
+}
26
+
27
+.save {
28
+  position: fixed;
29
+  left: 0;
30
+  top: 0;
31
+  width: 100%;
32
+  height: 100%;
33
+  background: rgba(0, 0, 0, 0.4);
34
+  z-index: 99;
35
+
36
+  .modalBody {
37
+    width: 350px;
38
+    background: #fff;
39
+    border-radius: 5px;
40
+    padding: 10px 20px;
41
+    color: #333;
42
+
43
+    .title {
44
+      width: 100%;
45
+      text-align: center;
46
+      font-size: 18px;
47
+      position: relative;
48
+
49
+      i {
50
+        position: absolute;
51
+        right: 0;
52
+        top: 0;
53
+        font-size: 20px;
54
+        color: #666;
55
+        cursor: pointer;
56
+        padding: 0 5px;
57
+      }
58
+    }
59
+
60
+    .content {
61
+      width: 100%;
62
+      height: 117px;
63
+      background: #f9fafb;
64
+      border: 1px solid #e5e9ed;
65
+      border-radius: 5px;
66
+      overflow: hidden;
67
+      margin-top: 12px;
68
+
69
+      div {
70
+        text-align: center;
71
+        margin: 0;
72
+
73
+        &.icon {
74
+          margin-top: 17px;
75
+
76
+          i {
77
+            color: #34b349;
78
+            font-size: 30px !important;
79
+
80
+            &.transport-wenhao {
81
+              color: #f5a523;
82
+            }
83
+
84
+            &.transport-shibai {
85
+              color: #ff3a52;
86
+            }
87
+          }
88
+        }
89
+
90
+        &.defeat {
91
+          color: #333;
92
+          font-size: 18px;
93
+        }
94
+
95
+        &:nth-child(3) {
96
+          font-size: 14px;
97
+          color: #666;
98
+        }
99
+      }
100
+    }
101
+
102
+    button {
103
+      margin-top: 10px;
104
+
105
+      &.btn {
106
+        margin-left: 8px;
107
+      }
108
+    }
109
+  }
110
+
111
+  // 新增
112
+  &.add {
113
+    .modalBody {
114
+      width: 80%;
115
+      height: auto;
116
+
117
+      .content {
118
+        width: 100%;
119
+        height: auto;
120
+        padding: 19px 14px 0 14px;
121
+        max-height: 500px;
122
+        overflow-y: auto;
123
+				
124
+				.list-template__bottom {
125
+				  background: #f9fafb;
126
+				  border: 1px solid #e5e9ed;
127
+				  border-radius: 8px;
128
+				  padding-bottom: 56px;
129
+				  position: relative;
130
+				  .list-template__nzTable {
131
+				    padding: 16px 16px 0;
132
+				
133
+				    .thead {
134
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
135
+				
136
+				      th {
137
+				        background: transparent;
138
+				        color: #fff;
139
+				        text-align: center;
140
+				      }
141
+				    }
142
+				
143
+				    .ant-table-body {
144
+				      border-bottom: 1px solid #e5e9ed;
145
+				    }
146
+				
147
+				    .ant-table-tbody {
148
+				      tr {
149
+				        text-align: center;
150
+				        color: #333;
151
+				
152
+				        td {
153
+				          border: none;
154
+				
155
+				          &.tab_hover:hover{
156
+				            text-decoration: underline;
157
+				            cursor: pointer;
158
+				          }
159
+				
160
+				          .coop {
161
+				            button{
162
+				              color: #333;
163
+				            }
164
+				            span,button {
165
+				              display: inline-block;
166
+				              padding: 0 8px;
167
+				              cursor: pointer;
168
+				              position: relative;
169
+				
170
+				              &::after {
171
+				                content: "|";
172
+				                position: absolute;
173
+				                top: 0;
174
+				                right: 0;
175
+				              }
176
+				
177
+				              &:hover,
178
+				              &:active {
179
+				                color: @primary-color;
180
+				              }
181
+				
182
+				              &:nth-last-child(1) {
183
+				                &::after {
184
+				                  content: "";
185
+				                }
186
+				              }
187
+				            }
188
+				          }
189
+				        }
190
+				      }
191
+				    }
192
+				  }
193
+				  .list-template__pagination {
194
+				    height: 56px;
195
+				    display: flex;
196
+				    align-items: center;
197
+				    position: absolute;
198
+				    right: 8px;
199
+				  }
200
+				}
201
+				
202
+        .addForm {
203
+          .ant-form-item {
204
+            margin-bottom: 14px;
205
+
206
+            .ant-form-item-label {
207
+              line-height: 14px;
208
+              text-align: left;
209
+            }
210
+          }
211
+        }
212
+
213
+        .editForm {
214
+          .ant-form-item {
215
+            margin-bottom: 14px;
216
+
217
+            .ant-form-item-label {
218
+              line-height: 0;
219
+              text-align: left;
220
+            }
221
+          }
222
+        }
223
+      }
224
+
225
+      button {
226
+        &:nth-child(1) {
227
+          margin-right: 20px;
228
+        }
229
+      }
230
+    }
231
+  }
232
+}
233
+

+ 882 - 0
src/app/views/admin-office-prescription/admin-office-prescription.component.ts

@@ -0,0 +1,882 @@
1
+import { Component, OnInit, ViewChild} from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { format } from "date-fns";
14
+import { NzMessageService } from "ng-zorro-antd";
15
+import { Subject } from "rxjs";
16
+import { debounceTime, filter } from "rxjs/operators";
17
+import host from "../../../assets/js/http";
18
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
19
+
20
+@Component({
21
+  selector: "app-admin-office-prescription",
22
+  templateUrl: "./admin-office-prescription.component.html",
23
+  styleUrls: ["./admin-office-prescription.component.less"],
24
+})
25
+export class AdminOfficePrescriptionComponent implements OnInit{
26
+  @ViewChild("osComponentRef1", {
27
+    read: OverlayScrollbarsComponent,
28
+    static: false,
29
+  })
30
+  osComponentRef1: OverlayScrollbarsComponent;
31
+  constructor(
32
+    private message: NzMessageService,
33
+    private fb: FormBuilder,
34
+    private route: ActivatedRoute,
35
+    private router: Router,
36
+    private mainService: MainService,
37
+    private tool: ToolService,
38
+    private http: HttpClient,
39
+  ) {}
40
+	
41
+  ngOnInit() {
42
+    this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
43
+      // this.getAllParentdepart(v).subscribe((result) => {
44
+      //   this.isLoading = false;
45
+      //   if (result.status == 200) {
46
+      //     this.allParentdepart = result.list;
47
+      //   }
48
+      // });
49
+			this.isDeptLoading = true;
50
+			this.getDeparts(e);
51
+    });
52
+		this.hosId = this.tool.getCurrentHospital().id;
53
+    this.coopBtns = this.tool.initCoopBtns(this.route);
54
+    this.initForm();
55
+    this.getAllHospital();
56
+    // this.getType();
57
+    // this.getDeptHandoverType();
58
+  }
59
+  listOfData: any[] = []; //表格数据
60
+  promptContent: string; //操作提示框提示信息
61
+  ifSuccess: boolean; //操作成功/失败
62
+  promptInfo: string; //操作结果提示信息
63
+  promptModalShow: boolean; //操作提示框是否展示
64
+  modal: boolean = false; //新增/编辑模态框
65
+  add: boolean; //true:新增;false:编辑
66
+  validateForm: FormGroup; //新增/编辑表单
67
+  coopId: number; //表格中执行操作的id
68
+  department: ""; //所属科室
69
+	hosId: number; 
70
+	dateRange;//时间
71
+  batchNumber; //批次号
72
+  num; //编码
73
+  deptalias; //别名
74
+  type; //类型
75
+  deptHandoverType; //类型
76
+  pageIndex: number = 1; //页码
77
+  listLength: number = 10; //总条数
78
+  pageSize: number = 10; //每页条数
79
+  btnLoading: boolean = false; //确认按钮loading状态
80
+  printLoading: boolean = false; //批量打印按钮loading状态
81
+  deptPhones: any = []; //新添加的科室电话列表
82
+  isAddDeptsPhone = true; //添加新的科室电话是否禁用
83
+  deptsPhoneId = 1; //科室电话自增id
84
+  allParentdepart: any = []; //所有的父级科室列表
85
+  hospitals1: any = []; //科室列表(搜索)
86
+	rowData: object = {}; //打印选择列表
87
+  searchParentDeptSubject = new Subject();
88
+  // 初始化增删改按钮
89
+  coopBtns: any = {};
90
+	viewData: any = []; //科室单查看数据
91
+  // 模板导出
92
+  excelExport(){
93
+    this.maskFlag = this.message.loading("下载模板中..", {
94
+      nzDuration: 0,
95
+    }).messageId;
96
+    this.mainService.exportExcel("department", {}).subscribe(
97
+      (data) => {
98
+        this.message.remove(this.maskFlag);
99
+        this.maskFlag = false;
100
+        this.message.success('下载模板成功');
101
+        var file = new Blob([data], {
102
+          type: "application/vnd.ms-excel",
103
+        });
104
+        //trick to download store a file having its URL
105
+        var fileURL = URL.createObjectURL(file);
106
+        var a = document.createElement("a");
107
+        a.href = fileURL;
108
+        a.target = "_blank";
109
+        a.download = "科室导入模板.xls";
110
+        document.body.appendChild(a);
111
+        a.click();
112
+      },
113
+      (err) => {
114
+        this.message.remove(this.maskFlag);
115
+        this.maskFlag = false;
116
+        this.message.error('下载模板失败');
117
+      }
118
+    );
119
+  }
120
+
121
+  // 导入---start
122
+  // model-取消
123
+  isShow = false;
124
+  hideExcelImport() {
125
+    this.isShow = false;
126
+  }
127
+  // 触发
128
+  excelImport() {
129
+    this.isShow = true;
130
+  }
131
+  submitExcelImport({fileList}){
132
+    this.isShow = false;
133
+    const formData = new FormData();
134
+    fileList.forEach((file: any) => {
135
+      formData.append('file', file);
136
+    });
137
+    this.maskFlag = this.message.loading("正在导入中..", {
138
+      nzDuration: 0,
139
+    }).messageId;
140
+    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/department', formData, {
141
+      reportProgress: true
142
+    });
143
+    this.http
144
+      .request(req)
145
+      .pipe(filter(e => e instanceof HttpResponse))
146
+      .subscribe(
147
+        (res:any) => {
148
+          if(res.body.status == 200){
149
+            this.message.remove(this.maskFlag);
150
+            this.maskFlag = false;
151
+            this.message.success('导入成功');
152
+            this.getList();
153
+          }else{
154
+            this.message.remove(this.maskFlag);
155
+            this.maskFlag = false;
156
+            this.showPromptModal("导入", false, res.body.msg);
157
+          }
158
+        },
159
+        () => {
160
+          this.message.remove(this.maskFlag);
161
+          this.maskFlag = false;
162
+          this.message.error('导入失败');
163
+        },
164
+      );
165
+  }
166
+  // 导入---end
167
+  //搜索父级科室
168
+	isDeptLoading = false;
169
+  changeInp(e) {
170
+    this.searchParentDeptSubject.next(e);
171
+  }
172
+  // 打开父级科室下拉框baba
173
+  isLoading = false;
174
+  openDeptSelect(flag) {
175
+    if (flag) {
176
+      this.isLoading = true;
177
+      this.getAllParentdepart().subscribe((result) => {
178
+        this.isLoading = false;
179
+        if (result.status == 200) {
180
+          this.allParentdepart = result.list;
181
+        }
182
+      });
183
+    }
184
+  }
185
+  // 配送建单
186
+  coopData:any = {};
187
+  addDateModal(data) {
188
+    this.coopData = data;
189
+    this.showDelModal1();
190
+  }
191
+  delModal1: boolean = false; //删除模态框
192
+
193
+  showDelModal1() {
194
+    this.delModal1 = true;
195
+  }
196
+  hideDelModal1() {
197
+    this.delModal1 = false;
198
+  }
199
+  // 确认配送工单
200
+  confirmDel1() {
201
+    this.btnLoading = true;
202
+    this.mainService
203
+      .transfusionBuildOrder({
204
+				drugsListId:this.coopData.id
205
+			})
206
+      .subscribe((data) => {
207
+        this.btnLoading = false;
208
+        this.delModal1 = false;
209
+        if (data.status == 200) {
210
+          this.showPromptModal('操作', true, "");
211
+        } else {
212
+          this.showPromptModal('操作', false, data.msg);
213
+        }
214
+      });
215
+  }
216
+  //获取所有的父级科室列表
217
+  getAllParentdepart(keyWord = "") {
218
+    let postData: any = {
219
+      idx: 0,
220
+      sum: 10,
221
+      department: {
222
+        // hospital: { id: this.add ? this.tool.getCurrentHospital().id : this.hospital },
223
+        keyWord: keyWord,
224
+      },
225
+    };
226
+    if (this.coopItem) {
227
+      // 过滤这个科室及其子科室
228
+      postData.department.filterByDeptId = this.coopItem.id;
229
+    }
230
+    return this.mainService.getFetchDataList("data", "department", postData);
231
+  }
232
+  // 新添加科室号码
233
+  addDeptPhone(e: MouseEvent) {
234
+    e.preventDefault();
235
+    this.deptPhones.push({ id: ++this.deptsPhoneId, phone: "" });
236
+    this.deptsPhoneChange();
237
+  }
238
+  // 删除新添加科室号码
239
+  removeDeptPhone(index: number, e: MouseEvent) {
240
+    e.preventDefault();
241
+    this.deptPhones.splice(index, 1);
242
+    this.deptsPhoneChange();
243
+  }
244
+  //监听科室电话输入事件
245
+  deptsPhoneChange(e?, phone?) {
246
+    if (e !== undefined && phone !== undefined) {
247
+      phone.phone = e;
248
+    }
249
+    // -------------判断添加按钮是否禁用 start
250
+    this.isAddDeptsPhone = !this.validateForm.value.officeNum;
251
+    if (!this.isAddDeptsPhone) {
252
+      //如果没禁用
253
+      this.isAddDeptsPhone = this.deptPhones.some((item) => item.phone === "");
254
+    }
255
+    // -------------判断添加按钮是否禁用 end
256
+  }
257
+
258
+  // 搜索
259
+  search() {
260
+    this.pageIndex = 1;
261
+    this.getList();
262
+  }
263
+  // 重置
264
+  reset() {
265
+    this.pageIndex = 1;
266
+    this.department = null;
267
+    this.batchNumber = "";
268
+		this.dateRange = [];
269
+		this.startDate = "";
270
+		this.endDate = "";
271
+    this.getList();
272
+  }
273
+  // 表格数据
274
+  loading1 = false;
275
+  getList() {
276
+    var that = this;
277
+    let data = {
278
+      idx: that.pageIndex - 1,
279
+      sum: that.pageSize,
280
+      drugsList: {
281
+        applyDept: that.department,
282
+				batch:{
283
+					batchNo:that.batchNumber
284
+				},
285
+        startTime: this.startDate,
286
+				endTime: this.endDate,
287
+				hosId: this.hosId
288
+      },
289
+    };
290
+		if(that.department){
291
+			data.drugsList.applyDept = that.department
292
+		}else{
293
+			delete data.drugsList.applyDept
294
+		}
295
+		if(that.batchNumber){
296
+			data.drugsList.batch.batchNo = that.batchNumber
297
+		}else{
298
+			delete data.drugsList.batch
299
+		}
300
+    this.loading1 = true;
301
+    that.mainService
302
+      .getFetchDataList("data", "drugsList", data)
303
+      .subscribe((data) => {
304
+        this.loading1 = false;
305
+        that.listOfData = data.list;
306
+        that.listLength = data.totalNum;
307
+      });
308
+  }
309
+	
310
+	// 日期选择
311
+	startDate: string; //发起时间开始
312
+	endDate: string; //发起时间结束
313
+	changeDate(result?): void {
314
+	  if (!result) {
315
+	    this.startDate = this.endDate = "";
316
+	    return;
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";
334
+	}
335
+	
336
+	// 获取所有科室
337
+  // snum = 0;
338
+  getDeparts(dept) {
339
+    var that = this;
340
+    let data = {
341
+      department: {
342
+        dept,
343
+        hospital: {
344
+          id: this.hosId
345
+        },
346
+      },
347
+      idx: 0,
348
+      sum: 20,
349
+    };
350
+    that.mainService
351
+		.getFetchDataList("data", "department", data)
352
+		.subscribe((data) => {
353
+			setTimeout(_=>{
354
+				this.isDeptLoading = false
355
+				this.hospitals1 = data.list
356
+			},500)
357
+		});
358
+  }
359
+	
360
+  // 获取所有院区
361
+  getAllHospital() {
362
+		this.getDeparts('')
363
+    this.getList();
364
+  }
365
+
366
+  // 切换院区选项
367
+  buildings: any = []; //楼栋
368
+  maskFlag: any = false;
369
+  changeHosp(obj?) {
370
+    let hospitalId;
371
+    if (obj) {
372
+      hospitalId = obj.hospital.id;
373
+    }
374
+    let hid;
375
+    if (hospitalId || hospitalId == 0) {
376
+      hid = hospitalId - 0;
377
+    } 
378
+		// else {
379
+  //     hid = this.hospital - 0;
380
+  //   }
381
+    let data = {
382
+      // hosId: this.add ? this.tool.getCurrentHospital().id : hid,
383
+    };
384
+    this.maskFlag = this.message.loading("正在加载中..", {
385
+      nzDuration: 0,
386
+    }).messageId;
387
+    this.mainService
388
+      .coopData("getBuildingOrFloor", "building", data)
389
+      .subscribe((data) => {
390
+        this.buildings = data.data;
391
+        this.floors = [];
392
+        // ---------
393
+        if (obj) {
394
+          //编辑
395
+          let arr = this.buildings.map((item) => item.id);
396
+          if (obj.building.id && arr.includes(obj.building.id)) {
397
+            //有楼栋
398
+            this.changeBuilding(obj.building.id, obj);
399
+            this.validateForm.controls.building.setValue(obj.building.id + "");
400
+          } else {
401
+            //无楼栋
402
+            this.floors = [];
403
+            this.message.remove(this.maskFlag);
404
+            this.maskFlag = false;
405
+            this.modal = true;
406
+            this.validateForm.controls.building.setValue(null);
407
+            this.validateForm.controls.officeAddress.setValue(null);
408
+          }
409
+        } else {
410
+          //新增
411
+          this.message.remove(this.maskFlag);
412
+          this.maskFlag = false;
413
+          this.modal = true;
414
+        }
415
+        // ---------
416
+      });
417
+  }
418
+
419
+  // 切换楼栋信息
420
+  floors: Array<any> = []; //楼层
421
+  floorLoading: boolean = false;
422
+  changeBuilding(buildingId?, obj?) {
423
+    var that = this;
424
+    that.floors = [];
425
+    var bid;
426
+    if (buildingId || buildingId == 0) {
427
+      bid = buildingId - 0;
428
+    } else if (!that.add && that.validateForm.value.building) {
429
+      bid = that.validateForm.value.building - 0;
430
+    } else {
431
+      return;
432
+    }
433
+    let data = {
434
+      buildingId: bid,
435
+    };
436
+    this.floorLoading = true;
437
+    that.mainService
438
+      .coopData("getBuildingOrFloor", "floor", data)
439
+      .subscribe((data) => {
440
+        this.floorLoading = false;
441
+        this.message.remove(this.maskFlag);
442
+        this.maskFlag = false;
443
+        this.modal = true;
444
+        that.floors = data.data;
445
+        if (obj) {
446
+          let floorId = obj.floor.id;
447
+          let arr = that.floors.map((item) => item["id"]);
448
+          if (floorId && arr.includes(floorId)) {
449
+            this.validateForm.controls.floor.setValue(floorId + "");
450
+          } else {
451
+            this.validateForm.controls.floor.setValue(null);
452
+            this.validateForm.controls.officeAddress.setValue(null);
453
+          }
454
+        }
455
+      });
456
+  }
457
+
458
+  // 获取科室类型
459
+  types: Array<any> = [];
460
+  getType() {
461
+    var that = this;
462
+    that.mainService.getDictionary("list", "dept_type").subscribe((data) => {
463
+      console.log(data);
464
+      that.types = data;
465
+    });
466
+  }
467
+
468
+  // 获取科室汇总交接类型
469
+  deptHandoverTypes: Array<any> = [];
470
+  getDeptHandoverType() {
471
+    var that = this;
472
+    that.mainService.getDictionary("list", "dept_handover_type").subscribe((data) => {
473
+      console.log(data);
474
+      that.deptHandoverTypes = data;
475
+    });
476
+  }
477
+
478
+  // 新增弹框
479
+  showModal() {
480
+    this.initForm();
481
+    // this.changeHosp();
482
+    this.add = true;
483
+    this.isAddDeptsPhone = true;
484
+    this.deptPhones = [];
485
+  }
486
+  hideModal() {
487
+    this.coopItem = null;
488
+    this.modal = false;
489
+    this.initForm();
490
+  }
491
+  // 初始化新增form表单
492
+  initForm() {
493
+    this.endTime1Hourdis = () => [];
494
+    this.endTime1Mindis = () => [];
495
+    this.endTime2Hourdis = () => [];
496
+    this.endTime2Mindis = () => [];
497
+    this.startTime1Hourdis = () => [];
498
+    this.startTime1Mindis = () => [];
499
+    this.startTime2Hourdis = () => [];
500
+    this.startTime2Mindis = () => [];
501
+    this.validateForm = this.fb.group({
502
+      parentOfficeName: [null],
503
+      officeName: [null, [Validators.required]],
504
+      deptalias: [null],
505
+      officeNo: [null, [Validators.required]],
506
+      officeNum: [null, [Validators.required]],
507
+      building: [null, [Validators.required]],
508
+      floor: [null, [Validators.required]],
509
+      officeAddress: [null, [Validators.required]],
510
+      officeType: [null, [Validators.required]],
511
+      deptHandoverType: [null],
512
+      startTime1: [null],
513
+      endTime1: [null],
514
+      dynamicCode1: [null],
515
+      startTime2: [null],
516
+      endTime2: [null],
517
+      dynamicCode2: [null],
518
+    });
519
+  }
520
+  // 科室位置必填
521
+  buildValidator = (control: FormControl): { [s: string]: boolean } => {
522
+    if (
523
+      this.validateForm &&
524
+      this.validateForm.value &&
525
+      (!this.validateForm.value.building ||
526
+        !this.validateForm.value.floor ||
527
+        !this.validateForm.value.officeAddress)
528
+    ) {
529
+      return { required: true };
530
+    }
531
+  };
532
+  /**
533
+   * 生成一个从 start 到 end 的连续数组
534
+   * @param start
535
+   * @param end
536
+   */
537
+  generateArray(start, end) {
538
+    return Array.from(new Array(end).keys()).slice(start);
539
+  }
540
+
541
+  //服务时间选择
542
+  // 禁用的小时
543
+  startTime1Hourdis() {
544
+    return [];
545
+  }
546
+  endTime1Hourdis() {
547
+    return [];
548
+  }
549
+  startTime2Hourdis() {
550
+    return [];
551
+  }
552
+  endTime2Hourdis() {
553
+    return [];
554
+  }
555
+  // 禁用的分钟
556
+  startTime1Mindis() {
557
+    return [];
558
+  }
559
+  endTime1Mindis() {
560
+    return [];
561
+  }
562
+  startTime2Mindis() {
563
+    return [];
564
+  }
565
+  endTime2Mindis() {
566
+    return [];
567
+  }
568
+  timeChange(e: boolean, type: string, num: number) {
569
+    if (!e && this.validateForm.value[type + num]) {
570
+      let hour = new Date(this.validateForm.value[type + num]).getHours();
571
+      let minute = new Date(this.validateForm.value[type + num]).getMinutes();
572
+      if (type == "startTime" && num === 1) {
573
+        this.endTime1Hourdis = () => this.generateArray(0, hour);
574
+        this.endTime1Mindis = () => this.generateArray(0, minute + 1);
575
+      } else if (type == "startTime" && num === 2) {
576
+        this.endTime2Hourdis = () => this.generateArray(0, hour);
577
+        this.endTime2Mindis = () => this.generateArray(0, minute + 1);
578
+      } else if (type == "endTime" && num === 1) {
579
+        this.startTime1Hourdis = () => this.generateArray(hour + 1, 24);
580
+        this.startTime1Mindis = () => this.generateArray(minute, 60);
581
+      } else if (type == "endTime" && num === 2) {
582
+        this.startTime2Hourdis = () => this.generateArray(hour + 1, 24);
583
+        this.startTime2Mindis = () => this.generateArray(minute, 60);
584
+      }
585
+    }
586
+  }
587
+  // 表单提交
588
+  submitForm(): void {
589
+    var that = this;
590
+    for (const i in that.validateForm.controls) {
591
+      that.validateForm.controls[i].markAsDirty();
592
+      that.validateForm.controls[i].updateValueAndValidity();
593
+    }
594
+    console.log(that.validateForm);
595
+    if (that.validateForm.invalid) return;
596
+    let deptsPhone = this.deptPhones.map((item) => item.phone).join();
597
+    let data: any = {
598
+      department: {
599
+        dept: that.validateForm.value.officeName,
600
+        deptalias: that.validateForm.value.deptalias,
601
+        // hospital: { id: that.add ? that.tool.getCurrentHospital().id : that.hospital },
602
+        pcode: that.validateForm.value.officeNo,
603
+        manyPhone: deptsPhone
604
+          ? that.validateForm.value.officeNum + "," + deptsPhone
605
+          : that.validateForm.value.officeNum,
606
+        building: { id: that.validateForm.value.building - 0 },
607
+        floor: { id: that.validateForm.value.floor - 0 },
608
+        address: that.validateForm.value.officeAddress,
609
+        type: { id: that.validateForm.value.officeType },
610
+        deptHandoverType: { id: that.validateForm.value.deptHandoverType },
611
+      },
612
+    };
613
+    if (this.validateForm.value.parentOfficeName) {
614
+      data.department.parent = { id: this.validateForm.value.parentOfficeName };
615
+    }
616
+    if (
617
+      this.validateForm.value.startTime1 ||
618
+      this.validateForm.value.endTime1
619
+    ) {
620
+      if (
621
+        this.validateForm.value.startTime1 &&
622
+        this.validateForm.value.endTime1
623
+      ) {
624
+        data.department["startTime1"] = format(
625
+          this.validateForm.value.startTime1,
626
+          "yyyy-MM-dd HH:mm:ss"
627
+        );
628
+        data.department["endTime1"] = format(
629
+          this.validateForm.value.endTime1,
630
+          "yyyy-MM-dd HH:mm:ss"
631
+        );
632
+        data.department["dynamicCode1"] = this.validateForm.value.dynamicCode1 ? 1 : 0;
633
+      } else {
634
+        return;
635
+      }
636
+    }
637
+    if (
638
+      this.validateForm.value.startTime2 ||
639
+      this.validateForm.value.endTime2
640
+    ) {
641
+      if (
642
+        this.validateForm.value.startTime2 &&
643
+        this.validateForm.value.endTime2
644
+      ) {
645
+        data.department["startTime2"] = format(
646
+          this.validateForm.value.startTime2,
647
+          "yyyy-MM-dd HH:mm:ss"
648
+        );
649
+        data.department["endTime2"] = format(
650
+          this.validateForm.value.endTime2,
651
+          "yyyy-MM-dd HH:mm:ss"
652
+        );
653
+        data.department["dynamicCode2"] = this.validateForm.value.dynamicCode2 ? 1 : 0;
654
+      } else {
655
+        return;
656
+      }
657
+    }
658
+    if (!that.add) {
659
+      data.department["id"] = that.coopId;
660
+    }
661
+    that.btnLoading = true;
662
+    that.mainService
663
+      .coopData(that.add ? "addData" : "updData", "department", data)
664
+      .subscribe((data) => {
665
+        that.btnLoading = false;
666
+        that.hideModal();
667
+        that.initForm();
668
+        if (data.status == 200) {
669
+          that.showPromptModal(that.add ? "新增" : "编辑", true, "");
670
+        } else {
671
+          that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
672
+        }
673
+      });
674
+  }
675
+
676
+  // 编辑
677
+  coopItem: any = null;
678
+  edit(e, data) {
679
+    e.stopPropagation();
680
+    this.add = false;
681
+    this.coopId = data.id;
682
+    this.coopItem = data;
683
+    this.isAddDeptsPhone = false;
684
+    this.deptPhones = [];
685
+    let phones = data.manyPhone ? data.manyPhone.split(",") : [];
686
+    if (phones.length === 0) {
687
+      this.validateForm.controls.officeNum.setValue("");
688
+      this.deptPhones = [];
689
+    } else if (phones.length === 1) {
690
+      this.validateForm.controls.officeNum.setValue(phones[0]);
691
+      this.deptPhones = [];
692
+    } else {
693
+      this.validateForm.controls.officeNum.setValue(phones[0]);
694
+      this.deptPhones = phones.slice(1).map((item) => {
695
+        return {
696
+          id: ++this.deptsPhoneId,
697
+          phone: item,
698
+        };
699
+      });
700
+    }
701
+    if (data.startTime1 && data.endTime1) {
702
+      this.validateForm.controls.startTime1.setValue(new Date(data.startTime1));
703
+      this.validateForm.controls.endTime1.setValue(new Date(data.endTime1));
704
+      this.validateForm.controls.dynamicCode1.setValue(data.dynamicCode1 == 1);
705
+    }
706
+    if (data.startTime2 && data.endTime2) {
707
+      this.validateForm.controls.startTime2.setValue(new Date(data.startTime2));
708
+      this.validateForm.controls.endTime2.setValue(new Date(data.endTime2));
709
+      this.validateForm.controls.dynamicCode2.setValue(data.dynamicCode2 == 1);
710
+    }
711
+    this.validateForm.controls.officeAddress.setValue(data.address);
712
+    if (data.parent) {
713
+      this.getAllParentdepart(data.parent.dept).subscribe((res) => {
714
+        if (res.status == 200) {
715
+          this.allParentdepart = res.list;
716
+          this.validateForm.controls.parentOfficeName.setValue(data.parent.id);
717
+        }
718
+      });
719
+    }
720
+    this.validateForm.controls.officeName.setValue(data.dept);
721
+    this.validateForm.controls.deptalias.setValue(data.deptalias);
722
+    this.validateForm.controls.officeNo.setValue(data.pcode);
723
+    this.validateForm.controls.officeType.setValue(data.type.id + "");
724
+    this.validateForm.controls.deptHandoverType.setValue(data.deptHandoverType ? data.deptHandoverType.id + "" : null);
725
+    // this.changeHosp(data);
726
+    this.validateForm.controls.officeAddress.setValue(data.address);
727
+  }
728
+
729
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
730
+  showPromptModal(con, success, promptInfo?) {
731
+    this.promptModalShow = false;
732
+    this.promptContent = con;
733
+    this.ifSuccess = success;
734
+    this.promptInfo = promptInfo;
735
+    setTimeout(() => {
736
+      this.promptModalShow = true;
737
+    }, 100);
738
+    this.getList();
739
+  }
740
+
741
+  delModal: boolean = false; //删除模态框
742
+  coopIds: any;
743
+  coopFlag: any = false;
744
+  /**
745
+   *
746
+   * @param e 事件对象
747
+   * @param flag true是批量删除,false是单个删除
748
+   * @param id
749
+   */
750
+  showDelModal(e, flag, id) {
751
+    e.stopPropagation();
752
+    this.delModal = true;
753
+    this.coopFlag = flag;
754
+    if (flag) {
755
+      this.coopIds = id;
756
+    } else {
757
+      this.coopId = id;
758
+    }
759
+  }
760
+  hideDelModal() {
761
+    this.delModal = false;
762
+  }
763
+  // 确认删除
764
+  confirmDel() {
765
+    var that = this;
766
+    that.btnLoading = true;
767
+    that.mainService
768
+      .coopData(
769
+        "rmvData",
770
+        "department",
771
+        this.coopFlag ? this.coopIds : [that.coopId]
772
+      )
773
+      .subscribe((data) => {
774
+        that.btnLoading = false;
775
+        that.delModal = false;
776
+        if (data.data && data.data[0]) {
777
+          if (!data.data[0].msg) {
778
+            if (
779
+              that.listOfData.length == 1 &&
780
+              that.pageIndex == Math.ceil(that.listLength / that.pageSize)
781
+            ) {
782
+              that.listLength--;
783
+              that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
784
+            }
785
+            that.showPromptModal("删除", true, "");
786
+          } else {
787
+            that.showPromptModal("删除", false, data.data[0].msg);
788
+          }
789
+        } else {
790
+          that.showPromptModal("删除", false, "");
791
+        }
792
+      });
793
+  }
794
+
795
+  // 查看
796
+  detail(e, id) {
797
+    e.stopPropagation();
798
+		var that = this;
799
+		let data = {
800
+			idx: 0,
801
+			sum: 9999,
802
+			drugsConfigure: {
803
+			  hosId: this.hosId,
804
+			  drugListId: id
805
+			}
806
+		};
807
+		this.loading1 = true;
808
+		that.mainService
809
+		  .getFetchDataList("data", "drugsConfigure", data)
810
+		  .subscribe((data) => {
811
+		    this.loading1 = false;
812
+				this.modal = true
813
+		    that.viewData = data.list;
814
+		    // that.listLength = data.totalNum;
815
+		  });
816
+  }
817
+
818
+  // 选中表格中科室
819
+  mapOfCheckedId: { [key: string]: boolean } = {};
820
+  checkedDepIds = []; //已选中科室id
821
+  refreshStatus(): void {
822
+    this.isAllDisplayDataChecked = this.listOfData.every(
823
+      (item) => this.mapOfCheckedId[item.id]
824
+    );
825
+    let arr = [];
826
+    for (var k in this.mapOfCheckedId) {
827
+      if (this.mapOfCheckedId[k]) {
828
+        arr.push(Number(k));
829
+      }
830
+    }
831
+    this.checkedDepIds = arr;
832
+    console.log(this.checkedDepIds);
833
+  }
834
+  //表格整行选中
835
+  selectedListData(id) {
836
+    this.mapOfCheckedId[id] = !this.mapOfCheckedId[id];
837
+    this.refreshStatus();
838
+  }
839
+  // 全选
840
+  isAllDisplayDataChecked = false; //当前页是否全选
841
+  checkAll(value: boolean): void {
842
+    this.listOfData.forEach((item) => (this.mapOfCheckedId[item.id] = value));
843
+    this.refreshStatus();
844
+  }
845
+
846
+  // 打印
847
+  codes = []; //二维码
848
+  print(e, data, id) {
849
+		this.rowData = data
850
+    e.stopPropagation();
851
+    let that = this;
852
+    that.printLoading = true;
853
+    that.mainService
854
+      .transfusionPrint("drugsList", id)
855
+      .subscribe((res) => {
856
+				let arr = res.data.drugsConfigureDTOS;
857
+				for(let i of arr){
858
+					i.deptName = res.data.pharmacyDTO?res.data.pharmacyDTO.dept:'-'
859
+				}
860
+				arr.push({
861
+					drugsInfoDTO:{
862
+						drugName:'合计',
863
+						specs:'',
864
+					},
865
+					actualCount:res.data.totalActual,
866
+					cartonNum:res.data.totalCarton,
867
+					deptName:''
868
+				})
869
+        that.codes = arr
870
+        that.printLoading = false;
871
+        setTimeout(() => {
872
+          const printContent = document.getElementById("report");
873
+          const WindowPrt = window.open("", "", "width=800,height=900");
874
+          WindowPrt.document.write(printContent.innerHTML);
875
+          WindowPrt.document.close();
876
+          WindowPrt.focus();
877
+          WindowPrt.print();
878
+          WindowPrt.close();
879
+        }, 500);
880
+      });
881
+  }
882
+}

+ 19 - 0
src/app/views/admin-office-prescription/admin-office-prescription.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { AdminOfficePrescriptionRoutingModule } from './admin-office-prescription-routing.module';
5
+import { AdminOfficePrescriptionComponent } from './admin-office-prescription.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    AdminOfficePrescriptionComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    AdminOfficePrescriptionRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class AdminOfficePrescriptionModule { }

+ 14 - 0
src/app/views/big-transfusion-set/big-transfusion-set-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { BigTransfusionSetComponent } from './big-transfusion-set.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: BigTransfusionSetComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class BigTransfusionSetRoutingModule { }

+ 49 - 0
src/app/views/big-transfusion-set/big-transfusion-set.component.html

@@ -0,0 +1,49 @@
1
+<div class="TaskTypeManagement">
2
+  <div class="taskTypeInfo">
3
+    <div class="top">
4
+      <div class="item" (click)="tabModal('characteristics')" [ngClass]="{'items':tabModalName=='characteristics'}">
5
+        特性配置
6
+      </div>
7
+      <div class="item" (click)="tabModal('automaticOrderCreation')" [ngClass]="{'items':tabModalName=='automaticOrderCreation'}">
8
+        自动建单配置
9
+      </div>
10
+    </div>
11
+    <div class="list" *ngIf="!loading">
12
+      <!-- 特性配置 -->
13
+      <div *ngIf="tabModalName=='characteristics'">
14
+       <!-- 任务类型 -->
15
+       <div class="display_flex align-items_center mb8">
16
+         <nz-form-label class="label" nzRequired>任务类型</nz-form-label>
17
+         <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
18
+           (nzOnSearch)="changeTasktype($event)" nzPlaceHolder="请选择任务类型" [(ngModel)]="infusionSolutionsTypeId">
19
+           <ng-container *ngFor="let option of taskTypes1">
20
+             <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
21
+           </ng-container>
22
+           <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
23
+             <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
24
+           </nz-option>
25
+         </nz-select>
26
+       </div>
27
+      </div>
28
+      <!-- 自动建单配置 -->
29
+      <div *ngIf="tabModalName=='automaticOrderCreation'">
30
+        <!-- 自动建单 -->
31
+        <div class="display_flex align-items_center mb8">
32
+          <nz-form-label class="label">自动建单</nz-form-label>
33
+          <nz-checkbox-group [(ngModel)]="autoCreateOrders"></nz-checkbox-group>
34
+        </div>
35
+      </div>
36
+      <div class="bottom">
37
+        <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>
38
+      </div>
39
+    </div>
40
+    <div class="list" *ngIf="loading">
41
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
42
+        <div class="loadingFullInner">
43
+          <img src="../../../assets/images/loading.gif" alt="">
44
+          <div>加载中...</div>
45
+        </div>
46
+      </div>
47
+    </div>
48
+  </div>
49
+</div>

+ 94 - 0
src/app/views/big-transfusion-set/big-transfusion-set.component.less

@@ -0,0 +1,94 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  height: 100%;
5
+}
6
+.w320px {
7
+  width: 250px;
8
+}
9
+
10
+.TaskTypeManagement {
11
+  height: calc(100vh - 88px);
12
+  background: #f9fafb;
13
+  overflow: hidden;
14
+  padding: 16px 20px;
15
+
16
+  //任务类型管理-主体
17
+  .taskTypeInfo {
18
+    height: 100%;
19
+    border: 1px solid #e5e9ed;
20
+    background: #fff;
21
+    color: #333;
22
+    position: relative;
23
+
24
+    .top {
25
+      height: 61px;
26
+      line-height: 60px;
27
+      display: flex;
28
+      align-items: center;
29
+      border-bottom: 1px solid #e5e9ed;
30
+      position: relative;
31
+      z-index: 2;
32
+
33
+      .items {
34
+        background: #f0f6ed;
35
+      }
36
+
37
+      & > div {
38
+        border-right: 1px solid #e5e9ed;
39
+        width: 30%;
40
+        text-align: center; // display: flex;
41
+        // align-items: center;
42
+        cursor: pointer;
43
+
44
+        &:hover {
45
+          background: #f0f6ed;
46
+        }
47
+      }
48
+
49
+      &:nth-last-child(4) {
50
+        border: none;
51
+      }
52
+    }
53
+
54
+    .list {
55
+      width: 100%;
56
+      padding: 16px;
57
+      background: #fff;
58
+      height: 89%;
59
+      overflow: auto;
60
+
61
+      nz-form-label {
62
+        margin-left: 0px !important;
63
+      }
64
+
65
+      & > div {
66
+        background: #f9fafb;
67
+        border: 1px solid #e5e9ed;
68
+        border-radius: 10px 10px 0px 0px;
69
+        padding: 24px 120px;
70
+
71
+        .label {
72
+          margin-left: 16px;
73
+          font-size: 14px;
74
+          color: #333;
75
+        }
76
+      }
77
+
78
+      .bottom {
79
+        height: 60px;
80
+        border-radius: 0px 0px 10px 10px;
81
+        padding: 10px 240px 0px 240px;
82
+        border-top: 0px;
83
+
84
+        button {
85
+          width: 80px;
86
+          height: 34px;
87
+          display: block;
88
+          margin: 0 auto;
89
+        }
90
+      }
91
+    }
92
+  }
93
+}
94
+

+ 223 - 0
src/app/views/big-transfusion-set/big-transfusion-set.component.ts

@@ -0,0 +1,223 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { MainService } from 'src/app/services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { NzMessageService } from 'ng-zorro-antd';
5
+import { Subject } from 'rxjs';
6
+import { debounceTime } from 'rxjs/operators';
7
+
8
+@Component({
9
+  selector: "app-big-transfusion-set",
10
+  templateUrl: "./big-transfusion-set.component.html",
11
+  styleUrls: ["./big-transfusion-set.component.less"],
12
+})
13
+export class BigTransfusionSetComponent implements OnInit {
14
+  loading:boolean = false; //页面加载的loading
15
+  btnLoading:boolean = false; //提交按钮的loading
16
+  tabModalName:string = 'characteristics'; //当前选中的tab
17
+  surgeryField = null; //手术关联业务
18
+  hosId = this.tool.getCurrentHospital().id; //当前院区
19
+  // 接手术关联任务类型
20
+  infusionSolutionsTypeId:Number;
21
+  taskTypes1:any[] = [];
22
+  taskTypeData:any[] = [];
23
+  // 苏醒室科室
24
+  recoveryDeptId:any;
25
+  recoveryDepts:any[] = [];
26
+  // 自动建单
27
+  autoCreateOrders:any[] = [
28
+    {label:'是否开启',value: 0}
29
+  ];
30
+  // 是否开通送回病房
31
+  autoSendWard:any[] = [
32
+    {label:'是否开启',value: 0}
33
+  ];
34
+  // 是否开通送回苏醒室
35
+  autoSendAwakeningRoom:any[] = [
36
+    {label:'是否开启',value: 0}
37
+  ];
38
+  // 是否开通关联手术清洁建单
39
+  autoRemandClean:any[] = [
40
+    {label:'是否开启',value: 0}
41
+  ];
42
+  // 是否开启手术即将开始通知
43
+  surgeryBegin:any[] = [
44
+    {label:'是否开启',value: 0}
45
+  ];
46
+  // 建单时间
47
+  autoTime:Date | null = null;
48
+  tasktype1Id:any;
49
+  tasktype2Id:any;
50
+  cleanTypeId:any;
51
+	associationTypeIds:any;
52
+	questionnaireManagementData:any; //调查问卷数据
53
+	questionnaireIds:Number; //问卷参数
54
+	intervalTime:string = ''; //间隔时间参数
55
+	taskTypeIds:any = []; //任务类型参数
56
+	editId:'';
57
+	targetData:any = [];
58
+	stateData:any = [];
59
+	// 间隔时间数据
60
+	timeData:any[] = [
61
+	  {label:'10',value: 10},
62
+		{label:'15',value: 15},
63
+		{label:'30',value: 30},
64
+		{label:'60',value: 60}
65
+	];
66
+  // 配置
67
+  configs:any = {};
68
+  searchTimerSubject = new Subject();
69
+  constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
70
+
71
+  ngOnInit():void {
72
+    // todo
73
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
74
+      let fun = v[0];
75
+      fun.call(this, v[1], v[2], v[3]);
76
+    });
77
+    this.getTaskTypes('', true);
78
+		this.getTaskTypesId(true);
79
+  }
80
+
81
+  // 切换tab
82
+  tabModal(tabModalName:string){
83
+    this.tabModalName = tabModalName;
84
+  }
85
+
86
+  // 保存
87
+  submitForm() {
88
+    if(!this.infusionSolutionsTypeId){
89
+      this.msg.create("warning", "请选择任务类型!");
90
+      return;
91
+    }
92
+    let editData = {
93
+			id:'',
94
+			taskType:this.taskTypeData[0].id,
95
+			hosId: this.hosId,
96
+			infusionSolutionsTypeId:this.infusionSolutionsTypeId, //任务类型参数
97
+			autoCreate:0
98
+    };
99
+		if(this.editId){
100
+			editData.id = this.editId
101
+		}else{
102
+			delete editData.id 
103
+		}
104
+		if(this.autoCreateOrders[0].checked){
105
+			editData.autoCreate = 1
106
+		}else{
107
+			delete editData.autoCreate
108
+		}
109
+    this.btnLoading = true;
110
+    this.mainService
111
+      .simplePost("addData", "taskTypeConfig", editData)
112
+      .subscribe((result) => {
113
+        this.btnLoading = false;
114
+        if (result.status == 200) {
115
+          this.getConfig();
116
+        }
117
+      });
118
+  }
119
+	
120
+  // 用户输入搜索任务类型
121
+  isLoading: boolean = false;
122
+  changeTasktype(e) {
123
+    this.searchTimer(this.getTaskTypes, e, false);
124
+  }
125
+
126
+  // 边输入边搜索节流阀
127
+  searchTimer(fun, e, isFirst, type?) {
128
+    this.isLoading = true;
129
+    this.searchTimerSubject.next([fun, e, isFirst, type]);
130
+  }
131
+	
132
+  //获取关联任务类型
133
+  // 1 患者其他服务
134
+  // 2 其他临床服务
135
+  getTaskTypes(e:string = '', isFirst:boolean = false) {
136
+    isFirst && (this.loading = true);
137
+    let postData:any = {
138
+      idx: 0,
139
+      sum: 9999,
140
+      taskType: {
141
+        taskName: e,
142
+        simpleQuery: true,
143
+				associationType : {
144
+					key: 'association_types',
145
+					value: 'other'
146
+				},
147
+        hosId: {
148
+          id: this.hosId
149
+        }
150
+      }
151
+    };
152
+    this.isLoading = true;
153
+    this.mainService
154
+      .getFetchDataList("simple/data", "taskType", postData)
155
+      .subscribe((result) => {
156
+        this.isLoading = false;
157
+        if (result.status == 200) {
158
+          this.taskTypes1 = result.list || [];
159
+          isFirst && this.getConfig();
160
+        }
161
+      });
162
+  }
163
+	
164
+	// 获取任务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
+	    });
190
+	}
191
+	
192
+  // 获取配置
193
+  getConfig() {
194
+    this.loading = true;
195
+    let postData = {
196
+      idx: 0,
197
+      sum: 10,
198
+      taskTypeConfig: {
199
+				taskTypeDTO: {
200
+				  hosId: {
201
+				    id: this.hosId
202
+				  },
203
+				  ordinaryField: {
204
+				    key: 'ordinary_field',
205
+				    value: 'infusionSolutions'
206
+				  }
207
+				}
208
+      }
209
+    };
210
+    this.mainService
211
+      .getFetchDataList("simple/data", "taskTypeConfig", postData)
212
+      .subscribe((result) => {
213
+        this.loading = false;
214
+        if (result.status == 200) {
215
+    			let data = result.list[0] || {};
216
+					this.editId = data.id
217
+					this.autoCreateOrders[0].checked = data.autoCreate == 1;
218
+    			this.infusionSolutionsTypeId = data.infusionSolutionsTypeId
219
+        }
220
+      });
221
+  }
222
+}
223
+

+ 17 - 0
src/app/views/big-transfusion-set/big-transfusion-set.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { BigTransfusionSetRoutingModule } from './big-transfusion-set-routing.module';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { BigTransfusionSetComponent } from './big-transfusion-set.component';
7
+
8
+
9
+@NgModule({
10
+  declarations: [BigTransfusionSetComponent],
11
+  imports: [
12
+    CommonModule,
13
+    BigTransfusionSetRoutingModule,
14
+    ShareModule
15
+  ]
16
+})
17
+export class BigTransfusionSetModule { }

+ 20 - 0
src/app/views/dispensing-batch/dispensing-batch-routing.module.ts

@@ -0,0 +1,20 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DispensingBatchComponent } from './dispensing-batch.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: DispensingBatchComponent,
10
+    // children: [
11
+     
12
+    // ]
13
+  }
14
+];
15
+
16
+@NgModule({
17
+  imports: [RouterModule.forChild(routes)],
18
+  exports: [RouterModule]
19
+})
20
+export class DispensingBatchRoutingModule { }

+ 199 - 0
src/app/views/dispensing-batch/dispensing-batch.component.html

@@ -0,0 +1,199 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzLg='18' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">批次号:</span>
7
+          <input nz-input class="formItem" [(ngModel)]="batchNumber" placeholder="请输入批次号" nzSize="default" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">创建时间:</span>
11
+          <nz-range-picker [(ngModel)]="dateRange" [nzShowTime]="{ nzFormat: 'HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
12
+					(ngModelChange)="changeDate($event)"></nz-range-picker>
13
+        </div>
14
+      </div>
15
+      <div nz-col nzLg="6" class="list-template__btns">
16
+        <button class="btn default" (click)='search()'>搜索</button>
17
+        <button class="btn default ml8" (click)='reset()'>重置</button>
18
+				<button *ngIf="coopBtns.add" class="btn default ml8" (click)='showModal()'>新增</button>
19
+      </div>
20
+    </div>
21
+    <div class="list-template__bottom">
22
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
23
+        [nzLoading]="loading1">
24
+        <thead>
25
+          <tr class="thead">
26
+            <th nzWidth="13%">批次号</th>
27
+            <th nzWidth="13%">创建时间</th>
28
+            <th nzWidth="13%">发药时间区间</th>
29
+            <th nzWidth="7%">发药科室</th>
30
+            <th nzWidth="7%">科室数</th>
31
+            <th nzWidth="7%">发药量</th>
32
+            <th nzWidth="7%">箱数</th>
33
+            <th nzWidth="10%">药品总价</th>
34
+						<th nzWidth="7%">状态</th>
35
+            <th nzWidth="16%">操作</th>
36
+          </tr>
37
+        </thead>
38
+        <tbody>
39
+          <tr *ngFor="let data of listOfData" (click)="selectedListData(data.id)">
40
+            <td>{{ data.batchNo || '-' }}</td>
41
+            <td>{{ data.createTime|date:'yyyy-MM-dd HH:mm' }}</td>
42
+            <td>
43
+							<div>{{ data.startTime|date:'yyyy-MM-dd HH:mm' }}至</div>
44
+							<div>{{ data.endTime|date:'yyyy-MM-dd HH:mm' }}</div>
45
+						</td>
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>
51
+						<td>{{ data.batchState?data.batchState.name : '-' }}</td>
52
+            <td>
53
+              <div class="coop">
54
+								<span *ngIf="coopBtns.edit && data.batchState.name=='未发药'" (click)="edit($event,data)">编辑</span>
55
+								<span *ngIf="coopBtns.del && data.batchState.name=='未发药'" (click)="showDelModal($event,data.id)">删除</span>
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>
58
+                <span *ngIf="coopBtns.batchPrint && data.batchState.name=='未发药'" (click)="dispensingPrint($event, data, data.id)">发药并打印</span>
59
+              </div>
60
+            </td>
61
+          </tr>
62
+        </tbody>
63
+      </nz-table>
64
+      <div class="list-template__pagination">
65
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
66
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
67
+        </nz-pagination>
68
+      </div>
69
+    </div>
70
+  </div>
71
+
72
+  <!-- 新增/编辑模态框 -->
73
+  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
74
+    <div class="modalBody">
75
+      <div class="title">发药批次-{{add ? '新增' : '编辑'}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
76
+      </div>
77
+      <overlay-scrollbars #osComponentRef1 class="content">
78
+       <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
79
+       	<nz-form-item>
80
+       	  <nz-form-label nzRequired nzFor="dispensingTime">发药时间区间</nz-form-label>
81
+       	  <nz-form-control nzErrorTip="请选择发药时间区间!">
82
+       	    <nz-input-group>
83
+       				<nz-range-picker formControlName="dispensingTime" 
84
+							[nzShowTime]="{ nzFormat: 'yyyy-MM-dd HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
85
+							(ngModelChange)="formChangeDate($event)"></nz-range-picker>
86
+       			</nz-input-group>
87
+       	  </nz-form-control>
88
+       	</nz-form-item>
89
+       	<nz-form-item>
90
+       	  <nz-form-label nzRequired nzFor="department">取药科室</nz-form-label>
91
+       	  <nz-form-control nzErrorTip="请选择取药科室!">
92
+       	    <nz-input-group>
93
+       				<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event)" nzServerSearch nzShowSearch nzPlaceHolder="请选择申请科室" formControlName="department">
94
+       				  <ng-container *ngFor="let option of hospitals1">
95
+       				    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
96
+       				  </ng-container>
97
+       				  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
98
+       				    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
99
+       				  </nz-option>
100
+       				</nz-select>
101
+       			</nz-input-group>
102
+       	  </nz-form-control>
103
+       	</nz-form-item>
104
+       </form>
105
+      </overlay-scrollbars>
106
+      <div class="display_flex justify-content_flex-center">
107
+        <button class="btn" nz-button nzType="primary" (click)="submitForm()" [nzLoading]="btnLoading">{{add ? '保存并配置' : '保存'}}</button>
108
+				<button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
109
+      </div>
110
+    </div>
111
+  </div>
112
+  <!-- 删除模态框 -->
113
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
114
+    (confirmDelEvent)="confirmDel()" content="您确认要删除发药批次吗?"></app-dialog-delete>
115
+
116
+  <!-- 编辑模态框 -->
117
+  <app-dialog-delete [delModal]="editModal" (hideDelModalEvent)="hideDelModal1()" [btnLoading]="saveLoading"
118
+    (confirmDelEvent)="confirmDel1()" [content]="'保存后会重置您的发药科室的药品信息,您确认吗?'"></app-dialog-delete>
119
+
120
+  <!-- 打印 -->
121
+  <div id="report" style="display: none">
122
+		<div class="monad" *ngFor="let item of printData"
123
+				style="padding: 10px;
124
+				border: 1px solid #e7e7e7;
125
+				border-radius: 5px;margin-bottom: 40px;">
126
+			<div class="monad-title" 
127
+				style="text-align: center;
128
+				font-weight: 700;
129
+				font-size: 16px;
130
+				border-bottom: 1px solid #e7e7e7;
131
+				padding-bottom: 10px;">
132
+				大输液发药单-{{item.pharmacyDTO.dept}}
133
+			</div>
134
+			<div class="monad-sign" style="display: flex;line-height: 40px;font-size: 14px;">
135
+				<div style="margin-right: 15px;">日期:{{item.createTime|date:'yyyy-MM-dd HH:mm'}}</div>
136
+				<div style="margin-right: 15px;">批次号:{{item.batch.batchNo}}</div>
137
+				<div style="margin-right: 15px;">单号:{{item.packingNo}}</div>
138
+			</div>
139
+			<div style="border: 1px solid #e7e7e7;border-bottom: none;font-size: 14px;">
140
+				<div class="thead" style="display: flex;">
141
+					<div style="text-align: center;width: 20%;height: 40px;
142
+					line-height: 40px;
143
+					border-right: 1px solid #e7e7e7;
144
+					border-bottom: 1px solid #e7e7e7;">药品名称</div>
145
+					
146
+					<div style="text-align: center;width: 20%;height: 40px;
147
+					line-height: 40px;
148
+					border-right: 1px solid #e7e7e7;
149
+					border-bottom: 1px solid #e7e7e7;">规格</div>
150
+					
151
+					<div style="text-align: center;width: 20%;height: 40px;
152
+					line-height: 40px;
153
+					border-right: 1px solid #e7e7e7;
154
+					border-bottom: 1px solid #e7e7e7;">总量(实发数量)</div>
155
+					
156
+					<div style="text-align: center;width: 20%;height: 40px;
157
+					line-height: 40px;
158
+					border-right: 1px solid #e7e7e7;
159
+					border-bottom: 1px solid #e7e7e7;">箱数(发药箱数)</div>
160
+					
161
+					<div style="text-align: center;width: 20%;height: 40px;
162
+					line-height: 40px;border-bottom: 1px solid #e7e7e7;">取药药房</div>
163
+				</div>
164
+				<div *ngFor="let data of item.drugsConfigureDTOS" style="display: flex;">
165
+					<div style="text-align: center;width: 20%;height: 40px;
166
+					line-height: 40px;
167
+					border-right: 1px solid #e7e7e7;
168
+					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.drugName }}</div>
169
+					
170
+					<div style="text-align: center;width: 20%;height: 40px;
171
+					line-height: 40px;
172
+					border-right: 1px solid #e7e7e7;
173
+					border-bottom: 1px solid #e7e7e7;">{{ data.drugsInfoDTO.specs }}</div>
174
+					
175
+					<div style="text-align: center;width: 20%;height: 40px;
176
+					line-height: 40px;
177
+					border-right: 1px solid #e7e7e7;
178
+					border-bottom: 1px solid #e7e7e7;">{{ data.actualCount }}</div>
179
+					
180
+					<div style="text-align: center;width: 20%;height: 40px;
181
+					line-height: 40px;
182
+					border-right: 1px solid #e7e7e7;
183
+					border-bottom: 1px solid #e7e7e7;">{{ data.cartonNum }}</div>
184
+					
185
+					<div style="text-align: center;width: 20%;height: 40px;
186
+					line-height: 40px;border-bottom: 1px solid #e7e7e7;">{{ data.deptName }}</div>
187
+				</div>
188
+			</div>
189
+		</div>
190
+  </div>
191
+
192
+</div>
193
+<!-- 操作成功/失败提示框 -->
194
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
195
+  [info]="promptInfo"></app-prompt-modal>
196
+
197
+<!-- 遮罩 -->
198
+<app-mask *ngIf="maskFlag"></app-mask>
199
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 260 - 0
src/app/views/dispensing-batch/dispensing-batch.component.less

@@ -0,0 +1,260 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  .add-button {
4
+    margin: 0 auto 16px !important;
5
+  }
6
+  .targetDept {
7
+    overflow: hidden;
8
+    // width: 90px;
9
+    text-overflow: ellipsis;
10
+    white-space: nowrap;
11
+  }
12
+  .dynamic {
13
+    margin-bottom: 16px;
14
+    display: flex;
15
+    align-items: center;
16
+    input {
17
+      width: 90%;
18
+    }
19
+    i {
20
+      margin-left: 8px;
21
+      cursor: pointer;
22
+      font-size: 18px;
23
+    }
24
+  }
25
+}
26
+
27
+.save {
28
+  position: fixed;
29
+  left: 0;
30
+  top: 0;
31
+  width: 100%;
32
+  height: 100%;
33
+  background: rgba(0, 0, 0, 0.4);
34
+  z-index: 99;
35
+
36
+  .modalBody {
37
+    width: 350px;
38
+    background: #fff;
39
+    border-radius: 5px;
40
+    padding: 10px 20px;
41
+    color: #333;
42
+
43
+    .title {
44
+      width: 100%;
45
+      text-align: center;
46
+      font-size: 18px;
47
+      position: relative;
48
+
49
+      i {
50
+        position: absolute;
51
+        right: 0;
52
+        top: 0;
53
+        font-size: 20px;
54
+        color: #666;
55
+        cursor: pointer;
56
+        padding: 0 5px;
57
+      }
58
+    }
59
+
60
+    .content {
61
+      width: 100%;
62
+      height: 117px;
63
+      background: #f9fafb;
64
+      border: 1px solid #e5e9ed;
65
+      border-radius: 5px;
66
+      overflow: hidden;
67
+      margin-top: 12px;
68
+
69
+      div {
70
+        text-align: center;
71
+        margin: 0;
72
+
73
+        &.icon {
74
+          margin-top: 17px;
75
+
76
+          i {
77
+            color: #34b349;
78
+            font-size: 30px !important;
79
+
80
+            &.transport-wenhao {
81
+              color: #f5a523;
82
+            }
83
+
84
+            &.transport-shibai {
85
+              color: #ff3a52;
86
+            }
87
+          }
88
+        }
89
+
90
+        &.defeat {
91
+          color: #333;
92
+          font-size: 18px;
93
+        }
94
+
95
+        &:nth-child(3) {
96
+          font-size: 14px;
97
+          color: #666;
98
+        }
99
+      }
100
+    }
101
+
102
+    button {
103
+      margin-top: 10px;
104
+
105
+      &.btn {
106
+        margin-left: 8px;
107
+      }
108
+    }
109
+  }
110
+
111
+  // 新增
112
+  &.add {
113
+    .modalBody {
114
+      width: 420px;
115
+      height: auto;
116
+
117
+      .content {
118
+        width: 100%;
119
+        height: auto;
120
+        padding: 19px 14px 0 14px;
121
+        max-height: 500px;
122
+        overflow-y: auto;
123
+				
124
+				.ant-select{
125
+					width: 100%;
126
+				}
127
+				.ant-calendar-picker{
128
+					width: 100% !important;
129
+				}
130
+				.list-template__bottom {
131
+				  background: #f9fafb;
132
+				  border: 1px solid #e5e9ed;
133
+				  border-radius: 8px;
134
+				  padding-bottom: 56px;
135
+				  position: relative;
136
+				  .list-template__nzTable {
137
+				    padding: 16px 16px 0;
138
+				
139
+				    .thead {
140
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
141
+				
142
+				      th {
143
+				        background: transparent;
144
+				        color: #fff;
145
+				        text-align: center;
146
+				      }
147
+				    }
148
+				
149
+				    .ant-table-body {
150
+				      border-bottom: 1px solid #e5e9ed;
151
+				    }
152
+				
153
+				    .ant-table-tbody {
154
+				      tr {
155
+				        text-align: center;
156
+				        color: #333;
157
+				
158
+				        td {
159
+				          border: none;
160
+				
161
+				          &.tab_hover:hover{
162
+				            text-decoration: underline;
163
+				            cursor: pointer;
164
+				          }
165
+				
166
+				          .coop {
167
+				            button{
168
+				              color: #333;
169
+				            }
170
+				            span,button {
171
+				              display: inline-block;
172
+				              padding: 0 8px;
173
+				              cursor: pointer;
174
+				              position: relative;
175
+				
176
+				              &::after {
177
+				                content: "|";
178
+				                position: absolute;
179
+				                top: 0;
180
+				                right: 0;
181
+				              }
182
+				
183
+				              &:hover,
184
+				              &:active {
185
+				                color: @primary-color;
186
+				              }
187
+				
188
+				              &:nth-last-child(1) {
189
+				                &::after {
190
+				                  content: "";
191
+				                }
192
+				              }
193
+				            }
194
+				          }
195
+				        }
196
+				      }
197
+				    }
198
+				  }
199
+				  .list-template__pagination {
200
+				    height: 56px;
201
+				    display: flex;
202
+				    align-items: center;
203
+				    position: absolute;
204
+				    right: 8px;
205
+				  }
206
+				}
207
+				
208
+        .addForm {
209
+          .ant-form-item {
210
+            margin-bottom: 14px;
211
+
212
+            .ant-form-item-label {
213
+              line-height: 14px;
214
+              text-align: left;
215
+            }
216
+          }
217
+        }
218
+
219
+        .editForm {
220
+          .ant-form-item {
221
+            margin-bottom: 14px;
222
+
223
+            .ant-form-item-label {
224
+              line-height: 0;
225
+              text-align: left;
226
+            }
227
+          }
228
+        }
229
+      }
230
+
231
+      button {
232
+        &:nth-child(1) {
233
+          margin-right: 20px;
234
+        }
235
+      }
236
+    }
237
+  }
238
+}
239
+
240
+.monad{
241
+	margin-top: 20px;
242
+	.monad-list{
243
+		border: 1px solid #e7e7e7;
244
+		border-radius: 5px;
245
+		margin-bottom: 40px;
246
+		padding: 20px;
247
+	}
248
+	.monad-title{
249
+		text-align: center;
250
+		font-weight: 700;
251
+		font-size: 16px;
252
+	}
253
+	.monad-sign{
254
+		display: flex;
255
+		line-height: 30px;
256
+		div{
257
+			margin-right: 15px;
258
+		}
259
+	}
260
+}

+ 728 - 0
src/app/views/dispensing-batch/dispensing-batch.component.ts

@@ -0,0 +1,728 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { format, startOfDay, endOfDay } from "date-fns";
14
+import { NzMessageService } from "ng-zorro-antd";
15
+import { Subject } from "rxjs";
16
+import { debounceTime, filter } from "rxjs/operators";
17
+import host from "../../../assets/js/http";
18
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
19
+
20
+@Component({
21
+  selector: "app-dispensing-batch",
22
+  templateUrl: "./dispensing-batch.component.html",
23
+  styleUrls: ["./dispensing-batch.component.less"],
24
+})
25
+export class DispensingBatchComponent implements OnInit {
26
+  @ViewChild("osComponentRef1", {
27
+    read: OverlayScrollbarsComponent,
28
+    static: false,
29
+  })
30
+  osComponentRef1: OverlayScrollbarsComponent;
31
+  constructor(
32
+    private message: NzMessageService,
33
+    private fb: FormBuilder,
34
+    private route: ActivatedRoute,
35
+    private router: Router,
36
+    private mainService: MainService,
37
+    private tool: ToolService,
38
+    private http: HttpClient,
39
+  ) {}
40
+
41
+  ngOnInit() {
42
+    this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
43
+			this.isDeptLoading = true;
44
+			this.getDeparts(e);
45
+    });
46
+		this.hosId = this.tool.getCurrentHospital().id;
47
+    this.coopBtns = this.tool.initCoopBtns(this.route);
48
+    this.initForm();
49
+    this.getAllHospital();
50
+    this.getType();
51
+    this.getDeptHandoverType();
52
+  }
53
+  listOfData: any[] = []; //表格数据
54
+  promptContent: string; //操作提示框提示信息
55
+  ifSuccess: boolean; //操作成功/失败
56
+  promptInfo: string; //操作结果提示信息
57
+  promptModalShow: boolean; //操作提示框是否展示
58
+  modal: boolean = false; //新增/编辑模态框
59
+  add: boolean; //true:新增;false:编辑
60
+  validateForm: FormGroup; //新增/编辑表单
61
+  coopId: number; //表格中执行操作的id
62
+  department: number; //所属科室
63
+	hosId: number; 
64
+	dateRange;//时间
65
+  batchNumber; //批次号
66
+  num; //编码
67
+  deptalias; //别名
68
+  type; //类型
69
+  deptHandoverType; //类型
70
+  pageIndex: number = 1; //页码
71
+  listLength: number = 10; //总条数
72
+  pageSize: number = 10; //每页条数
73
+  btnLoading: boolean = false; //确认按钮loading状态
74
+  printLoading: boolean = false; //批量打印按钮loading状态
75
+  deptPhones: any = []; //新添加的科室电话列表
76
+  isAddDeptsPhone = true; //添加新的科室电话是否禁用
77
+  deptsPhoneId = 1; //科室电话自增id
78
+  allParentdepart: any = []; //所有的父级科室列表
79
+  hospitals1: any = []; //科室列表(搜索)
80
+	rowData: object = {}; //打印选择列表
81
+	editModal:boolean = false; //编辑时弹框
82
+  searchParentDeptSubject = new Subject();
83
+  // 初始化增删改按钮
84
+  coopBtns: any = {};
85
+	saveLoading:boolean = false;
86
+  // 模板导出
87
+  excelExport(){
88
+    this.maskFlag = this.message.loading("下载模板中..", {
89
+      nzDuration: 0,
90
+    }).messageId;
91
+    this.mainService.exportExcel("department", {}).subscribe(
92
+      (data) => {
93
+        this.message.remove(this.maskFlag);
94
+        this.maskFlag = false;
95
+        this.message.success('下载模板成功');
96
+        var file = new Blob([data], {
97
+          type: "application/vnd.ms-excel",
98
+        });
99
+        //trick to download store a file having its URL
100
+        var fileURL = URL.createObjectURL(file);
101
+        var a = document.createElement("a");
102
+        a.href = fileURL;
103
+        a.target = "_blank";
104
+        a.download = "科室导入模板.xls";
105
+        document.body.appendChild(a);
106
+        a.click();
107
+      },
108
+      (err) => {
109
+        this.message.remove(this.maskFlag);
110
+        this.maskFlag = false;
111
+        this.message.error('下载模板失败');
112
+      }
113
+    );
114
+  }
115
+
116
+  // 导入---start
117
+  // model-取消
118
+  isShow = false;
119
+  hideExcelImport() {
120
+    this.isShow = false;
121
+  }
122
+  // 触发
123
+  excelImport() {
124
+    this.isShow = true;
125
+  }
126
+  submitExcelImport({fileList}){
127
+    this.isShow = false;
128
+    const formData = new FormData();
129
+    fileList.forEach((file: any) => {
130
+      formData.append('file', file);
131
+    });
132
+    this.maskFlag = this.message.loading("正在导入中..", {
133
+      nzDuration: 0,
134
+    }).messageId;
135
+    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/department', formData, {
136
+      reportProgress: true
137
+    });
138
+    this.http
139
+      .request(req)
140
+      .pipe(filter(e => e instanceof HttpResponse))
141
+      .subscribe(
142
+        (res:any) => {
143
+          if(res.body.status == 200){
144
+            this.message.remove(this.maskFlag);
145
+            this.maskFlag = false;
146
+            this.message.success('导入成功');
147
+            this.getList();
148
+          }else{
149
+            this.message.remove(this.maskFlag);
150
+            this.maskFlag = false;
151
+            this.showPromptModal("导入", false, res.body.msg);
152
+          }
153
+        },
154
+        () => {
155
+          this.message.remove(this.maskFlag);
156
+          this.maskFlag = false;
157
+          this.message.error('导入失败');
158
+        },
159
+      );
160
+  }
161
+  // 导入---end
162
+  //搜索父级科室
163
+	isDeptLoading = false;
164
+  changeInp(e) {
165
+    this.searchParentDeptSubject.next(e);
166
+  }
167
+  // 打开父级科室下拉框baba
168
+  isLoading = false;
169
+  openDeptSelect(flag) {
170
+    if (flag) {
171
+      this.isLoading = true;
172
+      this.getAllParentdepart().subscribe((result) => {
173
+        this.isLoading = false;
174
+        if (result.status == 200) {
175
+          this.allParentdepart = result.list;
176
+        }
177
+      });
178
+    }
179
+  }
180
+  // 配送建单
181
+  coopData:any = {};
182
+  addDateModal(data) {
183
+    this.coopData = data;
184
+    this.showDelModal1();
185
+  }
186
+
187
+  showDelModal1() {
188
+    this.editModal = true;
189
+  }
190
+  hideDelModal1() {
191
+    this.editModal = false;
192
+  }
193
+	
194
+  // 编辑保存
195
+  confirmDel1() {
196
+    var that = this;
197
+		for (const i in that.validateForm.controls) {
198
+		  that.validateForm.controls[i].markAsDirty();
199
+		  that.validateForm.controls[i].updateValueAndValidity();
200
+		}
201
+		if (that.validateForm.invalid) return;
202
+    let data: any = {
203
+			startTime:this.formStartDate,//发起时间开始
204
+			endTime:this.formEndDate,//发起时间结束
205
+			hosId:this.hosId,
206
+			pharmacy:this.validateForm.value.department,
207
+			id:that.coopId
208
+    };
209
+		that.saveLoading = true;
210
+		that.mainService
211
+		  .simplePost("addData", "drugsBatch", data)
212
+		  .subscribe((data) => {
213
+		    that.saveLoading = false;
214
+		    that.hideModal();
215
+		    that.initForm();
216
+		    if (data.status == 200) {
217
+					this.editModal = false;
218
+		      that.showPromptModal("编辑", true, "");
219
+		    } else {
220
+		      that.showPromptModal("编辑", false, data.msg);
221
+		    }
222
+		  });
223
+  }
224
+	
225
+  //获取所有的父级科室列表
226
+  getAllParentdepart(keyWord = "") {
227
+    let postData: any = {
228
+      idx: 0,
229
+      sum: 10,
230
+      department: {
231
+        // hospital: { id: this.add ? this.tool.getCurrentHospital().id : this.hospital },
232
+        keyWord: keyWord,
233
+      },
234
+    };
235
+    if (this.coopItem) {
236
+      // 过滤这个科室及其子科室
237
+      postData.department.filterByDeptId = this.coopItem.id;
238
+    }
239
+    return this.mainService.getFetchDataList("data", "department", postData);
240
+  }
241
+  // 新添加科室号码
242
+  addDeptPhone(e: MouseEvent) {
243
+    e.preventDefault();
244
+    this.deptPhones.push({ id: ++this.deptsPhoneId, phone: "" });
245
+    this.deptsPhoneChange();
246
+  }
247
+  // 删除新添加科室号码
248
+  removeDeptPhone(index: number, e: MouseEvent) {
249
+    e.preventDefault();
250
+    this.deptPhones.splice(index, 1);
251
+    this.deptsPhoneChange();
252
+  }
253
+  //监听科室电话输入事件
254
+  deptsPhoneChange(e?, phone?) {
255
+    if (e !== undefined && phone !== undefined) {
256
+      phone.phone = e;
257
+    }
258
+    // -------------判断添加按钮是否禁用 start
259
+    this.isAddDeptsPhone = !this.validateForm.value.officeNum;
260
+    if (!this.isAddDeptsPhone) {
261
+      //如果没禁用
262
+      this.isAddDeptsPhone = this.deptPhones.some((item) => item.phone === "");
263
+    }
264
+    // -------------判断添加按钮是否禁用 end
265
+  }
266
+
267
+  // 搜索
268
+  search() {
269
+    this.pageIndex = 1;
270
+    this.getList();
271
+  }
272
+  // 重置
273
+  reset() {
274
+    this.pageIndex = 1;
275
+		this.batchNumber = null;
276
+    this.startDate = null;
277
+		this.endDate = null;
278
+		this.dateRange = [];
279
+    this.getList();
280
+  }
281
+  // 表格数据
282
+  loading1 = false;
283
+  getList() {
284
+    var that = this;
285
+    let data = {
286
+      idx: that.pageIndex - 1,
287
+      sum: that.pageSize,
288
+      drugsBatch: {
289
+    		batchNo:that.batchNumber,
290
+        startTime: this.startDate,
291
+    		endTime: this.endDate,
292
+    		hosId: this.hosId
293
+      },
294
+    };
295
+    if(that.batchNumber){
296
+    	data.drugsBatch.batchNo = that.batchNumber
297
+    }else{
298
+    	delete data.drugsBatch.batchNo
299
+    }
300
+    this.loading1 = true;
301
+    that.mainService
302
+      .getFetchDataList("data", "drugsBatch", data)
303
+      .subscribe((data) => {
304
+        this.loading1 = false;
305
+        that.listOfData = data.list;
306
+        that.listLength = data.totalNum;
307
+      });
308
+  }
309
+	
310
+	// 日期选择
311
+	startDate: string; //发起时间开始
312
+	endDate: string; //发起时间结束
313
+	changeDate(result?): void {
314
+	  if (!result) {
315
+	    this.startDate = this.endDate = "";
316
+	    return;
317
+	  }
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');
320
+	}
321
+	
322
+	// 新增、编辑日期选择
323
+	formStartDate: string; //发起时间开始
324
+	formEndDate: string; //发起时间结束
325
+	formChangeDate(result?): void {
326
+		if (!result) {
327
+		  this.formStartDate = this.formEndDate = "";
328
+		  return;
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');
332
+	}
333
+	
334
+	// 获取所有科室
335
+  getDeparts(dept) {
336
+    var that = this;
337
+    let data = {
338
+      department: {
339
+        dept,
340
+        hospital: {
341
+          id: this.hosId
342
+        },
343
+      },
344
+      idx: 0,
345
+      sum: 20,
346
+    };
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
+      });
355
+  }
356
+	
357
+  // 获取所有院区
358
+  getAllHospital() {
359
+		this.getDeparts('')
360
+    this.getList();
361
+  }
362
+
363
+  // 切换院区选项
364
+  buildings: any = []; //楼栋
365
+  maskFlag: any = false;
366
+  changeHosp(obj?) {
367
+    let hospitalId;
368
+    if (obj) {
369
+      hospitalId = obj.hospital.id;
370
+    }
371
+    let hid;
372
+    if (hospitalId || hospitalId == 0) {
373
+      hid = hospitalId - 0;
374
+    } 
375
+		// else {
376
+  //     hid = this.hospital - 0;
377
+  //   }
378
+    let data = {
379
+      hosId: this.add ? this.tool.getCurrentHospital().id : hid,
380
+    };
381
+    this.maskFlag = this.message.loading("正在加载中..", {
382
+      nzDuration: 0,
383
+    }).messageId;
384
+    this.mainService
385
+      .coopData("getBuildingOrFloor", "building", data)
386
+      .subscribe((data) => {
387
+        this.buildings = data.data;
388
+        this.floors = [];
389
+        // ---------
390
+        if (obj) {
391
+          //编辑
392
+          let arr = this.buildings.map((item) => item.id);
393
+          if (obj.building.id && arr.includes(obj.building.id)) {
394
+            //有楼栋
395
+            this.changeBuilding(obj.building.id, obj);
396
+            this.validateForm.controls.building.setValue(obj.building.id + "");
397
+          } else {
398
+            //无楼栋
399
+            this.floors = [];
400
+            this.message.remove(this.maskFlag);
401
+            this.maskFlag = false;
402
+            this.modal = true;
403
+            this.validateForm.controls.building.setValue(null);
404
+            this.validateForm.controls.officeAddress.setValue(null);
405
+          }
406
+        } else {
407
+          //新增
408
+          this.message.remove(this.maskFlag);
409
+          this.maskFlag = false;
410
+          this.modal = true;
411
+        }
412
+        // ---------
413
+      });
414
+  }
415
+
416
+  // 切换楼栋信息
417
+  floors: Array<any> = []; //楼层
418
+  floorLoading: boolean = false;
419
+  changeBuilding(buildingId?, obj?) {
420
+    var that = this;
421
+    that.floors = [];
422
+    var bid;
423
+    if (buildingId || buildingId == 0) {
424
+      bid = buildingId - 0;
425
+    } else if (!that.add && that.validateForm.value.building) {
426
+      bid = that.validateForm.value.building - 0;
427
+    } else {
428
+      return;
429
+    }
430
+    let data = {
431
+      buildingId: bid,
432
+    };
433
+    this.floorLoading = true;
434
+    that.mainService
435
+      .coopData("getBuildingOrFloor", "floor", data)
436
+      .subscribe((data) => {
437
+        this.floorLoading = false;
438
+        this.message.remove(this.maskFlag);
439
+        this.maskFlag = false;
440
+        this.modal = true;
441
+        that.floors = data.data;
442
+        if (obj) {
443
+          let floorId = obj.floor.id;
444
+          let arr = that.floors.map((item) => item["id"]);
445
+          if (floorId && arr.includes(floorId)) {
446
+            this.validateForm.controls.floor.setValue(floorId + "");
447
+          } else {
448
+            this.validateForm.controls.floor.setValue(null);
449
+            this.validateForm.controls.officeAddress.setValue(null);
450
+          }
451
+        }
452
+      });
453
+  }
454
+
455
+  // 获取科室类型
456
+  types: Array<any> = [];
457
+  getType() {
458
+    var that = this;
459
+    that.mainService.getDictionary("list", "dept_type").subscribe((data) => {
460
+      console.log(data);
461
+      that.types = data;
462
+    });
463
+  }
464
+
465
+  // 获取科室汇总交接类型
466
+  deptHandoverTypes: Array<any> = [];
467
+  getDeptHandoverType() {
468
+    var that = this;
469
+    that.mainService.getDictionary("list", "dept_handover_type").subscribe((data) => {
470
+      console.log(data);
471
+      that.deptHandoverTypes = data;
472
+    });
473
+  }
474
+
475
+  // 新增弹框
476
+  showModal() {
477
+    this.initForm();
478
+    this.add = true;
479
+		this.modal = true;
480
+    this.isAddDeptsPhone = true;
481
+  }
482
+  hideModal() {
483
+    this.coopItem = null;
484
+    this.modal = false;
485
+    this.initForm();
486
+  }
487
+  // 初始化新增form表单
488
+  initForm() {
489
+    this.validateForm = this.fb.group({
490
+      dispensingTime: [null, [Validators.required]],
491
+      department: [null, [Validators.required]]
492
+    });
493
+  }
494
+  // 科室位置必填
495
+  buildValidator = (control: FormControl): { [s: string]: boolean } => {
496
+    if (
497
+      this.validateForm &&
498
+      this.validateForm.value &&
499
+      (!this.validateForm.value.building ||
500
+        !this.validateForm.value.floor ||
501
+        !this.validateForm.value.officeAddress)
502
+    ) {
503
+      return { required: true };
504
+    }
505
+  };
506
+  /**
507
+   * 生成一个从 start 到 end 的连续数组
508
+   * @param start
509
+   * @param end
510
+   */
511
+  generateArray(start, end) {
512
+    return Array.from(new Array(end).keys()).slice(start);
513
+  }
514
+
515
+  //服务时间选择
516
+  // 禁用的小时
517
+  startTime1Hourdis() {
518
+    return [];
519
+  }
520
+  endTime1Hourdis() {
521
+    return [];
522
+  }
523
+  startTime2Hourdis() {
524
+    return [];
525
+  }
526
+  endTime2Hourdis() {
527
+    return [];
528
+  }
529
+  // 禁用的分钟
530
+  startTime1Mindis() {
531
+    return [];
532
+  }
533
+  endTime1Mindis() {
534
+    return [];
535
+  }
536
+  startTime2Mindis() {
537
+    return [];
538
+  }
539
+  endTime2Mindis() {
540
+    return [];
541
+  }
542
+  timeChange(e: boolean, type: string, num: number) {
543
+    if (!e && this.validateForm.value[type + num]) {
544
+      let hour = new Date(this.validateForm.value[type + num]).getHours();
545
+      let minute = new Date(this.validateForm.value[type + num]).getMinutes();
546
+      if (type == "startTime" && num === 1) {
547
+        this.endTime1Hourdis = () => this.generateArray(0, hour);
548
+        this.endTime1Mindis = () => this.generateArray(0, minute + 1);
549
+      } else if (type == "startTime" && num === 2) {
550
+        this.endTime2Hourdis = () => this.generateArray(0, hour);
551
+        this.endTime2Mindis = () => this.generateArray(0, minute + 1);
552
+      } else if (type == "endTime" && num === 1) {
553
+        this.startTime1Hourdis = () => this.generateArray(hour + 1, 24);
554
+        this.startTime1Mindis = () => this.generateArray(minute, 60);
555
+      } else if (type == "endTime" && num === 2) {
556
+        this.startTime2Hourdis = () => this.generateArray(hour + 1, 24);
557
+        this.startTime2Mindis = () => this.generateArray(minute, 60);
558
+      }
559
+    }
560
+  }
561
+  // 表单提交
562
+  submitForm(): void {
563
+    var that = this;
564
+		for (const i in that.validateForm.controls) {
565
+		  that.validateForm.controls[i].markAsDirty();
566
+		  that.validateForm.controls[i].updateValueAndValidity();
567
+		}
568
+		if (that.validateForm.invalid) return;
569
+    let data: any = {
570
+			startTime:this.formStartDate,//发起时间开始
571
+			endTime:this.formEndDate,//发起时间结束
572
+			hosId:this.hosId,
573
+			pharmacy:this.validateForm.value.department
574
+    };
575
+  
576
+    if (!that.add) {
577
+			this.editModal = true
578
+    }else{
579
+			that.btnLoading = true;
580
+			that.mainService
581
+			  .simplePost("addData", "drugsBatch", data)
582
+			  .subscribe((data) => {
583
+			    that.btnLoading = false;
584
+			    that.hideModal();
585
+			    that.initForm();
586
+			    if (data.status == 200) {
587
+			      that.showPromptModal(that.add ? "新增" : "编辑", true, "");
588
+			    } else {
589
+			      that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
590
+			    }
591
+			  });
592
+		}
593
+  }
594
+
595
+  // 编辑
596
+  coopItem: any = null;
597
+  edit(e, data) {
598
+    e.stopPropagation();
599
+    this.add = false;
600
+    this.coopId = data.id;
601
+    this.coopItem = data;
602
+    this.validateForm.controls.department.setValue(data.pharmacy);
603
+    this.validateForm.controls.dispensingTime.setValue([data.startTime,data.endTime]);
604
+		this.modal = true
605
+  }
606
+
607
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
608
+  showPromptModal(con, success, promptInfo?) {
609
+    this.promptModalShow = false;
610
+    this.promptContent = con;
611
+    this.ifSuccess = success;
612
+    this.promptInfo = promptInfo;
613
+    setTimeout(() => {
614
+      this.promptModalShow = true;
615
+    }, 100);
616
+    this.getList();
617
+  }
618
+
619
+  delModal: boolean = false; //删除模态框
620
+  coopIds: any;
621
+  coopFlag: any = false;
622
+  /**
623
+   *
624
+   * @param e 事件对象
625
+   * @param id
626
+   */
627
+  showDelModal(e, id) {
628
+    e.stopPropagation();
629
+    this.delModal = true;
630
+    this.coopId = id;
631
+  }
632
+  hideDelModal() {
633
+    this.delModal = false;
634
+  }
635
+  // 确认删除
636
+  confirmDel() {
637
+    var that = this;
638
+    that.btnLoading = true;
639
+    that.mainService
640
+      .coopTypeConfig(
641
+        "rmvData",
642
+        "drugsBatch",
643
+         [that.coopId]
644
+      )
645
+      .subscribe((data) => {
646
+        that.btnLoading = false;
647
+        that.delModal = false;
648
+        if (data.status==200) {
649
+          that.showPromptModal("删除", true, "");
650
+        } else {
651
+          that.showPromptModal("删除", false, data.data[0].msg);
652
+        }
653
+      });
654
+  }
655
+
656
+  // 查看
657
+  detail(e, data) {
658
+    e.stopPropagation();
659
+		this.router.navigateByUrl(`/dispensingDetail/${data.id}`);
660
+  }
661
+
662
+  // 选中表格中科室
663
+  mapOfCheckedId: { [key: string]: boolean } = {};
664
+  checkedDepIds = []; //已选中科室id
665
+  refreshStatus(): void {
666
+    this.isAllDisplayDataChecked = this.listOfData.every(
667
+      (item) => this.mapOfCheckedId[item.id]
668
+    );
669
+    let arr = [];
670
+    for (var k in this.mapOfCheckedId) {
671
+      if (this.mapOfCheckedId[k]) {
672
+        arr.push(Number(k));
673
+      }
674
+    }
675
+    this.checkedDepIds = arr;
676
+    console.log(this.checkedDepIds);
677
+  }
678
+  //表格整行选中
679
+  selectedListData(id) {
680
+    this.mapOfCheckedId[id] = !this.mapOfCheckedId[id];
681
+    this.refreshStatus();
682
+  }
683
+  // 全选
684
+  isAllDisplayDataChecked = false; //当前页是否全选
685
+  checkAll(value: boolean): void {
686
+    this.listOfData.forEach((item) => (this.mapOfCheckedId[item.id] = value));
687
+    this.refreshStatus();
688
+  }
689
+
690
+	// 发药并打印
691
+	printData = []; 
692
+	dispensingPrint(e, data, id?){
693
+		this.rowData = data
694
+		e.stopPropagation();
695
+		let that = this;
696
+		that.printLoading = true;
697
+		that.mainService
698
+		  .transfusionPrint("drugsBatch", id)
699
+		  .subscribe((res) => {
700
+				let arr = res.data.drugsListDTOS;
701
+				for(let i of arr){
702
+					for(let t of i.drugsConfigureDTOS){
703
+						t.deptName = i.pharmacyDTO?i.pharmacyDTO.dept:'-'
704
+					}
705
+					i.drugsConfigureDTOS.push({
706
+						drugsInfoDTO:{
707
+							drugName:'合计',
708
+							specs:'',
709
+						},
710
+						actualCount:i.totalActual,
711
+						cartonNum:i.totalCarton,
712
+						deptName:''
713
+					})
714
+				}
715
+		    that.printData = arr;
716
+		    that.printLoading = false;
717
+		    setTimeout(() => {
718
+		      const printContent = document.getElementById("report");
719
+		      const WindowPrt = window.open("", "", "width=800,height=900");
720
+		      WindowPrt.document.write(printContent.innerHTML);
721
+		      WindowPrt.document.close();
722
+		      WindowPrt.focus();
723
+		      WindowPrt.print();
724
+		      WindowPrt.close();
725
+		    }, 500);
726
+		  });
727
+	}
728
+}

+ 19 - 0
src/app/views/dispensing-batch/dispensing-batch.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { DispensingBatchRoutingModule } from './dispensing-batch-routing.module';
5
+import { DispensingBatchComponent } from './dispensing-batch.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    DispensingBatchComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    DispensingBatchRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class DispensingBatchModule { }

+ 17 - 0
src/app/views/dispensing-detail/dispensing-detail-routing.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DispensingDetailComponent } from './dispensing-detail.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: DispensingDetailComponent
10
+  }
11
+];
12
+
13
+@NgModule({
14
+  imports: [RouterModule.forChild(routes)],
15
+  exports: [RouterModule]
16
+})
17
+export class DispensingDetailRoutingModule { }

+ 139 - 0
src/app/views/dispensing-detail/dispensing-detail.component.html

@@ -0,0 +1,139 @@
1
+<div class="list-template detail-box">
2
+  <div class="list-template__content">
3
+		<div class="detail-title">
4
+			<h3 *ngIf="deptName">{{deptName}}-发药单</h3>
5
+			<button class="btn cancel right-btn" nz-button nzType="default" (click)="back()">取消</button>
6
+		</div>
7
+    <div class="list-template__bottom" style="padding: 0 !important;">
8
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
9
+        [nzLoading]="loading1">
10
+        <thead>
11
+          <tr class="thead">
12
+            <th nzWidth="10%">药品名称</th>
13
+            <th nzWidth="10%">规格</th>
14
+						<th nzWidth="9%">消耗数量</th>
15
+						<th nzWidth="9%">原库存数</th>
16
+						<th nzWidth="10%">包装规格</th>
17
+						<th nzWidth="9%">发药箱数</th>
18
+						<th nzWidth="9%">实发数量</th>
19
+            <th nzWidth="10%">计算后库存</th>
20
+						<th nzWidth="10%">增减</th>
21
+            <th nzWidth="14%">操作</th>
22
+          </tr>
23
+        </thead>
24
+        <tbody>
25
+          <tr *ngFor="let data of listOfData">
26
+            <td>{{ data.drugsInfoDTO?data.drugsInfoDTO.drugName:'-' }}</td>
27
+            <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>
35
+            <td>
36
+              <div class="coop">
37
+                <span (click)="itemClick($event,data.id, 'add')">增加</span>
38
+								<span (click)="itemClick($event,data.id, 'del')">减少</span>
39
+							</div>
40
+            </td>
41
+          </tr>
42
+        </tbody>
43
+      </nz-table>
44
+    </div>
45
+  </div>
46
+	<div class="right-content">
47
+		<div class="right-top">
48
+			<h3 class="title">快速搜索发药科室</h3>
49
+			<div class="right-template">
50
+			  <span class="label">科室:</span>
51
+			  <nz-select class="formItem" (ngModelChange)="deptChange($event)" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event, 'dept')" nzServerSearch nzShowSearch nzPlaceHolder="请选择科室" [(ngModel)]="department">
52
+			    <ng-container *ngFor="let option of hospitals1">
53
+			      <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
54
+			    </ng-container>
55
+			    <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
56
+			      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
57
+			    </nz-option>
58
+			  </nz-select>
59
+			</div>
60
+		</div>
61
+		<div class="right-bottom">
62
+			<h3 class="title">发药科室列表</h3>
63
+			<div class="right-template">
64
+			  <span class="label">楼栋:</span>
65
+			  <nz-select class="formItem" (ngModelChange)="buildingChange($event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
66
+			    (nzOnSearch)="changeInp($event, 'building')" nzAllowClear nzPlaceHolder="请选择楼栋" [(ngModel)]="building">
67
+			    <ng-container *ngFor="let option of buildingList">
68
+			      <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
69
+			    </ng-container>
70
+			    <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
71
+			      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
72
+			    </nz-option>
73
+			  </nz-select>
74
+			</div>
75
+			<div class="dept-box">
76
+				<div *ngFor="let item of deptList;let index=index;" class="dept-item" 
77
+					[ngClass]="{'activeClass': index == deptIndex}" (click)="deptClick($event,item,index)">
78
+					<div>{{item.applyDeptDTO?item.applyDeptDTO.dept:'-'}}</div>
79
+					<span class="icon_transport transport-lajitong" (click)="deptDel($event,item,index)"></span>
80
+				</div>
81
+			</div>
82
+		</div>
83
+	</div>
84
+  <!-- 增加/减少 -->
85
+  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
86
+    <div class="modalBody">
87
+      <div class="title">{{add ? '增加' : '减少'}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
88
+      </div>
89
+      <overlay-scrollbars #osComponentRef1 class="content">
90
+       <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
91
+       	<nz-form-item *ngIf="add">
92
+       	  <nz-form-label nzRequired nzFor="addNum">增加数量</nz-form-label>
93
+       	  <nz-form-control nzErrorTip="请选择增加数量!">
94
+       	    <nz-input-group>
95
+       				<nz-input-number
96
+								nz-input
97
+       					formControlName="addNum"
98
+       					[nzMin]="0"
99
+       					[nzPrecision]="0"
100
+       					[nzMax]="999999"
101
+       					[nzStep]="1"
102
+       					[nzPlaceHolder]="'请填写增加数量'"
103
+       				 ></nz-input-number>
104
+       			</nz-input-group>
105
+       	  </nz-form-control>
106
+       	</nz-form-item>
107
+				<nz-form-item *ngIf="!add">
108
+				  <nz-form-label nzRequired nzFor="delNum">减少数量</nz-form-label>
109
+				  <nz-form-control nzErrorTip="请选择减少数量!">
110
+				    <nz-input-group>
111
+							<nz-input-number
112
+								nz-input
113
+								formControlName="delNum"
114
+								[nzMin]="0"
115
+								[nzPrecision]="0"
116
+								[nzMax]="999999"
117
+								[nzStep]="1"
118
+								[nzPlaceHolder]="'请填写减少数量'"
119
+							 ></nz-input-number>
120
+						</nz-input-group>
121
+				  </nz-form-control>
122
+				</nz-form-item>
123
+       </form>
124
+      </overlay-scrollbars>
125
+      <div class="display_flex justify-content_flex-center">
126
+        <button class="btn" nz-button nzType="primary" (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
127
+    		<button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
128
+      </div>
129
+    </div>
130
+  </div>
131
+
132
+</div>
133
+<!-- 操作成功/失败提示框 -->
134
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
135
+  [info]="promptInfo"></app-prompt-modal>
136
+	
137
+<!-- 删除模态框 -->
138
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
139
+    (confirmDelEvent)="confirmDel()" content="您确认要删除发药科室吗?"></app-dialog-delete>

+ 380 - 0
src/app/views/dispensing-detail/dispensing-detail.component.less

@@ -0,0 +1,380 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+	width: 100%;
4
+	height: 100%;
5
+	// display: flex;
6
+	// text-rendering: optimizeLegibility;
7
+	// -webkit-font-smoothing: antialiased;
8
+	// -moz-osx-font-smoothing: grayscale;
9
+  .add-button {
10
+    margin: 0 auto 16px !important;
11
+  }
12
+  .targetDept {
13
+    overflow: hidden;
14
+    // width: 90px;
15
+    text-overflow: ellipsis;
16
+    white-space: nowrap;
17
+  }
18
+  .dynamic {
19
+    margin-bottom: 16px;
20
+    display: flex;
21
+    align-items: center;
22
+    input {
23
+      width: 90%;
24
+    }
25
+    i {
26
+      margin-left: 8px;
27
+      cursor: pointer;
28
+      font-size: 18px;
29
+    }
30
+  }
31
+}
32
+
33
+h3{
34
+	margin: 0 !important;
35
+}
36
+/* 修改垂直滚动条 */
37
+::-webkit-scrollbar {
38
+  width: 4px; /* 修改宽度 */
39
+}
40
+ 
41
+/* 修改滚动条轨道背景色 */
42
+::-webkit-scrollbar-track {
43
+  background-color: #f1f1f1;
44
+}
45
+ 
46
+/* 修改滚动条滑块颜色 */
47
+::-webkit-scrollbar-thumb {
48
+  background-color: #888;
49
+}
50
+ 
51
+/* 修改滚动条滑块悬停时的颜色 */
52
+::-webkit-scrollbar-thumb:hover {
53
+  background-color: #555;
54
+}
55
+
56
+.detail-box{
57
+	display: flex;
58
+	.list-template__content{
59
+		flex:3;
60
+		padding: 0 10px 10px 10px;
61
+		border-radius: 5px;
62
+		border: 1px solid #e5e5e5;
63
+		.list-template__bottom{
64
+			height: auto;
65
+			max-height: 550px;
66
+			overflow-y: auto;
67
+		}
68
+	}
69
+	.right-content{
70
+		flex: 1;
71
+		margin-left: 10px;
72
+		.right-top{
73
+			border-radius: 5px;
74
+			background: #f9fafb;
75
+			border: 1px solid #e5e5e5;
76
+			padding: 10px;
77
+			.title{
78
+				text-align: center;
79
+				margin-bottom: 10px;
80
+			}
81
+			.right-template{
82
+				display: flex;
83
+				align-items: center;
84
+				margin-top: 10px;
85
+				.label{
86
+					width:50px;
87
+				}
88
+				.ant-select{
89
+					width: 100%;
90
+				}
91
+			}
92
+			
93
+		}
94
+		.right-bottom{
95
+			border-radius: 5px;
96
+			background: #f9fafb;
97
+			border: 1px solid #e5e5e5;
98
+			padding: 10px;
99
+			margin-top: 20px;
100
+			.title{
101
+				text-align: center;
102
+				margin-bottom: 10px;
103
+			}
104
+			.right-template{
105
+				display: flex;
106
+				align-items: center;
107
+				margin-top: 10px;
108
+				.label{
109
+					width:50px;
110
+				}
111
+				.ant-select{
112
+					width: 100%;
113
+				}
114
+			}
115
+			.dept-box{
116
+				margin-top: 20px;
117
+				height: auto;
118
+				max-height: 393px;
119
+				overflow-y: auto;
120
+				.dept-item{
121
+					display: flex;
122
+					justify-content: space-between;
123
+					align-items: center;
124
+					cursor: pointer;
125
+					height: 40px;
126
+					padding: 0 10px;
127
+					box-sizing: border-box;
128
+					.transport-lajitong{
129
+						color: #49b856;
130
+						font-size: 18px;
131
+					}
132
+				}
133
+				.activeClass{
134
+					border: 1px solid #49b856;
135
+					background: #E9F7E9;
136
+				}
137
+			}
138
+		}
139
+	}
140
+	.detail-title{
141
+		display: flex;
142
+		justify-content: center;
143
+		align-items: center;
144
+		position: relative;
145
+		height: 42px;
146
+		
147
+		.right-btn{
148
+			position: absolute;
149
+			right: 0;
150
+		}
151
+	}
152
+}
153
+
154
+.save {
155
+  position: fixed;
156
+  left: 0;
157
+  top: 0;
158
+  width: 100%;
159
+  height: 100%;
160
+  background: rgba(0, 0, 0, 0.4);
161
+  z-index: 99;
162
+
163
+  .modalBody {
164
+    width: 350px;
165
+    background: #fff;
166
+    border-radius: 5px;
167
+    padding: 10px 20px;
168
+    color: #333;
169
+
170
+    .title {
171
+      width: 100%;
172
+      text-align: center;
173
+      font-size: 18px;
174
+      position: relative;
175
+
176
+      i {
177
+        position: absolute;
178
+        right: 0;
179
+        top: 0;
180
+        font-size: 20px;
181
+        color: #666;
182
+        cursor: pointer;
183
+        padding: 0 5px;
184
+      }
185
+    }
186
+
187
+    .content {
188
+      width: 100%;
189
+      height: 117px;
190
+      background: #f9fafb;
191
+      border: 1px solid #e5e9ed;
192
+      border-radius: 5px;
193
+      overflow: hidden;
194
+      margin-top: 12px;
195
+
196
+      div {
197
+        text-align: center;
198
+        margin: 0;
199
+
200
+        &.icon {
201
+          margin-top: 17px;
202
+
203
+          i {
204
+            color: #34b349;
205
+            font-size: 30px !important;
206
+
207
+            &.transport-wenhao {
208
+              color: #f5a523;
209
+            }
210
+
211
+            &.transport-shibai {
212
+              color: #ff3a52;
213
+            }
214
+          }
215
+        }
216
+
217
+        &.defeat {
218
+          color: #333;
219
+          font-size: 18px;
220
+        }
221
+
222
+        &:nth-child(3) {
223
+          font-size: 14px;
224
+          color: #666;
225
+        }
226
+      }
227
+    }
228
+
229
+    button {
230
+      margin-top: 10px;
231
+
232
+      &.btn {
233
+        margin-left: 8px;
234
+      }
235
+    }
236
+  }
237
+
238
+  // 新增
239
+  &.add {
240
+    .modalBody {
241
+      width: 400px;
242
+      height: auto;
243
+
244
+      .content {
245
+        width: 100%;
246
+        height: auto;
247
+        padding: 19px 14px 0 14px;
248
+        max-height: 500px;
249
+        overflow-y: auto;
250
+				
251
+				.ant-input-number{
252
+					width: 100%;
253
+				}
254
+				.list-template__bottom {
255
+				  background: #f9fafb;
256
+				  border: 1px solid #e5e9ed;
257
+				  border-radius: 8px;
258
+				  position: relative;
259
+				  .list-template__nzTable {
260
+				    padding: 16px 16px 0;
261
+				
262
+				    .thead {
263
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
264
+				
265
+				      th {
266
+				        background: transparent;
267
+				        color: #fff;
268
+				        text-align: center;
269
+				      }
270
+				    }
271
+				
272
+				    .ant-table-body {
273
+				      border-bottom: 1px solid #e5e9ed;
274
+				    }
275
+				
276
+				    .ant-table-tbody {
277
+				      tr {
278
+				        text-align: center;
279
+				        color: #333;
280
+				
281
+				        td {
282
+				          border: none;
283
+				
284
+				          &.tab_hover:hover{
285
+				            text-decoration: underline;
286
+				            cursor: pointer;
287
+				          }
288
+				
289
+				          .coop {
290
+				            button{
291
+				              color: #333;
292
+				            }
293
+				            span,button {
294
+				              display: inline-block;
295
+				              padding: 0 8px;
296
+				              cursor: pointer;
297
+				              position: relative;
298
+				
299
+				              &::after {
300
+				                content: "|";
301
+				                position: absolute;
302
+				                top: 0;
303
+				                right: 0;
304
+				              }
305
+				
306
+				              &:hover,
307
+				              &:active {
308
+				                color: @primary-color;
309
+				              }
310
+				
311
+				              &:nth-last-child(1) {
312
+				                &::after {
313
+				                  content: "";
314
+				                }
315
+				              }
316
+				            }
317
+				          }
318
+				        }
319
+				      }
320
+				    }
321
+				  }
322
+				  .list-template__pagination {
323
+				    height: 56px;
324
+				    display: flex;
325
+				    align-items: center;
326
+				    position: absolute;
327
+				    right: 8px;
328
+				  }
329
+				}
330
+				
331
+        .addForm {
332
+          .ant-form-item {
333
+            margin-bottom: 14px;
334
+
335
+            .ant-form-item-label {
336
+              line-height: 14px;
337
+              text-align: left;
338
+            }
339
+          }
340
+        }
341
+
342
+        .editForm {
343
+          .ant-form-item {
344
+            margin-bottom: 14px;
345
+
346
+            .ant-form-item-label {
347
+              line-height: 0;
348
+              text-align: left;
349
+            }
350
+          }
351
+        }
352
+      }
353
+
354
+      button {
355
+        &:nth-child(1) {
356
+          margin-right: 20px;
357
+        }
358
+      }
359
+    }
360
+  }
361
+}
362
+
363
+.monad{
364
+	padding: 10px;
365
+	border: 1px solid #e7e7e7;
366
+	border-radius: 5px;
367
+	margin-top: 20px;
368
+	.monad-title{
369
+		text-align: center;
370
+		font-weight: 700;
371
+		font-size: 16px;
372
+	}
373
+	.monad-sign{
374
+		display: flex;
375
+		line-height: 30px;
376
+		div{
377
+			margin-right: 15px;
378
+		}
379
+	}
380
+}

+ 368 - 0
src/app/views/dispensing-detail/dispensing-detail.component.ts

@@ -0,0 +1,368 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { NzMessageService } from "ng-zorro-antd";
14
+import { Subject } from "rxjs";
15
+import { debounceTime, filter } from "rxjs/operators";
16
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
17
+
18
+@Component({
19
+  selector: "app-dispensing-detail",
20
+  templateUrl: "./dispensing-detail.component.html",
21
+  styleUrls: ["./dispensing-detail.component.less"],
22
+})
23
+export class DispensingDetailComponent implements OnInit {
24
+  @ViewChild("osComponentRef1", {
25
+    read: OverlayScrollbarsComponent,
26
+    static: false,
27
+  })
28
+  osComponentRef1: OverlayScrollbarsComponent;
29
+  constructor(
30
+    private message: NzMessageService,
31
+    private fb: FormBuilder,
32
+    private route: ActivatedRoute,
33
+    private router: Router,
34
+    private mainService: MainService,
35
+    private tool: ToolService,
36
+    private http: HttpClient,
37
+  ) {}
38
+
39
+  ngOnInit() {
40
+    this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
41
+			this.isDeptLoading = true;
42
+			if(e[1]=='dept'){
43
+				this.getDeparts(e[0]);
44
+			}else{
45
+				this.getBuilding(e[0]);
46
+			}
47
+    });
48
+		this.detailId = this.route.snapshot.params.id;
49
+		this.hosId = this.tool.getCurrentHospital().id;
50
+    this.coopBtns = this.tool.initCoopBtns(this.route);
51
+    this.getAllHospital();
52
+  }
53
+	detailId:null; //列表数据
54
+	deptId:null; //选中的科室id
55
+  listOfData: any[] = []; //表格数据
56
+  promptContent: string; //操作提示框提示信息
57
+  ifSuccess: boolean; //操作成功/失败
58
+  promptInfo: string; //操作结果提示信息
59
+  promptModalShow: boolean; //操作提示框是否展示
60
+  modal: boolean = false; //新增/编辑模态框
61
+  add: boolean; //true:新增;false:编辑
62
+  validateForm: FormGroup; //新增/编辑表单
63
+  coopId: number; //表格中执行操作的id
64
+  department: number; //所属科室
65
+	drug: number; //药品名称
66
+	hosId: number; 
67
+	rowId:number; //清单id
68
+	dateRange;//时间
69
+  batchNumber; //批次号
70
+  num; //编码
71
+  deptalias; //别名
72
+  type; //类型
73
+  deptHandoverType; //类型
74
+  pageIndex: number = 1; //页码
75
+  listLength: number = 10; //总条数
76
+  pageSize: number = 10; //每页条数
77
+  btnLoading: boolean = false; //确认按钮loading状态
78
+  printLoading: boolean = false; //批量打印按钮loading状态
79
+  deptPhones: any = []; //新添加的科室电话列表
80
+  isAddDeptsPhone = true; //添加新的科室电话是否禁用
81
+  deptsPhoneId = 1; //科室电话自增id
82
+  allParentdepart: any = []; //所有的父级科室列表
83
+  hospitals1: any = []; //科室列表
84
+	buildingList: any = []; //楼栋列表
85
+	deptList: any = []; //楼栋科室
86
+	building:''; //楼栋
87
+	deptIndex:number; //选中index
88
+  searchParentDeptSubject = new Subject();
89
+  // 初始化增删改按钮
90
+  coopBtns: any = {};
91
+	deptName:null;
92
+  //搜索父级科室
93
+	isDeptLoading = false;
94
+  changeInp(e, type) {
95
+    this.searchParentDeptSubject.next([e, type]);
96
+  }
97
+
98
+  // 表格数据
99
+  loading1 = false;
100
+  getList() {
101
+    var that = this;
102
+    let data = {
103
+    	idx: 0,
104
+    	sum: 9999,
105
+    	drugsConfigure: {
106
+    	  hosId: this.hosId,
107
+				deptId :this.deptId,
108
+    	  batchId: this.detailId
109
+    	}
110
+    };
111
+    this.loading1 = true;
112
+    that.mainService
113
+      .getFetchDataList("data", "drugsConfigure", data)
114
+      .subscribe((data) => {
115
+        this.loading1 = false;
116
+        that.listOfData = data.list;
117
+      });
118
+  }
119
+	
120
+	// 发药科室列表
121
+	getDispensingDept(e,type){
122
+		var that = this;
123
+		let data = {
124
+			idx: 0,
125
+			sum: 9999,
126
+			drugsConfigure: {
127
+			  hosId: this.hosId,
128
+				deptId :e,
129
+				batchId:''
130
+			}
131
+		};
132
+		if(type=='dept'){
133
+			data.drugsConfigure.batchId = this.detailId
134
+		}else{
135
+			delete data.drugsConfigure.batchId
136
+		}
137
+		that.mainService
138
+		  .getFetchDataList("data", "drugsConfigure", data)
139
+		  .subscribe((res) => {
140
+				this.getDeptData(e,'all','')
141
+		  });
142
+	}
143
+	
144
+	// 科室点击
145
+	deptClick(e,item,index){
146
+		e.stopPropagation();
147
+		this.deptId = item.applyDeptDTO.id
148
+		this.deptName = item.applyDeptDTO.dept
149
+		this.deptIndex = index
150
+		this.getList()
151
+	}
152
+	
153
+	// 科室删除
154
+	deptDel(e,item,index){
155
+		e.stopPropagation();
156
+		this.delModal = true;
157
+		this.coopId = item.applyDept;
158
+	}
159
+	
160
+	hideDelModal() {
161
+	  this.delModal = false;
162
+	}
163
+	
164
+	// 确认删除
165
+	confirmDel() {
166
+		var that = this;
167
+		let data = {
168
+			hosId: this.hosId,
169
+			deptId :this.coopId,
170
+			batchId: this.detailId
171
+		};
172
+		that.btnLoading = true;
173
+		that.mainService
174
+		  .transfusionConfigDeptDel(data)
175
+		  .subscribe((res) => {
176
+				that.btnLoading = false;
177
+				that.delModal = false;
178
+				this.getDispensingDept('','')
179
+				if (res.status==200) {
180
+				  that.showPromptModal("删除", true, "");
181
+				} else {
182
+				  that.showPromptModal("删除", false, res.msg);
183
+				}
184
+		  });
185
+	}
186
+	// 选择楼栋
187
+	buildingChange(e){
188
+		this.getDeptData(e,'','')
189
+	}
190
+	
191
+	// 根据楼栋查询科室
192
+	getDeptData(e,type,initial){
193
+		var that = this;
194
+		let data = {
195
+		  idx: 0,
196
+		  sum: 99999,
197
+		  drugsList: {
198
+				hosId: this.hosId,
199
+				buildingId:e,
200
+				batch:{
201
+					id:this.detailId
202
+				}
203
+		  },
204
+		};
205
+		if(type=='all'){
206
+			delete data.drugsList.buildingId
207
+		}else{
208
+			data.drugsList.buildingId = e
209
+		}
210
+		that.mainService
211
+		  .getFetchDataList("data", "drugsList", data)
212
+		  .subscribe((res) => {
213
+				// this.deptId = null
214
+				// this.deptName = null
215
+				// this.deptIndex = null
216
+		    that.deptList = res.list;
217
+				if(initial=='load'){
218
+					if(res.list.length>0){
219
+						this.deptId = res.list[0].id
220
+						this.deptName = res.list[0].applyDeptDTO.dept
221
+						this.deptIndex = 0
222
+						this.getList()
223
+					}
224
+				}
225
+		  });
226
+	}
227
+	
228
+	// 选择科室
229
+	deptChange(e){
230
+		this.getDispensingDept(e,'dept')
231
+	}
232
+	
233
+	// 获取楼栋
234
+	getBuilding(name){
235
+		let postData = {
236
+		  building: {
237
+		    cascadeHosId: this.hosId,
238
+		    buildingName: name
239
+		  },
240
+		  idx: 0,
241
+		  sum: 20,
242
+		};
243
+		this.mainService
244
+		  .getFetchDataList("data", "building", postData)
245
+		  .subscribe((result) => {
246
+				setTimeout(_=>{
247
+					this.isDeptLoading = false
248
+					this.buildingList = result.list;
249
+				},500)
250
+		  });
251
+	}
252
+	
253
+	// 获取所有科室
254
+  getDeparts(dept) {
255
+    var that = this;
256
+    let data = {
257
+      department: {
258
+        dept,
259
+        hospital: {
260
+          id: this.hosId
261
+        },
262
+      },
263
+      idx: 0,
264
+      sum: 20,
265
+    };
266
+    that.mainService
267
+      .getFetchDataList("data", "department", data)
268
+      .subscribe((data) => {
269
+				setTimeout(_=>{
270
+					that.isDeptLoading = false;
271
+					this.hospitals1 = data.list
272
+				},500)
273
+      });
274
+  }
275
+	
276
+  // 获取所有院区
277
+  getAllHospital() {
278
+		this.getDeparts('')
279
+		this.getBuilding('')
280
+		this.getDeptData('','all','load')
281
+  }
282
+	
283
+	// 增加/减少
284
+	itemClick(e, id, type){
285
+		e.stopPropagation();
286
+		this.rowId = id
287
+		if(type=='add'){
288
+			this.add = true
289
+		}else{
290
+			this.add = false
291
+		}
292
+		this.modal = true
293
+		this.initForm();
294
+	}
295
+	
296
+	// 表单提交
297
+	submitForm(): void {
298
+	  var that = this;
299
+		for (const i in that.validateForm.controls) {
300
+		  that.validateForm.controls[i].markAsDirty();
301
+		  that.validateForm.controls[i].updateValueAndValidity();
302
+		}
303
+		if (that.validateForm.invalid) return;
304
+	  let data = {
305
+			addSub:this.add?this.validateForm.value.addNum:this.validateForm.value.delNum,
306
+			id:this.rowId,
307
+			hosId:this.hosId,
308
+			deptId:this.deptId,
309
+			upType:that.add ? 'add' : 'sub'
310
+	  };
311
+	  that.mainService
312
+	    .simplePost("addData", "drugsConfigure", data)
313
+	    .subscribe((data) => {
314
+	      that.btnLoading = false;
315
+	      that.hideModal();
316
+	      if (data.status == 200) {
317
+	        that.showPromptModal(that.add ? "增加" : "减少", true, "");
318
+	      } else {
319
+	        that.showPromptModal(that.add ? "增加" : "减少", false, data.msg);
320
+	      }
321
+	    });
322
+	}
323
+
324
+  // 新增弹框
325
+  showModal() {
326
+    this.add = true;
327
+    this.isAddDeptsPhone = true;
328
+    this.deptPhones = [];
329
+  }
330
+	// 返回
331
+	back(){
332
+		this.router.navigateByUrl(`/main/dispensingBatch`);
333
+	}
334
+	
335
+  hideModal() {
336
+		this.initForm();
337
+    this.modal = false;
338
+  }
339
+  // 初始化新增form表单
340
+  initForm() {
341
+		if(this.add){
342
+			this.validateForm = this.fb.group({
343
+			  addNum: [null, [Validators.required]]
344
+			});
345
+		}else{
346
+			this.validateForm = this.fb.group({
347
+				delNum: [null, [Validators.required]]
348
+			});
349
+		}
350
+  }
351
+
352
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
353
+  showPromptModal(con, success, promptInfo?) {
354
+    this.promptModalShow = false;
355
+    this.promptContent = con;
356
+    this.ifSuccess = success;
357
+    this.promptInfo = promptInfo;
358
+    setTimeout(() => {
359
+      this.promptModalShow = true;
360
+    }, 100);
361
+    this.getList();
362
+  }
363
+
364
+  delModal: boolean = false; //删除模态框
365
+  coopIds: any;
366
+  coopFlag: any = false;
367
+
368
+}

+ 19 - 0
src/app/views/dispensing-detail/dispensing-detail.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { DispensingDetailRoutingModule } from './dispensing-detail-routing.module';
5
+import { DispensingDetailComponent } from './dispensing-detail.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    DispensingDetailComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    DispensingDetailRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class DispensingDetailModule { }

+ 17 - 0
src/app/views/drug-cloud/drug-cloud-routing.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DrugCloudComponent } from './drug-cloud.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: DrugCloudComponent
10
+  }
11
+];
12
+
13
+@NgModule({
14
+  imports: [RouterModule.forChild(routes)],
15
+  exports: [RouterModule]
16
+})
17
+export class DrugCloudRoutingModule { }

+ 126 - 0
src/app/views/drug-cloud/drug-cloud.component.html

@@ -0,0 +1,126 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzLg='20' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">科室:</span>
7
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event,'dept')" nzServerSearch nzShowSearch nzPlaceHolder="请选择科室" [(ngModel)]="department">
8
+            <ng-container *ngFor="let option of hospitals1">
9
+              <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
10
+            </ng-container>
11
+            <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
12
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
13
+            </nz-option>
14
+          </nz-select>
15
+        </div>
16
+        <div class="list-template__searchItem">
17
+          <span class="label">药品:</span>
18
+					<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" (nzOnSearch)="changeInp($event,'drug')" nzServerSearch nzShowSearch nzPlaceHolder="请选择药品" [(ngModel)]="drug">
19
+					  <ng-container *ngFor="let option of drugData">
20
+					    <nz-option *ngIf="!isDeptLoading" [nzLabel]="option.drugName" [nzValue]="option.id"></nz-option>
21
+					  </ng-container>
22
+					  <nz-option *ngIf="isDeptLoading" nzDisabled nzCustomContent>
23
+					    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
24
+					  </nz-option>
25
+					</nz-select>
26
+        </div>
27
+      </div>
28
+      <div nz-col nzLg="4" class="list-template__btns">
29
+        <button class="btn default" (click)='search()'>搜索</button>
30
+        <button class="btn default ml8" (click)='reset()'>重置</button>
31
+      </div>
32
+    </div>
33
+    <div class="list-template__bottom">
34
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
35
+        [nzLoading]="loading1">
36
+        <thead>
37
+          <tr class="thead">
38
+						<th nzWidth="20%">科室名称</th>
39
+            <th nzWidth="20%">药品名称</th>
40
+            <th nzWidth="10%">规格</th>
41
+            <th nzWidth="20%">库存数量(正负值)</th>
42
+            <th nzWidth="20%">库存价值(正负值)</th>
43
+            <th nzWidth="10%">操作</th>
44
+          </tr>
45
+        </thead>
46
+        <tbody>
47
+          <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>
53
+            <td>
54
+              <div class="coop">
55
+                <span *ngIf="coopBtns.historyRecord" (click)="detail($event,data.id)">历史记录</span>
56
+              </div>
57
+            </td>
58
+          </tr>
59
+        </tbody>
60
+      </nz-table>
61
+      <div class="list-template__pagination">
62
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
63
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
64
+        </nz-pagination>
65
+      </div>
66
+    </div>
67
+  </div>
68
+
69
+  <!-- 历史记录 -->
70
+  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
71
+    <div class="modalBody">
72
+      <div class="title">历史记录<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
73
+      </div>
74
+      <overlay-scrollbars #osComponentRef1 class="content">
75
+        <div class="list-template__bottom">
76
+          <nz-table class="list-template__nzTable" [nzData]="viewData" nzSize="middle" [nzShowPagination]="false"
77
+            [nzLoading]="loading1">
78
+            <thead>
79
+              <tr class="thead">
80
+                <th nzWidth="13%">时间</th>
81
+                <th nzWidth="13%">批次号</th>
82
+								<th nzWidth="13%">发药单号</th>
83
+                <th nzWidth="8%">消耗数量</th>
84
+								<th nzWidth="8%">原库存数</th>
85
+								<th nzWidth="7%">增减</th>
86
+                <th nzWidth="10%">包装规格</th>
87
+                <th nzWidth="10%">发药药箱</th>
88
+								<th nzWidth="8%">实发数量</th>
89
+                <th nzWidth="10%">计算后库存</th>
90
+              </tr>
91
+            </thead>
92
+            <tbody>
93
+              <tr *ngFor="let data of viewData">
94
+                <td>{{ data.createTime|date:'yyyy-MM-dd HH:mm'}}</td>
95
+                <td>{{ data.drugsList?data.drugsList.batch.batchNo : '无' }}</td>
96
+                <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>
104
+              </tr>
105
+            </tbody>
106
+          </nz-table>
107
+        <!--  <div class="list-template__pagination">
108
+            <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
109
+              (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
110
+            </nz-pagination>
111
+          </div> -->
112
+        </div>
113
+      </overlay-scrollbars>
114
+      <div class="display_flex justify-content_flex-center">
115
+        <button class="btn" nz-button nzType="primary" (click)="hideModal()">知道了</button>
116
+      </div>
117
+    </div>
118
+  </div>
119
+
120
+</div>
121
+<!-- 操作成功/失败提示框 -->
122
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
123
+  [info]="promptInfo"></app-prompt-modal>
124
+<!-- 遮罩 -->
125
+<app-mask *ngIf="maskFlag"></app-mask>
126
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 251 - 0
src/app/views/drug-cloud/drug-cloud.component.less

@@ -0,0 +1,251 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  .add-button {
4
+    margin: 0 auto 16px !important;
5
+  }
6
+  .targetDept {
7
+    overflow: hidden;
8
+    // width: 90px;
9
+    text-overflow: ellipsis;
10
+    white-space: nowrap;
11
+  }
12
+  .dynamic {
13
+    margin-bottom: 16px;
14
+    display: flex;
15
+    align-items: center;
16
+    input {
17
+      width: 90%;
18
+    }
19
+    i {
20
+      margin-left: 8px;
21
+      cursor: pointer;
22
+      font-size: 18px;
23
+    }
24
+  }
25
+}
26
+
27
+.save {
28
+  position: fixed;
29
+  left: 0;
30
+  top: 0;
31
+  width: 100%;
32
+  height: 100%;
33
+  background: rgba(0, 0, 0, 0.4);
34
+  z-index: 99;
35
+
36
+  .modalBody {
37
+    width: 350px;
38
+    background: #fff;
39
+    border-radius: 5px;
40
+    padding: 10px 20px;
41
+    color: #333;
42
+
43
+    .title {
44
+      width: 100%;
45
+      text-align: center;
46
+      font-size: 18px;
47
+      position: relative;
48
+
49
+      i {
50
+        position: absolute;
51
+        right: 0;
52
+        top: 0;
53
+        font-size: 20px;
54
+        color: #666;
55
+        cursor: pointer;
56
+        padding: 0 5px;
57
+      }
58
+    }
59
+
60
+    .content {
61
+      width: 100%;
62
+      height: 117px;
63
+      background: #f9fafb;
64
+      border: 1px solid #e5e9ed;
65
+      border-radius: 5px;
66
+      overflow: hidden;
67
+      margin-top: 12px;
68
+
69
+      div {
70
+        text-align: center;
71
+        margin: 0;
72
+
73
+        &.icon {
74
+          margin-top: 17px;
75
+
76
+          i {
77
+            color: #34b349;
78
+            font-size: 30px !important;
79
+
80
+            &.transport-wenhao {
81
+              color: #f5a523;
82
+            }
83
+
84
+            &.transport-shibai {
85
+              color: #ff3a52;
86
+            }
87
+          }
88
+        }
89
+
90
+        &.defeat {
91
+          color: #333;
92
+          font-size: 18px;
93
+        }
94
+
95
+        &:nth-child(3) {
96
+          font-size: 14px;
97
+          color: #666;
98
+        }
99
+      }
100
+    }
101
+
102
+    button {
103
+      margin-top: 10px;
104
+
105
+      &.btn {
106
+        margin-left: 8px;
107
+      }
108
+    }
109
+  }
110
+
111
+  // 新增
112
+  &.add {
113
+    .modalBody {
114
+      width: 80%;
115
+      height: auto;
116
+
117
+      .content {
118
+        width: 100%;
119
+        height: auto;
120
+        padding: 19px 14px 0 14px;
121
+        max-height: 500px;
122
+        overflow-y: auto;
123
+				
124
+				.list-template__bottom {
125
+				  background: #f9fafb;
126
+				  border: 1px solid #e5e9ed;
127
+				  border-radius: 8px;
128
+				  padding-bottom: 56px;
129
+				  position: relative;
130
+				  .list-template__nzTable {
131
+				    padding: 16px 16px 0;
132
+				
133
+				    .thead {
134
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
135
+				
136
+				      th {
137
+				        background: transparent;
138
+				        color: #fff;
139
+				        text-align: center;
140
+				      }
141
+				    }
142
+				
143
+				    .ant-table-body {
144
+				      border-bottom: 1px solid #e5e9ed;
145
+				    }
146
+				
147
+				    .ant-table-tbody {
148
+				      tr {
149
+				        text-align: center;
150
+				        color: #333;
151
+				
152
+				        td {
153
+				          border: none;
154
+				
155
+				          &.tab_hover:hover{
156
+				            text-decoration: underline;
157
+				            cursor: pointer;
158
+				          }
159
+				
160
+				          .coop {
161
+				            button{
162
+				              color: #333;
163
+				            }
164
+				            span,button {
165
+				              display: inline-block;
166
+				              padding: 0 8px;
167
+				              cursor: pointer;
168
+				              position: relative;
169
+				
170
+				              &::after {
171
+				                content: "|";
172
+				                position: absolute;
173
+				                top: 0;
174
+				                right: 0;
175
+				              }
176
+				
177
+				              &:hover,
178
+				              &:active {
179
+				                color: @primary-color;
180
+				              }
181
+				
182
+				              &:nth-last-child(1) {
183
+				                &::after {
184
+				                  content: "";
185
+				                }
186
+				              }
187
+				            }
188
+				          }
189
+				        }
190
+				      }
191
+				    }
192
+				  }
193
+				  .list-template__pagination {
194
+				    height: 56px;
195
+				    display: flex;
196
+				    align-items: center;
197
+				    position: absolute;
198
+				    right: 8px;
199
+				  }
200
+				}
201
+				
202
+        .addForm {
203
+          .ant-form-item {
204
+            margin-bottom: 14px;
205
+
206
+            .ant-form-item-label {
207
+              line-height: 14px;
208
+              text-align: left;
209
+            }
210
+          }
211
+        }
212
+
213
+        .editForm {
214
+          .ant-form-item {
215
+            margin-bottom: 14px;
216
+
217
+            .ant-form-item-label {
218
+              line-height: 0;
219
+              text-align: left;
220
+            }
221
+          }
222
+        }
223
+      }
224
+
225
+      button {
226
+        &:nth-child(1) {
227
+          margin-right: 20px;
228
+        }
229
+      }
230
+    }
231
+  }
232
+}
233
+
234
+.monad{
235
+	padding: 10px;
236
+	border: 1px solid #e7e7e7;
237
+	border-radius: 5px;
238
+	margin-top: 20px;
239
+	.monad-title{
240
+		text-align: center;
241
+		font-weight: 700;
242
+		font-size: 16px;
243
+	}
244
+	.monad-sign{
245
+		display: flex;
246
+		line-height: 30px;
247
+		div{
248
+			margin-right: 15px;
249
+		}
250
+	}
251
+}

+ 322 - 0
src/app/views/drug-cloud/drug-cloud.component.ts

@@ -0,0 +1,322 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { NzMessageService } from "ng-zorro-antd";
14
+import { Subject } from "rxjs";
15
+import { debounceTime, filter } from "rxjs/operators";
16
+import host from "../../../assets/js/http";
17
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
18
+
19
+@Component({
20
+  selector: "app-drug-cloud",
21
+  templateUrl: "./drug-cloud.component.html",
22
+  styleUrls: ["./drug-cloud.component.less"],
23
+})
24
+export class DrugCloudComponent implements OnInit {
25
+  @ViewChild("osComponentRef1", {
26
+    read: OverlayScrollbarsComponent,
27
+    static: false,
28
+  })
29
+  osComponentRef1: OverlayScrollbarsComponent;
30
+  constructor(
31
+    private message: NzMessageService,
32
+    private fb: FormBuilder,
33
+    private route: ActivatedRoute,
34
+    private router: Router,
35
+    private mainService: MainService,
36
+    private tool: ToolService,
37
+    private http: HttpClient,
38
+  ) {}
39
+
40
+  ngOnInit() {
41
+    this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
42
+			this.isDeptLoading = true;
43
+			if(e[1]=='dept'){
44
+				this.getDeparts(e[0]);
45
+			}else{
46
+				this.getDrugInfo(e[0]);
47
+			}
48
+    });
49
+		this.hosId = this.tool.getCurrentHospital().id;
50
+    this.coopBtns = this.tool.initCoopBtns(this.route);
51
+    this.initForm();
52
+    this.getAllHospital();
53
+  }
54
+  listOfData: any[] = []; //表格数据
55
+  promptContent: string; //操作提示框提示信息
56
+  ifSuccess: boolean; //操作成功/失败
57
+  promptInfo: string; //操作结果提示信息
58
+  promptModalShow: boolean; //操作提示框是否展示
59
+  modal: boolean = false; //新增/编辑模态框
60
+  add: boolean; //true:新增;false:编辑
61
+  validateForm: FormGroup; //新增/编辑表单
62
+  coopId: number; //表格中执行操作的id
63
+  department: number; //所属科室
64
+	drug: number; //药品名称
65
+	hosId: number; 
66
+	dateRange;//时间
67
+  batchNumber; //批次号
68
+  num; //编码
69
+  deptalias; //别名
70
+  type; //类型
71
+  deptHandoverType; //类型
72
+  pageIndex: number = 1; //页码
73
+  listLength: number = 10; //总条数
74
+  pageSize: number = 10; //每页条数
75
+  btnLoading: boolean = false; //确认按钮loading状态
76
+  printLoading: boolean = false; //批量打印按钮loading状态
77
+  deptPhones: any = []; //新添加的科室电话列表
78
+  isAddDeptsPhone = true; //添加新的科室电话是否禁用
79
+  deptsPhoneId = 1; //科室电话自增id
80
+  allParentdepart: any = []; //所有的父级科室列表
81
+  hospitals1: any = []; //科室列表(搜索)
82
+	rowData: object = {}; //打印选择列表
83
+  searchParentDeptSubject = new Subject();
84
+  // 初始化增删改按钮
85
+  coopBtns: any = {};
86
+	drugData: any = []; //药品搜索列表
87
+	drugTypeData: any = {}; //药品类型
88
+	viewData: any = []; //历史记录
89
+  // 导入---start
90
+  // model-取消
91
+  isShow = false;
92
+  hideExcelImport() {
93
+    this.isShow = false;
94
+  }
95
+  // 触发
96
+  excelImport() {
97
+    this.isShow = true;
98
+  }
99
+
100
+  // 导入---end
101
+  //搜索父级科室
102
+	isDeptLoading = false;
103
+  changeInp(e,type) {
104
+    this.searchParentDeptSubject.next([e,type]);
105
+  }
106
+
107
+  // 配送建单
108
+  coopData:any = {};
109
+  addDateModal(data) {
110
+    this.coopData = data;
111
+    this.showDelModal1();
112
+  }
113
+  delModal1: boolean = false; //删除模态框
114
+
115
+  showDelModal1() {
116
+    this.delModal1 = true;
117
+  }
118
+  hideDelModal1() {
119
+    this.delModal1 = false;
120
+  }
121
+
122
+  // 搜索
123
+  search() {
124
+    this.pageIndex = 1;
125
+    this.getList();
126
+  }
127
+  // 重置
128
+  reset() {
129
+    this.pageIndex = 1;
130
+    this.department = null;
131
+    this.drug = null;
132
+    this.getList();
133
+  }
134
+	
135
+	// 获取药品类型
136
+	getDrugType(){
137
+		this.mainService.getDictionary("list", "drug_type").subscribe((data) => {
138
+			this.drugTypeData = data.find(i=>i.value=='infusion_solutions')
139
+			this.getDrugInfo('')
140
+		});
141
+	}
142
+	
143
+	// 获取药品信息
144
+	getDrugInfo(e) {
145
+	  let data = {
146
+	    idx: 0,
147
+	    sum: 20,
148
+	    drugsInfo: {
149
+				drugName: e,
150
+	      hosId: this.hosId || "" ,
151
+				drugType:{
152
+					id:this.drugTypeData.id
153
+				}
154
+	    },
155
+	  };
156
+	  this.mainService
157
+	    .getFetchDataList("data", "drugsInfo", data)
158
+	    .subscribe((data) => {
159
+				this.isDeptLoading = false;
160
+	      this.drugData = data.list;
161
+				this.getList();
162
+	    });
163
+	}
164
+	
165
+  // 表格数据
166
+  loading1 = false;
167
+  getList() {
168
+    var that = this;
169
+    let data = {
170
+      idx: that.pageIndex - 1,
171
+      sum: that.pageSize,
172
+      drugsCloudInventory: {
173
+        deptId: that.department,
174
+        drugId: that.drug,
175
+        hosId: this.hosId
176
+      },
177
+    };
178
+    this.loading1 = true;
179
+    that.mainService
180
+      .getFetchDataList("data", "drugsCloudInventory", data)
181
+      .subscribe((data) => {
182
+        this.loading1 = false;
183
+        that.listOfData = data.list;
184
+        that.listLength = data.totalNum;
185
+      });
186
+  }
187
+	
188
+	
189
+	// 获取所有科室
190
+  getDeparts(dept) {
191
+    var that = this;
192
+    let data = {
193
+      department: {
194
+        dept,
195
+        hospital: {
196
+          id: this.hosId
197
+        },
198
+      },
199
+      idx: 0,
200
+      sum: 20,
201
+    };
202
+    that.mainService
203
+      .getFetchDataList("data", "department", data)
204
+      .subscribe((data) => {
205
+				setTimeout(_=>{
206
+					this.isDeptLoading = false
207
+					this.hospitals1 = data.list
208
+				},500)
209
+      });
210
+  }
211
+	
212
+  // 获取所有院区
213
+  getAllHospital() {
214
+		this.getDeparts('')
215
+    this.getDrugType();
216
+  }
217
+
218
+
219
+  // 新增弹框
220
+  showModal() {
221
+    this.initForm();
222
+    // this.changeHosp();
223
+    this.add = true;
224
+    this.isAddDeptsPhone = true;
225
+    this.deptPhones = [];
226
+  }
227
+  hideModal() {
228
+    this.modal = false;
229
+    this.initForm();
230
+  }
231
+  // 初始化新增form表单
232
+  initForm() {
233
+    this.validateForm = this.fb.group({
234
+      parentOfficeName: [null],
235
+      officeName: [null, [Validators.required]],
236
+      deptalias: [null],
237
+      officeNo: [null, [Validators.required]],
238
+      officeNum: [null, [Validators.required]],
239
+      building: [null, [Validators.required]],
240
+      floor: [null, [Validators.required]],
241
+      officeAddress: [null, [Validators.required]],
242
+      officeType: [null, [Validators.required]],
243
+      deptHandoverType: [null],
244
+      startTime1: [null],
245
+      endTime1: [null],
246
+      dynamicCode1: [null],
247
+      startTime2: [null],
248
+      endTime2: [null],
249
+      dynamicCode2: [null],
250
+    });
251
+  }
252
+  // 科室位置必填
253
+  buildValidator = (control: FormControl): { [s: string]: boolean } => {
254
+    if (
255
+      this.validateForm &&
256
+      this.validateForm.value &&
257
+      (!this.validateForm.value.building ||
258
+        !this.validateForm.value.floor ||
259
+        !this.validateForm.value.officeAddress)
260
+    ) {
261
+      return { required: true };
262
+    }
263
+  };
264
+
265
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
266
+  showPromptModal(con, success, promptInfo?) {
267
+    this.promptModalShow = false;
268
+    this.promptContent = con;
269
+    this.ifSuccess = success;
270
+    this.promptInfo = promptInfo;
271
+    setTimeout(() => {
272
+      this.promptModalShow = true;
273
+    }, 100);
274
+    this.getList();
275
+  }
276
+
277
+  delModal: boolean = false; //删除模态框
278
+  coopIds: any;
279
+  coopFlag: any = false;
280
+  /**
281
+   *
282
+   * @param e 事件对象
283
+   * @param flag true是批量删除,false是单个删除
284
+   * @param id
285
+   */
286
+  showDelModal(e, flag, id) {
287
+    e.stopPropagation();
288
+    this.delModal = true;
289
+    this.coopFlag = flag;
290
+    if (flag) {
291
+      this.coopIds = id;
292
+    } else {
293
+      this.coopId = id;
294
+    }
295
+  }
296
+  hideDelModal() {
297
+    this.delModal = false;
298
+  }
299
+
300
+  // 查看
301
+  detail(e, id) {
302
+    e.stopPropagation();
303
+		var that = this;
304
+		let data = {
305
+			idx: 0,
306
+			sum: 9999,
307
+			drugsLog: {
308
+			  hosId: this.hosId,
309
+			  drugListId: id
310
+			}
311
+		};
312
+		this.loading1 = true;
313
+		that.mainService
314
+		  .getFetchDataList("data", "drugsLog", data)
315
+		  .subscribe((data) => {
316
+		    this.loading1 = false;
317
+				this.modal = true
318
+		    that.viewData = data.list;
319
+		  });
320
+  }
321
+
322
+}

+ 19 - 0
src/app/views/drug-cloud/drug-cloud.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { DrugCloudRoutingModule } from './drug-cloud-routing.module';
5
+import { DrugCloudComponent } from './drug-cloud.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    DrugCloudComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    DrugCloudRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class DrugCloudModule { }

+ 15 - 0
src/app/views/drug-info/drug-info-routing.module.ts

@@ -0,0 +1,15 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DrugInfoComponent } from './drug-info.component';
4
+
5
+
6
+const routes: Routes = [{
7
+  path: '',
8
+  component: DrugInfoComponent
9
+}];
10
+
11
+@NgModule({
12
+  imports: [RouterModule.forChild(routes)],
13
+  exports: [RouterModule]
14
+})
15
+export class DrugInfoRoutingModule { }

+ 184 - 0
src/app/views/drug-info/drug-info.component.html

@@ -0,0 +1,184 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">药品标识</span>:
7
+          <input nz-input class="formItem" [(ngModel)]="drugCode" placeholder="请输入药品标识" nzSize="default" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">药品名称</span>:
11
+          <input nz-input class="formItem" [(ngModel)]="name" placeholder="请输入药品名称" nzSize="default" />
12
+        </div>
13
+      </div>
14
+      <div nz-col nzXl='6' class="list-template__btns">
15
+        <button nz-button class="btn default" (click)='search()'>搜索</button>
16
+        <button nz-button class="btn ml8 default" (click)='reset()'>重置</button>
17
+        <button nz-button *ngIf="coopBtns.add" class="btn ml8 default" (click)="showModal()">新增</button>
18
+      </div>
19
+    </div>
20
+    <div class="list-template__bottom">
21
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
22
+        [nzLoading]="loading1">
23
+        <thead>
24
+          <tr class="thead">
25
+            <th nzWidth="5%">序号</th>
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>
35
+          </tr>
36
+        </thead>
37
+        <tbody>
38
+          <tr *ngFor="let data of listOfData;let index=index;">
39
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
40
+            <td>{{ data.drugCode||'-' }}</td>
41
+            <td>{{ data.drugName||'-' }}</td>
42
+            <td>{{ data.specs||'-'}}</td>
43
+            <td>{{ data.unit||'-' }}</td>
44
+            <td>{{ data.unitPrice||'-' }}</td>
45
+            <td>{{ data.packingSpecs }}</td>
46
+						<td>{{ data.lowerRound }}</td>
47
+						<td>{{ data.upperRound }}</td>
48
+            <td>
49
+              <div class="coop">
50
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
51
+                <span *ngIf="coopBtns.del" (click)="del(data)">删除</span>
52
+              </div>
53
+            </td>
54
+          </tr>
55
+        </tbody>
56
+      </nz-table>
57
+      <div class="list-template__pagination">
58
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
59
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
60
+        </nz-pagination>
61
+      </div>
62
+    </div>
63
+  </div>
64
+</div>
65
+<!-- 新增/编辑模态框 -->
66
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
67
+  <div class="modalBody">
68
+    <div class="title">药品信息 - {{add?"新增":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
69
+    </div>
70
+    <overlay-scrollbars #osComponentRef1 class="content">
71
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
72
+        <nz-form-item>
73
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="drugCode">药品标识</nz-form-label>
74
+          <nz-form-control nzErrorTip="请填写药品标识!">
75
+            <nz-input-group>
76
+              <input type="text" pattern="^[^\u4e00-\u9fa5]+$" (input)="handleInput($event)"
77
+							nz-input formControlName="drugCode" placeholder="请填写药品标识" />
78
+            </nz-input-group>
79
+          </nz-form-control>
80
+        </nz-form-item>
81
+        <nz-form-item>
82
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="drugName">药品名称</nz-form-label>
83
+          <nz-form-control nzErrorTip="请填写药品名称!">
84
+            <nz-input-group>
85
+              <input type="drugName" nz-input formControlName="drugName" placeholder="请填写药品名称" />
86
+            </nz-input-group>
87
+          </nz-form-control>
88
+        </nz-form-item>
89
+        <nz-form-item>
90
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="specs">规格</nz-form-label>
91
+          <nz-form-control nzErrorTip="请填写规格!">
92
+            <nz-input-group>
93
+              <input type="specs" nz-input formControlName="specs" placeholder="请填写规格" />
94
+            </nz-input-group>
95
+          </nz-form-control>
96
+        </nz-form-item>
97
+        <nz-form-item>
98
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="unit">单位</nz-form-label>
99
+          <nz-form-control nzErrorTip="请填写单位!">
100
+            <nz-input-group>
101
+              <input nz-input formControlName="unit" placeholder="请填写单位" />
102
+            </nz-input-group>
103
+          </nz-form-control>
104
+        </nz-form-item>
105
+        <nz-form-item>
106
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="unitPrice">单价</nz-form-label>
107
+          <nz-form-control nzErrorTip="请填写单价!">
108
+           <nz-input-number
109
+							formControlName="unitPrice"
110
+            	[nzMin]="0"
111
+							[nzPrecision]="2"
112
+            	[nzMax]="999999"
113
+            	[nzStep]="0.1"
114
+            	[nzPlaceHolder]="'请填写单价(保留2位小数)'"
115
+            ></nz-input-number>
116
+          </nz-form-control>
117
+        </nz-form-item>
118
+				<nz-form-item>
119
+				  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="packingSpecs">包装规格</nz-form-label>
120
+				  <nz-form-control nzErrorTip="请填写包装规格!">
121
+				    <nz-input-group>
122
+							<nz-input-number
123
+								formControlName="packingSpecs"
124
+								[nzMin]="0"
125
+								[nzPrecision]="0"
126
+								[nzMax]="999999"
127
+								[nzStep]="1"
128
+								[nzPlaceHolder]="'请填写包装规格'"
129
+							 ></nz-input-number>
130
+						 </nz-input-group>
131
+				  </nz-form-control>
132
+				</nz-form-item>
133
+				<nz-form-item>
134
+				  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="lowerRound">低舍</nz-form-label>
135
+				  <nz-form-control nzErrorTip="请填写低舍!">
136
+				    <nz-input-group>
137
+							<nz-input-number
138
+								formControlName="lowerRound"
139
+								[nzMin]="0"
140
+								[nzPrecision]="0"
141
+								[nzMax]="999999"
142
+								[nzStep]="1"
143
+								[nzPlaceHolder]="'请填写低舍'"
144
+							 ></nz-input-number>
145
+						</nz-input-group>
146
+				  </nz-form-control>
147
+				</nz-form-item>
148
+				<nz-form-item>
149
+				  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="upperRound">高入</nz-form-label>
150
+				  <nz-form-control nzErrorTip="请填写高入!">
151
+				    <nz-input-group>
152
+							<nz-input-number
153
+								formControlName="upperRound"
154
+								[nzMin]="0"
155
+								[nzPrecision]="0"
156
+								[nzMax]="999999"
157
+								[nzStep]="1"
158
+								[nzPlaceHolder]="'请填写高入'"
159
+							 ></nz-input-number>
160
+						</nz-input-group>
161
+				  </nz-form-control>
162
+				</nz-form-item>
163
+      </form>
164
+    </overlay-scrollbars>
165
+    <div class="display_flex justify-content_flex-center">
166
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
167
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
168
+    </div>
169
+  </div>
170
+</div>
171
+<!-- 删除模态框 -->
172
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" [cancenlLoading]="cancenlLoading"
173
+  (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="是否删除药品信息?" confirmTxt="是" cancelTxt="否">
174
+</app-dialog-delete>
175
+
176
+<!-- 操作成功/失败提示框 -->
177
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
178
+  [info]="promptInfo"></app-prompt-modal>
179
+
180
+<!-- 查看详情 -->
181
+<router-outlet (deactivate)="getList()"></router-outlet>
182
+
183
+<!-- 遮罩 -->
184
+<app-mask *ngIf="maskFlag"></app-mask>

+ 130 - 0
src/app/views/drug-info/drug-info.component.less

@@ -0,0 +1,130 @@
1
+@import "../../../../src/theme.less";
2
+.save {
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  width: 100%;
7
+  height: 100%;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 99;
10
+
11
+  .modalBody {
12
+    width: 350px;
13
+    background: #fff;
14
+    border-radius: 5px;
15
+    padding: 10px 20px;
16
+    color: #333;
17
+
18
+    .title {
19
+      width: 100%;
20
+      text-align: center;
21
+      font-size: 18px;
22
+      position: relative;
23
+
24
+      i {
25
+        position: absolute;
26
+        right: 0;
27
+        top: 0;
28
+        font-size: 20px;
29
+        color: #666;
30
+        cursor: pointer;
31
+        padding: 0 5px;
32
+      }
33
+    }
34
+
35
+    .content {
36
+      width: 100%;
37
+      height: 117px;
38
+      background: #f9fafb;
39
+      border: 1px solid #e5e9ed;
40
+      border-radius: 5px;
41
+      overflow: hidden;
42
+      margin-top: 12px;
43
+
44
+      div {
45
+        text-align: center;
46
+        margin: 0;
47
+
48
+        &.icon {
49
+          margin-top: 17px;
50
+
51
+          i {
52
+            color: #34b349;
53
+            font-size: 30px !important;
54
+
55
+            &.transport-wenhao {
56
+              color: #f5a523;
57
+            }
58
+
59
+            &.transport-shibai {
60
+              color: #ff3a52;
61
+            }
62
+          }
63
+        }
64
+
65
+        &.defeat {
66
+          color: #333;
67
+          font-size: 18px;
68
+        }
69
+
70
+        &:nth-child(3) {
71
+          font-size: 14px;
72
+          color: #666;
73
+        }
74
+      }
75
+    }
76
+
77
+    button {
78
+      margin-top: 10px;
79
+
80
+      &.btn {
81
+        margin-left: 8px;
82
+      }
83
+    }
84
+  }
85
+
86
+  // 新增
87
+  &.add {
88
+    .modalBody {
89
+      width: 480px;
90
+      height: auto;
91
+
92
+      .content {
93
+        width: 100%;
94
+        height: auto;
95
+        padding: 19px 14px 0 14px;
96
+        max-height: 500px;
97
+        overflow-y: auto;
98
+
99
+        .addForm {
100
+          .ant-form-item {
101
+            margin-bottom: 8px;
102
+						.ant-input-number{
103
+							width: 100% !important;
104
+						}
105
+            .ant-form-item-label {
106
+              line-height: 14px;
107
+              text-align: left;
108
+            }
109
+          }
110
+        }
111
+
112
+        .editForm {
113
+          .ant-form-item {
114
+            margin-bottom: 14px;
115
+						.ant-input-number{
116
+							width: 100% !important;
117
+						}
118
+            .ant-form-item-label {
119
+              line-height: 0;
120
+            }
121
+          }
122
+        }
123
+      }
124
+
125
+      button:nth-child(1) {
126
+        margin-right: 20px;
127
+      }
128
+    }
129
+  }
130
+}

+ 267 - 0
src/app/views/drug-info/drug-info.component.ts

@@ -0,0 +1,267 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7
+import { ToolService } from "../../services/tool.service";
8
+import { forkJoin, Subject } from "rxjs";
9
+import { debounceTime } from "rxjs/operators";
10
+import { NzMessageService } from "ng-zorro-antd";
11
+
12
+@Component({
13
+  selector: "app-drug-info",
14
+  templateUrl: "./drug-info.component.html",
15
+  styleUrls: ["./drug-info.component.less"],
16
+})
17
+export class DrugInfoComponent implements OnInit {
18
+  @ViewChild("osComponentRef1", {
19
+    read: OverlayScrollbarsComponent,
20
+    static: false,
21
+  })
22
+  osComponentRef1: OverlayScrollbarsComponent;
23
+  constructor(
24
+    private message: NzMessageService,
25
+    private fb: FormBuilder,
26
+    private route: ActivatedRoute,
27
+    private router: Router,
28
+    private mainService: MainService,
29
+    private tool: ToolService
30
+  ) {}
31
+
32
+  listOfData: any[] = []; //表格数据
33
+
34
+  modal: boolean = false; //新增/编辑模态框
35
+  add: boolean; //true:新增;false:编辑
36
+  validateForm: FormGroup; //新增/编辑表单
37
+  coopId: number; //表格中执行操作的id
38
+  department: any; //所属科室
39
+  drugCode; //编号
40
+  name; //名称
41
+  userType: any; //用户类型
42
+  hosId: any; //院区(搜索)
43
+  userGroup; //所属组
44
+  userGroup1; //所属组(搜索)
45
+  userTypes: Array<any>; //所有用户类型
46
+  alldepart: any = []; //所有所属科室
47
+  alldepart1: any = []; //所有所属科室(搜索)
48
+  hospitals1: any = []; //院区列表(搜索)
49
+	drugTypeData: any = []; //药品类型
50
+  allUserGroup: Array<any>; //所有用户组
51
+  allUserGroup1: Array<any>; //用户组(搜索)
52
+  allUserRole: Array<any>; //所有角色
53
+  pageIndex: number = 1; //页码
54
+  listLength: number = 10; //总条数
55
+  pageSize: number = 10; //每页条数
56
+
57
+  promptContent: string; //操作提示框提示信息
58
+  ifSuccess: boolean; //操作成功/失败
59
+  promptInfo: string; //操作结果提示信息
60
+  promptModalShow: boolean; //操作提示框是否展示
61
+
62
+  btnLoading: boolean = false; //提交按钮loading状态
63
+  wxRequired = false; //新增或编辑用户的时候,微信号是否必填
64
+  changeInpSubject = new Subject(); //防抖
65
+  changeInpHospitalSubject = new Subject(); //防抖
66
+	
67
+  ngOnInit() {
68
+    this.coopBtns = this.tool.initCoopBtns(this.route);
69
+		this.hosId = this.tool.getCurrentHospital().id;
70
+    this.initForm();
71
+		this.getDrugType()
72
+  }
73
+
74
+  // 初始化增删改按钮
75
+  coopBtns: any = {};
76
+  // 搜索
77
+  search() {
78
+    this.pageIndex = 1;
79
+    this.getList();
80
+  }
81
+  // 重置
82
+  reset() {
83
+    this.pageIndex = 1;
84
+    this.name = "";
85
+    this.drugCode = "";
86
+    this.getList();
87
+  }
88
+  // 表格数据
89
+  loading1 = false;
90
+  getList() {
91
+    let data = {
92
+      idx: this.pageIndex - 1,
93
+      sum: this.pageSize,
94
+      drugsInfo: {
95
+        drugName: this.name || "",
96
+        drugCode: this.drugCode || "",
97
+        hosId: this.hosId || "" ,
98
+				drugType:{
99
+					id:this.drugTypeData.id
100
+				}
101
+      },
102
+    };
103
+    this.loading1 = true;
104
+    this.mainService
105
+      .getFetchDataList("data", "drugsInfo", data)
106
+      .subscribe((data) => {
107
+        this.loading1 = false;
108
+        this.listOfData = data.list;
109
+        this.listLength = data.totalNum;
110
+      });
111
+  }
112
+	
113
+	// 获取药品类型
114
+	getDrugType(){
115
+		this.mainService.getDictionary("list", "drug_type").subscribe((data) => {
116
+			this.drugTypeData = data.find(i=>i.value=='infusion_solutions')
117
+			this.getList();
118
+		});
119
+	}
120
+	// 监听标识输入
121
+	handleInput(event: KeyboardEvent){
122
+		const input = event.target as HTMLInputElement;
123
+		// 如果输入的不是中文,则允许输入
124
+		if (!input.validity.patternMismatch) {
125
+			this.validateForm.value.drugCode = input.value;
126
+		} else {
127
+			// 重置输入值,不允许输入中文
128
+			input.value = this.validateForm.value.drugCode;
129
+		}
130
+	}
131
+	
132
+  // 新增弹框
133
+  showModal() {
134
+    this.add = true;
135
+		this.modal = true
136
+    this.initForm();
137
+  }
138
+  hideModal() {
139
+    this.modal = false;
140
+    this.initForm();
141
+  }
142
+	
143
+  // 初始化新增form表单
144
+  initForm() {
145
+    this.validateForm = this.fb.group({
146
+      drugName: [null, [Validators.required]],
147
+      drugCode: [null, [Validators.required]],
148
+      specs: [null, [Validators.required]],
149
+      unit: [null, [Validators.required]],
150
+			unitPrice:[null, [Validators.required]],
151
+			packingSpecs:[null, [Validators.required]],
152
+			lowerRound:[null, [Validators.required]],
153
+			upperRound:[null, [Validators.required]],
154
+    });
155
+  }
156
+  // 表单提交
157
+  submitForm(): void {
158
+    var that = this;
159
+		for (const i in that.validateForm.controls) {
160
+		  that.validateForm.controls[i].markAsDirty();
161
+		  that.validateForm.controls[i].updateValueAndValidity();
162
+		}
163
+		if (that.validateForm.invalid) return;
164
+		let form = this.validateForm.value
165
+		if(form.lowerRound >= form.upperRound){
166
+			this.message.error('低舍不能大于或者等于高入')
167
+			return 
168
+		}
169
+		if(form.upperRound >= form.packingSpecs){
170
+			this.message.error('高入不能大于或者等于包装规格')
171
+			return
172
+		}
173
+    let data = {
174
+			...this.validateForm.value,
175
+			id:0,
176
+			drugType:{
177
+				id:this.drugTypeData.id
178
+			},
179
+			hosId:that.hosId
180
+    };
181
+    if (!that.add) {
182
+      data.id = that.coopId;
183
+    }else{
184
+			delete data.id
185
+		}
186
+    that.mainService
187
+      .simplePost("addData", "drugsInfo", data)
188
+      .subscribe((data) => {
189
+        that.btnLoading = false;
190
+        that.hideModal();
191
+        that.initForm();
192
+        if (data.status == 200) {
193
+          that.showPromptModal(that.add ? "新增" : "编辑", true, "");
194
+        } else {
195
+          that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
196
+        }
197
+      });
198
+  }
199
+
200
+  // 编辑
201
+  edit(data) {
202
+		this.add = false
203
+		this.coopId = data.id;
204
+    this.validateForm.controls.drugName.setValue(data.drugName);
205
+    this.validateForm.controls.drugCode.setValue(data.drugCode);
206
+    this.validateForm.controls.specs.setValue(data.specs);
207
+    this.validateForm.controls.unit.setValue(data.unit);
208
+    this.validateForm.controls.unitPrice.setValue(data.unitPrice);
209
+    this.validateForm.controls.packingSpecs.setValue(data.packingSpecs);
210
+    this.validateForm.controls.lowerRound.setValue(data.lowerRound);
211
+		this.validateForm.controls.upperRound.setValue(data.upperRound);
212
+		this.modal = true
213
+  }
214
+
215
+  // 删除
216
+  delModal: boolean = false; //删除模态框
217
+  del(data) {
218
+    let that = this;
219
+    that.coopId = data.id;
220
+    that.delModal = true;
221
+  }
222
+	
223
+	// 取消删除弹框
224
+	cancelDel(){
225
+		this.hideDelModal();
226
+	}
227
+	
228
+  // 确认删除
229
+  confirmDel() {
230
+    let that = this;
231
+    that.btnLoading = true;
232
+    that.mainService
233
+      .coopTypeConfig('rmvData', 'drugsInfo', [this.coopId])
234
+      .subscribe((data) => {
235
+        that.btnLoading = false;
236
+        that.hideDelModal();
237
+        if (data["status"] == 200) {
238
+          that.showPromptModal("删除", true, "");
239
+        } else {
240
+          that.showPromptModal("删除", false, data["msg"]);
241
+        }
242
+      });
243
+  }
244
+	
245
+	// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
246
+	showPromptModal(con, success, promptInfo?) {
247
+	  this.promptModalShow = false;
248
+	  this.promptContent = con;
249
+	  this.ifSuccess = success;
250
+	  this.promptInfo = promptInfo;
251
+	  setTimeout(() => {
252
+	    this.promptModalShow = true;
253
+	  }, 100);
254
+	  this.getList();
255
+	}
256
+	
257
+  // 关闭删除模态框
258
+  hideDelModal() {
259
+    this.delModal = false;
260
+  }
261
+
262
+  // 查看
263
+  detail(id) {
264
+    this.router.navigateByUrl("/main/clinicalUsersManagement/userDetail/" + id);
265
+  }
266
+}
267
+

+ 19 - 0
src/app/views/drug-info/drug-info.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { DrugInfoRoutingModule } from './drug-info-routing.module';
5
+import { DrugInfoComponent } from './drug-info.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    DrugInfoComponent
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    DrugInfoRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class DrugInfoModule { }

+ 25 - 0
src/app/views/main/main-routing.module.ts

@@ -508,6 +508,31 @@ const routes: Routes = [
508 508
         path: "medicalWasteTrendAnalysis",
509 509
         loadChildren: () => import("../medical-waste-trend-analysis/medical-waste-trend-analysis.module").then((m) => m.MedicalWasteTrendAnalysisModule),
510 510
       },
511
+			// 大输液配置
512
+			{
513
+			  path: "bigTransfusionSet",
514
+			  loadChildren: () => import("../big-transfusion-set/big-transfusion-set.module").then((m) => m.BigTransfusionSetModule),
515
+			},
516
+			// 药品信息
517
+			{
518
+			  path: "drugInfo",
519
+			  loadChildren: () => import("../drug-info/drug-info.module").then((m) => m.DrugInfoModule),
520
+			},
521
+			// 科室发药单
522
+			{
523
+			  path: "adminOfficePrescription",
524
+			  loadChildren: () => import("../admin-office-prescription/admin-office-prescription.module").then((m) => m.AdminOfficePrescriptionModule),
525
+			},
526
+			// 药品云库存
527
+			{
528
+			  path: "drugCloud",
529
+			  loadChildren: () => import("../drug-cloud/drug-cloud.module").then((m) => m.DrugCloudModule),
530
+			},
531
+			// 发药批次
532
+			{
533
+			  path: "dispensingBatch",
534
+			  loadChildren: () => import("../dispensing-batch/dispensing-batch.module").then((m) => m.DispensingBatchModule),
535
+			}
511 536
     ],
512 537
   },
513 538
 ];

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 0
src/app/views/main/main.component.html


+ 2 - 2
src/app/views/office-detail/office-detail.component.html

@@ -1,7 +1,7 @@
1 1
 <div class="detail" *ngIf="!maskFlag">
2 2
   <div class="modalBody">
3 3
     <div class="title">查看科室信息<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
-    <div class="content">
4
+		<div class="content">
5 5
       <div class="top display_flex justify-content_space-between align-items_center">
6 6
         <span>{{officeInfo['dept']?officeInfo['dept']:'无'}}<em style="font-style: normal;"
7 7
             *ngIf="officeInfo['deptalias']">(别名:{{officeInfo['deptalias']}})</em></span>
@@ -39,7 +39,7 @@
39 39
       </div>
40 40
     </div>
41 41
     <div class="display_flex justify-content_flex-center">
42
-      <button class="btn know" nz-button nzType="primary" nzGhost (click)="hideModal()">知道了</button>
42
+      <button class="btn know" nz-button nzType="primary" nzGhost (click)="hideModal()">取消</button>
43 43
     </div>
44 44
   </div>
45 45
 </div>

+ 1 - 1
src/app/views/office-detail/office-detail.component.ts

@@ -24,7 +24,7 @@ export class OfficeDetailComponent implements OnInit {
24 24
     this.getDetail();
25 25
   }
26 26
   hideModal() {
27
-    this.router.navigateByUrl("/main/officeManagement");
27
+    this.router.navigateByUrl("/main/dispensingBatch");
28 28
   }
29 29
 
30 30
   // 获取详情