浏览代码

工单消息设置

seimin 3 年之前
父节点
当前提交
603e6cdb4f

+ 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.3.96",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 279 - 82
src/app/services/main.service.ts

@@ -1,324 +1,521 @@
1
-import { Injectable } from '@angular/core';
2
-import { HttpClient, HttpHeaders } from '@angular/common/http';
1
+import { Injectable } from "@angular/core";
2
+import { HttpClient, HttpHeaders } from "@angular/common/http";
3 3
 
4 4
 import host from "../../assets/js/http";
5 5
 
6 6
 @Injectable({
7
-  providedIn: 'root'
7
+  providedIn: "root",
8 8
 })
9 9
 export class MainService {
10
-  constructor(private http: HttpClient) { }
10
+  constructor(private http: HttpClient) {}
11 11
 
12 12
   headers = new HttpHeaders({
13
-    'Content-Type': 'application/json',
14
-    'Cache-Control': 'no-cache'
13
+    "Content-Type": "application/json",
14
+    "Cache-Control": "no-cache",
15 15
   });
16
-  exportHeader = new HttpHeaders().set('Accept', '*/*');//导出excel表使用
16
+  exportHeader = new HttpHeaders().set("Accept", "*/*"); //导出excel表使用
17 17
   // 单点登录
18 18
   singleSignOnLogin(data): any {
19
-    return this.http.post(host.host + '/auth/portalLogin', data, { headers: this.headers });
19
+    return this.http.post(host.host + "/auth/portalLogin", data, {
20
+      headers: this.headers,
21
+    });
20 22
   }
21 23
   // 登录
22 24
   login(name: string, pwd: string): any {
23 25
     const data = {
24 26
       username: name,
25 27
       password: pwd,
26
-      type: 'PC'
27
-    }
28
-    return this.http.post(host.host + '/auth/login', data, { headers: this.headers });
28
+      type: "PC",
29
+    };
30
+    return this.http.post(host.host + "/auth/login", data, {
31
+      headers: this.headers,
32
+    });
29 33
   }
30 34
   // 登出
31 35
   logOut(): any {
32
-    return this.http.delete(host.host + '/auth/logout2', { headers: this.headers });
36
+    return this.http.delete(host.host + "/auth/logout2", {
37
+      headers: this.headers,
38
+    });
33 39
   }
34 40
 
35 41
   // 修改密码
36 42
   upPwd(data): any {
37
-    return this.http.post(host.host + '/auth/uppwd', data, { headers: this.headers });
43
+    return this.http.post(host.host + "/auth/uppwd", data, {
44
+      headers: this.headers,
45
+    });
38 46
   }
39 47
   // 字典表
40 48
   getDictionary(type, key): any {
41 49
     const data = {
42 50
       type: type,
43
-      key: key
44
-    }
45
-    return this.http.post(host.host + '/common/common/getDictionary', data, { headers: this.headers });
51
+      key: key,
52
+    };
53
+    return this.http.post(host.host + "/common/common/getDictionary", data, {
54
+      headers: this.headers,
55
+    });
46 56
   }
47 57
   // 列表搜索(get data)
48 58
   getDataFetchData(type, id): any {
49
-    return this.http.get(host.host + '/data/fetchData/' + type + '/' + id, { headers: this.headers });
59
+    return this.http.get(host.host + "/data/fetchData/" + type + "/" + id, {
60
+      headers: this.headers,
61
+    });
50 62
   }
51 63
   // api 详情 -工单详情
52 64
   getApiFetchData(type, id): any {
53
-    return this.http.get(host.host + '/api/fetchData/' + type + '/' + id, { headers: this.headers });
65
+    return this.http.get(host.host + "/api/fetchData/" + type + "/" + id, {
66
+      headers: this.headers,
67
+    });
54 68
   }
55 69
   // 列表搜索(通用)
56 70
   getFetchDataList(type, target, data): any {
57
-    return this.http.post(host.host + '/' + type + '/fetchDataList/' + target, data, { headers: this.headers });
71
+    return this.http.post(
72
+      host.host + "/" + type + "/fetchDataList/" + target,
73
+      data,
74
+      { headers: this.headers }
75
+    );
58 76
   }
59 77
 
60 78
   // 调度台 获取支助人员信息
61 79
   getSerInfo(type, data): any {
62
-    return this.http.post(host.host + '/ser/' + type, data, { headers: this.headers });
80
+    return this.http.post(host.host + "/ser/" + type, data, {
81
+      headers: this.headers,
82
+    });
63 83
   }
64 84
 
65 85
   // 通用操作data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
66 86
   coopData(coop, type, data): any {
67
-    return this.http.post(host.host + '/data/' + coop + '/' + type, data, { headers: this.headers });
87
+    return this.http.post(host.host + "/data/" + coop + "/" + type, data, {
88
+      headers: this.headers,
89
+    });
68 90
   }
69 91
 
70 92
   // 通用操作user data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
