|
|
@@ -16,7 +16,7 @@
|
|
|
<span v-if="listMode">切换为盘点</span>
|
|
|
</button>
|
|
|
</span>
|
|
|
- <span class="form-group mb-5">
|
|
|
+ <span class="form-group mb-5">
|
|
|
<label class="text-muted">货主:</label><span class="font-weight-bold">@{{ inventory.owner.name }}</span>
|
|
|
</span>
|
|
|
<span class="form-group p-2 mb-5" class="text-muted">
|
|
|
@@ -56,29 +56,35 @@
|
|
|
<form id="form" class="mt-3 form-inline " v-if="!listMode" :class="inventory.surplus!=0?'row-cols-3':'row-cols-5'">
|
|
|
<span class="form-group">
|
|
|
<label for="location" class="text-secondary font-weight-bold">请输库位</label>
|
|
|
- <input id="inventoryInput" name="location" type="text" class="form-control input" autocomplete="off" value="@if(old('location')){{old('location')}}@endif">
|
|
|
+ <input id="inventoryInput" @keypress="inputSwitch($event)"
|
|
|
+ name="location" type="text" class="form-control input" autocomplete="off" value="@if(old('location')){{old('location')}}@endif">
|
|
|
</span>
|
|
|
- <span class="form-group ml-4">
|
|
|
+ <span class="form-group ml-4">
|
|
|
<label for="barcode" class="text-secondary font-weight-bold">请输产品条码</label>
|
|
|
- <input id="barcode" name="barcode" type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control input" autocomplete="off" @blur="searchBarcode">
|
|
|
+ <input id="barcode" name="barcode" @keypress="inputSwitch($event)"
|
|
|
+ type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control input" autocomplete="off" @blur="searchBarcode">
|
|
|
</span>
|
|
|
- <span class="form-group ml-4">
|
|
|
+ <span class="form-group ml-4">
|
|
|
<label for="count" class="text-secondary font-weight-bold">请输盘点数</label>
|
|
|
- <input type="text" id="count" name="count" class="form-control input" value="@if(old('count')){{old('count')}}@endif" autocomplete="off">
|
|
|
+ <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
+ name="count" class="form-control input" value="@if(old('count')){{old('count')}}@endif" autocomplete="off">
|
|
|
</span>
|
|
|
|
|
|
- <span v-if="inventory.surplus==0">
|
|
|
+ <span v-if="inventory.surplus==0">
|
|
|
<label for="count" class="text-secondary font-weight-bold">上一次盘点数</label>
|
|
|
<span v-if="!inventoryMissionRecord.re_checked_amount">
|
|
|
- <input type="text" id="count" name="count" v-model="inventoryMissionRecord.verified_amount" class="form-control input" readonly>
|
|
|
+ <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
+ name="count" v-model="inventoryMissionRecord.verified_amount" class="form-control input" readonly>
|
|
|
</span>
|
|
|
<span v-if="inventoryMissionRecord.re_checked_amount">
|
|
|
- <input type="text" id="count" name="count" v-model="inventoryMissionRecord.re_checked_amount" class="form-control input" readonly>
|
|
|
+ <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
+ name="count" v-model="inventoryMissionRecord.re_checked_amount" class="form-control input" readonly>
|
|
|
</span>
|
|
|
</span>
|
|
|
- <span v-if="inventory.surplus==0">
|
|
|
+ <span v-if="inventory.surplus==0">
|
|
|
<label for="count" class="text-secondary font-weight-bold">盘点差异数</label>
|
|
|
- <input type="text" id="count" name="count" v-model="inventoryMissionRecord.difference_amount" class="form-control input" readonly>
|
|
|
+ <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
+ name="count" v-model="inventoryMissionRecord.difference_amount" class="form-control input" readonly>
|
|
|
</span>
|
|
|
</form>
|
|
|
|
|
|
@@ -176,6 +182,25 @@
|
|
|
})();
|
|
|
},
|
|
|
methods:{
|
|
|
+ inputSwitch(e){
|
|
|
+ if(e.key==='Enter') {
|
|
|
+ let inputs = $("#form .input");
|
|
|
+ let idx = inputs.index($(e.target)); // 获取当前焦点输入框所处的位置
|
|
|
+ let location=document.getElementById('inventoryInput').value;
|
|
|
+ if (idx == 2) { // 判断是否是最后一个输入框
|
|
|
+ if (location==''||location==undefined||location==null){
|
|
|
+ document.getElementById('inventoryInput').focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ listVue.submitStockInventory();
|
|
|
+ $("#form .input").val(' ');
|
|
|
+ document.getElementById('inventoryInput').focus();
|
|
|
+ } else {
|
|
|
+ inputs[idx + 1].focus(); // 设置焦点
|
|
|
+ inputs[idx + 1].select(); // 选中文字
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
selectedColor(id){
|
|
|
if (id==this.selectedStyle){
|
|
|
this.selectedStyle='';
|
|
|
@@ -253,27 +278,6 @@
|
|
|
},
|
|
|
}
|
|
|
});
|
|
|
- $("#form").on("keydown","input",function(){
|
|
|
- let _this=this;
|
|
|
- let e = event || window.event;
|
|
|
- if(e && e.keyCode==13) {
|
|
|
- let inputs = $("#form .input");
|
|
|
- let idx = inputs.index(this); // 获取当前焦点输入框所处的位置
|
|
|
- let location=document.getElementById('inventoryInput').value;
|
|
|
- if (idx == 2) { // 判断是否是最后一个输入框
|
|
|
- if (location==''||location==undefined||location==null){
|
|
|
- document.getElementById('inventoryInput').focus();
|
|
|
- return;
|
|
|
- }
|
|
|
- listVue.submitStockInventory();
|
|
|
- $("#form .input").val(' ');
|
|
|
- document.getElementById('inventoryInput').focus();
|
|
|
- } else {
|
|
|
- inputs[idx + 1].focus(); // 设置焦点
|
|
|
- inputs[idx + 1].select(); // 选中文字
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
</script>
|
|
|
@endsection
|
|
|
|