Browse Source

医嘱需求

XMLWAN 5 years ago
parent
commit
4e6dc775ee
3 changed files with 2733 additions and 2649 deletions
  1. 213 179
      src/api/advice.js
  2. 2451 2452
      src/xt_pages/dialysis/template/DialysisPrintOrderNine.vue
  3. 69 18
      src/xt_pages/user/doctorAdvice.vue

+ 213 - 179
src/api/advice.js View File

1
-import request from '@/utils/request'
1
+import request from "@/utils/request";
2
 
2
 
3
 export function getAdviceConfig(type) {
3
 export function getAdviceConfig(type) {
4
   return request({
4
   return request({
5
-    url: '/api/getadviceconfigs?type=' + type,
6
-    method: 'get'
7
-  })
5
+    url: "/api/getadviceconfigs?type=" + type,
6
+    method: "get"
7
+  });
8
 }
8
 }
9
 
9
 
10
 export function getAllAdviceConfig() {
10
 export function getAllAdviceConfig() {
11
   return request({
11
   return request({
12
-    url: '/api/getalladviceconfig',
13
-    method: 'get'
14
-  })
12
+    url: "/api/getalladviceconfig",
13
+    method: "get"
14
+  });
15
 }
15
 }
16
 
16
 
17
 export function CreateDoctorAdvice(id, advice, mode) {
17
 export function CreateDoctorAdvice(id, advice, mode) {
18
   return request({
18
   return request({
19
-    url: '/api/patients/advice/create?id=' + id + '&mode=' + mode,
20
-    method: 'post',
19
+    url: "/api/patients/advice/create?id=" + id + "&mode=" + mode,
20
+    method: "post",
21
     data: advice,
21
     data: advice,
22
     headers: {
22
     headers: {
23
-      'Permission': 3
23
+      Permission: 3
24
     }
24
     }
25
-
26
-  })
25
+  });
27
 }
26
 }
28
 
27
 
29
 export function EditDoctorAdvice(patient, id, advice, mode) {
28
 export function EditDoctorAdvice(patient, id, advice, mode) {
30
   return request({
29
   return request({
31
-    url: '/api/patients/advice/edit?id=' + id + '&patient=' + patient + '&mode=' + mode,
32
-    method: 'Put',
30
+    url:
31
+      "/api/patients/advice/edit?id=" +
32
+      id +
33
+      "&patient=" +
34
+      patient +
35
+      "&mode=" +
36
+      mode,
37
+    method: "Put",
33
     data: advice,
38
     data: advice,
34
     headers: {
39
     headers: {
35
-      'Permission': 2
40
+      Permission: 2
36
     }
41
     }
37
-
38
-  })
42
+  });
39
 }
43
 }
40
 
44
 
41
 export function ExecDoctorAdvice(patient, id, time, mode) {
45
 export function ExecDoctorAdvice(patient, id, time, mode) {
44
     patient: patient,
48
     patient: patient,
45
     execution_time: time,
49
     execution_time: time,
46
     mode: mode
50
     mode: mode
47
-  }
51
+  };
48
   return request({
52
   return request({
49
-    url: '/api/patients/advice/exec',
50
-    method: 'Post',
53
+    url: "/api/patients/advice/exec",
54
+    method: "Post",
51
     params: params,
55
     params: params,
52
     headers: {
56
     headers: {
53
-      'Permission': 2
57
+      Permission: 2
54
     }
58
     }
55
-
56
-  })
59
+  });
57
 }
60
 }
58
 export function CheckDoctorAdvice(patient, id, mode) {
61
 export function CheckDoctorAdvice(patient, id, mode) {
59
   var params = {
62
   var params = {
61
     patient: patient,
64
     patient: patient,
62
     mode: mode
65
     mode: mode
63
     // execution_time: time,
66
     // execution_time: time,
64
-  }
67
+  };
65
   return request({
68
   return request({
66
-    url: '/api/patients/advice/check',
67
-    method: 'Post',
69
+    url: "/api/patients/advice/check",
70
+    method: "Post",
68
     params: params,
71
     params: params,
69
     headers: {
72
     headers: {
70
-      'Permission': 2
73
+      Permission: 2
71
     }
74
     }
72
-
73
-  })
75
+  });
74
 }
76
 }
