Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
d720a4f7b2

+ 3 - 7
src/views/layout/Layout.vue View File

@@ -17,15 +17,11 @@
17 17
           <p>透析管理</p>
18 18
         </div>
19 19
 
20
-
21
-
22
-        <!-- <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
+        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
23 21
           <i class="iconfont icon-kccx navIcon"></i>
24 22
           <p>采购管理</p>
25
-        </div> -->
26
-
27
-
28
-
23
+        </div>
24
+        
29 25
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
30 26
           <i class="iconfont icon-kccx navIcon"></i>
31 27
           <p>库房管理</p>

+ 1 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_six.vue View File

@@ -734,7 +734,7 @@
734 734
                               : "/"
735 735
                           }}
736 736
                         </div>
737
-                        ml
737
+                        L
738 738
                       </div>
739 739
                       <div class="inline_block" style="flex:1;">
740 740
                         干体重:

+ 10 - 3
src/xt_pages/dialysis/details/DialysisPrescription.vue View File

@@ -107,11 +107,18 @@
107 107
       </ul>
108 108
 
109 109
       <ul>
110
-        <li v-if="isShow('目标超滤量')">
110
+        <li v-if="isShow('目标超滤量') && this.$store.getters.xt_user.template_info.org_id != 10290">
111 111
           <label>目标超滤量 : </label>
112 112
           <span class="content">{{ target_ultrafiltration != "0" ? target_ultrafiltration : ""}}</span>
113
-          <span v-if="this.$store.getters.xt_user.template_info.template_id != 17 && this.$store.getters.xt_user.template_info.template_id != 9 && this.$store.getters.xt_user.template_info.template_id != 20 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 22 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 24 && this.$store.getters.xt_user.template_info.template_id != 26 && this.$store.getters.xt_user.template_info.template_id != 28 && this.$store.getters.xt_user.template_info.template_id != 27 && this.$store.getters.xt_user.template_info.template_id != 29 && this.$store.getters.xt_user.template_info.template_id != 30 && this.$store.getters.xt_user.template_info.template_id != 31 && this.$store.getters.xt_user.template_info.template_id != 32 && this.$store.getters.xt_user.template_info.template_id != 34 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 43 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.org_id != 9555 && this.$store.getters.xt_user.template_info.org_id != 9671"  class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
114
-          <span v-if="this.$store.getters.xt_user.template_info.template_id == 17 || this.$store.getters.xt_user.template_info.template_id == 9 || this.$store.getters.xt_user.template_info.template_id == 20 || this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 22 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 24 || this.$store.getters.xt_user.template_info.template_id == 26 || this.$store.getters.xt_user.template_info.template_id == 28 || this.$store.getters.xt_user.template_info.template_id == 27 || this.$store.getters.xt_user.template_info.template_id == 29 || this.$store.getters.xt_user.template_info.template_id == 30 || this.$store.getters.xt_user.template_info.template_id == 31 || this.$store.getters.xt_user.template_info.template_id == 32 || this.$store.getters.xt_user.template_info.template_id == 34 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.template_id != 40 || this.$store.getters.xt_user.template_info.template_id != 43 || this.$store.getters.xt_user.template_info.template_id != 45 || this.$store.getters.xt_user.template_info.org_id == 9555 || this.$store.getters.xt_user.template_info.org_id == 9671" class="unit">{{ target_ultrafiltration != "0" ? "ml" : "" }}</span>
113
+          
114
+          <span v-if="this.$store.getters.xt_user.template_info.template_id != 17 && this.$store.getters.xt_user.template_info.template_id != 9 && this.$store.getters.xt_user.template_info.template_id != 20 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 22 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 24 && this.$store.getters.xt_user.template_info.template_id != 26 && this.$store.getters.xt_user.template_info.template_id != 28 && this.$store.getters.xt_user.template_info.template_id != 27 && this.$store.getters.xt_user.template_info.template_id != 29 && this.$store.getters.xt_user.template_info.template_id != 30 && this.$store.getters.xt_user.template_info.template_id != 31 && this.$store.getters.xt_user.template_info.template_id != 32 && this.$store.getters.xt_user.template_info.template_id != 34 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 43 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.org_id != 9555"  class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
115
+          <span v-if="this.$store.getters.xt_user.template_info.template_id == 17 || this.$store.getters.xt_user.template_info.template_id == 9 || this.$store.getters.xt_user.template_info.template_id == 20 || this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 22 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 24 || this.$store.getters.xt_user.template_info.template_id == 26 || this.$store.getters.xt_user.template_info.template_id == 28 || this.$store.getters.xt_user.template_info.template_id == 27 || this.$store.getters.xt_user.template_info.template_id == 29 || this.$store.getters.xt_user.template_info.template_id == 30 || this.$store.getters.xt_user.template_info.template_id == 31 || this.$store.getters.xt_user.template_info.template_id == 32 || this.$store.getters.xt_user.template_info.template_id == 34 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.template_id != 40 || this.$store.getters.xt_user.template_info.template_id != 43 || this.$store.getters.xt_user.template_info.template_id != 45 || this.$store.getters.xt_user.template_info.org_id == 9555" class="unit">{{ target_ultrafiltration != "0" ? "ml" : "" }}</span>
116
+        </li>
117
+
118
+         <li v-if="isShow('目标超滤量') && this.$store.getters.xt_user.template_info.org_id == 10290">
119
+          <label>目标超滤量 : </label>
120
+          <span class="content">{{ target_ultrafiltration != "0" ? target_ultrafiltration : ""}}</span>
121
+          <span class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
115 122
         </li>
