3 Ревизии 33271e8c6d ... 011fb99222

Автор SHA1 Съобщение Дата
  陈少旭 011fb99222 1111 преди 3 седмици
  陈少旭 1ffa233c55 Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch преди 3 седмици
  陈少旭 892041aab8 1111 преди 3 седмици

+ 5 - 0
src/xt_pages/Dialysisanalysis/summary/index.vue Целия файл

@@ -155,6 +155,8 @@ export default {
155 155
               label: key // 可以自定义表头名称
156 156
             }));
157 157
             // this.tableData = response.data.data.list
158
+            console.log(this.columns)
159
+
158 160
 
159 161
 
160 162
             this.tableData = response.data.data.list.map(row => {
@@ -165,6 +167,9 @@ export default {
165 167
               return newRow;
166 168
             });
167 169
 
170
+            console.log( this.tableData)
171
+
172
+
168 173
             // 将 JSON 数据设置为表格数据
169 174
 
170 175
           } else {

+ 46 - 45
src/xt_pages/Pharmacy/DrugDispensing.vue Целия файл

@@ -239,7 +239,7 @@
239 239
                 {{ scope.row.frequency }}
240 240
               </template>
241 241
             </el-table-column>
242
-            
242
+
243 243
             <el-table-column
244 244
               prop="name"
245 245
               label="天数"
@@ -262,7 +262,7 @@
262 262
             </el-table-column>
263 263
             <el-table-column label="药品追溯码" width="162" align="center">
264 264
               <template slot-scope="scope">
265
-                <div @click="getDrugCode(scope.row.ID,scope.row.data_sources,scope.row.DrugCode,scope.$index)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div> 
265
+                <div @click="getDrugCode(scope.row.ID,scope.row.data_sources,scope.row.DrugCode,scope.$index)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
266 266
               </template>
267 267
             </el-table-column>
268 268
             <el-table-column
@@ -574,33 +574,33 @@ export default {
574 574
         }else{
575 575
           return ""
576 576
         }
577
-      
577
+
578 578
       }
579 579
 
580 580
     },
581 581
     // 追溯码
582 582
     getDrugCode(id,DataSources,DrugCode,index){
583
-      
583
+
584 584
       if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id == 0){
585 585
         var params = {
586 586
             drug_id:this.drug_id,
587 587
             start_time:moment().subtract(15, 'days').format("YYYY-MM-DD")
588 588
         }
589
-       
589
+
590 590
         getDrugTocalCount(params).then(response=>{
591 591
           if(response.data.state == 1){
592
-            
592
+
593 593
             var adviceList = response.data.data.adviceList
594 594
 
595 595
            this.scan_code = response.data.data.drug.scan_code
596
-              
596
+
597 597
             var str = ""
598 598
             if(adviceList!=null && adviceList.length>0){
599 599
               for(let i=0;i<adviceList.length;i++){
600 600
                 if(adviceList[i].drug_code!=""){
601
-                  str+=adviceList[i].drug_code 
601
+                  str+=adviceList[i].drug_code
602 602
                 }
603
-              
603
+
604 604
               }
605 605
             }
606 606
             var new_arr = str.split(",");
@@ -608,20 +608,20 @@ export default {
608 608
             console.log("adviceList==========",new_arr)
609 609
 
610 610
             if(new_arr!=null && new_arr.length>0){
611
-              
611
+
612 612
               let dataInfo = {}
613 613
               new_arr.forEach((item, index) => {
614 614
                 if (!dataInfo[item]) {
615 615
                     dataInfo[item] = {
616 616
                     drug_code:item,
617
-                    child: [], 
617
+                    child: [],
618 618
                   }
619 619
                 }
620 620
               })
621 621
               let arr = Object.values(dataInfo)
622 622
 
623 623
               if(arr!=null && arr.length>0){
624
-                
624
+
625 625
                 for(let i=0;i<arr.length;i++){
626 626
                   for(let j=0;j<new_arr.length;j++){
627 627
                       if(arr[i].drug_code == new_arr[j]){
@@ -630,11 +630,11 @@ export default {
630 630
                   }
631 631
                 }
632 632
               }
633
-              
633
+
634 634
               this.newArrList = []
635 635
               this.newArrList = arr
636
-               
637
-              this.id = id 
636
+
637
+              this.id = id
638 638
               var is_source =0
639 639
               if (DataSources == "his处方"){
640 640
                   is_source = 1
@@ -649,13 +649,13 @@ export default {
649 649
               this.$nextTick(()=>{
650 650
                 this.$refs.Datefrom.focus()
651 651
               })
652
-              
652
+
653 653
             }
654 654
           }
655 655
         })
656 656
 
657 657
       }else{
658
-        this.id = id 
658
+        this.id = id
659 659
         var is_source =0
660 660
         if (DataSources == "his处方"){
661 661
           is_source = 1
@@ -675,14 +675,15 @@ export default {
675 675
     saveTextArea(){
676 676
 
677 677
 
678
-      
678
+
679 679
        var params = {
680 680
         id:this.id,
681 681
         data_source:this.is_source,
682 682
         drug_code:this.textarea,
683 683
        }
684 684
        console.log("paramss",params)
685
-      
685
+
686
+
686 687
       changeDrugCode(params).then(response=>{
687 688
          if(response.data.state == 1){
688 689
             this.$message.success("保存成功!")
@@ -702,15 +703,15 @@ export default {
702 703
         var textarea = ""
703 704
         textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
704 705
 
705
-      
706
+
706 707
         if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id == 10726){
707
-          
708
+
708 709
           var drugindentificaitoncode = this.getDrugIdentificationCode(this.drug_id)
709
-         
710
+
710 711
           var total_one = 0
711 712
           var total_two = 0
712 713
 
713
-          
714
+
714 715
 
715 716
           var arr= []
716 717
           arr = textarea.split(",")
@@ -721,14 +722,14 @@ export default {
721 722
                 if (!dataInfo[item]) {
722 723
                     dataInfo[item] = {
723 724
                     drug_code:item,
724
-                    child: [], 
725
+                    child: [],
725 726
                   }
726 727
                  }
727 728
                })
728 729
                let new_arr = Object.values(dataInfo)
729 730
 
730 731
                if(new_arr!=null && new_arr.length>0){
731
-                
732
+
732 733
                  for(let i=0;i<new_arr.length;i++){
733 734
                    for(let j=0;j<arr.length;j++){
734 735
                       if(new_arr[i].drug_code == arr[j]){
@@ -738,13 +739,13 @@ export default {
738 739
                  }
739 740
                }
740 741
             arrList = new_arr
741
-            
742
+
742 743
           }
743 744
 
744 745
           var is_err_check = false
745 746
           var i_index = ""
746 747
           var drug_code = ""
747
-       
748
+
748 749
           if(arr!=null && arr.length>0){
749 750
             for(let i=0;i<arr.length;i++){
750 751
 
@@ -763,8 +764,8 @@ export default {
763 764
                     }
764 765
                   }
765 766
                  }
766
-                
767
-                
767
+
768
+
768 769
 
769 770
                }
770 771
 
@@ -773,7 +774,7 @@ export default {
773 774
           if(is_err_check == true){
774 775
               arr.splice(i_index,1)
775 776
           }
776
-         
777
+
777 778
           for(let i=0;i<this.newArrList.length;i++){
778 779
              if(drug_code == this.newArrList[i].drug_code){
779 780
                  total_one = this.newArrList[i].child.length
@@ -788,23 +789,23 @@ export default {
788 789
 
789 790
           console.log("total_one-----------",total_one)
790 791
           console.log("total_two-----------",total_two)
791
-   
792
+
792 793
           if(this.scan_code>0){
793 794
             if((total_one + total_two)>this.scan_code){
794 795
               this.$message.error("扫码次数已经超过限制!")
795 796
               arr.splice(i_index,1)
796 797
             }
797 798
           }
798
-         
799
+
799 800
          var is_arr = this.hasDuplicates(arr)
800 801
 
801
-       
802
+
802 803
 
803 804
         this.textarea = arr.join(",")
804 805
 
805 806
         }else{
806 807
           var arr = textarea.split(",");
807
-          
808
+
808 809
           var lastElement = arr[arr.length - 2];
809 810
 
810 811
           if(lastElement.length!=20){
@@ -812,7 +813,7 @@ export default {
812 813
             arr.splice(arr.length-2,1)
813 814
           }
814 815
           console.log("arr-------------",arr)
815
-         
816
+
816 817
           this.textarea = ""
817 818
           this.textarea = arr.join(",")
818 819
 
@@ -821,7 +822,7 @@ export default {
821 822
           // var i_index = ""
822 823
           // var arr = textarea.split(",")
823 824
           // if(arr!=null && arr.length>0){
824
-            
825
+
825 826
           //   for(let i=0;i<arr.length;i++){
826 827
           //     console.log("arrp[i].")
827 828
           //     i_index = i
@@ -832,23 +833,23 @@ export default {
832 833
           //       }else{
833 834
           //         newArr.push(arr[i])
834 835
           //       }
835
-                
836
+
836 837
           //     }
837 838
           //   }
838 839
           // }
839
-         
840
+
840 841
           // if(is_err_check == 1){
841 842
           //    newArr.splice(i_index,1)
842 843
           // }
843 844
 
844
-          
845
+
845 846
           // if(newArr!=null && newArr.length>0){
846
-           
847
+
847 848
           //   this.textarea = newArr.join(",")
848 849
           // }
849 850
           // this.textarea = textarea
850 851
         }
851
-       
852
+
852 853
       }
853 854
     },
854 855
     tt() {},
@@ -934,7 +935,7 @@ export default {
934 935
           data.forEach((el, index) => {
935 936
             dose_unit.push(this.getDose_unit(el.total));
936 937
           });
937
-        
938
+
938 939
           dose_unit = this.unique_unit(dose_unit);
939 940
           console.log(dose_unit,'dose_unit')
940 941
           // // 数据合计
@@ -1457,8 +1458,8 @@ export default {
1457 1458
             this.tableData = []
1458 1459
             this.tableData = list
1459 1460
           }
1460
-         
1461
-         
1461
+
1462
+
1462 1463
           this.total = res.data.data.total; //合计
1463 1464
         } else {
1464 1465
           this.$message.error(res.data.msg);
@@ -1529,7 +1530,7 @@ export default {
1529 1530
       return uniqueNumbers.length !== arr.length;
1530 1531
     },
1531 1532
     getDrugIdentificationCode(id){
1532
-       
1533
+
1533 1534
       var drug_identification_code = ""
1534 1535
       for(let i=0;i<this.baseList.length;i++){
1535 1536
           if(id == this.baseList[i].id){

+ 149 - 219
src/xt_pages/Pharmacy/PatientDispensing.vue Целия файл

@@ -69,13 +69,13 @@
69 69
           >
70 70
             <el-table-column prop="date" label="患者姓名" width="100">
71 71
               <template slot-scope="scope">
72
-                <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
72
+                <span>{{ scope.row.name ? scope.row.name : "" }}</span>
73 73
               </template>
74 74
             </el-table-column>
75 75
             <el-table-column prop="name" label="透析号" width="100">
76 76
               <template slot-scope="scope">
77 77
                 <span>{{
78
-                  scope.row.DialysisNo ? scope.row.DialysisNo : ""
78
+                  scope.row.dialysis_no ? scope.row.dialysis_no : ""
79 79
                 }}</span>
80 80
               </template>
81 81
             </el-table-column>
@@ -97,13 +97,13 @@
97 97
           >
98 98
             <el-table-column prop="date" label="患者姓名" width="100">
99 99
               <template slot-scope="scope">
100
-                <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
100
+                <span>{{ scope.row.name ? scope.row.name : "" }}</span>
101 101
               </template>
102 102
             </el-table-column>
103 103
             <el-table-column prop="name" label="透析号" width="100">
104 104
               <template slot-scope="scope">
105 105
                 <span>{{
106
-                  scope.row.DialysisNo ? scope.row.DialysisNo : ""
106
+                  scope.row.dialysis_no ? scope.row.dialysis_no : ""
107 107
                 }}</span>
108 108
               </template>
109 109
             </el-table-column>
@@ -189,7 +189,7 @@
189 189
             </el-table-column>
190 190
             <el-table-column label="规格" width="100" align="center">
191 191
               <template slot-scope="scope">
192
-                <span>{{getSpecaiName(scope.row.DrugId)}}</span>
192
+                <span>{{ scope.row.Spec}}</span>
193 193
               </template>
194 194
             </el-table-column>
195 195
             <el-table-column label="单次用量" width="100" align="center">
@@ -223,12 +223,12 @@
223 223
             </el-table-column>
224 224
             <el-table-column label="生产厂商" width="100" align="center">
225 225
               <template slot-scope="scope">
226
-                <span>{{ getManutuer(scope.row.DrugId) }}</span>
226
+                <span>{{ (scope.row.MName) }}</span>
227 227
               </template>
228 228
             </el-table-column>
229 229
             <el-table-column label="药品追溯码" width="162" align="center">
230 230
               <template slot-scope="scope">
231
-                <div @click="getDrugCode(scope.row.ID,scope.row.DataSources,scope.row.DrugCode,scope.$index,scope.row.DrugId)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
231
+                <div @click="getDrugCode(scope.row.ID,scope.row.DataSources,scope.row.DrugCode,scope.$index,scope.row.DrugId,scope.row.Type)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
232 232
               </template>
233 233
             </el-table-column>
234 234
             <el-table-column label="开立医生" width="150" align="center">
@@ -245,7 +245,7 @@
245 245
             </el-table-column>
246 246
             <el-table-column label="国家编码" width="162" align="center">
247 247
               <template slot-scope="scope">
248
-                <span>{{getDrugName(scope.row.DrugId)}}</span>
248
+                <span>{{ scope.row.Bm}}</span>
249 249
               </template>
250 250
             </el-table-column>
251 251
 
@@ -426,17 +426,15 @@ export default {
426 426
       textAreaList:[],
427 427
       scan_code:"",
428 428
       printShow:false,
429
+      drug_type:1, //1是药品,2耗材
429 430
     };
430 431
   },
431
- 
432
+
432 433
   created() {
433 434
     this.init();
434
-    this.gettodaynumber();
435
-    this.fun3();
436 435
     this.getgetpartitionlist();
436
+    this.fun3();
437 437
     this.org_id = this.$store.getters.xt_user.org.id
438
-    // this.getwaitmount();//fun3
439
-    // this.selectedbydefault();
440 438
   },
441 439
   methods: {
442 440
     getTotal(){
@@ -455,9 +453,9 @@ export default {
455 453
         }else{
456 454
           return ""
457 455
         }
458
-       
456
+
459 457
       }
460
-     
458
+
461 459
     },
462 460
     openDialog(){
463 461
       this.$nextTick(() => {
@@ -493,7 +491,6 @@ export default {
493 491
       console.log("this.alreadmount", this.alreadmount);
494 492
     },
495 493
     async fun3() {
496
-      console.log("fun3");
497 494
       this.fun1().then((val) => {
498 495
         this.fun2();
499 496
       });
@@ -539,7 +536,7 @@ export default {
539 536
       console.log("state--",this.state)
540 537
       this.currentRow = val;
541 538
       console.log("this.currentRow", this.currentRow);
542
-    
539
+
543 540
       if (this.state == 1) {
544 541
         this.tableData = []
545 542
         this.patients = {}
@@ -577,21 +574,27 @@ export default {
577 574
     },
578 575
     //包装selectedbydefault
579 576
     fun2() {
580
-      console.log("3333333this.waitmount_data", this.waitmount_data);
581
-      // return new Promise((resolve, reject) => {
582 577
       if (this.state == 1 && this.waitmount_data.length > 0) {
583 578
         this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
579
+        this.currentRow = this.waitmount_data[0]
584 580
         this.handleCurrentChange(this.waitmount_data[0]);
581
+        console.log(" this.currentRow111")
582
+        console.log( this.currentRow)
583
+
584
+
585 585
       }
586 586
       if (this.state == 2 && this.alreadmount_data.length > 0) {
587 587
         this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
588
+        this.currentRow = this.alreadmount_data[0]
588 589
         this.handleCurrentChange(this.alreadmount_data[0]);
590
+        console.log(" this.currentRow222")
591
+        console.log( this.currentRow)
589 592
       }
590 593
       // });
591 594
     },
592 595
     changeTimes() {
593 596
       this.gettodaynumber();
594
-      this.getwaitmount();
597
+      // this.getwaitmount();
595 598
       this.fun3();
596 599
     },
597 600
     //获取当天发药的人数
@@ -623,8 +626,7 @@ export default {
623 626
         if (res.data.state == 1) {
624 627
           this.waitmount_data=[]
625 628
           var list = res.data.data.list;
626
-          this.baseList =[]
627
-          this.baseList = res.data.data.baseList
629
+
628 630
           if (this.shift != 0 || this.partition != 0) {
629 631
             if (this.waitmount_data == null) {
630 632
               this.waitmount = 0;
@@ -736,7 +738,6 @@ export default {
736 738
     },
737 739
     //包装getwaitmount
738 740
     async fun1() {
739
-      // return new Promise((resolve, reject) => {
740 741
       var params = {
741 742
         keyword: this.keywords,
742 743
         time: this.start_time,
@@ -746,86 +747,21 @@ export default {
746 747
       await waitingdrug(params).then((res) => {
747 748
         if (res.data.state == 1) {
748 749
           this.waitmount_data=[]
749
-          var list = res.data.data.list;
750 750
           this.patientList = []
751
-          this.patientList = res.data.data.patientList
752
-          var listTwo = res.data.data.listTwo
753
-          var newArr =[]
754
-          if(listTwo!=null && listTwo.length>0){
755
-             for(let i=0;i<listTwo.length;i++){
756
-              listTwo[i].PatientID = 0
757
-              listTwo[i].Name=""
758
-              listTwo[i].DialysisNo=""
759
-              listTwo[i].PatientID = listTwo[i].patient_id
760
-              listTwo[i].Name = listTwo[i].patient.name
761
-              listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
762
-              newArr.push(listTwo[i])
763
-             }
764
-          }
765
-          if(list!=null && list.length>0){
766
-            for(let i=0;i<list.length;i++){
767
-              this.waitmount_data.push(list[i])
768
-            }
769
-            if(newArr!=null && newArr.length>0){
770
-               for(let i=0;i<newArr.length;i++){
771
-                this.waitmount_data.push(newArr[i])
772
-               }
773
-            }
774
-          }
775
-          if(list==null){
776
-            if(newArr!=null && newArr.length>0){
777
-               for(let i=0;i<newArr.length;i++){
778
-                this.waitmount_data.push(newArr[i])
779
-               }
780
-            }
751
+          this.patientList = res.data.data.wait_patientList
752
+          this.waitmount_data =  this.patientList
753
+          this.waitmount =this.waitmount_data.length
781 754
 
782
-          }
783
-
784
-          console.log("1111111");
785 755
         }
786 756
       });
787 757
       await issueddrugs(params).then((res) => {
788 758
         if (res.data.state == 1) {
789 759
           this.alreadmount_data = []
790
-          var list = res.data.data.list;
791
-          var listTwo = res.data.data.listTwo
792
-          var newArr =[]
793
-          if(listTwo!=null && listTwo.length>0){
794
-             for(let i=0;i<listTwo.length;i++){
795
-              listTwo[i].PatientID = 0
796
-              listTwo[i].Name=""
797
-              listTwo[i].DialysisNo=""
798
-              listTwo[i].PatientID = listTwo[i].patient_id
799
-              listTwo[i].Name = listTwo[i].patient.name
800
-              listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
801
-              newArr.push(listTwo[i])
802
-             }
803
-          }
804
-          if(list!=null && list.length>0){
805
-            for(let i=0;i<list.length;i++){
806
-              this.alreadmount_data.push(list[i])
807
-            }
808
-            if(newArr!=null && newArr.length>0){
809
-               for(let i=0;i<newArr.length;i++){
810
-                this.alreadmount_data.push(newArr[i])
811
-               }
812
-            }
813
-          }
814
-          if(list==null){
815
-            if(newArr!=null && newArr.length>0){
816
-               for(let i=0;i<newArr.length;i++){
817
-                this.alreadmount_data.push(newArr[i])
818
-               }
819
-            }
820
-
821
-          }
822
-
823
-          console.log("1111111s");
760
+          this.alreadmount_data =  res.data.data.user_patientList
761
+          this.alreadmount = this.alreadmount_data.length
824 762
         }
825 763
       });
826
-      console.log("222222222");
827 764
 
828
-      // })
829 765
     },
830 766
     getPatientName(patient_id){
831 767
       var name = ""
@@ -855,14 +791,14 @@ export default {
855 791
       // });
856 792
       console.log("val2332323223",this.currentRow)
857 793
       var params = {
858
-        patient_id: this.currentRow.PatientID,
794
+        patient_id: this.currentRow.id,
859 795
         is_medicine: val,
860 796
         time: this.start_time,
861 797
       };
862 798
       getpharmacycontent(params).then((res) => {
863 799
         if (res.data.state == 1) {
864 800
           //  loading.close()
865
-         
801
+
866 802
            var list = res.data.data.list;
867 803
            console.log("hhhhawoowowow",res.data.data)
868 804
            this.baseList =[]
@@ -987,11 +923,8 @@ export default {
987 923
     // 搜索患者
988 924
     searchAction() {
989 925
       this.tableData = null;
990
-      this.getwaitmount();
991
-      if (this.shift != 0 || this.partition != 0) {
992
-      } else {
993
-        this.gettodaynumber();
994
-      }
926
+      this.fun3();
927
+      // this.gettodaynumber();
995 928
     },
996 929
 
997 930
     // 药品发药
@@ -1012,6 +945,7 @@ export default {
1012 945
             return false
1013 946
           } else {
1014 947
             var tmp = that.currentRow.PatientID;
948
+            console.log(that.currentRow)
1015 949
             var params = {
1016 950
               patient_id: that.currentRow.PatientID,
1017 951
               time: that.start_time,
@@ -1080,9 +1014,11 @@ export default {
1080 1014
         })
1081 1015
 
1082 1016
       }else{
1083
-        var tmp = this.currentRow.PatientID;
1017
+        var tmp = this.currentRow.id;
1018
+        console.log(this.currentRow)
1019
+
1084 1020
         var params = {
1085
-          patient_id: this.currentRow.PatientID,
1021
+          patient_id: this.currentRow.id,
1086 1022
           time: this.start_time,
1087 1023
         };
1088 1024
         this.$confirm("确定是否对该患者进行发药?", "患者发药", {
@@ -1156,9 +1092,9 @@ export default {
1156 1092
               });
1157 1093
             return false
1158 1094
           } else {
1159
-            var tmp = that.currentRow.PatientID;
1095
+            var tmp = that.currentRow.id;
1160 1096
             var params = {
1161
-              patient_id: that.currentRow.PatientID,
1097
+              patient_id: that.currentRow.id,
1162 1098
               admin_user_id: that.$store.getters.xt_user.user.id,
1163 1099
               time: that.start_time,
1164 1100
             };
@@ -1227,9 +1163,9 @@ export default {
1227 1163
             .catch(() => {});
1228 1164
         })
1229 1165
       }else{
1230
-        var tmp = this.currentRow.PatientID;
1166
+        var tmp = this.currentRow.id;
1231 1167
         var params = {
1232
-          patient_id: this.currentRow.PatientID,
1168
+          patient_id: this.currentRow.id,
1233 1169
           time: this.start_time,
1234 1170
         };
1235 1171
         this.$confirm("确定是否对该患者进行退药?", "患者退药", {
@@ -1285,102 +1221,108 @@ export default {
1285 1221
        }
1286 1222
        return spc
1287 1223
     },
1288
-    getDrugCode(id,DataSources,DrugCode,index,DrugId){
1289
-      
1290
-     // 针对百霖
1291
-       if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id==0|| this.$store.getters.xt_user.org.id==10726){
1224
+    getDrugCode(id,DataSources,DrugCode,index,DrugId,type){
1225
+      this.drug_type = type
1226
+      console.log(type)
1227
+      console.log( this.drug_type)
1228
+      if (type == 1){
1229
+        // 针对百霖
1230
+        if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id==0|| this.$store.getters.xt_user.org.id==10726){
1292 1231
           var params = {
1293 1232
             drug_id:DrugId,
1294 1233
             start_time:moment().subtract(15, 'days').format("YYYY-MM-DD")
1295 1234
           }
1296
-         getDrugTocalCount(params).then(response=>{
1297
-           if(response.data.state == 1){
1298
-             
1299
-            var adviceList = response.data.data.adviceList
1300
-
1301
-            var drug = response.data.data.drug
1302
-              
1303
-            this.scan_code = drug.scan_code
1304
-
1305
-
1306
-            var str = ""
1307
-            if(adviceList!=null && adviceList.length>0){
1308
-              for(let i=0;i<adviceList.length;i++){
1309
-                if(adviceList[i].drug_code!=""){
1310
-                  str+=adviceList[i].drug_code 
1235
+          getDrugTocalCount(params).then(response=>{
1236
+            if(response.data.state == 1){
1237
+              var adviceList = response.data.data.adviceList
1238
+              var drug = response.data.data.drug
1239
+              this.scan_code = drug.scan_code
1240
+              var str = ""
1241
+              if(adviceList!=null && adviceList.length>0){
1242
+                for(let i=0;i<adviceList.length;i++){
1243
+                  if(adviceList[i].drug_code!=""){
1244
+                    str+=adviceList[i].drug_code
1245
+                  }
1311 1246
                 }
1312
-               
1313 1247
               }
1314
-            }
1315
-            var new_arr = str.split(",");
1248
+              var new_arr = str.split(",");
1316 1249
 
1317
-            console.log("adviceList==========",new_arr)
1250
+              console.log("adviceList==========",new_arr)
1318 1251
 
1319
-            if(new_arr!=null && new_arr.length>0){
1320
-               
1321
-               let dataInfo = {}
1322
-               new_arr.forEach((item, index) => {
1323
-                if (!dataInfo[item]) {
1252
+              if(new_arr!=null && new_arr.length>0){
1253
+
1254
+                let dataInfo = {}
1255
+                new_arr.forEach((item, index) => {
1256
+                  if (!dataInfo[item]) {
1324 1257
                     dataInfo[item] = {
1325
-                    drug_code:item,
1326
-                    child: [], 
1258
+                      drug_code:item,
1259
+                      child: [],
1260
+                    }
1327 1261
                   }
1328
-                 }
1329
-               })
1330
-               let arr = Object.values(dataInfo)
1262
+                })
1263
+                let arr = Object.values(dataInfo)
1331 1264
 
1332
-               if(arr!=null && arr.length>0){
1333
-                
1334
-                 for(let i=0;i<arr.length;i++){
1335
-                   for(let j=0;j<new_arr.length;j++){
1265
+                if(arr!=null && arr.length>0){
1266
+
1267
+                  for(let i=0;i<arr.length;i++){
1268
+                    for(let j=0;j<new_arr.length;j++){
1336 1269
                       if(arr[i].drug_code == new_arr[j]){
1337
-                         arr[i].child.push(new_arr[j])
1270
+                        arr[i].child.push(new_arr[j])
1338 1271
                       }
1339
-                   }
1340
-                 }
1341
-               }
1342
-               
1343
-               this.newArrList = []
1344
-               this.newArrList = arr
1345
-               console.log("newARRlIST----------",this.newArrList)
1346
-            }
1347
-              
1348
-            this.drug_id = DrugId
1349
-            this.id = id
1350
-            var is_source =0
1351
-            if (DataSources == "his处方"){
1352
-              is_source = 1
1353
-            }
1354
-            if (DataSources == "临时医嘱"){
1355
-              is_source = 2
1272
+                    }
1273
+                  }
1274
+                }
1275
+
1276
+                this.newArrList = []
1277
+                this.newArrList = arr
1278
+                console.log("newARRlIST----------",this.newArrList)
1279
+              }
1280
+
1281
+              this.drug_id = DrugId
1282
+              this.id = id
1283
+              var is_source =0
1284
+              if (DataSources == "his处方"){
1285
+                is_source = 1
1286
+              }
1287
+              if (DataSources == "临时医嘱"){
1288
+                is_source = 2
1289
+              }
1290
+              this.is_source = is_source
1291
+              this.textarea = DrugCode
1292
+              this.currentIndex = index
1293
+
1294
+              this.dialogVisibleOne = true
1356 1295
             }
1357
-            this.is_source = is_source
1358
-            this.textarea = DrugCode
1359
-            this.currentIndex = index
1360
-            
1361
-            this.dialogVisibleOne = true
1362
-           }
1363
-         })
1364
-       }else{
1365
-        
1296
+          })
1297
+        }else{
1298
+
1299
+          this.drug_id = DrugId
1300
+          this.id = id
1301
+          var is_source =0
1302
+          if (DataSources == "his处方"){
1303
+            is_source = 1
1304
+          }
1305
+          if (DataSources == "临时医嘱"){
1306
+            is_source = 2
1307
+          }
1308
+          this.is_source = is_source
1309
+          this.textarea = DrugCode
1310
+          this.currentIndex = index
1311
+          this.dialogVisibleOne = true
1312
+        }
1313
+        this.$nextTick(()=>{
1314
+          this.$refs.inputRef.focus()
1315
+        })
1316
+
1317
+      }else{
1366 1318
         this.drug_id = DrugId
1367 1319
         this.id = id
1368
-        var is_source =0
1369
-        if (DataSources == "his处方"){
1370
-          is_source = 1
1371
-        }
1372
-        if (DataSources == "临时医嘱"){
1373
-          is_source = 2
1374
-        }
1375
-        this.is_source = is_source
1320
+        this.is_source = 3
1376 1321
         this.textarea = DrugCode
1377 1322
         this.currentIndex = index
1378 1323
         this.dialogVisibleOne = true
1379
-       }
1380
-       this.$nextTick(()=>{
1381
-        this.$refs.inputRef.focus()
1382
-       })
1383
-     
1324
+
1325
+      }
1384 1326
 
1385 1327
     },
1386 1328
     saveTextArea(){
@@ -1408,19 +1350,18 @@ export default {
1408 1350
      console.log("event------------",event.key)
1409 1351
       // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
1410 1352
       if (event.key === 'Enter') {
1411
-       
1353
+
1412 1354
         var textarea = ""
1413 1355
         textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
1414
-        
1415 1356
 
1416
-        
1417 1357
 
1418
-        
1419
-         
1358
+
1359
+
1360
+
1361
+
1420 1362
         if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278|| this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10726){
1421 1363
 
1422 1364
           var drugindentificaitoncode = this.getDrugIdentificationCode(this.drug_id)
1423
-             
1424 1365
           var total_one = 0
1425 1366
           var total_two = 0
1426 1367
 
@@ -1433,14 +1374,14 @@ export default {
1433 1374
                 if (!dataInfo[item]) {
1434 1375
                     dataInfo[item] = {
1435 1376
                     drug_code:item,
1436
-                    child: [], 
1377
+                    child: [],
1437 1378
                   }
1438 1379
                  }
1439 1380
                })
1440 1381
                let new_arr = Object.values(dataInfo)
1441 1382
 
1442 1383
                if(new_arr!=null && new_arr.length>0){
1443
-                
1384
+
1444 1385
                  for(let i=0;i<new_arr.length;i++){
1445 1386
                    for(let j=0;j<arr.length;j++){
1446 1387
                       if(new_arr[i].drug_code == arr[j]){
@@ -1450,13 +1391,13 @@ export default {
1450 1391
                  }
1451 1392
                }
1452 1393
             arrList = new_arr
1453
-            
1394
+
1454 1395
           }
1455 1396
 
1456 1397
           var is_err_check = false
1457 1398
           var i_index = ""
1458 1399
           var drug_code = ""
1459
-       
1400
+
1460 1401
           if(arr!=null && arr.length>0){
1461 1402
             for(let i=0;i<arr.length;i++){
1462 1403
 
@@ -1478,8 +1419,8 @@ export default {
1478 1419
                     }
1479 1420
                  }
1480 1421
 
1481
-               
1482
-                
1422
+
1423
+
1483 1424
 
1484 1425
                }
1485 1426
 
@@ -1488,7 +1429,7 @@ export default {
1488 1429
           if(is_err_check == true){
1489 1430
               arr.splice(i_index,1)
1490 1431
           }
1491
-         
1432
+
1492 1433
           for(let i=0;i<this.newArrList.length;i++){
1493 1434
              if(drug_code == this.newArrList[i].drug_code){
1494 1435
                  total_one = this.newArrList[i].child.length
@@ -1504,24 +1445,24 @@ export default {
1504 1445
 
1505 1446
           console.log("数量1--------------",total_one)
1506 1447
           console.log("数量2---------------",total_two)
1507
-        
1508
-        
1509
-          
1448
+
1449
+
1450
+
1510 1451
           if(this.scan_code>0){
1511 1452
             if((total_one + total_two)>this.scan_code){
1512 1453
               this.$message.error("扫码次数已经超过限制!")
1513 1454
               arr.splice(i_index,1)
1514 1455
             }
1515 1456
           }
1516
-         
1457
+
1517 1458
          var is_arr = this.hasDuplicates(arr)
1518 1459
 
1519 1460
           this.textarea = arr.join(",")
1520 1461
         }else{
1521 1462
           // console.log("haaaaaaaaaaaaaaaaaaa",textarea)
1522
-          
1463
+
1523 1464
           var arr = textarea.split(",");
1524
-          
1465
+
1525 1466
           var lastElement = arr[arr.length - 2];
1526 1467
 
1527 1468
           if(lastElement.length!=20){
@@ -1529,26 +1470,26 @@ export default {
1529 1470
             arr.splice(arr.length-2,1)
1530 1471
           }
1531 1472
           console.log("arr-------------",arr)
1532
-         
1473
+
1533 1474
           this.textarea = ""
1534 1475
           this.textarea = arr.join(",")
1535 1476
 
1536 1477
           // this.textarea = textarea
1537 1478
         }
1538
-        
1539 1479
 
1540
-       
1480
+
1481
+
1541 1482
       }
1542 1483
 
1543 1484
       this.getTotal()
1544 1485
     },
1545
-    
1486
+
1546 1487
     hasDuplicates(arr) {
1547 1488
       const uniqueNumbers = [...new Set(arr)];
1548 1489
       return uniqueNumbers.length !== arr.length;
1549 1490
     },
1550 1491
     getDrugIdentificationCode(id){
1551
-       
1492
+
1552 1493
       var drug_identification_code = ""
1553 1494
       for(let i=0;i<this.baseList.length;i++){
1554 1495
           if(id == this.baseList[i].id){
@@ -1557,23 +1498,12 @@ export default {
1557 1498
       }
1558 1499
       return drug_identification_code
1559 1500
     },
1560
-    getDrugScanCode(drug_id){
1561
-      var scan_code = ""
1562
-      for(let i=0;i<this.baseList.length;i++){
1563
-       if(drug_id == this.baseList[i].id){
1564
-          scan_code = this.baseList[i].scan_code
1565
-       }
1566
-      }
1567
-      return scan_code
1568
-    }
1569
-
1570
-
1571 1501
 
1572 1502
   },
1573 1503
   watch:{
1574 1504
 
1575 1505
   }
1576
-  
1506
+
1577 1507
 };
1578 1508
 </script>
1579 1509
 

+ 277 - 119
src/xt_pages/Pharmacy/drugCode.vue Целия файл

@@ -108,17 +108,17 @@
108 108
         <template slot-scope="scope">{{ getPatientName(scope.row.patient_id) }}</template>
109 109
       </el-table-column>
110 110
       <el-table-column align="center" prop="name" label="处方日期">
111
-        <template slot-scope="scope">{{ getTime(scope.row.advice_date) }}</template>
111
+        <template slot-scope="scope">{{is_type == 3 ? getTime(scope.row.record_date): getTime(scope.row.advice_date) }}</template>
112 112
       </el-table-column>
113 113
       <el-table-column align="center" prop="name" label="药品名称">
114
-        <template slot-scope="scope">{{ scope.row.advice_name }}</template>
114
+        <template slot-scope="scope">{{ is_type == 3 ? scope.row.good_info.good_name :scope.row.advice_name }}</template>
115 115
       </el-table-column>
116 116
       <el-table-column align="center" prop="name" label="规格">
117
-        <template slot-scope="scope">{{ getDrugSpec(scope.row.drug_id) }}</template>
117
+        <template slot-scope="scope">{{is_type == 3 ? scope.row.good_info.specification_name : getDrugSpec(scope.row.drug_id) }}</template>
118 118
       </el-table-column>
119 119
       <el-table-column align="center" prop="name" label="开药总量">
120
-        <template slot-scope="scope">{{ scope.row.prescribing_number }}{{
121
-            scope.row.prescribing_number_unit
120
+        <template slot-scope="scope">{{ is_type == 3 ? scope.row.count : scope.row.prescribing_number }}{{
121
+            is_type == 3 ? scope.row.unit :scope.row.prescribing_number_unit
122 122
           }}
123 123
         </template>
124 124
       </el-table-column>
@@ -135,15 +135,12 @@
135 135
           <div v-if="scope.row.is_upload == 2 || scope.row.is_upload == 0">未上传</div>
136 136
         </template>
137 137
       </el-table-column>
138
-
139 138
       <el-table-column align="center" prop="name" label="发药状态" v-if="is_type == 1">
140 139
         <template slot-scope="scope">
141 140
           <div v-if="scope.row.is_medicine == 1">已发药</div>
142 141
           <div v-if="scope.row.is_medicine == 2 || scope.row.is_medicine == 0">未发药</div>
143 142
         </template>
144 143
       </el-table-column>
145
-
146
-
147 144
       <el-table-column align="center" prop="name" label="结算状态" v-if="is_type == 1">
148 145
         <template slot-scope="scope">
149 146
 
@@ -151,13 +148,9 @@
151 148
           <div v-if="scope.row.pre.order_status != 2">未结算</div>
152 149
         </template>
153 150
       </el-table-column>
154
-
155 151
       <el-table-column align="center" prop="name" label="操作" width="200">
156 152
         <template slot-scope="scope">
157 153
           <div>
158
-            <!--             <el-button v-if="scope.row.is_upload == 1" type="primary" @click="sigle_stock(scope.row)">未上传</el-button>-->
159
-            <!--            <el-button type="primary" v-if="scope.row.is_upload == 0 || scope.row.is_upload == 2" @click="toUpload(scope.row)">上传</el-button>-->
160
-
161 154
             <el-button v-if="scope.row.is_upload == 1" type="primary" @click="revokeDrugCode(scope.row)">撤销
162 155
             </el-button>
163 156
             <el-button type="primary" v-if="scope.row.is_upload == 0" @click="toUpload(scope.row)">上传</el-button>
@@ -165,10 +158,7 @@
165 158
           </div>
166 159
         </template>
167 160
       </el-table-column>
168
-
169
-
170 161
     </el-table>
171
-
172 162
     <el-pagination
173 163
       @size-change="handleSizeChange"
174 164
       @current-change="handleCurrentChange"
@@ -254,8 +244,10 @@ export default {
254 244
         {id: "1", name: '未结算'},
255 245
       ],
256 246
       advice_items:[
257
-        {id:"1",name:"HIS系统"},
247
+        {id:"1",name:"HIS系统药品"},
258 248
         {id:"2",name:"血透系统"},
249
+        {id:"3",name:"HIS系统耗材"},
250
+
259 251
       ],
260 252
       patientList: [],
261 253
       drugList: [],
@@ -279,65 +271,130 @@ export default {
279 271
       this.getlist()
280 272
     },
281 273
     toUpload(row) {
282
-      if (row.drug_code.length == 0) {
283
-        this.$message.error("追溯码不能为空");
284
-        return
285
-      }
286
-      let ids = row.id
287
-      var that = this;
288
-      let params = {
289
-        id: ids,
290
-        admin_user_id: this.$store.getters.xt_user.user.id,
291
-        is_type:this.is_type,
292
-      };
293
-
294
-      axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
295
-        if (response.data.state == 0) {
296
-          // that.$message.error(response.data.data.msg);
274
+      if(this.is_type == 3){
275
+        if (row.drug_code.length == 0) {
276
+          this.$message.error("追溯码不能为空");
277
+          return
278
+        }
279
+        let ids = row.id
280
+        var that = this;
281
+        let params = {
282
+          id: ids,
283
+          admin_user_id: this.$store.getters.xt_user.user.id,
284
+          is_type:this.is_type,
285
+        };
286
+
287
+        axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
288
+          if (response.data.state == 0) {
289
+            // that.$message.error(response.data.data.msg);
290
+            that.$confirm("请检查医保程序是否有打开", "提示", {
291
+              confirmButtonText: "确 定",
292
+              cancelButtonText: "取 消",
293
+              type: "warning",
294
+            }).then(() => {
295
+
296
+
297
+            })
298
+              .catch(() => {
299
+              });
300
+            return false
301
+          } else {
302
+
303
+            //有打开则调用接口
304
+            axios.get('http://127.0.0.1:9532/api/changedrug/six', {params: params}).then(function (response) {
305
+              if (response.data.state == 0) {
306
+                that.$message.error(response.data.data.msg);
307
+                return false
308
+              } else {
309
+                if (response.data.data.failed_code == -10) {
310
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
311
+                    confirmButtonText: '确 定',
312
+                    type: 'warning'
313
+                  }).then(() => {
314
+
315
+                  }).catch(() => {
316
+                  })
317
+                } else {
318
+                  that.getlist()
319
+                }
320
+              }
321
+            }).catch(function (error) {
322
+            })
323
+          }
324
+        }).catch(function (error) {
297 325
           that.$confirm("请检查医保程序是否有打开", "提示", {
298 326
             confirmButtonText: "确 定",
299 327
             cancelButtonText: "取 消",
300 328
             type: "warning",
301 329
           }).then(() => {
302
-
303
-
304 330
           })
305 331
             .catch(() => {
306 332
             });
307
-          return false
308
-        } else {
309
-
310
-          //有打开则调用接口
311
-          axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
312
-            if (response.data.state == 0) {
313
-              that.$message.error(response.data.data.msg);
314
-              return false
315
-            } else {
316
-              if (response.data.data.failed_code == -10) {
317
-                that.$confirm(response.data.data.msg, '医保错误信息', {
318
-                  confirmButtonText: '确 定',
319
-                  type: 'warning'
320
-                }).then(() => {
333
+        })
321 334
 
322
-                }).catch(() => {
323
-                })
335
+      }else {
336
+        if (row.drug_code.length == 0) {
337
+          this.$message.error("追溯码不能为空");
338
+          return
339
+        }
340
+        let ids = row.id
341
+        var that = this;
342
+        let params = {
343
+          id: ids,
344
+          admin_user_id: this.$store.getters.xt_user.user.id,
345
+          is_type:this.is_type,
346
+        };
347
+
348
+        axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
349
+          if (response.data.state == 0) {
350
+            // that.$message.error(response.data.data.msg);
351
+            that.$confirm("请检查医保程序是否有打开", "提示", {
352
+              confirmButtonText: "确 定",
353
+              cancelButtonText: "取 消",
354
+              type: "warning",
355
+            }).then(() => {
356
+
357
+
358
+            })
359
+              .catch(() => {
360
+              });
361
+            return false
362
+          } else {
363
+
364
+            //有打开则调用接口
365
+            axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
366
+              if (response.data.state == 0) {
367
+                that.$message.error(response.data.data.msg);
368
+                return false
324 369
               } else {
325
-                that.getlist()
370
+                if (response.data.data.failed_code == -10) {
371
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
372
+                    confirmButtonText: '确 定',
373
+                    type: 'warning'
374
+                  }).then(() => {
375
+
376
+                  }).catch(() => {
377
+                  })
378
+                } else {
379
+                  that.getlist()
380
+                }
326 381
               }
327
-            }
328
-          }).catch(function (error) {
382
+            }).catch(function (error) {
383
+            })
384
+          }
385
+        }).catch(function (error) {
386
+          that.$confirm("请检查医保程序是否有打开", "提示", {
387
+            confirmButtonText: "确 定",
388
+            cancelButtonText: "取 消",
389
+            type: "warning",
390
+          }).then(() => {
329 391
           })
330
-        }
331
-      }).catch(function (error) {
332
-        that.$confirm("请检查医保程序是否有打开", "提示", {
333
-          confirmButtonText: "确 定",
334
-          cancelButtonText: "取 消",
335
-          type: "warning",
336
-        }).then(() => {
392
+            .catch(() => {
393
+            });
337 394
         })
338
-          .catch(() => {
339
-          });
340
-      })
395
+
396
+      }
397
+
341 398
 
342 399
 
343 400
     },
@@ -438,7 +495,7 @@ export default {
438 495
           }
439 496
        })
440 497
       }
441
-      if(this.is_type == 2){
498
+      if(this.is_type == 3){
442 499
         var params = {
443 500
           id: this.id,
444 501
           data_source: 2,
@@ -455,6 +512,23 @@ export default {
455 512
          })
456 513
       }
457 514
 
515
+      if(this.is_type == 3){
516
+        var params = {
517
+          id: this.id,
518
+          data_source: 3,
519
+          drug_code: this.textarea,
520
+        }
521
+        changeDrugCode(params).then(response=>{
522
+          this.$message.success("保存成功!")
523
+          for (let i = 0; i < this.tableData.length; i++) {
524
+            if (this.currentIndex == i) {
525
+              this.tableData[i].drug_code = this.textarea
526
+            }
527
+          }
528
+          this.dialogVisibleOne = false
529
+        })
530
+      }
531
+
458 532
     },
459 533
     getPatientName(id) {
460 534
       var name = ""
@@ -568,77 +642,155 @@ export default {
568 642
       // 判断结束时间是否在一个月内
569 643
       return endDate <= oneMonthLater;
570 644
     }, batchUpload() {
571
-      var that = this
572
-      let ids  = ""
573
-      for (var i = 0; i < this.selection.length; i++){
574
-        if (ids.length == 0){
575
-          ids = this.selection[i].id
576
-        }else{
577
-          ids = ids + "," + this.selection[i].id
645
+      if(this.is_type == 3){
646
+        var that = this
647
+        let ids  = ""
648
+        for (var i = 0; i < this.selection.length; i++){
649
+          if (ids.length == 0){
650
+            ids = this.selection[i].id
651
+          }else{
652
+            ids = ids + "," + this.selection[i].id
653
+          }
578 654
         }
579
-      }
580
-      if(ids.length == 0 ){
581
-        this.$message.error("请勾选需要上传的数据");
582
-        return
583
-      }
584
-      let params = {
585
-        id: ids,
586
-        admin_user_id: this.$store.getters.xt_user.user.id,
587
-        is_type:this.is_type
655
+        if(ids.length == 0 ){
656
+          this.$message.error("请勾选需要上传的数据");
657
+          return
658
+        }
659
+        let params = {
660
+          id: ids,
661
+          admin_user_id: this.$store.getters.xt_user.user.id,
662
+          is_type:this.is_type
663
+
664
+        };
665
+        axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
666
+          if (response.data.state == 0) {
667
+            // that.$message.error(response.data.data.msg);
668
+            that.$confirm("请检查医保程序是否有打开", "提示", {
669
+              confirmButtonText: "确 定",
670
+              cancelButtonText: "取 消",
671
+              type: "warning",
672
+            }).then(() => {
673
+
674
+            })
675
+              .catch(() => {
676
+
677
+              });
678
+            return false
679
+          } else {
680
+            that.isloading = true
681
+
682
+            //有打开则调用接口
683
+            axios.get('http://127.0.0.1:9532/api/changedrug/six', {params: params}).then(function (response) {
684
+              if (response.data.state == 0) {
685
+                that.isloading = false
686
+                that.$message.error(response.data.data.msg);
687
+                return false
688
+              } else {
689
+                that.isloading = false
690
+                if (response.data.data.failed_code == -10) {
691
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
692
+                    confirmButtonText: '确 定',
693
+                    type: 'warning'
694
+                  }).then(() => {
695
+
696
+                  }).catch(() => {
697
+                  })
698
+                } else {
699
+                  that.getlist()
700
+                }
701
+              }
702
+            }).catch(function (error) {
703
+              that.isloading = false
704
+            })
705
+          }
706
+        }).catch(function (error) {
588 707
 
589
-      };
590
-      axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
591
-        if (response.data.state == 0) {
592
-          // that.$message.error(response.data.data.msg);
593 708
           that.$confirm("请检查医保程序是否有打开", "提示", {
594 709
             confirmButtonText: "确 定",
595 710
             cancelButtonText: "取 消",
596 711
             type: "warning",
597 712
           }).then(() => {
598
-
599 713
           })
600 714
             .catch(() => {
601
-
602 715
             });
603
-          return false
604
-        } else {
605
-          that.isloading = true
716
+        })
606 717
 
607
-          //有打开则调用接口
608
-          axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
609
-            if (response.data.state == 0) {
610
-              that.isloading = false
611
-              that.$message.error(response.data.data.msg);
612
-              return false
613
-            } else {
614
-              that.isloading = false
615
-              if (response.data.data.failed_code == -10) {
616
-                that.$confirm(response.data.data.msg, '医保错误信息', {
617
-                  confirmButtonText: '确 定',
618
-                  type: 'warning'
619
-                }).then(() => {
620 718
 
621
-                }).catch(() => {
622
-                })
719
+      }else{
720
+        var that = this
721
+        let ids  = ""
722
+        for (var i = 0; i < this.selection.length; i++){
723
+          if (ids.length == 0){
724
+            ids = this.selection[i].id
725
+          }else{
726
+            ids = ids + "," + this.selection[i].id
727
+          }
728
+        }
729
+        if(ids.length == 0 ){
730
+          this.$message.error("请勾选需要上传的数据");
731
+          return
732
+        }
733
+        let params = {
734
+          id: ids,
735
+          admin_user_id: this.$store.getters.xt_user.user.id,
736
+          is_type:this.is_type
737
+
738
+        };
739
+        axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
740
+          if (response.data.state == 0) {
741
+            // that.$message.error(response.data.data.msg);
742
+            that.$confirm("请检查医保程序是否有打开", "提示", {
743
+              confirmButtonText: "确 定",
744
+              cancelButtonText: "取 消",
745
+              type: "warning",
746
+            }).then(() => {
747
+
748
+            })
749
+              .catch(() => {
750
+
751
+              });
752
+            return false
753
+          } else {
754
+            that.isloading = true
755
+
756
+            //有打开则调用接口
757
+            axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
758
+              if (response.data.state == 0) {
759
+                that.isloading = false
760
+                that.$message.error(response.data.data.msg);
761
+                return false
623 762
               } else {
624
-                that.getlist()
763
+                that.isloading = false
764
+                if (response.data.data.failed_code == -10) {
765
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
766
+                    confirmButtonText: '确 定',
767
+                    type: 'warning'
768
+                  }).then(() => {
769
+
770
+                  }).catch(() => {
771
+                  })
772
+                } else {
773
+                  that.getlist()
774
+                }
625 775
               }
626
-            }
627
-          }).catch(function (error) {
628
-            that.isloading = false
629
-          })
630
-        }
631
-      }).catch(function (error) {
776
+            }).catch(function (error) {
777
+              that.isloading = false
778
+            })
779
+          }
780
+        }).catch(function (error) {
632 781
 
633
-        that.$confirm("请检查医保程序是否有打开", "提示", {
634
-          confirmButtonText: "确 定",
635
-          cancelButtonText: "取 消",
636
-          type: "warning",
637
-        }).then(() => {
782
+          that.$confirm("请检查医保程序是否有打开", "提示", {
783
+            confirmButtonText: "确 定",
784
+            cancelButtonText: "取 消",
785
+            type: "warning",
786
+          }).then(() => {
787
+          })
788
+            .catch(() => {
789
+            });
638 790
         })
639
-          .catch(() => {
640
-          });
641
-      })
791
+
792
+
793
+      }
642 794
 
643 795
     }, query() {
644 796
       this.getlist()
@@ -678,8 +830,14 @@ export default {
678 830
           this.$message.error(response.data.msg)
679 831
           return false
680 832
         } else {
833
+          if(this.is_type !=  3){
834
+            this.tableData = response.data.data.list
835
+
836
+          }else{
837
+            this.tableData = response.data.data.project_list
838
+
839
+          }
681 840
 
682
-          this.tableData = response.data.data.list
683 841
           this.total = response.data.data.total
684 842
           this.drugList = response.data.data.drug
685 843
           this.patientList = response.data.data.patients

+ 12 - 17
src/xt_pages/Pharmacy/print/patientPrintTwo.vue Целия файл

@@ -29,7 +29,7 @@
29 29
         <span>入院诊断:{{ getdiagnosis(diagnosis) }}</span>
30 30
       </div>
31 31
       <div>
32
-        <table class="table" border="1" 
32
+        <table class="table" border="1"
33 33
           style="border-collapse: collapse;border-left: none;border-right: none;width: 100%;text-align: center;">
34 34
           <tr>
35 35
             <td>药品名称</td>
@@ -44,13 +44,13 @@
44 44
           </tr>
45 45
           <tr v-for="item in tableData" >
46 46
             <td>{{item.Name}}</td>
47
-            <td>{{getSpecaiName(item.DrugId)}}</td>
47
+            <td>{{item.Spec}}</td>
48 48
             <td>{{item.SingleDosage}}</td>
49 49
             <td>{{item.Frequency}}</td>
50 50
             <td>{{ item.Days }}</td>
51 51
             <td>{{ item.Usage }}<span>{{item.Total}}</span></td>
52
-           
53
-            <td>{{item.Price}}</td> 
52
+
53
+            <td>{{item.Price}}</td>
54 54
             <td>{{item.Total_cost.toFixed(2)}}</td>
55 55
             <td>{{getTime(item.ExecutionTime) }}</td>
56 56
           </tr>
@@ -148,11 +148,14 @@ export default {
148 148
       this.visibility = true;
149 149
       console.log("val",val)
150 150
       this.tableData = []
151
-      this.tableData = val
151
+      for(let i =0; i < val.length;i++){
152
+        if(val[i].Type == 1){
153
+          this.tableData.push(val[i])
154
+        }
155
+      }
152 156
       this.Doctor = val[0].Doctor
153 157
       this.name = data.Name
154 158
       this.DialysisNo = data.DialysisNo
155
-      this.baseList = base
156 159
       this.patients = patients
157 160
       this.doctors = doctors
158 161
       this.diagnosearr = arr
@@ -165,7 +168,7 @@ export default {
165 168
       }
166 169
       var Price_zong2 =0
167 170
       for(let i in this.tableData){
168
-        
171
+
169 172
         const str = this.tableData[i].Total
170 173
         const num = str.replace(/[^\d]/g,"")
171 174
         // 每一行的金额
@@ -278,15 +281,7 @@ export default {
278 281
       //   ],
279 282
       // });
280 283
     },
281
-    getSpecaiName(drug_id){
282
-       var spc =""
283
-       for(let i=0;i<this.baseList.length;i++){
284
-         if(drug_id == this.baseList[i].id){
285
-           spc = this.baseList[i].dose + this.baseList[i].dose_unit +"*"+this.baseList[i].min_number+this.baseList[i].min_unit+"/"+this.baseList[i].max_unit
286
-         }
287
-       }
288
-       return spc
289
-    },
284
+
290 285
     getTime(val) {
291 286
         if(val < 0){
292 287
           return ""
@@ -296,7 +291,7 @@ export default {
296 291
         }else {
297 292
         return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
298 293
         }
299
-    }, 
294
+    },
300 295
     getdoctors(id){
301 296
       for(let i in this.doctors){
302 297
         if(this.doctors[i].id == id){

+ 1 - 1
src/xt_pages/drugSourceCode/drugQuery.vue Целия файл

@@ -158,7 +158,7 @@
158 158
                  highlight-current-row>
159 159
 
160 160
         <el-table-column align="center" prop="name" label="就诊ID">
161
-          <template slot-scope="scope">{{scope.row.mdtrt_id}}</template>
161
+          <template slot-scope="scope">{{scope.row.MdtrtId}}</template>
162 162
         </el-table-column>
163 163
         <el-table-column align="center" prop="name" label="药品名称">
164 164
           <template slot-scope="scope">{{scope.row.MedinsListName}}</template>

+ 14 - 1
src/xt_pages/outpatientCharges/components/chargeDialog.vue Целия файл

@@ -8,6 +8,14 @@
8 8
         <div>{{record_date}}</div>
9 9
       </el-form-item>
10 10
 
11
+      <el-form-item label="本次结算应上传最小包装药品追溯码数量:" prop="name" :validate-event="is_Name">
12
+        <el-input class="number_style" type="number" v-model="form.pack_num" ></el-input>
13
+      </el-form-item>
14
+
15
+      <el-form-item label="本次结算应上传最小包装耗材追溯码数量:" prop="name" :validate-event="is_Name">
16
+        <el-input class="number_style" type="number" v-model="form.good_pack_num" ></el-input>
17
+      </el-form-item>
18
+
11 19
       <el-form-item label="总计:" prop="name" :validate-event="is_Name">
12 20
         <el-input class="number_style" type="number" v-model="form.total" :disabled="true"></el-input>
13 21
       </el-form-item>
@@ -15,7 +23,6 @@
15 23
         <el-input class="number_style" type="number" v-model="form.medical_insurance_price" :disabled="true"></el-input>
16 24
       </el-form-item>
17 25
 
18
-
19 26
       <el-form-item class="number_style" label="自费:" prop="age" :validate-event="is_Name">
20 27
         <el-input type="number" v-model="form.private_price" :disabled="true"></el-input>
21 28
       </el-form-item>
@@ -193,6 +200,8 @@
193 200
           { id: 2, name: '使用共济个账' },
194 201
         ],
195 202
         form: {
203
+          pack_num:0,
204
+          good_pack_num:0,
196 205
           medical_insurance_price:0,
197 206
           private_price:'',//自费12
198 207
           pay_way:"",
@@ -264,6 +273,8 @@
264 273
           wechat_pay:"",
265 274
           ali_pay:"",
266 275
           jifen_pay:"",
276
+          pack_num:0,
277
+          good_pack_num:0,
267 278
         },
268 279
 
269 280
       }
@@ -387,6 +398,8 @@
387 398
 
388 399
         if(this.order && this.order.id > 0){
389 400
           this.form.acct_pay = this.order.acct_pay
401
+          this.form.pack_num = this.order.pack_num
402
+          this.form.good_pack_num = this.order.good_pack_num
390 403
           this.form.psn_pay = this.order.psn_cash_pay
391 404
           this.form.total = this.order.medfee_sumamt
392 405
           this.form.pay_price = (this.order.medfee_sumamt).toFixed(2)

+ 77 - 21
src/xt_pages/outpatientTool/gatherPrint.vue Целия файл

@@ -97,8 +97,8 @@
97 97
                    {{item.count_number }}{{item.unit }}
98 98
                 </td>
99 99
                 <td style="text-align:center" >
100
-                   <span v-if="item.is_total == 1">{{ item.total }}</span>
101
-                   <span v-if="item.is_total == 2">{{ (item.pric * item.count_number).toFixed(2) }}</span>
100
+                   <span v-if="item.is_total == 1">{{ getAllPice() }}</span>
101
+                   <span v-if="item.is_total == 2">{{ getT(item) }}</span>
102 102
                 </td>
103 103
                 <td style="text-align:center" >
104 104
                   {{getChrgitmLv(item.medical_insurance_level)}}
@@ -246,6 +246,7 @@
246 246
                 cost_type:"",
247 247
                 name:"",
248 248
                 pric:item.pric,
249
+                det_sun:item.det_item_fee_sumamt,
249 250
                 chrgitm_lv:"",
250 251
                 advice_id:item.advice_id,
251 252
                 project_id:item.project_id,
@@ -271,8 +272,7 @@
271 272
                   arr[i].unit = arr[i].child[0].advice.prescribing_number_unit
272 273
                   arr[i].cost_type = arr[i].child[0].advice.drug.drug_type
273 274
                   arr[i].medical_insurance_level = arr[i].child[0].chrgitm_lv
274
-
275
-
275
+                 // arr[i].record_date = arr[i].child[0].advice.advice_date
276 276
                }
277 277
                if(arr[i].project_id > 0){
278 278
                   arr[i].record_date = arr[i].child[0].project.record_date
@@ -422,6 +422,8 @@
422 422
             }
423 423
             this.tableList = []
424 424
             this.tableList = tempList
425
+            console.log("this.tableList")
426
+            console.log( this.tableList)
425 427
 
426 428
         }
427 429
      })
@@ -705,7 +707,9 @@
705 707
       var total_price = 0
706 708
       for(let i=0;i<this.tableList.length;i++){
707 709
         if(this.tableList[i].is_total ==2){
708
-          total_price += (this.tableList[i].pric * parseInt(this.tableList[i].count_number))
710
+          for(let a = 0; a < this.tableList[i].child.length; a++){
711
+            total_price += this.tableList[i].child[a].det_item_fee_sumamt
712
+          }
709 713
         }
710 714
       }
711 715
       if(total_price > 0){
@@ -926,7 +930,15 @@
926 930
         }
927 931
       }
928 932
       return med_chrgitm_type
929
-    },
933
+    },getT(item){
934
+        let total = 0
935
+        // for()
936
+          for(let a = 0; a < item.child.length; a++){
937
+            total += item.child[a].det_item_fee_sumamt
938
+          }
939
+          return total.toFixed(2)
940
+        // console.log(item)
941
+      },
930 942
     getChrgitmLv(value){
931 943
       var name = ""
932 944
       for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
@@ -958,7 +970,9 @@
958 970
       var total_price = 0
959 971
       for(let i=0;i<this.tableList.length;i++){
960 972
          if(this.tableList[i].cost_type == "西药"){
961
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
973
+           for(let a = 0; a < this.tableList[i].child.length; a++){
974
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
975
+           }
962 976
          }
963 977
       }
964 978
 
@@ -968,7 +982,10 @@
968 982
       var total_price = 0
969 983
       for(let i=0;i<this.tableList.length;i++){
970 984
          if(this.tableList[i].cost_type == "中成药"){
971
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
985
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
986
+           for(let a = 0; a < this.tableList[i].child.length; a++){
987
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
988
+           }
972 989
          }
973 990
       }
974 991
       return total_price.toFixed(2)
@@ -977,7 +994,10 @@
977 994
       var total_price = 0
978 995
       for(let i=0;i<this.tableList.length;i++){
979 996
          if(this.tableList[i].cost_type == "中草药"){
980
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
997
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
998
+           for(let a = 0; a < this.tableList[i].child.length; a++){
999
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1000
+           }
981 1001
          }
982 1002
       }
983 1003
       return total_price.toFixed(2)
@@ -986,7 +1006,10 @@
986 1006
       var total_price = 0
987 1007
       for(let i=0;i<this.tableList.length;i++){
988 1008
          if(this.tableList[i].cost_type == "检验费"){
989
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1009
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1010
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1011
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1012
+           }
990 1013
          }
991 1014
       }
992 1015
       return total_price.toFixed(2)
@@ -995,7 +1018,10 @@
995 1018
      var total_price = 0
996 1019
       for(let i=0;i<this.tableList.length;i++){
997 1020
          if(this.tableList[i].cost_type == "输氧费"){
998
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1021
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1022
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1023
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1024
+           }
999 1025
          }
1000 1026
       }
1001 1027
       return total_price.toFixed(2)
@@ -1004,7 +1030,10 @@
1004 1030
       var total_price = 0
1005 1031
       for(let i=0;i<this.tableList.length;i++){
1006 1032
          if(this.tableList[i].cost_type == "手术费"){
1007
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1033
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1034
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1035
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1036
+           }
1008 1037
          }
1009 1038
       }
1010 1039
       return total_price.toFixed(2)
@@ -1013,7 +1042,10 @@
1013 1042
       var total_price = 0
1014 1043
       for(let i=0;i<this.tableList.length;i++){
1015 1044
          if(this.tableList[i].cost_type == "化验费"){
1016
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1045
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1046
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1047
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1048
+           }
1017 1049
          }
1018 1050
       }
1019 1051
       return total_price.toFixed(2)
@@ -1022,7 +1054,10 @@
1022 1054
      var total_price = 0
1023 1055
       for(let i=0;i<this.tableList.length;i++){
1024 1056
          if(this.tableList[i].cost_type == "输血费"){
1025
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1057
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1058
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1059
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1060
+           }
1026 1061
          }
1027 1062
       }
1028 1063
       return total_price.toFixed(2)
@@ -1031,7 +1066,10 @@
1031 1066
       var total_price = 0
1032 1067
       for(let i=0;i<this.tableList.length;i++){
1033 1068
          if(this.tableList[i].cost_type == "诊断费"){
1034
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1069
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1070
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1071
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1072
+           }
1035 1073
          }
1036 1074
       }
1037 1075
       return total_price.toFixed(2)
@@ -1040,7 +1078,10 @@
1040 1078
      var total_price = 0
1041 1079
       for(let i=0;i<this.tableList.length;i++){
1042 1080
          if(this.tableList[i].cost_type == "治疗费"){
1043
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1081
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1082
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1083
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1084
+           }
1044 1085
          }
1045 1086
       }
1046 1087
       return total_price.toFixed(2)
@@ -1049,7 +1090,10 @@
1049 1090
       var total_price = 0
1050 1091
       for(let i=0;i<this.tableList.length;i++){
1051 1092
          if(this.tableList[i].cost_type == "护理费"){
1052
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1093
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1094
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1095
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1096
+           }
1053 1097
          }
1054 1098
       }
1055 1099
       return total_price.toFixed(2)
@@ -1058,7 +1102,10 @@
1058 1102
       var total_price = 0
1059 1103
       for(let i=0;i<this.tableList.length;i++){
1060 1104
          if(this.tableList[i].cost_type == "床位费"){
1061
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1105
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1106
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1107
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1108
+           }
1062 1109
          }
1063 1110
       }
1064 1111
       return total_price.toFixed(2)
@@ -1067,7 +1114,10 @@
1067 1114
       var total_price = 0
1068 1115
       for(let i=0;i<this.tableList.length;i++){
1069 1116
          if(this.tableList[i].cost_type == "麻醉费"){
1070
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1117
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1118
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1119
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1120
+           }
1071 1121
          }
1072 1122
       }
1073 1123
       return total_price.toFixed(2)
@@ -1076,7 +1126,10 @@
1076 1126
       var total_price = 0
1077 1127
       for(let i=0;i<this.tableList.length;i++){
1078 1128
          if(this.tableList[i].cost_type == "材料费"){
1079
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1129
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1130
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1131
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1132
+           }
1080 1133
          }
1081 1134
       }
1082 1135
       return total_price.toFixed(2)
@@ -1085,7 +1138,10 @@
1085 1138
       var total_price = 0
1086 1139
       for(let i=0;i<this.tableList.length;i++){
1087 1140
          if(this.tableList[i].cost_type == "其他"){
1088
-            total_price += this.tableList[i].count_number * this.tableList[i].pric
1141
+            // total_price += this.tableList[i].count_number * this.tableList[i].pric
1142
+           for(let a = 0; a < this.tableList[i].child.length; a++){
1143
+             total_price += this.tableList[i].child[a].det_item_fee_sumamt
1144
+           }
1089 1145
          }
1090 1146
       }
1091 1147
       return total_price.toFixed(2)