Browse Source

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 1 year ago
parent
commit
84f45b0910

File diff suppressed because it is too large
+ 322 - 371
src/xt_pages/dialysis/template/DialysisPrintOrderSixtyeight.vue


+ 186 - 88
src/xt_pages/workforce/Patientshift.vue View File

@@ -73,12 +73,14 @@
73 73
                 </td>
74 74
                 <td>
75 75
                   <div v-for="(it,index) in numberlist" style="display: inline-block;position: relative;" >
76
-                    <div v-if="hidder_chuang==true ? getkongchuang(it,item.list)>0 : ' '">
77
-                      <div  v-if="ite.partition_id==it.zone_id" class="huanzhekuais" :style="{'height':!hidder ? '110px': '30px','line-height':hidder ? '30px':''}" @dblclick="db_click($event,it)" @drop="drop($event,item,it.number)" @dragstart="curInfoDragStart($event,item)" draggable="true"   @dragover="allowDrop"> 
76
+                    <div v-if="hidder_chuang==true ? getkongchuang(it,item.list)>0 : ' '"><!--'background':getcolors(item)>0?'bisque':'#30b8e394'  'background':item2.mode_id==2||item2.mode_id==3?'bisque':'#30b8e394'-->
77
+                      <div  v-if="ite.partition_id==it.zone_id" class="huanzhekuais" 
78
+                      :style="{'height':!hidder ? '110px': '45px','overflow': 'auto'}" 
79
+                      @dblclick="db_click($event,it)" @drop="drop($event,item,it.number)" @dragstart="curInfoDragStart($event,item)" draggable="true"   @dragover="allowDrop"> 
78 80
                         <div class="huanzhekuai">
79
-                          <div v-for="(item2) in item.list"   draggable="true" >
80
-                            <template >
81
-                              <div v-if="it.id==item2.bed_id" style="display: inline-block;">
81
+                          <div v-for="(item2) in item.list" style="width: 100%;">
82
+                            <template>
83
+                              <div v-if="it.id==item2.bed_id" :style="{'display': 'inline-block','color':item2.mode_id==2 || item2.mode_id==3 ? 'red':'black'}">
82 84
                                 <div>
83 85
                                   <span>{{nameSplit(item2.name) }}({{ getmode(item2.mode_id) }})</span><br>
84 86
                                   <span v-if="!hidder" >
@@ -308,11 +310,13 @@
308 310
                 <td>
309 311
                   <div v-for="(it,index) in numberlist" style="display: inline-block;position: relative;" >
310 312
                     <div v-if="hidder_chuang==true ? getkongchuang(it,item.list)>0 : ' '">
311
-                      <div  v-if="ite.partition_id==it.zone_id" class="huanzhekuais" :style="{'height':!hidder ? '110px': '30px','line-height':hidder ? '30px':''}" @dblclick="db_click($event,it)" @drop="drop($event,item,it.number)" @dragstart="curInfoDragStart($event,item)" draggable="true"   @dragover="allowDrop"> 
313
+                      <div  v-if="ite.partition_id==it.zone_id" class="huanzhekuais" 
314
+                      :style="{'height':!hidder ? '110px': '45px','overflow': 'auto'}" 
315
+                      @dblclick="db_click($event,it)" @drop="drop($event,item,it.number)" @dragstart="curInfoDragStart($event)" draggable="true"   @dragover="allowDrop"> 
312 316
                         <div class="huanzhekuai">
313
-                          <div v-for="(item2) in item.list"   draggable="true" >
317
+                          <div v-for="(item2) in item.list" :key="item2.bed_id"   draggable="true" >
314 318
                             <template >
315
-                              <div v-if="it.id==item2.bed_id" style="display: inline-block;">
319
+                              <div v-if="it.id==item2.bed_id" :style="{'display': 'inline-block','color':item2.mode_id==2 || item2.mode_id==3 ? 'red':'black'}">
316 320
                                 <div>
317 321
                                   <span>{{nameSplit(item2.name) }}({{ getmode(item2.mode_id) }})</span><br>
318 322
                                   <span v-if="!hidder" >
@@ -382,6 +386,8 @@ export default {
382 386
         quhao:'',
383 387
         chaung:'',
384 388
         patient_id:'',
389
+        schedule_remark:'',
390
+        blood_access_id:'',
385 391
       },