75
 
77
 
76
 export function getDoctorAdviceList(params) {
78
 export function getDoctorAdviceList(params) {
79
+  console.log("params", params);
77
   return request({
80
   return request({
78
-    url: '/api/patients/advices',
79
-    method: 'Get',
81
+    url: "/api/patients/advices",
82
+    method: "Get",
80
     params: params
83
     params: params
81
-  })
84
+  });
82
 }
85
 }
83
 
86
 
84
 // export function StopDoctorAdvice(id, reason,mode) {
87
 // export function StopDoctorAdvice(id, reason,mode) {
93
 
96
 
94
 export function StopGroupAdvice(groupno, reason, mode) {
97
 export function StopGroupAdvice(groupno, reason, mode) {
95
   return request({
98
   return request({
96
-    url: '/api/patients/advice/stopgroup?groupno=' + groupno + '&mode=' + mode,
97
-    method: 'Post',
99
+    url: "/api/patients/advice/stopgroup?groupno=" + groupno + "&mode=" + mode,
100
+    method: "Post",
98
     data: reason,
101
     data: reason,
99
     headers: {
102
     headers: {
100
-      'Permission': 3
103
+      Permission: 3
101
     }
104
     }
102
-
103
-  })
105
+  });
104
 }
106
 }
105
 
107
 
106
 export function DeleteDoctorAdvice(id, mode) {
108
 export function DeleteDoctorAdvice(id, mode) {
107
   return request({
109
   return request({
108
-    url: '/api/patients/advice/delete?id=' + id + '&mode=' + mode,
109
-    method: 'Delete',
110
+    url: "/api/patients/advice/delete?id=" + id + "&mode=" + mode,
111
+    method: "Delete",
110
     headers: {
112
     headers: {
111
-      'Permission': 2
113
+      Permission: 2
112
     }
114
     }
113
-
114
-  })
115
+  });
115
 }
116
 }
116
 
117
 
117
 export function CreateDrugDic(data) {
118
 export function CreateDrugDic(data) {
118
   return request({
119
   return request({
119
-    url: '/api/drugdic/create',
120
-    method: 'post',
120
+    url: "/api/drugdic/create",
121
+    method: "post",
121
     data: data
122
     data: data
122
-  })
123
+  });
123
 }
124
 }
124
 export function UpdateDrugDic(id, data) {
125
 export function UpdateDrugDic(id, data) {
125
   return request({
126
   return request({
126
-    url: '/api/drugdic/update?id=' + id,
127
-    method: 'put',
127
+    url: "/api/drugdic/update?id=" + id,
128
+    method: "put",
128
     data: data
129
     data: data
129
-  })
130
+  });
130
 }
131
 }
131
 export function DeleteDrugDic(id) {
132
 export function DeleteDrugDic(id) {
132
   return request({
133
   return request({
133
-    url: '/api/drugdic/delete?id=' + id,
134
-    method: 'delete'
135
-  })
134
+    url: "/api/drugdic/delete?id=" + id,
135
+    method: "delete"
136
+  });
136
 }
137
 }
137
 
138
 
138
 export function CreateDrugWay(data) {
139
 export function CreateDrugWay(data) {
139
   return request({
140
   return request({
140
-    url: '/api/drugway/create',
141
-    method: 'post',
141
+    url: "/api/drugway/create",
142
+    method: "post",
142
     data: data
143
     data: data
143
-  })
144
+  });
144
 }
145
 }
145
 
146
 
146
 export function UpdateDrugWay(id, data) {
147
 export function UpdateDrugWay(id, data) {
147
   return request({
148
   return request({
148
-    url: '/api/drugway/update?id=' + id,
149
-    method: 'put',
149
+    url: "/api/drugway/update?id=" + id,
150
+    method: "put",
150
     data: data
151
     data: data
151
-  })
152
+  });
152
 }
153
 }
153
 export function DeleteDrugWay(id) {
154
 export function DeleteDrugWay(id) {
154
   return request({
155
   return request({
155
-    url: '/api/drugway/delete?id=' + id,
156
-    method: 'delete'
157
-  })
156
+    url: "/api/drugway/delete?id=" + id,
157
+    method: "delete"
158
+  });
158
 }
159
 }
159
 
160
 
160
 export function CreateExecutionFrequency(data) {
161
 export function CreateExecutionFrequency(data) {
161
   return request({
162
   return request({
162
-    url: '/api/executionfrequency/create',
163
-    method: 'post',
163
+    url: "/api/executionfrequency/create",
164
+    method: "post",
164
     data: data
165
     data: data
165
-  })
166
+  });
166
 }
167
 }
167
 
168
 
168
 export function UpdateExecutionFrequency(id, data) {
169
 export function UpdateExecutionFrequency(id, data) {
169
   return request({
170
   return request({
170
-    url: '/api/executionfrequency/update?id=' + id,
171
-    method: 'put',
171
+    url: "/api/executionfrequency/update?id=" + id,
172
+    method: "put",
172
     data: data
173
     data: data
173
-  })
174
+  });
174
 }
175
 }
175
 export function DeleteExecutionFrequency(id) {
176
 export function DeleteExecutionFrequency(id) {
176
   return request({
177
   return request({
177
-    url: '/api/executionfrequency/delete?id=' + id,
178
-    method: 'delete'
179
-  })
178
+    url: "/api/executionfrequency/delete?id=" + id,
179
+    method: "delete"
180
+  });
180
 }
181
 }
181
 export function CreateAdviceTemplate(data) {
182
 export function CreateAdviceTemplate(data) {
182
   return request({
183
   return request({
183
-    url: '/api/advicetemplate/create',
184
-    method: 'post',
184
+    url: "/api/advicetemplate/create",
185
+    method: "post",
185
     data: data
186
     data: data
186
-  })
187
+  });
187
 }
188
 }
188
 
189
 
189
 export function UpdateAdviceTemplate(id, data) {
190
 export function UpdateAdviceTemplate(id, data) {
190
   return request({
191
   return request({
191
-    url: '/api/advicetemplate/update?id=' + id,
192
-    method: 'put',
192
+    url: "/api/advicetemplate/update?id=" + id,
193
+    method: "put",
193
     data: data
194
     data: data
194
-  })
195
+  });
195
 }
196
 }
196
 export function DeleteAdviceTemplate(id, template_id, parent_id) {
197
 export function DeleteAdviceTemplate(id, template_id, parent_id) {
197
   return request({
198
   return request({
198
-    url: '/api/advicetemplate/delete?id=' + id + '&template_id=' + template_id + '&parent_id=' + parent_id,
199
-    method: 'delete'
200
-  })
199
+    url:
200
+      "/api/advicetemplate/delete?id=" +
201
+      id +
202
+      "&template_id=" +
203
+      template_id +
204
+      "&parent_id=" +
205
+      parent_id,
206
+    method: "delete"
207
+  });
201
 }
208
 }
202
 
209
 
203
 export function postAdviceTemplate(params, name, advice_type) {
210
 export function postAdviceTemplate(params, name, advice_type) {
204
   return request({
211
   return request({
205
-    url: '/api/advicetemplate/create?template_name=' + name + '&advice_type=' + advice_type,
206
-    method: 'post',
212
+    url:
213
+      "/api/advicetemplate/create?template_name=" +
214
+      name +
215
+      "&advice_type=" +
216
+      advice_type,
217
+    method: "post",
207
     data: params
218
     data: params
208
-  })
219
+  });
209
 }
220
 }
210
 
221
 
211
 export function CreateGroupAdvice(id, groupno, advices, mode) {
222
 export function CreateGroupAdvice(id, groupno, advices, mode) {
212
   if (advices.remind > 0) {
223
   if (advices.remind > 0) {
213
     return request({
224
     return request({
214
-      url: '/api/patients/advice/creategroup?id=' + id + '&groupno=' + groupno + '&mode=' + mode,
215
-      method: 'post',
225
+      url:
226
+        "/api/patients/advice/creategroup?id=" +
227
+        id +
228
+        "&groupno=" +
229
+        groupno +
230
+        "&mode=" +
231
+        mode,
232
+      method: "post",
216
       data: advices,
233
       data: advices,
217
       headers: {
234
       headers: {
218
-        'Permission': 2
235
+        Permission: 2
219
       }
236
       }
220
-
221
-    })
237
+    });
222
   } else {
238
   } else {
223
     return request({
239
     return request({
224
-      url: '/api/patients/advice/creategroup?id=' + id + '&groupno=' + groupno + '&mode=' + mode,
225
-      method: 'post',
240
+      url:
241
+        "/api/patients/advice/creategroup?id=" +
242
+        id +
243
+        "&groupno=" +
244
+        groupno +
245
+        "&mode=" +
246
+        mode,
247
+      method: "post",
226
       data: advices,
248
       data: advices,
227
       headers: {
249
       headers: {
228
-        'Permission': 2
250
+        Permission: 2
229
       }
251
       }
230
-
231
-    })
252
+    });
232
   }
253
   }
233
 }
254
 }