71 93
   coopUserData(coop, type, data): any {
72
-    return this.http.post(host.host + '/user/data/' + coop + '/' + type, data, { headers: this.headers });
94
+    return this.http.post(host.host + "/user/data/" + coop + "/" + type, data, {
95
+      headers: this.headers,
96
+    });
73 97
   }
74 98
   // 获取院区user信息
75 99
   getHosUser(type, id): any {
76
-    return this.http.get(host.host + '/user/data/' + type + '/' + id, {});
100
+    return this.http.get(host.host + "/user/data/" + type + "/" + id, {});
77 101
   }
78 102
 
79 103
   // 通用操作configuration信息 有操作类型(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
80 104
   coopTypeConfig(coop, type, data): any {
81
-    return this.http.post(host.host + '/configuration/' + coop + '/' + type, data, { headers: this.headers });
105
+    return this.http.post(
106
+      host.host + "/configuration/" + coop + "/" + type,
107
+      data,
108
+      { headers: this.headers }
109
+    );
82 110
   }
83 111
   // 通用操作configuration信息(新增/更新/删除)
84 112
   coopConfig(type, data): any {
85
-    return this.http.post(host.host + '/configuration/' + type, data, { headers: this.headers });
113
+    return this.http.post(host.host + "/configuration/" + type, data, {
114
+      headers: this.headers,
115
+    });
86 116
   }
87 117
 
88 118
   // 查询所有数据
89 119
   findAllDataList(type): any {
90
-    return this.http.post(host.host + '/data/findAll/' + type, {}, { headers: this.headers });
120
+    return this.http.post(
121
+      host.host + "/data/findAll/" + type,
122
+      {},
123
+      { headers: this.headers }
124
+    );
91 125
   }
92 126
 
93 127
   // 权限相关
94 128
   getPermission(type): any {
95
-    return this.http.get(host.host + '/permission/roleMenu/' + type, { headers: this.headers });
129
+    return this.http.get(host.host + "/permission/roleMenu/" + type, {
130
+      headers: this.headers,
131
+    });
96 132
   }
97 133
 
98 134
   //科室详情
99 135
   getOfficeDetail(id): any {
100
-    return this.http.get(host.host + '/data/fetchData/department/' + id, { headers: this.headers });
136
+    return this.http.get(host.host + "/data/fetchData/department/" + id, {
137
+      headers: this.headers,
138
+    });
101 139
   }
102 140
 
103 141
   // fetchData查看详情
104 142
   getFetchData(type, info, id?): any {
105
-    let url = id ? host.host + '/' + type + '/fetchData/' + info + '/' + id : host.host + '/' + type + '/fetchData/' + info
143
+    let url = id
144
+      ? host.host + "/" + type + "/fetchData/" + info + "/" + id
145
+      : host.host + "/" + type + "/fetchData/" + info;
106 146
     return this.http.get(url, { headers: this.headers });
107 147
   }
108 148
 
109 149
   // 获取楼栋信息/楼层信息
110 150
   getBuildingOrFloor(type, data): any {
111
-    return this.http.post(host.host + '/data/getBuildingOrFloor/' + type, data, { headers: this.headers });
151
+    return this.http.post(
152
+      host.host + "/data/getBuildingOrFloor/" + type,
153
+      data,
154
+      { headers: this.headers }
155
+    );
112 156
   }
113 157
 
114 158
   // 自定义请求 post
115 159
   postCustom(type, info, data): any {
116
-    return this.http.post(host.host + '/' + type + '/' + info, data, { headers: this.headers });
160
+    return this.http.post(host.host + "/" + type + "/" + info, data, {
161
+      headers: this.headers,
162
+    });
117 163
   }
118 164
   // 科室二维码打印flag=1
119 165
   postCustomCode(type, info, data): any {
120
-    return this.http.post(host.host + '/' + type + '/' + info + '/1', data, { headers: this.headers });
166
+    return this.http.post(host.host + "/" + type + "/" + info + "/1", data, {
167
+      headers: this.headers,
168
+    });
121 169
   }
122 170
 
123 171
   // 自定义请求 get
124 172
   getCustom(type, info): any {
125
-    return this.http.get(host.host + '/' + type + '/' + info, { headers: this.headers });
173
+    return this.http.get(host.host + "/" + type + "/" + info, {
174
+      headers: this.headers,
175
+    });
126 176
   }
127 177
   // 调度台-分派工单
128 178
   assignWorker(data, type): any {
129
-    return this.http.post(host.host + '/workerOrder/' + type, data, { headers: this.headers });
179
+    return this.http.post(host.host + "/workerOrder/" + type, data, {
180
+      headers: this.headers,
181
+    });
130 182
   }
131 183
 
132 184
   // 调度台-删除工单
133 185
   delOrder(id): any {
134
-    return this.http.get(host.host + '/workerOrder/delWorkOrder/' + id, { headers: this.headers });
186
+    return this.http.get(host.host + "/workerOrder/delWorkOrder/" + id, {
187
+      headers: this.headers,
188
+    });
135 189
   }