116 123
         <!-- <li v-if="isShow('葡萄糖')">
117 124
           <label>葡萄糖 : </label>

+ 2 - 0
src/xt_pages/dialysis/template/DialysisPrintOrderFortyTwo.vue View File

@@ -65,6 +65,8 @@
65 65
                   showValue='临时股静脉导管'></label-box>
66 66
               &nbsp;
67 67
               <label-box :isChecked="prescription.blood_access_part_opera_name ? prescription.blood_access_part_opera_name.indexOf('长期插管')>-1?true:false : false"
68
+                  showValue='长期插管'></label-box>
69
+              <label-box :isChecked="prescription.blood_access_part_opera_name ? prescription.blood_access_part_opera_name.indexOf('长期静脉导管')>-1?true:false : false"
68 70
                   showValue='长期静脉导管'></label-box>
69 71
               &nbsp;
70 72
             </td>

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue View File

@@ -407,7 +407,7 @@
407 407
                       <div class="under_line" style="width: 100px;text-align: center">
408 408
                         {{ prescription.target_ultrafiltration ? prescription.target_ultrafiltration : "/" }}
409 409
                       </div>
410
-                      L
410
+                     L
411 411
                     </div>
412 412
                     <div class="inline_block" style="flex:1;">
413 413
                       干体重:

+ 1 - 4
src/xt_pages/stock/stockInOrder.vue View File

@@ -1059,10 +1059,7 @@ export default {
1059 1059
       }
1060 1060
     },
1061 1061
     handleEdit: function(index, row) {
1062
-      // this.$router.push({
1063
-      //   name: "stockInDetail",
1064
-      //   query: { id: row.id, type: this.type }
1065
-      // });
1062
+      console.log("rowe232323232332",row)
1066 1063
       this.$router.push({path:"/stock/in/order/edit?id="+row.id})
1067 1064
     },
