|
@@ -83,8 +83,8 @@
|
83
|
83
|
|
84
|
84
|
<el-table-column label="推送医嘱" align="center" width="1280">
|
85
|
85
|
<template slot-scope="scope">
|
86
|
|
- {{getAdviceContent(scope.row.patient_id)}}
|
87
|
|
- {{getHisAdviceContent(scope.row.patient_id)}}
|
|
86
|
+ <span v-if="config.is_open !=1">{{getAdviceContent(scope.row.patient_id)}}</span>
|
|
87
|
+ <span v-if="config.is_open == 1"> {{getHisAdviceContent(scope.row.patient_id)}}</span>
|
88
|
88
|
</template>
|
89
|
89
|
</el-table-column>
|
90
|
90
|
|
|
@@ -233,10 +233,11 @@
|
233
|
233
|
adviceList:[],
|
234
|
234
|
templateList:[],
|
235
|
235
|
startdialogVisible:false,
|
236
|
|
- schedule_type:"",
|
237
|
|
- partion_type:"",
|
|
236
|
+ schedule_type:0,
|
|
237
|
+ partion_type:0,
|
238
|
238
|
druglist:[],
|
239
|
239
|
tableList:[],
|
|
240
|
+ config:{},
|
240
|
241
|
}
|
241
|
242
|
},
|
242
|
243
|
created() {
|
|
@@ -257,6 +258,9 @@
|
257
|
258
|
this.getlist()
|
258
|
259
|
},
|
259
|
260
|
methods: {
|
|
261
|
+ open(){
|
|
262
|
+
|
|
263
|
+ },
|
260
|
264
|
getlist(){
|
261
|
265
|
getDialysisAdviceTemplateList(this.query).then(response=>{
|
262
|
266
|
if(response.data.state == 1){
|
|
@@ -267,7 +271,20 @@
|
267
|
271
|
var adviceList = response.data.data.adviceList
|
268
|
272
|
this.adviceList = adviceList
|
269
|
273
|
var templateList = response.data.data.templateList
|
|
274
|
+ var druglist = response.data.data.drugList
|
|
275
|
+ for(let i=0;i<templateList.length;i++){
|
|
276
|
+ templateList[i].advice_desc = ""
|
|
277
|
+ for(let j=0;j<druglist.length;j++){
|
|
278
|
+ if(templateList[i].drug_id == druglist[j].id){
|
|
279
|
+ templateList[i].advice_desc = druglist[j].dose + druglist[j].dose_unit +"*"+druglist[j].min_unit +druglist[j].min_number+"/"+druglist[j].max_unit
|
|
280
|
+ }
|
|
281
|
+ }
|
|
282
|
+ }
|
|
283
|
+ console.log("医嘱模版",templateList)
|
270
|
284
|
this.templateList = templateList
|
|
285
|
+
|
|
286
|
+ this.config = response.data.data.config
|
|
287
|
+
|
271
|
288
|
}
|
272
|
289
|
})
|
273
|
290
|
},
|
|
@@ -355,68 +372,90 @@
|
355
|
372
|
console.log("listwo222222",list)
|
356
|
373
|
var adviceList = response.data.data.adviceList
|
357
|
374
|
console.log("adviceList",adviceList)
|
358
|
|
- if(adviceList!=null && adviceList.length > 0){
|
359
|
|
- let dataInfo = {}
|
360
|
|
- adviceList.forEach((item, index) => {
|
361
|
|
- let { advice_name } = item
|
362
|
|
- if (!dataInfo[advice_name]) {
|
363
|
|
- dataInfo[advice_name] = {
|
364
|
|
- advice_name:item.advice_name,
|
365
|
|
- child: [],
|
366
|
|
- count:0,
|
367
|
|
- drug_id:item.drug_id,
|
368
|
|
- specification_name:item.advice_desc,
|
|
375
|
+ var config = response.data.data.config
|
|
376
|
+ console.log("config",config)
|
|
377
|
+ if(config.is_open!=1){
|
|
378
|
+ if(adviceList!=null && adviceList.length > 0){
|
|
379
|
+ let dataInfo = {}
|
|
380
|
+ adviceList.forEach((item, index) => {
|
|
381
|
+ let { advice_name } = item
|
|
382
|
+ if (!dataInfo[advice_name]) {
|
|
383
|
+ dataInfo[advice_name] = {
|
|
384
|
+ advice_name:item.advice_name,
|
|
385
|
+ child: [],
|
|
386
|
+ count:0,
|
|
387
|
+ drug_id:item.drug_id,
|
|
388
|
+ specification_name:item.advice_desc,
|
|
389
|
+ patient_id:item.patient_id,
|
|
390
|
+ }
|
|
391
|
+ }
|
|
392
|
+ })
|
|
393
|
+ let arr = Object.values(dataInfo)
|
|
394
|
+ if(arr.length > 0){
|
|
395
|
+ for(let i=0;i<adviceList.length;i++){
|
|
396
|
+ for(let j=0;j<arr.length;j++){
|
|
397
|
+ if(adviceList[i].advice_name == arr[j].advice_name){
|
|
398
|
+ arr[j].child.push(adviceList[i])
|
|
399
|
+ }
|
|
400
|
+ }
|
369
|
401
|
}
|
370
|
402
|
}
|
371
|
|
- })
|
372
|
|
- let arr = Object.values(dataInfo)
|
373
|
|
- if(arr.length > 0){
|
374
|
|
- for(let i=0;i<adviceList.length;i++){
|
|
403
|
+
|
|
404
|
+ this.tableList = []
|
|
405
|
+ for(let i=0;i<list.length;i++){
|
375
|
406
|
for(let j=0;j<arr.length;j++){
|
376
|
|
- if(adviceList[i].advice_name == arr[j].advice_name){
|
377
|
|
- arr[j].child.push(adviceList[i])
|
378
|
|
- }
|
|
407
|
+ if(list[i].patient_id == arr[j].patient_id){
|
|
408
|
+ this.tableList.push(arr[j])
|
|
409
|
+ }
|
379
|
410
|
}
|
380
|
|
- }
|
381
|
|
- }
|
382
|
|
- console.log("xinar232323232",arr)
|
383
|
|
- this.tableList = []
|
384
|
|
- this.tableList = arr
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ }
|
385
|
414
|
}
|
|
415
|
+
|
386
|
416
|
|
387
|
417
|
|
388
|
418
|
|
389
|
419
|
var templateList = response.data.data.templateList
|
390
|
|
-
|
391
|
|
- console.log("templateList",templateList)
|
392
|
|
- if(templateList!=null && templateList.length > 0){
|
393
|
|
- let dataInfoOne = {}
|
394
|
|
- adviceList.forEach((item, index) => {
|
395
|
|
- let { advice_name } = item
|
396
|
|
- if (!dataInfoOne[advice_name]) {
|
397
|
|
- dataInfoOne[advice_name] = {
|
398
|
|
- advice_name:item.advice_name,
|
399
|
|
- child: [],
|
400
|
|
- count:0,
|
401
|
|
- specification_name:this.getSpecification(item.drug_id),
|
402
|
|
- drug_id:item.drug_id,
|
|
420
|
+ console.log("templatelist",templateList)
|
|
421
|
+ if(config.is_open == 1){
|
|
422
|
+ if(templateList!=null && templateList.length > 0){
|
|
423
|
+ let dataInfoOne = {}
|
|
424
|
+ templateList.forEach((item, index) => {
|
|
425
|
+ let { advice_name } = item
|
|
426
|
+ if (!dataInfoOne[advice_name]) {
|
|
427
|
+ dataInfoOne[advice_name] = {
|
|
428
|
+ advice_name:item.advice_name,
|
|
429
|
+ child: [],
|
|
430
|
+ count:0,
|
|
431
|
+ specification_name:this.getSpecification(item.drug_id),
|
|
432
|
+ drug_id:item.drug_id,
|
|
433
|
+ patient_id:item.patient_id,
|
|
434
|
+ }
|
|
435
|
+ }
|
|
436
|
+ })
|
|
437
|
+ let hisarr = Object.values(dataInfoOne)
|
|
438
|
+ if(hisarr.length > 0){
|
|
439
|
+ for(let i=0;i<templateList.length;i++){
|
|
440
|
+ for(let j=0;j<hisarr.length;j++){
|
|
441
|
+ if(templateList[i].drug_id == hisarr[j].drug_id){
|
|
442
|
+ hisarr[j].child.push(templateList[i])
|
|
443
|
+ }
|
|
444
|
+ }
|
403
|
445
|
}
|
404
|
446
|
}
|
405
|
|
- })
|
406
|
|
- let hisarr = Object.values(dataInfoOne)
|
407
|
|
- if(hisarr.length > 0){
|
408
|
|
- for(let i=0;i<templateList.length;i++){
|
|
447
|
+ console.log("hisarr",hisarr)
|
|
448
|
+ this.tableList = []
|
|
449
|
+ for(let i=0;i<list.length;i++){
|
409
|
450
|
for(let j=0;j<hisarr.length;j++){
|
410
|
|
- if(templateList[i].advice_name == hisarr[j].advice_name){
|
411
|
|
- hisarr[j].child.push(templateList[i])
|
412
|
|
- }
|
|
451
|
+ if(list[i].patient_id == hisarr[j].patient_id){
|
|
452
|
+ this.tableList.push(hisarr[j])
|
|
453
|
+ }
|
413
|
454
|
}
|
414
|
|
- }
|
415
|
|
- }
|
416
|
|
- this.tableList = []
|
417
|
|
- console.log("hisarrw22222222",hisarr)
|
418
|
|
- this.tableList = hisarr
|
|
455
|
+ }
|
|
456
|
+ }
|
419
|
457
|
}
|
|
458
|
+
|
420
|
459
|
|
421
|
460
|
|
422
|
461
|
|
|
@@ -465,34 +504,35 @@
|
465
|
504
|
formatJson(filterVal, jsonData) {
|
466
|
505
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
467
|
506
|
},
|
|
507
|
+
|
468
|
508
|
getAdviceContent(patient_id){
|
469
|
509
|
var newArr = []
|
470
|
510
|
var his_str = ""
|
471
|
|
- if(this.templateList!=null && this.templateList.length > 0){
|
472
|
|
- for(let i=0;i<this.templateList.length;i++){
|
473
|
|
- if(patient_id == this.templateList[i].patient_id){
|
474
|
|
- newArr.push(this.templateList[i])
|
|
511
|
+ if(this.adviceList!=null && this.adviceList.length > 0){
|
|
512
|
+ for(let i=0;i<this.adviceList.length;i++){
|
|
513
|
+ if(patient_id == this.adviceList[i].patient_id){
|
|
514
|
+ newArr.push(this.adviceList[i])
|
475
|
515
|
}
|
476
|
516
|
}
|
477
|
517
|
}
|
478
|
518
|
if(newArr!=null && newArr.length > 0){
|
479
|
519
|
for(let i=0;i<newArr.length;i++){
|
480
|
|
- his_str += newArr[i].advice_name +''+newArr[i].advice_desc +''+ newArr[i].prescribing_number +''+newArr[i].prescribing_number_unit + "。"
|
|
520
|
+ his_str += newArr[i].advice_name +' '+newArr[i].advice_desc +' '+ newArr[i].prescribing_number +' '+newArr[i].prescribing_number_unit + "。"
|
481
|
521
|
}
|
482
|
522
|
}
|
483
|
523
|
return his_str
|
484
|
524
|
},
|
485
|
525
|
getHisAdviceContent(patient_id){
|
486
|
526
|
var arr = []
|
487
|
|
- for(let i=0;i<this.adviceList.length;i++){
|
488
|
|
- if(patient_id == this.adviceList[i].patient_id){
|
489
|
|
- arr.push(this.adviceList[i])
|
|
527
|
+ for(let i=0;i<this.templateList.length;i++){
|
|
528
|
+ if(patient_id == this.templateList[i].patient_id){
|
|
529
|
+ arr.push(this.templateList[i])
|
490
|
530
|
}
|
491
|
531
|
}
|
492
|
532
|
var str = ""
|
493
|
533
|
if(arr!=null && arr.length > 0){
|
494
|
534
|
for(let i=0;i<arr.length;i++){
|
495
|
|
- str += arr[i].advice_name +''+ arr[i].advice_desc+'' + arr[i].prescribing_number+'' + arr[i].prescribing_number_unit + "。"
|
|
535
|
+ str += arr[i].advice_name +' '+ arr[i].advice_desc+' ' + arr[i].prescribing_number+' ' + arr[i].prescribing_number_unit + "。"
|
496
|
536
|
}
|
497
|
537
|
}
|
498
|
538
|
return str
|
|
@@ -501,7 +541,7 @@
|
501
|
541
|
var specification_name = ""
|
502
|
542
|
for(let i=0;i<this.druglist.length;i++){
|
503
|
543
|
if(id == this.druglist[i].id){
|
504
|
|
- specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_nubmer +this.druglist[i].min_unit +"/"+this.druglist[i].max_unt
|
|
544
|
+ specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
|
505
|
545
|
}
|
506
|
546
|
}
|
507
|
547
|
return specification_name
|