|
|
@@ -3,7 +3,7 @@
|
|
|
@section('content')
|
|
|
<div id="container" class="d-none container-fluid mt-2">
|
|
|
<div class="card">
|
|
|
- <div class="card-header">
|
|
|
+ <div class="card-header m-0">
|
|
|
<b>波次信息</b>
|
|
|
<button class="btn text-white btn-sm btn-info pull-right" @click="isShow=!isShow" data-toggle="collapse" data-target="#body">@{{ isShow ? '隐藏' : '显示' }}</button>
|
|
|
</div>
|
|
|
@@ -19,18 +19,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="card mt-2">
|
|
|
- <div class="card-header row m-0">
|
|
|
+ <div class="card-header row m-0 p-0">
|
|
|
<b class="col-4">分拣信息</b>
|
|
|
- <input id="barcode" v-model="barcode" @keydown.enter="searchBarcode()" class="form-control form-control-sm rounded-pill col-6 offset-2" placeholder="条码"></input>
|
|
|
+ <input id="barcode" v-model="barcode" @keydown.13="searchBarcode()" class="form-control form-control-sm rounded-pill col-6 offset-2" placeholder="条码"></input>
|
|
|
</div>
|
|
|
<div class="card-body">
|
|
|
- <div class="row border-info p-0" style="height:60vh;overflow-y: auto">
|
|
|
- <div class="col-4 m-0" style="height: 50px;border: 1px solid #aaaaaa;z-index:100;position:relative;" v-for="index in waves.length"
|
|
|
- :style="[waveQtyMap['_'+(index-1)] && waveQtyMap['_'+(index-1)]>0 ? {boxShadow: 'rgba(19,193,137) 0 0 5px 5px inset'} : '']">
|
|
|
- <div class="text-center small font-weight-bold text-secondary">@{{ 'W-'+index }}</div>
|
|
|
+ <div class="row border-info p-0" style="height:65vh;overflow-y: auto">
|
|
|
+ <div class="col-4 m-0 p-1" style="height: 55px;border: 1px solid #aaaaaa;z-index:100;position:relative;" v-for="index in waves.length"
|
|
|
+ :style="[waveQtyMap['_'+(index-1)] && waveQtyMap['_'+(index-1)].sum>0 ? {boxShadow: colorPool[colorIndex]+' 0 0 5px 5px inset'} : '']">
|
|
|
+ <div class="text-center small font-weight-bold h-25 text-secondary">@{{ 'W-'+index }}</div>
|
|
|
<div style="display:flex;align-items:center;justify-content:center;" class="w-100 h-50 text-primary font-weight-bold">
|
|
|
- @{{ waveQtyMap['_'+(index-1)] ? waveQtyMap['_'+(index-1)] : '0' }}
|
|
|
+ @{{ waveQtyMap['_'+(index-1)] ? waveQtyMap['_'+(index-1)].sum : '0' }}
|
|
|
</div>
|
|
|
+ <div class="text-center small font-weight-bold h-25 text-muted mb-1">@{{ waveQtyMap['_'+(index-1)] ? waveQtyMap['_'+(index-1)].lot : '0' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -56,6 +57,10 @@
|
|
|
isShow:false,
|
|
|
waves:[],
|
|
|
waveQtyMap:{},
|
|
|
+ colorIndex:0,
|
|
|
+ colorPool:[
|
|
|
+ "RGB(224,41,43)","rgba(19,193,137)","RGB(97,179,233)"
|
|
|
+ ]
|
|
|
},
|
|
|
mounted:function(){
|
|
|
this.pageInit();
|
|
|
@@ -91,18 +96,33 @@
|
|
|
},
|
|
|
searchBarcode(){
|
|
|
let waveQtyMap = {};
|
|
|
- this.waves.forEach((wave,i)=>{
|
|
|
- wave.forEach(order=>{
|
|
|
- if (order.barcode === this.barcode){
|
|
|
- if (waveQtyMap['_'+i]===undefined)waveQtyMap['_'+i] = 1;
|
|
|
- else waveQtyMap['_'+i]++;
|
|
|
- }
|
|
|
+ try {
|
|
|
+ this.waves.forEach((wave,i)=>{
|
|
|
+ wave.forEach(order=>{
|
|
|
+ if (order.barcode === this.barcode){
|
|
|
+ if (order.scanSign!==undefined){
|
|
|
+ throw new Error("unique");
|
|
|
+ }
|
|
|
+ order.scanSign = true;
|
|
|
+ if (waveQtyMap['_'+i]===undefined){
|
|
|
+ waveQtyMap['_'+i] = {"sum":order.qty,"lot":order.location};
|
|
|
+ } else waveQtyMap['_'+i].sum += order.qty;
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- this.waveQtyMap = waveQtyMap;
|
|
|
- let el = $("#barcode");
|
|
|
- el.focus();
|
|
|
- el.select();
|
|
|
+ }catch (e){
|
|
|
+ window.tempTip.setDuration(2000);
|
|
|
+ window.tempTip.setIndex(999);
|
|
|
+ window.tempTip.show("重复扫描");
|
|
|
+ return;
|
|
|
+ }finally {
|
|
|
+ this.waveQtyMap = waveQtyMap;
|
|
|
+ let el = $("#barcode");
|
|
|
+ el.focus();
|
|
|
+ el.select();
|
|
|
+ }
|
|
|
+ if (this.colorIndex===this.colorPool.length-1)this.colorIndex = 0;
|
|
|
+ else this.colorIndex++;
|
|
|
},
|
|
|
}
|
|
|
});
|