28169 hace 10 meses
padre
commit
5e7aafd801

+ 9 - 0
src/api/drug/drug.js Ver fichero

@@ -773,4 +773,13 @@ export function getSelfDrugBatchNumber(params){
773 773
     method:"get",
774 774
     params:params
775 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
+   })
776 785
 }

+ 31 - 1
src/store/modules/globalConfig.js Ver fichero

@@ -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: {

+ 3 - 3
src/xt_pages/data/basicConfig.vue Ver fichero

@@ -50,13 +50,13 @@
50 50
                 <el-switch v-model="drug_settle_open" @change="changeSettleOpen"></el-switch>
51 51
             </p> -->
52 52
 
53
-            <p style="margin-top:20px;">药品在保存处方时同步到自备库:
53
+            <!-- <p style="margin-top:20px;">药品在保存处方时同步到自备库:
54 54
                <el-switch v-model="self_prescription_out_open" @change="changeSelfPrescriptionOpen"></el-switch>
55 55
             </p>
56 56
 
57 57
             <p style="margin-top:20px;">药品在执行时自备药出库:
58 58
                <el-switch v-model="self_drug_out_open" @change="changeSelfPrescriptionOutOpen"></el-switch>
59
-            </p>
59
+            </p> -->
60 60
         </div>
61 61
 
62 62
 
@@ -544,7 +544,7 @@ export default {
544 544
     // this.getOrderConfig()
545 545
     this.getDataPrintList()
546 546
 
547
-    this.getSelfPrintList()
547
+    // this.getSelfPrintList()
548 548
   }
549 549
 };
550 550
 </script>

+ 226 - 1
src/xt_pages/data/prescription.vue Ver fichero

@@ -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 Ver fichero

@@ -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>

+ 1 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_sixtyeight.vue Ver fichero

@@ -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 Ver fichero

@@ -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>

+ 2 - 2
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue Ver fichero

@@ -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"

+ 2 - 2
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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
                     >

+ 157 - 116
src/xt_pages/stock/selfPreparedMedicine/addWarehouseOut.vue Ver fichero

@@ -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,getSelfDrugBatchNumber} 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) {
@@ -1113,7 +1120,41 @@
1113 1120
             }
1114 1121
           });
1115 1122
       },
1116
-  
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
+      },
1117 1158
     
1118 1159
     
1119 1160
     },