瀏覽代碼

转派,删除,延期处理,设置责任部门

seimin 7 月之前
父節點
當前提交
bc561da99b
共有 50 個文件被更改,包括 2562 次插入314 次删除
  1. 1 1
      proxy.conf.json
  2. 6 0
      src/app/components/configurationCenter/configuration-category/configuration-category.component.ts
  3. 3 1
      src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.ts
  4. 4 4
      src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.html
  5. 50 0
      src/app/components/incidentManagement/incident-detail/incident-detail.component.html
  6. 125 0
      src/app/components/incidentManagement/incident-detail/incident-detail.component.less
  7. 140 0
      src/app/components/incidentManagement/incident-detail/incident-detail.component.ts
  8. 20 0
      src/app/components/incidentManagement/incident-detail/incident-detail.module.ts
  9. 28 27
      src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.html
  10. 4 0
      src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.less
  11. 183 27
      src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.ts
  12. 45 41
      src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.html
  13. 4 0
      src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.less
  14. 266 26
      src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.ts
  15. 40 6
      src/app/components/incidentManagement/incident-handle-order/incident-handle-order.component.html
  16. 210 12
      src/app/components/incidentManagement/incident-handle-order/incident-handle-order.component.ts
  17. 5 4
      src/app/components/incidentManagement/incident-handle/incident-handle.component.html
  18. 185 16
      src/app/components/incidentManagement/incident-handle/incident-handle.component.ts
  19. 50 0
      src/app/components/incidentManagement/incident-postpone/incident-postpone.component.html
  20. 125 0
      src/app/components/incidentManagement/incident-postpone/incident-postpone.component.less
  21. 140 0
      src/app/components/incidentManagement/incident-postpone/incident-postpone.component.ts
  22. 20 0
      src/app/components/incidentManagement/incident-postpone/incident-postpone.module.ts
  23. 44 0
      src/app/components/incidentManagement/incident-setduty/incident-setduty.component.html
  24. 125 0
      src/app/components/incidentManagement/incident-setduty/incident-setduty.component.less
  25. 130 0
      src/app/components/incidentManagement/incident-setduty/incident-setduty.component.ts
  26. 20 0
      src/app/components/incidentManagement/incident-setduty/incident-setduty.module.ts
  27. 2 0
      src/app/components/incidentManagement/incident-substitutio-assign/incident-substitution-assign.component.ts
  28. 13 33
      src/app/components/incidentManagement/incident-substitutio-redeploy/incident-substitution-redeploy.component.html
  29. 8 61
      src/app/components/incidentManagement/incident-substitutio-redeploy/incident-substitution-redeploy.component.ts
  30. 1 1
      src/app/components/incidentManagement/incident-substitution/incident-substitution.component.html
  31. 42 1
      src/app/components/incidentManagement/incident-substitution/incident-substitution.component.ts
  32. 50 0
      src/app/components/incidentManagement/incident-visit/incident-visit.component.html
  33. 125 0
      src/app/components/incidentManagement/incident-visit/incident-visit.component.less
  34. 140 0
      src/app/components/incidentManagement/incident-visit/incident-visit.component.ts
  35. 20 0
      src/app/components/incidentManagement/incident-visit/incident-visit.module.ts
  36. 17 0
      src/app/services/main.service.ts
  37. 13 6
      src/app/services/tool.service.ts
  38. 2 0
      src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.ts
  39. 24 22
      src/app/share/wang-editor/wang-editor.component.ts
  40. 7 7
      src/app/views/admin-office-prescription/admin-office-prescription.component.ts
  41. 1 1
      src/app/views/building-floor/building-floor.component.ts
  42. 20 8
      src/app/views/incident-management/incident-management.component.html
  43. 86 4
      src/app/views/incident-management/incident-management.component.ts
  44. 8 0
      src/app/views/incident-management/incident-management.module.ts
  45. 2 0
      src/app/views/inspection-plan-config/inspection-plan-config.component.ts
  46. 1 1
      src/app/views/office-management/office-management.component.ts
  47. 1 1
      src/app/views/repository-manage-add/repository-manage-add.component.ts
  48. 2 2
      src/app/views/sys-config/sys-config.component.html
  49. 3 0
      src/app/views/sys-config/sys-config.component.ts
  50. 1 1
      src/app/views/users-management/users-management.component.ts

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-		"target": "http://192.168.3.108",
3
+		"target": "http://192.168.4.105",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 6 - 0
src/app/components/configurationCenter/configuration-category/configuration-category.component.ts

