| | |
| | | <div> |
| | | <span>物料</span> |
| | | <input type="text" id="matNo" onkeyup="find(this)" autocomplete="off"> |
| | | <button onclick="find()">查询</button> |
| | | </div> |
| | | |
| | | <div class="mat-msg" id="mat-msg-id"> |
| | |
| | | |
| | | <!-- 详情 --> |
| | | <div class="form-box" id="mat-detail"> |
| | | <div class="form-item form-count"> |
| | | <span style="margin-right: 10px">数量</span> |
| | | <button onclick="reduce()">-</button><input id="count" type="number" style="text-align: center"><button onclick="add()">+</button> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>名称</span> |
| | | <input id="matName" type="text" disabled="disabled" style="background-color: #ececec;color: #000"> |
| | |
| | | <div class="form-item"> |
| | | <span>单位</span> |
| | | <input id="str1" type="text" disabled="disabled" style="background-color: #ececec;color: #000; text-align: center;"> |
| | | </div> |
| | | <div class="form-item form-count"> |
| | | <span style="margin-right: 10px">数量</span> |
| | | <button onclick="reduce()">-</button><input id="count" type="number" style="text-align: center"><button onclick="add()">+</button> |
| | | </div> |
| | | <div class="form-item form-btn-con"> |
| | | <button id="confirm" onclick="confirm()">提取</button> |
| | |
| | | |
| | | </body> |
| | | <script> |
| | | |
| | | var matMsgTableBlankRows = 0; // 空白行数 |
| | | var matData = []; // 表格数据 |
| | | var code = document.getElementById("code") |
| | |
| | | |
| | | matDetail.style.display = 'none'; |
| | | var initMatCount = 1; |
| | | // window.onload = function(){code.focus();} |
| | | |
| | | // 查询物流 |
| | | function find(el) { |
| | |
| | | type: 'post', |
| | | headers: [{token: getCookie('token')}], |
| | | data: { |
| | | id: el.value |
| | | id: matNo.value |
| | | }, |
| | | }, function (res) { |
| | | if (res.code === 200) { |
| | |
| | | // 填充数据 |
| | | matName.value = res.data.matName; |
| | | str1.value = res.data.str1; |
| | | |
| | | count.focus(); |
| | | count.value = initMatCount; |
| | | document.getElementById("confirm").focus(); |
| | | // confirmBtn.focus(); |
| | | } else { |
| | | matMsg.style.display = 'block'; |
| | | btnCon.style.display = 'block'; |
| | |
| | | } |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 112) { |
| | | code.focus(); |
| | | } else if (key === 113) { |
| | | matNo.focus(); |
| | | } else if (key === 114) { |
| | | combBtn.focus(); |
| | | } else if (key === 13) { |
| | | confirmBtn.focus(); |
| | | } |
| | | |
| | | // if (code1 === 13) { |
| | | // if (window.getComputedStyle(matDetail).display === 'block') { |
| | | // confirm() |
| | | // } else if (window.getComputedStyle(btnCon).display === 'block') { |
| | | // comb() |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | document.onkeydown = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var code1 = e.charCode || e.keyCode; |
| | | if (code1 === 13) { |
| | | if (window.getComputedStyle(matDetail).display === 'block') { |
| | | confirm() |
| | | } else if (window.getComputedStyle(btnCon).display === 'block') { |
| | | comb() |
| | | } |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 114) { |
| | | comb() |
| | | } |
| | | |
| | | // if (code1 === 13) { |
| | | // if (window.getComputedStyle(matDetail).display === 'block') { |
| | | // confirm() |
| | | // } else if (window.getComputedStyle(btnCon).display === 'block') { |
| | | // comb() |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | // todo |
| | | setTimeout(function () { |
| | | code.value = "888" |
| | | addTableData({ |
| | | matNo: "1902980-11/14", |
| | | matName: "铝带|1100-O|0.33*475|", |
| | | str1: "件", |
| | | count: 1 |
| | | }) |
| | | }, 200) |
| | | // setTimeout(function () { |
| | | // code.value = "888" |
| | | // addTableData({ |
| | | // matNo: "1902980-11/14", |
| | | // matName: "铝带|1100-O|0.33*475|", |
| | | // str1: "件", |
| | | // count: 1 |
| | | // }) |
| | | // }, 200) |
| | | </script> |
| | | </html> |