|
@@ -12,11 +12,11 @@
|
12
|
12
|
align-items: center;
|
13
|
13
|
"
|
14
|
14
|
>
|
15
|
|
- <div style="display:flex;align-items: center;">
|
|
15
|
+ <div style="display: flex; align-items: center">
|
16
|
16
|
<span style="color: red">*</span><span>供应商:</span>
|
17
|
17
|
<el-select
|
18
|
18
|
v-model="supplier_name"
|
19
|
|
- style="width: 140px; margin-right: 10px"
|
|
19
|
+ style="width: 220px; margin-right: 10px"
|
20
|
20
|
placeholder="请选择"
|
21
|
21
|
@change="changeTypeName"
|
22
|
22
|
:disabled="disabled"
|
|
@@ -60,7 +60,7 @@
|
60
|
60
|
></el-date-picker>
|
61
|
61
|
<span>单据编码:{{ number }}</span>
|
62
|
62
|
</div>
|
63
|
|
- <div style="display: flex;">
|
|
63
|
+ <div style="display: flex">
|
64
|
64
|
<el-button size="small" type="primary" @click="toAdd" v-show="showOne"
|
65
|
65
|
>生成采购单</el-button
|
66
|
66
|
>
|
|
@@ -348,6 +348,7 @@
|
348
|
348
|
v-model="discount_amount"
|
349
|
349
|
:disabled="disabled"
|
350
|
350
|
placeholder="请输入优惠金额"
|
|
351
|
+ @input="count_discount"
|
351
|
352
|
></el-input
|
352
|
353
|
></span>
|
353
|
354
|
</div>
|
|
@@ -367,12 +368,20 @@
|
367
|
368
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
368
|
369
|
</span>
|
369
|
370
|
</el-dialog> -->
|
370
|
|
- <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList" :type="type"></popup>
|
|
371
|
+ <popup
|
|
372
|
+ ref="Popup"
|
|
373
|
+ :content="content"
|
|
374
|
+ :content_1="content_1"
|
|
375
|
+ :content_2="content_2"
|
|
376
|
+ :number="number"
|
|
377
|
+ :orderList="orderList"
|
|
378
|
+ :type="type"
|
|
379
|
+ ></popup>
|
371
|
380
|
</div>
|
372
|
381
|
</template>
|
373
|
382
|
|
374
|
383
|
<script>
|
375
|
|
-import popup from "./Popup"
|
|
384
|
+import popup from "./Popup";
|
376
|
385
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
377
|
386
|
import { uParseTime } from "@/utils/tools";
|
378
|
387
|
import {
|
|
@@ -384,20 +393,20 @@ import {
|
384
|
393
|
getGoodOrderList,
|
385
|
394
|
getReturnOrder,
|
386
|
395
|
deletePurchaseOrder,
|
387
|
|
- deletePurchOder
|
|
396
|
+ deletePurchOder,
|
388
|
397
|
} from "@/api/supply";
|
389
|
398
|
export default {
|
390
|
399
|
name: "addPurchaseOrder",
|
391
|
400
|
components: {
|
392
|
401
|
BreadCrumb,
|
393
|
|
- popup
|
|
402
|
+ popup,
|
394
|
403
|
},
|
395
|
404
|
data() {
|
396
|
405
|
return {
|
397
|
|
- content_2:"采购单",
|
398
|
|
- content:"采购订单",
|
399
|
|
- content_1:"已有以下关联数据,不能反审核",
|
400
|
|
- type:1,
|
|
406
|
+ content_2: "采购单",
|
|
407
|
+ content: "采购订单",
|
|
408
|
+ content_1: "已有以下关联数据,不能反审核",
|
|
409
|
+ type: 1,
|
401
|
410
|
Reviewed: false,
|
402
|
411
|
crumbs: [
|
403
|
412
|
{ path: false, name: "采购订单" },
|
|
@@ -454,9 +463,16 @@ export default {
|
454
|
463
|
showThree: false,
|
455
|
464
|
orderList: [],
|
456
|
465
|
return_remark: "",
|
457
|
|
-
|
458
|
466
|
};
|
459
|
467
|
},
|
|
468
|
+
|
|
469
|
+ watch: {
|
|
470
|
+ total_price: function (newval, oldval) {
|
|
471
|
+ if (this.rate_of_concession != "") {
|
|
472
|
+ this.addressChange();
|
|
473
|
+ }
|
|
474
|
+ },
|
|
475
|
+ },
|
460
|
476
|
methods: {
|
461
|
477
|
getInitOrder() {
|
462
|
478
|
getInitOrder().then((response) => {
|
|
@@ -559,15 +575,23 @@ export default {
|
559
|
575
|
goodList[i].good_type_id = this.goodTypeList[y].type_name;
|
560
|
576
|
}
|
561
|
577
|
}
|
562
|
|
- goodList[i].supply_name =goodList[i].good_name +" " +goodList[i].specification_name +" " + goodList[i].manufacturer;
|
|
578
|
+ goodList[i].supply_name =
|
|
579
|
+ goodList[i].good_name +
|
|
580
|
+ " " +
|
|
581
|
+ goodList[i].specification_name +
|
|
582
|
+ " " +
|
|
583
|
+ goodList[i].manufacturer;
|
563
|
584
|
goodList[i].supply_type = goodList[i].good_type_id;
|
564
|
|
- goodList[i].supply_specification_name =goodList[i].specification_name;
|
|
585
|
+ goodList[i].supply_specification_name =
|
|
586
|
+ goodList[i].specification_name;
|
565
|
587
|
goodList[i].supply_price = goodList[i].buy_price;
|
566
|
|
- goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info);
|
|
588
|
+ goodList[i].supply_total = this.getTotalStockCount(
|
|
589
|
+ goodList[i].good_warehouse_info
|
|
590
|
+ );
|
567
|
591
|
goodList[i].supply_count = "";
|
568
|
592
|
goodList[i].supply_total_price = "";
|
569
|
593
|
goodList[i].supply_manufacturer = goodList[i].manufacturer;
|
570
|
|
- goodList[i].supply_license_number = goodList[i].number
|
|
594
|
+ goodList[i].supply_license_number = goodList[i].number;
|
571
|
595
|
goodList[i].supply_remake = "";
|
572
|
596
|
goodList[i].type = 2;
|
573
|
597
|
goodList[i].name = goodList[i].good_name;
|
|
@@ -579,7 +603,6 @@ export default {
|
579
|
603
|
this.tabList.push(goodList[i]);
|
580
|
604
|
}
|
581
|
605
|
this.goodList = goodList;
|
582
|
|
-
|
583
|
606
|
}
|
584
|
607
|
});
|
585
|
608
|
},
|
|
@@ -594,7 +617,8 @@ export default {
|
594
|
617
|
this.recordInfo.tableList[i].name = val.name;
|
595
|
618
|
this.recordInfo.tableList[i].supply_name = val.supply_name;
|
596
|
619
|
this.recordInfo.tableList[i].supply_type = val.supply_type;
|
597
|
|
- this.recordInfo.tableList[i].supply_specification_name =val.supply_specification_name;
|
|
620
|
+ this.recordInfo.tableList[i].supply_specification_name =
|
|
621
|
+ val.supply_specification_name;
|
598
|
622
|
this.recordInfo.tableList[i].supply_total = val.supply_total;
|
599
|
623
|
if (val.supply_count == NaN) {
|
600
|
624
|
this.recordInfo.tableList[i].supply_count = "";
|
|
@@ -604,10 +628,15 @@ export default {
|
604
|
628
|
: "";
|
605
|
629
|
}
|
606
|
630
|
|
607
|
|
- this.recordInfo.tableList[i].supply_price = val.supply_price? val.supply_price: "";
|
608
|
|
- this.recordInfo.tableList[i].supply_total_price =val.supply_total_price ? val.supply_total_price : "";
|
609
|
|
- this.recordInfo.tableList[i].supply_manufacturer =val.supply_manufacturer;
|
610
|
|
- this.recordInfo.tableList[i].supply_license_number =val.supply_license_number;
|
|
631
|
+ this.recordInfo.tableList[i].supply_price = val.supply_price
|
|
632
|
+ ? val.supply_price
|
|
633
|
+ : "";
|
|
634
|
+ this.recordInfo.tableList[i].supply_total_price =
|
|
635
|
+ val.supply_total_price ? val.supply_total_price : "";
|
|
636
|
+ this.recordInfo.tableList[i].supply_manufacturer =
|
|
637
|
+ val.supply_manufacturer;
|
|
638
|
+ this.recordInfo.tableList[i].supply_license_number =
|
|
639
|
+ val.supply_license_number;
|
611
|
640
|
this.recordInfo.tableList[i].supply_remake = val.supply_remake;
|
612
|
641
|
this.recordInfo.tableList[i].is_total = val.is_total;
|
613
|
642
|
this.recordInfo.tableList[i].supply_unit = val.supply_unit;
|
|
@@ -641,42 +670,40 @@ export default {
|
641
|
670
|
this.recordInfo.tableList.push(tempObj);
|
642
|
671
|
},
|
643
|
672
|
handleDelete: function (index, row) {
|
644
|
|
-
|
645
|
|
- if(this.is_check == 1){
|
646
|
|
- this.$message.error("已审核单据,不能删除!")
|
647
|
|
- return false
|
|
673
|
+ if (this.is_check == 1) {
|
|
674
|
+ this.$message.error("已审核单据,不能删除!");
|
|
675
|
+ return false;
|
648
|
676
|
}
|
649
|
|
- if(row.id == 0){
|
|
677
|
+ if (row.id == 0) {
|
650
|
678
|
if (this.recordInfo.tableList.length <= 1) {
|
651
|
679
|
this.$message.error("只有一条记录的时候无法删除");
|
652
|
680
|
return;
|
653
|
681
|
} else {
|
654
|
682
|
this.recordInfo.tableList.splice(index, 1);
|
655
|
683
|
}
|
656
|
|
- }else{
|
657
|
|
- const params = {
|
658
|
|
- id: row.id
|
659
|
|
- }
|
660
|
|
- this.$confirm('确认删除吗?', {
|
661
|
|
- confirmButtonText: '确定',
|
662
|
|
- cancelButtonText: '取消',
|
663
|
|
- type: 'warning'
|
664
|
|
- }).then(() => {
|
665
|
|
- deletePurchOder(params).then(response => {
|
|
684
|
+ } else {
|
|
685
|
+ const params = {
|
|
686
|
+ id: row.id,
|
|
687
|
+ };
|
|
688
|
+ this.$confirm("确认删除吗?", {
|
|
689
|
+ confirmButtonText: "确定",
|
|
690
|
+ cancelButtonText: "取消",
|
|
691
|
+ type: "warning",
|
|
692
|
+ })
|
|
693
|
+ .then(() => {
|
|
694
|
+ deletePurchOder(params).then((response) => {
|
666
|
695
|
if (response.data.state == 0) {
|
667
|
|
- this.$message.error(response.data.msg)
|
668
|
|
- return false
|
|
696
|
+ this.$message.error(response.data.msg);
|
|
697
|
+ return false;
|
669
|
698
|
} else {
|
670
|
|
- this.$message.success('删除成功')
|
|
699
|
+ this.$message.success("删除成功");
|
671
|
700
|
|
672
|
|
- this.recordInfo.tableList.splice(index, 1)
|
|
701
|
+ this.recordInfo.tableList.splice(index, 1);
|
673
|
702
|
}
|
674
|
|
- })
|
675
|
|
- }).catch(() => {
|
676
|
|
- })
|
677
|
|
-
|
|
703
|
+ });
|
|
704
|
+ })
|
|
705
|
+ .catch(() => {});
|
678
|
706
|
}
|
679
|
|
-
|
680
|
707
|
},
|
681
|
708
|
|
682
|
709
|
changeTypeName() {},
|
|
@@ -715,12 +742,11 @@ export default {
|
715
|
742
|
for (let i = 0; i < arr.length; i++) {
|
716
|
743
|
total_count += arr[i].stock_count;
|
717
|
744
|
}
|
718
|
|
- if(total_count >0){
|
|
745
|
+ if (total_count > 0) {
|
719
|
746
|
return total_count;
|
720
|
|
- }else{
|
721
|
|
- return ""
|
|
747
|
+ } else {
|
|
748
|
+ return "";
|
722
|
749
|
}
|
723
|
|
-
|
724
|
750
|
},
|
725
|
751
|
calculate: function (val) {
|
726
|
752
|
if (isNaN(val)) {
|
|
@@ -746,13 +772,21 @@ export default {
|
746
|
772
|
this.$refs["tableForm"].validate((valid) => {
|
747
|
773
|
if (valid) {
|
748
|
774
|
this.loading = true;
|
749
|
|
-
|
|
775
|
+
|
750
|
776
|
for (let i = 0; i < this.recordInfo.tableList.length; i++) {
|
751
|
|
- this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
|
752
|
|
- this.recordInfo.tableList[i].supply_license_number =this.recordInfo.tableList[i].supply_license_number.toString();
|
753
|
|
- this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count *this.recordInfo.tableList[i].supply_price).toString();
|
754
|
|
- this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
|
755
|
|
- this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString();
|
|
777
|
+ this.recordInfo.tableList[i].supply_count = parseInt(
|
|
778
|
+ this.recordInfo.tableList[i].supply_count
|
|
779
|
+ );
|
|
780
|
+ this.recordInfo.tableList[i].supply_license_number =
|
|
781
|
+ this.recordInfo.tableList[i].supply_license_number.toString();
|
|
782
|
+ this.recordInfo.tableList[i].supply_total_price = (
|
|
783
|
+ this.recordInfo.tableList[i].supply_count *
|
|
784
|
+ this.recordInfo.tableList[i].supply_price
|
|
785
|
+ ).toString();
|
|
786
|
+ this.recordInfo.tableList[i].supply_total =
|
|
787
|
+ this.recordInfo.tableList[i].supply_total.toString();
|
|
788
|
+ this.recordInfo.tableList[i].supply_price =
|
|
789
|
+ this.recordInfo.tableList[i].supply_price.toString();
|
756
|
790
|
for (let j = 0; j < this.manufactuerList.length; j++) {
|
757
|
791
|
if (
|
758
|
792
|
this.recordInfo.tableList[i].supply_manufacturer ==
|
|
@@ -776,8 +810,8 @@ export default {
|
776
|
810
|
stockIn: this.recordInfo.tableList,
|
777
|
811
|
return_remake: this.return_remark,
|
778
|
812
|
};
|
779
|
|
- console.log("哈哈哈哈哈哈",params)
|
780
|
|
-
|
|
813
|
+ console.log("哈哈哈哈哈哈", params);
|
|
814
|
+
|
781
|
815
|
updatePurchaseOrder(
|
782
|
816
|
params,
|
783
|
817
|
this.supplier_name,
|
|
@@ -792,7 +826,7 @@ export default {
|
792
|
826
|
this.loading = false;
|
793
|
827
|
var warehousingInfo = response.data.data.warehousingInfo;
|
794
|
828
|
this.$message.success("保存成功!");
|
795
|
|
- this.getPurchaseOrderDetail()
|
|
829
|
+ this.getPurchaseOrderDetail();
|
796
|
830
|
}
|
797
|
831
|
});
|
798
|
832
|
}
|
|
@@ -807,7 +841,7 @@ export default {
|
807
|
841
|
this.recordInfo.tableList[i].supply_count;
|
808
|
842
|
}
|
809
|
843
|
this.total_price = total_price;
|
810
|
|
- this.addressChange()
|
|
844
|
+ // this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
|
811
|
845
|
return total_price.toFixed(2);
|
812
|
846
|
},
|
813
|
847
|
|
|
@@ -816,7 +850,8 @@ export default {
|
816
|
850
|
confirmButtonText: "确 定",
|
817
|
851
|
cancelButtonText: "取 消",
|
818
|
852
|
type: "warning",
|
819
|
|
- }).then(() => {
|
|
853
|
+ })
|
|
854
|
+ .then(() => {
|
820
|
855
|
checkPurchaseOrder(this.id).then((response) => {
|
821
|
856
|
if (response.data.state == 1) {
|
822
|
857
|
var info = response.data.data.info;
|
|
@@ -872,11 +907,11 @@ export default {
|
872
|
907
|
this.showTwo = false;
|
873
|
908
|
this.showThree = true;
|
874
|
909
|
}
|
875
|
|
-
|
|
910
|
+
|
876
|
911
|
var drugList = response.data.data.baseList;
|
877
|
912
|
var goodList = response.data.data.goodList;
|
878
|
913
|
for (let i = 0; i < orderInfo.length; i++) {
|
879
|
|
- orderInfo[i].id = orderInfo[i].id
|
|
914
|
+ orderInfo[i].id = orderInfo[i].id;
|
880
|
915
|
orderInfo[i].supply_count = orderInfo[i].count;
|
881
|
916
|
orderInfo[i].supply_price = orderInfo[i].price;
|
882
|
917
|
orderInfo[i].supply_remake = orderInfo[i].remark;
|
|
@@ -910,32 +945,31 @@ export default {
|
910
|
945
|
}
|
911
|
946
|
}
|
912
|
947
|
}
|
913
|
|
-
|
|
948
|
+
|
914
|
949
|
this.recordInfo.tableList = [];
|
915
|
|
- if(orderInfo.length == 0){
|
916
|
|
- const tempObj = {};
|
917
|
|
- tempObj["id"] = 0;
|
918
|
|
- tempObj["name"] = "";
|
919
|
|
- tempObj["supply_name"] = "";
|
920
|
|
- tempObj["supply_type"] = "";
|
921
|
|
- tempObj["supply_specification_name"] = "";
|
922
|
|
- tempObj["supply_total"] = "";
|
923
|
|
- tempObj["supply_count"] = "";
|
924
|
|
- tempObj["supply_price"] = "";
|
925
|
|
- tempObj["supply_total_price"] = "";
|
926
|
|
- tempObj["supply_manufacturer"] = "";
|
927
|
|
- tempObj["supply_license_number"] = "";
|
928
|
|
- tempObj["supply_remake"] = "";
|
929
|
|
- tempObj["type"] = 0;
|
930
|
|
- tempObj["is_total"] = 1;
|
931
|
|
- tempObj["project_id"] = 0;
|
932
|
|
- tempObj["supply_unit"] = "";
|
933
|
|
- tempObj["manufacturer_id"] = "";
|
934
|
|
- this.recordInfo.tableList.push(tempObj);
|
935
|
|
- }else{
|
|
950
|
+ if (orderInfo.length == 0) {
|
|
951
|
+ const tempObj = {};
|
|
952
|
+ tempObj["id"] = 0;
|
|
953
|
+ tempObj["name"] = "";
|
|
954
|
+ tempObj["supply_name"] = "";
|
|
955
|
+ tempObj["supply_type"] = "";
|
|
956
|
+ tempObj["supply_specification_name"] = "";
|
|
957
|
+ tempObj["supply_total"] = "";
|
|
958
|
+ tempObj["supply_count"] = "";
|
|
959
|
+ tempObj["supply_price"] = "";
|
|
960
|
+ tempObj["supply_total_price"] = "";
|
|
961
|
+ tempObj["supply_manufacturer"] = "";
|
|
962
|
+ tempObj["supply_license_number"] = "";
|
|
963
|
+ tempObj["supply_remake"] = "";
|
|
964
|
+ tempObj["type"] = 0;
|
|
965
|
+ tempObj["is_total"] = 1;
|
|
966
|
+ tempObj["project_id"] = 0;
|
|
967
|
+ tempObj["supply_unit"] = "";
|
|
968
|
+ tempObj["manufacturer_id"] = "";
|
|
969
|
+ this.recordInfo.tableList.push(tempObj);
|
|
970
|
+ } else {
|
936
|
971
|
this.recordInfo.tableList = orderInfo;
|
937
|
972
|
}
|
938
|
|
-
|
939
|
973
|
}
|
940
|
974
|
});
|
941
|
975
|
},
|
|
@@ -955,21 +989,23 @@ export default {
|
955
|
989
|
var purcaseOrder = response.data.data.purcaseOrder;
|
956
|
990
|
|
957
|
991
|
var goodOrder = response.data.data.goodOrder;
|
958
|
|
-
|
|
992
|
+
|
959
|
993
|
var drugList = response.data.data.drugList;
|
960
|
|
-
|
|
994
|
+
|
961
|
995
|
var ids = "";
|
962
|
996
|
// 如果采购单没有数据,则代表改订单第一次生成采购订单数据
|
963
|
997
|
if (goodOrder.length == 0) {
|
964
|
|
- this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
|
|
998
|
+ this.$router.push({
|
|
999
|
+ path: "/good/order/add?id=" + id + "&ids=" + ids,
|
|
1000
|
+ });
|
965
|
1001
|
}
|
966
|
|
-
|
967
|
|
-
|
|
1002
|
+
|
968
|
1003
|
for (let i = 0; i < purcaseOrder.length; i++) {
|
969
|
1004
|
for (let j = 0; j < drugList.length; j++) {
|
970
|
1005
|
if (purcaseOrder[i].is_source == 1) {
|
971
|
1006
|
if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
|
972
|
|
- purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
|
|
1007
|
+ purcaseOrder[i].count =
|
|
1008
|
+ purcaseOrder[i].count * drugList[j].min_number;
|
973
|
1009
|
}
|
974
|
1010
|
}
|
975
|
1011
|
}
|
|
@@ -979,7 +1015,8 @@ export default {
|
979
|
1015
|
for (let j = 0; j < drugList.length; j++) {
|
980
|
1016
|
if (goodOrder[i].is_source == 1) {
|
981
|
1017
|
if (goodOrder[i].supply_unit == drugList[j].max_unit) {
|
982
|
|
- goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
|
|
1018
|
+ goodOrder[i].count =
|
|
1019
|
+ goodOrder[i].count * drugList[j].min_number;
|
983
|
1020
|
}
|
984
|
1021
|
}
|
985
|
1022
|
}
|
|
@@ -1006,7 +1043,6 @@ export default {
|
1006
|
1043
|
}
|
1007
|
1044
|
}
|
1008
|
1045
|
}
|
1009
|
|
-
|
1010
|
1046
|
|
1011
|
1047
|
for (let i = 0; i < newArr.length; i++) {
|
1012
|
1048
|
for (let j = 0; j < newArr[i].child.length; j++) {
|
|
@@ -1014,95 +1050,104 @@ export default {
|
1014
|
1050
|
}
|
1015
|
1051
|
}
|
1016
|
1052
|
|
1017
|
|
- var arr = [];
|
|
1053
|
+ var arr = [];
|
1018
|
1054
|
var total = 0;
|
1019
|
1055
|
var str = "";
|
1020
|
|
- console.log("newArr2323223323223",newArr)
|
1021
|
|
- console.log("newArr2323223323223",purcaseOrder)
|
1022
|
|
-
|
|
1056
|
+ console.log("newArr2323223323223", newArr);
|
|
1057
|
+ console.log("newArr2323223323223", purcaseOrder);
|
1023
|
1058
|
|
1024
|
|
- console.log("长度1",goodOrder.length)
|
1025
|
|
- console.log("长度2",purcaseOrder.length)
|
|
1059
|
+ console.log("长度1", goodOrder.length);
|
|
1060
|
+ console.log("长度2", purcaseOrder.length);
|
1026
|
1061
|
|
1027
|
|
- if(purcaseOrder.length <=goodOrder.length){
|
1028
|
|
- //如果采购单有数据,则需要比较数量
|
1029
|
|
- if (newArr.length > 0) {
|
1030
|
|
- for (let i = 0; i < purcaseOrder.length; i++) {
|
1031
|
|
- for (let j = 0; j < newArr.length; j++) {
|
1032
|
|
- if (purcaseOrder[i].project_id == newArr[j].project_id) {
|
1033
|
|
- //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
|
1034
|
|
- if (purcaseOrder[i].count > newArr[j].count) {
|
1035
|
|
- arr.push(purcaseOrder[i].project_id);
|
|
1062
|
+ if (purcaseOrder.length <= goodOrder.length) {
|
|
1063
|
+ //如果采购单有数据,则需要比较数量
|
|
1064
|
+ if (newArr.length > 0) {
|
|
1065
|
+ for (let i = 0; i < purcaseOrder.length; i++) {
|
|
1066
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
1067
|
+ if (purcaseOrder[i].project_id == newArr[j].project_id) {
|
|
1068
|
+ //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
|
|
1069
|
+ if (purcaseOrder[i].count > newArr[j].count) {
|
|
1070
|
+ arr.push(purcaseOrder[i].project_id);
|
|
1071
|
+ }
|
1036
|
1072
|
}
|
1037
|
1073
|
}
|
1038
|
1074
|
}
|
1039
|
|
- }
|
1040
|
|
- //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
|
1041
|
|
-
|
1042
|
|
- if (arr.length == 0) {
|
1043
|
|
- this.$message.error("该订单已全部生成采购单,请知悉!");
|
1044
|
|
- return;
|
1045
|
|
- }
|
|
1075
|
+ //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
|
1046
|
1076
|
|
1047
|
|
- if (arr.length >0) {
|
1048
|
|
- str = arr.join(",");
|
1049
|
|
- this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
|
1050
|
|
- }
|
|
1077
|
+ if (arr.length == 0) {
|
|
1078
|
+ this.$message.error("该订单已全部生成采购单,请知悉!");
|
|
1079
|
+ return;
|
|
1080
|
+ }
|
1051
|
1081
|
|
|
1082
|
+ if (arr.length > 0) {
|
|
1083
|
+ str = arr.join(",");
|
|
1084
|
+ this.$router.push({
|
|
1085
|
+ path: "/good/order/add?id=" + id + "&ids=" + str,
|
|
1086
|
+ });
|
|
1087
|
+ }
|
|
1088
|
+ }
|
1052
|
1089
|
}
|
1053
|
|
-
|
1054
|
|
- }
|
1055
|
|
- //如果采购订单的商品个数不等与 采购单里面的商品个数
|
1056
|
|
- if(purcaseOrder.length>goodOrder.length){
|
1057
|
|
- var arrList = []
|
1058
|
|
- var str = "";
|
1059
|
|
- if (newArr.length > 0) {
|
1060
|
|
- for (let i = 0; i < purcaseOrder.length; i++) {
|
1061
|
|
- for (let j = 0; j < newArr.length; j++) {
|
1062
|
|
- //如果采购订单的商品个数不等与 采购单里面的商品个数
|
1063
|
|
- if(purcaseOrder[i].project_id != newArr[j].project_id){
|
1064
|
|
- arrList.push(purcaseOrder[i].project_id)
|
|
1090
|
+ //如果采购订单的商品个数不等与 采购单里面的商品个数
|
|
1091
|
+ if (purcaseOrder.length > goodOrder.length) {
|
|
1092
|
+ var arrList = [];
|
|
1093
|
+ var str = "";
|
|
1094
|
+ if (newArr.length > 0) {
|
|
1095
|
+ for (let i = 0; i < purcaseOrder.length; i++) {
|
|
1096
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
1097
|
+ //如果采购订单的商品个数不等与 采购单里面的商品个数
|
|
1098
|
+ if (purcaseOrder[i].project_id != newArr[j].project_id) {
|
|
1099
|
+ arrList.push(purcaseOrder[i].project_id);
|
|
1100
|
+ }
|
1065
|
1101
|
}
|
1066
|
1102
|
}
|
1067
|
|
- }
|
1068
|
|
- //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
|
1069
|
|
- console.log("are232323323223322323",arrList)
|
1070
|
|
- if(arrList.length > 0){
|
1071
|
|
- str = arrList.join(",");
|
1072
|
|
- this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
|
|
1103
|
+ //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
|
|
1104
|
+ console.log("are232323323223322323", arrList);
|
|
1105
|
+ if (arrList.length > 0) {
|
|
1106
|
+ str = arrList.join(",");
|
|
1107
|
+ this.$router.push({
|
|
1108
|
+ path: "/good/order/add?id=" + id + "&ids=" + str,
|
|
1109
|
+ });
|
|
1110
|
+ }
|
1073
|
1111
|
}
|
1074
|
1112
|
}
|
1075
|
|
- }
|
1076
|
1113
|
}
|
1077
|
1114
|
}
|
1078
|
1115
|
});
|
1079
|
1116
|
},
|
1080
|
1117
|
addressChange() {
|
|
1118
|
+ var discount_amount = 0;
|
1081
|
1119
|
if (this.rate_of_concession > 0) {
|
1082
|
|
- this.discount_amount = (
|
|
1120
|
+ discount_amount = (
|
1083
|
1121
|
(this.rate_of_concession / 100) *
|
1084
|
1122
|
this.total_price
|
1085
|
1123
|
).toFixed(2);
|
1086
|
1124
|
}
|
|
1125
|
+ this.discount_amount = discount_amount;
|
|
1126
|
+ },
|
|
1127
|
+ count_discount() {
|
|
1128
|
+ this.rate_of_concession = (
|
|
1129
|
+ this.discount_amount /
|
|
1130
|
+ (this.total_price * 0.01)
|
|
1131
|
+ ).toFixed(2);
|
1087
|
1132
|
},
|
1088
|
1133
|
checkReturnOrder() {
|
1089
|
1134
|
var id = this.$route.query.id;
|
1090
|
1135
|
//获取购货订单号
|
1091
|
1136
|
getGoodOrderList(id).then((response) => {
|
1092
|
1137
|
if (response.data.state == 1) {
|
1093
|
|
- var list = response.data.data.list
|
1094
|
|
-
|
1095
|
|
- this.orderList = list
|
|
1138
|
+ var list = response.data.data.list;
|
|
1139
|
+
|
|
1140
|
+ this.orderList = list;
|
1096
|
1141
|
//如果长度大于0,有购货单不能反审核
|
1097
|
1142
|
if (list.length > 0) {
|
1098
|
|
- this.$refs.Popup.dialogVisible = true
|
1099
|
|
- return
|
|
1143
|
+ this.$refs.Popup.dialogVisible = true;
|
|
1144
|
+ return;
|
1100
|
1145
|
}
|
1101
|
1146
|
if (list.length == 0) {
|
1102
|
|
- this.getReturnOrder()
|
1103
|
|
- this.showOne = false
|
1104
|
|
- this.showTwo = true
|
1105
|
|
- this.showThree = false
|
|
1147
|
+ this.getReturnOrder();
|
|
1148
|
+ this.showOne = false;
|
|
1149
|
+ this.showTwo = true;
|
|
1150
|
+ this.showThree = false;
|
1106
|
1151
|
}
|
1107
|
1152
|
}
|
1108
|
1153
|
});
|
|
@@ -1113,14 +1158,14 @@ export default {
|
1113
|
1158
|
if (response.data.state == 1) {
|
1114
|
1159
|
var msg = response.data.data.msg;
|
1115
|
1160
|
this.disabled = false;
|
1116
|
|
- this.Reviewed = false
|
|
1161
|
+ this.Reviewed = false;
|
1117
|
1162
|
this.$message.success("反审核成功!");
|
1118
|
1163
|
this.getPurchaseOrderDetail();
|
1119
|
1164
|
}
|
1120
|
1165
|
});
|
1121
|
1166
|
},
|
1122
|
1167
|
toClick(id) {
|
1123
|
|
- this.$router.push({path:"/good/order/edit?id=" + id});
|
|
1168
|
+ this.$router.push({ path: "/good/order/edit?id=" + id });
|
1124
|
1169
|
},
|
1125
|
1170
|
},
|
1126
|
1171
|
created() {
|
|
@@ -1174,9 +1219,25 @@ export default {
|
1174
|
1219
|
margin-top: 15px;
|
1175
|
1220
|
margin-bottom: 15px;
|
1176
|
1221
|
}
|
|
1222
|
+/deep/ .el-table--scrollable-x .el-table__body-wrapper {
|
|
1223
|
+ overflow: auto;
|
|
1224
|
+}
|
|
1225
|
+/deep/ .gutter {
|
|
1226
|
+ width: 15px !important;
|
|
1227
|
+ display: inline-block !important;
|
|
1228
|
+}
|
|
1229
|
+/deep/ .el-table__fixed-right-patch {
|
|
1230
|
+ width: 15px !important;
|
|
1231
|
+}
|
|
1232
|
+
|
|
1233
|
+/deep/ .el-table__fixed-right {
|
|
1234
|
+ bottom: 0 !important;
|
|
1235
|
+ left: auto;
|
|
1236
|
+ right: 0;
|
|
1237
|
+}
|
1177
|
1238
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar {
|
1178
|
|
- width: 10px;
|
1179
|
|
- height: 10px;
|
|
1239
|
+ width: 15px !important;
|
|
1240
|
+ height: 15px !important;
|
1180
|
1241
|
}
|
1181
|
1242
|
</style>
|
1182
|
1243
|
|
|
@@ -1203,17 +1264,15 @@ export default {
|
1203
|
1264
|
.el-table::before {
|
1204
|
1265
|
background-color: #d0d3da;
|
1205
|
1266
|
}
|
1206
|
|
-.el-table__fixed-right {
|
|
1267
|
+/* .el-table__fixed-right {
|
1207
|
1268
|
width: 150px;
|
1208
|
1269
|
bottom: 20px;
|
1209
|
1270
|
height: 100%;
|
1210
|
|
-}
|
|
1271
|
+} */
|
1211
|
1272
|
.reviewImg {
|
1212
|
1273
|
position: fixed;
|
1213
|
1274
|
left: 50%;
|
1214
|
1275
|
transform: translateX(-50%);
|
1215
|
1276
|
top: 30%;
|
1216
|
1277
|
}
|
1217
|
|
-
|
1218
|
|
-
|
1219
|
1278
|
</style>
|