|
|
@ -12,26 +12,26 @@ import { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getLabelInfo(scanMsg,headerType, callBack) { |
|
|
|
console.log('扫描信息:', scanMsg); |
|
|
|
export function getLabelInfo(scanMsg, headerType, callBack) { |
|
|
|
console.log('扫描信息:', scanMsg); |
|
|
|
if (scanMsg.length == 0) { |
|
|
|
return null |
|
|
|
} |
|
|
|
let items = scanMsg.split(';'); |
|
|
|
let header = items[0]; |
|
|
|
let version = items[1]; |
|
|
|
if ((header != undefined) && (version!=undefined)) { |
|
|
|
var hearList =getDirectoryItemArray(headerType) |
|
|
|
if(!checkDirectoryItemExist(hearList,header)){ |
|
|
|
if ((header != undefined) && (version != undefined)) { |
|
|
|
var hearList = getDirectoryItemArray(headerType) |
|
|
|
if (!checkDirectoryItemExist(hearList, header)) { |
|
|
|
let labelResult = { |
|
|
|
label: { |
|
|
|
labelType: "", |
|
|
|
barType: '', |
|
|
|
code:"" |
|
|
|
code: "" |
|
|
|
}, |
|
|
|
package: null, |
|
|
|
success: false, |
|
|
|
message: '请输入'+headerType+"开始的标签", |
|
|
|
message: '请输入' + headerType + "开始的标签", |
|
|
|
} |
|
|
|
callBack(labelResult); |
|
|
|
return; |
|
|
@ -47,10 +47,10 @@ export function getLabelInfo(scanMsg,headerType, callBack) { |
|
|
|
// {
|
|
|
|
// getBarCodeInfo(header, version, items[2], callBack);
|
|
|
|
// }
|
|
|
|
else { //直接输入文本
|
|
|
|
else { //直接输入文本
|
|
|
|
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); |
|
|
|
// let labelResult = {
|
|
|
|
// label: {
|
|
|
@ -79,7 +79,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) { |
|
|
|
message: '' |
|
|
|
} |
|
|
|
getLabelByHeader(header, version).then(res => { |
|
|
|
if (res.data==null) { |
|
|
|
if (res.data == null) { |
|
|
|
labelResult.success = false; |
|
|
|
labelResult.message = '未查找到标签头为[' + header + ']的标签类型'; |
|
|
|
callBack(labelResult); |
|
|
@ -108,7 +108,7 @@ export function getLabelItems(labelItem, scanMsg, callBack) { |
|
|
|
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { |
|
|
|
//查询包装信息
|
|
|
|
let packingNumber = labelResult.label.packingNumber |
|
|
|
if (packingNumber != undefined) { |
|
|
|
if (packingNumber != undefined && packingNumber != '') { |
|
|
|
getPackageListByNumber(packingNumber).then(pack => { |
|
|
|
if (pack.data.reqPackage) { |
|
|
|
labelResult.package = pack.data.reqPackage; |
|
|
@ -126,9 +126,12 @@ export function getLabelItems(labelItem, scanMsg, callBack) { |
|
|
|
callBack(labelResult); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
labelResult.success = false; |
|
|
|
labelResult.message = '在条码中未解析到箱码'; |
|
|
|
//线边的物料可能没有箱码
|
|
|
|
labelResult.package = labelResult.label; |
|
|
|
callBack(labelResult); |
|
|
|
// labelResult.success = false;
|
|
|
|
// labelResult.message = '在条码中未解析到箱码';
|
|
|
|
// callBack(labelResult);
|
|
|
|
} |
|
|
|
} else { |
|
|
|
callBack(labelResult); |
|
|
@ -189,7 +192,7 @@ export function getBarCodeInfo(header, version, value, callBack) { |
|
|
|
label: { |
|
|
|
labelType: header, |
|
|
|
barType: 'BarCode', |
|
|
|
code:value |
|
|
|
code: value |
|
|
|
}, |
|
|
|
package: null, |
|
|
|
success: true, |
|
|
|