Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 3 years ago
parent
commit
56cf8c22a4

+ 40 - 8
src/xt_pages/supply/components/addGoodReturn.vue View File

58
             v-show="showTwo"
58
             v-show="showTwo"
59
             >保存</el-button
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
         </div>
63
         </div>
66
       </div>
64
       </div>
67
 
65
 
374
   getGoodOrderDetail,
372
   getGoodOrderDetail,
375
   saveGoodReturnOrder,
373
   saveGoodReturnOrder,
376
   checkReturnOrder,
374
   checkReturnOrder,
377
-  updateGoodReturn
375
+  updateGoodReturn,
376
+  modefyReturnOrder
378
 } from "@/api/supply";
377
 } from "@/api/supply";
379
 export default {
378
 export default {
380
   name: "addPurchaseOrder",
379
   name: "addPurchaseOrder",
435
       dialogVisible: false,
434
       dialogVisible: false,
436
       return_remark: "",
435
       return_remark: "",
437
       warehouse_out_id:0,
436
       warehouse_out_id:0,
437
+      showThree:false,
438
+      tableDataList:[],
438
     };
439
     };
439
   },
440
   },
440
   watch: {
441
   watch: {
752
       getGoodOrderDetail(id).then((response) => {
753
       getGoodOrderDetail(id).then((response) => {
753
         if (response.data.state == 1) {
754
         if (response.data.state == 1) {
754
           var out = response.data.data.out;
755
           var out = response.data.data.out;
755
-          this.is_check = out.is_check;
756
           this.id = out.id;
756
           this.id = out.id;
757
           this.supplier_name = out.supplier_id;
757
           this.supplier_name = out.supplier_id;
758
           this.rate_of_concession = out.rate_of_concession;
758
           this.rate_of_concession = out.rate_of_concession;
811
 
811
 
812
           this.recordInfo.tableList = [];
812
           this.recordInfo.tableList = [];
813
           this.recordInfo.tableList = orderInfo;
813
           this.recordInfo.tableList = orderInfo;
814
+          this.tableDataList = []
815
+          this.tableDataList = orderInfo
814
         }
816
         }
815
       });
817
       });
816
     },
818
     },
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
            var params = {
861
            var params = {
848
             stockIn:this.recordInfo.tableList,
862
             stockIn:this.recordInfo.tableList,
849
             return_marke:this.return_remark,
863
             return_marke:this.return_remark,
850
            }
864
            }
851
            console.log("2323323232",params)
865
            console.log("2323323232",params)
852
-         
866
+           return 
853
            saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
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
              if(response.data.state == 1){
868
              if(response.data.state == 1){
855
                 this.loading = false
869
                 this.loading = false
856
                 this.showOne = false
870
                 this.showOne = false
857
                 this.showTwo = true
871
                 this.showTwo = true
872
+                this.is_check = 2
858
                 this.$message.success("保存成功!")
873
                 this.$message.success("保存成功!")
859
                 var warehouseCancel = response.data.data.warehouseCancel
874
                 var warehouseCancel = response.data.data.warehouseCancel
860
                 var out = response.data.data.cancelOrder
875
                 var out = response.data.data.cancelOrder
958
      checkReturnOrder(params).then(response=>{
973
      checkReturnOrder(params).then(response=>{
959
        if(response.data.state == 1){
974
        if(response.data.state == 1){
960
         this.loading = false
975
         this.loading = false
976
+        this.showThree = false
977
+        this.is_check = 1
961
         var msg = response.data.data.msg
978
         var msg = response.data.data.msg
962
         this.$message.success("保存成功!")
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
   created() {
1000
   created() {

+ 5 - 22
src/xt_pages/supply/components/editGoodReturn.vue View File

844
     count_arrearage() {
844
     count_arrearage() {
845
       this.payment = this.total_price - this.arrearage;
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
     getGoodReturnDetail() {
847
     getGoodReturnDetail() {
867
       var id = this.$route.query.id;
848
       var id = this.$route.query.id;
868
       getGoodReturnDetail(id).then((response) => {
849
       getGoodReturnDetail(id).then((response) => {
1008
          
989
          
1009
           if(msg == 1){
990
           if(msg == 1){
1010
            this.$message.success("审核成功!");
991
            this.$message.success("审核成功!");
992
+           this.is_check = 1
993
+           this.Reviewed = true
1011
           }
994
           }
1012
           if(msg == 2){
995
           if(msg == 2){
1013
             var good_name = response.data.data.good_name
996
             var good_name = response.data.data.good_name
1014
             var specification_name = response.data.data.specification_name
997
             var specification_name = response.data.data.specification_name
1015
-            var str = good_name +"*" + specification_name +"库存不足"+"审核失败"
998
+            var str = good_name +"*" + specification_name +"库存不足,审核失败!"
1016
             this.$message.error(str)
999
             this.$message.error(str)
1017
 
1000
 
1018
           }
1001
           }
1024
               var min_unit =  response.data.data.min_unit
1007
               var min_unit =  response.data.data.min_unit
1025
               var max_unit =  response.data.data.max_unit
1008
               var max_unit =  response.data.data.max_unit
1026
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
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
           this.loading = false;
1023
           this.loading = false;
1042
           var msg = response.data.data.msg;
1024
           var msg = response.data.data.msg;
1043
           this.$message.success("反审核成功!");
1025
           this.$message.success("反审核成功!");
1026
+          this.Reviewed = false
1044
         }
1027
         }
1045
       });
1028
       });
1046
     },
1029
     },

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

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