Преглед изворни кода

Merge remote-tracking branch 'origin/20230223_pc_vue_new_branch' into 20230223_pc_vue_new_branch

yq1 пре 8 месеци
родитељ
комит
3425106734
27 измењених фајлова са 1265 додато и 818 уклоњено
  1. 27 0
      src/api/config.js
  2. 18 0
      src/api/drug/drug.js
  3. 10 0
      src/api/his/his.js
  4. 9 0
      src/api/his/his_tools.js
  5. 2 1
      src/lang/zh.js
  6. 5 0
      src/router/modules/hisTool.js
  7. 31 1
      src/store/modules/globalConfig.js
  8. 76 3
      src/xt_pages/data/basicConfig.vue
  9. 226 1
      src/xt_pages/data/prescription.vue
  10. 2 1
      src/xt_pages/dialysis/batch_print/batch_print_order_seventyeight.vue
  11. 22 0
      src/xt_pages/dialysis/batch_print/batch_print_order_six.vue
  12. 1 0
      src/xt_pages/dialysis/batch_print/batch_print_order_sixtyeight.vue
  13. 2 2
      src/xt_pages/dialysis/details/DialysisPrescription.vue
  14. 13 2
      src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue
  15. 2 2
      src/xt_pages/dialysis/details/dialog/monitor_dialog.vue
  16. 2 2
      src/xt_pages/dialysis/details/dialysisMonitoring.vue
  17. 1 1
      src/xt_pages/dialysis/template/DialysisPrintOrderSeventyeight.vue
  18. 1 0
      src/xt_pages/dialysis/template/DialysisPrintOrderSixtyeight.vue
  19. 4 2
      src/xt_pages/hospitalStation/inHospitalHistory.vue
  20. 57 0
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  21. 0 10
      src/xt_pages/outpatientTool/PrescriptionSmmary.vue
  22. 3 6
      src/xt_pages/outpatientTool/components/detail.vue
  23. 2 5
      src/xt_pages/outpatientTool/components/gather.vue
  24. 255 347
      src/xt_pages/outpatientTool/components/pdetail.vue
  25. 310 311
      src/xt_pages/outpatientTool/components/pgather.vue
  26. 10 2
      src/xt_pages/stock/detail/stockOutDetail.vue
  27. 174 119
      src/xt_pages/stock/selfPreparedMedicine/addWarehouseOut.vue

+ 27 - 0
src/api/config.js Прегледај датотеку

@@ -225,3 +225,30 @@ export function changeGoodOutOpen(params) {
225 225
     params: params
226 226
   })
227 227
 }
228
+
229
+export function changeSelfPrescriptionOpen(params){
230
+  
231
+  return request({
232
+    url:"/api/changeselfprescriptionopen",
233
+    method:"get",
234
+    params:params,
235
+  })
236
+}
237
+
238
+export function changeSelfPrescriptionOutOpen(params){
239
+ 
240
+  return request({
241
+    url:"/api/changeselfprescriptionoutopen",
242
+    method:"get",
243
+    params:params,
244
+  })
245
+}
246
+
247
+export function getSelfPrintList(params){
248
+  
249
+  return request({
250
+    url:"/api/getselfprintlist",
251
+    method:"get",
252
+    params:params,
253
+  })
254
+}

+ 18 - 0
src/api/drug/drug.js Прегледај датотеку

@@ -764,4 +764,22 @@ export function postSelfDrugOutInfoWarehouse(){
764 764
     method:"Get",
765 765
     params:params,
766 766
   })
767
+}
768
+
769
+export function getSelfDrugBatchNumber(params){
770
+
771
+  return request({
772
+    url:"/api/drug/getselfdrugbatchnumber",
773
+    method:"get",
774
+    params:params
775
+  })
776
+}
777
+
778
+export function postSelfDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type, storehouse_id, warehouse_out_id){
779
+
780
+   return request({
781
+    url:"/api/drug/postsetfdrugwarehouseout?warehousing_out_time="+warehousing_time+ '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&warehouse_out_id=' + warehouse_out_id,
782
+    method:"post",
783
+    params:params,
784
+   })
767 785
 }

+ 10 - 0
src/api/his/his.js Прегледај датотеку

@@ -869,6 +869,16 @@ export function modifyFapiaoCodetwo(params) {
869 869
 
870 870
 
871 871
 
872
+export function GetPSummaryDetail(params) {
873
+  return request({
874
+    url: '/api/his/prescription/detail',
875
+    method: 'get',
876
+    params: params
877
+  })
878
+}
879
+
880
+
881
+
872 882
 
873 883
 
874 884
 

+ 9 - 0
src/api/his/his_tools.js Прегледај датотеку

@@ -84,6 +84,15 @@ export function getBatchPrivateExpenses(params) {
84 84
 }
85 85
 
86 86
 
87
+export function getPrescriptionInitdata() {
88
+  return request({
89
+    url: '/api/his/prescription/initdata',
90
+    method: 'get',
91
+  })
92
+}
93
+
94
+
95
+
87 96
 
88 97
 
89 98
 

+ 2 - 1
src/lang/zh.js Прегледај датотеку

@@ -291,7 +291,8 @@ export default {
291 291
 
292 292
     DepositManagement: '押金管理',
293 293
 
294
-    summary_tool: '项目消费明细汇总',
294
+    summary_tool: '结算明细汇总',
295
+    p_summary_tool: '处方明细汇总',
295 296
     labelPrint: '标签打印',
296 297
     faPiao: '发票设置',
297 298
     chargeDetailManagement: '收费明细',

+ 5 - 0
src/router/modules/hisTool.js Прегледај датотеку

@@ -77,6 +77,11 @@ export default {
77 77
       component: () => import('@/xt_pages/outpatientTool/summary'),
78 78
       name: 'summary_tool',
79 79
       meta: { title: 'summary_tool', noCache: true }
80
+    }, {
81
+      path: '/hisTool/p_summary',
82
+      component: () => import('@/xt_pages/outpatientTool/PrescriptionSmmary'),
83
+      name: 'p_summary_tool',
84
+      meta: { title: 'p_summary_tool', noCache: true }
80 85
     },
81 86
     {
82 87
       path: '/hisTool/print',

+ 31 - 1
src/store/modules/globalConfig.js Прегледај датотеку

@@ -773,7 +773,37 @@ const global_config = {
773 773
         sodium: 1,
774 774
         calcium: 1,
775 775
         bicarbonate: 1
776
-      }
776
+      },
777
+      38: {
778
+        id: 38,
779
+        name: 'HDF80',
780
+        dialysis_duration: 1,
781
+        replacement_way: 1,
782
+        hemodialysis_machine: 2,
783
+        blood_filter: 1,
784
+        perfusion_apparatus: 2,
785
+        blood_flow_volume: 1,
786
+        dialysate_flow: 1,
787
+        kalium: 1,
788
+        sodium: 1,
789
+        calcium: 1,
790
+        bicarbonate: 1
791
+      },
792
+      39: {
793
+        id: 39,
794
+        name: 'HF16',
795
+        dialysis_duration: 1,
796
+        replacement_way: 1,
797
+        hemodialysis_machine: 2,
798
+        blood_filter: 1,
799
+        perfusion_apparatus: 2,
800
+        blood_flow_volume: 1,
801
+        dialysate_flow: 1,
802
+        kalium: 1,
803
+        sodium: 1,
804
+        calcium: 1,
805
+        bicarbonate: 1
806
+      },
777 807
     },
778 808
     anticoagulants_confit: { // 抗凝剂
779 809
       1: {

+ 76 - 3
src/xt_pages/data/basicConfig.vue Прегледај датотеку

@@ -49,6 +49,14 @@
49 49
             <!-- <p style="margin-top:20px;">药品耗材在结算时出库:
50 50
                 <el-switch v-model="drug_settle_open" @change="changeSettleOpen"></el-switch>
51 51
             </p> -->
52
+
53
+            <!-- <p style="margin-top:20px;">药品在保存处方时同步到自备库:
54
+               <el-switch v-model="self_prescription_out_open" @change="changeSelfPrescriptionOpen"></el-switch>
55
+            </p>
56
+
57
+            <p style="margin-top:20px;">药品在执行时自备药出库:
58
+               <el-switch v-model="self_drug_out_open" @change="changeSelfPrescriptionOutOpen"></el-switch>
59
+            </p> -->
52 60
         </div>
53 61
 
54 62
 
@@ -104,7 +112,7 @@
104 112
 
105 113
 <script>
106 114
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
107
-import { getAllIsOpenInit,postXtHisIsOpen,postMonitorIsOpen,changeFuncPrint,getDataPrintList,postXtHisProjectIsOpen,changeStockSetting,changeAdviceConfig,changePrescriptionConfig,changeDrugOpenConfig,changeSettleOpenConfig,changeGoodOutOpen} from '@/api/config'
115
+import { getAllIsOpenInit,postXtHisIsOpen,postMonitorIsOpen,changeFuncPrint,getDataPrintList,postXtHisProjectIsOpen,changeStockSetting,changeAdviceConfig,changePrescriptionConfig,changeDrugOpenConfig,changeSettleOpenConfig,changeGoodOutOpen,changeSelfPrescriptionOpen,changeSelfPrescriptionOutOpen,getSelfPrintList} from '@/api/config'
108 116
 
109 117
 export default {
110 118
   name: "printTemplate",
@@ -128,6 +136,8 @@ export default {
128 136
       drug_out_open:false,
129 137
       drug_settle_open:false,
130 138
       good_out_open:false,
139
+      self_prescription_out_open:false,
140
+      self_drug_out_open:false
131 141
     };
132 142
   },
133 143
   methods: {
@@ -463,15 +473,78 @@ export default {
463 473
           this.$message.success("保存成功!")
464 474
         }
465 475
       })
466
-    }
467
-    
476
+    },
468 477
 
478
+    changeSelfPrescriptionOpen(){
479
+      var self_info_open = 0
480
+      if(this.self_prescription_out_open == true){
481
+          self_info_open = 1
482
+      }
483
+      if(this.self_prescription_out_open == false){
484
+         self_info_open =2
485
+      }
486
+      var params = {
487
+        is_open:self_info_open
488
+      }
489
+      changeSelfPrescriptionOpen(params).then(response=>{
490
+        if(response.data.state ==1){
491
+          var selfPrescriptionOpen = response.data.data.selfPrescriptionOpen
492
+          this.$message.success("保存成功!")
493
+        }
494
+      })
495
+    },
496
+    changeSelfPrescriptionOutOpen(){
497
+        var out_info_open = 0 
498
+        if(this.self_drug_out_open == true){
499
+          out_info_open = 1
500
+        }
501
+        if(this.self_drug_out_open == false){
502
+          out_info_open = 2
503
+        }
504
+        var params = {
505
+          is_open:out_info_open,
506
+        }
507
+      changeSelfPrescriptionOutOpen(params).then(response=>{
508
+         if(response.data.state ==1){
509
+          var selfPrescriptionOpen = response.data.data.selfPrescriptionOutOpen
510
+          this.$message.success("保存成功!")
511
+         }
512
+     })
513
+    },
514
+
515
+    getSelfPrintList(){
516
+      getSelfPrintList().then(response=>{
517
+        if(response.data.state ==1){
518
+         
519
+          var selfPrescriptionOpen =  response.data.data.selfPrescriptionOpen
520
+
521
+          if(selfPrescriptionOpen.is_open ==1){
522
+            this.self_prescription_out_open = true
523
+          }
524
+
525
+          if(selfPrescriptionOpen.is_open ==2){
526
+            this.self_prescription_out_open = false
527
+          }
528
+
529
+           var selfPrescriptionOutOpen = response.data.data.selfPrescriptionOutOpen
530
+
531
+           if(selfPrescriptionOutOpen.is_open ==1){
532
+            this.self_drug_out_open = true
533
+           }
534
+           if(selfPrescriptionOutOpen.is_open ==2){
535
+            this.self_drug_out_open = false
536
+           }
537
+        }
538
+      })
539
+    }
469 540
   },
470 541
   created() {
471 542
     this.getInitIsOpenConfig()
472 543
     // this.getMonitorConfig()
473 544
     // this.getOrderConfig()
474 545
     this.getDataPrintList()
546
+
547
+    // this.getSelfPrintList()
475 548
   }
476 549
 };
477 550
 </script>

+ 226 - 1
src/xt_pages/data/prescription.vue Прегледај датотеку

