seimin před 8 měsíci
rodič
revize
83860cf11f

+ 1 - 1
proxy.conf.json

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

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

@@ -191,6 +191,30 @@ export class ToolService {
191 191
         case "commonFault":
192 192
           coopBtns.commonFault = true; //常见故障
193 193
           break;
194
+        case "handle":
195
+          coopBtns.handle = true; //处理
196
+          break;
197
+        case "substitution":
198
+          coopBtns.substitution = true; //换人处理
199
+          break;
200
+        case "postpone":
201
+          coopBtns.postpone = true; //延期处理
202
+          break;
203
+        case "settings":
204
+          coopBtns.settings = true; //设置
205
+          break;
206
+        case "all":
207
+          coopBtns.all = true; //全部故障
208
+          break;
209
+        case "reassign":
210
+          coopBtns.reassign = true; //重新指派
211
+          break;
212
+        case "callback":
213
+          coopBtns.callback = true; //待我回访
214
+          break;
215
+        case "badEvaluate":
216
+          coopBtns.badEvaluate = true; //异常评价
217
+          break;
194 218
       }
195 219
     });
196 220
     console.log(coopBtns);

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

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

+ 143 - 0
src/app/views/incident-management/incident-management.component.html

@@ -0,0 +1,143 @@
1
+<div class="list-template pt0">
2
+  <div class="list-template__content">
3
+    <div class="list-template__tab">
4
+      <div class="list-template__tabItem" [ngClass]="{'active': queryTask == item.key}" (click)="changeTab(item.key)" *ngFor="let item of tabs">{{item.value}}({{item.num}})</div>
5
+    </div>
6
+    <div class="list-template__top" nz-row>
7
+      <div nz-col nzXl='18' class="list-template__searchBox">
8
+        <div class="list-template__searchItem">
9
+          <span class="label">登记时间</span>:
10
+          <nz-range-picker style="width: 373px;" nzShowTime [(ngModel)]="searchDTO.dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)"></nz-range-picker>
11
+        </div>
12
+        <div class="list-template__searchItem">
13
+          <span class="label">事件单号</span>:
14
+          <input nz-input class="formItem" placeholder="请输入事件单号" [(ngModel)]="searchDTO.gdcode" />
15
+        </div>
16
+        <div class="list-template__searchItem">
17
+          <span class="label">报修科室</span>:
18
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
19
+            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="searchDTO.department">
20
+            <ng-container *ngFor="let option of alldepart">
21
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
22
+            </ng-container>
23
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
24
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
25
+            </nz-option>
26
+          </nz-select>
27
+        </div>
28
+        <div class="list-template__searchItem">
29
+          <span class="label">状态</span>:
30
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
31
+            nzPlaceHolder="请选择状态" [(ngModel)]="gdState">
32
+            <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of gdStates"></nz-option>
33
+          </nz-select>
34
+        </div>
35
+        <div class="list-template__searchItem">
36
+          <span class="label">处理人</span>:
37
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
38
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择处理人" [(ngModel)]="worker">
39
+            <ng-container *ngFor="let option of allWorker">
40
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
41
+            </ng-container>
42
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
43
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
44
+            </nz-option>
45
+          </nz-select>
46
+        </div>
47
+      </div>
48
+      <div nz-col nzXl='6' class="list-template__btns">
49
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
50
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
51
+        <button nz-button *ngIf="coopBtns.export" class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
52
+        <button nz-button class="btn default ml8" (click)='reset()'>详细搜索</button>
53
+      </div>
54
+    </div>
55
+    <div class="list-template__bottom">
56
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
57
+        [nzLoading]="loading1">
58
+        <thead>
59
+          <tr class="thead">
60
+            <th nzWidth="5%">序号</th>
61
+            <th nzWidth="27%">故障信息</th>
62
+            <th nzWidth="14%">详细地址</th>
63
+            <th nzWidth="14%">联系信息</th>
64
+            <th nzWidth="12%">受理人|处理人/组</th>
65
+            <th nzWidth="10%">延期记录</th>
66
+            <th nzWidth="8%">状态</th>
67
+            <th nzWidth="10%">操作</th>
68
+          </tr>
69
+        </thead>
70
+        <tbody>
71
+          <tr *ngFor="let data of listOfData;let index=index;">
72
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
73
+            <td class="text_align_left"><span class="red">极高</span> SJ2408030022 2024-08-03 08:45电类-电器插座空开-安装电线线路插座,需要3个插座,联系电话137774177017,周一要开诊</td>
74
+            <td class="text_align_left">南院区<br>神经内科Ⅰ<br>行政办公楼5楼办公室A</td>
75
+            <td class="text_align_left">廖小明<br>联电:18711111111<br>来电:18711111111</td>
76
+            <td>王满<br>水电组<br><span class="red">08-03 08:45</span>前接单</td>
77
+            <td>次日维修<br>06月28日<br>01时00分前完成</td>
78
+            <td>已关闭</td>
79
+            <td>
80
+              <div class="coop">
81
+                <span *ngIf="coopBtns.look" (click)="detail($event,data.id)">查看</span>
82
+                <span *ngIf="coopBtns.del&&data.gdState.value!=6&&data.gdState.value!=7"
83
+                  (click)="showDelModal($event,data.id)">删除</span>
84
+              </div>
85
+            </td>
86
+          </tr>
87
+        </tbody>
88
+      </nz-table>
89
+      <div class="list-template__pagination">
90
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
91
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
92
+        </nz-pagination>
93
+      </div>
94
+    </div>
95
+  </div>
96
+  <!-- 删除模态框 -->
97
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="loading3"
98
+    (confirmDelEvent)="confirmDel()" content="您确认要删除工单吗?"></app-dialog-delete>
99
+
100
+</div>
101
+<!-- 操作成功/失败提示框 -->
102
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
103
+  [info]="promptInfo"></app-prompt-modal>
104
+
105
+<!-- 详细搜索模态框 -->
106
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="searchModal">
107
+  <div class="modalBody">
108
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideSearchModal()"></i></div>
109
+    <div class="content">
110
+      <form nz-form [formGroup]="validateSearchForm" class="addForm">
111
+        <nz-form-item>
112
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="name">故障现象</nz-form-label>
113
+          <nz-form-control [nzSpan]="19" nzErrorTip="请输入故障现象!">
114
+            <nz-input-group>
115
+                <input formControlName="name" nz-input placeholder="请输入故障现象">
116
+            </nz-input-group>
117
+          </nz-form-control>
118
+        </nz-form-item>
119
+        <nz-form-item>
120
+          <nz-form-label [nzSpan]="5" nzFor="user">受理人</nz-form-label>
121
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择受理人!">
122
+            <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
123
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择受理人" formControlName="user">
124
+            <ng-container *ngFor="let option of allWorker">
125
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
126
+            </ng-container>
127
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
128
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
129
+            </nz-option>
130
+          </nz-select>
131
+          </nz-form-control>
132
+        </nz-form-item>
133
+      </form>
134
+    </div>
135
+    <div class="display_flex justify-content_flex-center">
136
+      <button nzType="primary" nz-button (click)="submitSearchForm()" [nzLoading]="btnLoading">确认搜索</button>
137
+      <button class="btn cancel" nz-button nzType="default" (click)="hideSearchModal()">取消</button>
138
+    </div>
139
+  </div>
140
+</div>
141
+
142
+<!-- 查看详情 -->
143
+<router-outlet></router-outlet>

