|
|
@@ -7,7 +7,10 @@
|
|
|
<a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('enterStockInventory',3)}">盘点中({!! $inventoryAccount->id !!})</a>
|
|
|
</li>
|
|
|
@endcomponent
|
|
|
- <div id="list" class="d-none container-fluid" >
|
|
|
+ <div class="text-center h5 mt-2" id="loadingPage">
|
|
|
+ 载入中……
|
|
|
+ </div>
|
|
|
+ <div id="list" class="d-none container-fluid d-none" >
|
|
|
<div class="mt-3">
|
|
|
<span class="mt-3" >
|
|
|
@can('库存管理-盘点-完结')
|
|
|
@@ -635,8 +638,8 @@
|
|
|
},
|
|
|
@endforeach
|
|
|
],
|
|
|
- 条码索引_记录: [],
|
|
|
- 库位索引_记录: [],
|
|
|
+ 条码索引_记录: {},
|
|
|
+ 库位索引_记录: {},
|
|
|
checkData: [],
|
|
|
selectedStyle:'',
|
|
|
指定盘点记录列:[],
|
|
|
@@ -670,8 +673,11 @@
|
|
|
},
|
|
|
mounted: function () {
|
|
|
let _this = this;
|
|
|
+ (function 显示渲染后页面(){
|
|
|
+ $('#loadingPage').remove();
|
|
|
+ $('#list').removeClass('d-none');
|
|
|
+ })()
|
|
|
$(".tooltipTarget").tooltip({'trigger': 'hover'});
|
|
|
- $("#list").removeClass('d-none');
|
|
|
$barcodeInput=$('#barcodeInput');
|
|
|
$locationInput=$('#locationInput');
|
|
|
$amountInput=$('#amountInput');
|
|
|
@@ -717,8 +723,7 @@
|
|
|
});
|
|
|
header.init();
|
|
|
},0);
|
|
|
- this.以条码建立记录索引();
|
|
|
- this.以库位建立记录索引();
|
|
|
+ this.建立记录索引();
|
|
|
},
|
|
|
methods:{
|
|
|
inputs() {
|
|
|
@@ -797,20 +802,15 @@
|
|
|
}
|
|
|
this.筛选出记录(_this.inputs().location,_this.inputs().barcode);
|
|
|
},100,{ 'trailing': false }),
|
|
|
- 以条码建立记录索引(){
|
|
|
+ 建立记录索引(){
|
|
|
let _this=this;
|
|
|
_this.inventoryMissions.forEach(function (inventoryMission) {
|
|
|
inventoryMission.commodity_barcodes.forEach(function (barcode) {
|
|
|
- _this.条码索引_记录[barcode.code]=inventoryMission;
|
|
|
- _this.条码索引_记录.push(_this.条码索引_记录[barcode.code])
|
|
|
+ if(!Array.isArray(_this.条码索引_记录[barcode.code])) _this.条码索引_记录[barcode.code]=[];
|
|
|
+ _this.条码索引_记录[barcode.code].push(inventoryMission);
|
|
|
})
|
|
|
- });
|
|
|
- },
|
|
|
- 以库位建立记录索引(){
|
|
|
- let _this=this;
|
|
|
- _this.inventoryMissions.forEach(function (inventoryMission) {
|
|
|
- _this.库位索引_记录[inventoryMission.location]=inventoryMission;
|
|
|
- _this.库位索引_记录.push(_this.库位索引_记录[inventoryMission.location])
|
|
|
+ if(!Array.isArray(_this.库位索引_记录[inventoryMission.location])) _this.库位索引_记录[inventoryMission.location]=[];
|
|
|
+ _this.库位索引_记录[inventoryMission.location].push(inventoryMission);
|
|
|
});
|
|
|
},
|
|
|
清空指定盘点记录列(){
|
|
|
@@ -836,15 +836,14 @@
|
|
|
if(!库位)return false;
|
|
|
if(!条码)return false;
|
|
|
if (!_this.库位索引_记录[库位]||(!_this.条码索引_记录[条码]&&(await _this.is条码存在于WMS(条码)))) return;
|
|
|
- _this.inventoryMissions.forEach(function (inventoryMission) {
|
|
|
- inventoryMission.commodity_barcodes.forEach(function (barcode) {
|
|
|
- if (inventoryMission.location===库位 && 条码===barcode.code){
|
|
|
- if(!_this.指定盘点记录列.includes(inventoryMission)){
|
|
|
- _this.指定盘点记录列.push(inventoryMission);
|
|
|
- }
|
|
|
+ if(_this.库位索引_记录[条码]){
|
|
|
+ let inventoryMission=_this.条码索引_记录[条码];
|
|
|
+ if (inventoryMission.location===库位){
|
|
|
+ if(!_this.指定盘点记录列.includes(inventoryMission)){
|
|
|
+ _this.指定盘点记录列.push(inventoryMission);
|
|
|
}
|
|
|
- })
|
|
|
- });
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
放置焦点光标至正确位置:_.throttle(function(){
|
|
|
let _this=this;
|
|
|
@@ -1241,17 +1240,17 @@
|
|
|
tempTip.setDuration(3000);
|
|
|
tempTip.show('增加系统之外的盘点记录失败!');
|
|
|
} else {
|
|
|
- _this.inventoryMissions.push(response.data.inventoryAccountMission);
|
|
|
- _this.inventoryMissions.every(function (inventoryAccountMission, i) {
|
|
|
- if (parseInt(inventoryAccountMission.id) === parseInt(response.data.inventoryAccountMission.id)) {
|
|
|
- inventoryAccountMission = response.data.inventoryAccountMission;
|
|
|
- inventoryAccountMission.stockInventoryPersons = response.data.stockInventoryPersons;
|
|
|
- _this.inventoryMissions.splice(i, 1);
|
|
|
- _this.inventoryMissions.unshift(inventoryAccountMission);
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true
|
|
|
+ let inventoryAccountMission=response.data.inventoryAccountMission;
|
|
|
+ inventoryAccountMission.commodity_barcodes = response.data.inventoryAccountMission.commodity.barcodes;
|
|
|
+ inventoryAccountMission.commodity_name = response.data.inventoryAccountMission.commodity.name;
|
|
|
+ inventoryAccountMission.stockInventoryPersons = response.data.stockInventoryPersons;
|
|
|
+ inventoryAccountMission.produced_at = '';
|
|
|
+ inventoryAccountMission.valid_at = '';
|
|
|
+ _this.inventoryMissions.push(inventoryAccountMission);
|
|
|
+ inventoryAccountMission.commodity_barcodes.forEach(function(barcode){
|
|
|
+ _this.条码索引_记录[barcode.code]=inventoryAccountMission;
|
|
|
});
|
|
|
+ _this.库位索引_记录[location]=inventoryAccountMission;
|
|
|
_this.重排序并标记全列表类型(_this.inventoryMissions);
|
|
|
_this.清空inputs();
|
|
|
tempTip.setDuration(3000);
|