136 190
   // 工单列表-删除工单
137 191
   delOrders(ids): any {
138
-    return this.http.post(host.host + '/workerOrder/delWorkOrders', { ids }, { headers: this.headers });
192
+    return this.http.post(
193
+      host.host + "/workerOrder/delWorkOrders",
194
+      { ids },
195
+      { headers: this.headers }
196
+    );
139 197
   }
140 198
 
141 199
   // 调度台工单相关
142 200
   coopWorkerOrder(type, data): any {
143
-    return this.http.post(host.host + '/workerOrder/' + type, data, { headers: this.headers });
201
+    return this.http.post(host.host + "/workerOrder/" + type, data, {
202
+      headers: this.headers,
203
+    });
144 204
   }
145 205
 
146 206
   // 调度台-工单历史记录
147 207
   getWorkOrderLog(id): any {
148
-    return this.http.get(host.host + '/ser/fetchWorkOrderLog/' + id, { headers: this.headers });
208
+    return this.http.get(host.host + "/ser/fetchWorkOrderLog/" + id, {
209
+      headers: this.headers,
210
+    });
149 211
   }
150 212
 
151 213
   // 综合报表
152 214
   postReportCount(type, data): any {
153
-    return this.http.post(host.host + '/report/orderCount/' + type, data, { headers: this.headers });
215
+    return this.http.post(host.host + "/report/orderCount/" + type, data, {
216
+      headers: this.headers,
217
+    });
154 218
   }
155 219
 
156 220
   // 报表导出
157 221
   exportReport(type, data): any {
158
-    return this.http.post(host.host + '/report/export/' + type, data, { headers: this.exportHeader, responseType: 'arraybuffer' });
222
+    return this.http.post(host.host + "/report/export/" + type, data, {
223
+      headers: this.exportHeader,
224
+      responseType: "arraybuffer",
225
+    });
159 226
   }
160 227
 
161 228
   dataExport(type, data): any {
162
-    return this.http.post(host.host + '/data/export/' + type, data, { headers: this.exportHeader, responseType: 'arraybuffer' });
229
+    return this.http.post(host.host + "/data/export/" + type, data, {
230
+      headers: this.exportHeader,
231
+      responseType: "arraybuffer",
232
+    });
163 233
   }
164 234
   //新增/编辑轮巡计划
165 235
   addRoundRobin(type: string, data: any): any {
166
-    return this.http.post(host.host + '/orderPlan/' + type, data, { headers: this.headers });
236
+    return this.http.post(host.host + "/orderPlan/" + type, data, {
237
+      headers: this.headers,
238
+    });
167 239
   }
168 240
   //删除轮巡计划
169 241
   delRoundRobin(id): any {
170
-    return this.http.get(host.host + '/orderPlan/deletePlan/' + id, { headers: this.headers });
242
+    return this.http.get(host.host + "/orderPlan/deletePlan/" + id, {
243
+      headers: this.headers,
244
+    });
171 245
   }
172 246
   //启用/停用轮巡计划
173 247
   switchRoundRobin(isSwitch, id): any {
174
-    return this.http.get(`${host.host}/orderPlan/activePlan/${isSwitch}/${id}`, { headers: this.headers });
248
+    return this.http.get(
249
+      `${host.host}/orderPlan/activePlan/${isSwitch}/${id}`,
250
+      { headers: this.headers }
251
+    );
175 252
   }
176 253
   //新增/编辑快捷建单
177 254
   addShortcutBuildOrders(type: string, data: any): any {
178
-    return this.http.post(host.host + '/api/' + type + '/quickOrder', data, { headers: this.headers });
255
+    return this.http.post(host.host + "/api/" + type + "/quickOrder", data, {
256
+      headers: this.headers,
257
+    });
179 258
   }
180 259
   //删除快捷建单
181 260
   delShortcutBuildOrders(id): any {
182
-    return this.http.post(host.host + '/api/rmvData/quickOrder', [id], { headers: this.headers });
261
+    return this.http.post(host.host + "/api/rmvData/quickOrder", [id], {
262
+      headers: this.headers,
263
+    });
183 264
   }
184 265
   // 快捷建单二维码批量打印
185 266
   printShortcutBuildOrders(idArr): any {
186
-    return this.http.post(host.host + '/api/orderCodes', idArr, { headers: this.headers });
267
+    return this.http.post(host.host + "/api/orderCodes", idArr, {
268
+      headers: this.headers,
269
+    });
187 270
   }
188 271
   //护士端返回二维码信息,flag=0,动态二维码
189 272
   getDeptCode(idArr) {
190
-    return this.http.post(host.host + '/dept/deptCodes/0', idArr, { headers: this.headers });
273
+    return this.http.post(host.host + "/dept/deptCodes/0", idArr, {
274
+      headers: this.headers,
275
+    });
191 276
   }
192 277
   //药房端药房列表查询、搜索接口
