| | |
| | | }, |
| | | }); |
| | | |
| | | // 库区下拉 |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#putSiteSelect').append(html); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | var records = res.data.records; |
| | | records.map(function (item) { |
| | | locArea.map(function (d) { |
| | | if (d.id == item.warehouse) { |
| | | if (d.uuid == item.warehouse) { |
| | | item.warehouse = d.name; |
| | | } |
| | | }) |
| | |
| | | table.on('edit(locNormal)', function (obj) { |
| | | var count = obj.value; |
| | | var matnr = obj.data.matnr; |
| | | var id = obj.data.id; |
| | | |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | |
| | | const param = { |
| | | matnr: matnr, |
| | | anfme: count, |
| | | id: id, |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/update/auth", |
| | |
| | | var data = obj.data; |
| | | var param = { |
| | | matnr: data.matnr, |
| | | id: data.id, |
| | | } |
| | | switch (obj.event) { |
| | | case 'outLocNormal': |
| | | // 出库 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/outLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | }, |
| | | layer.confirm('确定要出库['+data.matnr+']吗?', { |
| | | btn: ['确定', '取消'] //可以无限个按钮 |
| | | }, function(index, layero){ |
| | | //确定回调-出库 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/outLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | layer.closeAll(); |
| | | layer.msg("出库成功"); |
| | | }, |
| | | }); |
| | | }, function(index){ |
| | | //按钮【按钮二】的回调 |
| | | }); |
| | | break; |
| | | case 'removeLocNormal': |
| | | // 移除 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/removeLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | }, |
| | | layer.confirm('确定要移除['+data.matnr+']吗?', { |
| | | btn: ['确定', '取消'] //可以无限个按钮 |
| | | }, function(index, layero){ |
| | | //确定回调-移除 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/removeLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | layer.closeAll(); |
| | | layer.msg("移除成功"); |
| | | }, |
| | | }); |
| | | }, function(index){ |
| | | //按钮【按钮二】的回调 |
| | | }); |
| | | break; |
| | | } |