Browse Source

Merge branch 'develop' of http://git.dashitech.com/seimin/zy-pc

maotao 8 months ago
parent
commit
2a19e2f073

+ 0 - 6
package-lock.json

@@ -10164,7 +10164,6 @@
10164
     },
10164
     },
10165
     "node_modules/npm/node_modules/lodash._baseindexof": {
10165
     "node_modules/npm/node_modules/lodash._baseindexof": {
10166
       "version": "3.1.0",
10166
       "version": "3.1.0",
10167
-      "extraneous": true,
10168
       "inBundle": true,
10167
       "inBundle": true,
10169
       "license": "MIT"
10168
       "license": "MIT"
10170
     },
10169
     },
@@ -10179,19 +10178,16 @@
10179
     },
10178
     },
10180
     "node_modules/npm/node_modules/lodash._bindcallback": {
10179
     "node_modules/npm/node_modules/lodash._bindcallback": {
10181
       "version": "3.0.1",
10180
       "version": "3.0.1",
10182
-      "extraneous": true,
10183
       "inBundle": true,
10181
       "inBundle": true,
10184
       "license": "MIT"
10182
       "license": "MIT"
10185
     },
10183
     },
10186
     "node_modules/npm/node_modules/lodash._cacheindexof": {
10184
     "node_modules/npm/node_modules/lodash._cacheindexof": {
10187
       "version": "3.0.2",
10185
       "version": "3.0.2",
10188
-      "extraneous": true,
10189
       "inBundle": true,
10186
       "inBundle": true,
10190
       "license": "MIT"
10187
       "license": "MIT"
10191
     },
10188
     },
10192
     "node_modules/npm/node_modules/lodash._createcache": {
10189
     "node_modules/npm/node_modules/lodash._createcache": {
10193
       "version": "3.1.2",
10190
       "version": "3.1.2",
10194
-      "extraneous": true,
10195
       "inBundle": true,
10191
       "inBundle": true,
10196
       "license": "MIT",
10192
       "license": "MIT",
10197
       "dependencies": {
10193
       "dependencies": {
@@ -10205,7 +10201,6 @@
10205
     },
10201
     },
10206
     "node_modules/npm/node_modules/lodash._getnative": {
10202
     "node_modules/npm/node_modules/lodash._getnative": {
10207
       "version": "3.9.1",
10203
       "version": "3.9.1",
10208
-      "extraneous": true,
10209
       "inBundle": true,
10204
       "inBundle": true,
10210
       "license": "MIT"
10205
       "license": "MIT"
10211
     },
10206
     },
@@ -10221,7 +10216,6 @@
10221
     },
10216
     },
10222
     "node_modules/npm/node_modules/lodash.restparam": {
10217
     "node_modules/npm/node_modules/lodash.restparam": {
10223
       "version": "3.6.1",
10218
       "version": "3.6.1",
10224
-      "extraneous": true,
10225
       "inBundle": true,
10219
       "inBundle": true,
10226
       "license": "MIT"
10220
       "license": "MIT"
10227
     },
10221
     },

+ 1 - 0
src/app/components/configurationCenter/configuration-hospital/configuration-hospital.component.less

@@ -100,6 +100,7 @@
100
       }
100
       }
101
       .contentBody2{
101
       .contentBody2{
102
         flex: 1;
102
         flex: 1;
103
+        margin-bottom: 16px;
103
       }
104
       }
