Commit 43461798 by LJM

在WMS的输入框扫描识别标签二维码会漏字符,而其他软件输入框烧苗识别均正确的

parent 88d01be6
...@@ -875,6 +875,19 @@ ...@@ -875,6 +875,19 @@
* 修改自营数据提交 * 修改自营数据提交
*/ */
saveZyGoodsDataSubmit() { saveZyGoodsDataSubmit() {
const isEmptyMpq = this.saveZyGoodsParams.every(obj => {
return obj.hasOwnProperty('mpq') && obj.mpq !== '';
});
if (!isEmptyMpq) {
uni.showModal({
title: '提示',
content: '标准包装量必填',
showCancel: false
});
return false
}
const hasError = this.saveZyGoodsParams.filter(item => item.packing === 5).some(({ standard_length, unit_length }, index) => { const hasError = this.saveZyGoodsParams.filter(item => item.packing === 5).some(({ standard_length, unit_length }, index) => {
if (this.standardSizeIndex == 0 && !standard_length) { if (this.standardSizeIndex == 0 && !standard_length) {
uni.showModal({ uni.showModal({
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<!-- 批量扫描 --> <!-- 批量扫描 -->
<template v-if="is_batch"> <template v-if="is_batch">
<input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="15" ref="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="16" ref="myInput" />
</template> </template>
<template v-else> <template v-else>
<input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="15" ref="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="16" ref="myInput" />
</template> </template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text>
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<template v-if="index == 0"> <template v-if="index == 0">
<template v-if="is_batch"> <template v-if="is_batch">
<input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(1, $event)" maxlength="15" ref="myInput" id="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(1, $event)" maxlength="16" ref="myInput" id="myInput" />
</template> </template>
<template v-else> <template v-else>
<input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.search_keyword" @input="handleInput(1, $event)" maxlength="15" ref="myInput" id="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.search_keyword" @input="handleInput(1, $event)" maxlength="16" ref="myInput" id="myInput" />
</template> </template>
</template> </template>
<template v-else-if="index == 1"> <template v-else-if="index == 1">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput" maxlength="15" /> <input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput" maxlength="16" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<template v-if="index == 0"> <template v-if="index == 0">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="15" /> <input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="16" />
</template> </template>
<template v-else-if="index == 1"> <template v-else-if="index == 1">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" /> <input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" />
......
...@@ -1253,8 +1253,6 @@ ...@@ -1253,8 +1253,6 @@
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
}, 500); }, 500);
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<!-- 新标签-入库批次号 --> <!-- 新标签-入库批次号 -->
<template v-if="index == 0"> <template v-if="index == 0">
<input class="uni-input" placeholder="请扫描入库批次号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event)" maxlength="15" /> <input class="uni-input" placeholder="请扫描入库批次号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event)" maxlength="16" />
</template> </template>
<!-- 旧标签--> <!-- 旧标签-->
<template v-else-if="index == 1"> <template v-else-if="index == 1">
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="15" /> <input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="16" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text>
</view> </view>
...@@ -204,198 +204,198 @@ ...@@ -204,198 +204,198 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
is_submit: true, is_submit: true,
transfer_id: '',
transfer_sn: '',
input_flag_origin_pos_code: false,
input_flag_stock_in_batch_sn: false,
input_flag_position_code: false,
input_flag_container_sn: false,
page: 1,
limit: 1000,
index: 0,
list: [],
detail: {},
warehouse_id: '',
stock_in_type: '',
searchParams: {
transfer_id: '', transfer_id: '',
origin_pos_code: '', //源库位编码 transfer_sn: '',
stock_in_batch_sn: '' //入库批次号 input_flag_origin_pos_code: false,
}, input_flag_stock_in_batch_sn: false,
formParams: { input_flag_position_code: false,
transfer_item_id: '', input_flag_container_sn: false,
transfer_qty: '', page: 1,
position_code: '', limit: 1000,
container_sn: '' index: 0,
} list: [],
}; detail: {},
}, warehouse_id: '',
onNavigationBarButtonTap(e) { stock_in_type: '',
console.log(e); searchParams: {
if (e.index == 0) { transfer_id: '',
uni.navigateTo({ origin_pos_code: '', //源库位编码
url: '/pages/transfer/records' stock_in_batch_sn: '' //入库批次号
}); },
} formParams: {
}, transfer_item_id: '',
onLoad(options) { transfer_qty: '',
this.searchParams.transfer_id = options.transfer_id || ''; position_code: '',
this.searchParams.transfer_sn = options.transfer_sn || ''; container_sn: ''
}
uni.setNavigationBarTitle({ };
title: this.searchParams.transfer_sn
});
},
onShow() {
this.getData();
},
methods: {
showDrawer(val) {
this.detail = val;
this.formParams.transfer_item_id = val.transfer_item_id;
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
}, },
/** onNavigationBarButtonTap(e) {
* 确认移位 console.log(e);
*/ if (e.index == 0) {
confirmTransfer() { uni.navigateTo({
if (!this.formParams.transfer_qty) { url: '/pages/transfer/records'
uni.showToast({
title: '请输入移位数量',
icon: 'error'
}); });
return false;
}
if (!this.formParams.position_code) {
uni.showToast({
title: '请输入目标库位',
icon: 'error'
});
return false;
} }
},
onLoad(options) {
this.searchParams.transfer_id = options.transfer_id || '';
this.searchParams.transfer_sn = options.transfer_sn || '';
this.request(API.confirmTransfer, 'POST', { ...this.formParams }, true).then(res => { uni.setNavigationBarTitle({
if (res.code === 0) { title: this.searchParams.transfer_sn
uni.showToast({
title: '移位成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
}); });
}, },
/** onShow() {
* 获取列表数据 this.getData();
*/ },
getData() { methods: {
this.request(API.getTransferDetail, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { showDrawer(val) {
if (res.code === 0) { this.detail = val;
this.list = res.data.trans_items; this.formParams.transfer_item_id = val.transfer_item_id;
} else { this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 确认移位
*/
confirmTransfer() {
if (!this.formParams.transfer_qty) {
uni.showToast({ uni.showToast({
title: res.msg, title: '请输入移位数量',
icon: 'error' icon: 'error'
}); });
return false;
} }
}); if (!this.formParams.position_code) {
}, uni.showToast({
/** title: '请输入目标库位',
* 清空数据 icon: 'error'
*/ });
clearInput(type) { return false;
if (type == 1) {
this.searchParams.origin_pos_code = '';
this.input_flag_origin_pos_code = false;
this.getData();
} else if (type == 2) {
this.searchParams.stock_in_batch_sn = '';
this.input_flag_stock_in_batch_sn = false;
this.getData();
} else if (type == 3) {
this.formParams.position_code = '';
this.input_flag_position_code = false;
} else if (type == 4) {
this.formParams.container_sn = '';
this.input_flag_container_sn = false;
}
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, val) {
if (val) {
if (type == 1) {
this.input_flag_origin_pos_code = true;
this.getData();
} else if (type == 2) {
this.input_flag_stock_in_batch_sn = true;
this.getData();
} else if (type == 3) {
this.input_flag_position_code = true;
} else if (type == 4) {
this.input_flag_container_sn = true;
} }
} else {
this.request(API.confirmTransfer, 'POST', { ...this.formParams }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '移位成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getTransferDetail, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.trans_items;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) { if (type == 1) {
this.searchParams.origin_pos_code = '';
this.input_flag_origin_pos_code = false; this.input_flag_origin_pos_code = false;
this.getData();
} else if (type == 2) { } else if (type == 2) {
this.searchParams.stock_in_batch_sn = '';
this.input_flag_stock_in_batch_sn = false; this.input_flag_stock_in_batch_sn = false;
this.getData();
} else if (type == 3) { } else if (type == 3) {
this.formParams.position_code = '';
this.input_flag_position_code = false; this.input_flag_position_code = false;
} else if (type == 4) { } else if (type == 4) {
this.formParams.container_sn = '';
this.input_flag_container_sn = false; this.input_flag_container_sn = false;
} }
} },
}, 500), /**
/** * 单号搜索
* 监听库位编码 * @param {Object} event
*/ */
inputPositionCodeChange: debounce(function(event) { handleInput: debounce(function(type, val) {
this.getWhPositionList(); if (val) {
}, 500), if (type == 1) {
/** this.input_flag_origin_pos_code = true;
* @param {Object} type this.getData();
* 获取库位 } else if (type == 2) {
*/ this.input_flag_stock_in_batch_sn = true;
getWhPositionList() { this.getData();
this.request(API.getWhPositionList, 'POST', { warehouse_id: this.warehouse_id, stock_in_type: 1 }, false).then(res => { } else if (type == 3) {
if (res.code === 0) { this.input_flag_position_code = true;
var position_code = this.formParams.position_code; } else if (type == 4) {
this.is_submit = res.data.list.some(function(obj) { this.input_flag_container_sn = true;
return obj.position_code === position_code; }
});
} else { } else {
uni.showToast({ if (type == 1) {
title: res.msg, this.input_flag_origin_pos_code = false;
icon: 'error' } else if (type == 2) {
}); this.input_flag_stock_in_batch_sn = false;
} else if (type == 3) {
this.input_flag_position_code = false;
} else if (type == 4) {
this.input_flag_container_sn = false;
}
} }
}); }, 500),
/**
* 监听库位编码
*/
inputPositionCodeChange: debounce(function(event) {
this.getWhPositionList();
}, 500),
/**
* @param {Object} type
* 获取库位
*/
getWhPositionList() {
this.request(API.getWhPositionList, 'POST', { warehouse_id: this.warehouse_id, stock_in_type: 1 }, false).then(res => {
if (res.code === 0) {
var position_code = this.formParams.position_code;
this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code;
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/transfer/task.scss'; @import '@/assets/css/transfer/task.scss';
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment