let itemRows = [{LotCode: "2202122", ItemCode: "RJ8500154", ITEM_SPECIFICATION: "801201200", QTY: 2}];
let res = {ItemCode: "RJ8500154"};
let editableTabs = [
{
data: [
{
ID: 0,
LotBarcode: 0101,
},
{
ID: 2,
LotBarcode: 0101,
},
{
ID: 2,
LotBarcode: 0101,
},
],
tabIndex: 1,
}
];
let code = 0101;
for (let i in itemRows){
if (itemRows[i].ItemCode == res.ItemCode) {
let recordQTY=0;
for(const iterator of editableTabs){
console.log(iterator);
for (const data of iterator.data){
if(data.LotBarcode==code){
recordQTY++;
console.log(recordQTY);
if(recordQTY>itemRows[i].QTY){
console.log("扫描该批号条码数量已超过订单数量!");
}else{
console.log("未超过");
}
}
}
}
}
}
console