From 6f7a815b2d6e4f30e7ccf901b24d5103aaa72078 Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期一, 25 十二月 2023 10:23:08 +0800 Subject: [PATCH] Merge branch 'tzskasrs-1' of http://47.97.1.152:5880/r/zy-asrs into tzskasrs-1 --- src/main/webapp/views/pda/matQuery.html | 149 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 123 insertions(+), 26 deletions(-) diff --git a/src/main/webapp/views/pda/matQuery.html b/src/main/webapp/views/pda/matQuery.html index c12fdec..38ba406 100644 --- a/src/main/webapp/views/pda/matQuery.html +++ b/src/main/webapp/views/pda/matQuery.html @@ -14,7 +14,7 @@ .form-box { padding: 15px 5px 5px 5px; - font-size: 12px; + font-size: 16px; text-align: center; } @@ -23,19 +23,53 @@ } .form-box span { - font-size: 12px; + font-size: 16px; display: inline-block; text-align: right; - width: 50px; + width: 70px; } .form-box input { width: 120px; margin-left: 10px; padding-left: 5px; - height: 20px; + height: 30px; + border: 1px solid #777777; + overflow:hidden; + white-space:nowrap; + text-overflow:ellipsis; } - .form-box button { + #confirm { + margin-top: 10px; padding: 5px 20px; + } + + .number-tool { + margin-left: 10px; + padding: 1px 0 1px 5px; + display: inline-block; + width: 120px; + } + .number-tool:after { + clear: both; + content: ""; + display: table; + } + .number-tool button { + background-color: #fff; + margin-top: 3px; + font-size: 16px; + height: 25px; + float: left; + width: 25px; + border: 1px solid #777777; + } + .number-tool input { + text-align: center; + height: 30px; + float: left; + margin: 0 5px; + width: 40px; + padding: 0; } </style> </head> @@ -43,49 +77,112 @@ <div class="form-box"> <div class="form-item"> - <span>鐗╂枡缂栫爜</span> - <input id="matNo" type="text" placeholder="鎵爜/杈撳叆"> + <span>鐗╂枡鍙�</span> + <input id="matNo" type="text" placeholder="鎵爜 / 杈撳叆" onkeyup="find(this)" autocomplete="off"> </div> <div class="form-item"> <span>鐗╂枡鍚嶇О</span> - <input type="text" disabled="disabled"> + <input id="matName" type="text" disabled="disabled"> </div> <div class="form-item"> - <span>鐗╂枡鎻忚堪</span> - <input type="text" disabled="disabled"> + <span>瑙勬牸</span> + <input id="str2" type="text" disabled="disabled"> </div> <div class="form-item"> <span>鍗曚綅</span> - <input type="text" disabled="disabled"> + <input id="str1" type="text" disabled="disabled"> </div> <div class="form-item"> - <span>鏁伴噺</span> - <input type="number" > + <span style="vertical-align: middle">鏁伴噺</span> + <div class="number-tool" style="vertical-align: middle"> + <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> + </div> </div> - <button id="confirm">鎻愬彇</button> + <button id="confirm" onclick="confirm()">鎻愬彇</button> </div> </body> <script> + var countDom = $('#count'); + var initMatCount = 1; var pageCurr; - layui.use(['table','laydate', 'form'], function() { - var table = layui.table; - var $ = layui.jquery; - var layer = layui.layer; - var layDate = layui.laydate; - var form = layui.form; - }); + /** + * 鏍规嵁鍟嗗搧缂栧彿鏌ヨ鐗╂枡璇︽儏 + */ + function find(el){ + if (isEmpty(el.value)) { + return; + } + $.ajax({ + url: baseUrl + "/mat/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + matnr: el.value + }, + method: 'POST', + success: function (res) { + if (res.code === 200) { + if (res.data != null) { + console.log(res.data) + $('#matName').val(res.data.maktx); + $('#str1').val(res.data.str1); + $('#str2').val(res.data.str2); + countDom.val(initMatCount); + $('#count').focus().select(); + } + } else if (res.code === 403) { + top.location.href = baseUrl + "/pda"; + } else { + alert(res.msg) + } + } + }) + } + + /** + * 鎻愬彇 + */ + function confirm(){ + var data = { + matnr: $('#matNo').val(), + maktx: $('#matName').val(), + count: countDom.val() + }; + console.log(data) + parent.addTableData(data); + parent.layer.close(parent.matCodeLayerIdx); + } window.onload = function(){document.getElementById("matNo").focus();} $(document).on('click','#confirm', function () { }) - $('body').keydown(function () { - if (event.keyCode === 13) { - $("#confirm").click(); + // $('body').keydown(function () { + // if (event.keyCode === 13) { + // $("#confirm").click(); + // } + // }); + + function add() { + countDom.val(Number(countDom.val()) + 1); + } + function reduce() { + if (countDom.val() <= initMatCount) { + return; } - }); + countDom.val(countDom.val() - 1); + } + + + document.onkeyup = function (e) { + if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯 + e = window.event; + var key = e.charCode || e.keyCode; + if (key === 115) { + confirm(); + } + } </script> -</html> \ No newline at end of file +</html> -- Gitblit v1.9.1