Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
1dffbbac76

+ 6 - 4
src/xt_pages/stock/detail/stockOutDetail.vue View File

744
       },
744
       },
745
 
745
 
746
     exportList(){
746
     exportList(){
747
+       console.log("哈哈哈",this.tableOut)
748
+      
747
        for(let i=0;i<this.tableOut.length;i++){
749
        for(let i=0;i<this.tableOut.length;i++){
748
         this.tableOut[i].index = i+1
750
         this.tableOut[i].index = i+1
749
         this.tableOut[i].good_name = this.tableOut[i].good_name
751
         this.tableOut[i].good_name = this.tableOut[i].good_name
750
         this.tableOut[i].specification_name = this.tableOut[i].specification_name
752
         this.tableOut[i].specification_name = this.tableOut[i].specification_name
751
         this.tableOut[i].packing_unit = this.tableOut[i].packing_unit
753
         this.tableOut[i].packing_unit = this.tableOut[i].packing_unit
752
-        if(this.orgId == 9919 || this.orgId == 9671){
754
+        if(this.orgId == 9919){
753
           this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].buy_price).toFixed(2)
755
           this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].buy_price).toFixed(2)
754
           this.tableOut[i].packing_price = this.tableOut[i].buy_price
756
           this.tableOut[i].packing_price = this.tableOut[i].buy_price
755
         }else{
757
         }else{
756
-          this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].packing_price).toFixed(2)
758
+          this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].retail_price).toFixed(2)
757
         }
759
         }
758
-      
759
         this.tableOut[i].out_count = this.getStockCount(this.tableOut[i].good_id)
760
         this.tableOut[i].out_count = this.getStockCount(this.tableOut[i].good_id)
760
        }
761
        }
761
        import('@/vendor/Export2Excel').then(excel => {
762
        import('@/vendor/Export2Excel').then(excel => {
786
           this.tableDataList[i].time = this.getTime(this.tableDataList[i].WarehouseOut.warehouse_out_time)
787
           this.tableDataList[i].time = this.getTime(this.tableDataList[i].WarehouseOut.warehouse_out_time)
787
           this.tableDataList[i].user_name = this.getXuserName(this.tableDataList[i].WarehouseOut.creater)
788
           this.tableDataList[i].user_name = this.getXuserName(this.tableDataList[i].WarehouseOut.creater)
788
           this.tableDataList[i].out_count = this.tableDataList[i].count
789
           this.tableDataList[i].out_count = this.tableDataList[i].count
789
-          if(this.orgId == 9919 || this.orgId == 9671){
790
+          if(this.orgId == 9919){
790
              this.tableDataList[i].total_price = (this.tableDataList[i].count * this.tableDataList[i].GoodInfo.buy_price).toFixed(2)
791
              this.tableDataList[i].total_price = (this.tableDataList[i].count * this.tableDataList[i].GoodInfo.buy_price).toFixed(2)
791
              total += this.tableDataList[i].count * this.tableDataList[i].buy_price
792
              total += this.tableDataList[i].count * this.tableDataList[i].buy_price
792
           }else{
793
           }else{
797
          
798
          
798
         }
799
         }
799
         obj.total_price = total.toFixed(2)
800
         obj.total_price = total.toFixed(2)
801
+      
800
         this.tableDataList.push(obj)
802
         this.tableDataList.push(obj)
801
        import('@/vendor/Export2Excel').then(excel => {
803
        import('@/vendor/Export2Excel').then(excel => {
802
        const tHeader = ['序号','单据编号', '耗材类型', '耗材名称','规格型号','操作时间','制单人','出货价','数量','总价']
804
        const tHeader = ['序号','单据编号', '耗材类型', '耗材名称','规格型号','操作时间','制单人','出货价','数量','总价']

+ 4 - 4
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

524
              this.tablePrint[i].total = this.getCountSenvenOne(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
524
              this.tablePrint[i].total = this.getCountSenvenOne(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
525
            }else{
525
            }else{
526
               this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
526
               this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
527
-              this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
527
+              this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
528
               this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
528
               this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
529
-              this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price) 
529
+              this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price) 
530
            }
530
            }
531
         }
531
         }
532
        console.log("列表数据333333333",this.tablePrint)
532
        console.log("列表数据333333333",this.tablePrint)
533
-      
533
+       
534
        import('@/vendor/Export2Excel').then(excel => {
534
        import('@/vendor/Export2Excel').then(excel => {
535
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
535
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
536
-       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','price','total_price','remark']
536
+       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
537
        let obj = {'index':'合计','total_price':0.00}
537
        let obj = {'index':'合计','total_price':0.00}
538
        for(let i=0;i<this.tablePrint.length;i++){
538
        for(let i=0;i<this.tablePrint.length;i++){
539
          obj.total_price += this.tablePrint[i].total
539
          obj.total_price += this.tablePrint[i].total

+ 6 - 1
src/xt_pages/supply/components/addPurchaseOrder.vue View File

805
       for (let i = 0; i < arr.length; i++) {
805
       for (let i = 0; i < arr.length; i++) {
806
         total_count += arr[i].stock_count;
806
         total_count += arr[i].stock_count;
807
       }
807
       }
808
-      return total_count;
808
+      if(total_count > 0){
809
+        return total_count;
810
+      }else{
811
+        return ""
812
+      }
813
+    
809
     },
814
     },
810
     calculate: function (val) {
815
     calculate: function (val) {
811
       if (isNaN(val)) {
816
       if (isNaN(val)) {

+ 13 - 2
src/xt_pages/supply/components/editGoodReturn.vue View File

1012
           if(msg == 2){
1012
           if(msg == 2){
1013
             var good_name = response.data.data.good_name
1013
             var good_name = response.data.data.good_name
1014
             var specification_name = response.data.data.specification_name
1014
             var specification_name = response.data.data.specification_name
1015
-            var str = good_name +"*" + specification_name +"无库存,请入库"
1016
-             this.$message.error(str)
1015
+            var str = good_name +"*" + specification_name +"库存不足"+"审核失败"
1016
+            this.$message.error(str)
1017
+
1018
+          }
1019
+          if(msg == 3){
1020
+              var drug_name =  response.data.data.drug_name
1021
+              var dose = response.data.data.dose
1022
+              var dose_unit = response.data.data.dose_unit
1023
+              var min_number = response.data.data.min_number
1024
+              var min_unit =  response.data.data.min_unit
1025
+              var max_unit =  response.data.data.max_unit
1026
+              var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
1027
+              this.$message.error(str + "库存不足")+"审核失败"
1017
           }
1028
           }
1018
           
1029
           
1019
         }
1030
         }