|
@@ -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 = {};
|