| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin: 5px 5px"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i |
| | | class="layui-icon">+</i>提取 |
| | | </button> |
| | | </div> |
| | | <!-- <div style="margin: 5px 5px">--> |
| | | <!-- <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i--> |
| | | <!-- class="layui-icon">+</i>提取--> |
| | | <!-- </button>--> |
| | | <!-- </div>--> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | |
| | |
| | | function confirm() { |
| | | var matNo = $('#matNo').val(); |
| | | var count = $('#count').val(); |
| | | if (count > maxCount) { |
| | | alert("数量不能超过" + maxCount); |
| | | return; |
| | | } |
| | | if (count < minCount) { |
| | | alert("数量不能低于" + minCount); |
| | | return; |
| | | } |
| | | var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) { |
| | | if (count > maxCount || count < minCount) { |
| | | tips("数量不能超过范围", true); |
| | | return; |
| | | if (mnemonic) { |
| | | if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) { |
| | | matData[j].count = Number(count); |
| | | } |
| | | matData[j].count = Number(count); |
| | | } else { |
| | | if (matNo === matData[j].matNo) { |
| | | matData[j].count = Number(count); |
| | | } |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("修改成功"); |
| | | } |
| | | |
| | | function remove() { |
| | | var matnr = $('#matNo').val(); |
| | | var index = $('#index').val(); |
| | | var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (mnemonic) { |
| | | if (matnr === matData[j].matNo && mnemonic === matData[j].mnemonic) { |
| | | matData.splice(j, 1); |
| | | } |
| | | } else { |
| | | if (matnr === matData[j].matNo) { |
| | | matData.splice(j, 1); |
| | | } |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | window.onload = function () { |
| | |
| | | }); |
| | | |
| | | // 请求保存接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/in", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(true); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | var areaType = getQueryVariable('areaType'); |
| | | if (areaType == 1) { |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/in/source", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(true); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } else { |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/in", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(true); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |