|
@@ -7,8 +7,7 @@
|
7
|
7
|
<div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
|
8
|
8
|
<div>
|
9
|
9
|
<span style="color:red">*</span><span>供应商:</span>
|
10
|
|
- <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
|
11
|
|
- @change="changeTypeName">
|
|
10
|
+ <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择">
|
12
|
11
|
<el-option
|
13
|
12
|
v-for="item in supplyList"
|
14
|
13
|
:key="item.id"
|
|
@@ -28,7 +27,6 @@
|
28
|
27
|
align="right"
|
29
|
28
|
format="yyyy-MM-dd"
|
30
|
29
|
value-format="yyyy-MM-dd"
|
31
|
|
- @change="startTimeChange"
|
32
|
30
|
></el-date-picker>
|
33
|
31
|
<!-- <span>交货日期:</span> -->
|
34
|
32
|
<!-- <el-date-picker
|
|
@@ -52,7 +50,7 @@
|
52
|
50
|
<el-button size="small" type="primary" @click="updateGoodOrder" v-show="showTwo">保存</el-button>
|
53
|
51
|
<el-button size="small" type="primary" @click="checkPurchaseOrder">审核</el-button>
|
54
|
52
|
|
55
|
|
-
|
|
53
|
+
|
56
|
54
|
</div>
|
57
|
55
|
</div>
|
58
|
56
|
|
|
@@ -75,7 +73,7 @@
|
75
|
73
|
</template>
|
76
|
74
|
<template slot-scope="scope">
|
77
|
75
|
<el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
|
78
|
|
- <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName" @input="changeGoodName(scope.$index)" :disabled="disabled">
|
|
76
|
+ <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择商品" @change="changeName" @input="changeGoodName(scope.$index)" :disabled="disabled">
|
79
|
77
|
<el-option
|
80
|
78
|
v-for="(item,index) in tabList"
|
81
|
79
|
:key="index"
|
|
@@ -91,13 +89,13 @@
|
91
|
89
|
<span>商品类别</span>
|
92
|
90
|
</template>
|
93
|
91
|
<template slot-scope="scope">
|
94
|
|
- <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
|
|
92
|
+ <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true" placeholder="商品类别"></el-input>
|
95
|
93
|
<div style="visibility: hidden">/</div>
|
96
|
94
|
</template>
|
97
|
95
|
</el-table-column>
|
98
|
|
- <el-table-column label="规格&单位" align="center" width="120px">
|
|
96
|
+ <el-table-column label="规格&单位" align="center" width="150px">
|
99
|
97
|
<template slot-scope="scope">
|
100
|
|
- <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
|
|
98
|
+ <el-input v-model="scope.row.supply_specification_name" style="width:120px" :disabled="true" placeholder="规格&单位"></el-input>
|
101
|
99
|
<div style="visibility: hidden">/</div>
|
102
|
100
|
</template>
|
103
|
101
|
</el-table-column>
|
|
@@ -115,16 +113,16 @@
|
115
|
113
|
:value="item.name">
|
116
|
114
|
</el-option>
|
117
|
115
|
</el-select>
|
118
|
|
- </el-form-item>
|
|
116
|
+ </el-form-item>
|
119
|
117
|
</template>
|
120
|
118
|
</el-table-column>
|
121
|
|
- <el-table-column label="批号" align="center" width="130px">
|
|
119
|
+ <el-table-column label="批号" align="center" width="200px">
|
122
|
120
|
<template slot="header" slot-scope="scope">
|
123
|
121
|
<span>批号<span style="color: red">*</span></span>
|
124
|
122
|
</template>
|
125
|
123
|
<template slot-scope="scope">
|
126
|
124
|
<el-form-item :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
|
127
|
|
- <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
|
|
125
|
+ <el-input v-model="scope.row.supply_batch_number" style="width:180px" :disabled="disabled" placeholder="请输入批号"></el-input>
|
128
|
126
|
</el-form-item>
|
129
|
127
|
</template>
|
130
|
128
|
</el-table-column>
|
|
@@ -142,26 +140,26 @@
|
142
|
140
|
</el-form-item>
|
143
|
141
|
</template>
|
144
|
142
|
</el-table-column>
|
145
|
|
- <el-table-column label="可用库存" align="center" width="100px">
|
|
143
|
+ <el-table-column label="可用库存" align="center" width="150px">
|
146
|
144
|
<template slot-scope="scope">
|
147
|
|
- <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
|
|
145
|
+ <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
|
148
|
146
|
<div style="visibility: hidden">/</div>
|
149
|
147
|
</template>
|
150
|
148
|
</el-table-column>
|
151
|
|
- <el-table-column label="数量" align="center" width="120px">
|
|
149
|
+ <el-table-column label="数量" align="center" width="140px">
|
152
|
150
|
<template slot="header" slot-scope="scope">
|
153
|
151
|
<span>数量<span style="color: red">*</span></span>
|
154
|
152
|
</template>
|
155
|
153
|
<template slot-scope="scope">
|
156
|
154
|
<el-form-item :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
|
157
|
|
- <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
|
|
155
|
+ <el-input v-model="scope.row.supply_count" style="width:100px" :disabled="disabled" placeholder="请输入数量"></el-input>
|
158
|
156
|
</el-form-item>
|
159
|
157
|
</template>
|
160
|
158
|
</el-table-column>
|
161
|
159
|
|
162
|
|
- <el-table-column label="采购单价" align="center" width="120px">
|
|
160
|
+ <el-table-column label="采购单价" align="center" width="180px">
|
163
|
161
|
<template slot-scope="scope">
|
164
|
|
- <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
|
|
162
|
+ <el-input v-model="scope.row.supply_price" style="width:140px" :disabled="disabled" placeholder="请输入采购单价"></el-input>
|
165
|
163
|
<div style="visibility: hidden">/</div>
|
166
|
164
|
</template>
|
167
|
165
|
</el-table-column>
|
|
@@ -216,7 +214,7 @@
|
216
|
214
|
|
217
|
215
|
<el-table-column label="备注" align="center" width="200px">
|
218
|
216
|
<template slot-scope="scope">
|
219
|
|
- <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
|
|
217
|
+ <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled" placeholder="请输入备注"></el-input>
|
220
|
218
|
<div style="visibility: hidden">/</div>
|
221
|
219
|
</template>
|
222
|
220
|
</el-table-column>
|
|
@@ -243,17 +241,28 @@
|
243
|
241
|
</template>
|
244
|
242
|
</el-table-column>
|
245
|
243
|
</el-table>
|
|
244
|
+ <div style="margin-top: 10px">
|
|
245
|
+ <el-input
|
|
246
|
+ type="textarea"
|
|
247
|
+ :rows="2"
|
|
248
|
+ placeholder="备注信息"
|
|
249
|
+ v-model="return_remark"
|
|
250
|
+ >
|
|
251
|
+ </el-input>
|
|
252
|
+ </div>
|
246
|
253
|
</el-form>
|
247
|
254
|
<!-- <div style="margin-top:10px">
|
248
|
255
|
合计:{{getAllPrice()}} 元
|
249
|
256
|
</div>
|
250
|
257
|
<div style="margin-top:10px">
|
251
|
|
- <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
|
|
258
|
+ <span>优惠率:<el-input style="width:150px" v-model="rate_of_concession" placeholder="请输入优惠率"></el-input>%</span>
|
252
|
259
|
|
253
|
|
- <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
|
254
|
|
-
|
255
|
|
- <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
|
|
260
|
+ <span>优惠金额:<el-input style="width:150px" v-model="discount_amount" placeholder="请输入优惠金额"></el-input></span>
|
256
|
261
|
|
|
262
|
+ <span>本次付款:<el-input style="width:150px" v-model="payment" placeholder="请输入本次付款"></el-input></span>
|
|
263
|
+
|
|
264
|
+ <span>本次欠款:<el-input style="width:150px" v-model="arrearage" placeholder="请输入本次欠款"></el-input></span>
|
|
265
|
+ </div>
|
257
|
266
|
<span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
|
258
|
267
|
</div> -->
|
259
|
268
|
<Computed :total="total_price" :rate_of_concession="rate_of_concession" :discount_amount="discount_amount"></Computed>
|
|
@@ -346,6 +355,7 @@ return {
|
346
|
355
|
showOne:true,
|
347
|
356
|
showTwo:false,
|
348
|
357
|
warese_out_id:0,
|
|
358
|
+ return_remark:"",
|
349
|
359
|
};
|
350
|
360
|
},
|
351
|
361
|
methods:{
|
|
@@ -392,8 +402,8 @@ getInitOrder(){
|
392
|
402
|
if(drugList[i].max_unit == drugList[i].min_unit){
|
393
|
403
|
drugList[i].unitList = [{id:1,name:""}]
|
394
|
404
|
}
|
395
|
|
-
|
396
|
|
- drugList[i].supply_unit = drugList[i].max_unit
|
|
405
|
+
|
|
406
|
+ drugList[i].supply_unit = drugList[i].max_unit
|
397
|
407
|
for(let j=0;j<drugList[i].unitList.length;j++){
|
398
|
408
|
if(drugList[i].max_unit != drugList[i].min_unit){
|
399
|
409
|
drugList[i].unitList[0].name = drugList[i].max_unit
|
|
@@ -433,19 +443,19 @@ getInitOrder(){
|
433
|
443
|
goodList[i].unitList = [{id:1,name:""}]
|
434
|
444
|
goodList[i].supply_unit = goodList[i].packing_unit
|
435
|
445
|
for(let j=0;j<goodList[i].unitList.length;j++){
|
436
|
|
- goodList[i].unitList[0].name = goodList[i].packing_unit
|
|
446
|
+ goodList[i].unitList[0].name = goodList[i].packing_unit
|
437
|
447
|
}
|
438
|
448
|
this.tabList.push(goodList[i])
|
439
|
449
|
}
|
440
|
450
|
this.goodList = goodList
|
441
|
|
- }
|
|
451
|
+ }
|
442
|
452
|
})
|
443
|
453
|
},
|
444
|
454
|
changeGoodName(val){
|
445
|
455
|
this.currentIndex = val
|
446
|
456
|
},
|
447
|
457
|
changeName(val){
|
448
|
|
-
|
|
458
|
+
|
449
|
459
|
for(let i=0;i<this.recordInfo.tableList.length;i++){
|
450
|
460
|
if(this.currentIndex == i){
|
451
|
461
|
this.recordInfo.tableList[i].project_id = val.id
|
|
@@ -471,7 +481,7 @@ changeName(val){
|
471
|
481
|
this.recordInfo.tableList[i].unitList = val.unitList
|
472
|
482
|
}
|
473
|
483
|
}
|
474
|
|
-
|
|
484
|
+
|
475
|
485
|
|
476
|
486
|
},
|
477
|
487
|
handleEdit(){
|
|
@@ -507,20 +517,6 @@ handleDelete: function(index, row) {
|
507
|
517
|
this.recordInfo.tableList.splice(index, 1)
|
508
|
518
|
}
|
509
|
519
|
},
|
510
|
|
-
|
511
|
|
-changeTypeName(){
|
512
|
|
-
|
513
|
|
-},
|
514
|
|
-startTimeChange(){
|
515
|
|
-
|
516
|
|
-},
|
517
|
|
-endTimeChange(){
|
518
|
|
-
|
519
|
|
-},
|
520
|
|
-search(){
|
521
|
|
-
|
522
|
|
-},
|
523
|
|
-
|
524
|
520
|
getWarehoseInfo(arr,max_unit,min_unit,min_number){
|
525
|
521
|
var total = 0
|
526
|
522
|
var max_str= ""
|
|
@@ -574,7 +570,7 @@ getTimes(time) {
|
574
|
570
|
var total_price = 0
|
575
|
571
|
for(let i=0;i<this.recordInfo.tableList.length;i++){
|
576
|
572
|
total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
|
577
|
|
- }
|
|
573
|
+ }
|
578
|
574
|
return total_price.toFixed(2)
|
579
|
575
|
},
|
580
|
576
|
checkPurchaseOrder(id,index){
|
|
@@ -582,21 +578,21 @@ getTimes(time) {
|
582
|
578
|
confirmButtonText: '确 定',
|
583
|
579
|
cancelButtonText: '取 消',
|
584
|
580
|
type: 'warning'
|
585
|
|
- }).then(() => {
|
|
581
|
+ }).then(() => {
|
586
|
582
|
checkPurchaseOrder(this.id).then(response => {
|
587
|
583
|
if (response.data.state == 1) {
|
588
|
584
|
var info = response.data.data.info
|
589
|
585
|
this.disabled = true
|
590
|
586
|
this.$message.success("审核成功!")
|
591
|
587
|
this.getPurchaseOrderDetail()
|
592
|
|
- }
|
|
588
|
+ }
|
593
|
589
|
})
|
594
|
590
|
})
|
595
|
591
|
.catch(() => {
|
596
|
|
- })
|
|
592
|
+ })
|
597
|
593
|
},
|
598
|
594
|
getPurchaseOrderDetail(){
|
599
|
|
-
|
|
595
|
+
|
600
|
596
|
var id = this.$route.query.id
|
601
|
597
|
var ids = this.$route.query.ids
|
602
|
598
|
getPurchaseOrderInfo(id,ids).then(response=>{
|
|
@@ -609,7 +605,7 @@ getTimes(time) {
|
609
|
605
|
this.discount_amount = info.discount_amount
|
610
|
606
|
this.number = info.number
|
611
|
607
|
var orderInfo = response.data.data.orderInfo
|
612
|
|
-
|
|
608
|
+
|
613
|
609
|
for(let i=0;i<orderInfo.length;i++){
|
614
|
610
|
orderInfo[i].supply_batch_number = ""
|
615
|
611
|
orderInfo[i].supply_product_date = ""
|
|
@@ -640,36 +636,36 @@ getTimes(time) {
|
640
|
636
|
orderInfo[i].unitList[0].name = drugList[j].max_unit
|
641
|
637
|
}
|
642
|
638
|
}
|
643
|
|
- }
|
644
|
|
- }
|
|
639
|
+ }
|
|
640
|
+ }
|
645
|
641
|
if(orderInfo[i].is_source == 2){
|
646
|
642
|
for(let j=0;j<goodList.length;j++){
|
647
|
643
|
if(orderInfo[i].project_id == goodList[j].id){
|
648
|
644
|
orderInfo[i].unitList = [{id:1,name:""}]
|
649
|
645
|
orderInfo[i].unitList[0].name = goodList[j].packing_unit
|
650
|
646
|
}
|
651
|
|
- }
|
652
|
|
- }
|
|
647
|
+ }
|
|
648
|
+ }
|
653
|
649
|
}
|
654
|
|
-
|
|
650
|
+
|
655
|
651
|
this.recordInfo.tableList= []
|
656
|
652
|
this.recordInfo.tableList = orderInfo
|
657
|
|
-
|
|
653
|
+
|
658
|
654
|
console.log("orderINFO23323232",this.recordInfo.tableList)
|
659
|
655
|
}
|
660
|
|
- })
|
|
656
|
+ })
|
661
|
657
|
},
|
662
|
658
|
toPrint(){
|
663
|
659
|
var id = this.$route.query.id
|
664
|
|
- this.$router.push({path:"/purchase/order/print?&id="+id})
|
|
660
|
+ this.$router.push({path:"/purchase/order/print?&id="+id})
|
665
|
661
|
},
|
666
|
|
- saveGoodOrder(){
|
667
|
|
-
|
|
662
|
+ saveGoodOrder(){
|
|
663
|
+
|
668
|
664
|
if(this.supplier_name == 0 || this.supplier_name == ""){
|
669
|
665
|
this.$message.error("供应商不能为空!")
|
670
|
666
|
this.loading = false
|
671
|
667
|
return false
|
672
|
|
- }
|
|
668
|
+ }
|
673
|
669
|
|
674
|
670
|
for(let i=0;i<this.recordInfo.tableList.length;i++){
|
675
|
671
|
|
|
@@ -677,7 +673,7 @@ getTimes(time) {
|
677
|
673
|
this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
|
678
|
674
|
this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
|
679
|
675
|
this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
|
680
|
|
-
|
|
676
|
+
|
681
|
677
|
for(let j=0;j<this.manufactuerList.length;j++){
|
682
|
678
|
if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
|
683
|
679
|
this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
|
|
@@ -694,10 +690,11 @@ getTimes(time) {
|
694
|
690
|
this.loading = true
|
695
|
691
|
var warehousing_id = this.$route.query.id
|
696
|
692
|
var params = {
|
697
|
|
- "stockIn":this.recordInfo.tableList,
|
|
693
|
+ stockIn:this.recordInfo.tableList,
|
|
694
|
+ return_remake:this.return_remark,
|
698
|
695
|
}
|
699
|
|
- console.log("stockIN2323322332322323",params)
|
700
|
|
-
|
|
696
|
+ console.log("stockIN2323322332322323",params)
|
|
697
|
+
|
701
|
698
|
addGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehousing_id,this.number,this.rate_of_concession,this.discount_amount).then(response=>{
|
702
|
699
|
if(response.data.state == 1){
|
703
|
700
|
this.loading = false
|
|
@@ -713,6 +710,7 @@ getTimes(time) {
|
713
|
710
|
this.payment =warehouseOut.payment
|
714
|
711
|
this.arrearage =warehouseOut.arrearage
|
715
|
712
|
this.supplier_name = warehouseOut.supplier_id
|
|
713
|
+ this.return_remake = warehouseOut.return_remake
|
716
|
714
|
this.start_time = this.getTimes(warehouseOut.document_date)
|
717
|
715
|
for(let i=0;i< orderInfo.length;i++){
|
718
|
716
|
orderInfo[i].supply_count = orderInfo[i].count
|
|
@@ -737,32 +735,32 @@ getTimes(time) {
|
737
|
735
|
orderInfo[i].unitList[0].name = this.drugList[j].max_unit
|
738
|
736
|
}
|
739
|
737
|
}
|
740
|
|
- }
|
741
|
|
- }
|
|
738
|
+ }
|
|
739
|
+ }
|
742
|
740
|
if(orderInfo[i].is_source == 2){
|
743
|
741
|
for(let j=0;j<this.goodList.length;j++){
|
744
|
742
|
if(orderInfo[i].project_id == this.goodList[j].id){
|
745
|
743
|
orderInfo[i].unitList = [{id:1,name:""}]
|
746
|
744
|
orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
|
747
|
745
|
}
|
748
|
|
- }
|
749
|
|
- }
|
|
746
|
+ }
|
|
747
|
+ }
|
750
|
748
|
}
|
751
|
749
|
this.recordInfo.tableList= []
|
752
|
750
|
this.recordInfo.tableList = orderInfo
|
753
|
|
-
|
|
751
|
+
|
754
|
752
|
}
|
755
|
753
|
})
|
756
|
754
|
}
|
757
|
755
|
})
|
758
|
756
|
},
|
759
|
|
- updateGoodOrder(){
|
760
|
|
-
|
|
757
|
+ updateGoodOrder(){
|
|
758
|
+
|
761
|
759
|
if(this.supplier_name == 0 || this.supplier_name == ""){
|
762
|
760
|
this.$message.error("供应商不能为空!")
|
763
|
761
|
this.loading = false
|
764
|
762
|
return false
|
765
|
|
- }
|
|
763
|
+ }
|
766
|
764
|
console.log("表哥2323233232",this.recordInfo.tableList)
|
767
|
765
|
for(let i=0;i<this.recordInfo.tableList.length;i++){
|
768
|
766
|
|
|
@@ -770,7 +768,7 @@ getTimes(time) {
|
770
|
768
|
this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
|
771
|
769
|
this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
|
772
|
770
|
this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
|
773
|
|
-
|
|
771
|
+
|
774
|
772
|
for(let j=0;j<this.manufactuerList.length;j++){
|
775
|
773
|
if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
|
776
|
774
|
this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
|
|
@@ -787,15 +785,16 @@ getTimes(time) {
|
787
|
785
|
this.loading = true
|
788
|
786
|
var warehose_out_id = this.$route.query.id
|
789
|
787
|
var params = {
|
790
|
|
- "stockIn":this.recordInfo.tableList,
|
791
|
|
- }
|
|
788
|
+ stockIn:this.recordInfo.tableList,
|
|
789
|
+ return_remake:this.return_remake,
|
|
790
|
+ }
|
792
|
791
|
console.log("sotckind23232232323232323232",params)
|
793
|
|
-
|
|
792
|
+
|
794
|
793
|
updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then(response=>{
|
795
|
794
|
if(response.data.state == 1){
|
796
|
795
|
this.loading = false
|
797
|
796
|
this.$message.success("保存成功!")
|
798
|
|
-
|
|
797
|
+
|
799
|
798
|
}
|
800
|
799
|
})
|
801
|
800
|
}
|