+ 220 - 0
src/app/views/incident-management/incident-management.component.less

@@ -0,0 +1,220 @@
1
+@import "../../../../src/theme.less";
2
+
3
+.save {
4
+  position: fixed;
5
+  left: 0;
6
+  top: 0;
7
+  width: 100%;
8
+  height: 100%;
9
+  background: rgba(0, 0, 0, 0.4);
10
+  z-index: 99;
11
+
12
+  .modalBody {
13
+    width: 1000px;
14
+    background: #fff;
15
+    border-radius: 5px;
16
+    padding: 10px 20px;
17
+    color: #333;
18
+
19
+    .title {
20
+      width: 100%;
21
+      text-align: center;
22
+      font-size: 18px;
23
+      position: relative;
24
+
25
+      i {
26
+        position: absolute;
27
+        right: 0;
28
+        top: 0;
29
+        font-size: 20px;
30
+        color: #666;
31
+        cursor: pointer;
32
+        padding: 0 5px;
33
+      }
34
+    }
35
+
36
+    .content {
37
+      width: 100%;
38
+      border: 1px solid #e5e9ed;
39
+      border-radius: 5px;
40
+      overflow: hidden;
41
+      margin-top: 12px;
42
+
43
+      // 意见箱查看
44
+      .conItem {
45
+        color: #333;
46
+
47
+        .jiTit {
48
+          height: 50px;
49
+          line-height: 50px;
50
+          border-bottom: 1px solid #e5e9ed;
51
+          padding: 0 32px;
52
+        }
53
+
54
+        .defeat {
55
+          font-size: 14px;
56
+          color: #333;
57
+          padding: 15px 32px;
58
+          min-height: 125px;
59
+        }
60
+
61
+        &.noCon {
62
+          background: #f9fafb;
63
+          padding: 16px 32px 24px 32px;
64
+          border-top: 1px solid #e5e9ed;
65
+
66
+          .title {
67
+            text-align: left;
68
+            font-size: 14px;
69
+            margin-bottom: 8px;
70
+          }
71
+
72
+          textarea {
73
+            min-height: 210px;
74
+          }
75
+        }
76
+      }
77
+    }
78
+
79
+    button {
80
+      margin-top: 10px;
81
+      margin-left: 10px;
82
+    }
83
+  }
84
+
85
+  .txtL {
86
+    text-align: left !important;
87
+  }
88
+
89
+  .txtR {
90
+    text-align: right !important;
91
+  }
92
+}
93
+//删除
94
+.saveDel {
95
+  position: fixed;
96
+  left: 0;
97
+  top: 0;
98
+  width: 100%;
99
+  height: 100%;
100
+  background: rgba(0, 0, 0, 0.4);
101
+  z-index: 99;
102
+
103
+  .modalBody {
104
+    width: 350px;
105
+    height: 220px;
106
+    background: #fff;
107
+    border-radius: 5px;
108
+    padding: 10px 20px;
109
+    color: #333;
110
+
111
+    .title {
112
+      width: 100%;
113
+      text-align: center;
114
+      font-size: 18px;
115
+      position: relative;
116
+
117
+      i {
118
+        position: absolute;
119
+        right: 0;
120
+        top: 0;
121
+        font-size: 20px;
122
+        color: #666;
123
+        cursor: pointer;
124
+        padding: 0 5px;
125
+      }
126
+    }
127
+
128
+    .content {
129
+      width: 310px;
130
+      height: 117px;
131
+      background: #f9fafb;
132
+      border: 1px solid #e5e9ed;
133
+      border-radius: 5px;
134
+      overflow: hidden;
135
+      margin-top: 12px;
136
+
137
+      div {
138
+        text-align: center;
139
+        margin: 0;
140
+
141
+        &.icon {
142
+          margin-top: 17px;
143
+
144
+          i {
145
+            color: #34b349;
146
+            font-size: 30px !important;
147
+
148
+            &.transport-wenhao {
149
+              color: #f5a523;
150
+            }
151
+
152
+            &.transport-shibai {
153
+              color: #ff3a52;
154
+            }
155
+          }
156
+        }
157
+
158
+        &.defeat {
159
+          color: #333;
160
+          font-size: 18px;
161
+        }
162
+
163
+        &:nth-child(3) {
164
+          font-size: 14px;
165
+          color: #666;
166
+        }
167
+      }
168
+    }
169
+
170
+    button {
171
+      margin-top: 10px;
172
+
173
+      &.btn {
174
+        margin-left: 8px;
175
+      }
176
+    }
177
+  }
178
+
179
+  // 新增
180
+  &.add {
181
+    .modalBody {
182
+      width: 480px;
183
+      height: auto;
184
+
185
+      .content {
186
+        width: 100%;
187
+        height: auto;
188
+        padding: 18px 14px 0 14px;
189
+
190
+        .addForm {
191
+          .ant-form-item {
192
+            margin-bottom: 15px;
193
+
194
+            .ant-form-item-label {
195
+              line-height: 0;
196
+              text-align: left;
197
+            }
198
+          }
199
+        }
200
+
201
+        .editForm {
202
+          .ant-form-item {
203
+            margin-bottom: 15px;
204
+
205
+            .ant-form-item-label {
206
+              line-height: 0;
207
+              text-align: left;
208
+            }
209
+          }
210
+        }
211
+      }
212
+
213
+      button {
214
+        &:nth-child(1) {
215
+          margin-right: 20px;
216
+        }
217
+      }
218
+    }
219
+  }
220
+}

