seimin 8 月之前
父节点
当前提交
d236c69ede
共有 19 个文件被更改,包括 2422 次插入15 次删除
  1. 0 1
      src/app/pipes/data-to-name.pipe.ts
  2. 44 0
      src/app/services/tool.service.ts
  3. 82 0
      src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.html
  4. 331 0
      src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.less
  5. 259 0
      src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.ts
  6. 3 0
      src/app/share/share.module.ts
  7. 14 0
      src/app/views/assets-info/assets-info-routing.module.ts
  8. 231 0
      src/app/views/assets-info/assets-info.component.html
  9. 176 0
      src/app/views/assets-info/assets-info.component.less
  10. 455 0
      src/app/views/assets-info/assets-info.component.ts
  11. 19 0
      src/app/views/assets-info/assets-info.module.ts
  12. 14 0
      src/app/views/assets-product-management/assets-product-management-routing.module.ts
  13. 192 0
      src/app/views/assets-product-management/assets-product-management.component.html
  14. 179 0
      src/app/views/assets-product-management/assets-product-management.component.less
  15. 388 0
      src/app/views/assets-product-management/assets-product-management.component.ts
  16. 19 0
      src/app/views/assets-product-management/assets-product-management.module.ts
  17. 10 0
      src/app/views/main/main-routing.module.ts
  18. 6 0
      src/app/views/tripartite-company/tripartite-company.component.html
  19. 0 14
      src/app/views/tripartite-company/tripartite-company.component.ts

+ 0 - 1
src/app/pipes/data-to-name.pipe.ts

@@ -6,7 +6,6 @@ import { Pipe, PipeTransform } from '@angular/core';
6 6
 export class DataToNamePipe implements PipeTransform {
7 7
 
8 8
   transform(value: any[], ...args: any[]): any {
9
-    console.log(args)
10 9
     if(Array.isArray(value)){
11 10
       return value.map(v => v[args[0]]).join(args[1]);
12 11
     }else{

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

@@ -176,6 +176,9 @@ export class ToolService {
176 176
         case "reset":
177 177
           coopBtns.reset = true; //重置
178 178
           break;
179
+        case "commonFault":
180
+          coopBtns.commonFault = true; //常见故障
181
+          break;
179 182
       }
180 183
     });
181 184
     console.log(coopBtns);
@@ -229,4 +232,45 @@ export class ToolService {
229 232
     }
230 233
     return res;
231 234
   }
235
+
236
+  /**
237
+   * @description: 扁平化结构转成树形结构-ng-zorro树形结构专用
238
+   * @param {*} list 扁平化的数组
239
+   * @param {*} rootValue 顶级parentKeyName的值
240
+   * @param {*} parentKeyName 父级字段名称
241
+   * @param {*} keyName 字段名称
242
+   * @return {*} 返回树形结构
243
+   * @author: seimin
244
+   */
245
+  tranListToTreeDataLeaf(list:Array<any>, rootValue:any, parentKeyName:string, keyName:string = 'id'):Array<any> {
246
+    return list.filter((t) => {
247
+      let children = this.tranListToTreeData(list, t[keyName], parentKeyName, keyName);
248
+      if(!children.length){
249
+        t.isLeaf = true;
250
+      }
251
+      return t[parentKeyName] === rootValue
252
+      ? (t.children = children)
253
+      : false
254
+    });
255
+  }
256
+
257
+  /**
258
+   * @description: 树形结构根据id回显-ng-zorro树形结构专用
259
+   * @param {*} list 扁平化的数组
260
+   * @param {*} rootValue 顶级parentKeyName的值
261
+   * @param {*} parentKeyName 父级字段名称
262
+   * @param {*} keyName 字段名称
263
+   * @return {*} 返回树形结构
264
+   * @author: seimin
265
+   */
266
+  tranListToTreeDataFindIdsLeaf(tree: Array<any>, id: number, arr = []):Array<number> {
267
+    let list = this.tranTreeToListData(tree);
268
+    console.log(list)
269
+    let obj = list.find(v => v.id === id);
270
+    arr.unshift(id);
271
+    if(obj.parentId){
272
+      this.tranListToTreeDataFindIdsLeaf(tree, obj.parentId, arr);
273
+    }
274
+    return arr;
275
+  }
232 276
 }

+ 82 - 0
src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.html

@@ -0,0 +1,82 @@
1
+<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
2
+  <div class="modalBody">
3
+    <div class="title">常见故障配置<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="list-template content">
5
+      <div class="list-template__content">
6
+        <div class="list-template__top" nz-row>
7
+          <div nz-col nzXl='19' class="list-template__searchBox">
8
+
9
+          </div>
10
+          <div nz-col nzLg="5" class="list-template__btns">
11
+            <button nz-button class="btn default mr8" (click)="addModal()">新增</button>
12
+          </div>
13
+        </div>
14
+        <div class="list-template__bottom">
15
+          <nz-table class="hospitalTable list-template__nzTable" [nzData]="historySpecimenList" nzSize="middle" [nzShowPagination]="false"
16
+            [nzLoading]="hsLoading" [nzScroll]="{ y: '506px' }">
17
+            <thead>
18
+              <tr class="thead">
19
+                <th nzWidth="25%">关联故障现象</th>
20
+                <th nzWidth="25%">别名</th>
21
+                <th nzWidth="25%">状态</th>
22
+                <th nzWidth="25%">操作</th>
23
+              </tr>
24
+            </thead>
25
+            <tbody>
26
+              <tr *ngFor="let data of historySpecimenList;let i = index;">
27
+                <td>{{ data.incidentCategoryDTO?.category }}</td>
28
+                <td>{{ data.alias }}</td>
29
+                <td>{{ data.status?.name }}</td>
30
+                <td>
31
+                  <div class="coop">
32
+                    <span (click)="showDelModal($event, data,'您确认要删除吗?','删除','del')">删除</span>
33
+                    <span (click)="showDelModal($event, data, data.status.value == 1 ? '您确认要停用吗?' : '您确认要启动吗?', data.status.value == 1 ? '停用' : '启用', 'switch', data.status.value == 1)">{{data.status.value == 1 ? '停用' : '启用'}}</span>
34
+                    <span (click)="edit($event, data)">编辑</span>
35
+                  </div>
36
+                </td>
37
+              </tr>
38
+            </tbody>
39
+          </nz-table>
40
+        </div>
41
+      </div>
42
+    </div>
43
+    <div class="display_flex justify-content_flex-center">
44
+      <button class="btn know" nz-button nzType="primary" (click)="hideModal()">
45
+        知道了
46
+      </button>
47
+    </div>
48
+  </div>
49
+</div>
50
+
51
+<!-- 新增/编辑模态框 -->
52
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
53
+  <div class="modalBody">
54
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
55
+    <div class="content">
56
+      <form nz-form [formGroup]="validateForm" class="addForm">
57
+        <nz-form-item>
58
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="incidentCategoryId">故障现象</nz-form-label>
59
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择故障现象!">
60
+            <nz-cascader [nzOptions]="incidentCategoryList" formControlName="incidentCategoryId" nzPlaceHolder="请选择故障现象"></nz-cascader>
61
+          </nz-form-control>
62
+        </nz-form-item>
63
+        <nz-form-item>
64
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="alias">别&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</nz-form-label>
65
+          <nz-form-control [nzSpan]="19" nzErrorTip="请输入别名!">
66
+            <nz-input-group>
67
+                <input formControlName="alias" nz-input placeholder="请输入别名">
68
+            </nz-input-group>
69
+          </nz-form-control>
70
+        </nz-form-item>
71
+      </form>
72
+    </div>
73
+    <div class="display_flex justify-content_flex-center">
74
+      <button nzType="primary" nz-button (click)="submitAddForm()" [nzLoading]="btnLoading">确认</button>
75
+      <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
76
+    </div>
77
+  </div>
78
+</div>
79
+
80
+<!-- 模态框 -->
81
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
82
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

+ 331 - 0
src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.less

