| | |
| | | var cols = [ |
| | | {field: 'matnr', align: 'center', title: '物料号', sort: true} |
| | | , {field: 'maktx', align: 'center', title: '物料名称', sort: true} |
| | | , {field: 'specs', align: 'center', title: '规格'} |
| | | , {field: 'batch', align: 'center', title: '批号', width: 300, sort: true} |
| | | , {field: 'storeMax', align: 'center', title: '数量上限', sort: true} |
| | | , {field: 'storeMin', align: 'center', title: '数量下限', sort: true} |
| | | // , {field: 'storeMaxDate', align: 'center', title: '库龄上限', sort: true} |
| | | , { |
| | | field: 'warnStatus', align: 'center', title: '状态', sort: true, templet: function (d) { |
| | | var colorMap = { |
| | | '未设置': '#999999', |
| | | '正常': '#5cb85c', |
| | | '超上限': '#d9534f', |
| | | '超下限': '#337ab7' |
| | | }; |
| | | var text = d.warnStatus || ''; |
| | | var color = colorMap[text] || '#333333'; |
| | | return '<span style="color:' + color + ';">' + text + '</span>'; |
| | | } |
| | | } |
| | | , {field: 'anfme', align: 'center', title: '实际数量'} |
| | | // , {field: 'nowTime', align: 'center', title: '实际库龄'} |
| | | |
| | |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function () { |
| | | var titles = []; |
| | | var fields = []; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var titles = ['物料号', '物料名称', '数量上限', '数量下限', '状态', '实际数量']; |
| | | var fields = ['matnr', 'maktx', 'storeMax', 'storeMin', 'warnStatus', 'anfme']; |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | exportData[this.name] = this.value; |
| | |
| | | }; |
| | | var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false}); |
| | | $.ajax({ |
| | | url: baseUrl + "/locDetl/export/auth", |
| | | url: baseUrl + "/locDetl/groupLocExport/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType: 'json', |
| | |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | form.render('select'); |
| | | tableReload(false); |
| | | }); |
| | | |
| | |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | form.render('select'); |
| | | |
| | | }); |
| | | |