Commit 5d55fbd3 by LJM

add

parent c0ce2d67
Showing with 27 additions and 1 deletions
......@@ -25,7 +25,7 @@
<view class="box row verCenter">
<view class="row verCenter" style="flex:0 0 93%">
<view class="label">入仓号</view>
<input type="text" v-model="form.erp_order_sn" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入入仓号" />
<input type="text" v-model="form.erp_order_sn" placeholder-style="font-size:24rpx;color:#404547;" @input="handleInput($event)" class="uni-input" placeholder="请输入入仓号" />
</view>
<text class="scan iconfont icon-juxing6" @click="scanChange()"></text>
</view>
......@@ -61,6 +61,7 @@
<script>
import { API } from '@/util/api.js';
import { getPlatform, findIndexOrZero } from '@/util/util.js';
import debounce from 'lodash/debounce';
const ToBase64 = require('../../util/base64gb2312.js');
export default {
......@@ -176,11 +177,34 @@
}
},
methods: {
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
//检查是否存在 "-"
if (this.form.erp_order_sn.includes('-')) {
//分割字符串
var parts = this.form.erp_order_sn.split('-');
var firstPart = parts[0];
var secondPart = parts[1];
this.form.erp_order_sn = firstPart; //赋值切割后的入仓号
this.form.batch = findIndexOrZero(this.numberArr, Number(secondPart)); //匹配批次号就选中,否则就是默认0
}
}
}, 800),
scanChange() {
uni.scanCode({
success: res => {
if (res.errMsg == 'scanCode:ok') {
this.form.erp_order_sn = res.result;
//检查是否存在 "-"
if (this.form.erp_order_sn.includes('-')) {
//分割字符串
var parts = this.form.erp_order_sn.split('-');
var firstPart = parts[0];
var secondPart = parts[1];
this.form.erp_order_sn = firstPart; //赋值切割后的入仓号
this.form.batch = findIndexOrZero(this.numberArr, Number(secondPart)); //匹配批次号就选中,否则就是默认0
}
}
},
fail: function(res) {
......@@ -317,6 +341,8 @@
let params = Object.assign(this.form, {
is_add: 0
});
this.request(API.checkRepeatPrintLabel, 'POST', params, true).then(res => {
if (res.err_code === 0) {
this.printLabelChange();
......
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