193 278
   getPharmacyList(idx, type, searchKey, launch) {
194
-    return this.http.post(host.host + '/api/fetchDataList/drugsBag', { "idx": idx, "sum": 10, "drugsBag": { "searchType": type, "searchKey": searchKey, "launch": launch } }, { headers: this.headers });
279
+    return this.http.post(
280
+      host.host + "/api/fetchDataList/drugsBag",
281
+      {
282
+        idx: idx,
283
+        sum: 10,
284
+        drugsBag: { searchType: type, searchKey: searchKey, launch: launch },
285
+      },
286
+      { headers: this.headers }
287
+    );
195 288
   }
196 289
   //药房端打印二维码的接口
197 290
   printRequisition(idArr) {
198
-    return this.http.post(host.host + '/drugsBag/printRequisition', idArr, { headers: this.headers });
291
+    return this.http.post(host.host + "/drugsBag/printRequisition", idArr, {
292
+      headers: this.headers,
293
+    });
199 294
   }
200 295
   //药房端待打印变为待配药接口
201 296
   changeToDispensing(idArr, name) {
202
-    return this.http.post(host.host + '/drugsBag/changeToDispensing/' + name, idArr, { headers: this.headers });
297
+    return this.http.post(
298
+      host.host + "/drugsBag/changeToDispensing/" + name,
299
+      idArr,
300
+      { headers: this.headers }
301
+    );
203 302
   }
204 303
   //新建工单->获取新建类型
205 304
   getAutoWorkTypes(hosId) {
206
-    return this.http.get(host.host + '/ser/getAutoWorkTypes/' + hosId, { headers: this.headers });
305
+    return this.http.get(host.host + "/ser/getAutoWorkTypes/" + hosId, {
306
+      headers: this.headers,
307
+    });
207 308
   }
208 309
   //服务台新建工单—调度台建单获取起点科室或者终点科室列表
209 310
   getdeptList(taskTypeId) {
210
-    return this.http.post(host.host + '/ser/getdeptList', { taskTypeId }, { headers: this.headers });
311
+    return this.http.post(
312
+      host.host + "/ser/getdeptList",
313
+      { taskTypeId },
314
+      { headers: this.headers }
315
+    );
211 316
   }
212 317
   //服务台新建工单—调度台建单获取患者
213 318
   getPatientList(data) {
214
-    return this.http.post(host.host + '/ser/getPatientInfo', data, { headers: this.headers });
319
+    return this.http.post(host.host + "/ser/getPatientInfo", data, {
320
+      headers: this.headers,
321
+    });
215 322
   }
216 323
   //服务台新建工单—调度台建单获取起点科室或者终点科室列表
217 324
   buildOrder(data) {
218
-    return this.http.post(host.host + '/ser/buildOrder', data, { headers: this.headers });
325
+    return this.http.post(host.host + "/ser/buildOrder", data, {
326
+      headers: this.headers,
327
+    });
219 328
   }
220 329
   //获取当前用户信息
221 330
   getCurrentUser1() {
222
-    return this.http.get(host.host + '/user/data/getCurrentUser', { headers: this.headers });
331
+    return this.http.get(host.host + "/user/data/getCurrentUser", {
332
+      headers: this.headers,
333
+    });
223 334
   }
224 335
   //获取通话记录音频地址
225 336
   getCallLogPath(data) {
226
-    return this.http.post(host.host + '/callLog/getRecordByPath', data, { headers: this.headers });
337
+    return this.http.post(host.host + "/callLog/getRecordByPath", data, {
338
+      headers: this.headers,
339
+    });
227 340
   }
228 341
   //根据工作分配和人员id获取科室信息
229 342
   getDeptByUser(data) {
230
-    return this.http.post(host.host + '/api/getDeptByUser', data, { headers: this.headers });
343
+    return this.http.post(host.host + "/api/getDeptByUser", data, {
344
+      headers: this.headers,
345
+    });
231 346
   }
232 347
   //根据工作分配和分组id获取科室信息
233 348
   getDeptByGroup(data) {
234
-    return this.http.post(host.host + '/api/getDeptByGroup', data, { headers: this.headers });
349
+    return this.http.post(host.host + "/api/getDeptByGroup", data, {
350
+      headers: this.headers,
351
+    });
235 352
   }
236 353
   //微信配置修改
237 354
   changeWechatConfig(data) {
238
-    return this.http.post(host.host + '/simple/data/addData/wechatConfig', data, { headers: this.headers });
355
+    return this.http.post(
356
+      host.host + "/simple/data/addData/wechatConfig",
357
+      data,
358
+      { headers: this.headers }
359
+    );
239 360
   }
240 361
   //系统配置修改
241 362
   changeSysConfig(data) {
242
-    return this.http.post(host.host + '/simple/data/addListData/systemConfiguration', data, { headers: this.headers });
363
+    return this.http.post(
364
+      host.host + "/simple/data/addListData/systemConfiguration",
365
+      data,
366
+      { headers: this.headers }
367
+    );
243 368
   }
244 369
   //护士端关注接口