234
 export function DeleteGroupAdvice(groupno, mode) {
255
 export function DeleteGroupAdvice(groupno, mode) {
235
   return request({
256
   return request({
236
-    url: '/api/patients/advice/deletegroup?groupno=' + groupno + '&mode=' + mode,
237
-    method: 'delete',
257
+    url:
258
+      "/api/patients/advice/deletegroup?groupno=" + groupno + "&mode=" + mode,
259
+    method: "delete",
238
     headers: {
260
     headers: {
239
-      'Permission': 3
261
+      Permission: 3
240
     }
262
     }
241
-
242
-  })
263
+  });
243
 }
264
 }
244
 
265
 
245
 export function getAllAdviceTemplate() {
266
 export function getAllAdviceTemplate() {
246
   return request({
267
   return request({
247
-    url: '/api/advicetemplate/list',
248
-    method: 'get'
249
-  })
268
+    url: "/api/advicetemplate/list",
269
+    method: "get"
270
+  });
250
 }
271
 }
251
 
272
 
252
 export function CreateSingleAdviceTemplate(advices) {
273
 export function CreateSingleAdviceTemplate(advices) {
253
   return request({
274
   return request({
254
-    url: '/api/advicetemplate/add',
255
-    method: 'post',
275
+    url: "/api/advicetemplate/add",
276
+    method: "post",
256
     params: advices
277
     params: advices
257
-
258
-  })
278
+  });
259
 }
279
 }
260
 export function DeleteParentAdviceTemplate(id) {
280
 export function DeleteParentAdviceTemplate(id) {
261
   return request({
281
   return request({
262
-    url: '/api/adviceparenttemplate/delete?template_id=' + id,
263
-    method: 'delete'
264
-
265
-  })
282
+    url: "/api/adviceparenttemplate/delete?template_id=" + id,
283
+    method: "delete"
284
+  });
266
 }
285
 }
267
 
286
 
268
 export function CreateSubAdvice(params) {
287
 export function CreateSubAdvice(params) {
269
   return request({
288
   return request({
270
-    url: '/api/subadvice/create',
271
-    method: 'post',
289
+    url: "/api/subadvice/create",
290
+    method: "post",
272
     params: params
291
     params: params
273
-  })
292
+  });
274
 }
293
 }
275
 
294
 
276
 export function updateTemplateName(params) {
295
 export function updateTemplateName(params) {
277
   return request({
296
   return request({
278
-    url: '/api/template/modify',
279
-    method: 'post',
297
+    url: "/api/template/modify",
298
+    method: "post",
280
     params: params
299
     params: params
281
-  })
300
+  });
282
 }
301
 }
283
 
302
 
284
 export function getDoctorAdviceConfig() {
303
 export function getDoctorAdviceConfig() {
285
   return request({
304
   return request({
286
-    url: '/api/adviceconfig/get',
287
-    method: 'get'
288
-  })
305
+    url: "/api/adviceconfig/get",
306
+    method: "get"
307
+  });
289
 }
308
 }
290
 
309
 
291
 export function postDoctorAdviceConfig(params) {
310
 export function postDoctorAdviceConfig(params) {
292
   return request({
311
   return request({
293
-    url: '/api/adviceconfig/isopen',
294
-    method: 'post',
312
+    url: "/api/adviceconfig/isopen",
313
+    method: "post",
295
     params: params
314
     params: params
296
-  })
315
+  });
297
 }
316
 }
298
 
317
 
