| | |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[{field: 'qty', align: 'center', title: '数量', width: 80} |
| | | cols: [[{field: 'qty', align: 'center', title: '在库箱数', width: 120} |
| | | , {field: 'matNo', align: 'center', title: '产品编码'} |
| | | , {field: 'matName', align: 'center', title: '产品名称'} |
| | | , {field: 'specs', align: 'center',title: '规格'} |
| | | , {field: 'unit', align: 'center',title: '单位', width:80} |
| | | , {field: 'color', align: 'center',title: '颜色'} |
| | | , {field: 'qtyBox', align: 'center',title: '每箱数量(PCS)'} |
| | | , {field: 'allQty', align: 'center',title: '总数量(PCS)'} |
| | | , {field: 'weight', align: 'center',title: '每箱重量(KG)'} |
| | | , {field: 'str3', align: 'center',title: '客户名称'} |
| | | , {field: 'str4', align: 'center',title: '项目信息'} |
| | | , {field: 'str5$', align: 'center',title: '类别'} |
| | | // , {field: 'supplier', align: 'center', title: '批号'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | table.on('toolbar(locStatis)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'syncStok': |
| | | alert('插入数据到ERP接口库存同步表'); |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/stockSyncCount", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | method: 'POST', |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var msg = ''; |
| | | if (res.data == 0) { |
| | | msg = '确定要同步库存数据吗?' |
| | | } else { |
| | | msg = '同步任务正在进行,确定要中止并重新同步吗?' |
| | | } |
| | | layer.confirm(msg, { |
| | | shadeClose: true |
| | | , btn: ['确定'] |
| | | }, function () { |
| | | if (res.data > 0) { |
| | | // 清空同步上传清单数据,再进行插入数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/updateStockSync", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("更新上报库存数据成功!"); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | // 调用同步上传清单数据插入接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/insertStockSync", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("插入上报库存数据成功!"); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | layer.closeAll(); |
| | | } |
| | | ); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | case 'exportAll': |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | location.href = baseUrl + "/stock/statis/export"; |
| | | location.href = baseUrl + "/stock/statis/export?matNo="+$("#matNo").val()+"&matName="+$("#matName").val() |
| | | +"&supplier="+$("#supplier").val()+"&str3="+$("#str3").val()+"&str4="+$("#str4").val()+"&memo="+$("#memo").val(); |
| | | layer.closeAll('loading'); |
| | | break; |
| | | } |