仓库-出库入库,扫码根据客户需求进行改动
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="input-box">
|
||||
<!-- <input :adjust-position="false" :focus="isFocus" type="text" v-model="search" @confirm="getInfo" @blur="isFocus = true" /> -->
|
||||
<input type="text" v-model.trim="search" @confirm="getInfo($event)" />
|
||||
<input :adjust-position="false" :focus="isFocus" type="text" v-model.trim="search" @confirm="getInfo" @blur="handlerBlur" />
|
||||
<!-- <input type="text" v-model.trim="search" @confirm="getInfo($event)" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -10,16 +10,24 @@ import * as WarehoseApi from '@/api/warehouse/warehose.js';
|
||||
export default {
|
||||
name: 'pda-scan-input',
|
||||
props: {
|
||||
hasFocus:{
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
type: {
|
||||
// 1-仓库扫码 2-成品满箱扫码 3-扫出库单 4-退库
|
||||
default: 1,
|
||||
type: Number
|
||||
},
|
||||
warehouseInfo: {
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isFocus: true,
|
||||
search: 'A1-01',
|
||||
// search: 'A1-01',
|
||||
search: '',
|
||||
time: null
|
||||
};
|
||||
},
|
||||
@@ -41,23 +49,34 @@ export default {
|
||||
// this.time = setInterval(() => {
|
||||
// if (!this.isFocus) {
|
||||
// this.$nextTick(function () {
|
||||
// this.isFocus = true;
|
||||
// this.isFocus = false;
|
||||
// });
|
||||
// }
|
||||
// }, 1);
|
||||
// }, 60);
|
||||
},
|
||||
// 传输数据
|
||||
emitInputChange(data, type) {
|
||||
this.$emit('getInfo', data, type);
|
||||
},
|
||||
handlerBlur(){
|
||||
if(this.hasFocus){
|
||||
this.isFocus = false;
|
||||
setTimeout(() => {
|
||||
this.$nextTick(function () {
|
||||
this.isFocus = true;
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
// 获取扫码信息
|
||||
async getInfo(e) {
|
||||
const text = e.target.value;
|
||||
const type = this.type;
|
||||
setTimeout(() => {
|
||||
this.search = '';
|
||||
this.isFocus = true;
|
||||
}, 1500);
|
||||
this.$nextTick(function () {
|
||||
this.search = '';
|
||||
});
|
||||
}, 500);
|
||||
if (type === 1) {
|
||||
this.handleScanWareHouseCode(text);
|
||||
} else if (type === 2) {
|
||||
@@ -107,6 +126,28 @@ export default {
|
||||
// type = 2 入库扫货物编码
|
||||
async handleScanGoodsCode(text) {
|
||||
let package_code = text;
|
||||
// 临时库处理
|
||||
let _warehouseInfo = this.warehouseInfo;
|
||||
if (_warehouseInfo != null && _warehouseInfo != undefined) {
|
||||
if (_warehouseInfo.remark === '临时' || _warehouseInfo.locaiton === 'LS1-01') {
|
||||
let resolutionData = {
|
||||
code: package_code
|
||||
};
|
||||
const emitRes = await WarehoseApi.resolutionPackage(resolutionData);
|
||||
if (emitRes.code !== 200 || emitRes.data === null) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该箱号数据解析异常!',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.emitInputChange(emitRes.data, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 成品库处理
|
||||
// 成品满箱扫码
|
||||
let locationCheckData = {
|
||||
package_code
|
||||
@@ -139,6 +180,7 @@ export default {
|
||||
});
|
||||
return;
|
||||
} else if (checkRes.data === 1) {
|
||||
|
||||
// 判断是否为满箱
|
||||
const isFullRes = await WarehoseApi.isFullPackage(locationCheckData);
|
||||
if (isFullRes.code !== 200 || !isFullRes.data) {
|
||||
@@ -170,7 +212,7 @@ export default {
|
||||
async handleScanDeliveryOrderCode(text) {
|
||||
let id = text;
|
||||
const getWmOutOrderRes = await WarehoseApi.getWmOutOrder(id);
|
||||
if(getWmOutOrderRes.code != 200){
|
||||
if (getWmOutOrderRes.code != 200) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '出库单号异常!',
|
||||
|
||||
Reference in New Issue
Block a user