|  |  | 
 |  |  |     <div class="form-item"> | 
 |  |  |         <span style="vertical-align: middle">数量</span> | 
 |  |  |         <div class="number-tool" style="vertical-align: middle"> | 
 |  |  |             <button onclick="add()">+</button><input id="count" type="number" value="1"><button onclick="reduce()">-</button> | 
 |  |  |             <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> | 
 |  |  |         </div> | 
 |  |  |     </div> | 
 |  |  |     <button id="confirm" onclick="confirm()">提取</button> | 
 |  |  | 
 |  |  | </body> | 
 |  |  | <script> | 
 |  |  |     var countDom = $('#count'); | 
 |  |  |     var initMatCount = 1; | 
 |  |  |     var pageCurr; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |                         $('#matName').val(res.data.matName); | 
 |  |  |                         $('#str1').val(res.data.str1); | 
 |  |  |                         $('#str2').val(res.data.str2); | 
 |  |  |                         countDom.focus().val(initMatCount) | 
 |  |  |                     } | 
 |  |  |                 } else if (res.code === 403) { | 
 |  |  |                     top.location.href = baseUrl + "/pda"; | 
 |  |  | 
 |  |  |      * 提取 | 
 |  |  |      */ | 
 |  |  |     function confirm(){ | 
 |  |  |         var data = { | 
 |  |  |             matNo: $('#matNo').val(), | 
 |  |  |             matName: $('#matName').val(), | 
 |  |  |             count: countDom.val() | 
 |  |  |         }; | 
 |  |  |         parent.addTableData(data); | 
 |  |  |         parent.layer.close(parent.matCodeLayerIdx); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |         countDom.val(Number(countDom.val()) + 1); | 
 |  |  |     } | 
 |  |  |     function reduce() { | 
 |  |  |         if (countDom.val() <= 1) { | 
 |  |  |         if (countDom.val() <= initMatCount) { | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         countDom.val(countDom.val() - 1); |