@@ -0,0 +1,331 @@
1
+@import "../../../../src/theme.less";
2
+.list-template__top{
3
+  padding: 8px 0!important;
4
+}
5
+
6
+.modal {
7
+  position: fixed;
8
+  left: 0;
9
+  top: 0;
10
+  width: 100%;
11
+  height: 100%;
12
+  background: rgba(0, 0, 0, 0.4);
13
+  z-index: 99;
14
+  .hospitalTable {
15
+    width: 100%;
16
+    padding: 0;
17
+    td {
18
+      text-align: center !important;
19
+    }
20
+    .thead {
21
+      background-image: linear-gradient(to right, @bg-start, @bg-end);
22
+      th {
23
+        text-align: center !important;
24
+        color: #fff;
25
+        background: transparent;
26
+      }
27
+    }
28
+  }
29
+
30
+  .modalBody {
31
+    width: 950px;
32
+    min-height: 220px;
33
+    background: #fff;
34
+    border-radius: 5px;
35
+    padding: 10px 20px;
36
+    color: #333;
37
+    &.modalBody-search {
38
+      width: 480px;
39
+      min-height: 250px;
40
+    }
41
+
42
+    .title {
43
+      width: 100%;
44
+      text-align: center;
45
+      font-size: 18px;
46
+      position: relative;
47
+
48
+      i {
49
+        position: absolute;
50
+        right: 0;
51
+        top: 0;
52
+        font-size: 20px;
53
+        color: #666;
54
+        cursor: pointer;
55
+        padding: 0 5px;
56
+      }
57
+    }
58
+
59
+    .list-template{
60
+      padding: 0!important;
61
+    }
62
+
63
+    .list-template__bottom{
64
+      border: none!important;
65
+      padding: 0!important;
66
+    }
67
+
68
+    .content {
69
+      min-height: 117px;
70
+      background: #f9fafb;
71
+      border: 1px solid #e5e9ed;
72
+      border-radius: 5px;
73
+      overflow: hidden;
74
+      margin-top: 12px;
75
+      display: flex;
76
+      flex-direction: column;
77
+      justify-content: center;
78
+      // align-items: center;
79
+      &.content-search {
80
+        min-height: 147px;
81
+        justify-content: start;
82
+        .defeat-search {
83
+          width: 100%;
84
+          height: 52px;
85
+          display: flex;
86
+          justify-content: center;
87
+          align-items: center;
88
+          border-bottom: solid 1px #e5e9ed;
89
+          em {
90
+            color: #666;
91
+            font-style: normal;
92
+          }
93
+        }
94
+        .form {
95
+          width: 100%;
96
+          padding: 0 16px;
97
+          .ant-form-item-label,
98
+          .ant-form-explain {
99
+            text-align: left !important;
100
+          }
101
+        }
102
+      }
103
+
104
+      div {
105
+        margin: 0;
106
+      }
107
+      button{
108
+        margin-top: 0!important;
109
+        margin-left: 0!important;
110
+      }
111
+      .formItem{
112
+        text-align: left!important;
113
+      }
114
+    }
115
+
116
+    button {
117
+      margin-top: 10px;
118
+
119
+      &.btn {
120
+        margin-left: 8px;
121
+      }
122
+    }
123
+  }
124
+
125
+  // 新增
126
+  &.add {
127
+    .modalBody {
128
+      width: 480px;
129
+      height: auto;
130
+
131
+      .content {
132
+        width: 100%;
133
+        height: auto;
134
+        padding: 18px 14px 0 14px;
135
+
136
+        .addForm {
137
+          .ant-form-item {
138
+            margin-bottom: 15px;
139
+
140
+            .ant-form-item-label {
141
+              line-height: 0;
142
+            }
143
+          }
144
+        }
145
+
146
+        .editForm {
147
+          .ant-form-item {
148
+            margin-bottom: 15px;
149
+
150
+            .ant-form-item-label {
151
+              line-height: 0;
152
+            }
153
+          }
154
+        }
155
+      }
156
+
157
+      button {
158
+        &:nth-child(1) {
159
+          margin-right: 20px;
160
+        }
161
+      }
162
+    }
163
+  }
164
+}
165
+
166
+.save {
167
+  position: fixed;
168
+  left: 0;
169
+  top: 0;
170
+  width: 100%;
171
+  height: 100%;
172
+  background: rgba(0, 0, 0, 0.4);
173
+  z-index: 99;
174
+
175
+  .modalBody {
176
+    width: 350px;
177
+    background: #fff;
178
+    border-radius: 5px;
179
+    padding: 10px 20px;
180
+    color: #333;
181
+
182
+    .title {
183
+      width: 100%;
184
+      text-align: center;
185
+      font-size: 18px;
186
+      position: relative;
187
+
188
+      i {
189
+        position: absolute;
190
+        right: 0;
191
+        top: 0;
192
+        font-size: 20px;
193
+        color: #666;
194
+        cursor: pointer;
195
+        padding: 0 5px;
196
+      }
197
+    }
198
+
199
+    .content {
200
+      width: 310px;
201
+      background: #f9fafb;
202
+      border: 1px solid #e5e9ed;
203
+      border-radius: 5px;
204
+      overflow: hidden;
205
+      margin-top: 12px;
206
+      padding: 16px 0;
207
+
208
+      .busyList{
209
+        display: flex;
210
+        margin-bottom: 8px;
211
+        .busyContent{
212
+          margin-right: 8px;
213
+          flex: 1;
214
+        }
215
+      }
216
+
217
+      & > div {
218
+        text-align: center;
219
+        margin: 0;
220
+
221
+        &.icon {
222
+          // margin-top: 17px;
223
+
224
+          i {
225
+            color: #34b349;
226
+            font-size: 30px !important;
227
+
228
+            &.transport-wenhao {
229
+              color: #f5a523;
230
+            }
231
+
232
+            &.transport-shibai {
233
+              color: #ff3a52;
234
+            }
235
+          }
236
+        }
237
+
238
+        &.defeat {
239
+          color: #333;
240
+          font-size: 14px;
241
+        }
242
+
243
+        &:nth-child(3) {
244
+          font-size: 14px;
245
+          color: #666;
246
+        }
247
+      }
248
+      .workAssignmentTips {
249
+        font-size: 12px;
250
+      }
251
+    }
252
+
253
+    button {
254
+      margin-top: 10px;
255
+
256
+      &.btn {
257
+        margin-left: 8px;
258
+      }
259
+    }
260
+  }
261
+
262
+  // 新增
263
+  &.add {
264
+    .modalBody {
265
+      width: 480px;
266
+      height: auto;
267
+
268
+      .content {
269
+        width: 100%;
270
+        height: auto;
271
+        padding: 16px;
272
+        max-height: 497px;
273
+        overflow-y: auto;
274
+
275
+        .addForm {
276
+          .ant-form-item {
277
+            margin-bottom: 0;
278
+
279
+            .ant-form-item-label {
280
+              text-align: left;
281
+            }
282
+
283
+            .desc {
284
+              margin-top: 5px;
285
+            }
286
+          }
287
+
288
+          .datesControl {
289
+            margin-top: -16px;
290
+
291
+            .ant-form-item-label {
292
+              line-height: 40px;
293
+            }
294
+          }
295
+
296
+          .timer {
297
+            .ant-form-item-label {
298
+              width: 100%;
299
+              text-align: left;
300
+            }
301
+
302
+            .numInp {
303
+              margin-right: 5px;
304
+            }
305
+
306
+            .line {
307
+              margin-right: 5px;
308
+            }
309
+          }
310
+
311
+          .timer2 {
312
+            .ant-form-item-label {
313
+              line-height: 20px;
314
+            }
315
+          }
316
+        }
317
+
318
+        .editForm {
319
+          .ant-form-item {
320
+            margin-bottom: 15px;
321
+
322
+            .ant-form-item-label {
323
+              line-height: 14px;
324
+              text-align: left;
325
+            }
326
+          }
327
+        }
328
+      }
329
+    }
330
+  }
331
+}

+ 259 - 0
src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.ts

