Commit 30cc63ca by 施宇

1

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