|
|
@@ -14,7 +14,7 @@
|
|
|
<label for="asn" class="col-sm-2 col-3 text-right">ASN号:</label>
|
|
|
<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 : (focus=='asn' ? '' : '只需填写后几位,自动补充') }}</div>
|
|
|
+ id="asn" @blur="checkAsn($event,'asn')"><span>@{{ info.asn ? info.asn : (focus=='asn' ? '' : '只需填写后几位,自动补充') }}</span></div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.asn">
|
|
|
<strong>@{{ errors.asn[0] }}</strong>
|
|
|
</span>
|
|
|
@@ -23,7 +23,7 @@
|
|
|
<label for="station" class="col-sm-2 col-3 text-right">库位:</label>
|
|
|
<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 : (focus=='station' ? '' : '扫描货架条码') }}</div>
|
|
|
+ id="station" @blur="checkMaximum($event,'station')"><span>@{{ info.station ? info.station : (focus=='station' ? '' : '扫描货架条码') }}</span></div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.station">
|
|
|
<strong>@{{ errors.station[0] }}</strong>
|
|
|
</span>
|
|
|
@@ -32,7 +32,7 @@
|
|
|
<label for="barCode" class="col-sm-2 col-3 text-right">条码:</label>
|
|
|
<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 : (focus=='barCode' ? '' : '扫描商品条码') }}</div>
|
|
|
+ id="barCode" @blur="checkMaximum($event,'barCode')"><span>@{{ info.barCode ? info.barCode : (focus=='barCode' ? '' : '扫描商品条码') }}</span></div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.barCode">
|
|
|
<strong>@{{ errors.barCode[0] }}</strong>
|
|
|
</span>
|
|
|
@@ -41,16 +41,18 @@
|
|
|
<label for="amount" class="col-sm-2 col-3 text-right">数量:</label>
|
|
|
<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 : (focus=='amount' ? '' : (info.maximum!==undefined ? '最大可上:'+info.maximum : '')) }}</div>
|
|
|
+ id="amount" @blur="checkMaximum($event,'amount')"><span>@{{ info.amount ? info.amount : (focus=='amount' ? '' : (info.maximum!==undefined ? '最大可上:'+info.maximum : '')) }}</span></div>
|
|
|
<span class="invalid-feedback offset-2" role="alert" v-if="errors.amount">
|
|
|
<strong>@{{ errors.amount[0] }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="input-group row mt-5">
|
|
|
- <button type="submit" class="btn btn-success offset-2 col-6 col-sm-8" @click="checkInfo()">提交</button>
|
|
|
+ <button type="submit" class="btn btn-success offset-2 col-8" @click="checkInfo()">提交</button>
|
|
|
+ </div>
|
|
|
+ <div class="row offset-2 col-8">
|
|
|
<div class="custom-control custom-checkbox mt-2 d-sm-none">
|
|
|
<input type="checkbox" class="custom-control-input" id="customCheck" v-model="isOnlyKeyboardEnter">
|
|
|
- <label class="custom-control-label" for="customCheck">键盘</label>
|
|
|
+ <label class="custom-control-label" for="customCheck">隐藏虚拟键盘</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -180,18 +182,25 @@
|
|
|
dd = dd <10 ? '0'+dd : dd.toString();
|
|
|
this.before.asn = 'ASN'+yy+mm+dd+'000';
|
|
|
},
|
|
|
- checkAsn(){
|
|
|
+ changeInfo(e,type){
|
|
|
+ if (this.isOnlyKeyboardEnter || !type)return;
|
|
|
+ let str = e.target.innerText;
|
|
|
+ if (e.target.firstChild.nodeType===3)e.target.firstChild.remove();
|
|
|
+ this.$set(this.info,type,str);
|
|
|
+ },
|
|
|
+ checkAsn(e,type){
|
|
|
+ this.changeInfo(e,type);
|
|
|
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;
|
|
|
- if (!this.info.ide)document.getElementById("station").focus();
|
|
|
- if (!this.checkSign)this.checkMaximum();
|
|
|
+ if (!this.checkSign)this.checkMaximum(e,'');
|
|
|
},
|
|
|
downSign(){
|
|
|
this.checkSign = false;
|
|
|
},
|
|
|
- checkMaximum(){
|
|
|
+ checkMaximum(e,type){
|
|
|
+ this.changeInfo(e,type);
|
|
|
this.focus = "";
|
|
|
if (!this.info.asn || !this.info.barCode || this.checkSign)return;
|
|
|
window.tempTip.postBasicRequest("{{url('store/inStorage/checkMaximum')}}",this.info,res=>{
|
|
|
@@ -205,7 +214,7 @@
|
|
|
this.checkSign = true;
|
|
|
},
|
|
|
enterVal(e,type){
|
|
|
- if (e.keyCode === 229){e.preventDefault();return;}
|
|
|
+ if (!this.isOnlyKeyboardEnter)return;
|
|
|
if (e.keyCode === 8 && this.info[type]){this.$set(this.info,type,this.info[type].slice(0,-1));return;}
|
|
|
if (e.key.length>1)return;
|
|
|
if (e.key.match(/[a-zA-Z0-9\-]/g)===null)return;
|