@@ -0,0 +1,259 @@
1
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2
+import { MainService } from '../../services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { NzMessageService } from 'ng-zorro-antd';
5
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
6
+
7
+@Component({
8
+  selector: 'app-assets-product-management-prompt-modal',
9
+  templateUrl: './assets-product-management-prompt-modal.component.html',
10
+  styleUrls: ['./assets-product-management-prompt-modal.component.less']
11
+})
12
+export class AssetsProductManagementPromptModalComponent implements OnInit {
13
+  // 切换科室,切换弹窗
14
+  hsLoading = false;
15
+  historySpecimenList: any = [];
16
+
17
+  currentHospital; //当前院区
18
+  @Input() show: Boolean;
19
+  @Input() id: Number;
20
+
21
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  constructor(
24
+    private mainService: MainService,
25
+    private tool: ToolService,
26
+    private message: NzMessageService,
27
+    private fb: FormBuilder,
28
+  ) { }
29
+
30
+  ngOnInit() {
31
+    this.currentHospital = this.tool.getCurrentHospital();
32
+    this.getList();
33
+    this.getIncidentCategoryList();
34
+  }
35
+
36
+  // 获取故障现象
37
+  incidentCategoryList:any[] = [];
38
+  getIncidentCategoryList(){
39
+    if(!this.currentHospital.type || (this.currentHospital.type && this.currentHospital.type.value !== '6')){
40
+      this.incidentCategoryList = [];
41
+      return;
42
+    };
43
+    let postData = {
44
+      category: {
45
+        dutyIds: this.currentHospital.type.value === '6' ? this.currentHospital.id.toString()  : undefined,
46
+      },
47
+    };
48
+    this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
49
+      let incidentCategoryList = res.data || [];
50
+      incidentCategoryList = incidentCategoryList.map(v => ({...v, parentId: v.parent ? v.parent.id : undefined, label: v.category, value: v.id}));
51
+      this.incidentCategoryList = this.tool.tranListToTreeDataLeaf(incidentCategoryList, undefined, "parentId");
52
+      console.log(this.incidentCategoryList);
53
+    })
54
+  }
55
+
56
+  // 编辑
57
+  edit(e, data) {
58
+    e.stopPropagation();
59
+    console.log(data);
60
+    this.initForm();
61
+    this.modelName = "编辑";
62
+    this.add = false;
63
+    this.modal = true;
64
+    this.coopData = data;
65
+    this.validateForm.controls.alias.setValue(data.alias);
66
+    this.validateForm.controls.incidentCategoryId.setValue(this.tool.tranListToTreeDataFindIdsLeaf(this.incidentCategoryList, data.incidentCategoryId));
67
+  }
68
+
69
+  // 新增弹框
70
+  modelName = ""; //模态框名称
71
+  modal: boolean = false; //新增/编辑模态框
72
+  add: boolean; //true:新增;false:编辑
73
+  validateForm: FormGroup; //新增/编辑表单
74
+  coopData: any; //当前操作列
75
+  addModal() {
76
+    this.modelName = "新增";
77
+    this.add = true; //新增
78
+    this.modal = true;
79
+    this.initForm();
80
+  }
81
+  //关闭新增/编辑弹框
82
+  hideAddModal() {
83
+    this.modal = false;
84
+    this.initForm();
85
+  }
86
+
87
+  // 初始化新增form表单
88
+  initForm() {
89
+    this.validateForm = this.fb.group({
90
+      alias: ['', [Validators.required, Validators.pattern(/\S/)]],
91
+      incidentCategoryId: [null, [Validators.required]],
92
+    });
93
+  }
94
+
95
+  // 新增/编辑表单提交
96
+  btnLoading:boolean = false;
97
+  submitAddForm(): void {
98
+    for (const i in this.validateForm.controls) {
99
+      this.validateForm.controls[i].markAsDirty();
100
+      this.validateForm.controls[i].updateValueAndValidity();
101
+    }
102
+    if (this.validateForm.invalid) {
103
+      return;
104
+    }
105
+
106
+    console.log(this.validateForm.value)
107
+
108
+    this.btnLoading = true;
109
+    let postData:any = {};
110
+
111
+    if (this.add) {
112
+      //增加
113
+      postData = {
114
+        // assetProductIncidentCategory: {
115
+          hosId: this.currentHospital.id,
116
+          alias: this.validateForm.value.alias,
117
+          productId: this.id,
118
+          incidentCategoryId: this.validateForm.value.incidentCategoryId.length ? this.validateForm.value.incidentCategoryId.slice(-1)[0] : undefined,
119
+        // }
120
+      };
121
+    } else {
122
+      //编辑
123
+      postData = {
124
+        // assetProductIncidentCategory:{
125
+          ...this.coopData,
126
+          ...{
127
+            hosId: this.currentHospital.id,
128
+            alias: this.validateForm.value.alias,
129
+            productId: this.id,
130
+            incidentCategoryId: this.validateForm.value.incidentCategoryId.length ? this.validateForm.value.incidentCategoryId.slice(-1)[0] : undefined,
131
+          }
132
+        // }
133
+      };
134
+    }
135
+    console.log(postData);
136
+    this.mainService
137
+      .simplePost("addData", "assetProductIncidentCategory", postData)
138
+      .subscribe((result) => {
139
+        this.btnLoading = false;
140
+        this.hideAddModal();
141
+        let msg = "";
142
+        if (this.add) {
143
+          msg = "新增";
144
+        } else {
145
+          msg = "修改";
146
+        }
147
+        if (result.status == 200) {
148
+          this.showPromptModal(msg, true, "");
149
+        } else {
150
+          this.showPromptModal(msg, false, result.msg);
151
+        }
152
+      });
153
+  }
154
+
155
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
156
+  promptContent: string; //操作提示框提示信息
157
+  ifSuccess: boolean; //操作成功/失败
158
+  promptInfo: string; //操作结果提示信息
159
+  promptModalShow: boolean; //操作提示框是否展示
160
+  showPromptModal(con, success, promptInfo?) {
161
+    this.promptModalShow = false;
162
+    this.promptContent = con;
163
+    this.ifSuccess = success;
164
+    this.promptInfo = promptInfo;
165
+    setTimeout(() => {
166
+      this.promptModalShow = true;
167
+    }, 100);
168
+    this.getList();
169
+  }
170
+
171
+  delModal: boolean = false; //删除模态框
172
+  tipsMsg1: string; //提示框信息
173
+  tipsMsg2: string; //操作后信息
174
+  confirmDelType: string; //确认的类型(启用/停用,删除)
175
+  confirmDelIsSwitch: boolean; //启用/停用
176
+  showDelModal(
177
+    e,
178
+    data,
179
+    tipsMsg1: string,
180
+    tipsMsg2: string,
181
+    type: string,
182
+    isSwitch?: boolean
183
+  ) {
184
+    e.stopPropagation();
185
+    this.confirmDelIsSwitch = isSwitch;
186
+    this.confirmDelType = type;
187
+    this.delModal = true;
188
+    this.coopData = data;
189
+    this.tipsMsg1 = tipsMsg1;
190
+    this.tipsMsg2 = tipsMsg2;
191
+  }
192
+  // 隐藏删除框
193
+  hideDelModal() {
194
+    this.delModal = false;
195
+  }
196
+  // 确认删除
197
+  confirmDel() {
198
+    this.btnLoading = true;
199
+    if (this.confirmDelType === "del") {
200
+      //删除
201
+      this.mainService
202
+        .simplePost("rmvData", "assetProductIncidentCategory", [this.coopData.id])
203
+        .subscribe((data) => {
204
+          this.btnLoading = false;
205
+          this.delModal = false;
206
+          if (data.status == 200) {
207
+            this.showPromptModal(this.tipsMsg2, true, "");
208
+          } else {
209
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
210
+          }
211
+        });
212
+    } else if (this.confirmDelType === "switch") {
213
+      //启用/停用
214
+      let postData = {
215
+        // assetProductIncidentCategory:{
216
+          ...this.coopData,
217
+          ...{
218
+            status: { key: 'product_category_status', value: this.confirmDelIsSwitch ? '0' : '1' },
219
+          }
220
+        // }
221
+      };
222
+      console.log(postData);
223
+      this.mainService
224
+        .simplePost("addData", "assetProductIncidentCategory", postData)
225
+        .subscribe((data) => {
226
+          this.btnLoading = false;
227
+          this.delModal = false;
228
+          if (data.status == 200) {
229
+            this.showPromptModal(this.tipsMsg2, true, "");
230
+          } else {
231
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
232
+          }
233
+        });
234
+    }
235
+  }
236
+
237
+  // 关闭弹窗
238
+  hideModal() {
239
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
240
+  }
241
+  // 获取列表数据
242
+  getList() {
243
+    let postData = {
244
+      idx: 0,
245
+      sum: 9999,
246
+      assetProductIncidentCategory: {
247
+        productId: this.id,
248
+        hosId: this.currentHospital.id,
249
+      }
250
+    }
251
+    this.hsLoading = true;
252
+    this.mainService.getFetchDataList("data", "assetProductIncidentCategory", postData).subscribe(data => {
253
+      this.hsLoading = false;
254
+      this.historySpecimenList = data.list || [];
255
+    })
256
+  }
257
+}
258
+
259
+

+ 3 - 0
src/app/share/share.module.ts

@@ -13,6 +13,7 @@ import { HsPromptModalComponent } from './hs-prompt-modal/hs-prompt-modal.compon
13 13
 import { HistoryPromptModalComponent } from './history-prompt-modal/history-prompt-modal.component';
14 14
 import { InspectionConfigurationItemPromptModalComponent } from './inspection-configuration-item-prompt-modal/inspection-configuration-item-prompt-modal.component';
15 15
 import { InspectionAddressDepartmentPromptModalComponent } from './inspection-address-department-prompt-modal/inspection-address-department-prompt-modal.component';
16
+import { AssetsProductManagementPromptModalComponent } from './assets-product-management-prompt-modal/assets-product-management-prompt-modal.component';
16 17
 import { InspectionTemplatePromptModalComponent } from './inspection-template-prompt-modal/inspection-template-prompt-modal.component';
17 18
 import { InspectionAddressTagPromptModalComponent } from './inspection-address-tag-prompt-modal/inspection-address-tag-prompt-modal.component';
18 19
 import { InspectionExecuteAssignPromptModalComponent } from './inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component';
@@ -70,6 +71,7 @@ import { InspectionExecuteDetailComponent } from './inspection-execute-detail/in
70 71
     HistoryPromptModalComponent,
71 72
     InspectionConfigurationItemPromptModalComponent,
72 73
     InspectionAddressDepartmentPromptModalComponent,
74
+    AssetsProductManagementPromptModalComponent,
73 75
     InspectionTemplatePromptModalComponent,
74 76
     InspectionAddressTagPromptModalComponent,
75 77
     InspectionExecuteAssignPromptModalComponent,
@@ -131,6 +133,7 @@ import { InspectionExecuteDetailComponent } from './inspection-execute-detail/in
131 133
     HistoryPromptModalComponent,
132 134
     InspectionConfigurationItemPromptModalComponent,
133 135
     InspectionAddressDepartmentPromptModalComponent,
136
+    AssetsProductManagementPromptModalComponent,
134 137
     InspectionTemplatePromptModalComponent,
135 138
     InspectionAddressTagPromptModalComponent,
136 139
     InspectionExecuteAssignPromptModalComponent,

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

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

+ 231 - 0
src/app/views/assets-info/assets-info.component.html