245 370
   changeFollow(data) {
246
-    return this.http.post(host.host + '/nurse/updData/patient', data, { headers: this.headers });
371
+    return this.http.post(host.host + "/nurse/updData/patient", data, {
372
+      headers: this.headers,
373
+    });
247 374
   }
248 375
   //数据字典楼栋保存接口
249 376
   saveBuildingList(data) {
250
-    return this.http.post(host.host + '/simple/data/addListData/building', data, { headers: this.headers });
377
+    return this.http.post(
378
+      host.host + "/simple/data/addListData/building",
379
+      data,
380
+      { headers: this.headers }
381
+    );
251 382
   }
252 383
   //数据字典楼栋删除接口
253 384
   delBuildingList(data) {
254
-    return this.http.post(host.host + '/simple/data/rmvData/building', data, { headers: this.headers });
385
+    return this.http.post(host.host + "/simple/data/rmvData/building", data, {
386
+      headers: this.headers,
387
+    });
255 388
   }
256 389
   //数据字典楼层保存接口
257 390
   saveFloorList(data) {
258
-    return this.http.post(host.host + '/simple/data/addListData/floor', data, { headers: this.headers });
391
+    return this.http.post(host.host + "/simple/data/addListData/floor", data, {
392
+      headers: this.headers,
393
+    });
259 394
   }
260 395
   //数据字典楼层保存接口
261 396
   delFloorList(data) {
262
-    return this.http.post(host.host + '/simple/data/rmvData/floor', data, { headers: this.headers });
397
+    return this.http.post(host.host + "/simple/data/rmvData/floor", data, {
398
+      headers: this.headers,
399
+    });
263 400
   }
264 401
   //获取患者最近一条检查信息
265 402
   getRecentInfo(data) {
266
-    return this.http.post(host.host + '/nurse/workOrder/findInspectRecently', data, { headers: this.headers });
403
+    return this.http.post(
404
+      host.host + "/nurse/workOrder/findInspectRecently",
405
+      data,
406
+      { headers: this.headers }
407
+    );
267 408
   }
268 409
   //simple增删改查,addData新增
269 410
   simplePost(coop, type, data): any {
270
-    return this.http.post(host.host + '/simple/data/' + coop + '/' + type, data, { headers: this.headers });
411
+    return this.http.post(
412
+      host.host + "/simple/data/" + coop + "/" + type,
413
+      data,
414
+      { headers: this.headers }
415
+    );
271 416
   }
272 417
   //任务类型列表排序
273 418
   sortTaskType(data): any {
274
-    return this.http.post(host.host + '/configuration/setOrders', data, { headers: this.headers });
419
+    return this.http.post(host.host + "/configuration/setOrders", data, {
420
+      headers: this.headers,
421
+    });
275 422
   }
276 423
   //获取工单详情里的历史记录
277 424
   getWorkOrderRecord(data): any {
278
-    return this.http.post(host.host + '/workerOrder/getWorkOrderRecord', data, { headers: this.headers });
425
+    return this.http.post(host.host + "/workerOrder/getWorkOrderRecord", data, {
426
+      headers: this.headers,
427
+    });
279 428
   }
280 429
   //刷新字典缓存
281 430
   refreshDic(): any {
282
-    return this.http.post(host.host + '/common/common/refreshCache', {}, { headers: this.headers });
431
+    return this.http.post(
432
+      host.host + "/common/common/refreshCache",
433
+      {},
434
+      { headers: this.headers }
435
+    );
283 436
   }
284 437
   //调度台建单获取可搜索的任务类型列表
285 438
   getTaskTypeBySearchKey(data): any {
286
-    return this.http.post(host.host + '/ser/getTaskTypeBySearchKey', data, { headers: this.headers });
439
+    return this.http.post(host.host + "/ser/getTaskTypeBySearchKey", data, {
440
+      headers: this.headers,
441
+    });
287 442
   }
288 443
   //切换院区
289 444
   changeHospital(data): any {
290
-    return this.http.post(host.host + '/auth/changeHospital', data, { headers: this.headers });
445
+    return this.http.post(host.host + "/auth/changeHospital", data, {
446
+      headers: this.headers,
447
+    });
291 448
   }
292 449
   //刷新缓存
293 450
   refreshTaskType(): any {
294
-    return this.http.get(host.host + '/ser/refreshTaskType', { headers: this.headers });
451
+    return this.http.get(host.host + "/ser/refreshTaskType", {
452
+      headers: this.headers,
453
+    });
295 454
   }
296 455
   //楼栋配置保存接口
297 456
   saveBuildings(data) {
298
-    return this.http.post(host.host + '/simple/data/addListData/workOrderGradeBuilding', data, { headers: this.headers });
457
+    return this.http.post(
458
+      host.host + "/simple/data/addListData/workOrderGradeBuilding",
459
+      data,
460
+      { headers: this.headers }
461
+    );
299 462
   }
300 463
   //删除接口
