|
@@ -43,8 +43,8 @@
|
43
|
43
|
<div>
|
44
|
44
|
<el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
|
45
|
45
|
<el-button size="small" type="primary" @click="toCheck">核对</el-button>
|
46
|
|
- <el-button size="small" type="primary" @click="print">打印</el-button>
|
47
|
|
- <el-button size="small" type="primary" @click="exportList">导出</el-button>
|
|
46
|
+ <!-- <el-button size="small" type="primary" @click="print">打印</el-button>
|
|
47
|
+ <el-button size="small" type="primary" @click="exportList">导出</el-button> -->
|
48
|
48
|
</div>
|
49
|
49
|
</div>
|
50
|
50
|
<el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
|
|
@@ -64,6 +64,16 @@
|
64
|
64
|
{{scope.row.count}}
|
65
|
65
|
</template>
|
66
|
66
|
</el-table-column>
|
|
67
|
+ <el-table-column prop="name" label="库存" width="100" align="center">
|
|
68
|
+ <template slot-scope="scope">
|
|
69
|
+ {{scope.row.total}}
|
|
70
|
+ </template>
|
|
71
|
+ </el-table-column>
|
|
72
|
+ <el-table-column prop="name" label="批次" width="100" align="center">
|
|
73
|
+ <template slot-scope="scope">
|
|
74
|
+ {{scope.row.number}}
|
|
75
|
+ </template>
|
|
76
|
+ </el-table-column>
|
67
|
77
|
<el-table-column prop="name" label="盘点人" align="center">
|
68
|
78
|
<template slot-scope="scope" >
|
69
|
79
|
{{scope.row.user_name}}
|
|
@@ -81,12 +91,13 @@
|
81
|
91
|
</el-table-column>
|
82
|
92
|
<el-table-column prop="name" label="状态" align="center">
|
83
|
93
|
<template slot-scope="scope">
|
84
|
|
- <span v-if="scope.row.checker_status == 1">已审核</span>
|
85
|
|
- <span v-if="scope.row.checker_status == 2">未审核</span>
|
|
94
|
+ <span v-if="scope.row.checker_status == 1">盘点完成</span>
|
|
95
|
+ <span v-if="scope.row.checker_status == 2">正在盘点</span>
|
86
|
96
|
</template>
|
87
|
97
|
</el-table-column>
|
88
|
|
- <el-table-column label="操作" align="center">
|
|
98
|
+ <el-table-column label="操作" align="center" width="300">
|
89
|
99
|
<template slot-scope="scope">
|
|
100
|
+ <el-button type="primary" size="small" @click="getInventory(scope.row.id,scope.row.checker_status)">校对</el-button>
|
90
|
101
|
<el-button type="primary" size="small" @click="getInventoryDetail(scope.row.id,scope.row.checker_status)">编辑</el-button>
|
91
|
102
|
<el-button type="danger" size="small" @click="deleteInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
|
92
|
103
|
</template>
|
|
@@ -132,6 +143,17 @@
|
132
|
143
|
<el-form-item label="规格">
|
133
|
144
|
<el-input v-model="form.specification_name"></el-input>
|
134
|
145
|
</el-form-item>
|
|
146
|
+ <el-form-item label="批号">
|
|
147
|
+ <el-select v-model="form.number" filterable placeholder="请选择">
|
|
148
|
+ <el-option
|
|
149
|
+ v-for="(item,index) in numberList"
|
|
150
|
+ :key="index"
|
|
151
|
+ :label="item.number"
|
|
152
|
+ :value="item.number">
|
|
153
|
+ </el-option>
|
|
154
|
+ </el-select>
|
|
155
|
+ </el-form-item>
|
|
156
|
+
|
135
|
157
|
<el-form-item label="单位">
|
136
|
158
|
<el-input v-model="form.warehousing_unit"></el-input>
|
137
|
159
|
</el-form-item>
|
|
@@ -189,6 +211,7 @@
|
189
|
211
|
{{scope.row.count}}
|
190
|
212
|
</template>
|
191
|
213
|
</el-table-column>
|
|
214
|
+
|
192
|
215
|
<el-table-column prop="name" label="原进货价" width="100" align="center">
|
193
|
216
|
<template slot-scope="scope">
|
194
|
217
|
{{scope.row.buy_price}}
|
|
@@ -355,13 +378,72 @@
|
355
|
378
|
<el-button @click="modefiyePriceDialogVisible = false">取 消</el-button>
|
356
|
379
|
<el-button type="primary" @click="modifyInventory">保存</el-button>
|
357
|
380
|
</span>
|
358
|
|
- </el-dialog>
|
|
381
|
+ </el-dialog>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+ <el-dialog
|
|
385
|
+ title="校对"
|
|
386
|
+ :visible.sync="proofPriceDialogVisible"
|
|
387
|
+ width="50%">
|
|
388
|
+ <span>
|
|
389
|
+ <el-form :model="form">
|
|
390
|
+ <el-row>
|
|
391
|
+ <el-col>
|
|
392
|
+ <el-form-item label="耗材名称:">
|
|
393
|
+ <el-autocomplete
|
|
394
|
+ class="checkSearch"
|
|
395
|
+ popper-class="my-autocomplete"
|
|
396
|
+ v-model="form.good_name"
|
|
397
|
+ :fetch-suggestions="querySearchAsync"
|
|
398
|
+ :trigger-on-focus="true"
|
|
399
|
+ placeholder="请输入耗材名称"
|
|
400
|
+ @select="handleSelect"
|
|
401
|
+ @input="changeGoodName(scope.$index)"
|
|
402
|
+ style="width:160px;"
|
|
403
|
+ :disabled="true"
|
|
404
|
+ >
|
|
405
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
406
|
+ <template slot-scope="{ item }">
|
|
407
|
+ <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
|
|
408
|
+ </template>
|
|
409
|
+ </el-autocomplete>
|
|
410
|
+ </el-form-item>
|
|
411
|
+ <el-form-item label="规格">
|
|
412
|
+ <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
|
|
413
|
+ </el-form-item>
|
|
414
|
+ <el-form-item label="盘点数量:">
|
|
415
|
+ <el-input v-model="form.count" style="width:200px" :disabled="true"></el-input>
|
|
416
|
+ </el-form-item>
|
|
417
|
+ <el-form-item label="库存数量:" :disabled="true">
|
|
418
|
+ <el-input v-model="form.total" style="width:200px"></el-input>
|
|
419
|
+ </el-form-item>
|
|
420
|
+ <el-form-item label="校对数量:">
|
|
421
|
+ <el-input v-model="form.proof_count" style="width:200px"></el-input>
|
|
422
|
+ </el-form-item>
|
|
423
|
+ </el-col>
|
|
424
|
+ </el-row>
|
|
425
|
+ <el-row>
|
|
426
|
+ <el-col>
|
|
427
|
+ <el-form-item label="备注:">
|
|
428
|
+ <div style="display:flex;">
|
|
429
|
+ <el-input v-model="form.remark" style="width:200px"></el-input>
|
|
430
|
+ </div>
|
|
431
|
+ </el-form-item>
|
|
432
|
+ </el-col>
|
|
433
|
+ </el-row>
|
|
434
|
+ </el-form>
|
|
435
|
+ </span>
|
|
436
|
+ <span slot="footer" class="dialog-footer">
|
|
437
|
+ <el-button @click="proofPriceDialogVisible = false">取 消</el-button>
|
|
438
|
+ <el-button type="primary" @click="modifyInventory">保存</el-button>
|
|
439
|
+ </span>
|
|
440
|
+ </el-dialog>
|
359
|
441
|
</div>
|
360
|
442
|
</template>
|
361
|
443
|
|
362
|
444
|
<script>
|
363
|
445
|
import { uParseTime } from '@/utils/tools'
|
364
|
|
-import { postSearchGoodWarehouseList,saveInventory,getInventoryList,SaveCheckedInventory,getInventoryDetail,modifyInventory,deleteInventory } from "@/api/stock"
|
|
446
|
+import { postSearchGoodWarehouseList,saveInventory,getInventoryList,SaveCheckedInventory,getInventoryDetail,modifyInventory,deleteInventory,getStockBatchNumber,getGoodWarehouseList } from "@/api/stock"
|
365
|
447
|
export default {
|
366
|
448
|
name: "inventory",
|
367
|
449
|
data() {
|
|
@@ -398,7 +480,10 @@ export default {
|
398
|
480
|
good_origin_place:"",
|
399
|
481
|
report_count:"",
|
400
|
482
|
total:"",
|
401
|
|
-
|
|
483
|
+ expiry_date:"",
|
|
484
|
+ product_date:"",
|
|
485
|
+ number:"",
|
|
486
|
+ proof_count:"",
|
402
|
487
|
},
|
403
|
488
|
manufacturerList:[],
|
404
|
489
|
dealerList:[],
|
|
@@ -416,7 +501,9 @@ export default {
|
416
|
501
|
checkDialogVisible:false,
|
417
|
502
|
editPriceDialogVisible:false,
|
418
|
503
|
modefiyePriceDialogVisible:false,
|
|
504
|
+ proofPriceDialogVisible:false,
|
419
|
505
|
id:0,
|
|
506
|
+ numberList:[],
|
420
|
507
|
}
|
421
|
508
|
},
|
422
|
509
|
methods:{
|
|
@@ -462,6 +549,8 @@ export default {
|
462
|
549
|
},
|
463
|
550
|
handleSelect(val){
|
464
|
551
|
console.log("val232323223",val)
|
|
552
|
+ this.getStockBatchNumber(val.good_id)
|
|
553
|
+ this.getGoodWarehouseList(val.good_id)
|
465
|
554
|
this.form.id = val.id
|
466
|
555
|
this.form.good_id = val.good_id,
|
467
|
556
|
this.form.good_name = val.good_name
|
|
@@ -475,10 +564,12 @@ export default {
|
475
|
564
|
this.form.buy_price = val.buy_price
|
476
|
565
|
this.form.warehousing_unit = val.packing_unit
|
477
|
566
|
this.form.total = val.total
|
478
|
|
-
|
|
567
|
+ this.form.number = val.number
|
|
568
|
+ this.form.expiry_date = val.expiry_date
|
|
569
|
+ this.form.product_date = val.product_date
|
479
|
570
|
},
|
480
|
571
|
search(){
|
481
|
|
-
|
|
572
|
+ this.getlist()
|
482
|
573
|
},
|
483
|
574
|
print(){
|
484
|
575
|
if(this.ids == ""){
|
|
@@ -512,7 +603,7 @@ export default {
|
512
|
603
|
good_name:this.form.good_name,
|
513
|
604
|
specification_name:this.form.specification_name,
|
514
|
605
|
warehousing_unit:this.form.warehousing_unit,
|
515
|
|
- count:parseInt(this.form.count),
|
|
606
|
+ count:this.form.count,
|
516
|
607
|
buy_price:this.form.buy_price.toString(),
|
517
|
608
|
packing_price:this.form.packing_price.toString(),
|
518
|
609
|
manufacturer:this.form.manufacturer,
|
|
@@ -522,12 +613,27 @@ export default {
|
522
|
613
|
warehousing_order:this.form.warehousing_order,
|
523
|
614
|
dealer:this.form.dealer,
|
524
|
615
|
start_time:this.getTime(new Date()),
|
|
616
|
+ product_date:this.form.product_date,
|
|
617
|
+ expiry_date:this.form.expiry_date,
|
|
618
|
+ number:this.form.number,
|
|
619
|
+ warehousing_info_id:0,
|
|
620
|
+ total:this.form.total,
|
|
621
|
+
|
525
|
622
|
}
|
526
|
623
|
this.tableData.push(obj)
|
527
|
624
|
},
|
528
|
625
|
saveInventory(){
|
529
|
626
|
for(let i=0;i<this.tableData.length;i++){
|
|
627
|
+ for(let j=0;j<this.numberList.length;j++){
|
|
628
|
+ if(this.tableData[i].number == this.numberList[j].number){
|
|
629
|
+ this.tableData[i].warehousing_info_id = this.numberList[j].id
|
|
630
|
+ }
|
|
631
|
+ this.tableData[i].expiry_date = parseInt(this.tableData[i].expiry_date)
|
|
632
|
+ this.tableData[i].product_date = parseInt(this.tableData[i].product_date)
|
|
633
|
+ }
|
|
634
|
+
|
530
|
635
|
this.tableData[i].count = parseInt(this.tableData[i].count)
|
|
636
|
+ this.tableData[i].total = parseInt(this.tableData[i].total)
|
531
|
637
|
if(this.tableData[i].manufacturer == 0){
|
532
|
638
|
this.tableData[i].manufacturer = ""
|
533
|
639
|
}
|
|
@@ -537,12 +643,15 @@ export default {
|
537
|
643
|
}
|
538
|
644
|
var params = {
|
539
|
645
|
tableData:this.tableData,
|
540
|
|
- }
|
|
646
|
+ }
|
|
647
|
+ console.log("params",params)
|
|
648
|
+
|
541
|
649
|
saveInventory(params).then(response=>{
|
542
|
650
|
if(response.data.state == 1){
|
543
|
651
|
var msg = response.data.data.msg
|
544
|
652
|
this.$message.success("保存成功")
|
545
|
653
|
this.dialogVisible = false
|
|
654
|
+ this.getlist()
|
546
|
655
|
}
|
547
|
656
|
})
|
548
|
657
|
},
|
|
@@ -636,6 +745,22 @@ export default {
|
636
|
745
|
this.form.count = ""
|
637
|
746
|
this.form.remark = ""
|
638
|
747
|
},
|
|
748
|
+ getInventory(id){
|
|
749
|
+ getInventoryDetail(id).then(response=>{
|
|
750
|
+ if(response.data.state == 1){
|
|
751
|
+ var detail = response.data.data.detail
|
|
752
|
+ console.log("detial",detail)
|
|
753
|
+ this.form.good_name = detail.good_name
|
|
754
|
+ this.form.specification_name = detail.specification_name
|
|
755
|
+ this.form.count = detail.count
|
|
756
|
+ this.form.remark = detail.remark
|
|
757
|
+ this.form.total = detail.total
|
|
758
|
+ this.id = detail.id
|
|
759
|
+ this.proofPriceDialogVisible = true
|
|
760
|
+
|
|
761
|
+ }
|
|
762
|
+ })
|
|
763
|
+ },
|
639
|
764
|
getInventoryDetail(id,check_status){
|
640
|
765
|
if(check_status == 1){
|
641
|
766
|
this.$message.error("已核对的不能编辑")
|
|
@@ -722,6 +847,31 @@ export default {
|
722
|
847
|
formatJson(filterVal, jsonData) {
|
723
|
848
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
724
|
849
|
},
|
|
850
|
+
|
|
851
|
+ getStockBatchNumber(id){
|
|
852
|
+ var params = {
|
|
853
|
+ id:id
|
|
854
|
+ }
|
|
855
|
+ getStockBatchNumber(params).then(response=>{
|
|
856
|
+ if(response.data.state == 1){
|
|
857
|
+ var list = response.data.data.list
|
|
858
|
+ console.log("批号列表",list)
|
|
859
|
+ this.numberList = list
|
|
860
|
+ }
|
|
861
|
+ })
|
|
862
|
+ },
|
|
863
|
+ getGoodWarehouseList(id){
|
|
864
|
+ var params = {
|
|
865
|
+ id:id,
|
|
866
|
+ }
|
|
867
|
+ getGoodWarehouseList(params).then(response=>{
|
|
868
|
+ if(response.data.state == 1){
|
|
869
|
+ var list = response.data.data.list
|
|
870
|
+ this.form.total = list.stock_count
|
|
871
|
+ console.log("list23232",list)
|
|
872
|
+ }
|
|
873
|
+ })
|
|
874
|
+ }
|
725
|
875
|
},
|
726
|
876
|
created(){
|
727
|
877
|
this.getlist()
|