@@ -0,0 +1,231 @@
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" style="width: 100px;">资产编码|SN号</span>:
7
+          <input nz-input class="formItem" placeholder="请输入资产编码|SN号" [(ngModel)]="searchDto.searchKey" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">资产名称</span>:
11
+          <input nz-input class="formItem" placeholder="请输入资产名称" [(ngModel)]="searchDto.name" />
12
+        </div>
13
+        <div class="list-template__searchItem">
14
+          <span class="label">状态</span>:
15
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择状态" [(ngModel)]="searchDto.status">
16
+            <ng-container *ngFor="let option of dispatchMethods">
17
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
18
+            </ng-container>
19
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
20
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
21
+            </nz-option>
22
+          </nz-select>
23
+        </div>
24
+        <div class="list-template__searchItem">
25
+          <span class="label">使用科室</span>:
26
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
27
+            (nzOnSearch)="changeInp('search', 'department', $event)" nzAllowClear nzPlaceHolder="请选择使用科室" [(ngModel)]="searchDto.deptId">
28
+            <ng-container *ngFor="let option of departmentSearchList">
29
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
30
+            </ng-container>
31
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
32
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
33
+            </nz-option>
34
+          </nz-select>
35
+        </div>
36
+      </div>
37
+      <div nz-col nzLg="8" class="list-template__btns">
38
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
39
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
40
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
41
+      </div>
42
+    </div>
43
+    <div class="list-template__bottom">
44
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
45
+        [nzLoading]="loading1">
46
+        <thead>
47
+          <tr class="thead">
48
+            <th nzWidth="12%">资产编号|SN号</th>
49
+            <th nzWidth="11%">资产名称</th>
50
+            <th nzWidth="11%">存放位置</th>
51
+            <th nzWidth="11%">状态</th>
52
+            <th nzWidth="11%">入库时间|有效期至</th>
53
+            <th nzWidth="11%">关联产品</th>
54
+            <th nzWidth="11%">供应商</th>
55
+            <th nzWidth="11%">使用科室</th>
56
+            <th nzWidth="11%">责任部门</th>
57
+          </tr>
58
+        </thead>
59
+        <tbody>
60
+          <tr *ngFor="let data of listOfData;let i = index">
61
+            <td>{{data.code}}<br>{{data.snCode}}</td>
62
+            <td>{{data.name}}</td>
63
+            <td>{{data.buildDTO?.buildingName}}{{data.floorDTO?.floorName}}{{data.address}}</td>
64
+            <td>{{data.status?.name}}</td>
65
+            <td>{{data.inTime| date:'yyyy-MM-dd'}}<br>{{data.overTime| date:'yyyy-MM-dd'}}</td>
66
+            <td>{{data.assetProductDTO?.name}}</td>
67
+            <td>{{data.supplierDTO?.name}}</td>
68
+            <td>{{data.deptDTO?.dept}}</td>
69
+            <td>{{data.duty?.hosName}}</td>
70
+          </tr>
71
+        </tbody>
72
+      </nz-table>
73
+      <div class="list-template__pagination">
74
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
75
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
76
+        </nz-pagination>
77
+      </div>
78
+    </div>
79
+  </div>
80
+
81
+  <!-- 新增/编辑模态框 -->
82
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
83
+    <div class="modalBody">
84
+      <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
85
+      <div class="content">
86
+        <form nz-form [formGroup]="validateForm" class="addForm">
87
+          <nz-form-item>
88
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="code">资产编码</nz-form-label>
89
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入资产编码!">
90
+              <nz-input-group>
91
+                  <input formControlName="code" nz-input placeholder="请输入资产编码">
92
+              </nz-input-group>
93
+            </nz-form-control>
94
+          </nz-form-item>
95
+          <nz-form-item>
96
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="snCode">SN号</nz-form-label>
97
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入SN号!">
98
+              <nz-input-group>
99
+                  <input formControlName="snCode" nz-input placeholder="请输入SN号">
100
+              </nz-input-group>
101
+            </nz-form-control>
102
+          </nz-form-item>
103
+          <nz-form-item>
104
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="productId">关联产品</nz-form-label>
105
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择关联产品!">
106
+              <nz-select (nzOnSearch)="changeInp('add', 'assetProduct', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="productId" nzPlaceHolder="请选择关联产品" (ngModelChange)="changeAssetProduct($event)" (nzOpenChange)="changeInp('add', 'assetProduct', '')">
107
+                <ng-container *ngFor="let option of assetProductList">
108
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
109
+                </ng-container>
110
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
111
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
112
+                </nz-option>
113
+              </nz-select>
114
+            </nz-form-control>
115
+          </nz-form-item>
116
+          <nz-form-item>
117
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="name">资产名称</nz-form-label>
118
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入资产名称!">
119
+              <nz-input-group>
120
+                  <input formControlName="name" nz-input placeholder="请输入资产名称">
121
+              </nz-input-group>
122
+            </nz-form-control>
123
+          </nz-form-item>
124
+          <nz-form-item>
125
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="buildId">存放位置</nz-form-label>
126
+            <nz-form-control [nzSpan]="9" nzErrorTip="请选择楼栋!">
127
+              <nz-select (nzOnSearch)="changeInp('add', 'building', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="buildId" nzPlaceHolder="请选择楼栋" (ngModelChange)="changeBuilding($event)">
128
+                <ng-container *ngFor="let option of buildingAddList">
129
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
130
+                </ng-container>
131
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
132
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
133
+                </nz-option>
134
+              </nz-select>
135
+            </nz-form-control>
136
+            <nz-form-control [nzSpan]="9" [nzPush]="1" nzErrorTip="请选择楼层!">
137
+              <nz-select (nzOnSearch)="changeInp('add', 'floor', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="floorId" nzPlaceHolder="请选择楼层">
138
+                <ng-container *ngFor="let option of floorList">
139
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
140
+                </ng-container>
141
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
142
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
143
+                </nz-option>
144
+              </nz-select>
145
+            </nz-form-control>
146
+          </nz-form-item>
147
+          <nz-form-item>
148
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="address">具体位置</nz-form-label>
149
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入具体位置!">
150
+              <nz-input-group>
151
+                  <input formControlName="address" nz-input placeholder="请输入具体位置">
152
+              </nz-input-group>
153
+            </nz-form-control>
154
+          </nz-form-item>
155
+          <nz-form-item>
156
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="status">状态</nz-form-label>
157
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择状态!">
158
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="status" nzShowSearch
159
+                nzPlaceHolder="请选择状态" nzServerSearch>
160
+                <ng-container *ngFor="let data of dispatchMethods">
161
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
162
+                </ng-container>
163
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
164
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
165
+                </nz-option>
166
+              </nz-select>
167
+            </nz-form-control>
168
+          </nz-form-item>
169
+          <nz-form-item>
170
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="brand">品牌</nz-form-label>
171
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入品牌!">
172
+              <nz-input-group>
173
+                  <input formControlName="brand" nz-input placeholder="请输入品牌">
174
+              </nz-input-group>
175
+            </nz-form-control>
176
+          </nz-form-item>
177
+          <nz-form-item>
178
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="supplierId">供应商</nz-form-label>
179
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择供应商!">
180
+              <nz-select (nzOnSearch)="changeInp('add', 'company', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="supplierId" nzPlaceHolder="请选择供应商" (nzOpenChange)="changeInp('add', 'company', '')">
181
+                <ng-container *ngFor="let option of companyList">
182
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
183
+                </ng-container>
184
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
185
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
186
+                </nz-option>
187
+              </nz-select>
188
+            </nz-form-control>
189
+          </nz-form-item>
190
+          <nz-form-item>
191
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="deptId">使用科室</nz-form-label>
192
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择使用科室!">
193
+              <nz-select (nzOnSearch)="changeInp('add', 'department', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="deptId" nzPlaceHolder="请选择使用科室" (nzOpenChange)="changeInp('add', 'department', '')">
194
+                <ng-container *ngFor="let option of departmentAddList">
195
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
196
+                </ng-container>
197
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
198
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
199
+                </nz-option>
200
+              </nz-select>
201
+            </nz-form-control>
202
+          </nz-form-item>
203
+          <nz-form-item>
204
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="dutyId">责任部门</nz-form-label>
205
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择责任部门!">
206
+              <nz-select (nzOnSearch)="changeInp('add', 'hospital', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="dutyId" nzPlaceHolder="请选择责任部门" (nzOpenChange)="changeInp('add', 'hospital', '')">
207
+                <ng-container *ngFor="let option of dutyList">
208
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
209
+                </ng-container>
210
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
211
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
212
+                </nz-option>
213
+              </nz-select>
214
+            </nz-form-control>
215
+          </nz-form-item>
216
+        </form>
217
+      </div>
218
+      <div class="display_flex justify-content_flex-center">
219
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
220
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
221
+      </div>
222
+    </div>
223
+  </div>
224
+  <!-- 模态框 -->
225
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
226
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
227
+</div>
228
+<!-- 操作成功/失败提示框 -->
229
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
230
+  [info]="promptInfo">
231
+</app-prompt-modal>

+ 176 - 0
src/app/views/assets-info/assets-info.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
+}

+ 455 - 0
src/app/views/assets-info/assets-info.component.ts

