Kaynağa Gözat

11月14日 库存扣减更新

XMLWAN 3 yıl önce
ebeveyn
işleme
6013930b11

+ 4 - 11
src/components/Popup/index.vue Dosyayı Görüntüle

@@ -29,8 +29,7 @@
29 29
           </p>
30 30
           <div v-for="(item, index) in orderList" :key="index">
31 31
             <li>
32
-              购货单 {{ item.good_number }}
33
-              <router-link tag="span" to=""> </router-link>
32
+              购货单 {{ item.good_number}}<a @click="toClick(item.id)">点击查看</a>
34 33
             </li>
35 34
           </div>
36 35
         </div>
@@ -44,9 +43,6 @@
44 43
 </template>
45 44
 
46 45
 <script>
47
-import Vue from "vue";
48
-import router from "vue-router";
49
-Vue.use(router);
50 46
 export default {
51 47
   name: "Popup",
52 48
   data() {
@@ -57,19 +53,16 @@ export default {
57 53
       content: "",
58 54
       btnText: "关闭",
59 55
       orderList: [],
60
-      id: 0,
61 56
     };
62 57
   },
63 58
   created() {},
64 59
   methods: {
65 60
     btnClick() {
66
-      this.click1();
61
+      this.click();
67 62
       this.show = false;
68 63
     },
69
-    toClick_1(id) {
70
-      // this.toClick(id);
71
-      // return id;
72
-      console.log(this.router)
64
+    toClick(id) {
65
+      this.$router.push("/good/order/edit?id=" + id);
73 66
     },
74 67
   },
75 68
 };

+ 2 - 1
src/xt_pages/supply/components/Popup.vue Dosyayı Görüntüle

@@ -49,7 +49,8 @@ export default {
49 49
       this.show = false;
50 50
     },
51 51
     toClick_1(id) {
52
-      this.$router.push("/good/order/edit?id=" + id);
52
+
53
+      this.$router.push({path:"/good/order/edit?id=" + id});
53 54
     },
54 55
   },
55 56
 };

+ 72 - 223
src/xt_pages/supply/components/addGoodReturn.vue Dosyayı Görüntüle

@@ -64,7 +64,7 @@
64 64
             type="primary"
65 65
             @click="saveGoodReturn"
66 66
             v-show="showOne"
67
-            >存</el-button
67
+            >存</el-button
68 68
           >
69 69
           <el-button
70 70
             size="small"
@@ -778,62 +778,6 @@ export default {
778 778
         })
779 779
         .catch(() => {});
780 780
     },