+ 443 - 0
src/app/views/incident-management/incident-management.component.ts

@@ -0,0 +1,443 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+
4
+import { MainService } from "../../services/main.service";
5
+import { ToolService } from "../../services/tool.service";
6
+import { Subject } from "rxjs";
7
+import { debounceTime } from "rxjs/operators";
8
+import { NzMessageService } from 'ng-zorro-antd/message';
9
+import { format } from 'date-fns';
10
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
11
+@Component({
12
+  selector: "app-incident-management",
13
+  templateUrl: "./incident-management.component.html",
14
+  styleUrls: ["./incident-management.component.less"],
15
+})
16
+export class IncidentManagementComponent implements OnInit {
17
+  constructor(
18
+    public route: ActivatedRoute,
19
+    private router: Router,
20
+    private mainService: MainService,
21
+    private tool: ToolService,
22
+    private message: NzMessageService,
23
+    private fb: FormBuilder,
24
+  ) {}
25
+  loginUser: any = localStorage.getItem("user")
26
+    ? JSON.parse(localStorage.getItem("user")).user
27
+    : null; //登录人信息
28
+  listOfData: any[] = []; //表格数据
29
+  coopId: string; //表格中执行操作的id
30
+  hospital: string; //选中院区
31
+  alldepart: any = []; //当前院区所属科室
32
+  worker: number; //选择执行配送人员
33
+  allWorker: any = []; //当前院区执行配送人员列表
34
+  gdState: number; //选择工单状态
35
+  gdStates: any; //工单状态列表
36
+  pageIndex: number = 1; //页码
37
+  listLength: number = 10; //总条数
38
+  pageSize: number = 10; //每页条数
39
+
40
+  promptContent: string; //操作提示框提示信息
41
+  ifSuccess: boolean; //操作成功/失败
42
+  promptInfo: string; //操作结果提示信息
43
+  promptModalShow: boolean; //操作提示框是否展示
44
+
45
+  btnLoading: boolean = false; //提交按钮loading状态
46
+
47
+  tabs:any[] = [
48
+    // {key: 'all', value: '全部故障', num: 0},
49
+    {key: 'todo', value: '待我接单', num: 0},
50
+    {key: 'doing', value: '待我处理', num: 0},
51
+    // {key: 'reassign', value: '重新指派', num: 0},
52
+    // {key: 'callback', value: '待我回访', num: 0},
53
+    {key: 'resolve', value: '由我解决', num: 0},
54
+    {key: 'owns', value: '与我关联', num: 0},
55
+    {key: 'storage', value: '暂存', num: 0},
56
+    // {key: 'badEvaluate', value: '异常评价', num: 0},
57
+  ]
58
+
59
+  searchDTO: any = {};
60
+
61
+  searchTimerSubject = new Subject();
62
+
63
+  // 初始化增删改按钮
64
+  coopBtns: any = {};
65
+
66
+  // 选择tab
67
+  queryTask:string = 'todo';//默认待我接单
68
+  changeTab(key){
69
+    this.queryTask = key;
70
+  }
71
+
72
+  ngOnInit() {
73
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
74
+      let fun = v[0];
75
+      fun.call(this, v[1]);
76
+    });
77
+    this.coopBtns = this.tool.initCoopBtns(this.route);
78
+    this.initTabs();
79
+    this.getAllHos();
80
+    this.getGdStates();
81
+  }
82
+
83
+  // 初始化tab
84
+  initTabs(){
85
+    if (this.coopBtns.all) {
86
+        this.tabs.splice(0, 0 , {key: 'all', value: '全部故障', num: 0});
87
+    }
88
+    if (this.coopBtns.callback) {
89
+        let index = this.tabs.findIndex(v => v.key == 'resolve');
90
+        this.tabs.splice(index, 0 , {key: 'callback', value: '待我回访', num: 0});
91
+    }
92
+    if (this.coopBtns.reassign) {
93
+        let index = this.tabs.findIndex(v => v.key == 'doing');
94
+        this.tabs.splice(index + 1, 0 , {key: 'reassign', value: '重新指派', num: 0});
95
+    }
96
+    if (this.coopBtns.badEvaluate) {
97
+        this.tabs.push({key: 'badEvaluate', value: '异常评价', num: 0});
98
+    }
99
+  }
100
+
101
+  // 搜索
102
+  search() {
103
+    this.pageIndex = 1;
104
+    this.getList();
105
+  }
106
+  // 重置
107
+  reset() {
108
+    this.pageIndex = 1;
109
+    if (!(this.coopBtns.currentDept && !this.coopBtns.allOrders)) {
110
+      this.searchDTO.department = null;
111
+    }
112
+    if (!(this.coopBtns.currentUser && !this.coopBtns.allOrders)) {
113
+      this.worker = null;
114
+    }
115
+    this.gdState = null;
116
+    this.searchDTO = {};
117
+    this.changeDate();
118
+    this.getList();
119
+  }
120
+
121
+  // 获取院区
122
+  getAllHos() {
123
+    this.hospital = this.tool.getCurrentHospital().id + "";
124
+    this.changeHos();
125
+  }
126
+  // 修改院区获取对应科室,工单类型,执行配送人员
127
+  changeHos() {
128
+    this.searchDTO.department = null;
129
+    this.worker = null;
130
+    this.getDeparts();
131
+    this.getAllWorker();
132
+  }
133
+
134
+  // 获取配送人员
135
+  getAllWorker(e?, those?) {
136
+    let that = those || this;
137
+    let postData = {
138
+      user: {
139
+        name: e || "",
140
+        hospital: { id: that.hospital },
141
+        usertype: { id: 106 }, //配送人员
142
+      },
143
+      idx: 0,
144
+      sum: 20,
145
+    };
146
+    that.isLoading = true;
147
+    that.mainService
148
+      .getFetchDataList("data", "user", postData)
149
+      .subscribe((data) => {
150
+        that.allWorker = data.list;
151
+        that.isLoading = false;
152
+      });
153
+  }
154
+
155
+  onCalendarChangeDate(dateArr){
156
+    console.log(dateArr)
157
+    if(dateArr.length == 2){
158
+      let dateStart = new Date(dateArr[0]);
159
+      let dateEnd = new Date(dateArr[1]);
160
+      dateStart.setHours(0,0,0);
161
+      dateEnd.setHours(23,59,59);
162
+      this.searchDTO.dateRange = [dateStart,dateEnd];
163
+    }
164
+  }
165
+  // 表格数据
166
+  loading1 = false;
167
+  getList() {
168
+    var that = this;
169
+    let data: any = {
170
+      idx: that.pageIndex - 1,
171
+      sum: that.pageSize,
172
+      workOrder: {
173
+        worker: { id: that.worker },
174
+        gdState: { id: that.gdState },
175
+        gdcode: this.searchDTO.gdcode,
176
+        createDept: that.searchDTO.department,
177
+        hosId: that.hospital,
178
+      },
179
+    };
180
+
181
+    if (!data.workOrder.worker.id) {
182
+      delete data.workOrder.worker;
183
+    }
184
+    if (!data.workOrder.gdState.id) {
185
+      delete data.workOrder.gdState;
186
+    }
187
+    if (
188
+      data.workOrder.specialCloseFlag === undefined ||
189
+      data.workOrder.specialCloseFlag === null
190
+    ) {
191
+      delete data.workOrder.specialCloseFlag;
192
+    }
193
+    if (!data.workOrder.createDept) {
194
+      delete data.workOrder.createDept;
195
+    }
196
+    delete data.workOrder.overdueTime24;
197
+    delete data.workOrder.startTime1;
198
+    delete data.workOrder.endTime1;
199
+    if (false) {
200
+      data.workOrder.overdueTime24 = true;
201
+    } else if (that.startDate && that.endDate) {
202
+      data.workOrder.startTime1 = that.startDate;
203
+      data.workOrder.endTime1 = that.endDate;
204
+    }
205
+    that.loading1 = true;
206
+    that.mainService
207
+      .getFetchDataList("data", "workOrder", data)
208
+      .subscribe((result) => {
209
+        that.loading1 = false;
210
+        that.listOfData = result.list.map(v => ({...v, endDeptsName: v.endDepts ? v.endDepts.map(v => v.dept).toString() : ''}));
211
+        that.listLength = result.totalNum;
212
+      });
213
+  }
214
+
215
+  // 获取所有科室
216
+  getDeparts(dept?) {
217
+    let data = {
218
+      department: {
219
+        cascadeHosId: this.hospital,
220
+        dept: dept,
221
+      },
222
+      idx: 0,
223
+      sum: 20,
224
+    };
225
+    this.isLoading = true;
226
+    this.mainService
227
+      .getFetchDataList("data", "department", data)
228
+      .subscribe((data) => {
229
+        this.alldepart = data.list;
230
+        this.isLoading = false;
231
+        if (dept === undefined && this.coopBtns.currentDept && !this.coopBtns.allOrders) {
232
+          // 初次渲染,权限有当前科室工单,没有全部工单,则回显申请科室
233
+          this.alldepart = [this.loginUser.dept];
234
+          this.searchDTO.department = this.loginUser.dept.id;
235
+        }
236
+        if (dept === undefined && this.coopBtns.currentUser && !this.coopBtns.allOrders) {
237
+          // 初次渲染,权限有当前人员工单,没有全部工单,则回显执行配送人员
238
+          this.allWorker = [this.loginUser];
239
+          this.worker = this.loginUser.id;
240
+        }
241
+        this.getList();
242
+      });
243
+  }
244
+
245
+  // 获取工单状态
246
+  getGdStates() {
247
+    var that = this;
248
+    that.mainService.getDictionary("list", "gdstate").subscribe((data) => {
249
+      that.gdStates = data;
250
+    });
251
+  }
252
+
253
+  // 日期选择
254
+  startDate: string; //发起时间开始
255
+  endDate: string; //发起时间结束
256
+  changeDate(result?): void {
257
+    if (!result) {
258
+      this.startDate = this.endDate = "";
259
+      return;
260
+    }
261
+    this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
262
+    this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
263
+  }
264
+
265
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
266
+  showPromptModal(con, success, promptInfo?) {
267
+    this.promptModalShow = false;
268
+    this.promptContent = con;
269
+    this.ifSuccess = success;
270
+    this.promptInfo = promptInfo;
271
+    setTimeout(() => {
272
+      this.promptModalShow = true;
273
+    }, 100);
274
+    this.getList();
275
+  }
276
+
277
+  // 查看
278
+  detail(e, id) {
279
+    e.stopPropagation();
280
+    this.router.navigateByUrl("/main/orderManagement/orderDetail/" + id);
281
+  }
282
+
283
+  //删除
284
+  loading3 = false;
285
+  delModal: boolean = false; //删除模态框
286
+  showDelModal(e, id) {
287
+    e.stopPropagation();
288
+    this.delModal = true;
289
+    this.coopId = id + "";
290
+  }
291
+  hideDelModal() {
292
+    this.delModal = false;
293
+  }
294
+  confirmDel() {
295
+    this.loading3 = true;
296
+    this.mainService[this.coopId.includes(",") ? "delOrders" : "delOrder"](
297
+      this.coopId
298
+    ).subscribe((data) => {
299
+      this.loading3 = false;
300
+      this.delModal = false;
301
+      if (data.status == 200) {
302
+        if (
303
+          this.listOfData.length == 1 &&
304
+          this.pageIndex == Math.ceil(this.listLength / this.pageSize)
305
+        ) {
306
+          this.listLength--;
307
+          this.pageIndex = Math.ceil(this.listLength / this.pageSize);
308
+        }
309
+        this.showPromptModal("删除", true, "");
310
+      } else {
311
+        this.showPromptModal("删除", false, data.msg);
312
+      }
313
+    });
314
+  }
315
+
316
+  // 导出
317
+  loading2 = false;
318
+  export() {
319
+    // 有备注,无发起时间则提示
320
+    if(!this.searchDTO.dateRange.length){
321
+      this.message.info('请选择发起时间!');
322
+      return;
323
+    }
324
+    // 三个权限都没有,则不展示
325
+    if(!this.coopBtns.currentDept && !this.coopBtns.currentUser && !this.coopBtns.allOrders){
326
+      return;
327
+    }
328
+    let that = this;
329
+    let postData: any = {
330
+      idx: that.pageIndex - 1,
331
+      sum: that.pageSize,
332
+      workOrder: {
333
+        worker: { id: that.worker },
334
+        gdState: { id: that.gdState },
335
+        gdcode: this.searchDTO.gdcode,
336
+        createDept: that.searchDTO.department,
337
+        hosId: that.hospital,
338
+      },
339
+    };
340
+
341
+    if (!postData.workOrder.worker.id) {
342
+      delete postData.workOrder.worker;
343
+    }
344
+    if (!postData.workOrder.gdState.id) {
345
+      delete postData.workOrder.gdState;
346
+    }
347
+    if (
348
+      postData.workOrder.specialCloseFlag === undefined ||
349
+      postData.workOrder.specialCloseFlag === null
350
+    ) {
351
+      delete postData.workOrder.specialCloseFlag;
352
+    }
353
+    if (!postData.workOrder.createDept) {
354
+      delete postData.workOrder.createDept;
355
+    }
356
+    delete postData.workOrder.overdueTime24;
357
+    delete postData.workOrder.startTime1;
358
+    delete postData.workOrder.endTime1;
359
+    if (false) {
360
+      postData.workOrder.overdueTime24 = true;
361
+    } else if (that.startDate && that.endDate) {
362
+      postData.workOrder.startTime1 = that.startDate;
363
+      postData.workOrder.endTime1 = that.endDate;
364
+    }
365
+    this.loading2 = true;
366
+    that.mainService.dataExport("workOrder", postData).subscribe(
367
+      (data) => {
368
+        this.loading2 = false;
369
+        this.showPromptModal("导出", true, "");
370
+        var file = new Blob([data], {
371
+          type: "application/vnd.ms-excel",
372
+        });
373
+        //trick to download store a file having its URL
374
+        var fileURL = URL.createObjectURL(file);
375
+        var a = document.createElement("a");
376
+        a.href = fileURL;
377
+        a.target = "_blank";
378
+        a.download = "工单列表.xls";
379
+        document.body.appendChild(a);
380
+        a.click();
381
+      },
382
+      (err) => {
383
+        this.loading2 = false;
384
+        this.showPromptModal("导出", false, "");
385
+      }
386
+    );
387
+  }
388
+
389
+  // 申请科室边输边搜节流阀
390
+  isLoading = false;
391
+  changeInp(e) {
392
+    this.searchTimer(this.getDeparts, e);
393
+  }
394
+
395
+  // 用户输入搜索配送人员
396
+  changeUser(e) {
397
+    this.searchTimer(this.getAllWorker, e);
398
+  }
399
+
400
+  // 边输入边搜索节流阀
401
+  searchTimer(fun, e) {
402
+    this.isLoading = true;
403
+    this.searchTimerSubject.next([fun, e]);
404
+  }
405
+
406
+  // 截取意见内容(ie内核截取)
407
+  spliceContent(con) {
408
+    if (con.length >= 41 && navigator.userAgent.indexOf("Trident") > -1) {
409
+      return con.slice(0, 20) + "...";
410
+    } else {
411
+      return con;
412
+    }
413
+  }
414
+
415
+  // 详细搜索
416
+  searchModal: boolean = false; //新增/编辑模态框
417
+  modelName = ""; //模态框名称
418
+  add: boolean; //true:新增;false:编辑
419
+  validateSearchForm: FormGroup; //新增/编辑表单
420
+  coopData: any; //当前操作列
421
+  // 新增弹框
422
+  addModal() {
423
+    this.modelName = "新增";
424
+    this.add = true; //新增
425
+    this.searchModal = true;
426
+    this.initSearchForm();
427
+  }
428
+  //关闭新增/编辑弹框
429
+  hideAddModal() {
430
+    this.searchModal = false;
431
+    this.initSearchForm();
432
+  }
433
+
434
+  // 初始化新增form表单
435
+  initSearchForm() {
436
+    this.validateSearchForm = this.fb.group({
437
+      subType: [null],
438
+      description: [''],
439
+      supplierIds: [[]],
440
+      manufacturerIds: [[]],
441
+    });
442
+  }
443
+}

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

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

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