@@ -0,0 +1,455 @@
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-info",
12
+  templateUrl: "./assets-info.component.html",
13
+  styleUrls: ["./assets-info.component.less"],
14
+})
15
+export class AssetsInfoComponent 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] === 'department'){
51
+        this.getDeparts(v[0], v[2]);
52
+      } else if(v[1] === 'building'){
53
+        this.getBuildings(v[0], v[2]);
54
+      } else if(v[1] === 'floor'){
55
+        this.getFloors(v[0], v[2], this.validateForm.value.buildId);
56
+      } else if(v[1] === 'assetProduct'){
57
+        this.getAssetProductList(v[0], v[2]);
58
+      } else if(v[1] === 'company'){
59
+        this.getCompanyList(v[0], v[2]);
60
+      } else if(v[1] === 'hospital'){
61
+        this.getDutyList(v[0], v[2]);
62
+      }
63
+    });
64
+    this.currentHospital = this.tool.getCurrentHospital();
65
+    this.coopBtns = this.tool.initCoopBtns(this.route);
66
+    this.getList(1);
67
+    this.getDeparts('search', '');
68
+    this.getDeparts('add', '');
69
+    this.getAssetProductList('add', '');
70
+    this.getCompanyList('add', '');
71
+    this.getDutyList('add', '');
72
+    this.getBuildings('add', '');
73
+    this.getDispatchMethods();
74
+  }
75
+
76
+  // 初始化增删改按钮
77
+  coopBtns: any = {};
78
+
79
+  // 搜索
80
+  search() {
81
+    this.getList(1);
82
+  }
83
+  // 重置
84
+  reset() {
85
+    this.searchDto = {};
86
+    this.getList(1);
87
+  }
88
+
89
+  // 表格数据
90
+  searchDto: any = {};
91
+  loading1 = false;
92
+  getList(type) {
93
+    if (type == 1) {
94
+      this.pageIndex = 1;
95
+    }
96
+    let data = {
97
+      idx: this.pageIndex - 1,
98
+      sum: this.pageSize,
99
+      asset: {
100
+        hosId: this.currentHospital.id,
101
+        ...this.searchDto,
102
+      },
103
+    };
104
+    data.asset.status = data.asset.status ? { id: data.asset.status } : undefined;
105
+    this.loading1 = true;
106
+    this.mainService
107
+      .getFetchDataList("simple/data", "asset", data)
108
+      .subscribe((data) => {
109
+        this.loading1 = false;
110
+        if (data.status == 200) {
111
+          this.listOfData = data.list;
112
+          this.listLength = data.totalNum;
113
+        }else{
114
+          this.message.error(data.msg || "请求数据失败");
115
+        }
116
+      });
117
+  }
118
+
119
+  // 新增弹框
120
+  addModal() {
121
+    this.modelName = "新增";
122
+    this.add = true; //新增
123
+    this.modal = true;
124
+    this.initForm();
125
+  }
126
+  //关闭新增/编辑弹框
127
+  hideAddModal() {
128
+    this.modal = false;
129
+    this.initForm();
130
+  }
131
+
132
+  // 初始化新增form表单
133
+  initForm() {
134
+    this.floorList = [];
135
+    this.validateForm = this.fb.group({
136
+      code: ['', [Validators.required, Validators.pattern(/\S/)]],
137
+      snCode: ['', [Validators.required, Validators.pattern(/\S/)]],
138
+      productId: [null, [Validators.required]],
139
+      name: ['', [Validators.required, Validators.pattern(/\S/)]],
140
+      buildId: [null, [Validators.required]],
141
+      floorId: [null, [Validators.required]],
142
+      address: ['', [Validators.required, Validators.pattern(/\S/)]],
143
+      status: [null, [Validators.required]],
144
+      brand: ['', [Validators.required, Validators.pattern(/\S/)]],
145
+      supplierId: [null, [Validators.required]],
146
+      deptId: [null, [Validators.required]],
147
+      dutyId: [null, [Validators.required]],
148
+    });
149
+  }
150
+
151
+  // 边输边搜节流阀
152
+  isLoading = false;
153
+  changeInp(type, model, e) {
154
+    this.isLoading = true;
155
+    this.changeInpSubject.next([type, model, e]);
156
+  }
157
+
158
+  // 获取产品列表
159
+  assetProductList: any = [];
160
+  getAssetProductList(type, keyword, init = false) {
161
+    let postData:any = {
162
+      assetProduct: {
163
+        name: keyword,
164
+        hosId: this.currentHospital.id,
165
+      },
166
+      idx: 0,
167
+      sum: 20,
168
+    };
169
+    this.mainService
170
+      .getFetchDataList("simple/data", "assetProduct", postData)
171
+      .subscribe((data) => {
172
+        this.assetProductList = data.list || [];
173
+
174
+        this.isLoading = false;
175
+      });
176
+  }
177
+
178
+  // 获取所有科室
179
+  departmentAddList: any = []; //所有所属科室
180
+  departmentSearchList: any = []; //所有所属科室(搜索)
181
+  getDeparts(type, keyword, init = false) {
182
+    let postData:any = {
183
+      department: {
184
+        // searchType: 1,// 简单查询
185
+        dept: keyword,
186
+        cascadeHosId: this.currentHospital.id,
187
+      },
188
+      idx: 0,
189
+      sum: 20,
190
+    };
191
+    if(type === 'add'){
192
+      postData.department.bussType = 'inspection';
193
+    }
194
+    this.mainService
195
+      .getFetchDataList("data", "department", postData)
196
+      .subscribe((data) => {
197
+        if (type == "search") {
198
+          this.departmentSearchList = data.list;
199
+        } else if (type == "add") {
200
+          this.departmentAddList = data.list;
201
+        }
202
+
203
+        this.isLoading = false;
204
+      });
205
+  }
206
+
207
+  // 获取供应商
208
+  companyList: any = [];
209
+  getCompanyList(type, keyword, init = false) {
210
+    let postData:any = {
211
+      company: {
212
+        name: keyword,
213
+        busiType: {key: "company_busi_type", value: "2"},
214
+        hosId: this.currentHospital.id,
215
+      },
216
+      idx: 0,
217
+      sum: 20,
218
+    };
219
+    this.mainService
220
+      .getFetchDataList("simple/data", "company", postData)
221
+      .subscribe((data) => {
222
+        this.companyList = data.list || [];
223
+
224
+        this.isLoading = false;
225
+      });
226
+  }
227
+
228
+  // 获取责任部门
229
+  dutyList: any = [];
230
+  getDutyList(type, keyword, init = false) {
231
+    let postData:any = {
232
+      hospital: {
233
+        hosName: keyword,
234
+        type: { key: 'hospital_type', value: '6' },
235
+      },
236
+      idx: 0,
237
+      sum: 9999,
238
+    };
239
+    this.mainService
240
+      .getFetchDataList("simple/data", "hospital", postData)
241
+      .subscribe((data) => {
242
+        this.dutyList = data.list || [];
243
+
244
+        this.isLoading = false;
245
+      });
246
+  }
247
+
248
+  // 获取楼栋
249
+  buildingAddList: any = [];
250
+  buildingSearchList: any = [];
251
+  getBuildings(type, keyword, init = false) {
252
+    let postData = {
253
+      building: {
254
+        simpleQuery: true,
255
+        buildingName: keyword,
256
+        cascadeHosId: this.currentHospital.id,
257
+      },
258
+      idx: 0,
259
+      sum: 20,
260
+    };
261
+    this.mainService
262
+      .getFetchDataList("simple/data", "building", postData)
263
+      .subscribe((data) => {
264
+        if (type == "search") {
265
+          this.buildingSearchList = data.list;
266
+        } else if (type == "add") {
267
+          this.buildingAddList = data.list;
268
+        }
269
+        this.isLoading = false;
270
+      });
271
+  }
272
+
273
+  // 修改产品
274
+  changeAssetProduct(id){
275
+    let obj = this.assetProductList.find(v => v.id == id);
276
+    console.log(obj);
277
+    this.validateForm.controls.brand.setValue(obj.brand);
278
+    this.validateForm.controls.supplierId.setValue((Array.isArray(obj.supplierList) && obj.supplierList.length) ? obj.supplierList[0].id : null);
279
+  }
280
+
281
+  // 修改楼栋
282
+  noChangeBuilding:boolean = false;
283
+  changeBuilding(buildId?){
284
+    console.log(buildId)
285
+    if(!this.noChangeBuilding){
286
+      this.validateForm.controls.floorId.setValue(null);
287
+      this.getFloors('add', '', this.validateForm.value.buildId);
288
+    }
289
+    this.noChangeBuilding = false;
290
+  }
291
+
292
+  // 获取楼层
293
+  floorList: any = [];
294
+  getFloors(type, keyword, buildId, init = false, isNoChangeBuilding = false) {
295
+    console.log(isNoChangeBuilding)
296
+    if(!buildId){
297
+      this.floorList = [];
298
+      return;
299
+    }
300
+    let postData = {
301
+      floor: {
302
+        floorName: keyword,
303
+        buildId,
304
+        // hosId: this.currentHospital.id,
305
+      },
306
+      idx: 0,
307
+      sum: 20,
308
+    };
309
+    this.mainService
310
+      .getFetchDataList("simple/data", "floor", postData)
311
+      .subscribe((data) => {
312
+        this.floorList = data.list;
313
+        this.isLoading = false;
314
+      });
315
+  }
316
+
317
+  //获取状态
318
+  dispatchMethods:any[] = [];
319
+  getDispatchMethods() {
320
+    this.isLoading = true;
321
+    this.mainService.getDictionary("list", "asset_status").subscribe((data) => {
322
+      this.isLoading = false;
323
+      this.dispatchMethods = data || [];
324
+    });
325
+  }
326
+
327
+  // 新增/编辑表单提交
328
+  submitForm(): void {
329
+    for (const i in this.validateForm.controls) {
330
+      this.validateForm.controls[i].markAsDirty();
331
+      this.validateForm.controls[i].updateValueAndValidity();
332
+    }
333
+    if (this.validateForm.invalid) {
334
+      return;
335
+    }
336
+
337
+    console.log(this.validateForm.value)
338
+
339
+    this.btnLoading = true;
340
+    let postData:any = {};
341
+
342
+    if (this.add) {
343
+      //增加
344
+      postData = {
345
+        asset: {
346
+          hosId: this.currentHospital.id,
347
+          code: this.validateForm.value.code,
348
+          snCode: this.validateForm.value.snCode,
349
+          productId: this.validateForm.value.productId,
350
+          name: this.validateForm.value.name,
351
+          buildId: this.validateForm.value.buildId,
352
+          floorId: this.validateForm.value.floorId,
353
+          address: this.validateForm.value.address,
354
+          status: { id: this.validateForm.value.status },
355
+          deptId: this.validateForm.value.deptId,
356
+          dutyId: this.validateForm.value.dutyId,
357
+          brand: this.validateForm.value.brand,
358
+          supplierId: this.validateForm.value.supplierId,
359
+        }
360
+      };
361
+    } else {
362
+      //编辑
363
+      postData = {
364
+        asset:{
365
+          ...this.coopData,
366
+          ...{
367
+            hosId: this.currentHospital.id,
368
+            code: this.validateForm.value.code,
369
+            snCode: this.validateForm.value.snCode,
370
+            productId: this.validateForm.value.productId,
371
+            name: this.validateForm.value.name,
372
+            buildId: this.validateForm.value.buildId,
373
+            floorId: this.validateForm.value.floorId,
374
+            address: this.validateForm.value.address,
375
+            status: { id: this.validateForm.value.status },
376
+            deptId: this.validateForm.value.deptId,
377
+            dutyId: this.validateForm.value.dutyId,
378
+            brand: this.validateForm.value.brand,
379
+            supplierId: this.validateForm.value.supplierId,
380
+          }
381
+        }
382
+      };
383
+    }
384
+    this.mainService
385
+      .coopData("addData", "asset", postData)
386
+      .subscribe((result) => {
387
+        this.btnLoading = false;
388
+        this.hideAddModal();
389
+        let msg = "";
390
+        if (this.add) {
391
+          msg = "新增";
392
+        } else {
393
+          msg = "修改";
394
+        }
395
+        if (result.status == 200) {
396
+          this.showPromptModal(msg, true, "");
397
+        } else {
398
+          this.showPromptModal(msg, false, result.msg);
399
+        }
400
+      });
401
+  }
402
+
403
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
404
+  showPromptModal(con, success, promptInfo?) {
405
+    this.promptModalShow = false;
406
+    this.promptContent = con;
407
+    this.ifSuccess = success;
408
+    this.promptInfo = promptInfo;
409
+    setTimeout(() => {
410
+      this.promptModalShow = true;
411
+    }, 100);
412
+    this.getList(0);
413
+  }
414
+
415
+  delModal: boolean = false; //删除模态框
416
+  tipsMsg1: string; //提示框信息
417
+  tipsMsg2: string; //操作后信息
418
+  confirmDelType: string; //确认的类型(启用/停用,删除)
419
+  showDelModal(
420
+    e,
421
+    data,
422
+    tipsMsg1: string,
423
+    tipsMsg2: string,
424
+    type: string,
425
+  ) {
426
+    e.stopPropagation();
427
+    this.confirmDelType = type;
428
+    this.delModal = true;
429
+    this.coopData = data;
430
+    this.tipsMsg1 = tipsMsg1;
431
+    this.tipsMsg2 = tipsMsg2;
432
+  }
433
+  // 隐藏删除框
434
+  hideDelModal() {
435
+    this.delModal = false;
436
+  }
437
+  // 确认删除
438
+  confirmDel() {
439
+    this.btnLoading = true;
440
+    if (this.confirmDelType === "del") {
441
+      //删除
442
+      this.mainService
443
+        .simplePost("rmvData", "asset", [this.coopData.id])
444
+        .subscribe((data) => {
445
+          this.btnLoading = false;
446
+          this.delModal = false;
447
+          if (data.status == 200) {
448
+            this.showPromptModal(this.tipsMsg2, true, "");
449
+          } else {
450
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
451
+          }
452
+        });
453
+    }
454
+  }
455
+}

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

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

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

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

