Sfoglia il codice sorgente

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 4 anni fa
parent
commit
741a52effc

+ 16 - 7
resources/views/store/inStorage/cacheRackStorage.blade.php

@@ -12,7 +12,7 @@
                     <div class="form-group row">
                         <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>
@@ -20,7 +20,7 @@
                     <div class="form-group row">
                         <label for="ide" class="col-sm-2 col-3 text-right">料箱号:</label>
                         <div tabindex="0" @focus="()=>{this.focus='ide'}" @keydown="enterVal($event,'ide')" class="form-control col-8 overflow-hidden" :contenteditable="!isOnlyKeyboardEnter" :class="errors.ide ? 'is-invalid' : ''"
-                             id="ide" @blur="checkIde()">@{{ info.ide ? info.ide : (focus=='ide' ? '' : '只需填写后几位,自动补充') }}</div>
+                             id="ide" @blur="checkIde($event,'ide')"><span>@{{ info.ide ? info.ide : (focus=='ide' ? '' : '只需填写后几位,自动补充') }}</span></div>
                         <span class="invalid-feedback offset-2" role="alert" v-if="errors.ide">
                             <strong>@{{ errors.ide[0] }}</strong>
                         </span>
@@ -28,7 +28,7 @@
                     <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" :contenteditable="!isOnlyKeyboardEnter" :class="errors.barCode ? 'is-invalid' : ''"
-                             id="barCode">@{{ info.barCode }}</div>
+                             id="barCode" @blur="changeInfo($event,'barCode')"><span>@{{ info.barCode }}</span></div>
                         <span class="invalid-feedback offset-2" role="alert" v-if="errors.barCode">
                             <strong>@{{ errors.barCode[0] }}</strong>
                         </span>
@@ -36,7 +36,8 @@
                     <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"
-                             :class="errors.amount ? 'is-invalid' : ''" id="amount" type="number" :contenteditable="!isOnlyKeyboardEnter" >@{{ info.amount }}</div>
+                             :class="errors.amount ? 'is-invalid' : ''" @blur="changeInfo($event,'amount')" id="amount" type="number"
+                             :contenteditable="!isOnlyKeyboardEnter" ><span>@{{ info.amount }}</span></div>
                         <span class="invalid-feedback offset-2" role="alert" v-if="errors.amount">
                             <strong>@{{ errors.amount[0] }}</strong>
                         </span>
@@ -182,6 +183,12 @@
                         });
                     }
                 },
+                changeInfo(e,type){
+                    if (this.isOnlyKeyboardEnter)return;
+                    let str = e.target.innerText;
+                    if (e.target.firstChild.nodeType===3)e.target.firstChild.remove();
+                    this.$set(this.info,type,str);
+                },
                 checkInfo(){
                     let error = {};
                     if (!this.info.asn)error.asn = ["ASN号必填"];
@@ -216,15 +223,17 @@
                     this.before.asn = 'ASN'+yy+mm+dd+'000';
                     this.before.ide = 'IDE000000';
                 },
-                checkAsn(){
+                checkAsn(e,type){
                     this.focus = "";
+                    this.changeInfo(e,type);
                     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("ide").focus();
                 },
-                checkIde(){
+                checkIde(e,type){
                     this.focus = "";
+                    this.changeInfo(e,type);
                     if(!this.info.ide)return;
                     let len = this.info.ide.length;
                     if (len<10)this.info.ide = this.before.ide.substr(0,10-len)+this.info.ide;
@@ -253,7 +262,7 @@
                     if ((e.keyCode<48 || e.keyCode>105) || (e.keyCode>57 && e.keyCode<65) || (e.keyCode>90 && e.keyCode<96))return;
                     if (this.info[type])this.$set(this.info,type,this.info[type] += e.key);
                     else this.$set(this.info,type,e.key);*/
-                    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;

+ 20 - 11
resources/views/store/inStorage/halfChestStorage.blade.php

@@ -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;