@@ -821,7 +821,232 @@ export default {
821 821
           sodium: 1,
822 822
           calcium: 1,
823 823
           bicarbonate: 1
824
-        }
824
+        },
825
+        {
826
+          id: 25,
827
+          name: 'HD高通',
828
+          dialysis_duration: 1,
829
+          replacement_way: 1,
830
+          hemodialysis_machine: 2,
831
+          blood_filter: 1,
832
+          perfusion_apparatus: 2,
833
+          blood_flow_volume: 1,
834
+          dialysate_flow: 1,
835
+          kalium: 1,
836
+          sodium: 1,
837
+          calcium: 1,
838
+          bicarbonate: 1
839
+        },
840
+        {
841
+        id: 26,
842
+        name: 'CVVH',
843
+        dialysis_duration: 1,
844
+        replacement_way: 1,
845
+        hemodialysis_machine: 2,
846
+        blood_filter: 1,
847
+        perfusion_apparatus: 2,
848
+        blood_flow_volume: 1,
849
+        dialysate_flow: 1,
850
+        kalium: 1,
851
+        sodium: 1,
852
+        calcium: 1,
853
+        bicarbonate: 1
854
+      },
855
+      {
856
+        id: 27,
857
+        name: 'CVVHD',
858
+        dialysis_duration: 1,
859
+        replacement_way: 1,
860
+        hemodialysis_machine: 2,
861
+        blood_filter: 1,
862
+        perfusion_apparatus: 2,
863
+        blood_flow_volume: 1,
864
+        dialysate_flow: 1,
865
+        kalium: 1,
866
+        sodium: 1,
867
+        calcium: 1,
868
+        bicarbonate: 1
869
+      },
870
+      {
871
+        id: 28,
872
+        name: 'CVVHDF',
873
+        dialysis_duration: 1,
874
+        replacement_way: 1,
875
+        hemodialysis_machine: 2,
876
+        blood_filter: 1,
877
+        perfusion_apparatus: 2,
878
+        blood_flow_volume: 1,
879
+        dialysate_flow: 1,
880
+        kalium: 1,
881
+        sodium: 1,
882
+        calcium: 1,
883
+        bicarbonate: 1
884
+      },
885
+      {
886
+        id: 29,
887
+        name: 'PE',
888
+        dialysis_duration: 1,
889
+        replacement_way: 1,
890
+        hemodialysis_machine: 2,
891
+        blood_filter: 1,
892
+        perfusion_apparatus: 2,
893
+        blood_flow_volume: 1,
894
+        dialysate_flow: 1,
895
+        kalium: 1,
896
+        sodium: 1,
897
+        calcium: 1,
898
+        bicarbonate: 1
899
+      },
900
+      {
901
+        id: 30,
902
+        name: '血浆胆红素吸附+HP',
903
+        dialysis_duration: 1,
904
+        replacement_way: 1,
905
+        hemodialysis_machine: 2,
906
+        blood_filter: 1,
907
+        perfusion_apparatus: 2,
908
+        blood_flow_volume: 1,
909
+        dialysate_flow: 1,
910
+        kalium: 1,
911
+        sodium: 1,
912
+        calcium: 1,
913
+        bicarbonate: 1
914
+      },
915
+      {
916
+        id: 31,
917
+        name: 'HPD',
918
+        dialysis_duration: 1,
919
+        replacement_way: 1,
920
+        hemodialysis_machine: 2,
921
+        blood_filter: 1,
922
+        perfusion_apparatus: 2,
923
+        blood_flow_volume: 1,
924
+        dialysate_flow: 1,
925
+        kalium: 1,
926
+        sodium: 1,
927
+        calcium: 1,
928
+        bicarbonate: 1
929
+      },
930
+      {
931
+        id: 32,
932
+        name: 'HDP',
933
+        dialysis_duration: 1,
934
+        replacement_way: 1,
935
+        hemodialysis_machine: 2,
936
+        blood_filter: 1,
937
+        perfusion_apparatus: 2,
938
+        blood_flow_volume: 1,
939
+        dialysate_flow: 1,
940
+        kalium: 1,
941
+        sodium: 1,
942
+        calcium: 1,
943
+        bicarbonate: 1
944
+      },
945
+      {
946
+        id: 33,
947
+        name: 'HFD',
948
+        dialysis_duration: 1,
949
+        replacement_way: 1,
950
+        hemodialysis_machine: 2,
951
+        blood_filter: 1,
952
+        perfusion_apparatus: 2,
953
+        blood_flow_volume: 1,
954
+        dialysate_flow: 1,
955
+        kalium: 1,
956
+        sodium: 1,
957
+        calcium: 1,
958
+        bicarbonate: 1
959
+      },
960
+      {
961
+        id: 34,
962
+        name: 'HDF100',
963
+        dialysis_duration: 1,
964
+        replacement_way: 1,
965
+        hemodialysis_machine: 2,
966
+        blood_filter: 1,
967
+        perfusion_apparatus: 2,
968
+        blood_flow_volume: 1,
969
+        dialysate_flow: 1,
970
+        kalium: 1,
971
+        sodium: 1,
972
+        calcium: 1,
973
+        bicarbonate: 1
974
+      },
975
+      {
976
+        id: 35,
977
+        name: 'HDF600',
978
+        dialysis_duration: 1,
979
+        replacement_way: 1,
980
+        hemodialysis_machine: 2,
981
+        blood_filter: 1,
982
+        perfusion_apparatus: 2,
983
+        blood_flow_volume: 1,
984
+        dialysate_flow: 1,
985
+        kalium: 1,
986
+        sodium: 1,
987
+        calcium: 1,
988
+        bicarbonate: 1
989
+      },
990
+      {
991
+        id: 36,
992
+        name: 'HDF800',
993
+        dialysis_duration: 1,
994
+        replacement_way: 1,
995
+        hemodialysis_machine: 2,
996
+        blood_filter: 1,
997
+        perfusion_apparatus: 2,
998
+        blood_flow_volume: 1,
999
+        dialysate_flow: 1,
1000
+        kalium: 1,
1001
+        sodium: 1,
1002
+        calcium: 1,
1003
+        bicarbonate: 1
1004
+      },
1005
+     {
1006
+        id: 37,
1007
+        name: 'HDF1000',
1008
+        dialysis_duration: 1,
1009
+        replacement_way: 1,
1010
+        hemodialysis_machine: 2,
1011
+        blood_filter: 1,
1012
+        perfusion_apparatus: 2,
1013
+        blood_flow_volume: 1,
1014
+        dialysate_flow: 1,
1015
+        kalium: 1,
1016
+        sodium: 1,
1017
+        calcium: 1,
1018
+        bicarbonate: 1
1019
+      },
1020
+     {
1021
+        id: 38,
1022
+        name: 'HDF80',
1023
+        dialysis_duration: 1,
1024
+        replacement_way: 1,
1025
+        hemodialysis_machine: 2,
1026
+        blood_filter: 1,
1027
+        perfusion_apparatus: 2,
1028
+        blood_flow_volume: 1,
1029
+        dialysate_flow: 1,
1030
+        kalium: 1,
1031
+        sodium: 1,
1032
+        calcium: 1,
1033
+        bicarbonate: 1
1034
+      },
1035
+     {
1036
+        id: 39,
1037
+        name: 'HF16',
1038
+        dialysis_duration: 1,
1039
+        replacement_way: 1,
1040
+        hemodialysis_machine: 2,
1041
+        blood_filter: 1,
1042
+        perfusion_apparatus: 2,
1043
+        blood_flow_volume: 1,
1044
+        dialysate_flow: 1,
1045
+        kalium: 1,
1046
+        sodium: 1,
1047
+        calcium: 1,
1048
+        bicarbonate: 1
1049
+      },
825 1050
       ],
826 1051
       addPlan: {
827 1052
         id: 0,

+ 2 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_seventyeight.vue Прегледај датотеку

@@ -341,7 +341,8 @@
341 341
                       <div class="inline_block" style=" flex: 1">
342 342
                         预增脱水量:
343 343
                         <div class="under_line" style="width: 50%; text-align: left">
344
-                          0
344
+                            {{ record.assessment_before_dislysis.dehydration?record.assessment_before_dislysis.dehydration:"" }}
345
+                          
345 346
                         </div>L
346 347
                       </div>
347 348
                     </div>

+ 22 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_six.vue Прегледај датотеку

@@ -702,6 +702,28 @@
702 702
                           >
703 703
                             血浆胆红素吸附
704 704
                           </div>
705
+                          <div
706
+                            class="under_line"
707
+                            style="
708
+                              width: 100px;
709
+                              text-align: center;
710
+                              font-weight: 600;
711
+                            "
712
+                            v-if="record.prescription.mode_id == 24"
713
+                          >
714
+                            I-HDF
715
+                          </div>
716
+                          <div
717
+                            class="under_line"
718
+                            style="
719
+                              width: 100px;
720
+                              text-align: center;
721
+                              font-weight: 600;
722
+                            "
723
+                            v-if="record.prescription.mode_id == 25"
724
+                          >
725
+                            HD高通
726
+                          </div>
705 727
                           <div
706 728
                             class="under_line"
707 729
                             style="

+ 1 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_sixtyeight.vue Прегледај датотеку

@@ -771,6 +771,7 @@
771 771
                         L
772 772
                       </div>
773 773
                       <div
774
+                        v-if="org_id!=10677"
774 775
                         class="inline_block"
775 776
                         style="margin-left: 10px; flex: 1"
776 777
                       >

+ 2 - 2
src/xt_pages/dialysis/details/DialysisPrescription.vue Прегледај датотеку

@@ -170,13 +170,13 @@
170 170
         </li> -->
171 171
 
172 172
 
173
-        <li v-if="isShow('处方脱水量') && this.$store.getters.xt_user.template_info.org_id != 10597 && this.$store.getters.xt_user.template_info.org_id != 10571  && this.$store.getters.xt_user.template_info.org_id != 10612 && this.$store.getters.xt_user.template_info.org_id != 10598 && this.$store.getters.xt_user.template_info.org_id != 10677 && this.$store.getters.xt_user.template_info.org_id != 10679">
173
+        <li v-if="isShow('处方脱水量') && this.$store.getters.xt_user.template_info.org_id != 10597 && this.$store.getters.xt_user.template_info.org_id != 10571  && this.$store.getters.xt_user.template_info.org_id != 10612 && this.$store.getters.xt_user.template_info.org_id != 10598 && this.$store.getters.xt_user.template_info.org_id != 10677 && this.$store.getters.xt_user.template_info.org_id != 10679 && this.$store.getters.xt_user.template_info.org_id != 10702">
174 174
           <label>处方脱水量 : </label>
175 175
           <span class="content">{{ prescription_water != "0" ? prescription_water : "" }}</span>
176 176
           <span class="unit">{{ prescription_water != "0" ? "ml" : "" }}</span>
177 177
         </li>
178 178
 
179
-        <li v-if="isShow('处方脱水量') && this.$store.getters.xt_user.template_info.org_id == 10597 ||  this.$store.getters.xt_user.template_info.org_id == 10571 || this.$store.getters.xt_user.template_info.org_id == 10612  || this.$store.getters.xt_user.template_info.org_id == 10598 || this.$store.getters.xt_user.template_info.org_id == 10677 || this.$store.getters.xt_user.template_info.org_id == 10679">
179
+        <li v-if="isShow('处方脱水量') && this.$store.getters.xt_user.template_info.org_id == 10597 ||  this.$store.getters.xt_user.template_info.org_id == 10571 || this.$store.getters.xt_user.template_info.org_id == 10612  || this.$store.getters.xt_user.template_info.org_id == 10598 || this.$store.getters.xt_user.template_info.org_id == 10677 || this.$store.getters.xt_user.template_info.org_id == 10679 || this.$store.getters.xt_user.template_info.org_id == 10702">
180 180
           <label>处方脱水量 : </label>
181 181
           <span class="content">{{ prescription_water != "0" ? prescription_water : "" }}</span>
182 182
           <span class="unit">{{ prescription_water != "0" ? "L" : "" }}</span>

+ 13 - 2
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue Прегледај датотеку

@@ -143,7 +143,7 @@
143 143
                     </el-col>
144 144
 
145 145
                     <el-col :span="8"
146
-                            v-if="isShows('处方脱水量') && this.$store.getters.xt_user.template_info.org_id != 10597&& this.$store.getters.xt_user.template_info.org_id != 10571 && this.$store.getters.xt_user.template_info.org_id != 10612 && this.$store.getters.xt_user.template_info.org_id != 10598 && this.$store.getters.xt_user.template_info.org_id != 10677 && this.$store.getters.xt_user.template_info.org_id != 10679">
146
+                            v-if="isShows('处方脱水量') && this.$store.getters.xt_user.template_info.org_id != 10597&& this.$store.getters.xt_user.template_info.org_id != 10571 && this.$store.getters.xt_user.template_info.org_id != 10612 && this.$store.getters.xt_user.template_info.org_id != 10598 && this.$store.getters.xt_user.template_info.org_id != 10677 && this.$store.getters.xt_user.template_info.org_id != 10679 && this.$store.getters.xt_user.template_info.org_id != 10702">
147 147
                         <el-form-item label="处方脱水量(ml):" prop="prescription_water" :rules="isCheckmust('处方脱水量')">
148 148
                             <el-input
149 149
                                     type="number"
@@ -153,7 +153,7 @@
153 153
                     </el-col>
154 154
 
155 155
                     <el-col :span="8"
156
-                            v-if="isShows('处方脱水量') && this.$store.getters.xt_user.template_info.org_id == 10597 || this.$store.getters.xt_user.template_info.org_id ==10571 || this.$store.getters.xt_user.template_info.org_id ==10612 || this.$store.getters.xt_user.template_info.org_id ==10598 || this.$store.getters.xt_user.template_info.org_id ==10612 || this.$store.getters.xt_user.template_info.org_id ==10677 || this.$store.getters.xt_user.template_info.org_id==10679">
156
+                            v-if="isShows('处方脱水量') && this.$store.getters.xt_user.template_info.org_id == 10597 || this.$store.getters.xt_user.template_info.org_id ==10571 || this.$store.getters.xt_user.template_info.org_id ==10612 || this.$store.getters.xt_user.template_info.org_id ==10598 || this.$store.getters.xt_user.template_info.org_id ==10612 || this.$store.getters.xt_user.template_info.org_id ==10677 || this.$store.getters.xt_user.template_info.org_id==10679 || this.$store.getters.xt_user.template_info.org_id==10702">
157 157
                         <el-form-item label="处方脱水量(L):" prop="prescription_water" :rules="isCheckmust('处方脱水量')">
158 158
                             <el-input
159 159
                                     type="number"
@@ -5409,6 +5409,17 @@ mu
5409 5409
           }
5410 5410
           
5411 5411
            
5412
+        }
5413
+        if(this.$store.getters.xt_user.template_info.org_id==10702){
5414
+          if(this.predialysis!=undefined){
5415
+          if(this.dialysisPrescription.target_ultrafiltration==0 || this.dialysisPrescription.target_ultrafiltration==""){
5416
+            this.dialysisPrescription.target_ultrafiltration = this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight
5417
+          }
5418
+          console.log("hahhahahahhah",this.dialysisPrescription.prescription_water)
5419
+          if(this.dialysisPrescription.prescription_water==0 || this.dialysisPrescription.prescription_water==""){
5420
+            this.dialysisPrescription.prescription_water = this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight
5421
+          }
5422
+        }
5412 5423
         }
5413 5424
       },
5414 5425
       stockType: function() {

+ 2 - 2
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue Прегледај датотеку

@@ -392,14 +392,14 @@
392 392
             "
393 393
           >
394 394
             <template slot-scope="scope">
395
-             <span v-if="org_id == 10440 || org_id == 9671 || org_id ==10206 || org_id ==10612 || org_id ==10617">
395
+             <span v-if="org_id == 10440 || org_id == 9671 || org_id ==10206 || org_id ==10612 || org_id ==10617 || org_id ==10702">
396 396
               {{
397 397
                 scope.row.ultrafiltration_volume
398 398
                   ? scope.row.ultrafiltration_volume
399 399
                   : "0"
400 400
               }}
401 401
               </span>
402
-               <span v-if="org_id != 10440 && org_id!=9671 && org_id!=10206 && org_id!=10612 && org_id!=10617">
402
+               <span v-if="org_id != 10440 && org_id!=9671 && org_id!=10206 && org_id!=10612 && org_id!=10617 && org_id!=10702">
403 403
               {{
404 404
                 scope.row.ultrafiltration_volume
405 405
                   ? scope.row.ultrafiltration_volume

+ 2 - 2
src/xt_pages/dialysis/details/dialysisMonitoring.vue Прегледај датотеку

@@ -94,8 +94,8 @@
94 94
           <td v-if="isShow('跨膜压')"> {{ monitor.transmembrane_pressure ? monitor.transmembrane_pressure : "" }} </td>
95 95
           <td v-if="isShow('跨膜压1')"> {{ monitor.transmembrane_pressure_one ? monitor.transmembrane_pressure_one : "/" }} </td>
96 96
           <td v-if="isShow('超滤量')"> 
97
-            <span v-if="org_id!=9671 && org_id!=10440">{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "" }}  </span> 
98
-            <span v-if="org_id ==9671 || org_id==10440">{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "0" }}  </span> 
97
+            <span v-if="org_id!=9671 && org_id!=10440 && org_id!=10702">{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "" }}  </span> 
98
+            <span v-if="org_id ==9671 || org_id==10440 || org_id == 10702">{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "0" }}  </span> 
99 99
           </td>