+ 192 - 0
src/app/views/assets-product-management/assets-product-management.component.html

@@ -0,0 +1,192 @@
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
+          <input nz-input class="formItem" placeholder="请输入编码" [(ngModel)]="searchDto.code" />
12
+        </div>
13
+        <div class="list-template__searchItem">
14
+          <span class="label">大类</span>:
15
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择大类" [(ngModel)]="searchDto.mainType">
16
+            <ng-container *ngFor="let option of productCategoryTypeListSearch1">
17
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
18
+            </ng-container>
19
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
20
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
21
+            </nz-option>
22
+          </nz-select>
23
+        </div>
24
+      </div>
25
+      <div nz-col nzLg="8" class="list-template__btns">
26
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
27
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
28
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</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="8%">编码</th>
37
+            <th nzWidth="8%">名称</th>
38
+            <th nzWidth="8%">型号</th>
39
+            <th nzWidth="8%">品牌</th>
40
+            <th nzWidth="8%">大类</th>
41
+            <th nzWidth="8%">小类</th>
42
+            <th nzWidth="12%">描述</th>
43
+            <th nzWidth="14%">供应商</th>
44
+            <th nzWidth="14%">生产商</th>
45
+            <th nzWidth="12%">操作</th>
46
+          </tr>
47
+        </thead>
48
+        <tbody>
49
+          <tr *ngFor="let data of listOfData;let i = index">
50
+            <td>{{data.code}}</td>
51
+            <td>{{data.name}}</td>
52
+            <td>{{data.model}}</td>
53
+            <td>{{data.brand}}</td>
54
+            <td>{{data.mainTypeDTO?.name}}</td>
55
+            <td>{{data.subTypeDTO?.name}}</td>
56
+            <td>{{data.description}}</td>
57
+            <td>{{data.supplierList | dataToName:'name':','}}</td>
58
+            <td>{{data.manufacturerList | dataToName:'name':','}}</td>
59
+            <td>
60
+              <div class="coop">
61
+                <span *ngIf="coopBtns.commonFault" (click)="commonFault($event, data)">常见故障</span>
62
+                <span *ngIf="coopBtns.edit" (click)="edit($event, data)">编辑</span>
63
+                <span *ngIf="coopBtns.del" (click)="showDelModal($event, data,'您确认要删除吗?','删除','del')">删除</span>
64
+              </div>
65
+            </td>
66
+          </tr>
67
+        </tbody>
68
+      </nz-table>
69
+      <div class="list-template__pagination">
70
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
71
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
72
+        </nz-pagination>
73
+      </div>
74
+    </div>
75
+  </div>
76
+
77
+  <!-- 新增/编辑模态框 -->
78
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
79
+    <div class="modalBody">
80
+      <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
81
+      <div class="content">
82
+        <form nz-form [formGroup]="validateForm" class="addForm">
83
+          <nz-form-item>
84
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="name">名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称</nz-form-label>
85
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入名称!">
86
+              <nz-input-group>
87
+                  <input formControlName="name" nz-input placeholder="请输入名称">
88
+              </nz-input-group>
89
+            </nz-form-control>
90
+          </nz-form-item>
91
+          <nz-form-item>
92
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="model">型&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</nz-form-label>
93
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入型号!">
94
+              <nz-input-group>
95
+                  <input formControlName="model" nz-input placeholder="请输入型号">
96
+              </nz-input-group>
97
+            </nz-form-control>
98
+          </nz-form-item>
99
+          <nz-form-item>
100
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="brand">品&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;牌</nz-form-label>
101
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入品牌!">
102
+              <nz-input-group>
103
+                  <input formControlName="brand" nz-input placeholder="请输入品牌">
104
+              </nz-input-group>
105
+            </nz-form-control>
106
+          </nz-form-item>
107
+          <nz-form-item>
108
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="mainType">大&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类</nz-form-label>
109
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择大类!">
110
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="mainType" nzShowSearch
111
+                nzPlaceHolder="请选择大类" (ngModelChange)="changeMainType($event)">
112
+                <ng-container *ngFor="let data of productCategoryTypeList1">
113
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
114
+                </ng-container>
115
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
116
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
117
+                </nz-option>
118
+              </nz-select>
119
+            </nz-form-control>
120
+          </nz-form-item>
121
+          <nz-form-item>
122
+            <nz-form-label [nzSpan]="5" nzFor="subType">&nbsp;&nbsp;&nbsp;小&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类</nz-form-label>
123
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择小类!">
124
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="subType" nzShowSearch
125
+                nzPlaceHolder="请选择小类">
126
+                <ng-container *ngFor="let data of productCategoryTypeList2">
127
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
128
+                </ng-container>
129
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
130
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
131
+                </nz-option>
132
+              </nz-select>
133
+            </nz-form-control>
134
+          </nz-form-item>
135
+          <nz-form-item>
136
+            <nz-form-label [nzSpan]="5" nzFor="description">&nbsp;&nbsp;&nbsp;描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述</nz-form-label>
137
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入描述!">
138
+              <nz-input-group>
139
+                <textarea rows="3" nz-input formControlName="description" placeholder="请输入描述"></textarea>
140
+              </nz-input-group>
141
+            </nz-form-control>
142
+          </nz-form-item>
143
+          <nz-form-item>
144
+            <nz-form-label [nzSpan]="5" nzFor="supplierIds">&nbsp;&nbsp;&nbsp;供&nbsp;应&nbsp;商</nz-form-label>
145
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择供应商!">
146
+              <nz-select nzMode="multiple" (nzOnSearch)="changeInp('1', 'company', $event)" (nzOpenChange)="openSupplier($event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="supplierIds" nzPlaceHolder="请选择供应商">
147
+                <ng-container *ngFor="let option of companyList1">
148
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
149
+                </ng-container>
150
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
151
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
152
+                </nz-option>
153
+              </nz-select>
154
+            </nz-form-control>
155
+          </nz-form-item>
156
+          <nz-form-item>
157
+            <nz-form-label [nzSpan]="5" nzFor="manufacturerIds">&nbsp;&nbsp;&nbsp;生&nbsp;产&nbsp;商</nz-form-label>
158
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择生产商!">
159
+              <nz-select nzMode="multiple" (nzOnSearch)="changeInp('2', 'company', $event)" (nzOpenChange)="openManufacturer($event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="manufacturerIds" nzPlaceHolder="请选择生产商">
160
+                <ng-container *ngFor="let option of companyList2">
161
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
162
+                </ng-container>
163
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
164
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
165
+                </nz-option>
166
+              </nz-select>
167
+            </nz-form-control>
168
+          </nz-form-item>
169
+        </form>
170
+      </div>
171
+      <div class="display_flex justify-content_flex-center">
172
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
173
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
174
+      </div>
175
+    </div>
176
+  </div>
177
+  <!-- 模态框 -->
178
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
179
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
180
+</div>
181
+<!-- 操作成功/失败提示框 -->
182
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
183
+  [info]="promptInfo">
184
+</app-prompt-modal>
185
+
186
+<!-- 常见故障 -->
187
+<app-assets-product-management-prompt-modal
188
+  *ngIf="assetsProductManagementPromptModalShow"
189
+  [show]="assetsProductManagementPromptModalShow"
190
+  [id]="commonFaultId"
191
+  (closeModelHs)="closeModelAssetsProductManagement($event)"
192
+></app-assets-product-management-prompt-modal>