301 464
   delBuildings(data) {
302
-    return this.http.post(host.host + '/simple/data/rmvData/workOrderGradeBuilding', data, { headers: this.headers });
465
+    return this.http.post(
466
+      host.host + "/simple/data/rmvData/workOrderGradeBuilding",
467
+      data,
468
+      { headers: this.headers }
469
+    );
303 470
   }
304 471
   //获取配置文件的接口
305 472
   systemConfiguration(data) {
306
-    return this.http.post(host.host + '/simple/data/fetchDataList/systemConfiguration', data, { headers: this.headers });
473
+    return this.http.post(
474
+      host.host + "/simple/data/fetchDataList/systemConfiguration",
475
+      data,
476
+      { headers: this.headers }
477
+    );
307 478
   }
308 479
   //检查信息,患者信息
309
-  listMsgByMain(type,data) {
310
-    return this.http.post(host.host + '/nurse/'+type, data, { headers: this.headers });
480
+  listMsgByMain(type, data) {
481
+    return this.http.post(host.host + "/nurse/" + type, data, {
482
+      headers: this.headers,
483
+    });
311 484
   }
312 485
   //院区系统配置修改
313 486
   changeHospitalSysConfig(data) {
314
-    return this.http.post(host.host + '/simple/data/addListData/hospitalConfig', data, { headers: this.headers });
487
+    return this.http.post(
488
+      host.host + "/simple/data/addListData/hospitalConfig",
489
+      data,
490
+      { headers: this.headers }
491
+    );
315 492
   }
316 493
   //护士端获取综合日志
317 494
   listDeptOrderRecord(data) {
318
-    return this.http.post(host.host + '/nurse/listDeptOrderRecord', data, { headers: this.headers });
495
+    return this.http.post(host.host + "/nurse/listDeptOrderRecord", data, {
496
+      headers: this.headers,
497
+    });
319 498
   }
320 499
   //自动同步国家法定节假日
321 500
   syncWorkDay(data) {
322
-    return this.http.post(host.host + '/configuration/syncWorkDay', data, { headers: this.headers });
501
+    return this.http.post(host.host + "/configuration/syncWorkDay", data, {
502
+      headers: this.headers,
503
+    });
504
+  }
505
+  //查询工单消息设置
506
+  getWorkorderMessage(data) {
507
+    return this.http.post(
508
+      host.host + "/configuration/pageWorkOrderMessageSettings",
509
+      data,
510
+      { headers: this.headers }
511
+    );
512
+  }
513
+  //修改工单消息设置
514
+  updateWorkorderMessage(data) {
515
+    return this.http.post(
516
+      host.host + "/configuration/saveWorkOrderMessageSettings",
517
+      data,
518
+      { headers: this.headers }
519
+    );
323 520
   }
324 521
 }

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

@@ -280,6 +280,14 @@ const routes: Routes = [
280 280
           ),
281 281
       },