100 100
           <td v-if="isShow('超滤量1')"> 
101 101
             {{ monitor.ultrafiltration_volume_one ? monitor.ultrafiltration_volume_one : "/" }}

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderSeventyeight.vue Прегледај датотеку

@@ -322,7 +322,7 @@
322 322
                       <div
323 323
                         style="width: 50%; text-align: center;display: inline-block;border-bottom: 1px solid #999;"
324 324
                       >
325
-                        0
325
+                         {{predialysis.dehydration?predialysis.dehydration:"" }}
326 326
                       </div>L
327 327
                     </div>
328 328
                   </div>

+ 1 - 0
src/xt_pages/dialysis/template/DialysisPrintOrderSixtyeight.vue Прегледај датотеку

@@ -787,6 +787,7 @@
787 787
                       ml/min
788 788
                     </div>
789 789
                     <div
790
+                      v-if="org_id!=10677"
790 791
                       class="inline_block"
791 792
                       style="margin-left: 10px; flex: 1"
792 793
                     >

+ 4 - 2
src/xt_pages/hospitalStation/inHospitalHistory.vue Прегледај датотеку

@@ -72,6 +72,7 @@
72 72
           <template slot-scope="scope">
73 73
             <div v-if="scope.row.med_type == 11">普通住院</div>
74 74
             <div v-if="scope.row.med_type == 14">门诊特殊病</div>
75
+            <div v-if="scope.row.med_type == 240101">门诊视同住院</div>
75 76
           </template>
76 77
         </el-table-column>
77 78
 
@@ -86,8 +87,9 @@
86 87
         </el-table-column>
87 88
         <el-table-column align="center" prop="name" label="状态" width="70">
88 89
           <template slot-scope="scope">
89
-            <div v-if="scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 0">{{"在院"}}</div>
90
-            <div v-if="scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 1">{{"已出院"}}</div>
90
+            <div v-if="scope.row.status == 0">{{"已经撤销出院"}}</div>
91
+            <div v-if="scope.row.status == 1 &&  scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 0">{{"在院"}}</div>
92
+            <div v-if="scope.row.status == 1 &&  scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 1">{{"已出院"}}</div>
91 93
           </template>
92 94
         </el-table-column>
93 95
 <!--        <el-table-column align="center" prop="name" label="操作" width="180">-->

+ 57 - 0
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Прегледај датотеку

@@ -976,6 +976,20 @@ export default {
976 976
             }
977 977
           }
978 978
 
979
+          // for (let i = 0; i < response.data.data.list_three.length; i++) {
980
+          //   //已就诊
981
+          //   if (response.data.data.list_three[i].prescription.length > 0) {
982
+          //     let obj = {
983
+          //       name: response.data.data.list_three[i].name,
984
+          //       number: "",
985
+          //       id: response.data.data.list_three[i].id,
986
+          //       his_patient_id: 0,
987
+          //       first_letter: response.data.data.list_three[i].first_letter
988
+          //     }
989
+          //     this.cure_data.push(obj)
990
+          //   }
991
+          // }
992
+
979 993
           this.all_data = this.all_data.concat(this.cure_data)
980 994
           this.all_data = this.all_data.concat(this.un_cure_data)
981 995
 
@@ -1155,6 +1169,7 @@ export default {
1155 1169
             }
1156 1170
           }
1157 1171
 
1172
+
1158 1173
           //排班
1159 1174
           for (let i = 0; i < response.data.data.list_two.length; i++) {
1160 1175
             // console.log('hahhahahahahahahah', response.data.data.list_two)
@@ -1183,6 +1198,20 @@ export default {
1183 1198
               this.cure_data.push(obj)
1184 1199
             }
1185 1200
           }
1201
+          // for (let i = 0; i < response.data.data.list_three.length; i++) {
1202
+          //   //已就诊
1203
+          //   if (response.data.data.list_three[i].prescription.length > 0) {
1204
+          //     let obj = {
1205
+          //       name: response.data.data.list_three[i].name,
1206
+          //       number: "",
1207
+          //       id: response.data.data.list_three[i].id,
1208
+          //       his_patient_id: 0,
1209
+          //       first_letter: response.data.data.list_three[i].first_letter
1210
+          //     }
1211
+          //     this.cure_data.push(obj)
1212
+          //   }
1213
+          // }
1214
+
1186 1215
           // console.log('gggg',this.un_cure_data);
1187 1216
           this.all_data = this.all_data.concat(this.cure_data)
1188 1217
           this.all_data = this.all_data.concat(this.un_cure_data)
@@ -1285,6 +1314,20 @@ export default {
1285 1314
             }
1286 1315
           }
1287 1316
 
1317
+          // for (let i = 0; i < response.data.data.list_three.length; i++) {
1318
+          //   //已就诊
1319
+          //   if (response.data.data.list_three[i].prescription.length > 0) {
1320
+          //     let obj = {
1321
+          //       name: response.data.data.list_three[i].name,
1322
+          //       number: "",
1323
+          //       id: response.data.data.list_three[i].id,
1324
+          //       his_patient_id: 0,
1325
+          //       first_letter: response.data.data.list_three[i].first_letter
1326
+          //     }
1327
+          //     this.cure_data.push(obj)
1328
+          //   }
1329
+          // }
1330
+
1288 1331
           this.all_data = this.all_data.concat(this.cure_data)
1289 1332
           this.all_data = this.all_data.concat(this.un_cure_data)
1290 1333
 
@@ -1795,6 +1838,20 @@ export default {
1795 1838
             }
1796 1839
           }
1797 1840
 
1841
+          // for (let i = 0; i < response.data.data.list_three.length; i++) {
1842
+          //     //已就诊
1843
+          //     if (response.data.data.list_three[i].prescription.length > 0) {
1844
+          //       let obj = {
1845
+          //         name: response.data.data.list_three[i].name,
1846
+          //         number: "",
1847
+          //         id: response.data.data.list_three[i].id,
1848
+          //         his_patient_id: 0,
1849
+          //         first_letter: response.data.data.list_three[i].first_letter
1850
+          //       }
1851
+          //       this.cure_data.push(obj)
1852
+          //     }
1853
+          // }
1854
+
1798 1855
           this.all_data = this.all_data.concat(this.cure_data)
1799 1856
           this.all_data = this.all_data.concat(this.un_cure_data)
1800 1857
 

+ 0 - 10
src/xt_pages/outpatientTool/PrescriptionSmmary.vue Прегледај датотеку

@@ -10,8 +10,6 @@
10 10
           <el-tab-pane label="明细" name="明细"></el-tab-pane>
11 11
           <el-tab-pane label="汇总" name="汇总"></el-tab-pane>
12 12
         </el-tabs>
13
-<!--        <detail v-if="titleType == '明细'"></detail>-->
14
-<!--        <gather v-if="titleType == '汇总'"></gather>-->
15 13
         <pdetail v-if="titleType == '明细'"></pdetail>
16 14
         <pgather  v-if="titleType == '汇总'"></pgather>
17 15
       </div>
@@ -23,20 +21,12 @@
23 21
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
24 22
 import Pdetail from './components/pdetail.vue'
25 23
 import Pgather from './components/pgather.vue'
26
-
27
-
28 24
 const moment = require('moment')
