|
@ -139,7 +139,7 @@ |
|
|
}, 1000); |
|
|
}, 1000); |
|
|
// #endif |
|
|
// #endif |
|
|
}, |
|
|
}, |
|
|
setItemCodeSimulate(itemCode,scanMsg) { |
|
|
setItemCodeSimulate(itemCode, scanMsg) { |
|
|
this.itemCode = itemCode; |
|
|
this.itemCode = itemCode; |
|
|
this.scanMsg = scanMsg; |
|
|
this.scanMsg = scanMsg; |
|
|
}, |
|
|
}, |
|
@ -188,29 +188,30 @@ |
|
|
getMesPackInfo(this.itemCode).then(res => { |
|
|
getMesPackInfo(this.itemCode).then(res => { |
|
|
try { |
|
|
try { |
|
|
if (res.data.list.length == 0) { |
|
|
if (res.data.list.length == 0) { |
|
|
throw new Error("没有查找到物料号【"+this.itemCode+"】对应的生产条码配置") |
|
|
throw new Error("没有查找到物料号【" + this.itemCode + "】对应的生产条码配置") |
|
|
} |
|
|
} |
|
|
var result = res.data.list[0] //Mes条码标签解析规格 |
|
|
var result = res.data.list[0] //Mes条码标签解析规格 |
|
|
var partNumber = result.partNumber; //客户物料号 |
|
|
var partNumber = result.partNumber; //客户物料号 |
|
|
var lengthMat = result.lengthMat; |
|
|
var lengthMat = result.lengthMat; |
|
|
var lengthBc = result.lengthBc; |
|
|
var lengthBc = result.lengthBc; |
|
|
|
|
|
|
|
|
|
|
|
//因为Q5的客户物料进行了加密,没有解析规格,在生产条码配置中的Type配置成Q5 |
|
|
|
|
|
if (result.Type == 'P') { |
|
|
let scanPartNumber = content.substr(0, lengthMat); //扫描的客户物料号 |
|
|
let scanPartNumber = content.substr(0, lengthMat); //扫描的客户物料号 |
|
|
let productDate = content.substr(lengthMat, 8); |
|
|
// let productDate = content.substr(lengthMat, 8); |
|
|
let batch = content.substr(lengthMat + 8, 3); |
|
|
// let batch = content.substr(lengthMat + 8, 3); |
|
|
let order = content.substr(-8); |
|
|
let order = content.substr(-8); |
|
|
if (scanPartNumber != partNumber) { |
|
|
if (scanPartNumber != partNumber) { |
|
|
that.clear(); |
|
|
that.clear(); |
|
|
throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber + "】与生成条码配置表中的客户物料号【" + partNumber + |
|
|
throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber + |
|
|
|
|
|
"】与生成条码配置表中的客户物料号【" + partNumber + |
|
|
"】不一致") |
|
|
"】不一致") |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let scanResult = { |
|
|
let scanResult = { |
|
|
itemCode: scanPartNumber, |
|
|
itemCode: scanPartNumber, |
|
|
productDate: productDate, |
|
|
// productDate: productDate, |
|
|
batch: batch, |
|
|
// batch: batch, |
|
|
order: order, |
|
|
order: order, |
|
|
qty: 1, |
|
|
qty: 1, |
|
|
content: content, |
|
|
content: content, |
|
@ -218,8 +219,22 @@ |
|
|
}; |
|
|
}; |
|
|
that.clear(); |
|
|
that.clear(); |
|
|
that.$emit("getResult", scanResult); |
|
|
that.$emit("getResult", scanResult); |
|
|
|
|
|
} else { |
|
|
|
|
|
//不进行解析,直接按照扫描的标签进行赋值 |
|
|
|
|
|
let scanResult = { |
|
|
|
|
|
itemCode: this.itemCode, |
|
|
|
|
|
// productDate: new Date(), |
|
|
|
|
|
// batch: new Date(), |
|
|
|
|
|
order: 0, |
|
|
|
|
|
qty: 1, |
|
|
|
|
|
content: content, |
|
|
|
|
|
success: true, |
|
|
|
|
|
}; |
|
|
|
|
|
that.clear(); |
|
|
|
|
|
that.$emit("getResult", scanResult); |
|
|
|
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
this.$refs.comMessage.showErrorMessage( error.message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(error.message, res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
that.getfocus(); |
|
|
that.getfocus(); |
|
|
} |
|
|
} |
|
|