@@ -588,6 +588,11 @@ const routes: Routes = [
588 588
         path: "assetsConsumable",
589 589
         loadChildren: () => import("../assets-consumable/assets-consumable.module").then((m) => m.AssetsConsumableModule),
590 590
       },
591
+      // 工单列表
592
+      {
593
+        path: "incidentManagement",
594
+        loadChildren: () => import("../incident-management/incident-management.module").then((m) => m.IncidentManagementModule),
595
+      },
591 596
     ],
592 597
   },
593 598
 ];

+ 41 - 2
src/common.less

@@ -1,6 +1,9 @@
1 1
 .ant-table-tbody tr:nth-of-type(2n){
2 2
   background-color: #e9f7e9!important;
3 3
 }
4
+.pt0{
5
+  padding-top: 0!important;
6
+}
4 7
 .ml8 {
5 8
   margin-left: 8px !important;
6 9
 }
@@ -43,9 +46,15 @@
43 46
 .green {
44 47
   color: #49b856 !important;
45 48
 }
49
+.text_align_left{
50
+  text-align: left !important;
51
+}
46 52
 .text_align_center{
47 53
   text-align: center !important;
48 54
 }
55
+.text_align_right{
56
+  text-align: right !important;
57
+}
49 58
 // 加载中
50 59
 .loadingFull {
51 60
   height: 100%;
@@ -257,12 +266,42 @@
257 266
 // list模板样式 start
258 267
 .list-template {
259 268
   padding: 8px;
269
+  .ant-calendar-picker {
270
+    width: 373px!important;
271
+  }
260 272
   .list-template__content {
273
+    .list-template__tab{
274
+      height: 44px;
275
+      display: flex;
276
+      align-items: center;
277
+      border-bottom: 1px solid #D9D9D9;
278
+      .list-template__tabItem{
279
+        width: 148px;
280
+        height: 100%;
281
+        display: flex;
282
+        justify-content: center;
283
+        align-items: center;
284
+        cursor: pointer;
285
+        &.active{
286
+          color: @primary-color;
287
+          position: relative;
288
+          &::after{
289
+            content: '';
290
+            width: 100%;
291
+            height: 2px;
292
+            background-color: @primary-color;
293
+            position: absolute;
294
+            left: 0;
295
+            bottom: -1px;
296
+          }
297
+        }
298
+      }
299
+    }
261 300
     .list-template__top {
262 301
       display: flex;
263 302
       justify-content: space-between;
264 303
       align-items: center;
265
-      padding: 16px 0;
304
+      padding: 16px 0 0;
266 305
       position: relative;
267 306
       overflow: hidden;
268 307
       z-index: 2;
@@ -271,7 +310,7 @@
271 310
         align-items: center;
272 311
         flex-wrap: wrap;
273 312
         .list-template__searchItem {
274
-          margin-bottom: 8px;
313
+          margin-bottom: 16px;
275 314
           .label {
276 315
             margin-left: 16px;
277 316
             color: #333;