29
-
30 25
 export default {
31 26
   components: {
32 27
     Pgather,
33 28
     Pdetail,
34
-    Gather,
35
-    Settle,
36
-    Detail,
37
-    SummaryDetail,
38 29
     BreadCrumb
39
-
40 30
   },
41 31
   data() {
42 32
     return {

+ 3 - 6
src/xt_pages/outpatientTool/components/detail.vue Прегледај датотеку

@@ -30,10 +30,6 @@
30 30
 
31 31
             <el-select size="small" v-model="item_time_type" placeholder="请选择"
32 32
                        style="width:150px;margin-left:10px;" @change="changeTimeItem">
33
-              <el-option
34
-                label="处方时间"
35
-                value="0">
36
-              </el-option>
37 33
               <el-option
38 34
                 label="结算时间"
39 35
                 value="1">
@@ -150,7 +146,7 @@ export default {
150 146
       tableData: [],
151 147
       chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
152 148
       item_type: '0',
153
-      item_time_type:'0',
149
+      item_time_type:'1',
154 150
       items: [
155 151
         { id: 1, name: '药品' },
156 152
         { id: 2, name: '项目' },
@@ -770,7 +766,8 @@ export default {
770 766
           colspan: _col
771 767
         }
772 768
       }
773
-    }, export_detail() {
769
+    },
770
+    export_detail() {
774 771
 
775 772
       let list = []
776 773
       for (let i = 0; i < this.tableData.length; i++) {

+ 2 - 5
src/xt_pages/outpatientTool/components/gather.vue Прегледај датотеку

@@ -26,10 +26,7 @@
26 26
         </el-select>
27 27
         <el-select size="small" v-model="item_time_type" placeholder="请选择"
28 28
                    style="width:150px;margin-left:10px;" @change="changeTimeItem">
29
-          <el-option
30
-            label="处方时间"
31
-            value="0">
32
-          </el-option>
29
+
33 30
           <el-option
34 31
             label="结算时间"
35 32
             value="1">
@@ -116,7 +113,7 @@ export default {
116 113
       tableData: [],
117 114
       chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
118 115
       item_type: '0',
119
-      item_time_type:'0',
116
+      item_time_type:'1',
120 117
       items: [
121 118
         { id: 1, name: '药品' },
122 119
         { id: 2, name: '所有项目' },

+ 255 - 347
src/xt_pages/outpatientTool/components/pdetail.vue Прегледај датотеку

@@ -6,18 +6,27 @@
6 6
   <div>
7 7
     <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8 8
       <div>
9
-        <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
-        <!--@click="Action">-->
11
-        <!--导出-->
12
-        <!--</el-button>-->
13
-        <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
-                  @keyup.enter.native='searchAction'
15
-                  placeholder="请输入患者姓名"
16
-                  class="filter-item"/>
9
+
10
+        <el-autocomplete
11
+          class="checkSearch"
12
+          popper-class="my-autocomplete"
13
+          v-model="search_value"
14
+          :fetch-suggestions="querySearchAsync"
15
+          :trigger-on-focus="false"
16
+          placeholder="病人透析号/姓名"
17
+          @select="handleSelect"
18
+        >
19
+          <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+          <template slot-scope="{ item }">
21
+            <div class="name">{{ item.name }}</div>
22
+          </template>
23
+        </el-autocomplete>
24
+
25
+
17 26
         <el-select size="small" v-model="item_type" placeholder="请选择"
18
-                   style="width:150px;margin-left:10px;" @change="changeItem">
27
+                   style="width:150px;margin-left:10px;" >
19 28
           <el-option
20
-            label="全部"
29
+            label="不限"
21 30
             value="0">
22 31
           </el-option>
23 32
           <el-option
@@ -28,17 +37,6 @@
28 37
           </el-option>
29 38
         </el-select>
30 39
 
31
-        <el-select size="small" v-model="item_time_type" placeholder="请选择"
32
-                   style="width:150px;margin-left:10px;" @change="changeTimeItem">
33
-          <el-option
34
-            label="处方时间"
35
-            value="0">
36
-          </el-option>
37
-          <el-option
38
-            label="结算时间"
39
-            value="1">
40
-          </el-option>
41
-        </el-select>
42 40
 
43 41
         <el-date-picker
44 42
           v-model="chargeDate"
@@ -46,7 +44,6 @@
46 44
           value-format="yyyy-MM-dd"
47 45
           range-separator="至"
48 46
           start-placeholder="开始日期"
49
-          @change="handleDateChange"
50 47
           end-placeholder="结束日期">
51 48
         </el-date-picker>
52 49
         <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
@@ -62,16 +59,14 @@
62 59
           <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
63 60
 
64 61
         </el-popover> -->
65
-        <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
62
+        <el-button size="small" type="primary" @click="getSummaryDetailList">查询</el-button>
63
+        <el-button size="small" type="primary" @click="export_detail">下载报表</el-button>
64
+
66 65
       </div>
67 66
     </div>
68 67
     <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
69 68
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
70
-              :span-method="merge"
71
-              show-summary
72
-              :summary-method="getTotal"
73 69
               max-height="600"
74
-
75 70
               v-loading="detail_loading"
76 71
               highlight-current-row>
77 72
 
@@ -79,17 +74,25 @@
79 74
         <template slot-scope="scope">{{ scope.row.name }}</template>
80 75
       </el-table-column>
81 76
       <el-table-column align="center" prop="name" label="处方日期">
82
-        <template slot-scope="scope">{{ scope.row.name }}</template>
77
+        <template slot-scope="scope">{{ scope.row.record_date }}</template>
83 78
       </el-table-column>
84 79
       <!--<el-table-column align="center" prop="name" label="患者类型">-->
85 80
       <!--<template slot-scope="scope"></template>-->
86 81
       <!--</el-table-column>-->
87 82
       <el-table-column align="center" prop="name" label="费用类型">
88
-        <template slot-scope="scope">{{ scope.row.name }}</template>
83
+        <template slot-scope="scope">
84
+          <div v-if="scope.row.type == 1">{{getDrugType(scope.row.item_cost_type)}}</div>
85
+          <div v-if="scope.row.type == 2">{{getCostType(scope.row.item_cost_type)}}</div>
86
+          <div v-if="scope.row.type == 3">耗材</div>
87
+
88
+        </template>
89 89
       </el-table-column>
90 90
 
91 91
       <el-table-column align="center" prop="name" label="处方类型">
92
-        <template slot-scope="scope">{{ scope.row.name }}</template>
92
+        <template slot-scope="scope">
93
+          <div v-if="scope.row.med_type == 11">普通门诊</div>
94
+          <div v-if="scope.row.med_type == 14">门诊特殊病</div>
95
+        </template>
93 96
       </el-table-column>
94 97
 
95 98
 
@@ -106,26 +109,21 @@
106 109
       </el-table-column>
107 110
 
108 111
       <el-table-column align="center" prop="name" label="单位">
109
-        <template slot-scope="scope">{{scope.row.count}}</template>
112
+        <template slot-scope="scope">{{scope.row.unit}}</template>
110 113
       </el-table-column>
111 114
 
112 115
       <el-table-column align="center" prop="name" label="单价">
113 116
         <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
114 117
       </el-table-column>
115 118
 
116
-      <el-table-column align="center" prop="name" label="金额">
119
+      <el-table-column align="center" prop="sum" label="金额">
117 120
         <template slot-scope="scope">
118 121
           <div>{{((scope.row.price*scope.row.count).toFixed(2))}}</div>
119 122
         </template>
120 123
       </el-table-column>
121 124
 
122 125
       <el-table-column align="center" prop="name" label="是否结算">
123
-        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
124
-      </el-table-column>
125
-
126
-
127
-      <el-table-column align="center" prop="name" label="结算日期">
128
-        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
126
+        <template slot-scope="scope">{{scope.row.order_status == 2?'已结算':'未结算'}}</template>
129 127
       </el-table-column>
130 128
 
131 129
     </el-table>
@@ -137,7 +135,11 @@
137 135
 
138 136
 <script>
139 137
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
140
-import { GetSummaryDetail } from '@/api/his/his'
138
+import { GetPSummaryDetail } from '@/api/his/his'
139
+import { getPrescriptionInitdata } from '@/api/his/his_tools'
140
+
141
+import { PostSearch } from '@/api/patient'
142
+
141 143
 import { uParseTime } from '@/utils/tools'
142 144
 import axios from 'axios'
143 145
 import pako from 'pako';
@@ -166,9 +168,12 @@ export default {
166 168
       detail_loading: false,
167 169
       tempArr: [],
168 170
       pos: 0,
169
-
171
+      patient_id:0,
170 172
       sameRowArr: [],
171 173
       keywords: '',
174
+      search_value:"",
175
+      drugTypeList:[],
176
+      costClassifyList:[],
172 177
       tableData: [],
173 178
       chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
174 179
       item_type: '0',
@@ -181,6 +186,83 @@ export default {
181 186
     }
182 187
   },
183 188
   methods: {
189
+    export_detail() {
190
+
191
+      let list = []
192
+      for (let i = 0; i < this.tableData.length; i++) {
193
+        let order = this.tableData[i]
194
+        let name = order.name
195
+        let item_name = order.item_name
196
+        let count = order.count
197
+        let price = order.price.toFixed(2)
198
+        let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
199
+        let total = order.total.toFixed(2)
200
+
201
+        let obj = {
202
+          '患者姓名': name,
203
+          '项目名称': item_name,
204
+          '数量': count,
205
+          '单价': price,
206
+          '费用': pay_sumamt,
207
+          '费用总额': total
208
+        }
209
+        list.push(obj)
210
+      }
211
+      import('@/vendor/Export2Excel').then(excel => {
212
+        const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
213
+        const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
214
+        const data = this.formatJson(filterVal, list)
215
+        excel.export_json_to_excel1({
216
+          header: tHeader,
217
+          data,
218
+          filename: '明细',
219
+          ref: this.$refs['table'].$el
220
+        })
221
+      })
222
+
223
+    },
224
+    getCostType(type){
225
+      console.log(this.costClassifyList)
226
+      console.log(type)
227
+      var name = "";
228
+      for (let i = 0; i < this.costClassifyList.length; i++) {
229
+        if (type == this.costClassifyList[i].value) {
230
+          name = this.costClassifyList[i].name;
231
+        }
232
+      }
233
+      return name;
234
+    },
235
+    getDrugType(type){
236
+      console.log(this.drugTypeList)
237
+      console.log(type)
238
+
239
+      var name = "";
240
+      for (let i = 0; i < this.drugTypeList.length; i++) {
241
+        if (type == this.drugTypeList[i].value) {
242
+          name = this.drugTypeList[i].name;
243
+        }
244
+      }
245
+      return name;
246
+    },
247
+    handleSelect(val) {
248
+      this.patient_id = val.id
249
+      this.search_value = val.name
250
+    },
251
+    querySearchAsync(keyword, cb) {
252
+      let key = ''
253
+      if (keyword != undefined) {
254
+        key = keyword
255
+      }
256
+      let searchArray = []
257
+      PostSearch(key).then(response => {
258
+        if (response.data.state == 1) {
259
+          searchArray = response.data.data.patient
260
+          cb(searchArray)
261
+        } else {
262
+          cb([])
263
+        }
264
+      })
265
+    },
184 266
     handleDateChangetwo(value) {
185 267
       this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
186 268
         confirmButtonText: '确 定',
@@ -188,7 +270,6 @@ export default {
188 270
         type: 'warning'
189 271
       }).then(() => {
190 272
 
191
-
192 273
       }).catch(() => {
193 274
       })
194 275
 
@@ -224,11 +305,10 @@ export default {
224 305
       // }else{
225 306
       //   this.getSummaryDetailListtwo()
226 307
       // }
227
-      this.getSummaryDetailList()
228
-
308
+      // this.getSummaryDetailList()
229 309
 
230 310
     },
231
-    Action(){
311
+    Action() {
232 312
       var that = this
233 313
       axios.get('http://127.0.0.1:9531/handelExcel', {
234 314
         params: {}
@@ -237,18 +317,17 @@ export default {
237 317
           if (response.data.state == 0) {
238 318
             that.$message.error(response.data.msg)
239 319
 
240
-
241 320
             return false
242 321
           } else {
243 322
 
244 323
             var list = []
245
-            for(let i = 0; i < response.data.data.list.length; i++){
246
-              let team =  response.data.data.list[i]
247
-              for(let b = 0; b < team.list.length; b++){
324
+            for (let i = 0; i < response.data.data.list.length; i++) {
325
+              let team = response.data.data.list[i]
326
+              for (let b = 0; b < team.list.length; b++) {
248 327
                 let name = ""
249
-                if(team.list[b].type == 2){
328
+                if (team.list[b].type == 2) {
250 329
                   name = team.list[b].project.project_name
251
-                }else{
330
+                } else {
252 331
 
253 332
                   name = team.list[b].good_info.good_name
254 333
 
@@ -270,8 +349,8 @@ export default {
270 349
             }
271 350
 
272 351
             import('@/vendor/Export2Excel').then(excel => {
273
-              const tHeader = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
274
-              const filterVal = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
352
+              const tHeader = ['客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
353
+              const filterVal = ['客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
275 354
               const data = that.formatJson(filterVal, list)
276 355
               excel.export_json_to_excel({
277 356
                 header: tHeader,
@@ -280,17 +359,13 @@ export default {
280 359
               })
281 360
             })
282 361
 
283
-
284 362
           }
285 363
         })
286 364
         .catch(function(error) {
287 365
 
288 366
         })
289 367
 
290
-
291
-
292
-
293
-    },formatJson(filterVal, jsonData) {
368
+    }, formatJson(filterVal, jsonData) {
294 369
       return jsonData.map(v => filterVal.map(j => v[j]))
295 370
     },
296 371
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -321,108 +396,83 @@ export default {
321 396
     },
322 397
     changeItem() {
323 398
       this.getSummaryDetailList()
324
-    },changeTimeItem(){
399
+    }, changeTimeItem() {
325 400
 
326 401
       this.getSummaryDetailList()
327 402
 
403
+    }, uniqueProjectAndAdvice(array) {
404
+      // res用来存储结果
405
+      var res = []
406
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
407
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
408
+          if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
409
+            break
410
+          }
411
+        }
412
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
413
+        if (j === resLen) {
414
+          res.push(array[i])
415
+        }
416
+      }
417
+      return res
328 418
     },
329 419
     searchAction() {
330 420
       this.item_type = '0'
331 421
       this.getSummaryDetailList()
332 422
 
333
-    },  getSummaryDetailListtwo() {
334
-      this.detail_loading = true
335
-      let start_time = this.chargeDate[0]
336
-      let end_time = this.chargeDate[1]
337
-      let params = {
338
-        start_time: start_time,
339
-        end_time: end_time,
340
-        type: this.item_type,
341
-        keyword: this.keywords
423
+    },handleSpanTempArr() {
424
+      this.tempArr = []
425
+
426
+      for (let i = 0; i < this.tableData.length; i++) {
427
+        if (i === 0) {
428
+          this.tempArr.push(1)
429
+          this.pos = 0
430
+        } else {
431
+          // 判断当前元素与上一个元素是否相同
432
+          if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
433
+            this.tempArr[this.pos] += 1
434
+            this.tempArr.push(0)
435
+          } else {
436
+            this.tempArr.push(1)
437
+            this.pos = i
438
+          }
439
+        }
342 440
       }
343
-      GetSummaryDetail(params).then(response => {
441
+
442
+      let sameRowArr = [], sIdx = 0
443
+      this.tableData.forEach((item, index) => {
444
+        item.index = index
445
+        if (index === 0) {
446
+          sameRowArr.push([index])
447
+        } else {
448
+          if (item.patient_id === this.tableData[index - 1].patient_id) {
449
+            sameRowArr[sIdx].push(index)
450
+          } else {
451
+            sIdx = sIdx + 1
452
+            sameRowArr.push([index])
453
+          }
454
+        }
455
+      })
456
+      this.sameRowArr = sameRowArr
457
+    },getInit(){
458
+      getPrescriptionInitdata().then(response => {
344 459
         if (response.data.state == 0) {
345 460
           this.detail_loading = false
346 461
 
347 462
           this.$message.error(response.data.msg)
348 463
           return false
349 464
         } else {
350
-          this.detail_loading = false
351
-
352
-          this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
353
-            confirmButtonText: '确 定',
354
-            cancelButtonText: '取 消',
355
-            type: 'warning'
356
-          }).then(() => {
357
-
358
-
359
-          }).catch(() => {
360
-          })
361
-
362
-
465
+          this.drugTypeList = response.data.data.drugTypeList;
466
+          this.costClassifyList = response.data.data.costClassifyList;
363 467
         }
364 468
 
365
-
366
-
367
-
368
-        //
369
-        // console.log('去重前')
370
-        // console.log(advice)
371
-        // console.log(project)
372
-        // //
373
-        // //
374
-
375
-        // //
376
-        // console.log('去重后')
377
-        //
378
-        // console.log(advice.length)
379
-        // console.log(project.length)
380
-        //
381
-        // for (let i = 0; i < project.length; i++) {
382
-        //   let obj = {}
383
-        //   let count = 0
384
-        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
385
-        //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
386
-        //       count = count + tempPatientsTwo[a].count
387
-        //       obj['count'] = count
388
-        //
389
-        //     }
390
-        //     obj['price'] = project[i].price
391
-        //     obj['type'] = project[i].type
392
-        //     obj['item_name'] = project[i].item_name
393
-        //     obj['item_id'] = project[i].item_id
394
-        //     obj['name'] = project[i].name
395
-        //     obj['patient_id'] = project[i].patient_id
396
-        //     obj['count'] = count
397
-        //     this.tableData.push(obj)
398
-        //   }
399
-        // }
400
-        //
401
-        //
402
-        // for (let i = 0; i < advice.length; i++) {
403
-        //   let obj = {}
404
-        //   let count = 0
405
-        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
406
-        //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
407
-        //       count = count + tempPatientsTwo[a].count
408
-        //       obj['count'] = count
409
-        //
410
-        //     }
411
-        //     obj['price'] = advice[i].price
412
-        //     obj['type'] = advice[i].type
413
-        //     obj['item_name'] = advice[i].item_name
414
-        //     obj['item_id'] = advice[i].item_id
415
-        //     obj['name'] = advice[i].name
416
-        //     obj['patient_id'] = advice[i].patient_id
417
-        //     this.tableData.push(obj)
418
-        //   }
419
-        // }
420
-        // console.log(this.tableData.length)
421
-        // this.tableData = this.sort(this.tableData)
422
-
423 469
       })
470
+
424 471
     },
425 472
     getSummaryDetailList() {
473
+      if(this.search_value.length == 0){
474
+        this.patient_id = 0
475
+      }
426 476
       this.detail_loading = true
427 477
       let start_time = this.chargeDate[0]
428 478
       let end_time = this.chargeDate[1]
@@ -430,26 +480,22 @@ export default {
430 480
         start_time: start_time,
431 481
         end_time: end_time,
432 482
         type: this.item_type,
433
-        keyword: this.keywords,
434
-        time_type:this.item_time_type
483
+        patient_id: this.patient_id,
435 484
       }
436
-      GetSummaryDetail(params).then(response => {
485
+      GetPSummaryDetail(params).then(response => {
437 486
         if (response.data.state == 0) {
438 487
           this.detail_loading = false
439 488
 
440 489
           this.$message.error(response.data.msg)
441 490
           return false
442 491
         } else {
443
-
444
-
445 492
           this.detail_loading = false
446
-
447 493
           this.tableData = []
448 494
           let tempPatients = []
449 495
           let tempPatientsTwo = []
450 496
           //
451 497
           let tempData = response.data
452
-          let allData =  response.data
498
+          let allData = response.data
453 499
           tempData = this.uniquepid(tempData)
454 500
           //
455 501
           let order_infos = []
@@ -476,40 +522,37 @@ export default {
476 522
               order_info: []
477 523
             }
478 524
             let orders = tempPatients[i].orders
479
-
480 525
             for (let c = 0; c < orders.length; c++) {
481 526
               let newObj = {}
482 527
               newObj['count'] = orders[c].cnt
483 528
               newObj['price'] = orders[c].pric
484
-              newObj['item_total'] = orders[c].det_item_fee_sumamt
529
+
530
+              newObj['order_status'] = orders[c].order_status
531
+              newObj['med_type'] = orders[c].med_type
532
+              newObj['record_date'] = orders[c].record_date
533
+              newObj['unit'] = orders[c].unit
534
+
535
+              newObj['item_cost_type'] = orders[c].item_cost_type
536
+
537
+              // newObj['item_total'] = orders[c].det_item_fee_sumamt
485 538
 
486 539
               if (orders[c].advice_id > 0 && orders[c].project_id == 0) {
487 540
                 newObj['type'] = 1
488 541
                 newObj['item_name'] = orders[c].item_name
489 542
                 newObj['item_id'] = orders[c].item_id
490
-
491
-                if (orders[c].min_unit != orders[c].dose_unit) {
492
-                  newObj['item_spec'] =  orders[c].dose + orders[c].dose_unit + '*' + orders[c].min_number + orders[c].min_unit + '/' + orders[c].max_unit
493
-                } else {
494
-
495
-                  newObj['item_spec'] = ''
496
-                }
497
-
543
+                newObj['item_spec'] = orders[c].spec
498 544
               }
499 545
               if (orders[c].advice_id == 0 && orders[c].project_id > 0) {
500
-                newObj['type'] = 2
501 546
                 newObj['item_id'] = orders[c].item_id
502
-
503 547
                 if (orders[c].p_type == 2) {
504
-                  newObj['item_spec'] =""
505
-                  newObj['item_name'] = orders[c].item_name
506
-
548
+                  newObj['type'] = 2
507 549
 
550
+                  newObj['item_spec'] = ""
551
+                  newObj['item_name'] = orders[c].item_name
508 552
                 } else if (orders[c].p_type == 3) {
509
-                  newObj['item_spec'] =  orders[c].specification_name
553
+                  newObj['type'] = 3
554
+                  newObj['item_spec'] = orders[c].spec
510 555
                   newObj['item_name'] = orders[c].item_name
511
-
512
-
513 556
                 }
514 557
               }
515 558
               obj.order_info.push(newObj)
@@ -517,9 +560,7 @@ export default {
517 560
             }
518 561
             tempPatientsTwo.push(obj)
519 562
           }
520
-          console.log(tempPatientsTwo)
521 563
 
522
-          //
523 564
           for (let d = 0; d < tempPatientsTwo.length; d++) {
524 565
             tempPatientsTwo[d]['new_order_info'] = []
525 566
             let project = []
@@ -543,13 +584,19 @@ export default {
543 584
                 }
544 585
               }
545 586
 
546
-
547
-
548 587
               obj['price'] = project[i].price
549 588
               obj['type'] = project[i].type
550 589
               obj['item_name'] = project[i].item_name
551 590
               obj['item_spec'] = project[i].item_spec
552
-              obj['item_total'] = project[i].item_total
591
+
592
+              obj['order_status'] = project[i].order_status
593
+              obj['med_type'] = project[i].med_type
594
+              obj['record_date'] = project[i].record_date
595
+              obj['item_cost_type'] = project[i].item_cost_type
596
+              obj['unit'] = project[i].unit
597
+
598
+
599
+              // obj['item_total'] = project[i].item_total
553 600
 
554 601
               obj['item_id'] = project[i].item_id
555 602
               obj['name'] = tempPatientsTwo[d].name
@@ -572,8 +619,14 @@ export default {
572 619
               obj['item_name'] = advice[i].item_name
573 620
               obj['item_spec'] = advice[i].item_spec
574 621
               obj['item_id'] = advice[i].item_id
622
+              obj['unit'] = advice[i].unit
623
+
575 624
               obj['name'] = tempPatientsTwo[d].name
576
-              obj['item_total'] = advice[i].item_total
625
+              obj['order_status'] = advice[i].order_status
626
+              obj['med_type'] = advice[i].med_type
627
+              obj['record_date'] = advice[i].record_date
628
+              obj['item_cost_type'] = advice[i].item_cost_type
629
+              // obj['item_total'] = advice[i].item_total
577 630
               obj['patient_id'] = tempPatientsTwo[d].patient_id
578 631
               obj['count'] = count
579 632
               tempPatientsTwo[d].new_order_info.push(obj)
@@ -584,17 +637,14 @@ export default {
584 637
             let total = 0
585 638
             for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
586 639
               let new_name = tempPatientsTwo[i].new_order_info[b].item_name
587
-              if (new_name != undefined){
640
+              if (new_name != undefined) {
588 641
                 if (new_name.length != 0) {
589 642
                   console.log(parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price))
590 643
                   total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price)).toFixed(2))
591 644
                 }
592 645
 
593
-
594
-
595 646
               }
596 647
 
597
-
598 648
             }
599 649
             tempPatientsTwo[i]['total'] = total
600 650
           }
@@ -603,11 +653,6 @@ export default {
603 653
             if (tempPatientsTwo[i].new_order_info.length > 0) {
604 654
 
605 655
               for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
606
-                // let new_name = tempPatientsTwo[i].new_order_info[b].item_name
607
-                // console.log('2 ' + new_name)
608
-                //
609
-                // new_name = new_name.replace('( ', '')
610
-                // new_name = new_name.replace(' )', '')
611 656
 
612 657
                 let obj = {
613 658
                   name: tempPatientsTwo[i].name,
@@ -617,53 +662,50 @@ export default {
617 662
                   item_name: tempPatientsTwo[i].new_order_info[b].item_name,
618 663
                   item_id: tempPatientsTwo[i].new_order_info[b].item_id,
619 664
                   count: tempPatientsTwo[i].new_order_info[b].count,
620
-                  item_spec: tempPatientsTwo[i].new_order_info[b].item_spec
621
-                }
665
+                  item_spec: tempPatientsTwo[i].new_order_info[b].item_spec,
666
+                  order_status: tempPatientsTwo[i].new_order_info[b].order_status,
667
+                  med_type: tempPatientsTwo[i].new_order_info[b].med_type,
668
+                  record_date: tempPatientsTwo[i].new_order_info[b].record_date,
669
+                  item_cost_type: tempPatientsTwo[i].new_order_info[b].item_cost_type,
670
+                  unit: tempPatientsTwo[i].new_order_info[b].unit,
622 671
 
623 672
 
624
-                // if(b == 0){
673
+                }
625 674
                 obj['total'] = tempPatientsTwo[i].total
626
-                // }else{
627
-                //   obj['total'] = 0
628
-                // }
629 675
                 this.tableData.push(obj)
630 676
 
631
-
632
-
633
-
634 677
               }
635 678
             }
636 679
           }
637
-          console.log( this.tableData)
680
+          console.log(this.tableData)
638 681
           this.handleSpanTempArr()
682
+          console.log(this.tableData)
683
+
639 684
           // this.tableData = tempPatientsTwo
640 685
 
641 686
           // console.log(tempPatientsTwo.length)
642 687
           //
643
-          let advices = []
644
-          let projects = []
645
-          let goods = []
646
-          for(let i = 0; i < order_infos.length; i++){
647
-            if(order_infos[i].advice_id > 0 && order_infos[i].project_id == 0){
648
-              advices.push(order_infos[i].advice)
649
-            }
650
-            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
651
-              if(order_infos[i].project.type == 3){
652
-                goods.push(order_infos[i].project)
653
-              }
654
-            }
655
-            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
656
-              if(order_infos[i].project.type == 2){
657
-                projects.push(order_infos[i].project)
658
-              }
659
-            }
660
-          }
688
+          // let advices = []
689
+          // let projects = []
690
+          // let goods = []
691
+          // for (let i = 0; i < order_infos.length; i++) {
692
+          //   if (order_infos[i].advice_id > 0 && order_infos[i].project_id == 0) {
693
+          //     advices.push(order_infos[i].advice)
694
+          //   }
695
+          //   if (order_infos[i].advice_id == 0 && order_infos[i].project_id > 0) {
696
+          //     if (order_infos[i].project.type == 3) {
697
+          //       goods.push(order_infos[i].project)
698
+          //     }
699
+          //   }
700
+          //   if (order_infos[i].advice_id == 0 && order_infos[i].project_id > 0) {
701
+          //     if (order_infos[i].project.type == 2) {
702
+          //       projects.push(order_infos[i].project)
703
+          //     }
704
+          //   }
705
+          // }
661 706
 
662 707
         }
663 708
 
664
-
665
-
666
-
667 709
         //
668 710
         // console.log('去重前')
669 711
         // console.log(advice)
@@ -720,145 +762,11 @@ export default {
720 762
         // this.tableData = this.sort(this.tableData)
721 763
 
722 764
       })
723
-    }, uniqueProjectAndAdvice(array) {
724
-      // res用来存储结果
725
-      var res = []
726
-      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
727
-        for (var j = 0, resLen = res.length; j < resLen; j++) {
728
-          if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
729
-            break
730
-          }
731
-        }
732
-        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
733
-        if (j === resLen) {
734
-          res.push(array[i])
735
-        }
736
-      }
737
-      return res
738
-    }, sort(arr) {
739
-      for (var i = 0; i < arr.length - 1; i++) {
740
-        for (var j = 0; j < arr.length - i - 1; j++) {
741
-          if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
742
-            var hand = arr[j]
743
-            arr[j] = arr[j + 1]
744
-            arr[j + 1] = hand
745
-
746
-          }
747
-        }
748
-      }
749
-      return arr
750
-    }, handleSpanTempArr() {
751
-      this.tempArr = []
752
-
753
-      for (let i = 0; i < this.tableData.length; i++) {
754
-        if (i === 0) {
755
-          this.tempArr.push(1)
756
-          this.pos = 0
757
-        } else {
758
-          // 判断当前元素与上一个元素是否相同
759
-          if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
760
-            this.tempArr[this.pos] += 1
761
-            this.tempArr.push(0)
762
-          } else {
763
-            this.tempArr.push(1)
764
-            this.pos = i
765
-          }
766
-        }
767
-      }
768
-
769
-      let sameRowArr = [], sIdx = 0
770
-      this.tableData.forEach((item, index) => {
771
-        item.index = index
772
-        if (index === 0) {
773
-          sameRowArr.push([index])
774
-        } else {
775
-          if (item.patient_id === this.tableData[index - 1].patient_id) {
776
-            sameRowArr[sIdx].push(index)
777
-          } else {
778
-            sIdx = sIdx + 1
779
-            sameRowArr.push([index])
780
-          }
781
-        }
782
-      })
783
-      this.sameRowArr = sameRowArr
784
-    }, merge({ row, column, rowIndex, columnIndex }) {
785
-      if (columnIndex === 0 || columnIndex === 6) {
786
-        const _row = this.tempArr[rowIndex]
787
-        const _col = _row > 0 ? 1 : 0
788
-        return {
789
-          rowspan: _row,
790
-          colspan: _col
791
-        }
792
-      }
793
-    }, export_detail() {
794
-
795
-      let list = []
796
-      for (let i = 0; i < this.tableData.length; i++) {
797
-        let order = this.tableData[i]
798
-        let name = order.name
799
-        let item_name = order.item_name
800
-        let count = order.count
801
-        let price = order.price.toFixed(2)
802
-        let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
803
-        let total = order.total.toFixed(2)
804
-
805
-        let obj = {
806
-          '患者姓名': name,
807
-          '项目名称': item_name,
808
-          '数量': count,
809
-          '单价': price,
810
-          '费用': pay_sumamt,
811
-          '费用总额': total
812
-        }
813
-        list.push(obj)
814
-      }
815
-      import('@/vendor/Export2Excel').then(excel => {
816
-        const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
817
-        const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
818
-        const data = this.formatJson(filterVal, list)
819
-        excel.export_json_to_excel1({
820
-          header: tHeader,
821
-          data,
822
-          filename: '明细',
823
-          ref: this.$refs['table'].$el
824
-        })
825
-      })
826
-
827
-    }, formatJson(filterVal, jsonData) {
828
-      return jsonData.map(v => filterVal.map(j => v[j]))
829
-    }, getTotal(param) {
830
-      const { columns, data } = param
831
-      const sums = []
832
-      columns.forEach((column, index) => {
833
-        if (index === 0) {
834
-          sums[index] = '合计'
835
-          return
836
-        }
837
-        const values = data.map(item => Number(item[column.property]))
838
-        if (column.property === 'total') {
839
-          // sums[index] = values.reduce((prev, curr) => {
840
-          //   const value = Number(curr)
841
-          //   if (!isNaN(value)) {
842
-          //     return prev + curr
843
-          //   } else {
844
-          //     return prev
845
-          //   }
846
-          // }, 0)
847
-          // sums[index] = sums[index].toFixed(2)
848
-          let num = 0
849
-          data.map(item => {
850
-            num += item.price * item.count
851
-          })
852
-          sums[index] = num.toFixed(2)
853
-        } else {
854
-          sums[index] = ''
855
-        }
856
-      })
857
-
858
-      return sums
859
-    }
765
+    },
860 766
   },
767
+
861 768
   created() {
769
+    this.getInit()
862 770
     this.getSummaryDetailList()
863 771
 
864 772
   }

+ 310 - 311
src/xt_pages/outpatientTool/components/pgather.vue Прегледај датотеку

@@ -6,15 +6,25 @@
6 6
         <!--@click="Action">-->
7 7
         <!--导出-->
8 8
         <!--</el-button>-->
9
-        <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
10
-                  @keyup.enter.native='searchAction'
11
-                  placeholder="请输入患者姓名"
9
+        <el-autocomplete
10
+          class="checkSearch"
11
+          popper-class="my-autocomplete"
12
+          v-model="search_value"
13
+          :fetch-suggestions="querySearchAsync"
14
+          :trigger-on-focus="false"
15
+          placeholder="病人透析号/姓名"
16
+          @select="handleSelect"
17
+        >
18
+          <i class="el-icon-search el-input__icon" slot="suffix"></i>
19
+          <template slot-scope="{ item }">
20
+            <div class="name">{{ item.name }}</div>
21
+          </template>
22
+        </el-autocomplete>
12 23
 
13
-                  class="filter-item"/>
14 24
         <el-select size="small" v-model="item_type" placeholder="请选择"
15
-                   style="width:150px;margin-left:10px;" @change="changeItem">
25
+                   style="width:150px;margin-left:10px;" >
16 26
           <el-option
17
-            label="全部"
27
+            label="不限"
18 28
             value="0">
19 29
           </el-option>
20 30
           <el-option
@@ -24,68 +34,65 @@
24 34
             :value="item.id">
25 35
           </el-option>
26 36
         </el-select>
27
-        <el-select size="small" v-model="item_time_type" placeholder="请选择"
28
-                   style="width:150px;margin-left:10px;" @change="changeTimeItem">
29
-          <el-option
30
-            label="处方时间"
31
-            value="0">
32
-          </el-option>
33
-          <el-option
34
-            label="结算时间"
35
-            value="1">
36
-          </el-option>
37
-        </el-select>
37
+
38
+
38 39
         <el-date-picker
39 40
           v-model="chargeDate"
40 41
           type="daterange"
41 42
           value-format="yyyy-MM-dd"
42 43
           range-separator="至"
43 44
           start-placeholder="开始日期"
44
-          @change="changeDate"
45 45
           end-placeholder="结束日期">
46 46
         </el-date-picker>
47
-        <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
48
-        <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
49 47
       </div>
50 48
       <div>
51
-        <!-- <el-popover
52
-          placement="bottom"
53
-          width="210"
54
-          trigger="click">
55
-          <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
56
-          <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
57
-          <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
58
-
59
-        </el-popover> -->
49
+        <el-button size="small" type="primary" @click="getSummaryDetailList">查询</el-button>
60 50
         <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
61 51
       </div>
62 52
     </div>
63 53
     <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="tables"
64 54
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
65 55
               v-loading="gather_loading"
66
-              show-summary
67 56
               max-height="600"
68
-              :span-method="merge"
69
-              :summary-method="getTotal"
70 57
               highlight-current-row>
71 58
 
72 59
       <el-table-column align="center" prop="name" label="费用分类">
73
-        <template slot-scope="scope">{{ scope.row.name }}</template>
60
+        <template slot-scope="scope">
61
+          <div v-if="scope.row.type == 1">{{getDrugType(scope.row.item_cost_type)}}</div>
62
+          <div v-if="scope.row.type == 2">{{getCostType(scope.row.item_cost_type)}}</div>
63
+          <div v-if="scope.row.type == 3">耗材</div>
64
+        </template>
74 65
       </el-table-column>
75
-      <!--<el-table-column align="center" prop="name" label="患者类型">-->
76
-      <!--<template slot-scope="scope"></template>-->
77
-      <!--</el-table-column>-->
78 66
 
79
-      <el-table-column align="center" prop="item_name" label="处方类型">
80
-        <template slot-scope="scope">{{scope.row.item_name}}</template>
67
+      <el-table-column align="center" prop="name" label="处方类型">
68
+        <template slot-scope="scope">
69
+          <div v-if="scope.row.med_type == 11">普通门诊</div>
70
+          <div v-if="scope.row.med_type == 14">门诊特殊病</div>
71
+        </template>
81 72
       </el-table-column>
82 73
       <el-table-column align="center" prop="price" label="项目名称">
83
-        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
74
+        <template slot-scope="scope">{{scope.row.item_name}}</template>
84 75
       </el-table-column>
85
-      <el-table-column align="center" prop="sum" label="费用总额">
86
-        <template slot-scope="scope">
87
-          <div>{{scope.row.sum.toFixed(2)}}</div>
88
-        </template>
76
+      <el-table-column align="center" prop="price" label="规格型号">
77
+        <template slot-scope="scope">{{scope.row.spec}}</template>
78
+      </el-table-column>
79
+      <el-table-column align="center" prop="price" label="数量">
80
+        <template slot-scope="scope">{{scope.row.count}}</template>
81
+      </el-table-column>
82
+      <el-table-column align="center" prop="price" label="单位">
83
+        <template slot-scope="scope">{{scope.row.unit}}</template>
84
+      </el-table-column>
85
+      <el-table-column align="center" prop="price" label="单价">
86
+        <template slot-scope="scope">{{scope.row.price}}</template>
87
+      </el-table-column>
88
+      <el-table-column align="center" prop="sum" label="金额">
89
+        <template slot-scope="scope">{{(scope.row.count * scope.row.price).toFixed(2)}}</template>
90
+      </el-table-column>
91
+      <el-table-column align="center" prop="settle" label="已结算金额">
92
+        <template slot-scope="scope">{{scope.row.total_settle.toFixed(2)}}</template>
93
+      </el-table-column>
94
+      <el-table-column align="center" prop="un_settle" label="未结算金额">
95
+        <template slot-scope="scope">{{scope.row.total_un_settle.toFixed(2)}}</template>
89 96
       </el-table-column>
90 97
 
91 98
     </el-table>
@@ -95,7 +102,10 @@
95 102
 
96 103
 <script>
97 104
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
98
-import { GetSummaryDetail } from '@/api/his/his'
105
+import { GetPSummaryDetail } from '@/api/his/his'
106
+import { PostSearch } from '@/api/patient'
107
+import { getPrescriptionInitdata } from '@/api/his/his_tools'
108
+
99 109
 import { uParseTime } from '@/utils/tools'
100 110
 // import NewStatementPrint from './newStatementPrint'
101 111
 const moment = require('moment')
@@ -112,27 +122,80 @@ export default {
112 122
       sameRowArr: [],
113 123
       keywords: '',
114 124
       pos:0,
115
-
125
+      costClassifyList:[],
126
+      drugTypeList:[],
127
+      search_value:"",
116 128
       tableData: [],
117 129
       chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
118 130
       item_type: '0',
131
+      patient_id:0,
119 132
       item_time_type:'0',
120 133
       items: [
121
-        { id: 1, name: '药品' },
122
-        { id: 2, name: '所有项目' },
123
-        { id: 4, name: '检验费' },
124
-        { id: 5, name: '治疗费' },
125
-        { id: 6, name: '护理费' },
126
-        { id: 7, name: '其他' },
127
-
128
-        { id: 3, name: '耗材' },
134
+        { id: 1, name: '未结算' },
135
+        { id: 2, name: '结算' },
129 136
 
130 137
       ]
131 138
 
132 139
     }
133 140
   },
134 141
   methods: {
142
+    getInit(){
143
+      getPrescriptionInitdata().then(response => {
144
+        if (response.data.state == 0) {
145
+          this.detail_loading = false
135 146
 
147
+          this.$message.error(response.data.msg)
148
+          return false
149
+        } else {
150
+          this.drugTypeList = response.data.data.drugTypeList;
151
+          this.costClassifyList = response.data.data.costClassifyList;
152
+        }
153
+
154
+      })
155
+
156
+    },
157
+    getCostType(type){
158
+      console.log(this.costClassifyList)
159
+      console.log(type)
160
+      var name = "";
161
+      for (let i = 0; i < this.costClassifyList.length; i++) {
162
+        if (type == this.costClassifyList[i].value) {
163
+          name = this.costClassifyList[i].name;
164
+        }
165
+      }
166
+      return name;
167
+    },
168
+    getDrugType(type){
169
+      console.log(this.drugTypeList)
170
+      console.log(type)
171
+
172
+      var name = "";
173
+      for (let i = 0; i < this.drugTypeList.length; i++) {
174
+        if (type == this.drugTypeList[i].value) {
175
+          name = this.drugTypeList[i].name;
176
+        }
177
+      }
178
+      return name;
179
+    },
180
+    handleSelect(val) {
181
+      this.patient_id = val.id
182
+      this.search_value = val.name
183
+    },
184
+    querySearchAsync(keyword, cb) {
185
+      let key = ''
186
+      if (keyword != undefined) {
187
+        key = keyword
188
+      }
189
+      let searchArray = []
190
+      PostSearch(key).then(response => {
191
+        if (response.data.state == 1) {
192
+          searchArray = response.data.data.patient
193
+          cb(searchArray)
194
+        } else {
195
+          cb([])
196
+        }
197
+      })
198
+    },
136 199
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
137 200
       if (columnIndex === 0) {
138 201
         if (rowIndex % 2 === 0) {
@@ -169,6 +232,10 @@ export default {
169 232
       this.getSummaryDetailList()
170 233
     },
171 234
     getSummaryDetailList() {
235
+      console.log(this.search_value)
236
+      if(this.search_value.length == 0){
237
+        this.patient_id = 0
238
+      }
172 239
       this.gather_loading = true
173 240
       let start_time = this.chargeDate[0]
174 241
       let end_time = this.chargeDate[1]
@@ -176,265 +243,20 @@ export default {
176 243
         start_time: start_time,
177 244
         end_time: end_time,
178 245
         type: this.item_type,
179
-        keyword: this.keywords,
180
-        time_type:this.item_time_type,
246
+        patient_id:this.patient_id
181 247
       }
182
-      GetSummaryDetail(params).then(response => {
248
+      GetPSummaryDetail(params).then(response => {
183 249
         if (response.data.state == 0) {
184 250
           this.gather_loading = false
185
-
186 251
           this.$message.error(response.data.msg)
187 252
           return false
188 253
         } else {
189 254
           this.gather_loading = false
190
-
191
-          let tempPatients = []
192
-          let tempPatientsTwo = []
193 255
           this.tableData = []
194 256
           let tempData = response.data
195
-          let data = response.data
196
-          let orders = this.uniquepid(tempData)
197
-          console.log(orders)
198
-
199
-          for (let i = 0; i < orders.length; i++) {
200
-            let obj = {
201
-              patient_id: orders[i].p_id,
202
-              name: orders[i].p_name,
203
-              orders: []
204
-            }
205
-            for (let b = 0; b < data.length; b++) {
206
-              if (orders[i].p_id == data[b].p_id) {
207
-                obj.orders = obj.orders.concat(data[b])
208
-              }
209
-            }
210
-            tempPatients.push(obj)
211
-          }
212
-          console.log(tempPatients)
213
-
214
-          for (let i = 0; i < tempPatients.length; i++) {
215
-            let obj = {
216
-              patient_id: tempPatients[i].patient_id,
217
-              name: tempPatients[i].name,
218
-              order_info: []
219
-            }
220
-            let orders = tempPatients[i].orders
221
-            for (let c = 0; c < orders.length; c++) {
222
-              let newObj = {}
223
-
224
-              newObj['count'] = orders[c].cnt
225
-              newObj['price'] = orders[c].pric
226
-              if (orders[c].advice_id > 0 && orders[c].project_id == 0) {
227
-                newObj['type'] = 1
228
-                newObj['item_name'] = orders[c].item_name
229
-                newObj['item_id'] = orders[c].item_id
230
-
231
-              }
232
-              if (orders[c].advice_id == 0 && orders[c].project_id > 0) {
233
-                newObj['item_id'] = orders[c].item_id
234
-                if (orders[c].p_type == 2) {
235
-                  newObj['type'] = 2
236
-                  newObj['item_name'] = orders[c].item_name
237
-                } else if (orders[c].p_type == 3) {
238
-                  newObj['type'] = 3
239
-                  newObj['item_name'] = orders[c].item_name
240
-                }
241
-              }
242
-              obj.order_info.push(newObj)
243
-            }
244
-            tempPatientsTwo.push(obj)
245
-          }
246
-          console.log(tempPatientsTwo)
247
-
248
-          for (let d = 0; d < tempPatientsTwo.length; d++) {
249
-            tempPatientsTwo[d]['new_order_info'] = []
250
-            let project = []
251
-            let advice = []
252
-            for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
253
-              if (tempPatientsTwo[d].order_info[b].type == 1) {
254
-                advice.push(tempPatientsTwo[d].order_info[b])
255
-              } else {
256
-                project.push(tempPatientsTwo[d].order_info[b])
257
-              }
258
-            }
259
-            // project = this.uniqueProjectAndAdvice(project)
260
-            // advice = this.uniqueProjectAndAdvice(advice)
261
-
262
-            let obj = {}
263
-            let price = 0
264
-
265
-            let obj2 = {}
266
-            let price2 = 0
267
-
268
-            let obj3 = {}
269
-            let price3 = 0
270
-
271
-            for (let i = 0; i < project.length; i++) {
272
-              if (project[i].type == 2) {
273
-                price = parseFloat(price.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
274
-              } else if (project[i].type == 3) {
275
-                price3 = parseFloat(price3.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
276
-              }
277
-            }
278
-
279
-
280
-            for (let i = 0; i < advice.length; i++) {
281
-              price2 = parseFloat(price2.toString()) + parseFloat((parseFloat(advice[i].count.toString()) * parseFloat(advice[i].price.toString()).toFixed(2)).toString())
282
-            }
283
-
284
-
285
-            switch (parseInt(this.item_type)) {
286
-              case 0:
287
-
288
-                obj['sum'] = price + price2 + price3
289
-                obj['price'] = price
290
-                obj['item_name'] = '项目'
291
-                obj['name'] = tempPatientsTwo[d].name
292
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
293
-                this.tableData.push(obj)
294
-
295
-                obj2['sum'] = 0
296
-                obj2['price'] = price2
297
-                obj2['item_name'] = '药品'
298
-                obj2['name'] = tempPatientsTwo[d].name
299
-                obj2['patient_id'] = tempPatientsTwo[d].patient_id
300
-                this.tableData.push(obj2)
301
-
302
-                obj3['sum'] = 0
303
-                obj3['price'] = price3
304
-                obj3['item_name'] = '耗材'
305
-                obj3['name'] = tempPatientsTwo[d].name
306
-                obj3['patient_id'] = tempPatientsTwo[d].patient_id
307
-                this.tableData.push(obj3)
308
-                break
309
-              case 1:
310
-                obj2['sum'] = price2
311
-                obj2['price'] = price2
312
-                obj2['item_name'] = '药品'
313
-                obj2['name'] = tempPatientsTwo[d].name
314
-                obj2['patient_id'] = tempPatientsTwo[d].patient_id
315
-                this.tableData.push(obj2)
316
-                break
317
-              case 2:
318
-
319
-                obj['sum'] = price
320
-                obj['price'] = price
321
-                obj['item_name'] = '项目'
322
-                obj['name'] = tempPatientsTwo[d].name
323
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
324
-                this.tableData.push(obj)
325
-                break
326
-              case 3:
327
-                obj3['sum'] = price3
328
-                obj3['price'] = price3
329
-                obj3['item_name'] = '耗材'
330
-                obj3['name'] = tempPatientsTwo[d].name
331
-                obj3['patient_id'] = tempPatientsTwo[d].patient_id
332
-                this.tableData.push(obj3)
333
-                break
334
-              case 4:
335
-
336
-                obj['sum'] = price
337
-                obj['price'] = price
338
-                obj['item_name'] = '检验'
339
-                obj['name'] = tempPatientsTwo[d].name
340
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
341
-                this.tableData.push(obj)
342
-                break
343
-              case 5:
344
-
345
-                obj['sum'] = price
346
-                obj['price'] = price
347
-                obj['item_name'] = '治疗'
348
-                obj['name'] = tempPatientsTwo[d].name
349
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
350
-                this.tableData.push(obj)
351
-                break
352
-              case 6:
353
-
354
-                obj['sum'] = price
355
-                obj['price'] = price
356
-                obj['item_name'] = '护理'
357
-                obj['name'] = tempPatientsTwo[d].name
358
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
359
-                this.tableData.push(obj)
360
-                break
361
-              case 7:
362
-
363
-                obj['sum'] = price
364
-                obj['price'] = price
365
-                obj['item_name'] = '其他'
366
-                obj['name'] = tempPatientsTwo[d].name
367
-                obj['patient_id'] = tempPatientsTwo[d].patient_id
368
-                this.tableData.push(obj)
369
-                break
370
-
371
-            }
372
-
373
-
374
-
375
-          }
376
-
377
-          this.handleSpanTempArr()
378
-          // this.tableData = tempPatientsTwo
379
-
380
-          // console.log(tempPatientsTwo.length)
381
-          //
257
+          this.setMonthPrescription(tempData)
382 258
 
383 259
         }
384
-        //
385
-        // console.log('去重前')
386
-        // console.log(advice)
387
-        // console.log(project)
388
-        // //
389
-        // //
390
-
391
-        // //
392
-        // console.log('去重后')
393
-        //
394
-        // console.log(advice.length)
395
-        // console.log(project.length)
396
-        //
397
-        // for (let i = 0; i < project.length; i++) {
398
-        //   let obj = {}
399
-        //   let count = 0
400
-        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
401
-        //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
402
-        //       count = count + tempPatientsTwo[a].count
403
-        //       obj['count'] = count
404
-        //
405
-        //     }
406
-        //     obj['price'] = project[i].price
407
-        //     obj['type'] = project[i].type
408
-        //     obj['item_name'] = project[i].item_name
409
-        //     obj['item_id'] = project[i].item_id
410
-        //     obj['name'] = project[i].name
411
-        //     obj['patient_id'] = project[i].patient_id
412
-        //     obj['count'] = count
413
-        //     this.tableData.push(obj)
414
-        //   }
415
-        // }
416
-        //
417
-        //
418
-        // for (let i = 0; i < advice.length; i++) {
419
-        //   let obj = {}
420
-        //   let count = 0
421
-        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
422
-        //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
423
-        //       count = count + tempPatientsTwo[a].count
424
-        //       obj['count'] = count
425
-        //
426
-        //     }
427
-        //     obj['price'] = advice[i].price
428
-        //     obj['type'] = advice[i].type
429
-        //     obj['item_name'] = advice[i].item_name
430
-        //     obj['item_id'] = advice[i].item_id
431
-        //     obj['name'] = advice[i].name
432
-        //     obj['patient_id'] = advice[i].patient_id
433
-        //     this.tableData.push(obj)
434
-        //   }
435
-        // }
436
-        // console.log(this.tableData.length)
437
-        // this.tableData = this.sort(this.tableData)
438 260
 
439 261
       })
440 262
     }, uniqueProjectAndAdvice(array) {
@@ -517,7 +339,7 @@ export default {
517 339
         }
518 340
         console.log(data)
519 341
         const values = data.map(item => Number(item[column.property]))
520
-        if (column.property === 'sum') {
342
+        if (column.property === 'settle' || column.property === 'un_settle') {
521 343
           sums[index] = values.reduce((prev, curr) => {
522 344
             const value = Number(curr)
523 345
             if (!isNaN(value)) {
@@ -538,17 +360,17 @@ export default {
538 360
       let list = []
539 361
       for (let i = 0; i < this.tableData.length; i++) {
540 362
         let order = this.tableData[i]
541
-        let name = order.name
542
-        let item_name = order.item_name
543
-        let pay_sumamt = order.price.toFixed(2)
544
-        let total = order.sum.toFixed(2)
363
+        // let name = order.name
364
+        // let item_name = order.item_name
365
+        // let pay_sumamt = order.price.toFixed(2)
366
+        // let total = order.sum.toFixed(2)
545 367
 
546 368
 
547 369
         let obj = {
548
-          '患者姓名': name,
549
-          '项目类别': item_name,
550
-          '费用': pay_sumamt,
551
-          '费用总额':total,
370
+          '患者姓名': "",
371
+          '项目类别': "",
372
+          '费用': "",
373
+          '费用总额':"",
552 374
         }
553 375
         list.push(obj)
554 376
       }
@@ -566,9 +388,186 @@ export default {
566 388
 
567 389
     }, formatJson(filterVal, jsonData) {
568 390
       return jsonData.map(v => filterVal.map(j => v[j]))
569
-    }
391
+
392
+    }, setMonthPrescription(prescriptions) {
393
+
394
+      for (let a = 0; a < prescriptions.length; a++) {
395
+        if(prescriptions[a].order_status == 4){
396
+          prescriptions[a].order_status = 1
397
+        }
398
+      }
399
+
400
+        var advices = []
401
+      var projects = []
402
+      var goods = []
403
+      var ad_ids = []
404
+      var pro_ids = []
405
+      var gd_ids = []
406
+
407
+
408
+      for (let a = 0; a < prescriptions.length; a++) {
409
+        if(prescriptions[a].p_type == 1){
410
+          advices.push(prescriptions[a])
411
+          let obj = {
412
+            item_id:prescriptions[a].item_id,
413
+            price:prescriptions[a].pric,
414
+            med_type:prescriptions[a].med_type,
415
+            order_status:prescriptions[a].order_status,
416
+
417
+          }
418
+          ad_ids.push(obj)
419
+        }
420
+
421
+        if(prescriptions[a].p_type == 2){
422
+          projects.push(prescriptions[a])
423
+          let obj = {
424
+            item_id:prescriptions[a].item_id,
425
+            price:prescriptions[a].pric,
426
+            med_type:prescriptions[a].med_type,
427
+            order_status:prescriptions[a].order_status,
428
+
429
+          }
430
+          pro_ids.push(obj)
431
+
432
+        }
433
+
434
+        if(prescriptions[a].p_type == 3){
435
+          goods.push(prescriptions[a])
436
+          let obj = {
437
+            item_id:prescriptions[a].item_id,
438
+            price:prescriptions[a].pric,
439
+            med_type:prescriptions[a].med_type,
440
+            order_status:prescriptions[a].order_status,
441
+
442
+
443
+          }
444
+          gd_ids.push(obj)
445
+        }
446
+      }
447
+
448
+      let drug_ids = this.unique_two(ad_ids)
449
+      let project_ids = this.unique_two(pro_ids)
450
+      let goods_ids = this.unique_two(gd_ids)
451
+
452
+      for (let i = 0; i < drug_ids.length; i++) {
453
+          let obj = {}
454
+          let count = 0
455
+          let total_settle = 0
456
+          let total_un_settle = 0
457
+
458
+          for (let a = 0; a < prescriptions.length; a++) {
459
+            if (drug_ids[i].price == prescriptions[a].pric && drug_ids[i].item_id == prescriptions[a].item_id &&drug_ids[i].med_type == prescriptions[a].med_type &&drug_ids[i].order_status == prescriptions[a].order_status) {
460
+              obj['item_cost_type'] = prescriptions[a].item_cost_type
461
+              obj['unit'] = prescriptions[a].unit
462
+              obj['med_type'] =  prescriptions[a].med_type
463
+              obj['type'] =  prescriptions[a].p_type
464
+
465
+              obj['item_name'] =prescriptions[a].item_name
466
+              obj['spec'] = prescriptions[a].spec
467
+              obj['unit'] = prescriptions[a].unit
468
+              obj['price'] = prescriptions[a].pric
469
+              count = count + prescriptions[a].cnt
470
+              if(prescriptions[a].order_status == 2){
471
+                total_settle = total_settle + (prescriptions[a].pric * prescriptions[a].cnt)
472
+              }else{
473
+                total_un_settle = total_un_settle + (prescriptions[a].pric * prescriptions[a].cnt)
474
+              }
475
+            }
476
+          }
477
+          obj['count'] = count
478
+          obj['total_settle'] = total_settle
479
+          obj['total_un_settle'] = total_un_settle
480
+          this.tableData.push(obj)
481
+        }
482
+
483
+      for (let i = 0; i < project_ids.length; i++) {
484
+        let obj = {}
485
+        let count = 0
486
+        let total_settle = 0
487
+        let total_un_settle = 0
488
+
489
+        for (let a = 0; a < prescriptions.length; a++) {
490
+          if (project_ids[i].price == prescriptions[a].pric && project_ids[i].item_id == prescriptions[a].item_id &&project_ids[i].med_type == prescriptions[a].med_type&&project_ids[i].order_status == prescriptions[a].order_status) {
491
+            obj['item_cost_type'] = prescriptions[a].item_cost_type
492
+            obj['unit'] = prescriptions[a].unit
493
+            obj['med_type'] =  prescriptions[a].med_type
494
+            obj['type'] =  prescriptions[a].p_type
495
+
496
+
497
+            obj['item_name'] =prescriptions[a].item_name
498
+            obj['spec'] = prescriptions[a].spec
499
+            obj['unit'] = prescriptions[a].unit
500
+            obj['price'] = prescriptions[a].pric
501
+            count = count + prescriptions[a].cnt
502
+            if(prescriptions[a].order_status == 2){
503
+              total_settle = total_settle + (prescriptions[a].pric * prescriptions[a].cnt)
504
+            }else{
505
+              total_un_settle = total_un_settle + (prescriptions[a].pric * prescriptions[a].cnt)
506
+            }
507
+          }
508
+        }
509
+        obj['count'] = count
510
+        obj['total_settle'] = total_settle
511
+        obj['total_un_settle'] = total_un_settle
512
+        this.tableData.push(obj)
513
+      }
514
+
515
+      for (let i = 0; i < goods_ids.length; i++) {
516
+        let obj = {}
517
+        let count = 0
518
+        let total_settle = 0
519
+        let total_un_settle = 0
520
+
521
+        for (let a = 0; a < prescriptions.length; a++) {
522
+          if (goods_ids[i].price == prescriptions[a].pric && goods_ids[i].item_id == prescriptions[a].item_id &&goods_ids[i].med_type == prescriptions[a].med_type&&goods_ids[i].order_status == prescriptions[a].order_status) {
523
+            obj['item_cost_type'] = prescriptions[a].item_cost_type
524
+            obj['unit'] = prescriptions[a].unit
525
+            obj['med_type'] =  prescriptions[a].med_type
526
+            obj['type'] =  prescriptions[a].p_type
527
+
528
+            obj['item_name'] =prescriptions[a].item_name
529
+            obj['spec'] = prescriptions[a].spec
530
+            obj['unit'] = prescriptions[a].unit
531
+            obj['price'] = prescriptions[a].pric
532
+            count = count + prescriptions[a].cnt
533
+            if(prescriptions[a].order_status == 2){
534
+              total_settle = total_settle + (prescriptions[a].pric * prescriptions[a].cnt)
535
+            }else{
536
+              total_un_settle = total_un_settle + (prescriptions[a].pric * prescriptions[a].cnt)
537
+            }
538
+          }
539
+        }
540
+        obj['count'] = count
541
+        obj['total_settle'] = total_settle
542
+        obj['total_un_settle'] = total_un_settle
543
+        this.tableData.push(obj)
544
+      }
545
+
546
+
547
+
548
+
549
+
550
+
551
+    },  unique_two(array) {
552
+      // res用来存储结果
553
+      var res = []
554
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
555
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
556
+          if (array[i].item_id === res[j].item_id && array[i].price === res[j].price && array[i].med_type === res[j].med_type && array[i].order_status === res[j].order_status) {
557
+            break
558
+          }
559
+        }
560
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
561
+        if (j === resLen) {
562
+          res.push(array[i])
563
+        }
564
+      }
565
+      return res
566
+    },
570 567
   },
571 568
   created() {
569
+    this.getInit()
570
+
572 571
     this.getSummaryDetailList()
573 572
 
574 573
   }

+ 10 - 2
src/xt_pages/stock/detail/stockOutDetail.vue Прегледај датотеку

@@ -896,11 +896,19 @@ export default {
896 896
           this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
897 897
         }else if(this.orgId == 10485){
898 898
           this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
899
+        }else if(this.orgId ==10138){
900
+          this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
901
+        }else if(this.orgId == 10278){
902
+          this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
903
+        }else if(this.orgId == 10610){
904
+          this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
905
+        }else if(this.orgId==10537){
906
+          this.tableOut[i].total_price = (this.getWarehouseOut(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
899 907
         }else{
900 908
           this.tableOut[i].total_price = (this.getStockCount(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
901 909
         }
902 910
 
903
-        if(this.orgId  == 10265 || this.orgId ==10215 || this.orgId == 9919 || this.orgId == 9671 || this.orgId == 10402){
911
+        if(this.orgId  == 10265 || this.orgId ==10215 || this.orgId == 9919 || this.orgId == 9671 || this.orgId == 10402 || this.orgId==10138 || this.orgId==10278||this.orgId==10537||this.orgId==10610||this.orgId==0){
904 912
 
905 913
          this.tableOut[i].out_count = this.getMySelfCount(this.tableOut[i].good_id)
906 914
         }
@@ -908,7 +916,7 @@ export default {
908 916
           this.tableOut[i].out_count = this.getWarehouseOut(this.tableOut[i].good_id)
909 917
          
910 918
         }
911
-        if(this.orgId!=10265 && this.orgId !=10215  && this.orgId != 9671 &&this.orgId!=10210&&this.orgId!=9675 && this.orgId!=9956&& this.orgId!=10217 && this.orgId!=10188 && this.orgId!=10191 && this.orgId!=9919 && this.orgId!=0&& this.orgId!=10402 && this.orgId != 10489 && this.orgId!=10375 && this.orgId!=10485){
919
+        if(this.orgId!=10265 && this.orgId !=10215  && this.orgId != 9671 &&this.orgId!=10210&&this.orgId!=9675 && this.orgId!=9956&& this.orgId!=10217 && this.orgId!=10188 && this.orgId!=10191 && this.orgId!=9919 && this.orgId!=0&& this.orgId!=10402 && this.orgId != 10489 && this.orgId!=10375 && this.orgId!=10485&&this.orgId!=0&&this.orgId!=10138&&this.orgId!=10278&&this.orgId!=10537&&this.orgId!=10610&&this.orgId==0){
912 920
           this.tableOut[i].out_count = this.getStockCount(this.tableOut[i].good_id)
913 921
         }
914 922
         this.tableOut[i].manufacturer_name = this.getManufacturerNameOne(this.tableOut[i].manufacturer)

+ 174 - 119
src/xt_pages/stock/selfPreparedMedicine/addWarehouseOut.vue Прегледај датотеку

@@ -27,14 +27,7 @@
27 27
         </div>
28 28
       </div>
29 29
       <div class="app-container" v-loading="loading">
30
-        <drugs-stock-dialog
31
-          ref="dialog"
32
-          :propForm="propForm"
33
-          :visibility="isVisibility"
34
-          v-on:dialog-comfirm="comfirm"
35
-          v-on:dialog-cancle="cancle"
36
-        ></drugs-stock-dialog>
37
-  
30
+       
38 31
         <div class="cell clearfix">
39 32
           <label class="title"
40 33
             ><span class="name"><span style="color: red">*</span>患者</span>
@@ -358,7 +351,7 @@
358 351
   import BreadCrumb from "../../components/bread-crumb";
359 352
   import { getDataConfig, getDictionaryDataConfig } from "@/utils/data";
360 353
   import { getAllDrugList, postSearchDrugList } from "@/api/data";
361
-    import { getallPatientList,postSearchSelfDrugList,postSelfDrugOutInfoWarehouse} from "@/api/drug/drug"
354
+    import { getallPatientList,postSearchSelfDrugList,postSelfDrugWarehouseOut,getSelfDrugBatchNumber} from "@/api/drug/drug"
362 355
   export default {
363 356
     components: { BreadCrumb },
364 357
     name: "stockIn",
@@ -766,126 +759,140 @@
766 759
         this.$router.go(-1);
767 760
       },
768 761
       submit() {
769
-        this.$refs["tableForm"].validate((valid) => {
770
-          if (valid) {
771
-            this.loading = true;
772
-            const array = this.recordInfo.recordData;
773
-            if (this.patient_id == 0) {
774
-              this.$message.error("患者不能为空!");
775
-              this.loading = false;
776
-              return false;
762
+      this.$refs["tableForm"].validate((valid) => {
763
+        if (valid) {
764
+          const array = this.recordInfo.recordData;
765
+          let total = 0;
766
+          for (let i = 0; i < array.length; i++) {
767
+            if (array[i].drug_id == 0) {
768
+              this.$message.error("药品名称或者药品规格名称不能为空");
769
+              return;
777 770
             }
771
+            total = total + array[i].price * array[i].return_count;
772
+          }
773
+          if (this.patient_id == 0) {
774
+            this.$message.error("患者不能为空!");
775
+            return false;
776
+          }
777
+          if (this.recordInfo.recordData.length <= 0) {
778
+            this.$message.success("请添加出库商品");
779
+            return;
780
+          }
781
+          for (let i = 0; i < this.recordInfo.recordData.length; i++) {
782
+            this.recordInfo.recordData[i].total_price = 0
783
+            this.recordInfo.recordData[i].price = 0
778 784
 
779
-            for (let i = 0; i < array.length; i++) {
780
-              if (array[i].drug_id == 0) {
781
-                this.$message.error("药品名称或者药品规格名称不能为空");
782
-                this.loading = false;
783
-                return;
785
+            for (let j = 0; j < this.manufacturerList.length; j++) {
786
+              if (this.recordInfo.recordData[i].manufacturer ==  this.manufacturerList[j].manufacturer_name) {
787
+                this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id;
784 788
               }
785 789
             }
786
-  
787
-            if (this.recordInfo.recordData.length <= 0) {
788
-              this.$message.success("请添加入库商品");
789
-              this.loading = false;
790
-              return;
791
-            }
792
-  
793
-            for (let i = 0; i < this.recordInfo.recordData.length; i++) {
794
-              if (this.recordInfo.recordData[i].dealer == "") {
790
+            if (this.recordInfo.recordData[i].dealer == "") {
795 791
                 this.recordInfo.recordData[i].dealer = 0;
792
+            }
793
+            for (let z = 0; z < this.dealerList.length; z++) {
794
+              if (this.recordInfo.recordData[i].dealer ==this.dealerList[z].dealer_name) {
795
+                this.recordInfo.recordData[i].dealer = this.dealerList[z].id;
796 796
               }
797
-              this.recordInfo.recordData[i].last_price =
798
-                this.recordInfo.recordData[i].last_price.toString();
799
-              this.recordInfo.recordData[i].retail_price =
800
-                this.recordInfo.recordData[i].retail_price.toString();
801
-              if (this.recordInfo.recordData[i].dealer == "") {
802
-                this.recordInfo.recordData[i].dealer = 0;
797
+            }
798
+
799
+            for (let y = 0; y < this.numberList.length; y++) {
800
+              if (this.recordInfo.recordData[i].batch_number ==this.numberList[y].id) {
801
+                this.recordInfo.recordData[i].batch_number = this.numberList[y].batch_number;
802
+                this.recordInfo.recordData[i].warehouse_info_id = this.numberList[y].id;
803 803
               }
804
-              for (let j = 0; j < this.manufacturerList.length; j++) {
805
-                if (
806
-                  this.recordInfo.recordData[i].manufacturer ==
807
-                  this.manufacturerList[j].manufacturer_name
808
-                ) {
809
-                  this.recordInfo.recordData[i].manufacturer =
810
-                    this.manufacturerList[j].id;
804
+            }
805
+            // for (let s = 0; s < this.doctorList.length; s++) {
806
+            //   if (this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name) {
807
+            //      this.recordInfo.recordData[i].admin_user_id = this.doctorList[s].admin_user_id;
808
+            //   }
809
+            // }
810
+
811
+            this.recordInfo.recordData[i].last_price = 0
812
+            this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString();
813
+          }
814
+          const params = {
815
+            stockOut: this.recordInfo.recordData,
816
+          };
817
+          console.log("param22222222",params)
818
+          const loading = this.$loading({
819
+            lock: true,
820
+            text: "Loading",
821
+            spinner: "el-icon-loading",
822
+            background: "rgba(0, 0, 0, 0.7)",
823
+          });
824
+          postSelfDrugWarehouseOut(
825
+            params,
826
+            this.warehouse_out_time,
827
+            this.form.dealer,
828
+            this.form.manufacturer,
829
+            this.type,
830
+            this.patient_id,
831
+            this.warehouse_out_id,
832
+          ).then((response) => {
833
+            if (response.data.state == 0) {
834
+              this.$message.error("库存不足");
835
+              loading.close();
836
+              return false;
837
+            } else {
838
+              this.loading = false;
839
+              loading.close();
840
+              var msg = response.data.data.msg;
841
+              var drug_name = response.data.data.drug_name;
842
+              var dose = response.data.data.dose;
843
+              var dose_unit = response.data.data.dose_unit;
844
+              var min_number = response.data.data.min_number;
845
+              var min_unit = response.data.data.min_unit;
846
+              var max_unit = response.data.data.max_unit;
847
+              var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
848
+              var warehousingOutInfo = response.data.data.warehousingOutInfo
849
+              var warehouseOut = response.data.data.warehouseOut
850
+              this.warehouse_out_id = warehouseOut.id
851
+              var dealerList = response.data.data.dealerList
852
+              var manufacturerList = response.data.data.manufacturerList
853
+              var drugTypeList = response.data.data.drugTypeList
854
+              for(let i=0;i<warehousingOutInfo.length;i++){
855
+                for(let j=0;j<dealerList.length;j++){
856
+                   if(warehousingOutInfo[i].dealer == dealerList[j].id){
857
+                      warehousingOutInfo[i].dealer = dealerList[j].dealer_name
858
+                   }   
811 859
                 }
812
-              }
813
-  
814
-              for (let z = 0; z < this.dealerList.length; z++) {
815
-                if (
816
-                  this.recordInfo.recordData[i].dealer ==
817
-                  this.dealerList[z].dealer_name
818
-                ) {
819
-                  this.recordInfo.recordData[i].dealer = this.dealerList[z].id;
860
+
861
+                for(let z=0;z<manufacturerList.length;z++){
862
+                  if(warehousingOutInfo[i].manufacturer == manufacturerList[z].id){
863
+                     warehousingOutInfo[i].manufacturer = manufacturerList[z].manufacturer_name
864
+                  }
865
+                }
866
+                warehousingOutInfo[i].drug_name = warehousingOutInfo[i].drug.drug_name
867
+                warehousingOutInfo[i].name = warehousingOutInfo[i].drug.dose + warehousingOutInfo[i].drug.dose_unit +"*"+warehousingOutInfo[i].drug.min_number +warehousingOutInfo[i].drug.min_unit+"/"+warehousingOutInfo[i].drug.max_unit
868
+                warehousingOutInfo[i].product_date = this.getTimeOne(warehousingOutInfo[i].product_date)
869
+                warehousingOutInfo[i].expiry_date =  this.getTimeOne(warehousingOutInfo[i].expiry_date)
870
+                warehousingOutInfo[i].last_price = warehousingOutInfo[i].price
871
+                warehousingOutInfo[i].max_unit = warehousingOutInfo[i].count_unit
872
+                warehousingOutInfo[i].count = warehousingOutInfo[i].count.toString()
873
+                warehousingOutInfo[i].patient_id = warehousingOutInfo[i].patient_id
874
+                for(let z=0;z<drugTypeList.length;z++){
875
+                   if(warehousingOutInfo[i].drug.drug_type == drugTypeList[z].value){
876
+                      warehousingOutInfo[i].drug_type = drugTypeList[z].name
877
+                   }
820 878
                 }
821 879
               }
822
-            }
823
-            const params = {
824
-              stockIn: this.recordInfo.recordData,
825
-            };
826
-  
827
-            postSelfDrugOutInfoWarehouse(
828
-              params,
829
-              this.warehousing_time,
830
-              this.patient_id,
831
-              this.warehouse_out_id,
832
-            ).then((response) => {
833
-              if (response.data.state == 0) {
834
-                this.loading = false;
835
-                this.$message.error(response.data.msg);
836
-                return false;
880
+              if (msg == 1) {
881
+                this.$message.error(str + "库存不足");
837 882
               } else {
838
-                this.loading = false;
883
+                loading.close();
839 884
                 this.$message.success("保存成功");
840
-                this.listLoading = false;
841
-                var info = response.data.data.info
842
-                this.warehousing_id = info.id
843
-                var list = response.data.data.list
844
-                var manufacturerList = response.data.data.manufacturerList
845
-                var dealerList = response.data.data.dealerList
846
-                var drugTypeList = response.data.data.drugTypeList
847
-                for(let i=0;i<list.length;i++){
848
-                  for(let j=0;j<manufacturerList.length;j++){
849
-                     if(list[i].manufacturer_id == manufacturerList[j].id){
850
-                        list[i].manufacturer_id = manufacturerList[j].manufacturer_name
851
-                     }
852
-                  }
853
-                  for(let s=0;s<dealerList.length;s++){
854
-                    if(list[i].dealer_id == dealerList[s].id){
855
-                       list[i].dealer_id = dealerList[s].manufacturer_name
856
-                    }
857
-                  }
858
-  
859
-                  list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
860
-                  list[i].product_date = this.getTimeOne(list[i].product_date)
861
-                  list[i].drug_name = list[i].drug.drug_name
862
-                  list[i].name = list[i].drug.dose + list[i].drug.dose_unit +"*"+list[i].drug.min_number +list[i].drug.min_unit+"/"+list[i].drug.max_unit
863
-                  for(let z=0;z<drugTypeList.length;z++){
864
-                     if(list[i].drug.drug_type == drugTypeList[z].value){
865
-                        list[i].drug_type = drugTypeList[z].name
866
-                     }
867
-                  }
868
-                  list[i].last_price = list[i].price
869
-                  list[i].warehousing_count = list[i].warehousing_count.toString()
870
-                  list[i].unitList = []
871
-                  var obj = {id:1,name:""}
872
-                  obj.name = list[i].drug.max_unit
873
-                  var objOne = {id:2,name:""}
874
-                  objOne.name = list[i].drug.min_unit
875
-                  list[i].unitList.push(obj)
876
-                  list[i].unitList.push(objOne)
877
-                }
878
-                this.recordInfo.recordData = []
879
-                this.recordInfo.recordData = list
885
+                this.recordInfo.recordData = [];
886
+                this.recordInfo.recordData = warehousingOutInfo
880 887
                 this.showCheck = true
881
-                this.showReturnCheck = false
882
-                // this.$router.back(-1);
888
+               
883 889
               }
884
-            });
885
-          } else {
886
-            return false;
887
-          }
888
-        });
890
+            }
891
+          });
892
+        } else {
893
+          return false;
894
+        }
895
+       });
889 896
       },
890 897
       changeManufacturer(val) {},
891 898
       changeDealer(val) {
@@ -970,6 +977,8 @@
970 977
         this.currentIndex = val;
971 978
       },
972 979
       handleSelect(val) {
980
+
981
+        
973 982
         var arr = [];
974 983
 
975 984
         for (let i = 0; i < this.recordInfo.recordData.length; i++) {
@@ -987,8 +996,7 @@
987 996
         var total_count = 0;
988 997
         for (let i = 0; i < val.drug_warehouse_info.length; i++) {
989 998
           if (val.max_unit == val.drug_warehouse_info[i].max_unit) {
990
-            val.drug_warehouse_info[i].stock_max_number =
991
-              val.drug_warehouse_info[i].stock_max_number * val.min_number;
999
+             val.drug_warehouse_info[i].stock_max_number = val.drug_warehouse_info[i].stock_max_number * val.min_number;
992 1000
           }
993 1001
         }
994 1002
 
@@ -1057,7 +1065,20 @@
1057 1065
           }
1058 1066
         }
1059 1067
       },
1060
-        querySearchAsync(keyword, cb) {
1068
+      getDrugBatchNumber(id) {
1069
+        var params = {
1070
+          id: id,
1071
+        };
1072
+        getSelfDrugBatchNumber(params).then((response) => {
1073
+          if (response.data.state == 1) {
1074
+            var list = response.data.data.list;
1075
+
1076
+            this.numberList = [];
1077
+            this.numberList = list;
1078
+          }
1079
+        });
1080
+       },
1081
+      querySearchAsync(keyword, cb) {
1061 1082
           let key = "";
1062 1083
           if (keyword != undefined) {
1063 1084
             key = keyword;
@@ -1099,7 +1120,41 @@
1099 1120
             }
1100 1121
           });
1101 1122
       },
1102
-  
1123
+      getWarehoseInfo(arr, max_unit, min_unit, min_number) {
1124
+        var total = 0;
1125
+        var max_str = "";
1126
+        var min_str = "";
1127
+        if (arr.length > 0) {
1128
+          for (let i = 0; i < arr.length; i++) {
1129
+            total += parseInt(arr[i].stock_max_number + arr[i].stock_min_number);
1130
+          }
1131
+        }
1132
+        if (total < min_number) {
1133
+          min_str = total + min_unit;
1134
+        }
1135
+        if (total == 0) {
1136
+          min_str = "";
1137
+          max_str = "";
1138
+        }
1139
+        if (total >= min_number) {
1140
+          if (parseInt(total / min_number) != 0) {
1141
+            max_str = parseInt(total / min_number) + max_unit;
1142
+          }
1143
+          if (total % min_number != 0) {
1144
+            min_str = (total % min_number) + min_unit;
1145
+          }
1146
+        }
1147
+        return max_str + min_str;
1148
+      },
1149
+      getWarehoseInfoTwo(arr) {
1150
+        var total = 0;
1151
+        if (arr.length > 0) {
1152
+          for (let i = 0; i < arr.length; i++) {
1153
+            total += parseInt(arr[i].stock_max_number + arr[i].stock_min_number);
1154
+          }
1155
+        }
1156
+        return total;
1157
+      },
1103 1158
     
1104 1159
     
1105 1160
     },