1068 1065
     handleDelete: function(index, row) {

+ 7 - 4
src/xt_pages/supply/components/addGoodOrder.vue View File

@@ -943,8 +943,9 @@ export default {
943 943
           this.loading = true;
944 944
           var warehousing_id = this.$route.query.id;
945 945
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
946
-        
947
-          if(this.tableDataList.length != this.recordInfo.tableList){
946
+          console.log("长度2332233232",this.tableDataList.length)
947
+          console.log("产股2333223232323",this.recordInfo.tableList)
948
+          if(this.tableDataList.length != this.recordInfo.tableList.length){
948 949
              warehousing_id = 0
949 950
              for(let i=0;i<this.recordInfo.tableList.length;i++){
950 951
               this.recordInfo.tableList[i].id = 0
@@ -1097,8 +1098,10 @@ export default {
1097 1098
     },
1098 1099
     checkGoodOrder() {
1099 1100
       var id = this.warese_out_id;
1100
-      var warehousing_id = this.warehousing_id;
1101
-      
1101
+      var warehousing_id = this.id;
1102
+      console.log("id23322332233223",id)
1103
+      console.log("checkGoodOrder23323",warehousing_id)
1104
+    
1102 1105
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1103 1106
         if (response.data.state == 1) {
1104 1107
           this.$message.success("审核成功!");

+ 112 - 4
src/xt_pages/supply/components/addPurchaseOrder.vue View File

@@ -76,13 +76,19 @@
76 76
             @click="checkPurchaseOrder"
77 77
             v-show="showOne">审核
78 78
          </el-button>
79
-
80
-         <!-- <el-button
79
+        
80
+        <el-button
81
+            size="small"
82
+            type="primary"
83
+            @click="toAdd"
84
+            v-if="is_check == 1">生成采购单
85
+         </el-button>
86
+         <el-button
81 87
             size="small"
82 88
             type="primary"
83 89
             @click="checkReturnOrder"
84 90
             v-if="is_check == 1">反审核
85
-         </el-button> -->
91
+         </el-button>
86 92
          
87 93
           <el-button
88 94
             size="small"
@@ -365,7 +371,8 @@ import {
365 371
   savePurchaseOrder,
366 372
   updatePurchaseOrder,
367 373
   checkPurchaseOrder,
368
-  getReturnOrder
374
+  getReturnOrder,
375
+  getAllOrderCountList
369 376
 } from "@/api/supply";
370 377
 import { getDataConfig } from "@/utils/data";
371 378
 export default {
@@ -857,6 +864,7 @@ export default {
857 864
             if (response.data.state == 1) {
858 865
               var info = response.data.data.info;
859 866
               this.is_check = info.is_check
867
+              this.showOne = false
860 868
               this.disabled = true;
861 869
               this.$message.success("审核成功!");
862 870
               this.Reviewed = true
@@ -894,6 +902,106 @@ export default {
894 902
         }
895 903
       });
896 904
     },
905
+     toAdd() {
906
+      if (this.is_check == 2) {
907
+        this.$message.error("该采购订单未审核,不能生成采购数据!");
908
+        return false;
909
+      }
910
+      //获取商品购货订单 和 购货单的总数量
911
+      getAllOrderCountList(this.id).then((response) => {
912
+        if (response.data.state == 1) {
913
+          var purcaseOrder = response.data.data.purcaseOrder;
914
+
915
+          var goodOrder = response.data.data.goodOrder;
916
+         
917
+          var drugList = response.data.data.drugList;
918
+      
919
+          var ids = "";
920
+          // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
921
+          if (goodOrder.length == 0) {
922
+            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
923
+          }
924
+          for (let i = 0; i < purcaseOrder.length; i++) {
925
+            for (let j = 0; j < drugList.length; j++) {
926
+              if (purcaseOrder[i].is_source == 1) {
927
+                if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
928
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
929
+                }
930
+              }
931
+            }
932
+          }
933
+
934
+          for (let i = 0; i < goodOrder.length; i++) {
935
+            for (let j = 0; j < drugList.length; j++) {
936
+              if (goodOrder[i].is_source == 1) {
937
+                if (goodOrder[i].supply_unit == drugList[j].max_unit) {
938
+                    goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
939
+                }
940
+              }
941
+            }
942
+          }
943
+
944
+          let objInfo = {};
945
+          if (goodOrder.length > 0) {
946
+            goodOrder.forEach((item, index) => {
947
+              let { project_id } = item;
948
+              if (!objInfo[project_id]) {
949
+                objInfo[project_id] = {
950
+                  project_id,
951
+                  child: [],
952
+                  count: 0,
953
+                };
954
+              }
955
+            });
956
+            let newArr = Object.values(objInfo);
957
+
958
+            for (let i = 0; i < goodOrder.length; i++) {
959
+              for (let j = 0; j < newArr.length; j++) {
960
+                if (goodOrder[i].project_id == newArr[j].project_id) {
961
+                  newArr[j].child.push(goodOrder[i]);
962
+                }
963
+              }
964
+            }
965
+     
966
+
967
+            for (let i = 0; i < newArr.length; i++) {
968
+              for (let j = 0; j < newArr[i].child.length; j++) {
969
+                newArr[i].count += newArr[i].child[j].count;
970
+              }
971
+            }
972
+
973
+            var arr = [];
974
+            var total = 0;
975
+            var str = "";
976
+
977
+            //如果采购单有数据,则需要比较数量
978
+            if (newArr.length > 0) {
979
+              for (let i = 0; i < purcaseOrder.length; i++) {
980
+                for (let j = 0; j < newArr.length; j++) {
981
+                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
982
+                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
983
+                    if (purcaseOrder[i].count > newArr[j].count) {
984
+                      arr.push(purcaseOrder[i].project_id);
985
+                    }
986
+                  }
987
+                }
988
+              }
989
+              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
990
+
991
+              if (arr.length == 0) {
992
+                this.$message.error("该订单已全部生成采购单,请知悉!");
993
+                return;
994
+              }
995
+
996
+              if (arr.length >0) {
997
+                str = arr.join(",");
998
+                this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + str});
999
+              }
1000
+            }
1001
+          }
1002
+        }
1003
+      });
1004
+    },
897 1005
   },
898 1006
 
899 1007
   created() {

+ 52 - 21
src/xt_pages/supply/components/editGoodOrder.vue View File

@@ -46,11 +46,8 @@
46 46
           <span>单据编码:{{ good_number }}</span>
47 47
         </div>
48 48
       
49
-          <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
50
-        <div style="display: flex;" >
51
-          <el-button size="small" type="primary" @click="updateGoodOrder"
52
-            >保存</el-button
53
-          >
49
+         <div style="display: flex;" >
50
+           <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
54 51
           <el-button
55 52
             size="small"
56 53
             type="primary"
@@ -478,9 +475,7 @@ export default {
478 475
       showOne: true,
479 476
       showTwo: false,
480 477
       showThree: false,
481
-      recordInfo: {
482
-        tableList: [],
483
-      },
478
+      recordInfo: {tableList: []},
484 479
       keywords: "",
485 480
       total: 0,
486 481
       multipleSelection: [],
@@ -700,6 +695,10 @@ export default {
700 695
       }
701 696
     },
702 697
     handleEdit() {
698
+      if (this.is_check == 1) {
699
+        this.$message.error("已审核的不能新增!");
700
+        return false;
701
+      }
703 702
       const tempObj = {};
704 703
       tempObj["id"] = 0;
705 704
       tempObj["name"] = "";
@@ -893,6 +892,7 @@ export default {
893 892
           var drugList = response.data.data.drugList;
894 893
           var goodList = response.data.data.goodList;
895 894
           for (let i = 0; i < orderInfo.length; i++) {
895
+            orderInfo[i].id = orderInfo[i].id
896 896
             orderInfo[i].supply_count = orderInfo[i].count;
897 897
             orderInfo[i].supply_price = orderInfo[i].price;
898 898
             orderInfo[i].supply_remake = orderInfo[i].remark;
@@ -900,9 +900,7 @@ export default {
900 900
             orderInfo[i].project_id = orderInfo[i].project_id;
901 901
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
902 902
             orderInfo[i].order_number = orderInfo[i].order_number;
903
-            orderInfo[i].supply_total_price = (
904
-              orderInfo[i].count * orderInfo[i].price
905
-            ).toFixed(2);
903
+            orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
906 904
             orderInfo[i].supply_expiry_date = this.getTimes(
907 905
               orderInfo[i].supply_expiry_date
908 906
             );
@@ -936,12 +934,42 @@ export default {
936 934
               }
937 935
             }
938 936
           }
937
+          if(orderInfo.length == 0){
938
+            const tempObj = {};
939
+            tempObj["id"] = 0;
940
+            tempObj["name"] = "";
941
+            tempObj["supply_name"] = "";
942
+            tempObj["supply_type"] = "";
943
+            tempObj["supply_specification_name"] = "";
944
+            tempObj["supply_total"] = "";
945
+            tempObj["supply_count"] = "";
946
+            tempObj["supply_price"] = "";
947
+            tempObj["supply_total_price"] = "";
948
+            tempObj["supply_manufacturer"] = "";
949
+            tempObj["supply_license_number"] = "";
950
+            tempObj["supply_remake"] = "";
951
+            tempObj["type"] = 0;
952
+            tempObj["is_total"] = 1;
953
+            tempObj["project_id"] = 0;
954
+            tempObj["supply_unit"] = "";
955
+            tempObj["supply_batch_number"] = "";
956
+            tempObj["supply_product_date"] = "";
957
+            tempObj["order_number"] = "";
958
+            tempObj["supply_expiry_date"] = "";
959
+            tempObj["manufacturer_id"] = "";
960
+            tempObj["warehouse_info_id"] = "";
961
+            tempObj["warehousing_id"] = "";
962
+            tempObj["number"] = "";
963
+            tempObj["good_number"] = "";
964
+            this.recordInfo.tableList = [];
965
+            this.recordInfo.tableList.push(tempObj);
966
+          }else{
967
+            this.recordInfo.tableList = [];
968
+            this.recordInfo.tableList = orderInfo;
969
+            this.tableDataList = []
939 970
 
940
-          this.recordInfo.tableList = [];
941
-          this.recordInfo.tableList = orderInfo;
942
-          this.tableDataList = []
943
-          this.tableDataList = orderInfo
944
-
971
+            this.tableDataList = orderInfo
972
+          }
945 973
         }
946 974
       });
947 975
     },
@@ -983,16 +1011,17 @@ export default {
983 1011
           }
984 1012
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
985 1013
 
986
-          if(this.tableDataList.length != this.recordInfo.tableList){
987
-             warehousing_id = 0
1014
+          if(this.tableDataList.length != this.recordInfo.tableList.length){
1015
+            
988 1016
              for(let i=0;i<this.recordInfo.tableList.length;i++){
989
-              this.recordInfo.tableList[i].id = 0
990
-              this.recordInfo.tableDataList[i].order_number = ""
1017
+              this.recordInfo.tableList[i].warehousing_id = 0
1018
+              this.recordInfo.tableList[i].warehouse_info_id = 0
1019
+              this.recordInfo.tableList[i].order_number = ""
991 1020
               this.number = ""
992 1021
              }
993 1022
           }
994 1023
           console.log("param23322332323",params)
995
-          return
1024
+         
996 1025
           updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then((response) => {
997 1026
             if (response.data.state == 1) {
998 1027
               this.loading = false;
@@ -1241,6 +1270,8 @@ export default {
1241 1270
           var msg = response.data.data.msg;
1242 1271
           if (msg == 1) {
1243 1272
             this.$message.success("反审核成功!");
1273
+            this.disabled = false
1274
+            this.Reviewed = false
1244 1275
             return
1245 1276
           }
1246 1277
           if (msg == 2) {

+ 4 - 0
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -599,6 +599,10 @@ export default {
599 599
       }
600 600
     },
601 601
     handleEdit() {
602
+      if (this.is_check == 1) {
603
+        this.$message.error("已审核的不能新增!");
604
+        return false;
605
+      }
602 606
       const tempObj = {};
603 607
       tempObj["id"] = 0;
604 608
       tempObj["name"] = "";

+ 24 - 1
src/xt_pages/supply/components/editPurchaseOrder.vue View File

@@ -894,7 +894,30 @@ export default {
894 894
           }
895 895
          
896 896
           this.recordInfo.tableList = [];
897
-          this.recordInfo.tableList = orderInfo;
897
+          if(orderInfo.length == 0){
898
+              const tempObj = {};
899
+              tempObj["id"] = 0;
900
+              tempObj["name"] = "";
901
+              tempObj["supply_name"] = "";
902
+              tempObj["supply_type"] = "";
903
+              tempObj["supply_specification_name"] = "";
904
+              tempObj["supply_total"] = "";
905
+              tempObj["supply_count"] = "";
906
+              tempObj["supply_price"] = "";
907
+              tempObj["supply_total_price"] = "";
908
+              tempObj["supply_manufacturer"] = "";
909
+              tempObj["supply_license_number"] = "";
910
+              tempObj["supply_remake"] = "";
911
+              tempObj["type"] = 0;
912
+              tempObj["is_total"] = 1;
913
+              tempObj["project_id"] = 0;
914
+              tempObj["supply_unit"] = "";
915
+              tempObj["manufacturer_id"] = "";
916
+              this.recordInfo.tableList.push(tempObj);
917
+          }else{
918
+            this.recordInfo.tableList = orderInfo;
919
+          }
920
+         
898 921
         }
899 922
       });
900 923
     },