299
 export function getDoctorInitConfig() {
318
 export function getDoctorInitConfig() {
300
   return request({
319
   return request({
301
-    url: '/api/advicetemplate/init/get',
302
-    method: 'get'
303
-  })
320
+    url: "/api/advicetemplate/init/get",
321
+    method: "get"
322
+  });
304
 }
323
 }
305
 
324
 
306
 export function PostInitAdviceTemplate(params) {
325
 export function PostInitAdviceTemplate(params) {
307
   return request({
326
   return request({
308
-    url: '/api/advicetemplate/init/commit',
309
-    method: 'post',
327
+    url: "/api/advicetemplate/init/commit",
328
+    method: "post",
310
     params: params
329
     params: params
311
-
312
-  })
330
+  });
313
 }
331
 }
314
 
332
 
315
 export function getPrintInfo(data) {
333
 export function getPrintInfo(data) {
316
   return request({
334
   return request({
317
-    url: '/api/advicetemplate/getprintinfo',
318
-    method: 'post',
335
+    url: "/api/advicetemplate/getprintinfo",
336
+    method: "post",
319
     data: data
337
     data: data
320
-  })
338
+  });
321
 }
339
 }
322
 
340
 
323
 export function EditNewDoctorAdvice(patient, id, advice, mode) {
341
 export function EditNewDoctorAdvice(patient, id, advice, mode) {
324
   return request({
342
   return request({
325
-    url: '/api/patients/advice/edit?id=' + id + '&patient=' + patient + '&mode=' + mode,
326
-    method: 'Put',
343
+    url:
344
+      "/api/patients/advice/edit?id=" +
345
+      id +
346
+      "&patient=" +
347
+      patient +
348
+      "&mode=" +
349
+      mode,
350
+    method: "Put",
327
     data: advice,
351
     data: advice,
328
     headers: {
352
     headers: {
329
-      'Permission': 2
353
+      Permission: 2
330
     }
354
     }
331
-
332
-  })
355
+  });
333
 }
356
 }
334
 
357
 
335
 export function CreateNewDoctorAdvice(id, advice, mode) {
358
 export function CreateNewDoctorAdvice(id, advice, mode) {
336
   return request({
359
   return request({
337
-    url: '/api/patients/advice/create?id=' + id + '&mode=' + mode,
338
-    method: 'post',
360
+    url: "/api/patients/advice/create?id=" + id + "&mode=" + mode,
361
+    method: "post",
339
     data: advice,
362
     data: advice,
340
     headers: {
363
     headers: {
341
-      'Permission': 2
364
+      Permission: 2
342
     }
365
     }
343
-
344
-  })
366
+  });
345
 }
367
 }
346
 
368
 
347
 export function CreateNewGroupAdvice(id, groupno, advices, mode) {
369
 export function CreateNewGroupAdvice(id, groupno, advices, mode) {
348
   if (advices.remind > 0) {
370
   if (advices.remind > 0) {
349
     return request({
371
     return request({
350
-      url: '/api/patients/advice/creategroup?id=' + id + '&groupno=' + groupno + '&mode=' + mode,
351
-      method: 'post',
372
+      url:
373
+        "/api/patients/advice/creategroup?id=" +
374
+        id +
375
+        "&groupno=" +
376
+        groupno +
377
+        "&mode=" +
378
+        mode,
379
+      method: "post",
352
       data: advices,
380
       data: advices,
353
       headers: {
381
       headers: {
354
-        'Permission': 3
382
+        Permission: 3
355
       }
383
       }
356
-
357
-    })
384
+    });
358
   } else {
385
   } else {
359
     return request({
386
     return request({
360
-      url: '/api/patients/advice/creategroup?id=' + id + '&groupno=' + groupno + '&mode=' + mode,
361
-      method: 'post',
387
+      url:
388
+        "/api/patients/advice/creategroup?id=" +
389
+        id +
390
+        "&groupno=" +
391
+        groupno +
392
+        "&mode=" +
393
+        mode,
394
+      method: "post",
362
       data: advices,
395
       data: advices,
363
       headers: {
396
       headers: {
364
-        'Permission': 3
397
+        Permission: 3
365
       }
398
       }
366
-
367
-    })
399
+    });
368
   }
400
   }
369
 }
401
 }
370
 
402
 