104
       .address{
105
       .address{
105
         flex: 1;
106
         flex: 1;

+ 1 - 7
src/app/components/configurationCenter/configuration-hospital/configuration-hospital.component.ts

@@ -29,14 +29,8 @@ export class ConfigurationHospitalComponent implements OnInit {
29
   btnLoading: boolean = false; //提交按钮loading状态
29
   btnLoading: boolean = false; //提交按钮loading状态
30
   submitMessageForm(): void {
30
   submitMessageForm(): void {
31
     this.btnLoading = true;
31
     this.btnLoading = true;
32
-    let postData:any = {
33
-      hosId: this.currentHospital.id,
34
-      // workdayClassId: this.dataInfo.workdayClassId,
35
-      // holidayClassId: this.dataInfo.holidayClassId,
36
-    };
37
-    // postData = { ...this.dataInfo, ...postData };
38
     this.mainService
32
     this.mainService
39
-      .simplePost("addData", "hospitalConfig", postData)
33
+      .simplePost("addListData", "hospitalConfig", this.hospitalList)
40
       .subscribe((result) => {
34
       .subscribe((result) => {
41
         this.btnLoading = false;
35
         this.btnLoading = false;
42
         let msg = "保存";
36
         let msg = "保存";

+ 3 - 9
src/app/components/select-menu/select-menu.component.html

@@ -3,17 +3,11 @@
3
     <div class="title">配置中心<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
3
     <div class="title">配置中心<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
4
     </div>
4
     </div>
5
     <div class="content">
5
     <div class="content">
6
-      <div class="content_item" (click)="toIncidentConfig()">
6
+      <div class="content_item" (click)="clickHandle(item)" *ngFor="let item of configurationCenterMenus">
7
         <div class="name">
7
         <div class="name">
8
-          <i class="icon_transport transport-shijianpeizhi5"></i>事件配置
8
+          <i class="icon_transport" [ngClass]="item.icon"></i>{{item.title}}
9
         </div>
9
         </div>
10
-        <div class="tips">故障现象、优先级、数据字典、系统配置、消息通知、科室绑定人员...</div>
11
-      </div>
12
-      <div class="content_item" (click)="toOtherConfig()">
13
-        <div class="name">
14
-          <i class="icon_transport transport-disanfang"></i>第三方配置
15
-        </div>
16
-        <div class="tips">微信配置、呼叫中心...</div>
10
+        <div class="tips ellipsis-multiline">{{item.remark}}</div>
17
       </div>
11
       </div>
18
     </div>
12
     </div>
19
     <div class="display_flex justify-content_flex-center">
13
     <div class="display_flex justify-content_flex-center">

+ 2 - 1
src/app/components/select-menu/select-menu.component.less

@@ -34,12 +34,13 @@
34
 
34
 
35
     .content {
35
     .content {
36
       width: 100%;
36
       width: 100%;
37
+      min-height: 97px;
37
       margin-top: 12px;
38
       margin-top: 12px;
38
       display: flex;
39
       display: flex;
39
       flex-wrap: wrap;
40
       flex-wrap: wrap;
40
       gap: 16px;
41
       gap: 16px;
41
       .content_item{
42
       .content_item{
42
-        flex: 1;
43
+        width: 205px;
43
         height: 97px;
44
         height: 97px;
44
         background-color: #F9FAFB;
45
         background-color: #F9FAFB;
45
         border: 1px solid #EEEEEE;
46
         border: 1px solid #EEEEEE;

+ 7 - 6
src/app/components/select-menu/select-menu.component.ts

@@ -1,7 +1,6 @@
1
 import { Component, OnInit, Output, Input } from '@angular/core';
1
 import { Component, OnInit, Output, Input } from '@angular/core';
2
 import { EventEmitter } from '@angular/core';
2
 import { EventEmitter } from '@angular/core';
3
 import { Router } from "@angular/router";
3
 import { Router } from "@angular/router";
4
-import { ToolService } from '../../services/tool.service';
5
 
4
 
6
 @Component({
5
 @Component({
7
   selector: 'app-select-menu',
6
   selector: 'app-select-menu',
@@ -13,16 +12,18 @@ export class SelectMenuComponent implements OnInit {
13
   @Input() iShowMenuModal: boolean = false;//模态框
12
   @Input() iShowMenuModal: boolean = false;//模态框
14
   allHospital: any;//所有院区
13
   allHospital: any;//所有院区
15
   hosLoading: boolean = false;//确定按钮的loading
14
   hosLoading: boolean = false;//确定按钮的loading
15
+  configurationCenterMenus: any[] = [];//配置中心菜单
16
   constructor(
16
   constructor(
17
     private router: Router,
17
     private router: Router,
18
   ) { }
18
   ) { }
19
 
19
 
20
-  ngOnInit() {}
21
-  toIncidentConfig(){
22
-    this.router.navigateByUrl("configurationCenter/incidentConfig");
20
+  ngOnInit() {
21
+    let menus = JSON.parse(localStorage.getItem("menu"));
22
+    let configurationCenter = menus.find(item => item.link == 'configurationCenter');
23
+    this.configurationCenterMenus = configurationCenter ? (configurationCenter.childrens || []) : [];
23
   }
24
   }
24
-  toOtherConfig(){
25
-    this.router.navigateByUrl("configurationCenter/otherConfig");
25
+  clickHandle(item){
26
+    this.router.navigateByUrl("configurationCenter/" + item.link);
26
   }
27
   }
27
   // 隐藏模态框
28
   // 隐藏模态框
28
   hideModal() {
29
   hideModal() {

+ 14 - 0
src/app/views/assets-consumable/assets-consumable-routing.module.ts

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

+ 144 - 0
src/app/views/assets-consumable/assets-consumable.component.html

@@ -0,0 +1,144 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='16' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">耗材名称</span>:
7
+          <input nz-input class="formItem" placeholder="请输入耗材名称" [(ngModel)]="searchDto.name" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">关联产品</span>:
11
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
12
+            (nzOnSearch)="changeInp('search', 'assetProduct', $event)" nzAllowClear nzPlaceHolder="请选择关联产品" [(ngModel)]="searchDto.productId">
13
+            <ng-container *ngFor="let option of assetProductsearchList">
14
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name + '(' + option.brand + ')' + '(' + option.model + ')'" [nzValue]="option.id"></nz-option>
15
+            </ng-container>
16
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
17
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
18
+            </nz-option>
19
+          </nz-select>
20
+        </div>
21
+      </div>
22
+      <div nz-col nzLg="8" class="list-template__btns">
23
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
24
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
25
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
26
+      </div>
27
+    </div>
28
+    <div class="list-template__bottom">
29
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
30
+        [nzLoading]="loading1">
31
+        <thead>
32
+          <tr class="thead">
33
+            <th nzWidth="14%">耗材名称</th>
34
+            <th nzWidth="14%">型号</th>
35
+            <th nzWidth="14%">库存</th>
36
+            <th nzWidth="14%">单位</th>
37
+            <th nzWidth="14%">供应商</th>
38
+            <th nzWidth="14%">单价(元)</th>
39
+            <th nzWidth="16%">操作</th>
40
+          </tr>
41
+        </thead>
42
+        <tbody>
43
+          <tr *ngFor="let data of listOfData;let i = index">
44
+            <td>{{data.name}}</td>
45
+            <td>{{data.model}}</td>
46
+            <td>{{data.stock}}</td>
47
+            <td>{{data.unit}}</td>
48
+            <td>{{data.supplierDTO?.name}}</td>
49
+            <td>{{data.price}}</td>
50
+            <td>
51
+              <div class="coop">
52
+                <span *ngIf="coopBtns.edit" (click)="edit($event, data)">编辑</span>
53
+                <span *ngIf="coopBtns.del" (click)="showDelModal($event, data,'您确认要删除吗?','删除','del')">删除</span>
54
+              </div>
55
+            </td>
56
+          </tr>
57
+        </tbody>
58
+      </nz-table>
59
+      <div class="list-template__pagination">
60
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
61
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
62
+        </nz-pagination>
63
+      </div>
64
+    </div>
65
+  </div>
66
+
67
+  <!-- 新增/编辑模态框 -->
68
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
69
+    <div class="modalBody">
70
+      <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
71
+      <div class="content">
72
+        <form nz-form [formGroup]="validateForm" class="addForm">
73
+          <nz-form-item>
74
+            <nz-form-label [nzSpan]="5" nzRequired>耗材名称</nz-form-label>
75
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入耗材名称!">
76
+              {{productDto.name}}
77
+            </nz-form-control>
78
+          </nz-form-item>
79
+          <nz-form-item>
80
+            <nz-form-label [nzSpan]="5" nzRequired>型&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</nz-form-label>
81
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入型号!">
82
+              {{productDto.model}}
83
+            </nz-form-control>
84
+          </nz-form-item>
85
+          <nz-form-item>
86
+            <nz-form-label [nzSpan]="5" nzRequired>单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位</nz-form-label>
87
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入耗材单位!">
88
+              {{productDto.unit}}
89
+            </nz-form-control>
90
+          </nz-form-item>
91
+          <nz-form-item>
92
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="productId">产&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;品</nz-form-label>
93
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择产品!">
94
+              <nz-select (nzOnSearch)="changeInp('add', 'assetProduct', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch formControlName="productId" nzPlaceHolder="请选择产品" (ngModelChange)="changeAssetProduct($event)">
95
+                <ng-container *ngFor="let option of assetProductaddList">
96
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name + '(' + option.brand + ')' + '(' + option.model + ')'" [nzValue]="option.id"></nz-option>
97
+                </ng-container>
98
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
99
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
100
+                </nz-option>
101
+              </nz-select>
102
+            </nz-form-control>
103
+          </nz-form-item>
104
+          <nz-form-item>
105
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="supplierId">供&nbsp;应&nbsp;商</nz-form-label>
106
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择供应商!">
107
+              <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear formControlName="supplierId" nzPlaceHolder="请选择供应商">
108
+                <ng-container *ngFor="let option of companyList">
109
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
110
+                </ng-container>
111
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
112
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
113
+                </nz-option>
114
+              </nz-select>
115
+            </nz-form-control>
116
+          </nz-form-item>
117
+          <nz-form-item>
118
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="stock">库存</nz-form-label>
119
+            <nz-form-control [nzSpan]="19" nzErrorTip="请填写库存!">
120
+              <nz-input-number class="w100" nz-input formControlName="stock" nzPlaceHolder="请填写库存" [nzMin]="0" [nzStep]="0.01" [nzPrecision]="2"></nz-input-number>
121
+            </nz-form-control>
122
+          </nz-form-item>
123
+          <nz-form-item>
124
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="price">单价</nz-form-label>
125
+            <nz-form-control [nzSpan]="19" nzErrorTip="请填写单价!">
126
+              <nz-input-number class="w100" nz-input formControlName="price" nzPlaceHolder="请填写单价" [nzMin]="0" [nzStep]="0.01" [nzPrecision]="2"></nz-input-number>
127
+            </nz-form-control>
128
+          </nz-form-item>
129
+        </form>
130
+      </div>
131
+      <div class="display_flex justify-content_flex-center">
132
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
133
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
134
+      </div>
135
+    </div>
136
+  </div>
137
+  <!-- 模态框 -->
138
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
139
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
140
+</div>
141
+<!-- 操作成功/失败提示框 -->
142
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
143
+  [info]="promptInfo">
144
+</app-prompt-modal>

+ 176 - 0
src/app/views/assets-consumable/assets-consumable.component.less

@@ -0,0 +1,176 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  ::ng-deep .ant-calendar-picker {
5
+    width: 100% !important;
6
+  }
7
+  .list-template__top{
8
+    overflow: visible!important;
9
+  }
10
+}
11
+.save {
12
+  position: fixed;
13
+  left: 0;
14
+  top: 0;
15
+  width: 100%;
16
+  height: 100%;
17
+  background: rgba(0, 0, 0, 0.4);
18
+  z-index: 99;
19
+
20
+  .modalBody {
21
+    width: 350px;
22
+    background: #fff;
23
+    border-radius: 5px;
24
+    padding: 10px 20px;
25
+    color: #333;
26
+
27
+    .title {
28
+      width: 100%;
29
+      text-align: center;
30
+      font-size: 18px;
31
+      position: relative;
32
+
33
+      i {
34
+        position: absolute;
35
+        right: 0;
36
+        top: 0;
37
+        font-size: 20px;
38
+        color: #666;
39
+        cursor: pointer;
40
+        padding: 0 5px;
41
+      }
42
+    }
43
+
44
+    .content {
45
+      width: 310px;
46
+      background: #f9fafb;
47
+      border: 1px solid #e5e9ed;
48
+      border-radius: 5px;
49
+      overflow: hidden;
50
+      margin-top: 12px;
51
+      padding: 16px 0;
52
+
53
+      .busyList{
54
+        display: flex;
55
+        margin-bottom: 8px;
56
+        .busyContent{
57
+          margin-right: 8px;
58
+          flex: 1;
59
+        }
60
+      }
61
+
62
+      & > div {
63
+        text-align: center;
64
+        margin: 0;
65
+
66
+        &.icon {
67
+          // margin-top: 17px;
68
+
69
+          i {
70
+            color: #34b349;
71
+            font-size: 30px !important;
72
+
73
+            &.transport-wenhao {
74
+              color: #f5a523;
75
+            }
76
+
77
+            &.transport-shibai {
78
+              color: #ff3a52;
79
+            }
80
+          }
81
+        }
82
+
83
+        &.defeat {
84
+          color: #333;
85
+          font-size: 14px;
86
+        }
87
+
88
+        &:nth-child(3) {
89
+          font-size: 14px;
90
+          color: #666;
91
+        }
92
+      }
93
+      .workAssignmentTips {
94
+        font-size: 12px;
95
+      }
96
+    }
97
+
98
+    button {
99
+      margin-top: 10px;
100
+
101
+      &.btn {
102
+        margin-left: 8px;
103
+      }
104
+    }
105
+  }
106
+
107
+  // 新增
108
+  &.add {
109
+    .modalBody {
110
+      width: 480px;
111
+      height: auto;
112
+
113
+      .content {
114
+        width: 100%;
115
+        height: auto;
116
+        padding: 16px;
117
+        max-height: 497px;
118
+        overflow-y: auto;
119
+
120
+        .addForm {
121
+          .ant-form-item {
122
+            margin-bottom: 0;
123
+
124
+            .ant-form-item-label {
125
+              text-align: left;
126
+            }
127
+
128
+            .desc {
129
+              margin-top: 5px;
130
+            }
131
+          }
132
+
133
+          .datesControl {
134
+            margin-top: -16px;
135
+
136
+            .ant-form-item-label {
137
+              line-height: 40px;
138
+            }
139
+          }
140
+
141
+          .timer {
142
+            .ant-form-item-label {
143
+              width: 100%;
144
+              text-align: left;
145
+            }
146
+
147
+            .numInp {
148
+              margin-right: 5px;
149
+            }
150
+
151
+            .line {
152
+              margin-right: 5px;
153
+            }
154
+          }
155
+
156
+          .timer2 {
157
+            .ant-form-item-label {
158
+              line-height: 20px;
159
+            }
160
+          }
161
+        }
162
+
163
+        .editForm {
164
+          .ant-form-item {
165
+            margin-bottom: 15px;
166
+
167
+            .ant-form-item-label {
168
+              line-height: 14px;
169
+              text-align: left;
170
+            }
171
+          }
172
+        }
173
+      }
174
+    }
175
+  }
176
+}

+ 358 - 0
src/app/views/assets-consumable/assets-consumable.component.ts

@@ -0,0 +1,358 @@
1
+import { Component, OnInit } 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 { ToolService } from "../../services/tool.service";
7
+import { NzMessageService } from 'ng-zorro-antd';
8
+import { Subject } from 'rxjs';
9
+import { debounceTime } from 'rxjs/operators';
10
+@Component({
11
+  selector: "app-assets-consumable",
12
+  templateUrl: "./assets-consumable.component.html",
13
+  styleUrls: ["./assets-consumable.component.less"],
14
+})
15
+export class AssetsConsumableComponent implements OnInit {
16
+  constructor(
17
+    private fb: FormBuilder,
18
+    private mainService: MainService,
19
+    private route: ActivatedRoute,
20
+    private router: Router,
21
+    private tool: ToolService,
22
+    private message: NzMessageService,
23
+  ) {}
24
+
25
+  listOfData: any[] = []; //表格数据
26
+  pageIndex: number = 1; //表格当前页码
27
+  pageSize: number = 10; //表格每页展示条数
28
+  listLength: number = 10; //表格总数据量
29
+  modal: boolean = false; //新增/编辑模态框
30
+  add: boolean; //true:新增;false:编辑
31
+  validateForm: FormGroup; //新增/编辑表单
32
+  coopData: any; //当前操作列
33
+  currentHospital; //当前院区
34
+
35
+  btnLoading: boolean = false; //提交按钮loading状态
36
+
37
+  promptContent: string; //操作提示框提示信息
38
+  ifSuccess: boolean; //操作成功/失败
39
+  promptInfo: string; //操作结果提示信息
40
+  promptModalShow: boolean; //操作提示框是否展示
41
+  nextSchemeName = ""; //下一个开启的方案名称
42
+  modelName = ""; //模态框名称
43
+
44
+  changeInpSubject = new Subject(); //防抖
45
+  showDropdown:boolean = false;
46
+
47
+  ngOnInit() {
48
+    //防抖
49
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
50
+      if(v[1] === 'assetProduct'){
51
+        this.getAssetProductList(v[0], v[2]);
52
+      }
53
+    });
54
+    this.currentHospital = this.tool.getCurrentHospital();
55
+    this.coopBtns = this.tool.initCoopBtns(this.route);
56
+    this.getList(1);
57
+    this.getAssetProductList('search', '');
58
+    this.getAssetProductList('add', '');
59
+  }
60
+
61
+  // 初始化增删改按钮
62
+  coopBtns: any = {};
63
+
64
+  // 搜索
65
+  search() {
66
+    this.getList(1);
67
+  }
68
+  // 重置
69
+  reset() {
70
+    this.searchDto = {};
71
+    this.getList(1);
72
+  }
73
+
74
+  // 表格数据
75
+  searchDto: any = {};
76
+  productDto:any = {};
77
+  loading1 = false;
78
+  getList(type) {
79
+    if (type == 1) {
80
+      this.pageIndex = 1;
81
+    }
82
+    let data = {
83
+      idx: this.pageIndex - 1,
84
+      sum: this.pageSize,
85
+      consumable: {
86
+        hosId: this.currentHospital.id,
87
+        ...this.searchDto,
88
+      },
89
+    };
90
+    data.consumable.status = data.consumable.status ? { id: data.consumable.status } : undefined;
91
+    this.loading1 = true;
92
+    this.mainService
93
+      .getFetchDataList("simple/data", "consumable", data)
94
+      .subscribe((data) => {
95
+        this.loading1 = false;
96
+        if (data.status == 200) {
97
+          this.listOfData = data.list;
98
+          this.listLength = data.totalNum;
99
+        }else{
100
+          this.message.error(data.msg || "请求数据失败");
101
+        }
102
+      });
103
+  }
104
+
105
+  // 新增弹框
106
+  disableDutyId:boolean = false;
107
+  addModal() {
108
+    this.modelName = "新增";
109
+    this.add = true; //新增
110
+    this.modal = true;
111
+    this.productDto = {};
112
+    this.initForm();
113
+    if(this.currentHospital.type && this.currentHospital.type.value === '6'){
114
+      this.disableDutyId = true;
115
+      this.validateForm.controls.dutyId.setValue(this.currentHospital.id);
116
+    }else{
117
+      this.disableDutyId = false;
118
+    }
119
+  }
120
+  //关闭新增/编辑弹框
121
+  hideAddModal() {
122
+    this.modal = false;
123
+    this.initForm();
124
+  }
125
+
126
+  // 编辑
127
+  edit(e, data) {
128
+    e.stopPropagation();
129
+    console.log(data);
130
+    this.initForm();
131
+    this.modelName = "编辑";
132
+    this.add = false;
133
+    this.modal = true;
134
+    this.coopData = data;
135
+    this.productDto = {
136
+      name: data.name,
137
+      model: data.model,
138
+      unit: data.unit,
139
+    }
140
+    this.validateForm.controls.productId.setValue(data.productId);
141
+    this.validateForm.controls.supplierId.setValue(data.supplierId);
142
+    this.validateForm.controls.stock.setValue(data.stock);
143
+    this.validateForm.controls.price.setValue(data.price);
144
+
145
+    if(data.assetProductDTO){
146
+      this.companyList = data.assetProductDTO.supplierList || [];
147
+    }
148
+
149
+    this.getAssetProductList('add', '', true);
150
+  }
151
+
152
+  // 初始化新增form表单
153
+  initForm() {
154
+    this.validateForm = this.fb.group({
155
+      productId: [null, [Validators.required]],
156
+      supplierId: [null, [Validators.required]],
157
+      stock: [0, [Validators.required]],
158
+      price: [0, [Validators.required]],
159
+    });
160
+  }
161
+
162
+  // 边输边搜节流阀
163
+  isLoading = false;
164
+  changeInp(type, model, e) {
165
+    this.isLoading = true;
166
+    this.changeInpSubject.next([type, model, e]);
167
+  }
168
+
169
+  // 获取产品列表
170
+  assetProductsearchList: any = [];
171
+  assetProductaddList: any = [];
172
+  consumableId:any; // 大类为维修耗材id
173
+  async getAssetProductList(type, keyword, init = false) {
174
+    if(!this.consumableId){
175
+      let result = await this.getProductCategoryTypeList(1);
176
+      let productCategoryTypeList = result.list || []; // 获取大类
177
+      // 大类为维修耗材
178
+      let consumable = productCategoryTypeList.find(v => v.value == '维修耗材');
179
+      if(!consumable){
180
+        this['assetProduct' + type + 'List'] = [];
181
+        this.isLoading = false;
182
+        return;
183
+      }
184
+      this.consumableId = consumable.id;
185
+    }
186
+    let postData:any = {
187
+      assetProduct: {
188
+        name: keyword,
189
+        hosId: this.currentHospital.id,
190
+        mainType: this.consumableId,
191
+      },
192
+      idx: 0,
193
+      sum: 20,
194
+    };
195
+    console.log(this.coopData)
196
+    this.mainService
197
+      .getFetchDataList("simple/data", "assetProduct", postData)
198
+      .subscribe((data) => {
199
+        this.isLoading = false;
200
+        if(init){
201
+          // 回显
202
+          let assetProductList = data.list || [];
203
+          let flag = assetProductList.some(v => v.id == this.coopData.productId);
204
+          if(!flag){
205
+            assetProductList.unshift(this.coopData.assetProductDTO);
206
+            this['assetProduct' + type + 'List'] = assetProductList;
207
+          }
208
+        }else{
209
+          this['assetProduct' + type + 'List'] = data.list || [];
210
+        }
211
+      });
212
+  }
213
+
214
+  //获取大类
215
+  getProductCategoryTypeList(level:number) {
216
+    let postData = {
217
+      dictionaryTree: {
218
+        deleted: 0,
219
+        level: 1,
220
+        key: 'product_category_type',
221
+      },
222
+      idx: 0,
223
+      sum: 9999,
224
+    };
225
+    return this.mainService.getFetchDataList("simple/data", "dictionaryTree", postData).toPromise();
226
+  }
227
+
228
+  // 获取供应商
229
+  companyList: any = [];
230
+
231
+  // 修改产品
232
+  changeAssetProduct(id){
233
+    let obj = this.assetProductaddList.find(v => v.id == id);
234
+    console.log(obj);
235
+    this.productDto = obj || {};
236
+    this.companyList = obj.supplierList || [];
237
+    this.validateForm.controls.supplierId.setValue(null);
238
+  }
239
+
240
+  // 新增/编辑表单提交
241
+  submitForm(): void {
242
+    for (const i in this.validateForm.controls) {
243
+      this.validateForm.controls[i].markAsDirty();
244
+      this.validateForm.controls[i].updateValueAndValidity();
245
+    }
246
+    if (this.validateForm.invalid) {
247
+      return;
248
+    }
249
+
250
+    console.log(this.validateForm.value)
251
+
252
+    this.btnLoading = true;
253
+    let postData:any = {};
254
+
255
+    if (this.add) {
256
+      //增加
257
+      postData = {
258
+        consumable: {
259
+          hosId: this.currentHospital.id,
260
+          name: this.productDto.name,
261
+          model: this.productDto.model,
262
+          unit: this.productDto.unit,
263
+          productId: this.validateForm.value.productId,
264
+          supplierId: this.validateForm.value.supplierId,
265
+          stock: this.validateForm.value.stock,
266
+          price: this.validateForm.value.price,
267
+        }
268
+      };
269
+    } else {
270
+      //编辑
271
+      postData = {
272
+        consumable:{
273
+          ...this.coopData,
274
+          ...{
275
+            hosId: this.currentHospital.id,
276
+            name: this.productDto.name,
277
+            model: this.productDto.model,
278
+            unit: this.productDto.unit,
279
+            productId: this.validateForm.value.productId,
280
+            supplierId: this.validateForm.value.supplierId,
281
+            stock: this.validateForm.value.stock,
282
+            price: this.validateForm.value.price,
283
+          }
284
+        }
285
+      };
286
+    }
287
+    this.mainService
288
+      .coopData("addData", "consumable", postData)
289
+      .subscribe((result) => {
290
+        this.btnLoading = false;
291
+        this.hideAddModal();
292
+        let msg = "";
293
+        if (this.add) {
294
+          msg = "新增";
295
+        } else {
296
+          msg = "修改";
297
+        }
298
+        if (result.status == 200) {
299
+          this.showPromptModal(msg, true, "");
300
+        } else {
301
+          this.showPromptModal(msg, false, result.msg);
302
+        }
303
+      });
304
+  }
305
+
306
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
307
+  showPromptModal(con, success, promptInfo?) {
308
+    this.promptModalShow = false;
309
+    this.promptContent = con;
310
+    this.ifSuccess = success;
311
+    this.promptInfo = promptInfo;
312
+    setTimeout(() => {
313
+      this.promptModalShow = true;
314
+    }, 100);
315
+    this.getList(0);
316
+  }
317
+
318
+  delModal: boolean = false; //删除模态框
319
+  tipsMsg1: string; //提示框信息
320
+  tipsMsg2: string; //操作后信息
321
+  confirmDelType: string; //确认的类型(启用/停用,删除)
322
+  showDelModal(
323
+    e,
324
+    data,
325
+    tipsMsg1: string,
326
+    tipsMsg2: string,
327
+    type: string,
328
+  ) {
329
+    e.stopPropagation();
330
+    this.confirmDelType = type;
331
+    this.delModal = true;
332
+    this.coopData = data;
333
+    this.tipsMsg1 = tipsMsg1;
334
+    this.tipsMsg2 = tipsMsg2;
335
+  }
336
+  // 隐藏删除框
337
+  hideDelModal() {
338
+    this.delModal = false;
339
+  }
340
+  // 确认删除
341
+  confirmDel() {
342
+    this.btnLoading = true;
343
+    if (this.confirmDelType === "del") {
344
+      //删除
345
+      this.mainService
346
+        .simplePost("rmvData", "consumable", [this.coopData.id])
347
+        .subscribe((data) => {
348
+          this.btnLoading = false;
349
+          this.delModal = false;
350
+          if (data.status == 200) {
351
+            this.showPromptModal(this.tipsMsg2, true, "");
352
+          } else {
353
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
354
+          }
355
+        });
356
+    }
357
+  }
358
+}

+ 19 - 0
src/app/views/assets-consumable/assets-consumable.module.ts

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

+ 1 - 1
src/app/views/hospital-config/hospital-config.component.ts

@@ -351,7 +351,7 @@ export class HospitalConfigComponent implements OnInit {
351
   }
351
   }
352
   // 获取系统配置列表
352
   // 获取系统配置列表
353
   getHospitalConfigList(hosId) {
353
   getHospitalConfigList(hosId) {
354
-    let postData = { idx: 0, sum: 100, hospitalConfig: { hosId } };
354
+    let postData = { idx: 0, sum: 100, hospitalConfig: { hosId, model: 'hsms' } };
355
     return this.mainService.getFetchDataList(
355
     return this.mainService.getFetchDataList(
356
       "simple/data",
356
       "simple/data",
357
       "hospitalConfig",
357
       "hospitalConfig",

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

@@ -583,6 +583,11 @@ const routes: Routes = [
583
         path: "assetsProductManagement",
583
         path: "assetsProductManagement",
584
         loadChildren: () => import("../assets-product-management/assets-product-management.module").then((m) => m.AssetsProductManagementModule),
584
         loadChildren: () => import("../assets-product-management/assets-product-management.module").then((m) => m.AssetsProductManagementModule),
585
       },
585
       },
586
+      // 耗材库
587
+      {
588
+        path: "assetsConsumable",
589
+        loadChildren: () => import("../assets-consumable/assets-consumable.module").then((m) => m.AssetsConsumableModule),
590
+      },
586
     ],
591
     ],
587
   },
592
   },
588
 ];
593
 ];

+ 8 - 0
src/common.less

@@ -149,6 +149,14 @@
149
 .wd{
149
 .wd{
150
   word-break: break-all;
150
   word-break: break-all;
151
 }
151
 }
152
+
153
+.ellipsis-multiline {
154
+  display: -webkit-box;
155
+  -webkit-box-orient: vertical;
156
+  -webkit-line-clamp: 2; /* 定义显示的行数 */
157
+  overflow: hidden;
158
+  text-overflow: ellipsis;
159
+}
152
 // list模板样式 end
160
 // list模板样式 end
153
 
161
 
154
 // 滚动条样式
162
 // 滚动条样式