|  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .form-box { | 
|---|
|  |  |  | padding: 15px 5px 5px 5px; | 
|---|
|  |  |  | font-size: 12px; | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .form-box span { | 
|---|
|  |  |  | font-size: 12px; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .number-tool button { | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | margin-top: 2px; | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | height: 18px; | 
|---|
|  |  |  | margin-top: 3px; | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | height: 25px; | 
|---|
|  |  |  | float: left; | 
|---|
|  |  |  | width: 20px; | 
|---|
|  |  |  | width: 25px; | 
|---|
|  |  |  | border: 1px solid #777777; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .number-tool input { | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | height: 20px; | 
|---|
|  |  |  | height: 30px; | 
|---|
|  |  |  | float: left; | 
|---|
|  |  |  | margin: 0 5px; | 
|---|
|  |  |  | width: 30px; | 
|---|
|  |  |  | width: 40px; | 
|---|
|  |  |  | padding: 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .form-button { | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | padding: 5px 20px; | 
|---|
|  |  |  | margin: 5px 10px 0 10px; | 
|---|
|  |  |  | padding: 5px 15px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | 
|---|
|  |  |  | <input id="locNo" type="text" disabled="disabled"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="form-item"> | 
|---|
|  |  |  | <span>物料编码</span> | 
|---|
|  |  |  | <span>商品编号</span> | 
|---|
|  |  |  | <input id="matnr" type="text" disabled="disabled"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="form-item"> | 
|---|
|  |  |  | <span>物料名称</span> | 
|---|
|  |  |  | <span>商品名称</span> | 
|---|
|  |  |  | <input id="maktx" type="text" disabled="disabled"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="form-item"> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <button onclick="reduce()">-</button> | 
|---|
|  |  |  | <input id="count" type="number"> | 
|---|
|  |  |  | <!--            <button onclick="add()">+</button>--> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <button class="form-button" id="save" onclick="save()">保存</button> | 
|---|
|  |  |  | <button class="form-button" id="remove" onclick="remove()">移除</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | var countDom = $('#count'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function save() { | 
|---|
|  |  |  | if (countDom.val() <= 1) { | 
|---|
|  |  |  | alert("数量必须大于0") | 
|---|
|  |  |  | console.log(countDom.val()) | 
|---|
|  |  |  | if (countDom.val() < 1) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | parent.updateTableData({ | 
|---|
|  |  |  | 
|---|
|  |  |  | parent.layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function remove() { | 
|---|
|  |  |  | parent.removeTableData({ | 
|---|
|  |  |  | locNo: $('#locNo').val(), | 
|---|
|  |  |  | matnr: $('#matnr').val(), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | parent.layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function add() { | 
|---|
|  |  |  | countDom.val(Number(countDom.val()) + 1); | 
|---|
|  |  |  | } | 
|---|