371
 export function DeleteNewDoctorAdvice(id, mode) {
403
 export function DeleteNewDoctorAdvice(id, mode) {
372
   return request({
404
   return request({
373
-    url: '/api/patients/advice/delete?id=' + id + '&mode=' + mode,
374
-    method: 'Delete',
405
+    url: "/api/patients/advice/delete?id=" + id + "&mode=" + mode,
406
+    method: "Delete",
375
     headers: {
407
     headers: {
376
-      'Permission': 2
408
+      Permission: 2
377
     }
409
     }
378
-
379
-  })
410
+  });
380
 }
411
 }
381
 
412
 
382
 export function DeleteNewGroupAdvice(groupno, mode) {
413
 export function DeleteNewGroupAdvice(groupno, mode) {
383
   return request({
414
   return request({
384
-    url: '/api/patients/advice/deletegroup?groupno=' + groupno + '&mode=' + mode,
385
-    method: 'delete',
415
+    url:
416
+      "/api/patients/advice/deletegroup?groupno=" + groupno + "&mode=" + mode,
417
+    method: "delete",
386
     headers: {
418
     headers: {
387
-      'Permission': 3
419
+      Permission: 3
388
     }
420
     }
389
-
390
-  })
421
+  });
391
 }
422
 }
392
 
423
 
393
 export function StopDoctorAdvice(id, reason, mode) {
424
 export function StopDoctorAdvice(id, reason, mode) {
394
   return request({
425
   return request({
395
-    url: '/api/patients/advice/stop?id=' + id + '&mode=' + mode,
396
-    method: 'Post',
426
+    url: "/api/patients/advice/stop?id=" + id + "&mode=" + mode,
427
+    method: "Post",
397
     data: reason,
428
     data: reason,
398
     headers: {
429
     headers: {
399
-      'Permission': 2
430
+      Permission: 2
400
     }
431
     }
401
-
402
-  })
432
+  });
403
 }
433
 }
404
 
434
 
405
 export function ExecGroupAdvice(groupno, time, mode) {
435
 export function ExecGroupAdvice(groupno, time, mode) {
406
   return request({
436
   return request({
407
-    url: '/api/patients/advice/execgroup?groupno=' + groupno + '&execution_time=' + time + '&mode=' + mode,
408
-    method: 'Post',
437
+    url:
438
+      "/api/patients/advice/execgroup?groupno=" +
439
+      groupno +
440
+      "&execution_time=" +
441
+      time +
442
+      "&mode=" +
443
+      mode,
444
+    method: "Post",
409
     headers: {
445
     headers: {
410
-      'Permission': 2
446
+      Permission: 2
411
     }
447
     }
412
-
413
-  })
448
+  });
414
 }
449
 }
415
 
450
 
416
 export function CheckGroupAdvice(groupno, mode) {
451
 export function CheckGroupAdvice(groupno, mode) {
417
   var params = {
452
   var params = {
418
     groupno: groupno,
453
     groupno: groupno,
419
     mode: mode
454
     mode: mode
420
-  }
455
+  };
421
   return request({
456
   return request({
422
-    url: '/api/patients/advice/checkgroup',
423
-    method: 'Post',
457
+    url: "/api/patients/advice/checkgroup",
458
+    method: "Post",
424
     params: params,
459
     params: params,
425
     headers: {
460
     headers: {
426
-      'Permission': 2
461
+      Permission: 2
427
     }
462
     }
428
-
429
-  })
463
+  });
430
 }
464
 }
431
 
465
 
432
 export function getPatientSchedules(id, params) {
466
 export function getPatientSchedules(id, params) {
433
-  console.log('id----', id)
467
+  console.log("id----", id);
434
   return request({
468
   return request({
435
-    url: '/api/patients/advices/getpatientschedules?id=' + id,
436
-    method: 'get',
469
+    url: "/api/patients/advices/getpatientschedules?id=" + id,
470
+    method: "get",
437
     params: params
471
     params: params
438
-  })
472
+  });
439
 }
473
 }

File diff suppressed because it is too large
+ 2451 - 2452
src/xt_pages/dialysis/template/DialysisPrintOrderNine.vue


+ 69 - 18
src/xt_pages/user/doctorAdvice.vue View File

34
         <el-button
34
         <el-button
35
           size="small"
35
           size="small"
36
           @click="printThisInfo()"