386 392
       currentData:{
387 393
         currentData_id:'',
@@ -470,11 +476,11 @@ export default {
470 476
    console.log('dsafas',this.date);
471 477
     this.getAllZones()
472 478
     this.getlist()
479
+    // this.getcolors()
473 480
   },
474 481
   mounted(){
475 482
     // console.log('8888',this.huanzhe.order.DeviceNumber.zone.name);
476 483
   },
477
-
478 484
   methods:{
479 485
     quan_ping(){
480 486
       if(this.quanping==false){
@@ -495,6 +501,7 @@ export default {
495 501
       }
496 502
       return arr
497 503
     },
504
+    
498 505
     drop(e,val,value){
499 506
       this.allowDrop(e)
500 507
       var bedid = ''
@@ -513,6 +520,7 @@ export default {
513 520
             patient_id:val.list[i].patient_id,
514 521
             bed_id:val.list[i].bed_id
515 522
           }
523
+          console.log('kkkk',this.currentData);
516 524
         }
517 525
       }
518 526
       for(let x=0;x<this.numberlist.length;x++){
@@ -529,7 +537,6 @@ export default {
529 537
       }
530 538
       
531 539
       if(e.target.innerText == ''){
532
-        console.log('3333',e.target.innerText);
533 540
         this.schedule={
534 541
           schedule_date:this.date,
535 542
           schedule_type:this.classes,
@@ -552,7 +559,7 @@ export default {
552 559
           currentData_quhao:this.cur_drag_info.quhao,
553 560
           currentData_chaung:this.cur_drag_info.chaung,
554 561
           patient_id:this.cur_drag_info.patient_id,
555
-          
562
+
556 563
         }
557 564
         console.log('8888',this.currentData);
558 565
         this.setScheduleTwo(this.cur_drag_info.id)
@@ -582,27 +589,130 @@ export default {
582 589
         id_one:this.cur_drag_info.id,
583 590
         id_two:this.currentData.currentData_id
584 591
       }
592
+      console.log('3333',this.list);
585 593
         CoverSch(params).then((response) => {
586 594
         if (response.data.state == 0) {
587 595
           this.$message.error(response.data.msg);
588 596
           this.tipDialogVisibleTwo = false
589 597
         } else {
590
-          console.log('888888888888',response.data);
598
+          console.log('888888888888',response.data.data);
591 599
           this.$message.success("替换成功");
592 600
           this.tipDialogVisible = false
593 601
           this.tipDialogVisibleTwo = false
594
-          // const listl=this.list
602
+          const listl=this.list
603
+          // console.log('jjjj',this.list);
604
+          for(let i=0;i<listl.length;i++){
605
+            if(this.cur_drag_info.patient_id== listl[i].patient_id){
606
+              listl[i].bed_id = ''
607
+              this.list.splice(i,1)
608
+              // console.log('0000',i,this.list);
609
+            }
610
+            if(this.currentData.patient_id== listl[i].patient_id){
611
+              listl[i].bed_id = this.currentData.bed_id
612
+              listl[i].id = response.data.data.new_sch.id
613
+              listl[i].name = this.cur_drag_info.name
614
+              listl[i].new_name=this.cur_drag_info.name
615
+              listl[i].partition_id =this.cur_drag_info.partition_id
616
+              
617
+              listl[i].mode_id = this.cur_drag_info.mode_id
618
+              listl[i].patient_id = this.cur_drag_info.patient_id
619
+              listl[i].schedule_date=this.cur_drag_info.schedule_date
620
+              listl[i].schedule_type =this.cur_drag_info.schedule_type
621
+
622
+              listl[i].schedule_week = this.cur_drag_info.schedule_week
623
+              listl[i].order.DeviceNumber.number = this.cur_drag_info.chaung
624
+              listl[i].order.DeviceNumber.zone.name=this.cur_drag_info.quhao
625
+              listl[i].order.schedule_remark=this.cur_drag_info.schedule_remark
626
+              listl[i].order.blood_access_id=this.cur_drag_info.blood_access_id
627
+              // console.log('nnnn',listl[i],this.list);
628
+            }
629
+          }
630
+          return this.list
631
+          // this.getlist()
632
+          // for(let i=0;i<this.list.length;i++){
633
+          //   if(this.currentData.bed_id==this.list[i].bed_id){
634
+          //     this.list[i].patient_id=this.cur_drag_info.patient_id
635
+          //     this.list[i].id= response.data.new_sch.id
636
+          //     // console.log('3333',this.list);
637
+          //     // listl.splice(i,1)
638
+          //   }
639
+          // }
640
+          // console.log('6666',this.list);
641
+          // return this.list
642
+          // 
643
+          // for(let i=0;i<listl.length;i++){
644
+          //   if(this.currentData.bed_id==listl[i].bed_id){
645
+          //     listl[i].patient_id= this.cur_drag_info.patient_id
646
+          //     console.log('bbbb',this.currentData);
647
+          //   }
648
+          //   if(this.cur_drag_info.bed_id==listl[i].bed_id){
649
+          //    listl.splice(i,1)
650
+          //     console.log('bbbb',listl);
651
+          //   }
652
+          // }
653
+
595 654
           // for(let i=0;i<listl.length;i++){
596 655
           //   if(this.cur_drag_info.name== listl[i].name){
597
-          //     listl[i].bed_id = this.cur_drag_info.bed_id
656
+          //     listl[i].bed_id = ''
598 657
               
599 658
           //   }
600 659
           //   if(this.currentData.currentData_name== listl[i].name){
601
-          //     listl[i].bed_id = this.cur_drag_info.bed_id
602
-          //     console.log('nnnn',this.ent_index,this.cur_drag_info.bed_id);
660
+          //     listl[i].bed_id = this.currentData.bed_id
661
+          //     listl[i].id = response.data.data.new_sch.id
662
+          //     console.log('nnnn',listl[i],this.cur_drag_info.bed_id);
663
+          //   }
664
+          // }
665
+
666
+          // for(let i=0;i<listl.length;i++){
667
+          //   if(this.currentData.bed_id== listl[i].bed_id){
668
+          //     // listl.splice(i,1)
669
+          //     listl[i].id=response.data.data.new_sch.id
670
+          //     // listl[i].bed_id = this.currentData.bed_id
671
+          //     listl[i].name = this.cur_drag_info.name
672
+          //     listl[i].new_name=this.cur_drag_info.name
673
+          //     listl[i].partition_id =this.cur_drag_info.partition_id
674
+              
675
+          //     listl[i].mode_id = this.cur_drag_info.mode_id
676
+          //     listl[i].patient_id = this.cur_drag_info.patient_id
677
+          //     listl[i].schedule_date=this.cur_drag_info.schedule_date
678
+          //     listl[i].schedule_type =this.cur_drag_info.schedule_type
679
+
680
+          //     listl[i].schedule_week = this.cur_drag_info.schedule_week
681
+          //     listl[i].order.DeviceNumber.number = this.cur_drag_info.chaung
682
+          //     listl[i].order.DeviceNumber.zone.name=this.cur_drag_info.quhao
683
+          //     listl[i].order.schedule_remark=this.cur_drag_info.schedule_remark
684
+          //     listl[i].order.blood_access_id=this.cur_drag_info.blood_access_id
685
+          //     // listl.splice(i,1)
686
+          //     console.log('vvvv',listl[i]);
687
+          //     // return listl
688
+          //   }
689
+          //   console.log('cur_drag_info.bed_id',this.cur_drag_info.bed_id);
690
+          //   if(this.cur_drag_info.bed_id== listl[i].bed_id){
691
+          //     this.list.splice(i,1)
692
+          //     // listl[i].name=''
693
+          //     // listl[i].bed_id=''
694
+          //     // listl[i].new_name=''
695
+          //     // listl[i].mode_id=''
696
+          //     // listl[i].patient_id=''
697
+          //     // listl[i].order.DeviceNumber.number = ''
698
+          //     // listl[i].order.DeviceNumber.zone.name= ''
699
+          //     // listl[i].order.schedule_remark=''
700
+          //     // listl[i].order.blood_access_id=''
701
+          //     listl.splice(i,1)
702
+          //     console.log('this.list',listl[i],this.list);
703
+          //     // return listl
603 704
           //   }
705
+          //   // if(this.cur_drag_info.patient_id== listl[i].patient_id){
706
+          //   //   // listl[i].bed_id = this.currentData.bed_id
707
+          //   //   this.lsit=listl.splice(i,1)
708
+          //   //   console.log('nnnn',listl,this.currentData.bed_id);
709
+          //   //   return this.list
710
+          //   // }
711
+           
604 712
           // }
605
-          this.getlist();
713
+          // console.log('pppp',this.list);
714
+          // return this.list
715
+          // this.getlist();
606 716
         }
607 717
       });
608 718
     },
@@ -610,25 +720,6 @@ export default {
610 720
     changeSchTwo(){
611 721
       // this.tipDialogVisible=false
612 722
       this.tipDialogVisible=false
613
-      // this.tipDialogVisibleThree = false
614
-      // const listl=this.list
615
-      // for(let i=0;i<listl.length;i++){
616
-      //   if(this.cur_drag_info.name== listl[i].name){
617
-      //     // drag_index=i
618
-      //     // this.drag_index=listl[i].bed_id
619
-      //     this.currentData.bed_id =listl[i].bed_id
620
-      //     console.log('mmmm',this.drag_index,this.currentData);
621
-          
622
-      //   }
623
-      //   if(this.currentData.currentData_name== listl[i].name){
624
-      //     // this.ent_index=listl[i].bed_id
625
-      //     this.cur_drag_info.bed_id=listl[i].bed_id
626
-      //     console.log('nnnn',this.ent_index,this.cur_drag_info.bed_id);
627
-      //   }
628
-      // }
629
-      // // listl.splice(drag_index, 1, ...listl.splice(ent_index, 1, listl[drag_index]))
630
-      // console.log('zzzzz',this.cur_drag_info);
631
-      // console.log('xxxxx', this.currentData);
632 723
       let params={
633 724
         id_one:this.cur_drag_info.id,
634 725
         id_two:this.currentData.currentData_id
@@ -644,18 +735,17 @@ export default {
644 735
           this.tipDialogVisible = false
645 736
           this.tipDialogVisibleThree = false
646 737
           
647
-          // const listl=this.list
648
-          // for(let i=0;i<listl.length;i++){
649
-          //   if(this.cur_drag_info.name== listl[i].name){
650
-          //     listl[i].bed_id = this.currentData.bed_id 
651
-          //     console.log('mmmm',listl,this.currentData);
652
-          //   }
653
-          //   if(this.currentData.currentData_name== listl[i].name){
654
-          //     // this.ent_index=listl[i].bed_id
655
-          //     listl[i].bed_id =this.cur_drag_info.bed_id
656
-          //   }
657
-          // }
658
-           this.getlist();
738
+          const listl=this.list
739
+          for(let i=0;i<listl.length;i++){
740
+            if(this.cur_drag_info.patient_id== listl[i].patient_id){
741
+              listl[i].bed_id = this.currentData.bed_id 
742
+              console.log('mmmm',listl,this.currentData);
743
+            }
744
+            if(this.currentData.patient_id== listl[i].patient_id){
745
+              listl[i].bed_id =this.cur_drag_info.bed_id
746
+            }
747
+          }
748
+          // this.getlist();
659 749
         }
660 750
       });
661 751
       
@@ -674,36 +764,38 @@ export default {
674 764
       if (response.data.state == 0) {
675 765
         this.$message.error(response.data.msg);
676 766
       } else {
677
-        // var schedule = response.data.data.schedule;
678
-        // console.log('ddddd',schedule);
679
-        // this.list
680
-        // const listl=this.list
681
-        // for(let i=0;i<listl.length;i++){
682
-        //   if(this.schedule.patient== listl[i].name){
683
-        //     listl[i].bed_id = this.schedule.bed_id 
684
-        //     console.log('mmmm',listl);
685
-        //   }
686
-        // }
687
-         this.getlist()
767
+        var schedule = response.data.data.schedule;
768
+        console.log('ddddd',schedule);
769
+        const listl=this.list
770
+        for(let i=0;i<listl.length;i++){
771
+          if(schedule.patient_id== listl[i].patient_id){
772
+            listl[i].bed_id = schedule.bed_id 
773
+            listl[i].id = schedule.id
774
+            console.log('mmmm',listl[i].id);
775
+            // console.log('kkkk',this.currentData);
776
+          }
777
+        }
688 778
       }
689 779
     },
690 780
     // 需要拖动的
691
-    curInfoDragStart(e,val){
781
+    curInfoDragStart(e){
692 782
       const inntext2= e.target.innerText.split('(')[0]
693
-      for(let i=0;i<val.list.length;i++){
694
-        if(inntext2 == val.list[i].new_name){
783
+      for(let i=0;i<this.list.length;i++){
784
+        if(inntext2 == this.list[i].new_name){
695 785
           this.cur_drag_info={
696
-            id:val.list[i].id,
697
-            name:val.list[i].name,
698
-            quhao:val.list[i].order.DeviceNumber.zone.name,
699
-            chaung:val.list[i].order.DeviceNumber.number,
700
-            patient_id:val.list[i].patient_id,
701
-            bed_id:val.list[i].bed_id,
702
-            mode_id:val.list[i].mode_id,
703
-            partition_id:val.list[i].partition_id,
786
+            id:this.list[i].id,
787
+            name:this.list[i].name,
788
+            quhao:this.list[i].order.DeviceNumber.zone.name,
789
+            chaung:this.list[i].order.DeviceNumber.number,
790
+            patient_id:this.list[i].patient_id,
791
+            bed_id:this.list[i].bed_id,
792
+            mode_id:this.list[i].mode_id,
793
+            partition_id:this.list[i].partition_id,
704 794
             schedule_date:this.date,
705 795
             schedule_type:this.classes,
706
-            schedule_week: val.list[i].schedule_week,
796
+            schedule_week: this.list[i].schedule_week,
797
+            schedule_remark:this.list[i].order.schedule_remark,
798
+            blood_access_id:this.list[i].order.blood_access_id,
707 799
           }
708 800
         }
709 801
       }
@@ -764,7 +856,7 @@ export default {
764 856
       }
765 857
       this.loading = true
766 858
       this.tableData = []
767
-      console.log('111111111',params);
859
+      // console.log('111111111',params);
768 860
       getSchedualPrintList(params).then((response) => {
769 861
         if (response.data.state == 1) {
770 862
           this.loading = false
@@ -781,7 +873,7 @@ export default {
781 873
            list[i][new_name]=this.nameSplit(list[i].name)
782 874
            
783 875
           }
784
-          console.log('9999',list);
876
+          // console.log('9999',list);
785 877
           if (list != null && list.length > 0) {
786 878
             const dataInfo = {}
787 879
             list.forEach((item, index) => {
@@ -814,7 +906,7 @@ export default {
814 906
             // console.log('排班数据------------------', arr)
815 907
 
816 908
             this.tableData = arr
817
-            console.log('22222222',this.tableData);
909
+            // console.log('22222222',this.tableData);
818 910
           }
819 911
 
820 912
           this.numberList = response.data.data.numberList
@@ -857,9 +949,9 @@ export default {
857 949
     //   return str
858 950
     // },
859 951
     // 透析模式
860
-    getmode(id){
952
+    getmode(ids){
861 953
       for(let i=0;i<this.mode.length;i++){
862
-        if(id=this.mode[i].id){
954
+        if(ids==this.mode[i].id){
863 955
           return this.mode[i].name
864 956
         }
865 957
       }
@@ -1122,18 +1214,18 @@ export default {
1122 1214
                 this.$message.success("交换成功");
1123 1215
                 this.tipDialogVisible = false
1124 1216
                 this.tipDialogVisibleThree = false
1125
-                this.getlist();
1126
-                // const listl=this.list
1127
-                // for(let i=0;i<listl.length;i++){
1128
-                //   if(this.huanzhe.name== listl[i].name){
1129
-                //     listl[i].bed_id = this.chuangwei 
1130
-                //     console.log('mmmm',listl,this.currentData);
1131
-                //   }
1132
-                //   if(this.genghuan.name== listl[i].name){
1133
-                //     // this.ent_index=listl[i].bed_id
1134
-                //     listl[i].bed_id =this.huanzhe.bed_id
1135
-                //   }
1136
-                // }
1217
+                // this.getlist();
1218
+                const listl=this.list
1219
+                for(let i=0;i<listl.length;i++){
1220
+                  if(this.huanzhe.name== listl[i].name){
1221
+                    listl[i].bed_id = this.chuangwei 
1222
+                    console.log('mmmm',listl,this.currentData);
1223
+                  }
1224
+                  if(this.genghuan.name== listl[i].name){
1225
+                    // this.ent_index=listl[i].bed_id
1226
+                    listl[i].bed_id =this.huanzhe.bed_id
1227
+                  }
1228
+                }
1137 1229
               }
1138 1230
             });
1139 1231
             return this.genghuan
@@ -1173,6 +1265,12 @@ export default {
1173 1265
       // }
1174 1266
     }
1175 1267
   },
1268
+  // watch:{
1269
+  //   list(val){
1270
+  //     console.log('wwwww',val);
1271
+  //     return this.list=val
1272
+  //   }
1273
+  // }
1176 1274
 }
1177 1275
 </script>
1178 1276