@@ -128,6 +128,7 @@ export class ConfigurationCategoryComponent implements OnInit {
128 128
   userList: any = [];
129 129
   getUsers(keyword = '', isShowValue = false) {
130 130
     if((!this.validateConfigForm.value.groupId && this.validateConfigForm.value.userGroup === 1) || this.validateConfigForm.value.userGroup === 2){
131
+      this.isLoading = false;
131 132
       this.userList = [];
132 133
       return;
133 134
     }
@@ -137,6 +138,8 @@ export class ConfigurationCategoryComponent implements OnInit {
137 138
         name: keyword,
138 139
         simpleQuery: true,
139 140
         groupdata: { id: this.validateConfigForm.value.groupId },
141
+        roleCodes: 'first-line support',
142
+        engineer: 1,
140 143
       },
141 144
       idx: 0,
142 145
       sum: 10,
@@ -158,6 +161,7 @@ export class ConfigurationCategoryComponent implements OnInit {
158 161
   groupList: any = []; //所有所属科室(搜索)
159 162
   getGroups(keyword = '', isShowValue = false) {
160 163
     if(!this.validateConfigForm.value.dutyId){
164
+      this.isLoading = false;
161 165
       this.groupList = [];
162 166
       return;
163 167
     }
@@ -300,10 +304,12 @@ export class ConfigurationCategoryComponent implements OnInit {
300 304
   dutyList: any = [];
301 305
   getHospitals(type:number, parentId?) {
302 306
     if(type === 1){
307
+      this.isLoading = false;
303 308
       this.hospitalList = this.tool.getHospitalList().filter(v => !v.parent);
304 309
       return;
305 310
     }
306 311
     if(type === 2 && !parentId){
312
+      this.isLoading = false;
307 313
       this.dutyList = [];
308 314
       return;
309 315
     }

+ 3 - 1
src/app/components/configurationCenter/configuration-deptUser/configuration-deptUser.component.ts

@@ -166,7 +166,9 @@ export class ConfigurationDeptUserComponent implements OnInit {
166 166
 			user: {
167 167
 				// name:name,
168 168
 				hospital: { id: this.hosId || "" },
169
-				groupdata:{id:groupId || ""}
169
+				groupdata:{id:groupId || ""},
170
+        roleCodes: 'first-line support',
171
+        engineer: 1,
170 172
 			},
171 173
 		};
172 174
 		this.mainService

+ 4 - 4
src/app/components/configurationCenter/configuration-manHour/configuration-manHour.component.html

@@ -4,7 +4,7 @@
4 4
     <div class="address">
5 5
       <div class="contentHead">工时大类
6 6
 				<div>
7
-					<button nz-button class="mar-rig-10 btn cancel" nzType="default" nzSize="small" *ngIf="activeCategory1.id" (click)="delCategoryModal(1)">删除</button>
7
+					<button nz-button class="mar-rig-10 btn cancel" nzType="default" nzSize="small" *ngIf="activeCategory1.id && categoryList1.length" (click)="delCategoryModal(1)">删除</button>
8 8
 					<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button>
9 9
 				</div>
10 10
 			</div>
@@ -45,7 +45,7 @@
45 45
 						</nz-input-group>
46 46
 				  </nz-form-control>
47 47
 				</nz-form-item>
48
-				
48
+
49 49
 				<nz-form-item>
50 50
 				  <nz-form-label [nzSpan]="5" nzRequired nzFor="workName">工时名称</nz-form-label>
51 51
 				  <nz-form-control [nzSpan]="19" nzErrorTip="请填写工时名称!">
@@ -80,7 +80,7 @@
80 80
           <nz-form-control [nzSpan]="19" nzErrorTip="请选择工时积分!">
81 81
             <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear formControlName="integral" nzPlaceHolder="请选择工时积分">
82 82
               <ng-container *ngFor="let option of scoreList">
83
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
83
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.value" [nzValue]="option.id"></nz-option>
84 84
               </ng-container>
85 85
               <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
86 86
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -103,6 +103,6 @@
103 103
 </app-prompt-modal>
104 104
 
105 105
 <!-- 删除模态框 -->
106
-<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" 
106
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
107 107
   (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" [content]="delContent" confirmTxt="是" cancelTxt="否">
108 108
 </app-dialog-delete>

+ 50 - 0
src/app/components/incidentManagement/incident-detail/incident-detail.component.html

@@ -0,0 +1,50 @@
1
+<div class="save display_flex justify-content_flex-center align-items_center add">
2
+  <div class="modalBody">
3
+    <div class="title">延期处理<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="content">
5
+      <form nz-form [formGroup]="validateForm" class="addForm">
6
+        <nz-form-item>
7
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="repairTypeId">延期原因</nz-form-label>
8
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期原因!">
9
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="repairTypeId" nzPlaceHolder="请选择延期原因" nzServerSearch>
10
+              <ng-container *ngFor="let data of repairTypeList">
11
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
12
+              </ng-container>
13
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
14
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
15
+              </nz-option>
16
+            </nz-select>
17
+          </nz-form-control>
18
+        </nz-form-item>
19
+        <nz-form-item>
20
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralDayId">延期天数</nz-form-label>
21
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期天数!">
22
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="deferralDayId" nzPlaceHolder="请选择延期天数" nzServerSearch>
23
+              <ng-container *ngFor="let data of deferralDayList">
24
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.text" [nzValue]="data.value"></nz-option>
25
+              </ng-container>
26
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
27
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
28
+              </nz-option>
29
+            </nz-select>
30
+          </nz-form-control>
31
+        </nz-form-item>
32
+        <nz-form-item>
33
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralRemark">延期说明</nz-form-label>
34
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入延期说明!">
35
+            <nz-input-group>
36
+              <textarea formControlName="deferralRemark" nz-input rows="3" placeholder="请输入延期说明"></textarea>
37
+            </nz-input-group>
38
+          </nz-form-control>
39
+        </nz-form-item>
40
+      </form>
41
+    </div>
42
+    <div class="display_flex justify-content_flex-center">
43
+      <button nz-button nzType="primary" (click)="submitForm()"[nzLoading]="isLoading">确认</button>
44
+      <button nz-button nzType="default" class="btn cancel" (click)="hideModal()">取消</button>
45
+    </div>
46
+  </div>
47
+</div>
48
+
49
+<!-- 遮罩 -->
50
+<app-mask *ngIf="maskFlag"></app-mask>

+ 125 - 0
src/app/components/incidentManagement/incident-detail/incident-detail.component.less

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

+ 140 - 0
src/app/components/incidentManagement/incident-detail/incident-detail.component.ts

@@ -0,0 +1,140 @@
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
2
+import { MainService } from '../../../services/main.service';
3
+import { Router, ActivatedRoute } from '@angular/router';
4
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
8
+
9
+@Component({
10
+  selector: 'app-incident-detail',
11
+  templateUrl: './incident-detail.component.html',
12
+  styleUrls: ['./incident-detail.component.less']
13
+})
14
+export class IncidentDetailComponent implements OnInit {
15
+  @ViewChild("osComponentRef1", {
16
+    read: OverlayScrollbarsComponent,
17
+    static: false,
18
+  })
19
+  osComponentRef1: OverlayScrollbarsComponent;
20
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
21
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  @Input() id: any;
24
+
25
+  constructor(
26
+    private mainService: MainService,
27
+    private router: Router,
28
+    private route: ActivatedRoute,
29
+    private message: NzMessageService,
30
+    private tool: ToolService,
31
+    private fb: FormBuilder,
32
+  ) { }
33
+
34
+  isLoading = false;
35
+
36
+  ngOnInit() {
37
+    this.initForm();
38
+    this.getDetail();
39
+    this.getRepairTypeList();
40
+    this.getDeferralDayList();
41
+  }
42
+
43
+  // 初始化新增form表单
44
+  validateForm: FormGroup; //新增/编辑表单
45
+  initForm() {
46
+    this.validateForm = this.fb.group({
47
+      repairTypeId: [null, [Validators.required]],//延期原因
48
+      deferralDayId: [null, [Validators.required]],//延期天数
49
+      deferralRemark: [null, [Validators.required]],//延期说明
50
+    });
51
+    console.log(this.validateForm.controls)
52
+  }
53
+
54
+  // 获取延期原因
55
+  repairTypeList: any = [];
56
+  getRepairTypeList() {
57
+    this.mainService
58
+    .getDictionary('list', 'repair_type')
59
+    .subscribe((data) => {
60
+      this.repairTypeList = data || [];
61
+    });
62
+  }
63
+
64
+  // 获取延期天数
65
+  deferralDayList: any = [];
66
+  getDeferralDayList() {
67
+    this.deferralDayList = this.tool.generateNumberArray(1, 15).map(v => ({
68
+      text: v + '天',
69
+      value: v,
70
+    }));
71
+		this.deferralDayList.unshift({
72
+			text: '0.5天',
73
+			value: 0.5,
74
+		})
75
+  }
76
+
77
+  // 操作权限
78
+  incidentData:any = {};
79
+  getDetail(){
80
+    this.maskFlag = this.message.loading("正在加载中..", {
81
+      nzDuration: 0,
82
+    }).messageId;
83
+    this.mainService
84
+      .getFetchData("simple/data", "incident", this.id)
85
+      .subscribe((result) => {
86
+        this.message.remove(this.maskFlag);
87
+        this.maskFlag = false;
88
+        this.incidentData = result.data || {};
89
+      });
90
+  }
91
+
92
+  // 关闭弹窗
93
+  hideModal() {
94
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
95
+  }
96
+
97
+  // 表单提交
98
+  maskFlag:any = false;
99
+  submitForm(): void {
100
+    for (const i in this.validateForm.controls) {
101
+      this.validateForm.controls[i].markAsDirty();
102
+      this.validateForm.controls[i].updateValueAndValidity();
103
+    }
104
+    if (this.validateForm.invalid) {
105
+      return;
106
+    }
107
+
108
+    this.maskFlag = this.message.loading("正在加载中..", {
109
+      nzDuration: 0,
110
+    }).messageId;
111
+
112
+    let postData = {
113
+      incident: this.incidentData,
114
+    }
115
+
116
+    postData.incident.currentLog = {
117
+      remark: this.validateForm.value.deferralRemark,
118
+      extra1: this.validateForm.value.repairTypeId,
119
+      extra2: this.validateForm.value.deferralDayId,
120
+    }
121
+
122
+    this.mainService
123
+    .flowPost("incident/task/overtime", postData)
124
+    .subscribe((result) => {
125
+      this.message.remove(this.maskFlag);
126
+      this.maskFlag = false;
127
+      this.confirmModelHs.emit();
128
+
129
+      if (result.state == 200) {
130
+        this.message.success('操作成功');
131
+      } else {
132
+        this.message.error('操作失败');
133
+      }
134
+    });
135
+  }
136
+}
137
+
138
+
139
+
140
+

+ 20 - 0
src/app/components/incidentManagement/incident-detail/incident-detail.module.ts

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

+ 28 - 27
src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.html

@@ -3,10 +3,8 @@
3 3
     <div class="formItem">
4 4
       <div class="name"><i class="icon_transport transport-required red"></i>处理方式:</div>
5 5
       <div class="value w100">
6
-        <nz-select class="w100" [(ngModel)]="selectedValue" nzAllowClear nzPlaceHolder="请选择处理方式">
7
-          <nz-option nzValue="jack" nzLabel="Jack"></nz-option>
8
-          <nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
9
-          <nz-option nzValue="disabled" nzLabel="Disabled" nzDisabled></nz-option>
6
+        <nz-select class="w100" [(ngModel)]="incidentDataCopy.handleCategory" nzAllowClear nzPlaceHolder="请选择处理方式">
7
+          <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of handleCategoryList"></nz-option>
10 8
         </nz-select>
11 9
       </div>
12 10
     </div>
@@ -16,10 +14,14 @@
16 14
     <div class="formItem">
17 15
       <div class="name"><i class="icon_transport transport-required red" style="visibility: hidden;"></i>协同人员:</div>
18 16
       <div class="value w100">
19
-        <nz-select class="w100" [(ngModel)]="selectedValue" nzAllowClear nzPlaceHolder="请选择协同人员">
20
-          <nz-option nzValue="jack" nzLabel="Jack"></nz-option>
21
-          <nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
22
-          <nz-option nzValue="disabled" nzLabel="Disabled" nzDisabled></nz-option>
17
+        <nz-select class="w100" nzMode="multiple" [(ngModel)]="incidentDataCopy.synergetic" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
18
+        (nzOnSearch)="changeInp('synergetic', $event)" nzAllowClear  nzPlaceHolder="请选择协同人员">
19
+          <ng-container *ngFor="let option of synergeticList">
20
+            <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
21
+          </ng-container>
22
+          <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
23
+            <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
24
+          </nz-option>
23 25
         </nz-select>
24 26
       </div>
25 27
     </div>
@@ -28,32 +30,31 @@
28 30
   <div class="formItem">
29 31
     <div class="name"><i class="icon_transport transport-required red" style="visibility: hidden;"></i>关联资产:</div>
30 32
     <div class="value w100">
31
-      <nz-select class="w100" [(ngModel)]="selectedValue" nzAllowClear nzPlaceHolder="请选择关联资产">
32
-        <nz-option nzValue="jack" nzLabel="Jack"></nz-option>
33
-        <nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
34
-        <nz-option nzValue="disabled" nzLabel="Disabled" nzDisabled></nz-option>
35
-      </nz-select>
33
+      <nz-select class="w100" [(ngModel)]="incidentDataCopy.assetId" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
34
+        (nzOnSearch)="changeInp('assetId', $event)" nzAllowClear  nzPlaceHolder="请选择关联资产">
35
+          <ng-container *ngFor="let option of assetProducList">
36
+            <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
37
+          </ng-container>
38
+          <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
39
+            <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
40
+          </nz-option>
41
+        </nz-select>
36 42
     </div>
37 43
   </div>
38 44
 
39 45
   <div class="formItem">
40 46
     <div class="name"><i class="icon_transport transport-required red" style="visibility: hidden;"></i>处理图片:</div>
41 47
     <div class="value w100 upload">
42
-      <nz-upload
43
-        nzAction="https://jsonplaceholder.typicode.com/posts/"
44
-        nzName="avatar"
45
-        nzListType="picture-card"
46
-        [nzShowUploadList]="false"
47
-        [nzBeforeUpload]="beforeUpload"
48
-        (nzChange)="handleChange($event)"
49
-      >
50
-        <ng-container *ngIf="!avatarUrl">
51
-          <i class="upload-icon" nz-icon [nzType]="loading ? 'loading' : 'plus'"></i>
52
-          <div class="ant-upload-text">上传图片</div>
53
-        </ng-container>
54
-        <img *ngIf="avatarUrl" [src]="avatarUrl" class="avatar" />
48
+      <nz-upload nzListType="picture-card" [(nzFileList)]="fileList" [nzShowUploadList]="showUploadList" [nzPreview]="handlePreview" nzFileType="image/jpeg,image/png" nzAccept="image/jpeg,image/png" [nzShowButton]="fileList.length < 3" [nzBeforeUpload]="beforeUpload" [nzAction]="temporarilyUrl" [nzSize]="10240">
49
+        <i nz-icon nzType="plus"></i>
50
+        <div class="ant-upload-text">上传照片</div>
55 51
       </nz-upload>
56
-      <div class="tips">只支持jpg,png 格式</div>
52
+      <nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false">
53
+        <ng-template #modalContent>
54
+          <img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
55
+        </ng-template>
56
+      </nz-modal>
57
+      <div class="tips">(支持JPG/PNG格式图片,单张大小10M以内)</div>
57 58
     </div>
58 59
   </div>
59 60
 </div>

+ 4 - 0
src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.less

@@ -2,6 +2,10 @@
2 2
 :host{
3 3
   display: inline-block;
4 4
   width: 100%;
5
+  .anticon-plus{
6
+    font-size: 32px;
7
+    margin-bottom: 8px;
8
+  }
5 9
   .incident_handle_info{
6 10
     padding: 16px;
7 11
     .row{

+ 183 - 27
src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.ts

@@ -1,15 +1,20 @@
1
-import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild, OnChanges, SimpleChanges } from '@angular/core';
2 2
 import { MainService } from '../../../services/main.service';
3 3
 import { Router } from '@angular/router';
4
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5 4
 import { ToolService } from 'src/app/services/tool.service';
5
+import { NzMessageService, UploadFile, UploadXHRArgs } from 'ng-zorro-antd';
6
+import cloneDeep from 'lodash-es/cloneDeep'
7
+import { debounceTime } from 'rxjs/operators';
8
+import { Subject } from 'rxjs';
9
+import { HttpClient, HttpEvent, HttpResponse, HttpEventType, HttpRequest } from '@angular/common/http';
6 10
 
7 11
 @Component({
8 12
   selector: 'app-incident-handle-info-simple',
9 13
   templateUrl: './incident-handle-info-simple.component.html',
10 14
   styleUrls: ['./incident-handle-info-simple.component.less']
11 15
 })
12
-export class IncidentHandleInfoSimpleComponent implements OnInit {
16
+export class IncidentHandleInfoSimpleComponent implements OnInit, OnChanges {
17
+  @Input() incidentData:any = {};
13 18
   @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
14 19
   @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
15 20
 
@@ -17,42 +22,193 @@ export class IncidentHandleInfoSimpleComponent implements OnInit {
17 22
     private mainService: MainService,
18 23
     private router: Router,
19 24
     public tool: ToolService,
25
+    private message: NzMessageService,
26
+    private http: HttpClient,
20 27
   ) { }
21 28
 
22
-  isLoading = false;
23
-  formDTO:any =  {};
29
+  incidentDataCopy:any =  {};
30
+
31
+  changeInpSubject = new Subject(); //防抖
32
+
33
+  ngOnChanges(changes: SimpleChanges){
34
+    console.log('changes:', changes)
35
+
36
+    // 初始化
37
+    if(changes.incidentData && !changes.incidentData.firstChange && changes.incidentData.currentValue && changes.incidentData.previousValue && !changes.incidentData.previousValue.id){
38
+      this.init();
39
+    }
40
+
41
+    if(changes.incidentData && changes.incidentData.firstChange && changes.incidentData.currentValue && !changes.incidentData.previousValue){
42
+      this.init();
43
+    }
44
+  }
24 45
 
25 46
   ngOnInit() {
26
-    this.getOrders();
47
+    //防抖
48
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
49
+      if(v[0] === 'synergetic'){
50
+        this.getSynergeticList(v[1]);
51
+      }else if(v[0] === 'assetId'){
52
+        this.getAssetProductList(v[1]);
53
+      }
54
+    });
27 55
   }
56
+
57
+  init(){
58
+    console.log('初始化')
59
+    this.hosId = this.tool.getCurrentHospital().id;
60
+    this.incidentDataCopy = cloneDeep(this.incidentData);
61
+    if(Array.isArray(this.incidentDataCopy.synergetic)){
62
+      this.incidentDataCopy.synergetic = this.incidentDataCopy.synergetic.map(v => v.id);
63
+    }else{
64
+      this.incidentDataCopy.synergetic = [];
65
+    }
66
+    this.getHandleCategorys();
67
+    this.getSynergeticList();
68
+    this.getAssetProductList();
69
+  }
70
+
71
+  // 边输边搜节流阀
72
+  changeInp(model, e) {
73
+    this.isLoading = true;
74
+    this.changeInpSubject.next([model, e]);
75
+  }
76
+
28 77
   // 关闭弹窗
29 78
   hideModal() {
30 79
     this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
31 80
   }
32
-  // 获取列表数据
33
-  getOrders(idx?) {
34
-    // if (idx) {
35
-    //   this.historySpecimenPageIndex = 1;
36
-    // }
37
-    // let postData = {
38
-    //   idx: this.historySpecimenPageIndex - 1,
39
-    //   sum: this.historySpecimenPageSize,
40
-    //   workOrder: {
41
-    //     hosId: JSON.parse(localStorage.getItem("user")).user.currentHospital.id,
42
-    //     gdState: {id: "72"},
43
-    //     taskType: {associationType: {id: 256}},
44
-    //   }
45
-    // }
46
-    // this.mainService.getFetchDataList('data','workOrder',postData).subscribe(data => {
47
-    //   this.historySpecimenList = data.list || [];
48
-    //   this.historySpecimenListLength = data.totalNum || 0;
49
-    // })
81
+
82
+  // 获取处理方式列表
83
+  handleCategoryList:any[] = [];
84
+  getHandleCategorys(){
85
+    this.mainService.getDictionary("list", "incident_handleCategory").subscribe((data) => {
86
+      this.handleCategoryList = data || [];
87
+      console.log(this.incidentDataCopy)
88
+      if(!this.incidentDataCopy.handleCategory){
89
+        let handleCategory = this.handleCategoryList.find(v => v.value == 'SUPPORT');
90
+        this.incidentDataCopy.handleCategory = handleCategory ? handleCategory.id : undefined;
91
+      }
92
+    });
93
+  }
94
+
95
+  // 获取协同人员
96
+  hosId:any;
97
+  isLoading = false;
98
+  synergeticList: any = [];
99
+  getSynergeticList(keyword = '') {
100
+    let postData = {
101
+      user: {
102
+        hospital: { id: this.hosId },
103
+        name: keyword,
104
+        simpleQuery: true,
105
+        roleCodes: 'first-line support',
106
+        engineer: 1,
107
+      },
108
+      idx: 0,
109
+      sum: 20,
110
+    };
111
+    this.mainService
112
+      .getFetchDataList("simple/data", "user", postData)
113
+      .subscribe((data) => {
114
+        this.synergeticList = data.list;
115
+        this.isLoading = false;
116
+      });
117
+  }
118
+
119
+  // 获取资产列表
120
+  assetProducList: any = [];
121
+  getAssetProductList(keyword = '') {
122
+    let postData = {
123
+      assetProduct: {
124
+        hosId: this.hosId,
125
+        name: keyword,
126
+      },
127
+      idx: 0,
128
+      sum: 20,
129
+    };
130
+    this.mainService
131
+      .getFetchDataList("simple/data", "assetProduct", postData)
132
+      .subscribe((data) => {
133
+        this.assetProducList = data.list;
134
+      });
50 135
   }
51 136
 
52
-  // 表单提交
53
-  submitForm(): void {
54
-    this.confirmModelHs.emit();
137
+  // 图片相关
138
+  showUploadList = {
139
+    showPreviewIcon: true,
140
+    showRemoveIcon: true,
141
+    hidePreviewIconInNonImage: true
142
+  };
143
+  fileList = [
144
+    // {
145
+    //   uid: -1,
146
+    //   name: 'xxx.png',
147
+    //   status: '1',
148
+    //   url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
149
+    // }
150
+  ];
151
+  previewImage: string | undefined = '';
152
+  previewVisible = false;
153
+
154
+  handlePreview = (file: UploadFile) => {
155
+  	console.log('file1:', file)
156
+    this.previewImage = file.url || file.thumbUrl;
157
+    this.previewVisible = true;
158
+  };
159
+
160
+  beforeUpload = (file: UploadFile): boolean => {
161
+  	console.log('file2:', file)
162
+    this.fileList = [...this.fileList, file];
163
+    setTimeout(async () => {
164
+      file.url = await this.getBase64(file);
165
+    }, 0);
166
+    console.log('this.fileList:', this.fileList)
167
+    return true;
168
+  };
169
+
170
+  // customReq = (item: UploadXHRArgs) => {
171
+  //   console.log(item);
172
+  //   // Create a FormData here to store files and other parameters.
173
+  //   const formData = new FormData();
174
+  //   // tslint:disable-next-line:no-any
175
+  //   formData.append('file', item.file as any);
176
+  //   formData.append('filename', item.file.name);
177
+  //   const req = new HttpRequest('POST', item.action!, formData, {
178
+  //     reportProgress: true,
179
+  //     withCredentials: true
180
+  //   });
181
+  //   // Always returns a `Subscription` object. nz-upload would automatically unsubscribe it at correct time.
182
+  //   return this.http.request(req).subscribe(
183
+  //     // tslint:disable-next-line no-any
184
+  //     (event: HttpEvent<any>) => {
185
+  //       if (event.type === HttpEventType.UploadProgress) {
186
+  //         if (event.total! > 0) {
187
+  //           // tslint:disable-next-line:no-any
188
+  //           (event as any).percent = (event.loaded / event.total!) * 100;
189
+  //         }
190
+  //         item.onProgress!(event, item.file!);
191
+  //       } else if (event instanceof HttpResponse) {
192
+  //         item.onSuccess!(event.body, item.file!, event);
193
+  //       }
194
+  //     },
195
+  //     err => {
196
+  //       item.onError!(err, item.file!);
197
+  //     }
198
+  //   );
199
+  // };
200
+
201
+  getBase64(file: any): Promise<any> {
202
+    return new Promise((resolve, reject) => {
203
+      const reader = new FileReader();
204
+      reader.readAsDataURL(file);
205
+      reader.onload = () => resolve(reader.result);
206
+      reader.onerror = error => reject(error);
207
+    });
55 208
   }
209
+
210
+  // 临时上传图片
211
+  temporarilyUrl = this.mainService.returnUploadUrl('temporarily', 0);
56 212
 }
57 213
 
58 214
 

文件差異過大導致無法顯示
+ 45 - 41
src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.html


+ 4 - 0
src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.less

@@ -2,6 +2,10 @@
2 2
 :host{
3 3
   display: inline-block;
4 4
   width: 100%;
5
+  .anticon-plus{
6
+    font-size: 32px;
7
+    margin-bottom: 8px;
8
+  }
5 9
   .incident_handle_info{
6 10
     padding: 16px;
7 11
     .row{

+ 266 - 26
src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.ts

@@ -1,58 +1,298 @@
1
-import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild, OnChanges, SimpleChanges } from '@angular/core';
2 2
 import { MainService } from '../../../services/main.service';
3 3
 import { Router } from '@angular/router';
4
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5 4
 import { ToolService } from 'src/app/services/tool.service';
5
+import { UploadFile } from 'ng-zorro-antd';
6
+import { Subject } from 'rxjs';
7
+import { debounceTime } from 'rxjs/operators';
8
+import cloneDeep from 'lodash-es/cloneDeep'
9
+import { HttpClient } from '@angular/common/http';
6 10
 
7 11
 @Component({
8 12
   selector: 'app-incident-handle-info',
9 13
   templateUrl: './incident-handle-info.component.html',
10 14
   styleUrls: ['./incident-handle-info.component.less']
11 15
 })
12
-export class IncidentHandleInfoComponent implements OnInit {
16
+export class IncidentHandleInfoComponent implements OnInit, OnChanges {
17
+  @Input() incidentData:any = {};
13 18
   @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
14 19
   @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
20
+  @Output() changeCategoryHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
15 21
 
16 22
   constructor(
17 23
     private mainService: MainService,
18 24
     private router: Router,
19 25
     public tool: ToolService,
26
+    private http: HttpClient,
20 27
   ) { }
21 28
 
22
-  isLoading = false;
23
-  formDTO:any =  {};
29
+  incidentDataCopy:any =  {};
30
+
31
+  changeInpSubject = new Subject(); //防抖
32
+
33
+  ngOnChanges(changes: SimpleChanges){
34
+    console.log('changes:', changes)
35
+    // 引入知识库
36
+    if(changes.incidentData && !changes.incidentData.firstChange && changes.incidentData.currentValue){
37
+      this.incidentDataCopy.handleDescription = changes.incidentData.currentValue.handleDescription;
38
+    }
39
+
40
+    // 初始化
41
+    if(changes.incidentData && !changes.incidentData.firstChange && changes.incidentData.currentValue && changes.incidentData.previousValue && !changes.incidentData.previousValue.id){
42
+      this.init();
43
+    }
44
+
45
+    if(changes.incidentData && changes.incidentData.firstChange && changes.incidentData.currentValue && !changes.incidentData.previousValue){
46
+      this.init();
47
+    }
48
+  }
24 49
 
25 50
   ngOnInit() {
26
-    this.getOrders();
51
+    console.log('ngOnInit')
52
+    //防抖
53
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
54
+      if(v[0] === 'synergetic'){
55
+        this.getSynergeticList(v[1]);
56
+      }else if(v[0] === 'assetId'){
57
+        this.getAssetProductList(v[1]);
58
+      }else if(v[0] === 'category'){
59
+        this.getIncidentCategoryList(v[1]);
60
+      }
61
+    });
62
+  }
63
+
64
+  init(){
65
+    console.log('初始化')
66
+    this.hosId = this.tool.getCurrentHospital().id;
67
+    console.log('this.incidentData:', this.incidentData)
68
+    this.incidentDataCopy = cloneDeep(this.incidentData);
69
+    if(Array.isArray(this.incidentDataCopy.synergetic)){
70
+      this.incidentDataCopy.synergetic = this.incidentDataCopy.synergetic.map(v => v.id);
71
+    }else{
72
+      this.incidentDataCopy.synergetic = [];
73
+    }
74
+    if(this.incidentDataCopy.category){
75
+      this.incidentDataCopy.category = this.incidentDataCopy.category.id;
76
+    }
77
+    if(this.incidentDataCopy.transSolution === undefined){
78
+      this.incidentDataCopy.transSolution = 0;
79
+    }
80
+    console.log('this.incidentDataCopy:', this.incidentDataCopy)
81
+    this.getHandleCategorys();
82
+    this.getClosecodes();
83
+    this.getSynergeticList();
84
+    this.getAssetProductList();
85
+    this.getIncidentCategoryList();
27 86
   }
87
+
88
+  // 修改故障现象
89
+  changeCategory(id){
90
+    this.changeCategoryHs.emit(id);
91
+  }
92
+
93
+  // 边输边搜节流阀
94
+  changeInp(model, e) {
95
+    this.isLoading = true;
96
+    this.changeInpSubject.next([model, e]);
97
+  }
98
+
28 99
   // 关闭弹窗
29 100
   hideModal() {
30 101
     this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
31 102
   }
32
-  // 获取列表数据
33
-  getOrders(idx?) {
34
-    // if (idx) {
35
-    //   this.historySpecimenPageIndex = 1;
36
-    // }
37
-    // let postData = {
38
-    //   idx: this.historySpecimenPageIndex - 1,
39
-    //   sum: this.historySpecimenPageSize,
40
-    //   workOrder: {
41
-    //     hosId: JSON.parse(localStorage.getItem("user")).user.currentHospital.id,
42
-    //     gdState: {id: "72"},
43
-    //     taskType: {associationType: {id: 256}},
44
-    //   }
103
+
104
+  // 获取处理方式列表
105
+  handleCategoryList:any[] = [];
106
+  getHandleCategorys(){
107
+    this.mainService.getDictionary("list", "incident_handle_type").subscribe((data) => {
108
+      this.handleCategoryList = data || [];
109
+      console.log(this.incidentDataCopy)
110
+      if(!this.incidentDataCopy.handleCategory){
111
+        let handleCategory = this.handleCategoryList.find(v => v.value == '1');
112
+        this.incidentDataCopy.handleCategory = handleCategory ? handleCategory.id : undefined;
113
+      }
114
+    });
115
+  }
116
+
117
+  // 获取处理结果列表
118
+  closecodeList:any[] = [];
119
+  getClosecodes(){
120
+    this.mainService.getDictionary("list", "incident_closecode").subscribe((data) => {
121
+      this.closecodeList = data || [];
122
+      console.log(this.incidentDataCopy)
123
+      if(!this.incidentDataCopy.closecode){
124
+        let closecode = this.closecodeList.find(v => v.value == '1');
125
+        this.incidentDataCopy.closecode = closecode ? closecode.id : undefined;
126
+      }
127
+    });
128
+  }
129
+
130
+  // 获取协同人员
131
+  hosId:any;
132
+  isLoading = false;
133
+  synergeticList: any = [];
134
+  getSynergeticList(keyword = '') {
135
+    let postData = {
136
+      user: {
137
+        hospital: { id: this.hosId },
138
+        name: keyword,
139
+        simpleQuery: true,
140
+        roleCodes: 'first-line support',
141
+        engineer: 1,
142
+      },
143
+      idx: 0,
144
+      sum: 20,
145
+    };
146
+    this.mainService
147
+      .getFetchDataList("simple/data", "user", postData)
148
+      .subscribe((data) => {
149
+        this.synergeticList = data.list;
150
+        this.isLoading = false;
151
+      });
152
+  }
153
+
154
+  // 获取故障现象
155
+  incidentCategoryList:any[] = [];
156
+  handleInfoLoading:boolean = false;
157
+  getIncidentCategoryList(keyword = ''){
158
+    let { hospital, type } = this.tool.getHospitalOrDuty();
159
+    if(type === 'hospital' || type === 'department'){
160
+      this.incidentCategoryList = [];
161
+      this.incidentDataCopy.category = null;
162
+      return;
163
+    };
164
+    let postData = {
165
+      category: {
166
+        category: keyword,
167
+        selectType: 'mutlQuery',
168
+        hierarchy: 3,
169
+        dutyIds: type === 'duty' ? hospital.id.toString()  : undefined,
170
+      },
171
+    };
172
+    this.handleInfoLoading = true;
173
+    this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
174
+      this.handleInfoLoading = false;
175
+      this.incidentCategoryList = res.data || [];
176
+      if(this.incidentDataCopy.category){
177
+        let obj = this.incidentCategoryList.find(v => v.id == this.incidentDataCopy.category);
178
+        this.incidentDataCopy.category = obj ? obj.id : undefined;
179
+        this.changeCategoryHs.emit(this.incidentDataCopy.category);
180
+      }
181
+    })
182
+  }
183
+
184
+  // 获取资产列表
185
+  assetProducList: any = [];
186
+  getAssetProductList(keyword = '') {
187
+    let postData = {
188
+      assetProduct: {
189
+        hosId: this.hosId,
190
+        name: keyword,
191
+      },
192
+      idx: 0,
193
+      sum: 20,
194
+    };
195
+    this.mainService
196
+      .getFetchDataList("simple/data", "assetProduct", postData)
197
+      .subscribe((data) => {
198
+        this.assetProducList = data.list;
199
+      });
200
+  }
201
+
202
+  // 图片相关
203
+  showUploadList = {
204
+    showPreviewIcon: true,
205
+    showRemoveIcon: true,
206
+    hidePreviewIconInNonImage: true
207
+  };
208
+  fileList = [
209
+    // {
210
+    //   uid: -1,
211
+    //   name: 'xxx.png',
212
+    //   status: '1',
213
+    //   url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
45 214
     // }
46
-    // this.mainService.getFetchDataList('data','workOrder',postData).subscribe(data => {
47
-    //   this.historySpecimenList = data.list || [];
48
-    //   this.historySpecimenListLength = data.totalNum || 0;
49
-    // })
215
+  ];
216
+  previewImage: string | undefined = '';
217
+  previewVisible = false;
218
+
219
+  handlePreview = (file: UploadFile) => {
220
+  	console.log('file1:', file)
221
+    this.previewImage = file.url || file.thumbUrl;
222
+    this.previewVisible = true;
223
+  };
224
+
225
+  beforeUpload = (file: UploadFile): boolean => {
226
+  	console.log('file2:', file)
227
+    this.fileList = [...this.fileList, file];
228
+    setTimeout(async () => {
229
+      file.url = await this.getBase64(file);
230
+    }, 0);
231
+    console.log('this.fileList:', this.fileList)
232
+    return true;
233
+  };
234
+
235
+  // customReq = (item: UploadXHRArgs) => {
236
+  //   console.log(item);
237
+  //   // Create a FormData here to store files and other parameters.
238
+  //   const formData = new FormData();
239
+  //   // tslint:disable-next-line:no-any
240
+  //   formData.append('file', item.file as any);
241
+  //   formData.append('filename', item.file.name);
242
+  //   const req = new HttpRequest('POST', item.action!, formData, {
243
+  //     reportProgress: true,
244
+  //     withCredentials: true
245
+  //   });
246
+  //   // Always returns a `Subscription` object. nz-upload would automatically unsubscribe it at correct time.
247
+  //   return this.http.request(req).subscribe(
248
+  //     // tslint:disable-next-line no-any
249
+  //     (event: HttpEvent<any>) => {
250
+  //       if (event.type === HttpEventType.UploadProgress) {
251
+  //         if (event.total! > 0) {
252
+  //           // tslint:disable-next-line:no-any
253
+  //           (event as any).percent = (event.loaded / event.total!) * 100;
254
+  //         }
255
+  //         item.onProgress!(event, item.file!);
256
+  //       } else if (event instanceof HttpResponse) {
257
+  //         item.onSuccess!(event.body, item.file!, event);
258
+  //       }
259
+  //     },
260
+  //     err => {
261
+  //       item.onError!(err, item.file!);
262
+  //     }
263
+  //   );
264
+  // };
265
+
266
+  getBase64(file: any): Promise<any> {
267
+    return new Promise((resolve, reject) => {
268
+      const reader = new FileReader();
269
+      reader.readAsDataURL(file);
270
+      reader.onload = () => resolve(reader.result);
271
+      reader.onerror = error => reject(error);
272
+    });
50 273
   }
51 274
 
52
-  // 表单提交
53
-  submitForm(): void {
54
-    this.confirmModelHs.emit();
275
+  // 临时上传图片
276
+  temporarilyUrl = this.mainService.returnUploadUrl('temporarily', 0);
277
+
278
+  // 上传附件---start
279
+  // model-取消
280
+  maskFlag:boolean = false;
281
+  isShow = false;
282
+  hideExcelImport() {
283
+    this.isShow = false;
284
+  }
285
+  // 触发
286
+  excelImport() {
287
+    this.isShow = true;
55 288
   }
289
+  submitExcelImport({fileList}){
290
+    this.isShow = false;
291
+    console.log(fileList);
292
+  }
293
+  // 上传附件---end
294
+  fileList2:any[] = [];
295
+
56 296
 }
57 297
 
58 298
 

+ 40 - 6
src/app/components/incidentManagement/incident-handle-order/incident-handle-order.component.html

@@ -19,7 +19,7 @@
19 19
               <span>X{{ item.consumablesNum }}{{ item.consumablesUnit }}</span>
20 20
               <span class="unitPrice">总价:{{item.consumablesNum * item.consumableEndPrice}}元</span>
21 21
             </div>
22
-            <button nz-button class="btn default ml8" (click)="delConsumable(item)">删除</button>
22
+            <button nz-button class="btn default ml8" (click)="showDelModal(item,'您确认要删除吗?','删除','delConsumable')">删除</button>
23 23
           </div>
24 24
         </div>
25 25
       </div>
@@ -33,12 +33,12 @@
33 33
   <div class="orderList manHour">
34 34
     <div class="title">工时清单</div>
35 35
     <ng-container *ngIf="summaryObj.workHourManagementList.length">
36
-      <div class="orderItem" *ngFor="let item of summaryObj.workHourManagementList" (click)="numberClick(item, 'editWorkHourManagement')">
36
+      <div class="orderItem" *ngFor="let item of summaryObj.workHourManagementList">
37 37
         <div class="row">
38 38
           <div class="name">{{ item.workName }}</div>
39 39
           <div class="value">
40 40
             <span class="unitPrice">单价:{{ item.wage }}元</span>
41
-            <button nz-button class="btn default ml8" (click)="numberClick(item, 'editWorkHourManagement')">编辑</button>
41
+            <button nz-button class="btn default ml8" (click)="editWorkHourManagement(item)">编辑</button>
42 42
           </div>
43 43
         </div>
44 44
 
@@ -49,7 +49,7 @@
49 49
               <span>X{{ item.workHourNum2 }}{{ item.workUnit }}</span>
50 50
               <span class="unitPrice">总价:{{item.workHourNum2 * item.wage}}元</span>
51 51
             </div>
52
-            <button nz-button class="btn default ml8" (click)="numberClick(item, 'delWorkHourManagement')">删除</button>
52
+            <button nz-button class="btn default ml8" (click)="showDelModal(item,'您确认要删除吗?','删除','delWorkHourManagement')">删除</button>
53 53
           </div>
54 54
         </div>
55 55
       </div>
@@ -68,11 +68,10 @@
68 68
     <div class="title">{{modelName}}耗材<i class="icon_transport transport-guanbi" (click)="hideConsumableModal()"></i></div>
69 69
     <div class="content">
70 70
       <form nz-form [formGroup]="validateConsumableForm" class="addForm">
71
-
72 71
         <nz-form-item>
73 72
           <nz-form-label [nzSpan]="6" nzRequired nzFor="consumablesId">耗&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;材</nz-form-label>
74 73
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择耗材!">
75
-            <nz-select (nzOnSearch)="changeInp('consumable', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="consumablesId" nzPlaceHolder="请选择耗材">
74
+            <nz-select *ngIf="add" (nzOnSearch)="changeInp('consumable', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="consumablesId" nzPlaceHolder="请选择耗材">
76 75
               <ng-container *ngFor="let option of consumableList">
77 76
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
78 77
               </ng-container>
@@ -80,6 +79,7 @@
80 79
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
81 80
               </nz-option>
82 81
             </nz-select>
82
+            <span *ngIf="!add">{{coopData.consumableName}} ({{coopData.consumableBrandModel}}) {{coopData.consumableEndPrice}}元</span>
83 83
           </nz-form-control>
84 84
         </nz-form-item>
85 85
         <nz-form-item>
@@ -99,7 +99,41 @@
99 99
   </div>
100 100
 </div>
101 101
 
102
+<!-- 新增/编辑工时模态框 -->
103
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalWorkHourManagement">
104
+  <div class="modalBody">
105
+    <div class="title">{{modelName}}工时<i class="icon_transport transport-guanbi" (click)="hideWorkHourManagementModal()"></i></div>
106
+    <div class="content">
107
+      <form nz-form [formGroup]="validateWorkHourManagementForm" class="addForm">
108
+        <nz-form-item>
109
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="workHourId">工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;时</nz-form-label>
110
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择工时!">
111
+            <nz-cascader *ngIf="add" [nzOptions]="workHourManagementList" formControlName="workHourId" nzPlaceHolder="请选择工时"></nz-cascader>
112
+            <span *ngIf="!add">{{coopData.workName}} {{coopData.wage}}元</span>
113
+          </nz-form-control>
114
+        </nz-form-item>
115
+        <nz-form-item>
116
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="workHourNum">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</nz-form-label>
117
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入数量!">
118
+            <nz-input-group>
119
+              <nz-input-number class="w100" formControlName="workHourNum" nzPlaceHolder="请输入数量" [nzMin]="1" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
120
+            </nz-input-group>
121
+          </nz-form-control>
122
+        </nz-form-item>
123
+      </form>
124
+    </div>
125
+    <div class=" display_flex justify-content_flex-center">
126
+      <button nzType="primary" nz-button (click)="submitWorkHourManagementForm()" [nzLoading]="btnLoading">确认</button>
127
+      <button class="btn cancel" nz-button nzType="default" (click)="hideWorkHourManagementModal()">取消</button>
128
+    </div>
129
+  </div>
130
+</div>
131
+
102 132
 <!-- 操作成功/失败提示框 -->
103 133
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
104 134
   [info]="promptInfo">
105 135
 </app-prompt-modal>
136
+
137
+<!-- 删除模态框 -->
138
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
139
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

+ 210 - 12
src/app/components/incidentManagement/incident-handle-order/incident-handle-order.component.ts

@@ -36,8 +36,11 @@ export class IncidentHandleOrderComponent implements OnInit {
36 36
     this.hosId = this.tool.getCurrentHospital().id;
37 37
     this.getSummaryList();
38 38
     this.getConsumableList();
39
+    this.getWorkHourManagementList();
39 40
   }
40 41
 
42
+  // ============耗材start=================
43
+
41 44
   // 新增耗材/工时弹框
42 45
   modelName = ""; //模态框名称
43 46
   modalConsumable: boolean = false; //新增/编辑模态框
@@ -62,8 +65,8 @@ export class IncidentHandleOrderComponent implements OnInit {
62 65
     this.modalConsumable = true;
63 66
     this.initConsumableForm();
64 67
     this.coopData = data;
65
-    this.validateConsumableForm.controls.orders.setValue(data.orders);
66
-    this.validateConsumableForm.controls.workdayClassId.setValue(data.workdayClassId);
68
+    this.validateConsumableForm.controls.consumablesId.setValue(data.consumableId);
69
+    this.validateConsumableForm.controls.consumablesNum.setValue(data.consumablesNum);
67 70
   }
68 71
 
69 72
   // 新增/编辑表单提交
@@ -94,17 +97,14 @@ export class IncidentHandleOrderComponent implements OnInit {
94 97
     } else {
95 98
       //编辑
96 99
       postData = {
97
-        // priority: {
98
-          ...this.coopData,
99
-          ...{
100
-            name: this.validateConsumableForm.value.name,
101
-            orders: this.validateConsumableForm.value.orders,
102
-            responseTime: this.validateConsumableForm.value.responseTime,
103
-            handleTime: this.validateConsumableForm.value.handleTime,
104
-            holidayClassId: this.validateConsumableForm.value.holidayClassId,
105
-            workdayClassId: this.validateConsumableForm.value.workdayClassId,
100
+        "consumableList": [
101
+          {
102
+            "consumablesId": this.validateConsumableForm.value.consumablesId,
103
+            "consumablesNum": this.validateConsumableForm.value.consumablesNum,
106 104
           }
107
-        // }
105
+        ],
106
+        "modifyNum": "edit",
107
+        "summaryId": this.summaryId,
108 108
       };
109 109
     }
110 110
     this.mainService
@@ -150,6 +150,7 @@ export class IncidentHandleOrderComponent implements OnInit {
150 150
       consumable: {
151 151
         name: keyword,
152 152
         hosId: this.hosId,
153
+        showZero: true,
153 154
       },
154 155
       idx: 0,
155 156
       sum: 20,
@@ -167,6 +168,131 @@ export class IncidentHandleOrderComponent implements OnInit {
167 168
       });
168 169
   }
169 170
 
171
+  // ============耗材end=================
172
+
173
+  // ============工时start=================
174
+
175
+  // 新增耗材/工时弹框
176
+  modalWorkHourManagement: boolean = false; //新增/编辑模态框
177
+  addWorkHourManagement() {
178
+    this.modelName = "新增";
179
+    this.add = true; //新增
180
+    this.modalWorkHourManagement = true;
181
+    this.initWorkHourManagementForm();
182
+  }
183
+  //关闭新增/编辑弹框
184
+  hideWorkHourManagementModal() {
185
+    this.modalWorkHourManagement = false;
186
+  }
187
+
188
+  // 编辑
189
+  editWorkHourManagement(data) {
190
+    console.log(data);
191
+    this.modelName = "编辑";
192
+    this.add = false;
193
+    this.modalWorkHourManagement = true;
194
+    this.initWorkHourManagementForm();
195
+    this.coopData = data;
196
+    this.validateWorkHourManagementForm.controls.workHourId.setValue(data.id);
197
+    this.validateWorkHourManagementForm.controls.workHourNum.setValue(data.workHourNum2);
198
+  }
199
+
200
+  // 新增/编辑表单提交
201
+  submitWorkHourManagementForm(): void {
202
+    for (const i in this.validateWorkHourManagementForm.controls) {
203
+      this.validateWorkHourManagementForm.controls[i].markAsDirty();
204
+      this.validateWorkHourManagementForm.controls[i].updateValueAndValidity();
205
+    }
206
+    if (this.validateWorkHourManagementForm.invalid) {
207
+      return;
208
+    }
209
+    console.log(this.validateWorkHourManagementForm.value);
210
+    this.btnLoading = true;
211
+    let postData:any = {};
212
+
213
+    if (this.add) {
214
+      //增加
215
+      let workHourManagementList = this.summaryObj.workHourManagementList || [];
216
+      postData = {
217
+        "workHourManagementList": workHourManagementList.map(v => ({workHourId: v.id, workHourNum: v.workHourNum2 || 1})),
218
+        "summaryId": this.summaryId,
219
+      };
220
+      let index = postData.workHourManagementList.findIndex(v => v.workHourId == this.validateWorkHourManagementForm.value.workHourId.slice(-1)[0]);
221
+      if(index > -1){
222
+        postData.workHourManagementList[index].workHourNum += this.validateWorkHourManagementForm.value.workHourNum;
223
+      }else{
224
+        postData.workHourManagementList.push(
225
+          {
226
+            "workHourId": this.validateWorkHourManagementForm.value.workHourId.slice(-1)[0],
227
+            "workHourNum": this.validateWorkHourManagementForm.value.workHourNum,
228
+          }
229
+        );
230
+      }
231
+    } else {
232
+      //编辑
233
+      postData = {
234
+        "workHourManagementList": [
235
+          {
236
+            "workHourId": this.coopData.id,
237
+            "workHourNum": this.validateWorkHourManagementForm.value.workHourNum,
238
+          }
239
+        ],
240
+        "modifyNum": "edit",
241
+        "summaryId": this.summaryId,
242
+      };
243
+    }
244
+    this.mainService
245
+      .addSummaryDoc(postData)
246
+      .subscribe((result) => {
247
+        this.btnLoading = false;
248
+        this.hideWorkHourManagementModal();
249
+        let msg = "";
250
+        if (this.add) {
251
+          msg = "新增";
252
+        } else {
253
+          msg = "修改";
254
+        }
255
+        if (result.status == 200) {
256
+          this.showPromptModal(msg, true, '');
257
+        } else {
258
+          this.showPromptModal(msg, false, result.msg);
259
+        }
260
+      });
261
+  }
262
+
263
+  // 初始化新增form表单
264
+  validateWorkHourManagementForm: FormGroup; //新增/编辑表单
265
+  initWorkHourManagementForm() {
266
+    this.validateWorkHourManagementForm = this.fb.group({
267
+      workHourId: [null, [Validators.required]],
268
+      workHourNum: [1, [Validators.required]],
269
+    });
270
+    console.log(this.validateWorkHourManagementForm.controls)
271
+  }
272
+
273
+  // 获取工时
274
+  workHourManagementList: any = [];
275
+  getWorkHourManagementList() {
276
+    let postData = {
277
+      workHourManagement: {
278
+        hosId: this.hosId,
279
+      },
280
+      idx: 0,
281
+      sum: 9999,
282
+    };
283
+    this.mainService
284
+      .getFetchDataList("simple/data", "workHourManagement", postData)
285
+      .subscribe((res) => {
286
+        this.isLoading = false;
287
+        let workHourManagementList = res.list || [];
288
+        workHourManagementList = workHourManagementList.map(v => ({...v, parentId: v.parent ? v.parent.id : undefined, label: v.workName, value: v.id}));
289
+        this.workHourManagementList = this.tool.tranListToTreeDataLeaf(workHourManagementList, undefined, "parentId");
290
+        console.log(this.workHourManagementList);
291
+      });
292
+  }
293
+
294
+  // ============工时end=================
295
+
170 296
   // 获取汇总单信息
171 297
   summaryObj:any = {
172 298
     consumableList: [],//耗材列表
@@ -196,6 +322,78 @@ export class IncidentHandleOrderComponent implements OnInit {
196 322
       });
197 323
   }
198 324
 
325
+  delModal: boolean = false; //删除模态框
326
+  tipsMsg1: string; //提示框信息
327
+  tipsMsg2: string; //操作后信息
328
+  confirmDelType: string; //确认的类型(启用/停用,删除)
329
+  showDelModal(
330
+    data,
331
+    tipsMsg1: string,
332
+    tipsMsg2: string,
333
+    type: string,
334
+  ) {
335
+    this.confirmDelType = type;
336
+    this.delModal = true;
337
+    this.coopData = data;
338
+    this.tipsMsg1 = tipsMsg1;
339
+    this.tipsMsg2 = tipsMsg2;
340
+  }
341
+  // 隐藏删除框
342
+  hideDelModal() {
343
+    this.delModal = false;
344
+  }
345
+  // 确认删除
346
+  confirmDel() {
347
+    this.btnLoading = true;
348
+    if (this.confirmDelType === "delConsumable") {
349
+      //删除-耗材
350
+      let postData = {
351
+        "consumableList": [
352
+          {
353
+            "consumablesId": this.coopData.consumableId,
354
+            "consumablesNum": this.coopData.consumablesNum,
355
+          }
356
+        ],
357
+        "remove": "remove",
358
+        "summaryId": this.summaryId,
359
+      };
360
+      this.mainService
361
+        .addSummaryDoc(postData)
362
+        .subscribe((data) => {
363
+          this.btnLoading = false;
364
+          this.delModal = false;
365
+          if (data.status == 200) {
366
+            this.showPromptModal(this.tipsMsg2, true, "");
367
+          } else {
368
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
369
+          }
370
+        });
371
+    }else if (this.confirmDelType === "delWorkHourManagement") {
372
+      //删除-工时
373
+      let postData = {
374
+        "workHourManagementList": [
375
+          {
376
+            "workHourId": this.coopData.id,
377
+            "workHourNum": this.coopData.workHourNum2,
378
+          }
379
+        ],
380
+        "remove": "remove",
381
+        "summaryId": this.summaryId,
382
+      };
383
+      this.mainService
384
+        .addSummaryDoc(postData)
385
+        .subscribe((data) => {
386
+          this.btnLoading = false;
387
+          this.delModal = false;
388
+          if (data.status == 200) {
389
+            this.showPromptModal(this.tipsMsg2, true, "");
390
+          } else {
391
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
392
+          }
393
+        });
394
+    }
395
+  }
396
+
199 397
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
200 398
   promptContent: string; //操作提示框提示信息
201 399
   ifSuccess: boolean; //操作成功/失败

+ 5 - 4
src/app/components/incidentManagement/incident-handle/incident-handle.component.html

@@ -1,7 +1,7 @@
1 1
 <div class="modal display_flex justify-content_flex-center align-items_center">
2 2
   <div class="modalBody">
3 3
     <div class="title">详细处理<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
-    <div class="content">
4
+    <div class="content" [ngStyle]="{'visibility': incidentData.id ? 'visible' : 'hidden'}">
5 5
       <overlay-scrollbars #osComponentRef1 class="detail">
6 6
         <div class="detailItem">
7 7
           <div class="name">申请时间:</div>
@@ -55,8 +55,8 @@
55 55
           <div class="tab" *ngFor="let item of tabs" (click)="clickTbab(item)" [ngClass]="{ active: activeTabValue === item.value }">{{ item.name }}</div>
56 56
         </div>
57 57
         <ng-container *ngIf="activeTabValue === 1">
58
-          <app-incident-handle-info [id]="id"></app-incident-handle-info>
59
-          <!-- <app-incident-handle-info-simple [id]="id"></app-incident-handle-info-simple> -->
58
+          <app-incident-handle-info [incidentData]="incidentData" (changeCategoryHs)="changeCategoryHs($event)" *ngIf="itsmSimpleHandle.value == 0"></app-incident-handle-info>
59
+          <app-incident-handle-info-simple [incidentData]="incidentData" *ngIf="itsmSimpleHandle.value == 1"></app-incident-handle-info-simple>
60 60
         </ng-container>
61 61
         <ng-container *ngIf="activeTabValue === 2">
62 62
           <app-incident-handle-order [id]="id"></app-incident-handle-order>
@@ -67,10 +67,11 @@
67 67
           <div class="knowageTitle">{{item.title}}</div>
68 68
           <div class="knowageDescription">{{item.content | stripHtml}}</div>
69 69
           <div class="knowageBtns">
70
-            <button nz-button nzType="primary" (click)="submitForm()">引用</button>
70
+            <button nz-button nzType="primary" (click)="importKnowage(item)" *ngIf="activeTabValue === 1 && itsmSimpleHandle.value == 0">引用</button>
71 71
             <button class="ml8" nz-button nzType="primary" (click)="showKnowledgeModal(item)">查看</button>
72 72
           </div>
73 73
         </div>
74
+        <nz-empty *ngIf="!knowageLoading && knowageList.length === 0" style="margin-top: 80px;"></nz-empty>
74 75
         <nz-spin nzSimple [nzSpinning]="knowageLoading" class="mt8 text_align_center"></nz-spin>
75 76
       </overlay-scrollbars>
76 77
     </div>

+ 185 - 16
src/app/components/incidentManagement/incident-handle/incident-handle.component.ts

@@ -5,6 +5,11 @@ import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5 5
 import { NzMessageService } from 'ng-zorro-antd';
6 6
 import { ToolService } from 'src/app/services/tool.service';
7 7
 import { forkJoin } from 'rxjs';
8
+import { IncidentHandleInfoComponent } from '../incident-handle-info/incident-handle-info.component';
9
+import { IncidentHandleInfoSimpleComponent } from '../incident-handle-info-simple/incident-handle-info-simple.component';
10
+import cloneDeep from 'lodash-es/cloneDeep'
11
+import { HttpClient, HttpRequest, HttpResponse } from '@angular/common/http';
12
+import { filter } from 'rxjs/operators';
8 13
 
9 14
 @Component({
10 15
   selector: 'app-incident-handle',
@@ -28,6 +33,9 @@ export class IncidentHandleComponent implements OnInit {
28 33
   })
29 34
   osComponentRef3: OverlayScrollbarsComponent;
30 35
 
36
+  @ViewChild(IncidentHandleInfoComponent, { static: false }) incidentHandleInfoComponent: IncidentHandleInfoComponent;
37
+  @ViewChild(IncidentHandleInfoSimpleComponent, { static: false }) incidentHandleInfoSimpleComponent: IncidentHandleInfoSimpleComponent;
38
+
31 39
   @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
32 40
   @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
33 41
 
@@ -38,6 +46,7 @@ export class IncidentHandleComponent implements OnInit {
38 46
     private router: Router,
39 47
     private message: NzMessageService,
40 48
     private tool: ToolService,
49
+    private http: HttpClient,
41 50
   ) { }
42 51
 
43 52
   isLoading = false;
@@ -64,12 +73,13 @@ export class IncidentHandleComponent implements OnInit {
64 73
     this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
65 74
   }
66 75
   // 是否进入汇总单
67
-  get isInSummaryOrder(){
76
+  isInSummaryOrder(){
68 77
     return this.incidentData.duty && this.itsmSummarySheet.value == 1 && (this.incidentData.handlingPersonnelUser.id == this.tool.getCurrentUserId());
69 78
   }
70 79
 
71 80
   // 获取院区配置信息
72
-  itsmSummarySheet:any = {};
81
+  itsmSummarySheet:any = {};//是否需要填写汇总单
82
+  itsmSimpleHandle:any = {};//是否简单处理
73 83
   getHospitalConfig() {
74 84
     let postData = {
75 85
       idx: 0,
@@ -84,8 +94,11 @@ export class IncidentHandleComponent implements OnInit {
84 94
       .subscribe((result) => {
85 95
         let list = result.list || [];
86 96
         this.itsmSummarySheet = list.find(v => v.key == 'itsmSummarySheet') || {};
97
+        this.itsmSimpleHandle = list.find(v => v.key == 'itsmSimpleHandle') || {};
98
+        console.log(this.itsmSummarySheet)
87 99
         if(this.isInSummaryOrder){
88 100
           let summary = this.tabs.some(v => v.value == 2);
101
+          console.log(summary)
89 102
           !summary && this.tabs.push({ name: '汇总单', value: 2 });
90 103
         }
91 104
       });
@@ -142,30 +155,39 @@ export class IncidentHandleComponent implements OnInit {
142 155
     let solutionStatus$ = this.mainService.getDictionary('list', 'solution_status', true);
143 156
     let solutionType$ = this.mainService.getDictionary('list', 'solution_type', true);
144 157
     forkJoin(solutionStatus$, solutionType$).subscribe((data:any[]) => {
158
+      this.knowageLoading = false;
145 159
       let solutionStatusList = data[0] || [];
146 160
       let solutionTypeList = data[1] || [];
147 161
 
148
-      let solutionStatus = solutionStatusList.find(item => item.value == 2);
149
-      	console.log('solutionStatus:', solutionStatus)
150
-      let solutionType = solutionTypeList.find(item => item.value == 1);
151
-      	console.log('solutionType:', solutionType)
152
-
153
-      if(solutionStatus && solutionType){
154
-        this.getKnowledgeList(solutionStatus, solutionType);
155
-      }
162
+      this.solutionStatus = solutionStatusList.find(item => item.value == 2);
163
+      	console.log('this.solutionStatus:', this.solutionStatus)
164
+      this.solutionType = solutionTypeList.find(item => item.value == 1);
165
+      	console.log('this.solutionType:', this.solutionType)
156 166
     })
157 167
   }
168
+  solutionStatus;//知识库状态
169
+  solutionType;//知识库类型
170
+  // 修改故障现象
171
+  changeCategoryHs(categoryId){
172
+    this.getKnowledgeList(categoryId);
173
+  }
158 174
 
159 175
   // 获取知识库
160 176
   knowageList:any[] =  [];
161
-  getKnowledgeList(solutionStatus, solutionType) {
177
+  getKnowledgeList(categoryId) {
178
+    if(!(categoryId && this.solutionStatus && this.solutionType)){
179
+      this.knowageLoading = false;
180
+      this.knowageList = [];
181
+      return;
182
+    }
183
+    this.knowageLoading = true;
162 184
     let postData:any = {
163 185
       idx: 0,
164 186
       sum: 9999,
165 187
       solution: {
166
-        category: this.incidentData.category,
167
-				status: solutionStatus,
168
-				type: solutionType,
188
+        category: categoryId,
189
+				status: this.solutionStatus,
190
+				type: this.solutionType,
169 191
       },
170 192
     };
171 193
 
@@ -223,9 +245,156 @@ export class IncidentHandleComponent implements OnInit {
223 245
     }, 0)
224 246
   }
225 247
 
248
+  // 图片上传
249
+  uploadImages(file, id){
250
+    const formData = new FormData();
251
+    formData.append('file', file);
252
+    formData.append('fileName', file.name);
253
+    const req = new HttpRequest('Post', this.mainService.returnUploadUrl('incident', id), formData, {
254
+      reportProgress: true
255
+    });
256
+    return this.http.request(req).pipe(filter(e => e instanceof HttpResponse)).toPromise();
257
+  }
258
+
259
+  // 附件上传
260
+  uploadFiles(file, id){
261
+    const formData = new FormData();
262
+    formData.append('file', file);
263
+    formData.append('fileName', file.name);
264
+    const req = new HttpRequest('Post', this.mainService.returnUploadUrl('handleAttachment', id), formData, {
265
+      reportProgress: true
266
+    });
267
+    return this.http.request(req).pipe(filter(e => e instanceof HttpResponse)).toPromise();
268
+  }
269
+
270
+  // 引入知识库
271
+  solutionId;//引用的知识库Id
272
+  importKnowage(item){
273
+    console.log(item)
274
+    this.incidentData = {...this.incidentData, handleDescription:  `引用知识库解决,知识库编号:${item.solutionNumber}`};
275
+    this.solutionId = item.id;
276
+  }
277
+
226 278
   // 表单提交
227
-  submitForm(): void {
228
-    this.confirmModelHs.emit();
279
+  submitForm() {
280
+    if(this.itsmSimpleHandle.value == 0){
281
+      // 详细处理
282
+      console.log(this.incidentHandleInfoComponent)
283
+      return;
284
+      if(!this.incidentHandleInfoComponent.incidentDataCopy.handleDescription){
285
+        this.message.warning('请选择解决方案!');
286
+        return;
287
+      }
288
+      if(!this.incidentHandleInfoComponent.incidentDataCopy.category){
289
+        this.message.warning('请选择故障现象!');
290
+        return;
291
+      }
292
+      if(!this.incidentHandleInfoComponent.incidentDataCopy.handleCategory){
293
+        this.message.warning('请选择处理方式!');
294
+        return;
295
+      }
296
+      if(!this.incidentHandleInfoComponent.incidentDataCopy.closecode){
297
+        this.message.warning('请选择处理结果!');
298
+        return;
299
+      }
300
+
301
+      this.maskFlag = this.message.loading("正在加载中..", {
302
+        nzDuration: 0,
303
+      }).messageId;
304
+
305
+      let incidentDataCopy = cloneDeep(this.incidentHandleInfoComponent.incidentDataCopy);
306
+
307
+      // 图片上传
308
+      if(this.incidentHandleInfoComponent.fileList.length){
309
+        console.log(this.incidentHandleInfoComponent.fileList.map(v => v.originFileObj));
310
+        this.incidentHandleInfoComponent.fileList.map(v => v.originFileObj).forEach(async file => {
311
+          await this.uploadImages(file, incidentDataCopy.id);
312
+        })
313
+      }
314
+      // return;
315
+
316
+      // 附件上传
317
+      if(this.incidentHandleInfoComponent.fileList2.length){
318
+        console.log(this.incidentHandleInfoComponent.fileList2.map(v => v.originFileObj));
319
+        this.incidentHandleInfoComponent.fileList2.map(v => v.originFileObj).forEach(async file => {
320
+          await this.uploadFiles(file, incidentDataCopy.id);
321
+        })
322
+      }
323
+      // return;
324
+
325
+      let postData = {
326
+        solutionId: this.solutionId,
327
+        incident: {
328
+          ...incidentDataCopy,
329
+          handleCategory: incidentDataCopy.handleCategory ? { id: incidentDataCopy.handleCategory }: undefined,
330
+          closecode: incidentDataCopy.closecode ? { id: incidentDataCopy.closecode }: undefined,
331
+          synergetic: incidentDataCopy.synergetic.length ? incidentDataCopy.synergetic.map(v => ({id: v})): undefined,
332
+          category: incidentDataCopy.category ? { id: incidentDataCopy.category }: undefined,
333
+        },
334
+      }
335
+
336
+      console.log(postData);
337
+      // return;
338
+      this.mainService
339
+      .flowPost("incident/task/doing", postData)
340
+      .subscribe((result) => {
341
+        this.message.remove(this.maskFlag);
342
+        this.maskFlag = false;
343
+        this.confirmModelHs.emit();
344
+
345
+        if (result.state == 200) {
346
+          this.message.success('处理成功');
347
+        } else {
348
+          this.message.error('处理失败');
349
+        }
350
+      });
351
+    }else if(this.itsmSimpleHandle.value == 1){
352
+      // 简单处理
353
+      console.log(this.incidentHandleInfoSimpleComponent)
354
+      if(!this.incidentHandleInfoSimpleComponent.incidentDataCopy.handleCategory){
355
+        this.message.warning('请选择处理方式!');
356
+        return;
357
+      }
358
+
359
+      this.maskFlag = this.message.loading("正在加载中..", {
360
+        nzDuration: 0,
361
+      }).messageId;
362
+
363
+      let incidentDataCopy = cloneDeep(this.incidentHandleInfoSimpleComponent.incidentDataCopy);
364
+
365
+      // 图片上传
366
+      if(this.incidentHandleInfoSimpleComponent.fileList.length){
367
+        console.log(this.incidentHandleInfoSimpleComponent.fileList.map(v => v.originFileObj));
368
+        this.incidentHandleInfoSimpleComponent.fileList.map(v => v.originFileObj).forEach(async file => {
369
+          await this.uploadImages(file, incidentDataCopy.id);
370
+        })
371
+      }
372
+      // return;
373
+
374
+      let postData = {
375
+        incident: {
376
+          ...incidentDataCopy,
377
+          handleCategory: incidentDataCopy.handleCategory ? { id: incidentDataCopy.handleCategory }: undefined,
378
+          synergetic: incidentDataCopy.synergetic.length ? incidentDataCopy.synergetic.map(v => ({id: v})): undefined,
379
+        },
380
+      }
381
+
382
+      console.log(postData);
383
+
384
+      this.mainService
385
+      .flowPost("incident/task/doing", postData)
386
+      .subscribe((result) => {
387
+        this.message.remove(this.maskFlag);
388
+        this.maskFlag = false;
389
+        this.confirmModelHs.emit();
390
+
391
+        if (result.state == 200) {
392
+          this.message.success('处理成功');
393
+        } else {
394
+          this.message.error('处理失败');
395
+        }
396
+      });
397
+    }
229 398
   }
230 399
 }
231 400
 

+ 50 - 0
src/app/components/incidentManagement/incident-postpone/incident-postpone.component.html

@@ -0,0 +1,50 @@
1
+<div class="save display_flex justify-content_flex-center align-items_center add">
2
+  <div class="modalBody">
3
+    <div class="title">延期处理<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="content">
5
+      <form nz-form [formGroup]="validateForm" class="addForm">
6
+        <nz-form-item>
7
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="repairTypeId">延期原因</nz-form-label>
8
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期原因!">
9
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="repairTypeId" nzPlaceHolder="请选择延期原因" nzServerSearch>
10
+              <ng-container *ngFor="let data of repairTypeList">
11
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
12
+              </ng-container>
13
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
14
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
15
+              </nz-option>
16
+            </nz-select>
17
+          </nz-form-control>
18
+        </nz-form-item>
19
+        <nz-form-item>
20
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralDayId">延期天数</nz-form-label>
21
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期天数!">
22
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="deferralDayId" nzPlaceHolder="请选择延期天数" nzServerSearch>
23
+              <ng-container *ngFor="let data of deferralDayList">
24
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.text" [nzValue]="data.value"></nz-option>
25
+              </ng-container>
26
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
27
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
28
+              </nz-option>
29
+            </nz-select>
30
+          </nz-form-control>
31
+        </nz-form-item>
32
+        <nz-form-item>
33
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralRemark">延期说明</nz-form-label>
34
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入延期说明!">
35
+            <nz-input-group>
36
+              <textarea formControlName="deferralRemark" nz-input rows="3" placeholder="请输入延期说明"></textarea>
37
+            </nz-input-group>
38
+          </nz-form-control>
39
+        </nz-form-item>
40
+      </form>
41
+    </div>
42
+    <div class="display_flex justify-content_flex-center">
43
+      <button nz-button nzType="primary" (click)="submitForm()"[nzLoading]="isLoading">确认</button>
44
+      <button nz-button nzType="default" class="btn cancel" (click)="hideModal()">取消</button>
45
+    </div>
46
+  </div>
47
+</div>
48
+
49
+<!-- 遮罩 -->
50
+<app-mask *ngIf="maskFlag"></app-mask>

+ 125 - 0
src/app/components/incidentManagement/incident-postpone/incident-postpone.component.less

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

+ 140 - 0
src/app/components/incidentManagement/incident-postpone/incident-postpone.component.ts

@@ -0,0 +1,140 @@
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
2
+import { MainService } from '../../../services/main.service';
3
+import { Router, ActivatedRoute } from '@angular/router';
4
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
8
+
9
+@Component({
10
+  selector: 'app-incident-postpone',
11
+  templateUrl: './incident-postpone.component.html',
12
+  styleUrls: ['./incident-postpone.component.less']
13
+})
14
+export class IncidentPostponeComponent implements OnInit {
15
+  @ViewChild("osComponentRef1", {
16
+    read: OverlayScrollbarsComponent,
17
+    static: false,
18
+  })
19
+  osComponentRef1: OverlayScrollbarsComponent;
20
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
21
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  @Input() id: any;
24
+
25
+  constructor(
26
+    private mainService: MainService,
27
+    private router: Router,
28
+    private route: ActivatedRoute,
29
+    private message: NzMessageService,
30
+    private tool: ToolService,
31
+    private fb: FormBuilder,
32
+  ) { }
33
+
34
+  isLoading = false;
35
+
36
+  ngOnInit() {
37
+    this.initForm();
38
+    this.getDetail();
39
+    this.getRepairTypeList();
40
+    this.getDeferralDayList();
41
+  }
42
+
43
+  // 初始化新增form表单
44
+  validateForm: FormGroup; //新增/编辑表单
45
+  initForm() {
46
+    this.validateForm = this.fb.group({
47
+      repairTypeId: [null, [Validators.required]],//延期原因
48
+      deferralDayId: [null, [Validators.required]],//延期天数
49
+      deferralRemark: [null, [Validators.required]],//延期说明
50
+    });
51
+    console.log(this.validateForm.controls)
52
+  }
53
+
54
+  // 获取延期原因
55
+  repairTypeList: any = [];
56
+  getRepairTypeList() {
57
+    this.mainService
58
+    .getDictionary('list', 'repair_type')
59
+    .subscribe((data) => {
60
+      this.repairTypeList = data || [];
61
+    });
62
+  }
63
+
64
+  // 获取延期天数
65
+  deferralDayList: any = [];
66
+  getDeferralDayList() {
67
+    this.deferralDayList = this.tool.generateNumberArray(1, 15).map(v => ({
68
+      text: v + '天',
69
+      value: v,
70
+    }));
71
+		this.deferralDayList.unshift({
72
+			text: '0.5天',
73
+			value: 0.5,
74
+		})
75
+  }
76
+
77
+  // 操作权限
78
+  incidentData:any = {};
79
+  getDetail(){
80
+    this.maskFlag = this.message.loading("正在加载中..", {
81
+      nzDuration: 0,
82
+    }).messageId;
83
+    this.mainService
84
+      .getFetchData("simple/data", "incident", this.id)
85
+      .subscribe((result) => {
86
+        this.message.remove(this.maskFlag);
87
+        this.maskFlag = false;
88
+        this.incidentData = result.data || {};
89
+      });
90
+  }
91
+
92
+  // 关闭弹窗
93
+  hideModal() {
94
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
95
+  }
96
+
97
+  // 表单提交
98
+  maskFlag:any = false;
99
+  submitForm(): void {
100
+    for (const i in this.validateForm.controls) {
101
+      this.validateForm.controls[i].markAsDirty();
102
+      this.validateForm.controls[i].updateValueAndValidity();
103
+    }
104
+    if (this.validateForm.invalid) {
105
+      return;
106
+    }
107
+
108
+    this.maskFlag = this.message.loading("正在加载中..", {
109
+      nzDuration: 0,
110
+    }).messageId;
111
+
112
+    let postData = {
113
+      incident: this.incidentData,
114
+    }
115
+
116
+    postData.incident.currentLog = {
117
+      remark: this.validateForm.value.deferralRemark,
118
+      extra1: this.validateForm.value.repairTypeId,
119
+      extra2: this.validateForm.value.deferralDayId,
120
+    }
121
+
122
+    this.mainService
123
+    .flowPost("incident/task/overtime", postData)
124
+    .subscribe((result) => {
125
+      this.message.remove(this.maskFlag);
126
+      this.maskFlag = false;
127
+      this.confirmModelHs.emit();
128
+
129
+      if (result.state == 200) {
130
+        this.message.success('操作成功');
131
+      } else {
132
+        this.message.error('操作失败');
133
+      }
134
+    });
135
+  }
136
+}
137
+
138
+
139
+
140
+

+ 20 - 0
src/app/components/incidentManagement/incident-postpone/incident-postpone.module.ts

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

+ 44 - 0
src/app/components/incidentManagement/incident-setduty/incident-setduty.component.html

@@ -0,0 +1,44 @@
1
+<div class="save display_flex justify-content_flex-center align-items_center add">
2
+  <div class="modalBody">
3
+    <div class="title">设置责任部门<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="content">
5
+      <form nz-form [formGroup]="validateForm" class="addForm">
6
+        <nz-form-item>
7
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="hosId">院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区</nz-form-label>
8
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择院区!">
9
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="hosId" nzShowSearch
10
+              nzPlaceHolder="请选择院区" nzServerSearch (ngModelChange)="changeHospital($event)">
11
+              <ng-container *ngFor="let data of hospitalList">
12
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
13
+              </ng-container>
14
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
+              </nz-option>
17
+            </nz-select>
18
+          </nz-form-control>
19
+        </nz-form-item>
20
+        <nz-form-item>
21
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="dutyId">责任部门</nz-form-label>
22
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择责任部门!">
23
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="dutyId" nzShowSearch
24
+              nzPlaceHolder="请选择责任部门" nzServerSearch>
25
+              <ng-container *ngFor="let data of dutyList">
26
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
27
+              </ng-container>
28
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
29
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
30
+              </nz-option>
31
+            </nz-select>
32
+          </nz-form-control>
33
+        </nz-form-item>
34
+      </form>
35
+    </div>
36
+    <div class="display_flex justify-content_flex-center">
37
+      <button nz-button nzType="primary" (click)="submitForm()"[nzLoading]="isLoading">确认</button>
38
+      <button nz-button nzType="default" class="btn cancel" (click)="hideModal()">取消</button>
39
+    </div>
40
+  </div>
41
+</div>
42
+
43
+<!-- 遮罩 -->
44
+<app-mask *ngIf="maskFlag"></app-mask>

+ 125 - 0
src/app/components/incidentManagement/incident-setduty/incident-setduty.component.less

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

+ 130 - 0
src/app/components/incidentManagement/incident-setduty/incident-setduty.component.ts

@@ -0,0 +1,130 @@
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
2
+import { MainService } from '../../../services/main.service';
3
+import { Router, ActivatedRoute } from '@angular/router';
4
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
8
+
9
+@Component({
10
+  selector: 'app-incident-setduty',
11
+  templateUrl: './incident-setduty.component.html',
12
+  styleUrls: ['./incident-setduty.component.less']
13
+})
14
+export class IncidentSetdutyComponent implements OnInit {
15
+  @ViewChild("osComponentRef1", {
16
+    read: OverlayScrollbarsComponent,
17
+    static: false,
18
+  })
19
+  osComponentRef1: OverlayScrollbarsComponent;
20
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
21
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  @Input() id: any;
24
+
25
+  constructor(
26
+    private mainService: MainService,
27
+    private router: Router,
28
+    private route: ActivatedRoute,
29
+    private message: NzMessageService,
30
+    private tool: ToolService,
31
+    private fb: FormBuilder,
32
+  ) { }
33
+
34
+  isLoading = false;
35
+
36
+  ngOnInit() {
37
+    this.initForm();
38
+    this.getHospitals(1);
39
+  }
40
+
41
+  // 初始化新增form表单
42
+  validateForm: FormGroup; //新增/编辑表单
43
+  initForm() {
44
+    this.validateForm = this.fb.group({
45
+      hosId: [null, [Validators.required]],//院区
46
+      dutyId: [null, [Validators.required]],//责任部门
47
+    });
48
+    console.log(this.validateForm.controls)
49
+  }
50
+
51
+  // 修改院区
52
+  changeHospital(id){
53
+    this.validateForm.controls.dutyId.setValue(null);
54
+
55
+    this.dutyList = [];
56
+    this.getHospitals(2, id);
57
+  }
58
+
59
+  // 获取院区
60
+  hospitalList: any = [];
61
+  dutyList: any = [];
62
+  getHospitals(type:number, parentId?) {
63
+    if(type === 1){
64
+      this.hospitalList = this.tool.getHospitalList().filter(v => !v.parent);
65
+      return;
66
+    }
67
+    if(type === 2 && !parentId){
68
+      this.dutyList = [];
69
+      return;
70
+    }
71
+    let postData = {
72
+      hospital: {
73
+        parent: { id: parentId },
74
+        type: { key: 'hospital_type', value: '6' },
75
+      },
76
+      idx: 0,
77
+      sum: 9999,
78
+    };
79
+    this.mainService
80
+      .getFetchDataList("data", "hospital", postData)
81
+      .subscribe((data) => {
82
+        this.isLoading = false;
83
+        this.dutyList = data.list || [];
84
+      });
85
+  }
86
+
87
+  // 关闭弹窗
88
+  hideModal() {
89
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
90
+  }
91
+
92
+  // 表单提交
93
+  maskFlag:any = false;
94
+  submitForm(): void {
95
+    for (const i in this.validateForm.controls) {
96
+      this.validateForm.controls[i].markAsDirty();
97
+      this.validateForm.controls[i].updateValueAndValidity();
98
+    }
99
+    if (this.validateForm.invalid) {
100
+      return;
101
+    }
102
+
103
+    this.maskFlag = this.message.loading("正在加载中..", {
104
+      nzDuration: 0,
105
+    }).messageId;
106
+
107
+    let postData = {
108
+      orderId: this.id,
109
+      dutyId: this.validateForm.value.dutyId,
110
+    }
111
+
112
+    this.mainService
113
+    .changeIncidentDuty(postData)
114
+    .subscribe((result) => {
115
+      this.message.remove(this.maskFlag);
116
+      this.maskFlag = false;
117
+      this.confirmModelHs.emit();
118
+
119
+      if (result.status == 200) {
120
+        this.message.success('设置成功');
121
+      } else {
122
+        this.message.error('设置失败');
123
+      }
124
+    });
125
+  }
126
+}
127
+
128
+
129
+
130
+

+ 20 - 0
src/app/components/incidentManagement/incident-setduty/incident-setduty.module.ts

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

+ 2 - 0
src/app/components/incidentManagement/incident-substitutio-assign/incident-substitution-assign.component.ts

@@ -145,6 +145,8 @@ export class IncidentSubstitutionAssignComponent implements OnInit {
145 145
         name: keyword,
146 146
         simpleQuery: true,
147 147
         groupdata: { id: this.validateForm.value.groupId },
148
+        roleCodes: 'first-line support,second-line support',
149
+        engineer: 1,
148 150
       },
149 151
       idx: 0,
150 152
       sum: 10,

+ 13 - 33
src/app/components/incidentManagement/incident-substitutio-redeploy/incident-substitution-redeploy.component.html

@@ -1,33 +1,5 @@
1 1
 <form nz-form [formGroup]="validateForm" class="addForm">
2 2
   <nz-form-item>
3
-    <nz-form-label [nzSpan]="6" nzRequired nzFor="hosId">院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区</nz-form-label>
4
-    <nz-form-control [nzSpan]="18" nzErrorTip="请选择院区!">
5
-      <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="hosId" nzShowSearch
6
-        nzPlaceHolder="请选择院区" nzServerSearch (ngModelChange)="changeHospital($event)">
7
-        <ng-container *ngFor="let data of hospitalList">
8
-          <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
9
-        </ng-container>
10
-        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
-          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
-        </nz-option>
13
-      </nz-select>
14
-    </nz-form-control>
15
-  </nz-form-item>
16
-  <nz-form-item>
17
-    <nz-form-label [nzSpan]="6" nzRequired nzFor="dutyId">责任部门</nz-form-label>
18
-    <nz-form-control [nzSpan]="18" nzErrorTip="请选择责任部门!">
19
-      <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="dutyId" nzShowSearch
20
-        nzPlaceHolder="请选择责任部门" nzServerSearch (ngModelChange)="changeDuty($event)">
21
-        <ng-container *ngFor="let data of dutyList">
22
-          <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
23
-        </ng-container>
24
-        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
25
-          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
26
-        </nz-option>
27
-      </nz-select>
28
-    </nz-form-control>
29
-  </nz-form-item>
30
-  <nz-form-item>
31 3
     <nz-form-label [nzSpan]="6" nzRequired nzFor="groupId">工&nbsp;&nbsp;作&nbsp;&nbsp;组</nz-form-label>
32 4
     <nz-form-control [nzSpan]="18" nzErrorTip="请选择工作组!">
33 5
       <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择工作组" (ngModelChange)="changeGroup($event)">
@@ -41,8 +13,8 @@
41 13
     </nz-form-control>
42 14
   </nz-form-item>
43 15
   <nz-form-item>
44
-    <nz-form-label [nzSpan]="7" nzFor="userGroup">是否派到人</nz-form-label>
45
-    <nz-form-control [nzSpan]="17" nzErrorTip="请选择是否派到人!">
16
+    <nz-form-label [nzSpan]="7" nzFor="userGroup">是否派到人</nz-form-label>
17
+    <nz-form-control [nzSpan]="17" nzErrorTip="请选择是否派到人!">
46 18
       <nz-radio-group formControlName="userGroup" (ngModelChange)="changeUserGroup($event)">
47 19
         <label nz-radio [nzValue]="1">是</label>
48 20
         <label nz-radio [nzValue]="0">否</label>
@@ -50,9 +22,9 @@
50 22
     </nz-form-control>
51 23
   </nz-form-item>
52 24
   <nz-form-item *ngIf="validateForm.value.userGroup === 1">
53
-    <nz-form-label [nzSpan]="6" nzRequired nzFor="userId">派对象</nz-form-label>
54
-    <nz-form-control [nzSpan]="18" nzErrorTip="请选择派对象!">
55
-      <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择派对象">
25
+    <nz-form-label [nzSpan]="6" nzRequired nzFor="userId">派对象</nz-form-label>
26
+    <nz-form-control [nzSpan]="18" nzErrorTip="请选择派对象!">
27
+      <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择派对象">
56 28
         <ng-container *ngFor="let option of userList">
57 29
           <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
58 30
         </ng-container>
@@ -62,4 +34,12 @@
62 34
       </nz-select>
63 35
     </nz-form-control>
64 36
   </nz-form-item>
37
+  <nz-form-item>
38
+    <nz-form-label [nzSpan]="6" nzRequired nzFor="redeployRemark">转派原因</nz-form-label>
39
+    <nz-form-control [nzSpan]="18" nzErrorTip="请输入转派原因!">
40
+      <nz-input-group>
41
+        <textarea formControlName="redeployRemark" nz-input rows="3" placeholder="请输入转派原因"></textarea>
42
+      </nz-input-group>
43
+    </nz-form-control>
44
+  </nz-form-item>
65 45
 </form>

+ 8 - 61
src/app/components/incidentManagement/incident-substitutio-redeploy/incident-substitution-redeploy.component.ts

@@ -1,4 +1,4 @@
1
-import { Component, OnInit } from '@angular/core';
1
+import { Component, OnInit, Input } from '@angular/core';
2 2
 import { MainService } from '../../../services/main.service';
3 3
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
4 4
 import { Subject } from 'rxjs';
@@ -11,6 +11,7 @@ import { ToolService } from 'src/app/services/tool.service';
11 11
   styleUrls: ['./incident-substitution-redeploy.component.less']
12 12
 })
13 13
 export class IncidentSubstitutionRedeployComponent implements OnInit {
14
+  @Input() duty:any;
14 15
   constructor(
15 16
     private mainService: MainService,
16 17
     private fb: FormBuilder,
@@ -29,44 +30,21 @@ export class IncidentSubstitutionRedeployComponent implements OnInit {
29 30
       }
30 31
     });
31 32
     this.initForm();
32
-    this.getHospitals(1);
33
+    this.getGroups();
33 34
   }
34 35
 
35 36
   // 初始化新增form表单
36 37
   validateForm: FormGroup; //新增/编辑表单
37 38
   initForm() {
38 39
     this.validateForm = this.fb.group({
39
-      hosId: [null, [Validators.required]],//院区
40
-      dutyId: [null, [Validators.required]],//责任部门
41 40
       userGroup: [1, [Validators.required]],//分配方式
42 41
       userId: [null],//人
43 42
       groupId: [null, [Validators.required]],//组
43
+      redeployRemark: [null, [Validators.required]],//转派原因
44 44
     });
45 45
     console.log(this.validateForm.controls)
46 46
   }
47 47
 
48
-  // 修改院区
49
-  changeHospital(id){
50
-    this.validateForm.controls.dutyId.setValue(null);
51
-    this.validateForm.controls.userId.setValue(null);
52
-    this.validateForm.controls.groupId.setValue(null);
53
-
54
-    this.dutyList = [];
55
-    this.userList = [];
56
-    this.groupList = [];
57
-    this.getHospitals(2, id);
58
-  }
59
-
60
-  // 修改责任部门
61
-  changeDuty(id){
62
-    this.validateForm.controls.userId.setValue(null);
63
-    this.validateForm.controls.groupId.setValue(null);
64
-
65
-    this.userList = [];
66
-    this.groupList = [];
67
-    this.getGroups();
68
-  }
69
-
70 48
   // 修改组
71 49
   changeGroup(id){
72 50
     this.validateForm.controls.userId.setValue(null);
@@ -76,7 +54,6 @@ export class IncidentSubstitutionRedeployComponent implements OnInit {
76 54
   // 选择人|组
77 55
   changeUserGroup(id){
78 56
     this.validateForm.controls.userId.setValue(null);
79
-    this.userList = [];
80 57
     if(id === 1){
81 58
       // 人
82 59
       this.requiredConfigChange('userId', true);
@@ -104,34 +81,6 @@ export class IncidentSubstitutionRedeployComponent implements OnInit {
104 81
     this.changeInpSubject.next([model, e]);
105 82
   }
106 83
 
107
-  // 获取院区
108
-  hospitalList: any = [];
109
-  dutyList: any = [];
110
-  getHospitals(type:number, parentId?) {
111
-    if(type === 1){
112
-      this.hospitalList = this.tool.getHospitalList().filter(v => !v.parent);
113
-      return;
114
-    }
115
-    if(type === 2 && !parentId){
116
-      this.dutyList = [];
117
-      return;
118
-    }
119
-    let postData = {
120
-      hospital: {
121
-        parent: { id: parentId },
122
-        type: { key: 'hospital_type', value: '6' },
123
-      },
124
-      idx: 0,
125
-      sum: 9999,
126
-    };
127
-    this.mainService
128
-      .getFetchDataList("data", "hospital", postData)
129
-      .subscribe((data) => {
130
-        this.isLoading = false;
131
-        this.dutyList = data.list || [];
132
-      });
133
-  }
134
-
135 84
   // 搜索
136 85
   // 获取用户
137 86
   userList: any = [];
@@ -142,10 +91,12 @@ export class IncidentSubstitutionRedeployComponent implements OnInit {
142 91
     }
143 92
     let postData = {
144 93
       user: {
145
-        hospital: { id: this.validateForm.value.dutyId },
94
+        hospital: { id: this.duty.id },
146 95
         name: keyword,
147 96
         simpleQuery: true,
148 97
         groupdata: { id: this.validateForm.value.groupId },
98
+        roleCodes: 'first-line support,second-line support',
99
+        engineer: 1,
149 100
       },
150 101
       idx: 0,
151 102
       sum: 10,
@@ -162,14 +113,10 @@ export class IncidentSubstitutionRedeployComponent implements OnInit {
162 113
   // 获取组
163 114
   groupList: any = []; //所有所属科室(搜索)
164 115
   getGroups(keyword = '') {
165
-    if(!this.validateForm.value.dutyId){
166
-      this.groupList = [];
167
-      return;
168
-    }
169 116
     let postData = {
170 117
       group2: {
171 118
         groupName: keyword,
172
-        hospitals: this.validateForm.value.dutyId,
119
+        hospitals: this.duty.id,
173 120
         type: 1,
174 121
       },
175 122
       idx: 0,

+ 1 - 1
src/app/components/incidentManagement/incident-substitution/incident-substitution.component.html

@@ -7,7 +7,7 @@
7 7
           <div class="tab" *ngFor="let item of tabs" (click)="clickTbab(item)" [ngClass]="{ active: activeTabValue === item.value }">{{ item.name }}</div>
8 8
         </div>
9 9
         <ng-container *ngIf="activeTabValue === 'redeploy'">
10
-          <app-incident-substitution-redeploy></app-incident-substitution-redeploy>
10
+          <app-incident-substitution-redeploy [duty]="incidentData.duty"></app-incident-substitution-redeploy>
11 11
         </ng-container>
12 12
         <ng-container *ngIf="activeTabValue === 'assign'">
13 13
           <app-incident-substitution-assign></app-incident-substitution-assign>

+ 42 - 1
src/app/components/incidentManagement/incident-substitution/incident-substitution.component.ts

@@ -110,7 +110,48 @@ export class IncidentSubstitutionComponent implements OnInit {
110 110
 
111 111
   // 表单提交
112 112
   submitForm(): void {
113
-    if(this.activeTabValue === 'assign'){
113
+    if(this.activeTabValue === 'redeploy'){
114
+      // 转派
115
+      for (const i in this.redeploy.validateForm.controls) {
116
+        this.redeploy.validateForm.controls[i].markAsDirty();
117
+        this.redeploy.validateForm.controls[i].updateValueAndValidity();
118
+      }
119
+      if (this.redeploy.validateForm.invalid) {
120
+        return;
121
+      }
122
+
123
+      this.maskFlag = this.message.loading("正在加载中..", {
124
+        nzDuration: 0,
125
+      }).messageId;
126
+
127
+      let postData = {
128
+        incident: this.incidentData,
129
+      }
130
+
131
+      postData.incident.redeployRemark = this.redeploy.validateForm.value.redeployRemark;
132
+
133
+      if(this.redeploy.validateForm.value.userId){
134
+        // 派人
135
+        postData.incident.assignee = this.redeploy.validateForm.value.userId;
136
+      } else {
137
+        // 派组
138
+        postData.incident.candidateGroups = this.redeploy.validateForm.value.groupId;
139
+      }
140
+
141
+      this.mainService
142
+      .flowPost("incident/task/redeploy", postData)
143
+      .subscribe((result) => {
144
+        this.message.remove(this.maskFlag);
145
+        this.maskFlag = false;
146
+        this.confirmModelHs.emit();
147
+
148
+        if (result.state == 200) {
149
+          this.message.success('转派成功');
150
+        } else {
151
+          this.message.error('转派失败');
152
+        }
153
+      });
154
+    }else if(this.activeTabValue === 'assign'){
114 155
       // 指派
115 156
       for (const i in this.assign.validateForm.controls) {
116 157
         this.assign.validateForm.controls[i].markAsDirty();

+ 50 - 0
src/app/components/incidentManagement/incident-visit/incident-visit.component.html

@@ -0,0 +1,50 @@
1
+<div class="save display_flex justify-content_flex-center align-items_center add">
2
+  <div class="modalBody">
3
+    <div class="title">延期处理<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="content">
5
+      <form nz-form [formGroup]="validateForm" class="addForm">
6
+        <nz-form-item>
7
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="repairTypeId">延期原因</nz-form-label>
8
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期原因!">
9
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="repairTypeId" nzPlaceHolder="请选择延期原因" nzServerSearch>
10
+              <ng-container *ngFor="let data of repairTypeList">
11
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
12
+              </ng-container>
13
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
14
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
15
+              </nz-option>
16
+            </nz-select>
17
+          </nz-form-control>
18
+        </nz-form-item>
19
+        <nz-form-item>
20
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralDayId">延期天数</nz-form-label>
21
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择延期天数!">
22
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="deferralDayId" nzPlaceHolder="请选择延期天数" nzServerSearch>
23
+              <ng-container *ngFor="let data of deferralDayList">
24
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.text" [nzValue]="data.value"></nz-option>
25
+              </ng-container>
26
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
27
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
28
+              </nz-option>
29
+            </nz-select>
30
+          </nz-form-control>
31
+        </nz-form-item>
32
+        <nz-form-item>
33
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="deferralRemark">延期说明</nz-form-label>
34
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入延期说明!">
35
+            <nz-input-group>
36
+              <textarea formControlName="deferralRemark" nz-input rows="3" placeholder="请输入延期说明"></textarea>
37
+            </nz-input-group>
38
+          </nz-form-control>
39
+        </nz-form-item>
40
+      </form>
41
+    </div>
42
+    <div class="display_flex justify-content_flex-center">
43
+      <button nz-button nzType="primary" (click)="submitForm()"[nzLoading]="isLoading">确认</button>
44
+      <button nz-button nzType="default" class="btn cancel" (click)="hideModal()">取消</button>
45
+    </div>
46
+  </div>
47
+</div>
48
+
49
+<!-- 遮罩 -->
50
+<app-mask *ngIf="maskFlag"></app-mask>

+ 125 - 0
src/app/components/incidentManagement/incident-visit/incident-visit.component.less

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

+ 140 - 0
src/app/components/incidentManagement/incident-visit/incident-visit.component.ts

@@ -0,0 +1,140 @@
1
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
2
+import { MainService } from '../../../services/main.service';
3
+import { Router, ActivatedRoute } from '@angular/router';
4
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
8
+
9
+@Component({
10
+  selector: 'app-incident-visit',
11
+  templateUrl: './incident-visit.component.html',
12
+  styleUrls: ['./incident-visit.component.less']
13
+})
14
+export class IncidentVisitComponent implements OnInit {
15
+  @ViewChild("osComponentRef1", {
16
+    read: OverlayScrollbarsComponent,
17
+    static: false,
18
+  })
19
+  osComponentRef1: OverlayScrollbarsComponent;
20
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
21
+  @Output() confirmModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  @Input() id: any;
24
+
25
+  constructor(
26
+    private mainService: MainService,
27
+    private router: Router,
28
+    private route: ActivatedRoute,
29
+    private message: NzMessageService,
30
+    private tool: ToolService,
31
+    private fb: FormBuilder,
32
+  ) { }
33
+
34
+  isLoading = false;
35
+
36
+  ngOnInit() {
37
+    this.initForm();
38
+    this.getDetail();
39
+    this.getRepairTypeList();
40
+    this.getDeferralDayList();
41
+  }
42
+
43
+  // 初始化新增form表单
44
+  validateForm: FormGroup; //新增/编辑表单
45
+  initForm() {
46
+    this.validateForm = this.fb.group({
47
+      repairTypeId: [null, [Validators.required]],//延期原因
48
+      deferralDayId: [null, [Validators.required]],//延期天数
49
+      deferralRemark: [null, [Validators.required]],//延期说明
50
+    });
51
+    console.log(this.validateForm.controls)
52
+  }
53
+
54
+  // 获取延期原因
55
+  repairTypeList: any = [];
56
+  getRepairTypeList() {
57
+    this.mainService
58
+    .getDictionary('list', 'repair_type')
59
+    .subscribe((data) => {
60
+      this.repairTypeList = data || [];
61
+    });
62
+  }
63
+
64
+  // 获取延期天数
65
+  deferralDayList: any = [];
66
+  getDeferralDayList() {
67
+    this.deferralDayList = this.tool.generateNumberArray(1, 15).map(v => ({
68
+      text: v + '天',
69
+      value: v,
70
+    }));
71
+		this.deferralDayList.unshift({
72
+			text: '0.5天',
73
+			value: 0.5,
74
+		})
75
+  }
76
+
77
+  // 操作权限
78
+  incidentData:any = {};
79
+  getDetail(){
80
+    this.maskFlag = this.message.loading("正在加载中..", {
81
+      nzDuration: 0,
82
+    }).messageId;
83
+    this.mainService
84
+      .getFetchData("simple/data", "incident", this.id)
85
+      .subscribe((result) => {
86
+        this.message.remove(this.maskFlag);
87
+        this.maskFlag = false;
88
+        this.incidentData = result.data || {};
89
+      });
90
+  }
91
+
92
+  // 关闭弹窗
93
+  hideModal() {
94
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
95
+  }
96
+
97
+  // 表单提交
98
+  maskFlag:any = false;
99
+  submitForm(): void {
100
+    for (const i in this.validateForm.controls) {
101
+      this.validateForm.controls[i].markAsDirty();
102
+      this.validateForm.controls[i].updateValueAndValidity();
103
+    }
104
+    if (this.validateForm.invalid) {
105
+      return;
106
+    }
107
+
108
+    this.maskFlag = this.message.loading("正在加载中..", {
109
+      nzDuration: 0,
110
+    }).messageId;
111
+
112
+    let postData = {
113
+      incident: this.incidentData,
114
+    }
115
+
116
+    postData.incident.currentLog = {
117
+      remark: this.validateForm.value.deferralRemark,
118
+      extra1: this.validateForm.value.repairTypeId,
119
+      extra2: this.validateForm.value.deferralDayId,
120
+    }
121
+
122
+    this.mainService
123
+    .flowPost("incident/task/overtime", postData)
124
+    .subscribe((result) => {
125
+      this.message.remove(this.maskFlag);
126
+      this.maskFlag = false;
127
+      this.confirmModelHs.emit();
128
+
129
+      if (result.state == 200) {
130
+        this.message.success('操作成功');
131
+      } else {
132
+        this.message.error('操作失败');
133
+      }
134
+    });
135
+  }
136
+}
137
+
138
+
139
+
140
+

+ 20 - 0
src/app/components/incidentManagement/incident-visit/incident-visit.module.ts

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

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

@@ -894,4 +894,21 @@ export class MainService {
894 894
 	    headers: this.headers,
895 895
 	  });
896 896
 	}
897
+
898
+  // 返回附件上传url
899
+  returnUploadUrl(type, id): string {
900
+    return `${host.host}/common/common/uploadAttachment/${type}/${id}/${id}`;
901
+  }
902
+
903
+  // 返回excel导入url
904
+  returnImportExcelUrl(type): string {
905
+    return `${host.host}/user/data/importExcel/${type}`
906
+  }
907
+
908
+  // 设置责任部门
909
+	changeIncidentDuty(data): any {
910
+	  return this.http.post(host.host + "/incident/data/changeIncidentDuty", data, {
911
+	    headers: this.headers,
912
+	  });
913
+	}
897 914
 }

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

@@ -223,9 +223,6 @@ export class ToolService {
223 223
         case "commonFault":
224 224
           coopBtns.commonFault = true; //常见故障
225 225
           break;
226
-        case "handle":
227
-          coopBtns.handle = true; //处理
228
-          break;
229 226
         case "assign":
230 227
           coopBtns.assign = true; //指派
231 228
           break;
@@ -244,15 +241,15 @@ export class ToolService {
244 241
         case "callback":
245 242
           coopBtns.callback = true; //待我回访
246 243
           break;
247
-        case "badEvaluate":
248
-          coopBtns.badEvaluate = true; //异常评价
249
-          break;
250 244
         case "receive":
251 245
           coopBtns.receive = true; //接单
252 246
           break;
253 247
         case "transfer":
254 248
           coopBtns.transfer = true; //转派
255 249
           break;
250
+        case "visit":
251
+          coopBtns.visit = true; //回访
252
+          break;
256 253
       }
257 254
     });
258 255
     console.log(coopBtns);
@@ -345,4 +342,14 @@ export class ToolService {
345 342
     }
346 343
     return arr;
347 344
   }
345
+
346
+  /**
347
+   * @description 生成连续的数字
348
+   * @param {number} start 起点数字
349
+   * @param {number} end 终点数字
350
+   * @return {array}
351
+   */
352
+  generateNumberArray(start, end){
353
+    return Array.from(new Array(end + 1).keys()).slice(start);
354
+  }
348 355
 }

+ 2 - 0
src/app/share/inspection-execute-assign-prompt-modal/inspection-execute-assign-prompt-modal.component.ts

@@ -65,6 +65,8 @@ export class InspectionExecuteAssignPromptModalComponent implements OnInit {
65 65
         name: keyword,
66 66
         simpleQuery: true,
67 67
         menuId: 414,
68
+        roleCodes: 'inspectman',
69
+        engineer: 1,
68 70
       },
69 71
       idx: 0,
70 72
       sum: 20,

+ 24 - 22
src/app/share/wang-editor/wang-editor.component.ts

@@ -3,6 +3,7 @@ import WangEditor from 'wangeditor';
3 3
 import { HttpHeaders, HttpRequest, HttpClient  } from "@angular/common/http";
4 4
 import host from "../../../assets/js/http";
5 5
 import { NzMessageService } from "ng-zorro-antd";
6
+import { MainService } from 'src/app/services/main.service';
6 7
 
7 8
 @Component({
8 9
   selector: 'app-wang-editor',
@@ -10,16 +11,17 @@ import { NzMessageService } from "ng-zorro-antd";
10 11
   styleUrls: ['./wang-editor.component.less']
11 12
 })
12 13
 export class wangEditorComponent implements OnInit {
13
-	
14
+
14 15
 	@Output() changeContent = new EventEmitter();
15 16
 	@Input() content: string;
16 17
 	editor: any;
17 18
 	isLoading:boolean=false;
18 19
 	constructor(
19 20
 		private http: HttpClient,
20
-		private message: NzMessageService
21
+		private message: NzMessageService,
22
+    private mainService: MainService,
21 23
 	) { }
22
-	
24
+
23 25
   ngOnInit() {
24 26
 		// if(this.editor){
25 27
 		// 	this.editors()
@@ -27,7 +29,7 @@ export class wangEditorComponent implements OnInit {
27 29
 		this.editor = new WangEditor('#editorMenu', '#editor');
28 30
 		this.setEditorConfig()
29 31
   }
30
-	
32
+
31 33
 	// 编辑器相关配置设置
32 34
 	setEditorConfig () {
33 35
 		// 使用 base64 保存图片
@@ -41,15 +43,15 @@ export class wangEditorComponent implements OnInit {
41 43
 		// 自定义字体
42 44
 		this.editor.config.fontNames = this.getFontFamilyConfig();
43 45
 
44
-		// 上传图片大小 20M 
46
+		// 上传图片大小 20M
45 47
 		this.editor.config.uploadImgMaxSize = 20 * 1024 * 1024
46 48
 		// // 隐藏插入网络图片的功能
47 49
 		this.editor.config.showLinkImg = false
48
-		
50
+
49 51
 		// 上传视频大小 50M
50 52
 		this.editor.config.uploadVideoMaxSize = 50 * 1024 * 1024
51 53
 		this.editor.config.showLinkVideo = false
52
-		
54
+
53 55
 		// // 配置触发 onchange 的时间频率,默认为 200ms
54 56
 		this.editor.config.onchangeTimeout = 500 // 修改为 500ms
55 57
 		this.editor.config.customUploadImg = (resultFiles, insertImgFn) =>{
@@ -57,7 +59,7 @@ export class wangEditorComponent implements OnInit {
57 59
 				this.message.error('图片大小不能超过20M')
58 60
 				return
59 61
 			}
60
-			let url = `/service/common/common/uploadAttachment/solutionContent/0/0`
62
+			let url = this.mainService.returnUploadUrl('solutionContent', 0);
61 63
 			const formData = new FormData()
62 64
 			formData.append('file', resultFiles[0]);
63 65
 			formData.append('filename', resultFiles[0].name);
@@ -76,13 +78,13 @@ export class wangEditorComponent implements OnInit {
76 78
 				}
77 79
 			});
78 80
 		}
79
-		
81
+
80 82
 		this.editor.config.customUploadVideo = (resultFiles, insertVideoFn) =>{
81 83
 			if(resultFiles[0].size > this.editor.config.uploadVideoMaxSize){
82 84
 				this.message.error('视频大小不能超过50M')
83 85
 				return
84 86
 			}
85
-			let url = `/service/common/common/uploadAttachment/solutionContent/0/0`
87
+			let url = this.mainService.returnUploadUrl('solutionContent', 0);
86 88
 			const formData = new FormData()
87 89
 			formData.append('file', resultFiles[0]);
88 90
 			formData.append('filename', resultFiles[0].name);
@@ -101,19 +103,19 @@ export class wangEditorComponent implements OnInit {
101 103
 				}
102 104
 			});
103 105
 		}
104
-		
106
+
105 107
 		// 配置编辑器内容改变触发方法
106 108
 		this.editor.config.onchange = this.editorContentChange;
107 109
 		// 编辑器获取到焦点触发方法
108 110
 		this.editor.config.onfocus = this.editorOnFocus;
109 111
 		// 编辑器失去焦点触发方法
110 112
 		this.editor.config.onblur = this.editorOnBlur;
111
-		
113
+
112 114
 		this.editor.create();
113 115
 		// 设置内容
114 116
 		this.setContent()
115 117
 	}
116
-			
118
+
117 119
 	  // 获取显示菜单项
118 120
 	  getMenuConfig (): string[] {
119 121
 	    return [
@@ -139,7 +141,7 @@ export class wangEditorComponent implements OnInit {
139 141
 	      'redo'  // 重复
140 142
 	    ];
141 143
 	  }
142
-	
144
+
143 145
 	  // 获取字体、背景颜色列表配置
144 146
 	  getColorConfig(): string[] {
145 147
 	    return [
@@ -155,7 +157,7 @@ export class wangEditorComponent implements OnInit {
155 157
 	      '#ffffff'
156 158
 	    ];
157 159
 	  }
158
-	
160
+
159 161
 	  // 获取表情配置
160 162
 	  getEmotionsConfig() {
161 163
 	    return [
@@ -186,7 +188,7 @@ export class wangEditorComponent implements OnInit {
186 188
 	      }
187 189
 	    ];
188 190
 	  }
189
-	
191
+
190 192
 	  // 获取字体列表配置
191 193
 	  getFontFamilyConfig(): string[] {
192 194
 	    return [
@@ -197,29 +199,29 @@ export class wangEditorComponent implements OnInit {
197 199
 	      'Verdana'
198 200
 	    ];
199 201
 	  }
200
-		
202
+
201 203
 	  // 富文本编辑器内容变化触发方法
202 204
 	  editorContentChange = (html) => {
203 205
 			this.changeContent.emit(html)
204 206
 	    console.log(222,html);
205 207
 	  }
206
-	
208
+
207 209
 	  // 编辑器获取到焦点触发事件
208 210
 	  editorOnFocus = () => {
209 211
 	    console.log('on focus');
210 212
 	  }
211
-	
213
+
212 214
 	  // 编辑器失去焦点触发事件
213 215
 	  editorOnBlur = (html) => {
214 216
 			this.changeContent.emit(html)
215 217
 	  }
216
-	
218
+
217 219
 	  // 设置编辑器显示内容
218 220
 	  setContent() {
219 221
 			console.log(7777,this.content)
220 222
 	    this.editor.txt.html(this.content);
221 223
 	  }
222
-		
224
+
223 225
 		editors(){
224 226
 			this.editor.destroy()//销毁组件
225 227
 			this.editor = null
@@ -228,7 +230,7 @@ export class wangEditorComponent implements OnInit {
228 230
 	//   getContent() {
229 231
 	//     this.showMessage = this.editor.txt.html();
230 232
 	//   }
231
-	
233
+
232 234
 	//   // 获取编辑器文字内容
233 235
 	//   getContentText() {
234 236
 	//     this.showMessage = this.editor.txt.text();

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

@@ -37,7 +37,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
37 37
     private tool: ToolService,
38 38
     private http: HttpClient,
39 39
   ) {}
40
-	
40
+
41 41
   ngOnInit() {
42 42
     this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
43 43
       // this.getAllParentdepart(v).subscribe((result) => {
@@ -66,7 +66,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
66 66
   validateForm: FormGroup; //新增/编辑表单
67 67
   coopId: number; //表格中执行操作的id
68 68
   department: ""; //所属科室
69
-	hosId: number; 
69
+	hosId: number;
70 70
 	dateRange;//时间
71 71
   batchNumber; //批次号
72 72
   num; //编码
@@ -137,7 +137,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
137 137
     this.maskFlag = this.message.loading("正在导入中..", {
138 138
       nzDuration: 0,
139 139
     }).messageId;
140
-    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/department', formData, {
140
+    const req = new HttpRequest('Post', this.mainService.returnImportExcelUrl('department'), formData, {
141 141
       reportProgress: true
142 142
     });
143 143
     this.http
@@ -306,7 +306,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
306 306
         that.listLength = data.totalNum;
307 307
       });
308 308
   }
309
-	
309
+
310 310
 	// 日期选择
311 311
 	startDate: string; //发起时间开始
312 312
 	endDate: string; //发起时间结束
@@ -318,7 +318,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
318 318
 	  this.startDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
319 319
 	  this.endDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
320 320
 	}
321
-	
321
+
322 322
 	// 获取所有科室
323 323
   // snum = 0;
324 324
   getDeparts(dept) {
@@ -342,7 +342,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
342 342
 			},500)
343 343
 		});
344 344
   }
345
-	
345
+
346 346
   // 获取所有院区
347 347
   getAllHospital() {
348 348
 		this.getDeparts('')
@@ -360,7 +360,7 @@ export class AdminOfficePrescriptionComponent implements OnInit{
360 360
     let hid;
361 361
     if (hospitalId || hospitalId == 0) {
362 362
       hid = hospitalId - 0;
363
-    } 
363
+    }
364 364
 		// else {
365 365
   //     hid = this.hospital - 0;
366 366
   //   }

+ 1 - 1
src/app/views/building-floor/building-floor.component.ts

@@ -121,7 +121,7 @@ export class BuildingFloorComponent implements OnInit {
121 121
     this.maskFlag = this.message.loading("正在导入中..", {
122 122
       nzDuration: 0,
123 123
     }).messageId;
124
-    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/building', formData, {
124
+    const req = new HttpRequest('Post', this.mainService.returnImportExcelUrl('building'), formData, {
125 125
       reportProgress: true
126 126
     });
127 127
     this.http

+ 20 - 8
src/app/views/incident-management/incident-management.component.html

@@ -60,11 +60,11 @@
60 60
             <th nzWidth="5%">序号</th>
61 61
             <th nzWidth="27%">故障信息</th>
62 62
             <th nzWidth="14%">详细地址</th>
63
-            <th nzWidth="14%">联系信息</th>
63
+            <th nzWidth="12%">联系信息</th>
64 64
             <th nzWidth="12%">受理人|处理人/组</th>
65 65
             <th nzWidth="10%">延期记录</th>
66 66
             <th nzWidth="8%">状态</th>
67
-            <th nzWidth="10%">操作</th>
67
+            <th nzWidth="12%">操作</th>
68 68
           </tr>
69 69
         </thead>
70 70
         <tbody>
@@ -90,20 +90,20 @@
90 90
             <td>
91 91
               {{ data.acceptUser?.name || '无' }}<br>
92 92
               {{ transferSynergetic(data) }}<br>
93
-              <span [ngStyle]="{ color: data.handleColourInfo.value }">{{ data.overdueTime | date: 'MM-dd HH:mm' }}</span>前接单
93
+              <span [ngStyle]="{ color: data.handleColourInfo ? data.handleColourInfo.value : '' }">{{ data.overdueTime | date: 'MM-dd HH:mm' }}</span>前接单
94 94
             </td>
95 95
             <td [innerHTML]="transferHandlerLog(data.currentLog)"></td>
96 96
             <td>{{ data.state?.name }}</td>
97 97
             <td>
98 98
               <div class="coop">
99
-                <span *ngIf="coopBtns.look" (click)="detail($event,data.id)">查看</span>
100
-                <!-- <span *ngIf="coopBtns.edit" (click)="detail($event,data.id)">编辑</span> -->
99
+                <span *ngIf="coopBtns.look" (click)="detail($event,data)">查看</span>
100
+                <span *ngIf="computedVisit(data)" (click)="visit($event,data)">回访</span>
101 101
                 <span *ngIf="computedReceive(data)" (click)="showDelModal($event, data,'您确认要接单吗?','接单','receive')">接单</span>
102 102
                 <span *ngIf="computedHandle(data)" (click)="handle($event,data)">处理</span>
103 103
                 <span *ngIf="computedSubstitution(data)" (click)="substitution($event,data)">换人处理</span>
104
-                <span *ngIf="coopBtns.postpone" (click)="detail($event,data.id)">延期处理</span>
105
-                <span *ngIf="coopBtns.settings" (click)="detail($event,data.id)">设置责任科室</span>
106
-                <span *ngIf="coopBtns.del" (click)="showDelModal($event, data,'您确认要删除吗?','删除','del')">删除</span>
104
+                <span *ngIf="computedPostpone(data)" (click)="postpone($event,data)">延期处理</span>
105
+                <span *ngIf="computedSetDuty(data)" (click)="setDuty($event,data)">设置责任部门</span>
106
+                <span *ngIf="coopBtns.del && data.deleteFlag !== 1" (click)="showDelModal($event, data,'您确认要删除吗?','删除','del')">删除</span>
107 107
               </div>
108 108
             </td>
109 109
           </tr>
@@ -181,3 +181,15 @@
181 181
 
182 182
 <!-- 换人处理 -->
183 183
 <app-incident-substitution [id]="coopData.id" *ngIf="substitutionModalShow" (closeModelHs)="closeSubstitutionModelOrder($event)" (confirmModelHs)="confirmSubstitutionModelOrder($event)"></app-incident-substitution>
184
+
185
+<!-- 设置责任部门 -->
186
+<app-incident-setduty [id]="coopData.id" *ngIf="setdutyModalShow" (closeModelHs)="closeSetdutyModelOrder($event)" (confirmModelHs)="confirmSetdutyModelOrder($event)"></app-incident-setduty>
187
+
188
+<!-- 延期处理 -->
189
+<app-incident-postpone [id]="coopData.id" *ngIf="postponeModalShow" (closeModelHs)="closePostponeModelOrder($event)" (confirmModelHs)="confirmPostponeModelOrder($event)"></app-incident-postpone>
190
+
191
+<!-- 回访 -->
192
+<app-incident-visit [id]="coopData.id" *ngIf="visitModalShow" (closeModelHs)="closeVisitModelOrder($event)" (confirmModelHs)="confirmVisitModelOrder($event)"></app-incident-visit>
193
+
194
+<!-- 详情 -->
195
+<app-incident-detail [id]="coopData.id" *ngIf="detailModalShow" (closeModelHs)="closeDetailModelOrder($event)" (confirmModelHs)="confirmDetailModelOrder($event)"></app-incident-detail>

+ 86 - 4
src/app/views/incident-management/incident-management.component.ts

@@ -214,9 +214,9 @@ export class IncidentManagementComponent implements OnInit {
214 214
     if(currentLog.extra1DTO && currentLog.extra2 && currentLog.startTime){
215 215
         if(currentLog.extra2==0.5){
216 216
           currentLog.extra2 = 4;
217
-          return currentLog.extra1DTO.name+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日")+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
217
+          return currentLog.extra1DTO.name+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日")+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
218 218
         }else{
219
-          return currentLog.extra1DTO.name+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
219
+          return currentLog.extra1DTO.name+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
220 220
         }
221 221
     }else{
222 222
         return '无';
@@ -253,6 +253,21 @@ export class IncidentManagementComponent implements OnInit {
253 253
     return data.state.value === 'pending' || data.state.value === 'handler' || (data.state.value === 'reassign' && this.coopBtns.assign) && data.deleteFlag !== 1;
254 254
   }
255 255
 
256
+  // 是否显示延期处理按钮
257
+  computedPostpone(data){
258
+    return this.coopBtns.postpone && data.state.value == 'handler' && data.handlingPersonnelUser && data.handlingPersonnelUser.id == this.tool.getCurrentUserId() && data.deleteFlag !== 1;
259
+  }
260
+
261
+  // 是否显示设置责任部门按钮
262
+  computedSetDuty(data){
263
+    return this.coopBtns.settings && (data.state.value == 'resolved' || data.state.value == 'close') && data.deleteFlag !== 1;
264
+  }
265
+
266
+  // 是否显示回访按钮
267
+  computedVisit(data){
268
+    return this.coopBtns.visit && data.state.value == 'close' && data.deleteFlag !== 1;
269
+  }
270
+
256 271
   // 表格数据
257 272
   loading1 = false;
258 273
   getList(isInit = false) {
@@ -401,9 +416,76 @@ export class IncidentManagementComponent implements OnInit {
401 416
     this.debounceSubject.next(false);
402 417
   }
403 418
 
404
-  // 查看
405
-  detail(e, id) {
419
+  // 设置责任部门-弹窗
420
+  setdutyModalShow = false; //弹窗开关
421
+  setDuty(e, data) {
422
+    e.stopPropagation();
423
+    this.coopData = data;
424
+    this.setdutyModalShow = true;
425
+  }
426
+  // 关闭弹窗
427
+  closeSetdutyModelOrder(e) {
428
+    this.setdutyModalShow = JSON.parse(e).show;
429
+  }
430
+  // 弹窗确定
431
+  confirmSetdutyModelOrder(e){
432
+    console.log(e);
433
+    this.setdutyModalShow = false;
434
+    this.getList(true);
435
+  }
436
+
437
+  // 回访-弹窗
438
+  visitModalShow = false; //弹窗开关
439
+  visit(e, data) {
406 440
     e.stopPropagation();
441
+    this.coopData = data;
442
+    this.visitModalShow = true;
443
+  }
444
+  // 关闭弹窗
445
+  closeVisitModelOrder(e) {
446
+    this.visitModalShow = JSON.parse(e).show;
447
+  }
448
+  // 弹窗确定
449
+  confirmVisitModelOrder(e){
450
+    console.log(e);
451
+    this.visitModalShow = false;
452
+    this.getList(true);
453
+  }
454
+
455
+  // 详情-弹窗
456
+  detailModalShow = false; //弹窗开关
457
+  detail(e, data) {
458
+    e.stopPropagation();
459
+    this.coopData = data;
460
+    this.detailModalShow = true;
461
+  }
462
+  // 关闭弹窗
463
+  closeDetailModelOrder(e) {
464
+    this.detailModalShow = JSON.parse(e).show;
465
+  }
466
+  // 弹窗确定
467
+  confirmDetailModelOrder(e){
468
+    console.log(e);
469
+    this.detailModalShow = false;
470
+    this.getList(true);
471
+  }
472
+
473
+  // 延期处理-弹窗
474
+  postponeModalShow = false; //弹窗开关
475
+  postpone(e, data) {
476
+    e.stopPropagation();
477
+    this.coopData = data;
478
+    this.postponeModalShow = true;
479
+  }
480
+  // 关闭弹窗
481
+  closePostponeModelOrder(e) {
482
+    this.postponeModalShow = JSON.parse(e).show;
483
+  }
484
+  // 弹窗确定
485
+  confirmPostponeModelOrder(e){
486
+    console.log(e);
487
+    this.postponeModalShow = false;
488
+    this.getList(true);
407 489
   }
408 490
 
409 491
   delModal: boolean = false; //删除模态框

+ 8 - 0
src/app/views/incident-management/incident-management.module.ts

@@ -6,6 +6,10 @@ import { IncidentManagementComponent } from './incident-management.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { IncidentHandleModule } from 'src/app/components/incidentManagement/incident-handle/incident-handle.module';
8 8
 import { IncidentSubstitutionModule } from 'src/app/components/incidentManagement/incident-substitution/incident-substitution.module';
9
+import { IncidentSetdutyModule } from 'src/app/components/incidentManagement/incident-setduty/incident-setduty.module';
10
+import { IncidentPostponeModule } from 'src/app/components/incidentManagement/incident-postpone/incident-postpone.module';
11
+import { IncidentVisitModule } from 'src/app/components/incidentManagement/incident-visit/incident-visit.module';
12
+import { IncidentDetailModule } from 'src/app/components/incidentManagement/incident-detail/incident-detail.module';
9 13
 
10 14
 
11 15
 @NgModule({
@@ -18,6 +22,10 @@ import { IncidentSubstitutionModule } from 'src/app/components/incidentManagemen
18 22
     ShareModule,
19 23
     IncidentHandleModule,
20 24
     IncidentSubstitutionModule,
25
+    IncidentSetdutyModule,
26
+    IncidentPostponeModule,
27
+    IncidentVisitModule,
28
+    IncidentDetailModule,
21 29
   ]
22 30
 })
23 31
 export class IncidentManagementModule { }

+ 2 - 0
src/app/views/inspection-plan-config/inspection-plan-config.component.ts

@@ -186,6 +186,8 @@ export class InspectionPlanConfigComponent implements OnInit, AfterViewInit {
186 186
         name: keyword,
187 187
         simpleQuery: true,
188 188
         menuId: 414,
189
+        roleCodes: 'inspectman',
190
+        engineer: 1,
189 191
       },
190 192
       idx: 0,
191 193
       sum: 10,

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

@@ -131,7 +131,7 @@ export class OfficeManagementComponent implements OnInit {
131 131
     this.maskFlag = this.message.loading("正在导入中..", {
132 132
       nzDuration: 0,
133 133
     }).messageId;
134
-    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/department', formData, {
134
+    const req = new HttpRequest('Post', this.mainService.returnImportExcelUrl('department'), formData, {
135 135
       reportProgress: true
136 136
     });
137 137
     this.http

+ 1 - 1
src/app/views/repository-manage-add/repository-manage-add.component.ts

@@ -398,7 +398,7 @@ export class RepositoryManageAddComponent implements OnInit {
398 398
 
399 399
 	// 上传图片
400 400
 	uploadFile(id){
401
-		let url = `/service/common/common/uploadAttachment/solution/${id}/${id}`
401
+		let url = this.mainService.returnUploadUrl('solution', id);
402 402
 		for(let i of this.fileData){//新上传的附件
403 403
 			const formData = new FormData()
404 404
 			let item = this.fileAllData.find(t=>t.id == i.uid) //之前的附件

+ 2 - 2
src/app/views/sys-config/sys-config.component.html

@@ -21,7 +21,7 @@
21 21
           <nz-form-control [nzSpan]="24" nzErrorTip="请选择系统logo!">
22 22
             <nz-upload nzFor="logo"
23 23
               class="avatar-uploader"
24
-              nzAction="/service/common/common/uploadAttachment/sysLogo/777/777"
24
+              [nzAction]="sysLogoUrl"
25 25
               [nzCustomRequest]="customReq"
26 26
               nzName="file"
27 27
               nzListType="picture-card"
@@ -42,7 +42,7 @@
42 42
           <nz-form-control [nzSpan]="24" nzErrorTip="请选择系统favicon图标!">
43 43
             <nz-upload nzFor="favicon"
44 44
               class="avatar-uploader"
45
-              nzAction="/service/common/common/uploadAttachment/faviconLogo/777/777"
45
+              [nzAction]="faviconLogoUrl"
46 46
               [nzCustomRequest]="customReq"
47 47
               nzName="file"
48 48
               nzListType="picture-card"

+ 3 - 0
src/app/views/sys-config/sys-config.component.ts

@@ -29,6 +29,9 @@ export class SysConfigComponent implements OnInit {
29 29
   formatterSecond = (value: number) => `${value} 秒`;
30 30
   parserSecond = (value: string) => value.replace(' 秒', '');
31 31
   menu = JSON.parse(localStorage.getItem("menu")) || []; //菜单
32
+
33
+  sysLogoUrl:string =  this.mainService.returnUploadUrl('sysLogo', 777);
34
+  faviconLogoUrl:string =  this.mainService.returnUploadUrl('faviconLogo', 777);
32 35
   constructor(
33 36
     private mainService: MainService,
34 37
     private fb: FormBuilder,

+ 1 - 1
src/app/views/users-management/users-management.component.ts

@@ -134,7 +134,7 @@ export class UsersManagementComponent implements OnInit {
134 134
     this.maskFlag = this.message.loading("正在导入中..", {
135 135
       nzDuration: 0,
136 136
     }).messageId;
137
-    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/user', formData, {
137
+    const req = new HttpRequest('Post', this.mainService.returnImportExcelUrl('user'), formData, {
138 138
       reportProgress: true
139 139
     });
140 140
     this.http