| | |
| | | var printMatCodeNos = []; |
| | | var admin; |
| | | |
| | | function createNumberCell(title, field) { |
| | | return { |
| | | field: field, |
| | | align: 'center', |
| | | title: title, |
| | | templet: function (d) { |
| | | var raw = d[field]; |
| | | if (raw === null || raw === undefined) return ''; |
| | | if (typeof raw === 'string' && raw.trim() === '') return ''; |
| | | var num = Number(raw); |
| | | if (!isFinite(num)) return ''; |
| | | return num.toFixed(2); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | |
| | | // ,{field: 'store_min', align: 'center',title: '库存下限'} |
| | | // ,{field: 'store_max_date', align: 'center',title: '库龄上限(天)'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | var pageMatCols = matCols.filter(function (col) { |
| | | return ['specs', 'model', 'brand'].indexOf(col.field) === -1; |
| | | }); |
| | | cols.push.apply(cols, pageMatCols); |
| | | cols.push( |
| | | createNumberCell('库存预警数量上限', 'storeMax'), |
| | | createNumberCell('库存预警数量下限', 'storeMin') |
| | | ); |
| | | cols.push( |
| | | {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 150} |
| | | ) |