282 282
       {
283
+        // 工单消息设置
284
+        path: "workorderMessage",
285
+        loadChildren: () =>
286
+          import("../workorder-message/workorder-message.module").then(
287
+            (m) => m.WorkorderMessageModule
288
+          ),
289
+      },
290
+      {
283 291
         // 楼栋楼层
284 292
         path: "buildingFloor",
285 293
         loadChildren: () =>

+ 16 - 0
src/app/views/workorder-message/workorder-message-routing.module.ts

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

+ 87 - 0
src/app/views/workorder-message/workorder-message.component.html

@@ -0,0 +1,87 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='15' class="list-template__searchBox"></div>
5
+      <div nz-col nzXl="9" class="list-template__btns"></div>
6
+    </div>
7
+    <div class="list-template__bottom">
8
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
9
+        [nzLoading]="loading1">
10
+        <thead>
11
+          <tr class="thead">
12
+            <th nzWidth="5%">序号</th>
13
+            <th nzWidth="25%">发送内容</th>
14
+            <th nzWidth="25%">发送规则</th>
15
+            <th nzWidth="5%">发送类型</th>
16
+            <th nzWidth="20%">适用班次</th>
17
+            <th nzWidth="5%">是否开启</th>
18
+            <th nzWidth="15%">操作</th>
19
+          </tr>
20
+        </thead>
21
+        <tbody>
22
+          <tr *ngFor="let data of listOfData;let i = index">
23
+            <td>{{ i+1 }}</td>
24
+            <td>{{ data.sendContent }}</td>
25
+            <td>{{ data.sendRules }}</td>
26
+            <td>{{ data.sendType == 1?'微信':'' }}</td>
27
+            <td>{{ data.applicableShiftName }}</td>
28
+            <td>{{ data.status==1?'开启':'关闭' }}</td>
29
+            <td>
30
+              <div class="coop">
31
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
32
+                <span *ngIf="coopBtns.isStartUp"
33
+                  (click)="showDelModal(data,data.status==1?'您确认要停用吗?':'您确认要启用吗?',data.status==1?'停用':'启用','switch',data.status==1)">{{data.status==1?'停用':'启用'}}</span>
34
+              </div>
35
+            </td>
36
+          </tr>
37
+        </tbody>
38
+      </nz-table>
39
+      <div class="list-template__pagination">
40
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
41
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
42
+        </nz-pagination>
43
+      </div>
44
+    </div>
45
+  </div>
46
+
47
+  <!-- 编辑模态框 -->
48
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
49
+    <div class="modalBody">
50
+      <div class="title">编辑<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
51
+      </div>
52
+      <overlay-scrollbars #osComponentRef1 class="content">
53
+        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
54
+          <nz-form-item>
55
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applicableShift">班次</nz-form-label>
56
+            <nz-form-control nzErrorTip="请选择班次!">
57
+              <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="applicableShift"
58
+                nzShowSearch nzAllowClear nzPlaceHolder="请选择班次">
59
+                <ng-container *ngFor="let data of scheduleClasses">
60
+                  <nz-option *ngIf="!isLoading" nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
61
+                </ng-container>
62
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
63
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
64
+                </nz-option>
65
+              </nz-select>
66
+            </nz-form-control>
67
+          </nz-form-item>
68
+        </form>
69
+      </overlay-scrollbars>
70
+      <div class=" display_flex justify-content_flex-center">
71
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
72
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
73
+      </div>
74
+    </div>
75
+  </div>
76
+
77
+
78
+  <!-- 启用/停用模态框 -->
79
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
80
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
81
+</div>
82
+<!-- 操作成功/失败提示框 -->
83
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
84
+  [info]="promptInfo">
85
+</app-prompt-modal>
86
+<!-- 遮罩 -->
87
+<app-mask *ngIf="maskFlag"></app-mask>

+ 177 - 0
src/app/views/workorder-message/workorder-message.component.less

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

+ 224 - 0
src/app/views/workorder-message/workorder-message.component.ts

@@ -0,0 +1,224 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { NzMessageService } from "ng-zorro-antd";
14
+import { format } from "date-fns";
15
+@Component({
16
+  selector: "app-workorder-message",
17
+  templateUrl: "./workorder-message.component.html",
18
+  styleUrls: ["./workorder-message.component.less"],
19
+})
20
+export class WorkorderMessageComponent implements OnInit {
21
+  @ViewChild("osComponentRef1", {
22
+    read: OverlayScrollbarsComponent,
23
+    static: false,
24
+  })
25
+  osComponentRef1: OverlayScrollbarsComponent;
26
+  constructor(
27
+    private message: NzMessageService,
28
+    private fb: FormBuilder,
29
+    private mainService: MainService,
30
+    private route: ActivatedRoute,
31
+    private tool: ToolService
32
+  ) {}
33
+
34
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
35
+  hosId;
36
+  createUser = "";
37
+  scheduleClasses = []; // 用户列表
38
+  listOfData: any = []; //表格数据
39
+  pageIndex: number = 1; //表格当前页码
40
+  pageSize: number = 10; //表格每页展示条数
41
+  listLength: number = 10; //表格总数据量
42
+  tableHeight: number; //表格动态高
43
+  modal: boolean = false; //新增/编辑模态框
44
+  validateForm: FormGroup; //新增/编辑表单
45
+  dataContent: any; //当前操作列
46
+
47
+  oneOption: any; //适用日期类型
48
+  btnLoading: boolean = false; //提交按钮loading状态
49
+
50
+  promptContent: string; //操作提示框提示信息
51
+  ifSuccess: boolean; //操作成功/失败
52
+  promptInfo: string; //操作结果提示信息
53
+  promptModalShow: boolean; //操作提示框是否展示
54
+  demoValue: number = 0;
55
+
56
+  ngOnInit() {
57
+    this.hosId = this.tool.getCurrentHospital().id;
58
+    this.getList();
59
+    this.coopBtns = this.tool.initCoopBtns(this.route);
60
+    this.initForm();
61
+    this.getScheduleClass();
62
+  }
63
+
64
+  // 初始化权限按钮
65
+  coopBtns: any = {};
66
+
67
+  // 表格数据
68
+  loading1 = false;
69
+  getList() {
70
+    let postData = {
71
+      idx: this.pageIndex - 1,
72
+      sum: this.pageSize,
73
+      workOrderMessageSettingsDTO: {
74
+        hosId: this.hosId,
75
+      },
76
+    };
77
+    this.loading1 = true;
78
+    this.mainService.getWorkorderMessage(postData).subscribe((data) => {
79
+      this.loading1 = false;
80
+      if (data["status"] == 200) {
81
+        this.listOfData = data["list"].data;
82
+        this.listOfData.forEach((item) => {
83
+          item.applicableShiftName = Object.values(
84
+            JSON.parse(item.applicableShift)
85
+          ).join(",");
86
+        });
87
+        this.listLength = data["totalNum"];
88
+      }
89
+    });
90
+  }
91
+  //关闭编辑弹框
92
+  hideAddModal() {
93
+    this.modal = false;
94
+    this.initForm();
95
+  }
96
+  // 初始化form表单
97
+  initForm() {
98
+    this.validateForm = this.fb.group({
99
+      applicableShift: [null, [Validators.required]], //班次
100
+    });
101
+  }
102
+  // 表单提交
103
+  submitForm(): void {
104
+    this.btnLoading = true;
105
+    for (const i in this.validateForm.controls) {
106
+      this.validateForm.controls[i].markAsDirty();
107
+      this.validateForm.controls[i].updateValueAndValidity();
108
+    }
109
+    if (this.validateForm.invalid) {
110
+      this.btnLoading = false;
111
+      return;
112
+    }
113
+    let applicableShift: any = {};
114
+    this.scheduleClasses.forEach((item) => {
115
+      this.validateForm.value.applicableShift.forEach((v) => {
116
+        if (item.id == v) {
117
+          applicableShift[item.id] = item.name;
118
+        }
119
+      });
120
+    });
121
+    let postData: any = {
122
+      workOrderMessageSettingsDTO: {
123
+        status: this.dataContent.status,
124
+        applicableShift: JSON.stringify(applicableShift),
125
+        id: this.dataContent.id,
126
+      },
127
+    };
128
+    this.mainService.updateWorkorderMessage(postData).subscribe((data) => {
129
+      this.btnLoading = false;
130
+      this.hideAddModal();
131
+      this.initForm();
132
+      if (data["status"] == 200) {
133
+        this.listLength++;
134
+        this.showPromptModal("修改", true, "");
135
+      } else {
136
+        this.showPromptModal("修改", false, data["msg"]);
137
+      }
138
+    });
139
+  }
140
+  // 获取班次
141
+  getScheduleClass() {
142
+    this.mainService
143
+      .getFetchDataList("configuration", "scheduleClass", {
144
+        idx: 0,
145
+        sum: 9999,
146
+        scheduleClass: {
147
+          hosId: this.hosId,
148
+        },
149
+      })
150
+      .subscribe((result) => {
151
+        if (result.status == 200) {
152
+          this.scheduleClasses = result.list;
153
+        }
154
+      });
155
+  }
156
+  // 编辑
157
+  edit(data) {
158
+    this.dataContent = data;
159
+    this.modal = true;
160
+    this.validateForm.controls.applicableShift.setValue(
161
+      Object.keys(JSON.parse(data.applicableShift))
162
+    ); //班次
163
+  }
164
+
165
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
166
+  showPromptModal(con, success, promptInfo?) {
167
+    this.promptModalShow = false;
168
+    this.promptContent = con;
169
+    this.ifSuccess = success;
170
+    this.promptInfo = promptInfo;
171
+    setTimeout(() => {
172
+      this.promptModalShow = true;
173
+    }, 100);
174
+    this.getList();
175
+  }
176
+
177
+  // 是否启用
178
+  delModal: boolean = false; //删除模态框
179
+  tipsMsg1: string; //提示框信息
180
+  tipsMsg2: string; //操作后信息
181
+  confirmDelType: string; //确认的类型(启用/停用,删除)
182
+  confirmDelIsSwitch: boolean; //启用/停用
183
+  showDelModal(
184
+    dataContent,
185
+    tipsMsg1: string,
186
+    tipsMsg2: string,
187
+    type: string,
188
+    isSwitch?: boolean
189
+  ) {
190
+    this.confirmDelIsSwitch = isSwitch;
191
+    this.confirmDelType = type;
192
+    this.delModal = true;
193
+    this.dataContent = dataContent;
194
+    this.tipsMsg1 = tipsMsg1;
195
+    this.tipsMsg2 = tipsMsg2;
196
+  }
197
+  // 隐藏
198
+  hideDelModal() {
199
+    this.delModal = false;
200
+  }
201
+  // 确认
202
+  confirmDel() {
203
+    this.btnLoading = true;
204
+    if (this.confirmDelType === "switch") {
205
+      //启用/停用
206
+      let postData: any = {
207
+        workOrderMessageSettingsDTO: {
208
+          status: this.dataContent.status == 1 ? 0 : 1,
209
+          applicableShift: this.dataContent.applicableShift,
210
+          id: this.dataContent.id,
211
+        },
212
+      };
213
+      this.mainService.updateWorkorderMessage(postData).subscribe((data) => {
214
+        this.btnLoading = false;
215
+        this.delModal = false;
216
+        if (data["status"] == 200) {
217
+          this.showPromptModal(this.tipsMsg2, true, "");
218
+        } else {
219
+          this.showPromptModal(this.tipsMsg2, false, data["msg"]);
220
+        }
221
+      });
222
+    }
223
+  }
224
+}

+ 12 - 0
src/app/views/workorder-message/workorder-message.module.ts

@@ -0,0 +1,12 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { WorkorderMessageRoutingModule } from "./workorder-message-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { WorkorderMessageComponent } from "./workorder-message.component";
7
+
8
+@NgModule({
9
+  declarations: [WorkorderMessageComponent],
10
+  imports: [CommonModule, WorkorderMessageRoutingModule, ShareModule],
11
+})
12
+export class WorkorderMessageModule {}