Bladeren bron

11月14日 库存扣减更新

XMLWAN 3 jaren geleden
bovenliggende
commit
d4687cfece

+ 40 - 8
src/xt_pages/supply/components/addGoodReturn.vue Bestand weergeven

@@ -58,10 +58,8 @@
58 58
             v-show="showTwo"
59 59
             >保存</el-button
60 60
           >
61
-          <el-button size="small" type="primary" @click="checkReturnOrder">审核</el-button>
62
-          <!-- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
63
-        <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
64
-        <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button> -->
61
+          <el-button size="small" type="primary" v-if="is_check == 2" @click="checkReturnOrder">审核</el-button>
62
+          <el-button size="small" type="primary" v-if="is_check == 1" @click="modefyReturnOrder">反审核</el-button> 
65 63
         </div>
66 64
       </div>
67 65
 
@@ -374,7 +372,8 @@ import {
374 372
   getGoodOrderDetail,
375 373
   saveGoodReturnOrder,
376 374
   checkReturnOrder,
377
-  updateGoodReturn
375
+  updateGoodReturn,
376
+  modefyReturnOrder
378 377
 } from "@/api/supply";
379 378
 export default {
380 379
   name: "addPurchaseOrder",
@@ -435,6 +434,8 @@ export default {
435 434
       dialogVisible: false,
436 435
       return_remark: "",
437 436
       warehouse_out_id:0,
437
+      showThree:false,
438
+      tableDataList:[],
438 439
     };
439 440
   },
440 441
   watch: {
@@ -752,7 +753,6 @@ export default {
752 753
       getGoodOrderDetail(id).then((response) => {
753 754
         if (response.data.state == 1) {
754 755
           var out = response.data.data.out;
755
-          this.is_check = out.is_check;
756 756
           this.id = out.id;
757 757
           this.supplier_name = out.supplier_id;
758 758
           this.rate_of_concession = out.rate_of_concession;
@@ -811,6 +811,8 @@ export default {
811 811
 
812 812
           this.recordInfo.tableList = [];
813 813
           this.recordInfo.tableList = orderInfo;
814
+          this.tableDataList = []
815
+          this.tableDataList = orderInfo
814 816
         }
815 817
       });
816 818
     },
@@ -844,17 +846,30 @@ export default {
844 846
 
845 847
             }
846 848
           } 
849
+           //判断是否在采购单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
850
+           if(this.recordInfo.tableList.length != this.tableDataList.length){
851
+             warehouse_out_id = 0
852
+             for(let i=0;i<this.recordInfo.tableList.length;i++){
853
+                this.recordInfo.tableList[i].id = 0
854
+                this.recordInfo.tableList[i].warehouse_info_id = 0
855
+                this.recordInfo.tableList[i].warehouse_out_id = 0
856
+                this.recordInfo.tableList[i].warehousing_id = 0
857
+                this.recordInfo.tableList[i].good_number = ""
858
+                 this.recordInfo.tableList[i].order_number = ""
859
+             }
860
+           }
847 861
            var params = {
848 862
             stockIn:this.recordInfo.tableList,
849 863
             return_marke:this.return_remark,
850 864
            }
851 865
            console.log("2323323232",params)
852
-         
866
+           return 
853 867
            saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
854 868
              if(response.data.state == 1){
855 869
                 this.loading = false
856 870
                 this.showOne = false
857 871
                 this.showTwo = true
872
+                this.is_check = 2
858 873
                 this.$message.success("保存成功!")
859 874
                 var warehouseCancel = response.data.data.warehouseCancel
860 875
                 var out = response.data.data.cancelOrder
@@ -958,11 +973,28 @@ export default {
958 973
      checkReturnOrder(params).then(response=>{
959 974
        if(response.data.state == 1){
960 975
         this.loading = false
976
+        this.showThree = false
977
+        this.is_check = 1
961 978
         var msg = response.data.data.msg
962 979
         this.$message.success("保存成功!")
963 980
        }
964 981
      })
965
-    }
982
+    },
983
+    modefyReturnOrder() {
984
+      this.loading = true;
985
+      var params = {
986
+        warehouse_out_id: this.warehouse_out_id,
987
+        id: this.id,
988
+      };
989
+      modefyReturnOrder(params).then((response) => {
990
+        if (response.data.state == 1) {
991
+          this.loading = false;
992
+          var msg = response.data.data.msg;
993
+          this.$message.success("反审核成功!");
994
+          this.is_check = 2
995
+        }
996
+      });
997
+    },
966 998
    
967 999
   },
968 1000
   created() {

+ 5 - 22
src/xt_pages/supply/components/editGoodReturn.vue Bestand weergeven

@@ -844,25 +844,6 @@ export default {
844 844
     count_arrearage() {
845 845
       this.payment = this.total_price - this.arrearage;
846 846
     },
847
-
848
-    checkPurchaseOrder(id, index) {
849
-      this.$confirm("是否审核?", {
850
-        confirmButtonText: "确 定",
851
-        cancelButtonText: "取 消",
852
-        type: "warning",
853
-      })
854
-        .then(() => {
855
-          checkPurchaseOrder(this.id).then((response) => {
856
-            if (response.data.state == 1) {
857
-              var info = response.data.data.info;
858
-              this.disabled = true;
859
-              this.$message.success("审核成功!");
860
-              this.getPurchaseOrderDetail();
861
-            }
862
-          });
863
-        })
864
-        .catch(() => {});
865
-    },
866 847
     getGoodReturnDetail() {
867 848
       var id = this.$route.query.id;
868 849
       getGoodReturnDetail(id).then((response) => {
@@ -1008,11 +989,13 @@ export default {
1008 989
          
1009 990
           if(msg == 1){
1010 991
            this.$message.success("审核成功!");
992
+           this.is_check = 1
993
+           this.Reviewed = true
1011 994
           }
1012 995
           if(msg == 2){
1013 996
             var good_name = response.data.data.good_name
1014 997
             var specification_name = response.data.data.specification_name
1015
-            var str = good_name +"*" + specification_name +"库存不足"+"审核失败"
998
+            var str = good_name +"*" + specification_name +"库存不足,审核失败!"
1016 999
             this.$message.error(str)
1017 1000
 
1018 1001
           }
@@ -1024,9 +1007,8 @@ export default {
1024 1007
               var min_unit =  response.data.data.min_unit
1025 1008
               var max_unit =  response.data.data.max_unit
1026 1009
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
1027
-              this.$message.error(str + "库存不足")+"审核失败"
1010
+              this.$message.error(str + "库存不足,审核失败!")
1028 1011
           }
1029
-          
1030 1012
         }
1031 1013
       });
1032 1014
     },
@@ -1041,6 +1023,7 @@ export default {
1041 1023
           this.loading = false;
1042 1024
           var msg = response.data.data.msg;
1043 1025
           this.$message.success("反审核成功!");
1026
+          this.Reviewed = false
1044 1027
         }
1045 1028
       });
1046 1029
     },

+ 1 - 1
src/xt_pages/supply/goodOrderQuery.vue Bestand weergeven

@@ -149,7 +149,7 @@
149 149
                 icon="el-icon-delete"
150 150
                 size="small"
151 151
                 type="danger"
152
-                @click="toDelete(scope.row)"
152
+                @click="toDelete(scope.row,scope.row.$index)"
153 153
               >删除
154 154
               </el-button>
155 155
           </template>