|
@@ -14,7 +14,7 @@
|
14
|
14
|
>
|
15
|
15
|
<div>
|
16
|
16
|
<span style="color: red">*</span><span>供应商:</span>
|
17
|
|
- <el-select cxpib`*+9.`
|
|
17
|
+ <el-select
|
18
|
18
|
v-model="supplier_name"
|
19
|
19
|
style="width: 140px; margin-right: 10px"
|
20
|
20
|
placeholder="请选择"
|
|
@@ -191,7 +191,7 @@
|
191
|
191
|
<div style="visibility: hidden">/</div>
|
192
|
192
|
</template>
|
193
|
193
|
</el-table-column>
|
194
|
|
- <el-table-column label="数量" align="center" width="140px">
|
|
194
|
+ <el-table-column label="数量" align="center" width="180px">
|
195
|
195
|
<template slot="header" slot-scope="scope">
|
196
|
196
|
<span>数量<span style="color: red">*</span></span>
|
197
|
197
|
</template>
|
|
@@ -199,10 +199,11 @@
|
199
|
199
|
<el-form-item
|
200
|
200
|
:prop="'tableList.' + scope.$index + '.supply_count'"
|
201
|
201
|
:rules="tableRules.supply_count"
|
|
202
|
+ placeholder="请输入数量"
|
202
|
203
|
>
|
203
|
204
|
<el-input
|
204
|
205
|
v-model="scope.row.supply_count"
|
205
|
|
- style="width: 100px"
|
|
206
|
+ style="width: 140px"
|
206
|
207
|
:disabled="disabled"
|
207
|
208
|
placeholder="请输入数量"
|
208
|
209
|
></el-input>
|
|
@@ -210,11 +211,11 @@
|
210
|
211
|
</template>
|
211
|
212
|
</el-table-column>
|
212
|
213
|
|
213
|
|
- <el-table-column label="采购单价" align="center" width="180px">
|
|
214
|
+ <el-table-column label="购货单价" align="center" width="140px">
|
214
|
215
|
<template slot-scope="scope">
|
215
|
216
|
<el-input
|
216
|
217
|
v-model="scope.row.supply_price"
|
217
|
|
- style="width: 140px"
|
|
218
|
+ style="width: 80px"
|
218
|
219
|
:disabled="disabled"
|
219
|
220
|
placeholder="请输入购货单价"
|
220
|
221
|
></el-input>
|
|
@@ -309,7 +310,7 @@
|
309
|
310
|
</template>
|
310
|
311
|
</el-table-column>
|
311
|
312
|
</el-table>
|
312
|
|
- <div style="margin-top: 10px">
|
|
313
|
+ <div style="margin-top: 10px">
|
313
|
314
|
<el-input
|
314
|
315
|
type="textarea"
|
315
|
316
|
:rows="2"
|
|
@@ -360,6 +361,7 @@ import {
|
360
|
361
|
import { getDataConfig } from "@/utils/data";
|
361
|
362
|
export default {
|
362
|
363
|
name: "addPurchaseOrder",
|
|
364
|
+
|
363
|
365
|
components: {
|
364
|
366
|
BreadCrumb,
|
365
|
367
|
},
|
|
@@ -428,127 +430,99 @@ export default {
|
428
|
430
|
};
|
429
|
431
|
},
|
430
|
432
|
methods: {
|
431
|
|
- getInitOrder() {
|
432
|
|
- getInitOrder().then((response) => {
|
433
|
|
- if (response.data.state == 1) {
|
434
|
|
- var drugList = response.data.data.drugList;
|
435
|
|
-
|
436
|
|
- this.manufactuerList = response.data.data.manufactuerList;
|
437
|
|
- this.goodTypeList = response.data.data.goodTypeList;
|
438
|
|
- this.drugTypeList = response.data.data.drugTypeList;
|
439
|
|
- this.supplyList = response.data.data.supplyList;
|
440
|
|
- for (let i = 0; i < drugList.length; i++) {
|
441
|
|
- for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
|
442
|
|
- drugList[i].drug_warehouse_info[z].stock_max_number =
|
443
|
|
- drugList[i].drug_warehouse_info[z].stock_max_number *
|
444
|
|
- drugList[i].min_number;
|
|
433
|
+ getInitOrder(){
|
|
434
|
+ getInitOrder().then(response=>{
|
|
435
|
+ if(response.data.state == 1){
|
|
436
|
+ var drugList = response.data.data.drugList
|
|
437
|
+ this.manufactuerList = response.data.data.manufactuerList
|
|
438
|
+ this.goodTypeList = response.data.data.goodTypeList
|
|
439
|
+ this.drugTypeList = response.data.data.drugTypeList
|
|
440
|
+ this.supplyList = response.data.data.supplyList
|
|
441
|
+ for(let i=0;i<drugList.length;i++){
|
|
442
|
+ for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
|
|
443
|
+ if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
|
|
444
|
+ drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
|
445
|
445
|
}
|
446
|
|
- for (let j = 0; j < this.manufactuerList.length; j++) {
|
447
|
|
- if (drugList[i].manufacturer == this.manufactuerList[j].id) {
|
448
|
|
- drugList[i].manufacturer =
|
449
|
|
- this.manufactuerList[j].manufacturer_name;
|
450
|
|
- }
|
451
|
|
- }
|
452
|
|
- for (let y = 0; y < this.drugTypeList.length; y++) {
|
453
|
|
- if (drugList[i].drug_type == this.drugTypeList[y].value) {
|
454
|
|
- drugList[i].drug_type = this.drugTypeList[y].name;
|
455
|
|
- }
|
|
446
|
+ }
|
|
447
|
+ for(let j=0;j<this.manufactuerList.length;j++){
|
|
448
|
+ if(drugList[i].manufacturer == this.manufactuerList[j].id){
|
|
449
|
+ drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
|
456
|
450
|
}
|
457
|
|
- drugList[i].supply_name =
|
458
|
|
- drugList[i].drug_name +
|
459
|
|
- " " +
|
460
|
|
- drugList[i].dose +
|
461
|
|
- drugList[i].dose_unit +
|
462
|
|
- "*" +
|
463
|
|
- drugList[i].min_number +
|
464
|
|
- drugList[i].min_unit +
|
465
|
|
- "/" +
|
466
|
|
- drugList[i].max_unit +
|
467
|
|
- " " +
|
468
|
|
- drugList[i].manufacturer;
|
469
|
|
- drugList[i].supply_type = drugList[i].drug_type;
|
470
|
|
- drugList[i].supply_specification_name =
|
471
|
|
- drugList[i].dose +
|
472
|
|
- drugList[i].dose_unit +
|
473
|
|
- "*" +
|
474
|
|
- drugList[i].min_number +
|
475
|
|
- drugList[i].min_unit +
|
476
|
|
- "/" +
|
477
|
|
- drugList[i].max_unit;
|
478
|
|
- drugList[i].supply_total = this.getWarehoseInfo(
|
479
|
|
- drugList[i].drug_warehouse_info,
|
480
|
|
- drugList[i].max_unit,
|
481
|
|
- drugList[i].min_unit,
|
482
|
|
- drugList[i].min_number
|
483
|
|
- );
|
484
|
|
- drugList[i].supply_count = "";
|
485
|
|
- drugList[i].supply_total_price = "";
|
486
|
|
- drugList[i].supply_manufacturer = drugList[i].manufacturer;
|
487
|
|
- drugList[i].supply_license_number = drugList[i].number;
|
488
|
|
- drugList[i].supply_remake = "";
|
489
|
|
- drugList[i].type = 1;
|
490
|
|
- drugList[i].supply_price = drugList[i].last_price;
|
491
|
|
- drugList[i].name = drugList[i].drug_name;
|
492
|
|
- drugList[i].supply_unit = drugList[i].max_unit;
|
493
|
|
- drugList[i].unitList = [
|
494
|
|
- { id: 1, name: "" },
|
495
|
|
- { id: 2, name: "" },
|
496
|
|
- ];
|
497
|
|
- for (let j = 0; j < drugList[i].unitList.length; j++) {
|
498
|
|
- drugList[i].unitList[0].name = drugList[i].max_unit;
|
499
|
|
- drugList[i].unitList[1].name = drugList[i].min_unit;
|
|
451
|
+ }
|
|
452
|
+ for(let y=0;y<this.drugTypeList.length;y++){
|
|
453
|
+ if(drugList[i].drug_type == this.drugTypeList[y].value){
|
|
454
|
+ drugList[i].drug_type = this.drugTypeList[y].name
|
500
|
455
|
}
|
501
|
|
- this.tabList.push(drugList[i]);
|
|
456
|
+ }
|
|
457
|
+ drugList[i].supply_name = drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
|
|
458
|
+ drugList[i].supply_type = drugList[i].drug_type
|
|
459
|
+ drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
|
|
460
|
+ drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
|
|
461
|
+ drugList[i].supply_count = ""
|
|
462
|
+ drugList[i].supply_total_price = ""
|
|
463
|
+ drugList[i].supply_manufacturer= drugList[i].manufacturer
|
|
464
|
+ drugList[i].supply_license_number= drugList[i].number
|
|
465
|
+ drugList[i].supply_remake = ""
|
|
466
|
+ drugList[i].type = 1
|
|
467
|
+ drugList[i].supply_price = drugList[i].last_price
|
|
468
|
+ drugList[i].name = drugList[i].drug_name
|
|
469
|
+ if(drugList[i].max_unit!=drugList[i].min_unit){
|
|
470
|
+ drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
|
|
471
|
+ }
|
|
472
|
+ if(drugList[i].max_unit == drugList[i].min_unit){
|
|
473
|
+ drugList[i].unitList = [{id:1,name:""}]
|
|
474
|
+ }
|
|
475
|
+
|
|
476
|
+ drugList[i].supply_unit = drugList[i].max_unit
|
|
477
|
+ for(let j=0;j<drugList[i].unitList.length;j++){
|
|
478
|
+ if(drugList[i].max_unit!=drugList[i].min_unit){
|
|
479
|
+ drugList[i].unitList[0].name = drugList[i].max_unit
|
|
480
|
+ drugList[i].unitList[1].name = drugList[i].min_unit
|
502
|
481
|
}
|
503
|
|
- this.drugList = drugList;
|
504
|
|
- var goodList = response.data.data.goodList;
|
505
|
|
-
|
506
|
|
- for (let i = 0; i < goodList.length; i++) {
|
507
|
|
- for (let j = 0; j < this.manufactuerList.length; j++) {
|
508
|
|
- if (goodList[i].manufacturer == this.manufactuerList[j].id) {
|
509
|
|
- goodList[i].manufacturer =
|
510
|
|
- this.manufactuerList[j].manufacturer_name;
|
511
|
|
- }
|
512
|
|
- }
|
513
|
|
- for (let y = 0; y < this.goodTypeList.length; y++) {
|
514
|
|
- if (goodList[i].good_type_id == this.goodTypeList[y].id) {
|
515
|
|
- goodList[i].good_type_id = this.goodTypeList[y].type_name;
|
516
|
|
- }
|
|
482
|
+ if(drugList[i].max_unit ==drugList[i].min_unit){
|
|
483
|
+ drugList[i].unitList[0].name = drugList[i].max_unit
|
|
484
|
+ }
|
|
485
|
+
|
|
486
|
+ }
|
|
487
|
+ this.tabList.push(drugList[i])
|
|
488
|
+ }
|
|
489
|
+ this.drugList = drugList
|
|
490
|
+ var goodList = response.data.data.goodList
|
|
491
|
+ for(let i=0;i<goodList.length;i++){
|
|
492
|
+ for(let j=0;j<this.manufactuerList.length;j++){
|
|
493
|
+ if(goodList[i].manufacturer == this.manufactuerList[j].id){
|
|
494
|
+ goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
|
517
|
495
|
}
|
518
|
|
- goodList[i].supply_name =
|
519
|
|
- goodList[i].good_name +
|
520
|
|
- " " +
|
521
|
|
- goodList[i].specification_name +
|
522
|
|
- " " +
|
523
|
|
- goodList[i].manufacturer;
|
524
|
|
- goodList[i].supply_type = goodList[i].good_type_id;
|
525
|
|
- goodList[i].supply_specification_name =
|
526
|
|
- goodList[i].specification_name;
|
527
|
|
- goodList[i].supply_price = goodList[i].buy_price;
|
528
|
|
- goodList[i].supply_total = this.getTotalStockCount(
|
529
|
|
- goodList[i].good_warehouse_info
|
530
|
|
- );
|
531
|
|
- goodList[i].supply_count = "";
|
532
|
|
- goodList[i].supply_total_price = "";
|
533
|
|
- goodList[i].supply_manufacturer = goodList[i].manufacturer;
|
534
|
|
- goodList[i].supply_license_number = "";
|
535
|
|
- goodList[i].supply_remake = "";
|
536
|
|
- goodList[i].type = 2;
|
537
|
|
- goodList[i].name = goodList[i].good_name;
|
538
|
|
- goodList[i].supply_unit = goodList[i].packing_unit;
|
539
|
|
- goodList[i].unitList = [
|
540
|
|
- { id: 1, name: "" },
|
541
|
|
- { id: 2, name: "" },
|
542
|
|
- ];
|
543
|
|
- for (let j = 0; j < goodList[i].unitList.length; j++) {
|
544
|
|
- goodList[i].unitList[0].name = goodList[i].packing_unit;
|
|
496
|
+ }
|
|
497
|
+ for(let y=0;y<this.goodTypeList.length;y++){
|
|
498
|
+ if(goodList[i].good_type_id == this.goodTypeList[y].id){
|
|
499
|
+ goodList[i].good_type_id = this.goodTypeList[y].type_name
|
545
|
500
|
}
|
546
|
|
- this.tabList.push(goodList[i]);
|
547
|
|
- }
|
548
|
|
- this.goodList = goodList;
|
549
|
501
|
}
|
550
|
|
- });
|
551
|
|
- },
|
|
502
|
+ goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
|
|
503
|
+ goodList[i].supply_type = goodList[i].good_type_id
|
|
504
|
+ goodList[i].supply_specification_name =goodList[i].specification_name
|
|
505
|
+ goodList[i].supply_price = goodList[i].buy_price
|
|
506
|
+ goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
|
|
507
|
+ goodList[i].supply_count = ""
|
|
508
|
+ goodList[i].supply_total_price = ""
|
|
509
|
+ goodList[i].supply_manufacturer = goodList[i].manufacturer
|
|
510
|
+ goodList[i].supply_license_number = ""
|
|
511
|
+ goodList[i].supply_remake = ""
|
|
512
|
+ goodList[i].type = 2
|
|
513
|
+ goodList[i].name = goodList[i].good_name
|
|
514
|
+ goodList[i].unitList = [{id:1,name:""}]
|
|
515
|
+ goodList[i].supply_unit = goodList[i].packing_unit
|
|
516
|
+ for(let j=0;j<goodList[i].unitList.length;j++){
|
|
517
|
+ goodList[i].unitList[0].name = goodList[i].packing_unit
|
|
518
|
+ }
|
|
519
|
+ this.tabList.push(goodList[i])
|
|
520
|
+ }
|
|
521
|
+ this.goodList = goodList
|
|
522
|
+ console.log(this.goodList,'oo')
|
|
523
|
+ }
|
|
524
|
+ })
|
|
525
|
+},
|
552
|
526
|
changeGoodName(val) {
|
553
|
527
|
this.currentIndex = val;
|
554
|
528
|
},
|
|
@@ -656,9 +630,8 @@ export default {
|
656
|
630
|
stockIn: this.recordInfo.tableList,
|
657
|
631
|
return_remake:this.return_remark,
|
658
|
632
|
};
|
659
|
|
-
|
|
633
|
+
|
660
|
634
|
console.log("params23322323", params);
|
661
|
|
-
|
662
|
635
|
savePurchaseOrder(
|
663
|
636
|
params,
|
664
|
637
|
this.supplier_name,
|
|
@@ -672,14 +645,13 @@ export default {
|
672
|
645
|
this.loading = false;
|
673
|
646
|
this.$message.success("保存成功!");
|
674
|
647
|
var warehouseInfo = response.data.data.warehouseInfo;
|
675
|
|
-
|
676
|
648
|
if(warehouseInfo.is_check == 1){
|
677
|
649
|
this.Reviewed = true
|
678
|
650
|
}
|
679
|
651
|
this.number = warehouseInfo.number;
|
680
|
|
- this.return_remark = warehouseInfo.return_remake
|
681
|
652
|
this.id = warehouseInfo.id;
|
682
|
653
|
this.recordInfo.tableList = [];
|
|
654
|
+ this.return_remark = warehouseInfo.return_remake
|
683
|
655
|
var orderInfo = response.data.data.orderInfo;
|
684
|
656
|
for (let i = 0; i < orderInfo.length; i++) {
|
685
|
657
|
if (orderInfo[i].is_source == 1) {
|
|
@@ -823,7 +795,7 @@ export default {
|
823
|
795
|
var end = this.getTimes(this.end_time);
|
824
|
796
|
const params = {
|
825
|
797
|
stockIn: this.recordInfo.tableList,
|
826
|
|
- return_remake:this.return_remake,
|
|
798
|
+ return_remake:this.return_remark,
|
827
|
799
|
};
|
828
|
800
|
console.log("params23232233223", params);
|
829
|
801
|
|
|
@@ -978,4 +950,4 @@ export default {
|
978
|
950
|
bottom: 20px;
|
979
|
951
|
height: 100%;
|
980
|
952
|
}
|
981
|
|
-</style>
|
|
953
|
+</style>
|