|
|
@@ -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">
|
|
|
@@ -29,16 +29,16 @@
|
|
|
|
|
|
<div class="mt-3">
|
|
|
<span class="h5">
|
|
|
- <span class="form-group mb-5" v-if="inventory.surplus!=0">
|
|
|
+ <span class="form-group mb-5" v-if="inventory.status=='盘点中' ||inventory.status=='待盘点'">
|
|
|
<label class=" font-weight-bold">已盘点:</label><span>@{{ inventory.processed }}/总数:@{{ inventory.total }}</span>
|
|
|
</span>
|
|
|
- <span class="form-group mb-5" v-if="inventory.surplus!=0">
|
|
|
+ <span class="form-group mb-5" v-if="inventory.status=='盘点中' ||inventory.status=='待盘点'">
|
|
|
<label class=" font-weight-bold">剩余数:</label><span>@{{ inventory.surplus }}</span>
|
|
|
</span>
|
|
|
- <span class="form-group mb-5" v-if="inventory.surplus==0">
|
|
|
+ <span class="form-group mb-5" v-if="inventory.status=='复盘中'">
|
|
|
<label class=" font-weight-bold">盘点记录数:</label><span>@{{ inventory.total }}</span>
|
|
|
</span>
|
|
|
- <span class="form-group mb-5" v-if="inventory.surplus==0">
|
|
|
+ <span class="form-group mb-5" v-if="inventory.status=='复盘中'">
|
|
|
<label class=" font-weight-bold">复盘剩余数:</label><span>@{{ inventory.check_surplus }}/复盘总数:@{{ inventory.total }}</span>
|
|
|
</span>
|
|
|
</span>
|
|
|
@@ -46,39 +46,46 @@
|
|
|
|
|
|
|
|
|
<div class="mt-3" >
|
|
|
- <span v-if="!listMode" class="btn col-md-2 font-weight-bold" style="cursor: default;max-width: 160px" :class="inventory.surplus!=0?'bg-info':'btn-outline-info disabled'">
|
|
|
+ <span v-if="!listMode" class="btn col-md-2 font-weight-bold" style="cursor: default;max-width: 160px" :class="inventory.status=='盘点中' ||inventory.status=='待盘点'?'bg-info':'btn-outline-info disabled'">
|
|
|
@{{ inventory.type }}
|
|
|
</span>
|
|
|
- <span v-if="!listMode" class="btn col-md-2 font-weight-bold" style="cursor: default;max-width: 160px" :class="inventory.surplus!=0?'btn-outline-info disabled':'bg-info'">复盘</span>
|
|
|
+ <span v-if="!listMode && inventory.status=='盘点中' ||inventory.status=='待盘点'" class="btn col-md-2 font-weight-bold btn-outline-secondary" style="max-width: 160px" @click="stockInventoryEnd(inventory.id)">结束</span>
|
|
|
+ <span v-if="!listMode && inventory.status=='复盘中'" class="btn col-md-2 font-weight-bold" style="cursor: default;max-width: 160px" :class="inventory.status=='盘点中' ||inventory.status=='待盘点'?'btn-outline-info disabled':'bg-info'">复盘</span>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <form id="form" class="mt-3 form-inline " v-if="!listMode" :class="inventory.surplus!=0?'row-cols-3':'row-cols-5'">
|
|
|
+ <form id="form" class="mt-3 form-inline " v-if="!listMode" :class="inventory.status=='盘点中' ||inventory.status=='待盘点'?'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.status=='复盘中'" class="form-group ml-4">
|
|
|
<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.status=='复盘中'" class="form-group ml-4">
|
|
|
<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="difference_amount" @keypress="inputSwitch($event)"
|
|
|
+ name="difference_amount" v-model="inventoryMissionRecord.difference_amount" class="form-control input" readonly>
|
|
|
</span>
|
|
|
</form>
|
|
|
|
|
|
@@ -131,7 +138,7 @@
|
|
|
<span class="mr-3 text-nowrap"><span class="font-weight-bold">库位:</span><span style="color:#af7651">@{{ inventoryMission.location }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span class="font-weight-bold">产品名称:</span><span style="color:#af7651" v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span class="font-weight-bold">产品条码:</span><span style="color:#af7651" v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</span></span>
|
|
|
- <div v-if="inventory.surplus==0">
|
|
|
+ <div v-if="inventory.status=='复盘中'">
|
|
|
<span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点数量:</span><span style="color:#af7651">@{{ inventoryMission.verified_amount }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">复盘数量:</span><span style="color:#af7651">@{{ inventoryMission.re_checked_amount }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点差异:</span><span >@{{ inventoryMission.difference_amount }}</span></span>
|
|
|
@@ -166,7 +173,6 @@
|
|
|
|
|
|
(function 焦点放置(){
|
|
|
let inventoryInput=$('#inventoryInput')
|
|
|
- console.log(inventoryInput.length)
|
|
|
if(inventoryInput.length>0)
|
|
|
$('#inventoryInput').focus()
|
|
|
})();
|
|
|
@@ -177,6 +183,26 @@
|
|
|
})();
|
|
|
},
|
|
|
methods:{
|
|
|
+ inputSwitch(e){
|
|
|
+ if(e.key==='Enter') {
|
|
|
+ let inputs = $("#form .input");
|
|
|
+ let idx = inputs.index($(e.target)); // 获取当前焦点输入框所处的位置
|
|
|
+ let location=document.getElementById('inventoryInput').value;
|
|
|
+ console.log(idx)
|
|
|
+ if (idx == 2) { // 判断是否是最后一个输入框
|
|
|
+ if (location==''){
|
|
|
+ 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='';
|
|
|
@@ -254,27 +280,24 @@
|
|
|
tempTip.show('盘点失败!'+'网络错误'+err);
|
|
|
})
|
|
|
},
|
|
|
- }
|
|
|
- });
|
|
|
- $("#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(); // 选中文字
|
|
|
- }
|
|
|
+ //结束初盘任务
|
|
|
+ stockInventoryEnd(id){
|
|
|
+ let _this=this;
|
|
|
+ let url='{{url('inventory/stockInventoryEnd')}}';
|
|
|
+ axios.post(url,{id:id}).then(function (response) {
|
|
|
+ if (!response.data.success){
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.show('结束初盘失败!'+' '+response.data.data);
|
|
|
+ }else {
|
|
|
+ _this.inventory.status=response.data.data;
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.showSuccess('结束初盘,进入复盘!');
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.show('结束初盘失败!'+'网络错误'+err);
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
</script>
|