Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
5a8e14ea2c

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

@@ -749,6 +749,8 @@ export default {
749 749
       tempObj["supply_expiry_date"] = "";
750 750
       tempObj["manufacturer_id"] = "";
751 751
       tempObj["min_price"] = ""
752
+      tempObj["warehouse_info_id"] = 0
753
+      tempObj["warehousing_id"] = 0
752 754
       this.recordInfo.tableList.push(tempObj);
753 755
     },
754 756
     handleDelete: function (index, row) {
@@ -1021,6 +1023,8 @@ export default {
1021 1023
                 orderInfo[i].project_id = orderInfo[i].project_id;
1022 1024
                 orderInfo[i].supply_unit = orderInfo[i].supply_unit;
1023 1025
                 orderInfo[i].order_number = orderInfo[i].order_number;
1026
+                orderInfo[i].warehouse_info_id = orderInfo[i].warehouse_info_id
1027
+                orderInfo[i].warehousing_id = orderInfo[i].warehousing_id
1024 1028
                 orderInfo[i].supply_total_price = (
1025 1029
                   orderInfo[i].count * orderInfo[i].price
1026 1030
                 ).toFixed(2);
@@ -1103,7 +1107,7 @@ export default {
1103 1107
             stockIn: this.recordInfo.tableList,
1104 1108
             return_remake: this.return_remake,
1105 1109
           };
1106
-         
1110
+          console.log("param232332",params)
1107 1111
           updateGoodOrder(
1108 1112
             params,
1109 1113
             this.supplier_name,
@@ -1498,6 +1502,8 @@ export default {
1498 1502
     tempObj["supply_expiry_date"] = "";
1499 1503
     tempObj["manufacturer_id"] = "";
1500 1504
     tempObj["min_price"] = ""
1505
+    tempObj["warehouse_info_id"] = 0
1506
+    tempObj["warehousing_id"] = 0
1501 1507
     this.recordInfo.tableList.push(tempObj);
1502 1508
     this.getInitOrder();
1503 1509
     if (parseInt(this.$route.query.id) > 0) {

+ 1 - 0
src/xt_pages/supply/components/editGoodOrder.vue View File

@@ -1106,6 +1106,7 @@ export default {
1106 1106
             if (response.data.state == 1) {
1107 1107
               this.loading = false;
1108 1108
               this.$message.success("保存成功!");
1109
+              this.getGoodOrderDetail()
1109 1110
             }
1110 1111
           });
1111 1112
         }

+ 11 - 1
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -1005,7 +1005,17 @@ export default {
1005 1005
         if (response.data.state == 1) {
1006 1006
           this.loading = false;
1007 1007
           var msg = response.data.data.msg;
1008
-          this.$message.success("审核成功!");
1008
+         
1009
+          if(msg == 1){
1010
+           this.$message.success("审核成功!");
1011
+          }
1012
+          if(msg == 2){
1013
+            var good_name = response.data.data.good_name
1014
+            var specification_name = response.data.data.specification_name
1015
+            var str = good_name +"*" + specification_name +"无库存,请入库"
1016
+             this.$message.error(str)
1017
+          }
1018
+          
1009 1019
         }
1010 1020
       });
1011 1021
     },

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

@@ -787,6 +787,7 @@ export default {
787 787
               this.loading = false;
788 788
               var warehousingInfo = response.data.data.warehousingInfo;
789 789
               this.$message.success("保存成功!");
790
+              this.getPurchaseOrderDetail()
790 791
             }
791 792
           });
792 793
         }

+ 1 - 1
src/xt_pages/supply/goodOrderQuery.vue View File

@@ -330,7 +330,7 @@ export default {
330 330
        }
331 331
        if(all_price >0){
332 332
 
333
-         return (all_price - all_price * (paycount/100)).toFixed(2)
333
+         return (all_price - paycount).toFixed(2)
334 334
        }
335 335
       
336 336
      },

+ 13 - 1
src/xt_pages/supply/goodreturn.vue View File

@@ -110,7 +110,7 @@
110 110
         </el-table-column>
111 111
         <el-table-column label="优惠后金额" align="center" width="200">
112 112
          <template slot-scope="scope">
113
-          <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPrice(scope.row.cancelOrder) - scope.row.discount_amount}}</span> 
113
+          <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPriceOne(scope.row.cancelOrder,scope.row.discount_amount)}}</span> 
114 114
          </template>
115 115
        </el-table-column>
116 116
         <!-- <el-table-column label="已退款" align="center" width="200">
@@ -311,8 +311,20 @@ export default {
311 311
             buy_price += (arr[i].count * arr[i].price)
312 312
           }
313 313
        }
314
+
314 315
        return buy_price.toFixed(2)
315 316
      },
317
+     getAllBuyPriceOne(arr,discount_amount){
318
+      
319
+       var buy_price = 0
320
+       if(arr!=undefined && arr.length > 0){
321
+          for(let i=0;i<arr.length;i++){
322
+            buy_price += (parseInt(arr[i].count) * arr[i].price)
323
+          }
324
+       }
325
+        console.log("discount233232232323",discount_amount)
326
+       return (buy_price-discount_amount).toFixed(2)
327
+     },
316 328
      getAllCount(arr){
317 329
        var count = ""
318 330
         if(arr!=undefined && arr.length > 0){