36
           @click="printThisInfo()"
37
-          :type="adviceType == 1 || adviceType == 3 ? 'primary' : 'warning'"
37
+          :type="
38
+            adviceType == 1 || adviceType == 3 || adviceType == 2
39
+              ? 'primary'
40
+              : 'warning'
41
+          "
38
           icon="el-icon-printer"
42
           icon="el-icon-printer"
39
           >打印
43
           >打印
40
         </el-button>
44
         </el-button>
149
         >
153
         >
150
           <template slot-scope="scope">
154
           <template slot-scope="scope">
151
             <span v-if="scope.row.advice_type == 1">长嘱</span>
155
             <span v-if="scope.row.advice_type == 1">长嘱</span>
152
-            <span v-else-if="scope.row.advice_type == 3">临嘱</span>
156
+            <span
157
+              v-else-if="
158
+                scope.row.advice_type == 3 || scope.row.advice_type == 2
159
+              "
160
+              >临嘱</span
161
+            >
153
             <span v-else></span>
162
             <span v-else></span>
154
           </template>
163
           </template>
155
         </el-table-column>
164
         </el-table-column>
1915
   getAllAdviceConfig,
1924
   getAllAdviceConfig,
1916
   getDoctorAdviceList,
1925
   getDoctorAdviceList,
1917
   StopDoctorAdvice,
1926
   StopDoctorAdvice,
1918
-  getPatientSchedules
1927
+  getPatientSchedules,
1928
+  getPrintInfo
1919
 } from "@/api/advice";
1929
 } from "@/api/advice";
1920
 
1930
 
1921
 import { fetchPatient, PostRemind } from "@/api/patient";
1931
 import { fetchPatient, PostRemind } from "@/api/patient";
1988
         ]
1998
         ]
1989
       },
1999
       },
1990
 
2000
 
1991
-      adviceType: 0,
1992
-      adviceTypeArr: [
1993
-        { value: 0, label: "全部" },
1994
-        { value: 1, label: "长期" },
1995
-        { value: 3, label: "临时" }
1996
-      ],
2001
+      adviceType: 1,
2002
+      adviceTypeArr: [{ value: 1, label: "长期" }, { value: 3, label: "临时" }],
1997
       adviceTypeOptions: [
2003
       adviceTypeOptions: [
1998
         { value: 1, label: "长期" },
2004
         { value: 1, label: "长期" },
1999
         { value: 3, label: "临时" }
2005
         { value: 3, label: "临时" }
2102
       listQuery: {
2108
       listQuery: {
2103
         start_time: "",
2109
         start_time: "",
2104
         end_time: "",
2110
         end_time: "",
2105
-        advice_type: 0,
2111
+        advice_type: 1,
2106
         stop_state: "",
2112
         stop_state: "",
2107
         keywords: "",
2113
         keywords: "",
2108
-        id: 0
2114
+        id: 0,
2115
+        limit: 10,
2116
+        page: 1
2109
       },
2117
       },
2110
       addLoading: false,
2118
       addLoading: false,
2111
       lstableData: [],
2119
       lstableData: [],
2121
       multipleSelection: [],
2129
       multipleSelection: [],
2122
       patientID: 0,
2130
       patientID: 0,
2123
       temp: null,
2131
       temp: null,
2124
-      schedulStatus: 0
2132
+      schedulStatus: 0,
2133
+      doctorAdvice: [],
2134
+      dataAdvice: []
2125
     };
2135
     };
2126
   },
2136
   },
2127
   methods: {
2137
   methods: {
2130
       console.log("column", column);
2140
       console.log("column", column);
2131
     },
2141
     },
2132
     onTranPatient: function(tranPatient) {
2142
     onTranPatient: function(tranPatient) {
2143
+      console.log("tranPatient", tranPatient);
2133
       this.currentPatient = tranPatient;
2144
       this.currentPatient = tranPatient;
2134
     },
2145
     },
