|
|
@@ -12,36 +12,36 @@
|
|
|
</div>
|
|
|
<div class="form-group row">
|
|
|
<label for="asn" class="col-sm-2 col-3 text-right">ASN号:</label>
|
|
|
- <div tabindex="0" @keydown="enterVal($event,'asn')" class="form-control col-8 overflow-hidden"
|
|
|
+ <div tabindex="0" @focus="()=>{this.focus='asn'}" @keydown="enterVal($event,'asn')" class="form-control col-8 overflow-hidden"
|
|
|
:contenteditable="!isOnlyKeyboardEnter" :class="errors.asn ? 'is-invalid' : ''"
|
|
|
- id="asn" @blur="checkAsn()">@{{ info.asn ? info.asn : '只需填写后几位,自动补充' }}</div>
|
|
|
+ id="asn" @blur="checkAsn()">@{{ info.asn ? info.asn : (focus=='asn' ? '' : '只需填写后几位,自动补充') }}</div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.asn">
|
|
|
<strong>@{{ errors.asn[0] }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="form-group row">
|
|
|
<label for="station" class="col-sm-2 col-3 text-right">库位:</label>
|
|
|
- <div tabindex="0" @keydown="enterVal($event,'station')" class="form-control col-8 overflow-hidden"
|
|
|
+ <div tabindex="0" @focus="()=>{this.focus='station'}" @keydown="enterVal($event,'station')" class="form-control col-8 overflow-hidden"
|
|
|
:contenteditable="!isOnlyKeyboardEnter" :class="errors.station ? 'is-invalid' : ''"
|
|
|
- id="station" @blur="checkMaximum()">@{{ info.station ? info.station : '扫描货架条码' }}</div>
|
|
|
+ id="station" @blur="checkMaximum()">@{{ info.station ? info.station : (focus=='station' ? '' : '扫描货架条码') }}</div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.station">
|
|
|
<strong>@{{ errors.station[0] }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="form-group row">
|
|
|
<label for="barCode" class="col-sm-2 col-3 text-right">条码:</label>
|
|
|
- <div tabindex="0" @keydown="enterVal($event,'barCode')" class="form-control col-8 overflow-hidden"
|
|
|
+ <div tabindex="0" @focus="()=>{this.focus='barCode'}" @keydown="enterVal($event,'barCode')" class="form-control col-8 overflow-hidden"
|
|
|
:contenteditable="!isOnlyKeyboardEnter" :class="errors.barCode ? 'is-invalid' : ''"
|
|
|
- id="barCode" @blur="checkMaximum()">@{{ info.barCode ? info.barCode : '扫描商品条码' }}</div>
|
|
|
+ id="barCode" @blur="checkMaximum()">@{{ info.barCode ? info.barCode : (focus=='barCode' ? '' : '扫描商品条码') }}</div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.barCode">
|
|
|
<strong>@{{ errors.barCode[0] }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="form-group row">
|
|
|
<label for="amount" class="col-sm-2 col-3 text-right">数量:</label>
|
|
|
- <div tabindex="0" @keydown="enterVal($event,'amount')" class="form-control col-8 overflow-hidden"
|
|
|
+ <div tabindex="0" @focus="()=>{this.focus='amount'}" @keydown="enterVal($event,'amount')" class="form-control col-8 overflow-hidden"
|
|
|
:contenteditable="!isOnlyKeyboardEnter" :class="errors.amount ? 'is-invalid' : ''"
|
|
|
- id="amount" @blur="checkMaximum()">@{{ info.amount ? info.amount : (info.maximum!==undefined ? '最大可上:'+info.maximum : '') }}</div>
|
|
|
+ id="amount" @blur="checkMaximum()">@{{ info.amount ? info.amount : (focus=='amount' ? '' : (info.maximum!==undefined ? '最大可上:'+info.maximum : '')) }}</div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.amount">
|
|
|
<strong>@{{ errors.amount[0] }}</strong>
|
|
|
</span>
|
|
|
@@ -95,6 +95,7 @@
|
|
|
before:{
|
|
|
asn:"",
|
|
|
},
|
|
|
+ focus:"",
|
|
|
errors:{},
|
|
|
ov:{},//溢出减量数值
|
|
|
checkSign:false,
|
|
|
@@ -180,6 +181,7 @@
|
|
|
this.before.asn = 'ASN'+yy+mm+dd+'000';
|
|
|
},
|
|
|
checkAsn(){
|
|
|
+ this.focus = "";
|
|
|
if(!this.info.asn)return;
|
|
|
let len = this.info.asn.length;
|
|
|
if (len<13)this.info.asn = this.before.asn.substr(0,13-len)+this.info.asn;
|
|
|
@@ -190,16 +192,17 @@
|
|
|
this.checkSign = false;
|
|
|
},
|
|
|
checkMaximum(){
|
|
|
+ this.focus = "";
|
|
|
if (!this.info.asn || !this.info.barCode || this.checkSign)return;
|
|
|
window.tempTip.postBasicRequest("{{url('store/inStorage/checkMaximum')}}",this.info,res=>{
|
|
|
this.info.maximum = res.maximum;
|
|
|
this.info.material_box_id = res.material_box_id;
|
|
|
this.info.material_box_model_id = res.material_box_model_id;
|
|
|
this.info.commodity_id = res.commodity_id;
|
|
|
- this.checkSign = true;
|
|
|
if(!this.info.amount)this.info.amount = res.maximum;
|
|
|
return "该库位最大可上数为"+res.maximum;
|
|
|
});
|
|
|
+ this.checkSign = true;
|
|
|
},
|
|
|
enterVal(e,type){
|
|
|
if (e.keyCode === 229){e.preventDefault();return;}
|