| | |
| | | </body> |
| | | <script> |
| | | var matMsgTableBlankRows = 0; // 空白行数 |
| | | var matData = []; // 表格数据 |
| | | var code = document.getElementById("code") |
| | | var matnr = document.getElementById("matnr") |
| | | var matMsg = document.getElementById("mat-msg-id"); |
| | |
| | | var btnCon = document.getElementById("btn-con"); |
| | | var tipDom = document.getElementById("tips"); |
| | | |
| | | var matetail = document.getElementById("mat-detail"); |
| | | var matDetail = document.getElementById("mat-detail"); |
| | | var matName = document.getElementById("matName"); |
| | | var str1 = document.getElementById("str1"); |
| | | var count = document.getElementById("count"); |
| | | |
| | | matetail.style.display = 'none'; |
| | | alert(1); |
| | | matDetail.style.display = 'none'; |
| | | var initMatCount = 1; |
| | | |
| | | // 查询物流 |
| | |
| | | // 样式 |
| | | matMsg.style.display = 'none'; |
| | | btnCon.style.display = 'none'; |
| | | matetail.style.display = 'block'; |
| | | matDetail.style.display = 'block'; |
| | | // 填充数据 |
| | | matName.value = res.data.matName; |
| | | str1.value = res.data.str1; |
| | |
| | | } else { |
| | | matMsg.style.display = 'block'; |
| | | btnCon.style.display = 'block'; |
| | | matetail.style.display = 'none'; |
| | | matDetail.style.display = 'none'; |
| | | } |
| | | } else { |
| | | alert(res.msg); |
| | |
| | | } |
| | | |
| | | initCrnMsgTable(); |
| | | // 堆垛机数据表获取 ----- 表二 |
| | | function initCrnMsgTable(row) { |
| | | var line; |
| | | if (row === undefined){ |
| | |
| | | ttbody.innerHTML = html; |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | if (isEmpty(data.matName)){ |
| | | tips("提取失败"); |
| | | return; |
| | | } |
| | | let toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (matnr.value === matData[j].matnr) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data); |
| | | var html = " <div>\n" + |
| | | " <span>" + data.matnr + "</span>\n" + |
| | | " <span>" + data.matName + "</span>\n" + |
| | | " <span>" + data.str1 + "</span>\n" + |
| | | " <span>" + data.count + "</span>\n" + |
| | | " </div>\n"; |
| | | ttbody.innerHTML = html; |
| | | } |
| | | tips("提取成功"); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | code.value = ""; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | // 提取 |
| | | function confirm() { |
| | | addTableData({ |
| | | matnr: matnr.value, |
| | | matName: matName.value, |
| | | str1: str1.value, |
| | | count: count.value |
| | | }) |
| | | cancel(); |
| | | } |
| | | // 取消 |
| | | function cancel() { |
| | | matnr.value = ""; |
| | | matName.value = ""; |
| | | str1.value = ""; |
| | | count.value = initMatCount; |
| | | matMsg.style.display = 'block'; |
| | | btnCon.style.display = 'block'; |
| | | matDetail.style.display = 'none'; |
| | | } |
| | | |
| | | function add() { |
| | | count.value = Number(count.value) + 1; |
| | | } |