2135
     adviceNameShow({ row, column, rowIndex, columnIndex }) {
2146
     adviceNameShow({ row, column, rowIndex, columnIndex }) {
3263
         if (response.data.state == 1) {
3274
         if (response.data.state == 1) {
3264
           this.adviceTableData = response.data.data.advices;
3275
           this.adviceTableData = response.data.data.advices;
3265
           console.log("数据是什么", this.adviceTableData);
3276
           console.log("数据是什么", this.adviceTableData);
3277
+          var advice = response.data.data.advices;
3278
+          var one = response.data.data.advicetwo;
3279
+          console.log("advicetwo", one);
3280
+          let dataInfo = {};
3281
+          one.forEach((item, index) => {
3282
+            let { start_time } = item;
3283
+            if (!dataInfo[start_time]) {
3284
+              dataInfo[start_time] = {
3285
+                start_time,
3286
+                child: []
3287
+              };
3288
+            }
3289
+          });
3290
+          let list = Object.values(dataInfo);
3291
+          // console.log("list", list);
3292
+          list.map(item => {
3293
+            for (let i = 0; i < advice.length; i++) {
3294
+              if (
3295
+                item.start_time === advice[i].start_time &&
3296
+                advice[i].parent_id === 0
3297
+              ) {
3298
+                item.child.push(advice[i]);
3299
+              }
3300
+            }
3301
+          });
3302
+
3303
+          let objarr = [];
3304
+          for (let i = 0; i < advice.length; i++) {
3305
+            if (advice[i].parent_id != 0) {
3306
+              objarr.push(advice[i]);
3307
+            }
3308
+          }
3309
+          this.childList = objarr;
3310
+          let arr = this.doctorAdvice;
3311
+          arr.push(...list.reverse());
3312
+          console.log("arr", arr);
3313
+          this.doctorAdvice = arr;
3314
+          var total = response.data.data.total;
3315
+          console.log("total", total);
3316
+
3266
           this.operators = response.data.data.operators;
3317
           this.operators = response.data.data.operators;
3267
           if (this.operators.length > 0) {
3318
           if (this.operators.length > 0) {
3268
             var operatorsLen = this.operators.length;
3319
             var operatorsLen = this.operators.length;
3297
     },
3348
     },
3298
 
3349
 
3299
     selectAdvice(selection, row) {
3350
     selectAdvice(selection, row) {
3300
-      console.log("hhe", selection);
3301
-      if (this.adviceType != 3) {
3351
+      if (this.adviceType != 3 || this.adviceType != 2) {
3302
         this.lstableData = [];
3352
         this.lstableData = [];
3303
       } else if (this.adviceType != 1) {
3353
       } else if (this.adviceType != 1) {
3304
         this.cqtableData = [];
3354
         this.cqtableData = [];
3331
       }
3381
       }
3332
     },
3382
     },
3333
     changeAdvice(selection) {
3383
     changeAdvice(selection) {
3334
-      console.log("selection", selection);
3335
       this.multipleSelection = selection;
3384
       this.multipleSelection = selection;
3336
     },
3385
     },
3337
     handleClick(val) {
3386
     handleClick(val) {
3354
             scanStyles: false
3403
             scanStyles: false
3355
           });
3404
           });
3356
         }, 1);
3405
         }, 1);
3357
-      } else if (this.adviceType == 3) {
3406
+      } else if (this.adviceType == 3 || this.adviceType == 2) {
3358
         if (this.lstableData.length == 0) {
3407
         if (this.lstableData.length == 0) {
3359
           this.$message.error("请勾选需要打印的医嘱!");
3408
           this.$message.error("请勾选需要打印的医嘱!");
3360
           return false;
3409
           return false;
4195
         if (response.data.state === 1) {
4244
         if (response.data.state === 1) {
4196
           var doctoradvice = response.data.data.doctoradvice;
4245
           var doctoradvice = response.data.data.doctoradvice;
4197
           console.log("doctoradvice", doctoradvice);
4246
           console.log("doctoradvice", doctoradvice);
4198
-          if (this.adviceType === 3) {
4199
-            this.lstableData = this.multipleSelection;
4247
+          this.dataAdvice = doctoradvice;
4248
+          if (this.adviceType === 3 || this.adviceType === 2) {
4249
+            this.lstableData = this.dataAdvice;
4250
+            console.log("---", this.multipleSelection);
4200
           } else if (this.adviceType === 1) {
4251
           } else if (this.adviceType === 1) {
4201
             this.cqtableData = doctoradvice;
4252
             this.cqtableData = doctoradvice;
4202
           }
4253
           }