Browse Source

修改扫码后点击库存数据不准确的问题

lwx_dev
erdanergou 2 years ago
parent
commit
2f7f09c4fb
  1. 17
      src/main/resources/templates/pages/showInventory/showInventoryForLocation.html
  2. 18
      target/classes/templates/pages/showInventory/showInventoryForLocation.html

17
src/main/resources/templates/pages/showInventory/showInventoryForLocation.html

@ -166,11 +166,12 @@
result = res.data; result = res.data;
lis.push("<div class='clearfix'>"); lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) { for (let i = 0; i < result.length; i++) {
let splitInventory = result[i].splitInventory; let resultElement = result[i];
let splitInventory = resultElement.splitInventory;
let keys = Object.keys(splitInventory); let keys = Object.keys(splitInventory);
let InventoryItem = ""; let InventoryItem = "";
let brandItem = '<p>' + "物料品牌:" + result[i].mbrand + '</p>'; let brandItem = '<p>' + "物料品牌:" + resultElement.mbrand + '</p>';
if (result[i].mbrand === "") { if (resultElement.mbrand === "") {
brandItem = ""; brandItem = "";
} }
for (let j = 0; j < keys.length; j++) { for (let j = 0; j < keys.length; j++) {
@ -178,13 +179,13 @@
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>';
InventoryItem += item; InventoryItem += item;
} }
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' + result[i].id + ')">' + lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' + resultElement.iid + ')">' +
'<div class="layui-card-header"><h2>' + "物料名称:" + result[i].mname + '</h2></div>'); '<div class="layui-card-header"><h2>' + "物料名称:" + resultElement.mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+ '<p>' + "物料编码:" + result[i].mcode + '</p>' + '<p>' + "物料编码:" + resultElement.mcode + '</p>'
+ '<p>' + "物料型号:" + result[i].version + '</p>' + '<p>' + "物料型号:" + resultElement.version + '</p>'
+ brandItem + brandItem
+ '<p>' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '</p>' + '<p>' + "所处位置:" + resultElement.dname + "-" + resultElement.kingdeecode + '</p>'
+ InventoryItem + InventoryItem
+ '</div></div></li>'); + '</div></div></li>');
} }

18
target/classes/templates/pages/showInventory/showInventoryForLocation.html

@ -166,11 +166,13 @@
result = res.data; result = res.data;
lis.push("<div class='clearfix'>"); lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) { for (let i = 0; i < result.length; i++) {
let splitInventory = result[i].splitInventory; let resultElement = result[i];
console.log(resultElement)
let splitInventory = resultElement.splitInventory;
let keys = Object.keys(splitInventory); let keys = Object.keys(splitInventory);
let InventoryItem = ""; let InventoryItem = "";
let brandItem = '<p>' + "物料品牌:" + result[i].mbrand + '</p>'; let brandItem = '<p>' + "物料品牌:" + resultElement.mbrand + '</p>';
if (result[i].mbrand === "") { if (resultElement.mbrand === "") {
brandItem = ""; brandItem = "";
} }
for (let j = 0; j < keys.length; j++) { for (let j = 0; j < keys.length; j++) {
@ -178,13 +180,13 @@
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>';
InventoryItem += item; InventoryItem += item;
} }
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' + result[i].id + ')">' + lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' + resultElement.iid + ')">' +
'<div class="layui-card-header"><h2>' + "物料名称:" + result[i].mname + '</h2></div>'); '<div class="layui-card-header"><h2>' + "物料名称:" + resultElement.mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+ '<p>' + "物料编码:" + result[i].mcode + '</p>' + '<p>' + "物料编码:" + resultElement.mcode + '</p>'
+ '<p>' + "物料型号:" + result[i].version + '</p>' + '<p>' + "物料型号:" + resultElement.version + '</p>'
+ brandItem + brandItem
+ '<p>' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '</p>' + '<p>' + "所处位置:" + resultElement.dname + "-" + resultElement.kingdeecode + '</p>'
+ InventoryItem + InventoryItem
+ '</div></div></li>'); + '</div></div></li>');
} }

Loading…
Cancel
Save