781
-    getGoodOrderDetail(){
782
-
783
-        var id = this.$route.query.id
784
-        var ids = this.$route.query.ids
785
-      getGoodOrderDetail(id,ids).then(response=>{
786
-        if(response.data.state == 1){
787
-          var out = response.data.data.out
788
-          this.is_check = out.is_check
789
-          this.id = out.id
790
-          this.supplier_name = out.supplier_id
791
-          this.rate_of_concession = out.rate_of_concession
792
-          this.discount_amount = out.discount_amount
793
-          this.payment = out.payment
794
-          this.arrearage = out.arrearage
795
-          this.start_time = this.getTimes(out.document_date)
796
-          var orderInfo = response.data.data.list
797
-          console.log("orderINFO233232232332",orderInfo)
798
-          var drugList = response.data.data.drugList
799
-          var goodList = response.data.data.goodList
800
-          for(let i=0;i< orderInfo.length;i++){
801
-
802
-              orderInfo[i].supply_count =  orderInfo[i].count
803
-              orderInfo[i].supply_price =  orderInfo[i].price
804
-              orderInfo[i].supply_remake =  orderInfo[i].remark
805
-              orderInfo[i].type =  orderInfo[i].is_source
806
-              orderInfo[i].project_id =  orderInfo[i].project_id
807
-              orderInfo[i].supply_unit =  orderInfo[i].supply_unit
808
-              orderInfo[i].order_number =  orderInfo[i].order_number
809
-              orderInfo[i].good_number = orderInfo[i].good_number
810
-              orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
811
-              orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
812
-              orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
813
-            if(orderInfo[i].is_source == 1){
814
-              for(let j=0;j<drugList.length;j++){
815
-                  if( orderInfo[i].project_id == drugList[j].id){
816
-                    if(drugList[j].max_unit!=drugList[j].min_unit){
817
-                      orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
818
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
819
-                      orderInfo[i].unitList[1].name = drugList[j].min_unit
820
-                    }
821
-                    if(drugList[j].max_unit ==drugList[j].min_unit){
822
-                      orderInfo[i].unitList = [{id:1,name:""}]
823
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
824
-                    }
825
-
826
-                  }
827
-              }
828
-              }
829
-            if(orderInfo[i].is_source == 2){
830
-              for(let j=0;j<goodList.length;j++){
831
-                  if(orderInfo[i].project_id == goodList[j].id){
832
-                      orderInfo[i].unitList = [{id:1,name:""}]
833
-                      orderInfo[i].unitList[0].name = goodList[j].packing_unit
834
-                  }
835
-              }
836
-            }
837 781
     getGoodOrderDetail() {
838 782
       var id = this.$route.query.id;
839 783
       getGoodOrderDetail(id).then((response) => {
@@ -906,185 +850,90 @@ export default {
906 850
       var id = this.$route.query.id;
907 851
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
908 852
     },
909
-    saveGoodReturn() {
910
-      var warehouse_out_id = this.$route.query.id;
911
-      this.$refs["tableForm"].validate((valid) => {
912
-        if (valid) {
913
-          this.loading = true;
914
-          for (let i = 0; i < this.recordInfo.tableList.length; i++) {
915
-            this.recordInfo.tableList[i].supply_count = parseInt(
916
-              this.recordInfo.tableList[i].supply_count
917
-            );
918
-            this.recordInfo.tableList[i].supply_price =
919
-              this.recordInfo.tableList[i].supply_price.toString();
920
-            this.recordInfo.tableList[i].supply_total =
921
-              this.recordInfo.tableList[i].supply_total.toString();
922
-
853
+    saveGoodReturnOrder(){
854
+      var warehouse_out_id = this.$route.query.id
855
+      this.$refs["tableForm"].validate((valid)=>{
856
+        if(valid){
857
+          this.loading = true
858
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
859
+             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
860
+            this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
861
+            this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
923 862
             for (let j = 0; j < this.manufactuerList.length; j++) {
924
-              if (
925
-                this.recordInfo.tableList[i].supply_manufacturer ==
926
-                this.manufactuerList[j].manufacturer_name
927
-              ) {
928
-                this.recordInfo.tableList[i].manufacturer_id =
929
-                  this.manufactuerList[j].id;
863
+              if (this.recordInfo.tableList[i].supply_manufacturer ==this.manufactuerList[j].manufacturer_name) {
864
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id;
930 865
               }
931
-              if (
932
-                this.recordInfo.tableList[i].supply_manufacturer ==
933
-                this.manufactuerList[j].id
934
-              ) {
935
-                this.recordInfo.tableList[i].supply_manufacturer =
936
-                  this.manufactuerList[j].manufacturer_name;
866
+              if (this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id) {
867
+                this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name;
937 868
               }
938 869
             }
939
-          }
940
-          var params = {
870
+           var params = {
941 871
             stockIn:this.recordInfo.tableList,
942 872
             return_marke:this.return_remark,
943
-          }
944
-          console.log("start_time232233232",this.start_time)
873
+           }
874
+           saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
875
+             if(response.data.state == 1){
876
+                this.loading = false
877
+                this.showOne = false
878
+                this.showTwo = true
879
+                this.$message.success("保存成功!")
880
+                var warehouseCancel = response.data.data.warehouseCancel
881
+                var out = response.data.data.cancelOrder
882
+                this.id = out.id
883
+                this.supplier_name = out.supplier_id
884
+                this.rate_of_concession = out.rate_of_concession
885
+                this.discount_amount = out.discount_amount
886
+                this.payment = out.payment
887
+                this.arrearage = out.arrearage
888
+                this.start_time = this.getTimes(out.document_date)
889
+                var orderInfo = response.data.data.list
890
+                for(let i=0;i< orderInfo.length;i++){
891
+                   orderInfo[i].supply_count =  orderInfo[i].count
892
+                  orderInfo[i].supply_price =  orderInfo[i].price
893
+                  orderInfo[i].supply_remake =  orderInfo[i].remark
894
+                  orderInfo[i].type =  orderInfo[i].is_source
895
+                  orderInfo[i].project_id =  orderInfo[i].project_id
896
+                  orderInfo[i].supply_unit =  orderInfo[i].supply_unit
897
+                  orderInfo[i].order_number =  orderInfo[i].order_number
898
+                  orderInfo[i].good_number = orderInfo[i].good_number
899
+                  orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
900
+                  orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
901
+                  orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
902
+                   if(orderInfo[i].is_source == 1){
903
+                     for(let j=0;j<this.drugList.length;j++){
904
+                        if(orderInfo[i].project_id == this.drugList[j].id){
905
+                           if(this.drugList[j].max_unit!=this.drugList[j].min_unit){
906
+                              orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
907
+                              orderInfo[i].unitList[0].name = this.drugList[j].max_unit
908
+                              orderInfo[i].unitList[1].name = this.drugList[j].min_unit
909
+                           }
945 910
 
946
-          saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
947
-            if(response.data.state == 1){
948
-               this.loading = false
949
-               this.showOne = false
950
-               this.showTwo = true
951
-               this.$message.success("保存成功!")
952
-               var warehouseCancel = response.data.data.warehouseCancel
953
-               var out = response.data.data.cancelOrder
954
-               this.id = out.id
955
-               this.supplier_name = out.supplier_id
956
-               this.rate_of_concession = out.rate_of_concession
957
-               this.discount_amount = out.discount_amount
958
-               this.payment = out.payment
959
-               this.arrearage = out.arrearage
960
-               this.start_time = this.getTimes(out.document_date)
961
-               var orderInfo = response.data.data.list
962
-               for(let i=0;i< orderInfo.length;i++){
963
-                orderInfo[i].supply_count =  orderInfo[i].count
964
-                orderInfo[i].supply_price =  orderInfo[i].price
965
-                orderInfo[i].supply_remake =  orderInfo[i].remark
966
-                orderInfo[i].type =  orderInfo[i].is_source
967
-                orderInfo[i].project_id =  orderInfo[i].project_id
968
-                orderInfo[i].supply_unit =  orderInfo[i].supply_unit
969
-                orderInfo[i].order_number =  orderInfo[i].order_number
970
-                orderInfo[i].good_number = orderInfo[i].good_number
971
-                orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
972
-                orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
973
-                orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
974
-                if(orderInfo[i].is_source == 1){
975
-                  for(let j=0;j<this.drugList.length;j++){
976
-                      if( orderInfo[i].project_id == this.drugList[j].id){
977
-                        if(this.drugList[j].max_unit!=this.drugList[j].min_unit){
978
-                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
979
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
980
-                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
981
-                        }
982
-                        if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
983
-                          orderInfo[i].unitList = [{id:1,name:""}]
984
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
985
-                        }
911
+                           if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
912
+                            orderInfo[i].unitList = [{id:1,name:""}]
913
+                            orderInfo[i].unitList[0].name = this.drugList[j].max_unit
914
+                           }
986 915
 
987
-                      }
988
-                  }
989
-                  }
990
-                if(orderInfo[i].is_source == 2){
991
-                  for(let j=0;j<this.goodList.length;j++){
992
-                      if(orderInfo[i].project_id == this.goodList[j].id){
993
-                          orderInfo[i].unitList = [{id:1,name:""}]
994
-                          orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
995
-                      }
996
-                  }
997
-                }
998
-            stockIn: this.recordInfo.tableList,
999
-            return_marke: this.return_remark,
1000
-          };
1001
-          console.log("start_time232233232", this.start_time);
916
+                          
1002 917
 
1003
-          saveGoodReturnOrder(
1004
-            params,
1005
-            warehouse_out_id,
1006
-            this.start_time,
1007
-            this.rate_of_concession,
1008
-            this.discount_amount,
1009
-            this.arrearage,
1010
-            this.payment,
1011
-            this.supplier_name
1012
-          ).then((response) => {
1013
-            if (response.data.state == 1) {
1014
-              this.loading = false;
1015
-              this.showOne = false;
1016
-              this.showTwo = true;
1017
-              this.$message.success("保存成功!");
1018
-              var warehouseCancel = response.data.data.warehouseCancel;
1019
-              var out = response.data.data.cancelOrder;
1020
-              this.id = out.id;
1021
-              this.supplier_name = out.supplier_id;
1022
-              this.rate_of_concession = out.rate_of_concession;
1023
-              this.discount_amount = out.discount_amount;
1024
-              this.payment = out.payment;
1025
-              this.arrearage = out.arrearage;
1026
-              this.start_time = this.getTimes(out.document_date);
1027
-              var orderInfo = response.data.data.list;
1028
-              for (let i = 0; i < orderInfo.length; i++) {
1029
-                orderInfo[i].supply_count = orderInfo[i].count;
1030
-                orderInfo[i].supply_price = orderInfo[i].price;
1031
-                orderInfo[i].supply_remake = orderInfo[i].remark;
1032
-                orderInfo[i].type = orderInfo[i].is_source;
1033
-                orderInfo[i].project_id = orderInfo[i].project_id;
1034
-                orderInfo[i].supply_unit = orderInfo[i].supply_unit;
1035
-                orderInfo[i].order_number = orderInfo[i].order_number;
1036
-                orderInfo[i].good_number = orderInfo[i].good_number;
1037
-                orderInfo[i].supply_total_price = (
1038
-                  orderInfo[i].count * orderInfo[i].price
1039
-                ).toFixed(2);
1040
-                orderInfo[i].supply_expiry_date = this.getTimes(
1041
-                  orderInfo[i].supply_expiry_date
1042
-                );
1043
-                orderInfo[i].supply_product_date = this.getTimes(
1044
-                  orderInfo[i].supply_product_date
1045
-                );
1046
-                if (orderInfo[i].is_source == 1) {
1047
-                  for (let j = 0; j < this.drugList.length; j++) {
1048
-                    if (orderInfo[i].project_id == this.drugList[j].id) {
1049
-                      if (
1050
-                        this.drugList[j].max_unit != this.drugList[j].min_unit
1051
-                      ) {
1052
-                        orderInfo[i].unitList = [
1053
-                          { id: 1, name: "" },
1054
-                          { id: 2, name: "" },
1055
-                        ];
1056
-                        orderInfo[i].unitList[0].name =
1057
-                          this.drugList[j].max_unit;
1058
-                        orderInfo[i].unitList[1].name =
1059
-                          this.drugList[j].min_unit;
1060
-                      }
1061
-                      if (
1062
-                        this.drugList[j].max_unit == this.drugList[j].min_unit
1063
-                      ) {
1064
-                        orderInfo[i].unitList = [{ id: 1, name: "" }];
1065
-                        orderInfo[i].unitList[0].name =
1066
-                          this.drugList[j].max_unit;
1067
-                      }
1068
-                    }
1069
-                  }
1070
-                }
1071
-                if (orderInfo[i].is_source == 2) {
1072
-                  for (let j = 0; j < this.goodList.length; j++) {
1073
-                    if (orderInfo[i].project_id == this.goodList[j].id) {
1074
-                      orderInfo[i].unitList = [{ id: 1, name: "" }];
1075
-                      orderInfo[i].unitList[0].name =
1076
-                        this.goodList[j].packing_unit;
918
+                        }
919
+                     }
920
+                   }
921
+                  if(orderInfo[i].is_source == 2){
922
+                    for(let j=0;j<this.goodList.length;j++){
923
+                        if(orderInfo[i].project_id == this.goodList[j].id){
924
+                            orderInfo[i].unitList = [{id:1,name:""}]
925
+                            orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
926
+                        }
1077 927
                     }
1078 928
                   }
1079 929
                 }
1080
-              }
1081
-              this.recordInfo.tableList = [];
1082
-              this.recordInfo.tableList = orderInfo;
1083
-            }
1084
-          });
930
+             }
931
+           })
932
+          }
1085 933
         }
1086
-      });
1087
-    },
934
+      })
935
+    }
936
+   
1088 937
   },
1089 938
   created() {
1090 939
     const tempObj = {};