| | |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> |
| | | <meta name="viewport" |
| | | content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> |
| | | <title>库存明细详情</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .number-tool { |
| | |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <button id="reduceBtn" onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <!-- <button onclick="add()">+</button>--> |
| | | <!-- <button onclick="add()">+</button>--> |
| | | </div> |
| | | </div> |
| | | <button class="form-button" id="save" onclick="save()">保存</button> |
| | |
| | | </body> |
| | | <script> |
| | | var countDom = $('#count'); |
| | | var flag = getQueryVariable("flag"); |
| | | |
| | | if (flag == '1') { |
| | | console.log('隐藏部分功能'); |
| | | $("#reduceBtn").css("display", "none"); |
| | | $("#remove").css("display", "none"); |
| | | $("#count").attr("disabled", "true"); |
| | | } |
| | | |
| | | function getQueryVariable(variable) { |
| | | var query = window.location.search.substring(1); |
| | | var vars = query.split("&"); |
| | | for (var i = 0; i < vars.length; i++) { |
| | | var pair = vars[i].split("="); |
| | | if (pair[0] == variable) { |
| | | return pair[1]; |
| | | } |
| | | } |
| | | return (false); |
| | | } |
| | | |
| | | function save() { |
| | | console.log(countDom.val()) |
| | |
| | | function add() { |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= 1) { |
| | | return; |