Commit 30cc63ca by 施宇

1

parent 10bbc4a9
{
"pages": [
"pages/startPage/startPage",
"pages/receivinggoods/receivinggoods",
"pages/inventoryQuery/inventoryQuery",
"pages/upperShelf/upperShelf",
"pages/picking/picking",
"pages/receivinggoods/receivinggoods",
"pages/mountingPlate/mountingPlate",
......@@ -12,10 +14,10 @@
"pages/upperShelf/upperShelf",
"pages/startPage/startPage",
"pages/home/home",
......@@ -28,7 +30,6 @@
"pages/inventoryQuery/inventoryQuery",
......
......@@ -417,20 +417,23 @@ for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j+
},
formInput:function(e){
let {value} = e.detail ;
let str = value.substring(0, 2);
let RegXb = /^(XB)\d{11}$/;
let RegKb = /^(KB)\d{11}$/;
this.setData({
numText:value
})
if(str == 'XB'){//扫描的是箱号
if(RegXb.test(value)){//扫描的是箱号
this.setData({
kbText:""
})
this.getXbData()
}else if(str == 'KB'){//扫描的是卡版号
}else if(RegKb.test(value)){//扫描的是卡版号
this.getKbData();
this.setData({
kbText:value
})
}else{
//型号
}
},
......@@ -620,7 +623,8 @@ for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j+
let data = res.data;
let str = "! 0 200 200 400 1 \n"+
"B QR 200 0 M 2 2 10 \n"+
"MA,"+(data.pallet_sn||'--')+","+(data.box_num||'--')+","+(data.box_weight||'--')+"\n"+
// "MA,"+(data.pallet_sn||'--')+","+(data.box_num||'--')+","+(data.box_weight||'--')+"\n"+
"MA,"+(data.pallet_sn||'--')+"\n"+
"ENDQR \n"+
"TEXT 55 1 380 20 卡板号: \n"+
"TEXT 55 1 380 60 内含箱数: \n"+
......
......@@ -20,6 +20,35 @@ Page({
dataList:[],
hwList:[],
isShow:false,
inputIsScan:true,//input框是否是通过扫描获得数据
},
xhConfirm:function(e){
console.log('点击确认')
let {value} = e.detail;
let reg = /^(XB|KB)\d{11}$/;
let newVal = value;
if(!reg.test(value)){
//箱号要判断是手输入的还是扫码枪扫描的
if(this.data.inputIsScan){
//扫码枪扫描的需要解析数据
let obj = JSON.parse(value);
newVal = obj.goodsName
}
}
this.setData({
xhVal:newVal,
});
},
emitInput1:function(){
console.log('失去焦点')
let inputIsScan = this.data.inputIsScan;
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
},
hiddenInput:function(){
this.setData({
......@@ -40,7 +69,22 @@ Page({
})
},
xhInput:function(e){
console.log('输入中')
let {value} = e.detail ;
let inputIsScan = this.data.inputIsScan;
if(value){
if(inputIsScan){
this.setData({
inputIsScan:false
})
}
}else{
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
}
this.setData({
xhVal:value
})
......
......@@ -3,7 +3,7 @@
<view class="inventory-query-wrapper">
<view class="view-top Bflex aic">
<text class="desc noMarginLeft">型号:</text>
<input class="input input-border" bindinput="xhInput"></input>
<input class="input input-border" bindinput="xhInput" bindblur="emitInput1" bindconfirm="xhConfirm"></input>
<text class="desc">入仓单号:</text>
<input class="input input-border" bindinput="rcInput"></input>
<text class="desc">箱号:</text>
......
......@@ -418,20 +418,23 @@ for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j+
},
formInput:function(e){
let {value} = e.detail ;
let str = value.substring(0, 2);
let RegXb = /^(XB)\d{11}$/;
let RegKb = /^(KB)\d{11}$/;
this.setData({
numText:value
})
if(str == 'XB'){//扫描的是箱号
if(RegXb.test(value)){//扫描的是箱号
this.setData({
kbText:""
})
this.getXbData()
}else if(str == 'KB'){//扫描的是卡版号
}else if(RegKb.test(value)){//扫描的是卡版号
this.getKbData();
this.setData({
kbText:value
})
}else{
//型号
}
},
......@@ -596,7 +599,8 @@ for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j+
let data = res.data;
let str = "! 0 200 200 400 1 \n"+
"B QR 200 0 M 2 2 10 \n"+
"MA,"+(data.NO||'--')+","+(data.QTY||'--')+","+(data.WEIGHT||'--')+"\n"+
// "MA,"+(data.NO||'--')+","+(data.QTY||'--')+","+(data.WEIGHT||'--')+"\n"+
"MA,"+(data.NO||'--')+"\n"+
"ENDQR \n"+
"TEXT 55 1 380 20 卡板号: \n"+
"TEXT 55 1 380 60 内含箱数: \n"+
......@@ -633,7 +637,8 @@ for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j+
let data = res.data;
let str = "! 0 200 200 400 1 \n"+
"B QR 200 0 M 2 2 10 \n"+
"MA,"+(data.NO||'--')+","+(data.QTY||'--')+","+(data.WEIGHT||'--')+"\n"+
// "MA,"+(data.NO||'--')+","+(data.QTY||'--')+","+(data.WEIGHT||'--')+"\n"+
"MA,"+(data.NO||'--')+"\n"+
"ENDQR \n"+
"TEXT 55 1 380 20 卡板号: \n"+
"TEXT 55 1 380 60 内含箱数: \n"+
......
......@@ -5,6 +5,9 @@ import {
import {
apis
} from '../../utils/api.js';
import {
printData
} from '../../utils/util.js';
Page({
/**
......@@ -21,6 +24,7 @@ Page({
isKb:false,
isHw:false,
xDeviceId:"",//卡板标签的蓝牙deviceId
inputIsScan:true,//input框是否是通过扫描获得数据
blueNameDefault:"L51 BT Printer",//默认连接蓝牙的名字
},
......@@ -30,6 +34,30 @@ Page({
onLoad: function (options) {
},
emitInput1:function(){
let inputIsScan = this.data.inputIsScan;
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
},
emitInput:function(){
let inputIsScan = this.data.inputIsScan;
if(value){
if(inputIsScan){
this.setData({
inputIsScan:false
})
}
}else{
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
}
},
cancelJh:function(){
let me = this;
if(!this.data.initId){
......@@ -122,9 +150,12 @@ Page({
},
kbConfirm:function(e){
let {value} = e.detail ;
let str = value.substring(0, 2);
let RegXb = /^(XB)\d{11}$/;
let RegKb = /^(KB)\d{11}$/;
let rwVal = this.data.rwVal;
let hwVal = this.data.hwVal;
let newVal = value;
let bool = false;
this.setData({
isKb:false,
});
......@@ -141,21 +172,27 @@ Page({
duration: 2000
});
}else{
this.setData({
kbVal:value
})
if(str == 'KB'){
if(RegKb.test(value)){
this.setData({
kbText:value
kbText:value,
})
}else if(str == 'XB'){
}else if(RegXb.test(value)){
this.setData({
xText:value
xText:value,
})
}else{
this.getList(true)
bool = true;
if(this.data.inputIsScan){
//扫码枪扫描的需要解析数据
let obj = JSON.parse(value);
newVal = obj.goodsName
}
this.getList()
}
this.setData({
kbVal:newVal
})
this.getList(bool)
}
},
......@@ -212,7 +249,11 @@ Page({
getData(apis.get_box_info1, 'post', {"box_sn":me.data.xText}, function(res) {
if (res.errcode === 0) {
console.log('连接蓝牙打印')
me.initBlue(str)
let data = res.data;
if(data){
let str = printData(data.box_sn,data.box_weight,data.detail);
me.initBlue(str)
}
} else {
wx.showToast({
title: res.errmsg,
......
......@@ -7,7 +7,7 @@
<text class="desc">货位号:</text>
<input class="input input-border" value="{{hwVal}}" bindconfirm="hwConfirm" focus="{{isHw}}"></input>
<text class="desc">卡板号/箱号/型号:</text>
<input class="input input-border" value="{{kbVal}}" bindconfirm="kbConfirm" focus="{{isKb}}"></input>
<input class="input input-border" value="{{kbVal}}" bindconfirm="kbConfirm" focus="{{isKb}}" bindinput="emitInput" bindblur="emitInput1"></input>
<view class="number">
拣货任务号: <text>{{rwVal}}</text>
</view>
......
......@@ -48,6 +48,7 @@ Page({
blueNameDefault:"L51 BT Printer",//默认连接蓝牙的名字
wlDeviceId:"",//物料标签的蓝牙deviceId
xDeviceId:"",//箱标签的蓝牙deviceId
inputIsScan:true,//input框是否是通过扫描获得数据
},
initBlue:function(type,data){
......@@ -641,13 +642,48 @@ onUnload:function(){
orderZl:value
})
},
emitInput1:function(){
let inputIsScan = this.data.inputIsScan;
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
},
emitInput:function(value){
let inputIsScan = this.data.inputIsScan;
if(value){
if(inputIsScan){
this.setData({
inputIsScan:false
})
}
}else{
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
}
},
formtmInput:function(e){
//监听条码的input
let {value} = e.detail ;
let formData = this.data.formData;
let reg = /^(XB|KB)\d{11}$/;
let newVal = value;
if(!formData.xh){
//型号未扫描
this.scanXh(value)
if(!reg.test(value)){
//要判断是手输入的还是扫码枪扫描的
if(this.data.inputIsScan){
//扫码枪扫描的需要解析数据
let obj = JSON.parse(value);
newVal = obj.goodsName
}
}
this.scanXh(newVal)
}else{
if(!formData.sl){
//数量未扫描
......@@ -877,7 +913,8 @@ onUnload:function(){
let formData = me.data.formData;
let data = "! 0 200 200 400 1 \n"+
"B QR 200 0 M 2 2 10 \n"+
"MA,"+formData.xh+","+formData.pp+","+formData.sl+","+formData.cd+","+(formData.dc||'--')+","+(formData.pc||'--')+"\n"+
// "MA,"+formData.xh+","+formData.pp+","+formData.sl+","+formData.cd+","+(formData.dc||'--')+","+(formData.pc||'--')+"\n"+
"MA,{goodsName:"+formData.xh+",brandName:"+formData.pp+",number:"+formData.sl+",country:"+formData.cd+",dc:"+(formData.dc||'--')+",batch:"+(formData.pc||'--')+"}\n"+
"ENDQR \n"+
"TTEXT 55 1 380 0 型号 \n"+
"TEXT 55 1 380 40 品牌 \n"+
......
......@@ -62,7 +62,7 @@
<view class="form-bottom-left ">
<view class="form-bottom-left-view Bflex aic">
<text class="label">条码</text>
<input class="input input-border" bindconfirm="formtmInput" value="{{formData.tm}}"></input>
<input class="input input-border" bindconfirm="formtmInput" value="{{formData.tm}}" bindinput="emitInput" bindblur="emitInput1"></input>
</view>
<view class="form-bottom-left-view Bflex aic">
<text class="label">型号</text>
......
......@@ -6,6 +6,7 @@ import {
import {
apis
} from '../../utils/api.js';
Page({
/**
......@@ -23,6 +24,7 @@ Page({
maskText:"",
type:"0",//1 卡板 2//箱子 3 型号
receivingId:"",
inputIsScan:true,//input框是否是通过扫描获得数据
},
......@@ -32,6 +34,31 @@ Page({
onLoad: function (options) {
},
emitInput1:function(){
let inputIsScan = this.data.inputIsScan;
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
},
emitInput:function(value){
let inputIsScan = this.data.inputIsScan;
if(value){
if(inputIsScan){
this.setData({
inputIsScan:false
})
}
}else{
if(!inputIsScan){
this.setData({
inputIsScan:true
})
}
}
},
closeMask:function(){
this.setData({
isShowMask:false,
......@@ -50,43 +77,54 @@ Page({
} ,
kbConfirm:function(e){
let {value} = e.detail;
let rwVal = this.data.rwVal;
let reg = /^(XB|KB)\d{11}$/;
let newVal = value;
// let rwVal = this.data.rwVal;
this.setData({
isKb:false,
});
if(!rwVal){
wx.showToast({
title: '上架任务号不能为空',
icon: 'none',
duration: 2000
});
}else{
if(!reg.test(value)){
//箱号要判断是手输入的还是扫码枪扫描的
if(this.data.inputIsScan){
//扫码枪扫描的需要解析数据
let obj = JSON.parse(value);
newVal = obj.goodsName
}
}
// if(!rwVal){
// wx.showToast({
// title: '上架任务号不能为空',
// icon: 'none',
// duration: 2000
// });
// }else{
this.setData({
kbVal:value,
kbVal:newVal,
hwVal:"",
type:"0",
receivingId:"",
});
this.getKbList()
}
// }
} ,
hwConfirm:function(e){
let {value} = e.detail;
let rwVal = this.data.rwVal;
// let rwVal = this.data.rwVal;
let kbVal = this.data.kbVal;
this.setData({
isHw:false,
});
if(!rwVal){
// if(!rwVal){
// wx.showToast({
// title: '上架任务号不能为空',
// icon: 'none',
// duration: 2000
// });
// }else
if(!kbVal){
wx.showToast({
title: '上架任务号不能为空',
icon: 'none',
duration: 2000
});
}else if(!kbVal){
wx.showToast({
title: '卡板号/箱号/型号',
title: '卡板号/箱号/型号不能为空',
icon: 'none',
duration: 2000
});
......@@ -172,13 +210,14 @@ Page({
getKbList:function(){
let me = this;
let taskId = me.data.taskId
if(!taskId){
wx.showToast({
title: '上架任务id不能为空',
icon: 'none',
duration: 2000
});
}else{
// if(!taskId){
// wx.showToast({
// title: '上架任务id不能为空',
// icon: 'none',
// duration: 2000
// });
// }else
// {
getData(apis.scan_goods_discern, 'post', {"sale_task_id":taskId,"code":me.data.kbVal}, function(res) {
if (res.errcode === 0) {
let info = res.data.info || null;
......@@ -242,7 +281,7 @@ Page({
});
}
}, true,true)
}
// }
},
/**
* 生命周期函数--监听页面初次渲染完成
......
......@@ -5,7 +5,7 @@
<text class="desc">上架任务号:</text>
<input class="input input-border" bindconfirm="rwConfirm" value="{{rwVal}}"></input>
<text class="desc">卡板号/箱号/型号:</text>
<input class="input input-border" bindconfirm="kbConfirm" focus="{{isKb}}" value="{{kbVal}}"></input>
<input class="input input-border" bindconfirm="kbConfirm" focus="{{isKb}}" value="{{kbVal}}" bindinput="emitInput" bindblur="emitInput1"></input>
<text class="desc">货位号:</text>
<input class="input input-border" bindconfirm="hwConfirm" focus="{{isHw}}" value="{{hwVal}}"></input>
<view class="number">
......
......@@ -8,7 +8,8 @@ const printData = (xnum,weight,arr) =>{
let k = (i+1)*7;
str+="! 0 200 200 400 1\n";
str+="B QR 200 0 M 2 2 10\n";
str+="MA,"+xnum+","+weight+"\n";
// str+="MA,"+xnum+","+weight+"\n";
str+="MA,"+xnum+"\n";
str+="ENDQR\n";
str+="TEXT 55 1 200 160 箱号:\n";
str+="TEXT 55 1 250 160 "+xnum+"\n";
......
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