+ 179 - 0
src/app/views/assets-product-management/assets-product-management.component.less

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

+ 388 - 0
src/app/views/assets-product-management/assets-product-management.component.ts

@@ -0,0 +1,388 @@
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-product-management",
12
+  templateUrl: "./assets-product-management.component.html",
13
+  styleUrls: ["./assets-product-management.component.less"],
14
+})
15
+export class AssetsProductManagementComponent 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
+  modelName = ""; //模态框名称
42
+
43
+  changeInpSubject = new Subject(); //防抖
44
+  showDropdown:boolean = false;
45
+
46
+  ngOnInit() {
47
+    //防抖
48
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
49
+      if(v[1] === 'company'){
50
+        this.getCompanyList(v[0], v[2]);
51
+      }
52
+    });
53
+    this.currentHospital = this.tool.getCurrentHospital();
54
+    this.coopBtns = this.tool.initCoopBtns(this.route);
55
+    this.getList(1);
56
+    this.getProductCategoryTypeList(1);
57
+    this.getProductCategoryTypeList(1, 'Search');
58
+    this.getCompanyTypeList();
59
+  }
60
+
61
+  // 初始化增删改按钮
62
+  coopBtns: any = {};
63
+
64
+  // 常见故障
65
+  commonFaultId:any;
66
+  commonFault(e, data){
67
+    e.stopPropagation();
68
+    this.commonFaultId = data.id;
69
+    this.showAssetsProductManagementDepartment();
70
+  }
71
+
72
+  // 常见故障
73
+  assetsProductManagementPromptModalShow = false;
74
+  showAssetsProductManagementDepartment() {
75
+    this.assetsProductManagementPromptModalShow = true;
76
+  }
77
+  // 关闭弹窗
78
+  closeModelAssetsProductManagement(e) {
79
+    this.assetsProductManagementPromptModalShow = JSON.parse(e).show;
80
+  }
81
+
82
+  // 搜索
83
+  search() {
84
+    this.getList(1);
85
+  }
86
+  // 重置
87
+  reset() {
88
+    this.searchDto = {};
89
+    this.getList(1);
90
+  }
91
+
92
+  // 表格数据
93
+  searchDto: any = {};
94
+  loading1 = false;
95
+  getList(type) {
96
+    if (type == 1) {
97
+      this.pageIndex = 1;
98
+    }
99
+    let data = {
100
+      idx: this.pageIndex - 1,
101
+      sum: this.pageSize,
102
+      assetProduct: {
103
+        hosId: this.currentHospital.id,
104
+        ...this.searchDto,
105
+      },
106
+    };
107
+    this.loading1 = true;
108
+    this.mainService
109
+      .getFetchDataList("simple/data", "assetProduct", data)
110
+      .subscribe((data) => {
111
+        this.loading1 = false;
112
+        if (data.status == 200) {
113
+          this.listOfData = data.list;
114
+          this.listLength = data.totalNum;
115
+        }else{
116
+          this.message.error(data.msg || "请求数据失败");
117
+        }
118
+      });
119
+  }
120
+
121
+  // 新增弹框
122
+  addModal() {
123
+    this.modelName = "新增";
124
+    this.add = true; //新增
125
+    this.modal = true;
126
+    this.initForm();
127
+  }
128
+  //关闭新增/编辑弹框
129
+  hideAddModal() {
130
+    this.modal = false;
131
+    this.initForm();
132
+  }
133
+
134
+  // 初始化新增form表单
135
+  initForm() {
136
+    this.validateForm = this.fb.group({
137
+      name: ['', [Validators.required, Validators.pattern(/\S/)]],
138
+      model: ['', [Validators.required, Validators.pattern(/\S/)]],
139
+      brand: ['', [Validators.required, Validators.pattern(/\S/)]],
140
+      mainType: [null, [Validators.required]],
141
+      subType: [null],
142
+      description: [''],
143
+      supplierIds: [[]],
144
+      manufacturerIds: [[]],
145
+    });
146
+  }
147
+
148
+  // 边输边搜节流阀
149
+  isLoading = false;
150
+  changeInp(type, model, e) {
151
+    this.isLoading = true;
152
+    this.changeInpSubject.next([type, model, e]);
153
+  }
154
+
155
+  openSupplier(flag){
156
+    if(flag){
157
+      this.getCompanyList('1');
158
+    }
159
+  }
160
+
161
+  openManufacturer(flag){
162
+    if(flag){
163
+      this.getCompanyList('2');
164
+    }
165
+  }
166
+
167
+  // 获取三方公司
168
+  companyList1: any = [];//供应商
169
+  companyList2: any = [];//生产商
170
+  getCompanyList(type, keyword = '') {
171
+    this.isLoading = true;
172
+    let postData:any = {
173
+      company: {
174
+        name: keyword,
175
+        busiType: {key: "company_busi_type", value: "2"},
176
+        hosId: this.currentHospital.id,
177
+      },
178
+      idx: 0,
179
+      sum: 20,
180
+    };
181
+    let dictionary = this.companyTypeList.find(v => v.value == type);
182
+    if(!dictionary){
183
+      this['companyList' + type] = [];
184
+      return;
185
+    }
186
+    postData.company.companyTypeIds = dictionary.id.toString();
187
+    this.mainService
188
+      .getFetchDataList("simple/data", "company", postData)
189
+      .subscribe((data) => {
190
+        this['companyList' + type] = data.list || [];
191
+        this.isLoading = false;
192
+      });
193
+  }
194
+
195
+  //获取大类/小类
196
+  productCategoryTypeList1:any[] = [];
197
+  productCategoryTypeListSearch1:any[] = [];
198
+  productCategoryTypeList2:any[] = [];
199
+  getProductCategoryTypeList(level:number, type:string = '') {
200
+    this.isLoading = true;
201
+    let postData = {
202
+      dictionaryTree: {
203
+        deleted: 0,
204
+        level,
205
+        parent: level == 1 ? undefined : this.validateForm.value.mainType,
206
+        key: 'product_category_type',
207
+      },
208
+      idx: 0,
209
+      sum: 9999,
210
+    };
211
+    this.mainService
212
+      .getFetchDataList("simple/data", "dictionaryTree", postData)
213
+      .subscribe((data) => {
214
+        this.isLoading = false;
215
+        this['productCategoryTypeList' + type + level] = data.list || [];
216
+      });
217
+  }
218
+
219
+  // 获取三方公司公司分类
220
+  companyTypeList:any[] = [];
221
+  getCompanyTypeList(){
222
+    this.mainService.getDictionary("list", "company_type").subscribe((data) => {
223
+      this.companyTypeList = data || [];
224
+      this.getCompanyList('1');
225
+      this.getCompanyList('2');
226
+    });
227
+  }
228
+
229
+  // 修改大类
230
+  changeMainType(id){
231
+    console.log(id);
232
+    this.validateForm.controls.subType.setValue(null);
233
+    this.productCategoryTypeList2 = [];
234
+
235
+    this.getProductCategoryTypeList(2);
236
+  }
237
+
238
+  // 新增/编辑表单提交
239
+  submitForm(): void {
240
+    for (const i in this.validateForm.controls) {
241
+      this.validateForm.controls[i].markAsDirty();
242
+      this.validateForm.controls[i].updateValueAndValidity();
243
+    }
244
+    if (this.validateForm.invalid) {
245
+      return;
246
+    }
247
+
248
+    console.log(this.validateForm.value)
249
+
250
+    this.btnLoading = true;
251
+    let postData:any = {};
252
+
253
+    if (this.add) {
254
+      //增加
255
+      postData = {
256
+        // assetProduct: {
257
+          hosId: this.currentHospital.id,
258
+          name: this.validateForm.value.name,
259
+          model: this.validateForm.value.model,
260
+          brand: this.validateForm.value.brand,
261
+          mainType: this.validateForm.value.mainType,
262
+          subType: this.validateForm.value.subType || undefined,
263
+          description: this.validateForm.value.description,
264
+          supplierIds: this.validateForm.value.supplierIds.length ? this.validateForm.value.supplierIds.toString() : undefined,
265
+          manufacturerIds: this.validateForm.value.manufacturerIds.length ? this.validateForm.value.manufacturerIds.toString() : undefined,
266
+        // }
267
+      };
268
+    } else {
269
+      //编辑
270
+      postData = {
271
+        // assetProduct:{
272
+          ...this.coopData,
273
+          ...{
274
+            hosId: this.currentHospital.id,
275
+            name: this.validateForm.value.name,
276
+            model: this.validateForm.value.model,
277
+            brand: this.validateForm.value.brand,
278
+            mainType: this.validateForm.value.mainType,
279
+            subType: this.validateForm.value.subType || undefined,
280
+            description: this.validateForm.value.description,
281
+            supplierIds: this.validateForm.value.supplierIds.length ? this.validateForm.value.supplierIds.toString() : undefined,
282
+            manufacturerIds: this.validateForm.value.manufacturerIds.length ? this.validateForm.value.manufacturerIds.toString() : undefined,
283
+          }
284
+        // }
285
+      };
286
+    }
287
+    console.log(postData);
288
+    this.mainService
289
+      .simplePost("addData", "assetProduct", postData)
290
+      .subscribe((result) => {
291
+        this.btnLoading = false;
292
+        this.hideAddModal();
293
+        let msg = "";
294
+        if (this.add) {
295
+          msg = "新增";
296
+        } else {
297
+          msg = "修改";
298
+        }
299
+        if (result.status == 200) {
300
+          this.showPromptModal(msg, true, "");
301
+        } else {
302
+          this.showPromptModal(msg, false, result.msg);
303
+        }
304
+      });
305
+  }
306
+
307
+  // 编辑
308
+  edit(e, data) {
309
+    e.stopPropagation();
310
+    console.log(data);
311
+    this.initForm();
312
+    this.modelName = "编辑";
313
+    this.add = false;
314
+    this.modal = true;
315
+    this.coopData = data;
316
+    this.validateForm.controls.name.setValue(data.name);
317
+    this.validateForm.controls.model.setValue(data.model);
318
+    this.validateForm.controls.brand.setValue(data.brand);
319
+    this.validateForm.controls.mainType.setValue(data.mainType ? data.mainType.toString() : null);
320
+    this.validateForm.controls.subType.setValue(data.subType ? data.subType.toString() : null);
321
+    this.validateForm.controls.description.setValue(data.description);
322
+    this.validateForm.controls.supplierIds.setValue(Array.isArray(data.supplierList) ? data.supplierList.map(v => v.id) : []);
323
+    this.validateForm.controls.manufacturerIds.setValue(Array.isArray(data.manufacturerList) ? data.manufacturerList.map(v => v.id) : []);
324
+
325
+    if(data.supplierList){
326
+      this.companyList1 = data.supplierList || [];
327
+    }
328
+    if(data.manufacturerList){
329
+      this.companyList2 = data.manufacturerList || [];
330
+    }
331
+    if(data.mainType){
332
+      this.getProductCategoryTypeList(2);
333
+    }
334
+  }
335
+
336
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
337
+  showPromptModal(con, success, promptInfo?) {
338
+    this.promptModalShow = false;
339
+    this.promptContent = con;
340
+    this.ifSuccess = success;
341
+    this.promptInfo = promptInfo;
342
+    setTimeout(() => {
343
+      this.promptModalShow = true;
344
+    }, 100);
345
+    this.getList(0);
346
+  }
347
+
348
+  delModal: boolean = false; //删除模态框
349
+  tipsMsg1: string; //提示框信息
350
+  tipsMsg2: string; //操作后信息
351
+  confirmDelType: string; //确认的类型(启用/停用,删除)
352
+  showDelModal(
353
+    e,
354
+    data,
355
+    tipsMsg1: string,
356
+    tipsMsg2: string,
357
+    type: string,
358
+  ) {
359
+    e.stopPropagation();
360
+    this.confirmDelType = type;
361
+    this.delModal = true;
362
+    this.coopData = data;
363
+    this.tipsMsg1 = tipsMsg1;
364
+    this.tipsMsg2 = tipsMsg2;
365
+  }
366
+  // 隐藏删除框
367
+  hideDelModal() {
368
+    this.delModal = false;
369
+  }
370
+  // 确认删除
371
+  confirmDel() {
372
+    this.btnLoading = true;
373
+    if (this.confirmDelType === "del") {
374
+      //删除
375
+      this.mainService
376
+        .simplePost("rmvData", "assetProduct", [this.coopData.id])
377
+        .subscribe((data) => {
378
+          this.btnLoading = false;
379
+          this.delModal = false;
380
+          if (data.status == 200) {
381
+            this.showPromptModal(this.tipsMsg2, true, "");
382
+          } else {
383
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
384
+          }
385
+        });
386
+    }
387
+  }
388
+}

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

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

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

@@ -568,6 +568,16 @@ const routes: Routes = [
568 568
         path: "tripartiteCompany",
569 569
         loadChildren: () => import("../tripartite-company/tripartite-company.module").then((m) => m.TripartiteCompanyModule),
570 570
       },
571
+      // 资产信息
572
+      {
573
+        path: "assetsInfo",
574
+        loadChildren: () => import("../assets-info/assets-info.module").then((m) => m.AssetsInfoModule),
575
+      },
576
+      // 产品管理
577
+      {
578
+        path: "assetsProductManagement",
579
+        loadChildren: () => import("../assets-product-management/assets-product-management.module").then((m) => m.AssetsProductManagementModule),
580
+      },
571 581
     ],
572 582
   },
573 583
 ];

+ 6 - 0
src/app/views/tripartite-company/tripartite-company.component.html

@@ -69,6 +69,12 @@
69 69
       <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
70 70
       <div class="content">
71 71
         <form nz-form [formGroup]="validateForm" class="addForm">
72
+          <nz-form-item *ngIf="!add">
73
+            <nz-form-label [nzSpan]="5" nzRequired>公司编号</nz-form-label>
74
+            <nz-form-control [nzSpan]="19">
75
+              {{coopData.code}}
76
+            </nz-form-control>
77
+          </nz-form-item>
72 78
           <nz-form-item>
73 79
             <nz-form-label [nzSpan]="5" nzRequired nzFor="name">公司全称</nz-form-label>
74 80
             <nz-form-control [nzSpan]="19" nzErrorTip="请输入公司全称!">

+ 0 - 14
src/app/views/tripartite-company/tripartite-company.component.ts

@@ -202,19 +202,6 @@ export class TripartiteCompanyComponent implements OnInit {
202 202
     this.validateForm.controls.companyTypeIds.setValue(this.companyTypeList.map(v => ({label: v.name, value: v.id, checked: data.companyTypeIds.includes(v.id)})));
203 203
     this.validateForm.controls.contacts.setValue(data.contacts);
204 204
     this.validateForm.controls.mphone.setValue(data.mphone);
205
-
206
-    if(data.deptId){
207
-      this.getDeparts('add', '', true);
208
-    }
209
-
210
-    if(data.buildId){
211
-      this.getBuildings('add', '', true);
212
-    }
213
-
214
-    if(data.floorId){
215
-      this.noChangeBuilding = true;
216
-      this.getFloors('add', '', data.buildId, true, true);
217
-    }
218 205
   }
219 206
 
220 207
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
@@ -227,7 +214,6 @@ export class TripartiteCompanyComponent implements OnInit {
227 214
       this.promptModalShow = true;
228 215
     }, 100);
229 216
     this.getList(0);
230
-    this.getTags('add', '');
231 217
   }
232 218
 
233 219
   delModal: boolean = false; //删除模态框