CheckBom.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Ext.define('erp.view.pm.bom.CheckBom',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'erpFormPanel',
  10. anchor: '100% 20%',
  11. id:'formPanel',
  12. enableTools: false
  13. },{
  14. xtype: 'grid',
  15. id: 'bom-check',
  16. anchor: '100% 80%',
  17. columns: [{
  18. text: '',
  19. dataIndex: 'check',
  20. flex: 1,
  21. renderer: function(val, meta, record) {
  22. meta.tdCls = val;
  23. return '';
  24. }
  25. },{
  26. text: '检测项',
  27. dataIndex: 'VALUE',
  28. flex: 10,
  29. renderer: function(val, meta, record) {
  30. if(record.get('check') == 'error') {
  31. meta.style = 'color: gray';
  32. }
  33. return val;
  34. }
  35. },{
  36. text: '',
  37. dataIndex: 'link',
  38. flex: 1,
  39. renderer: function(val, meta, record) {
  40. if(record.get('check') == 'error') {
  41. meta.tdCls = 'detail';
  42. return '详细情况';
  43. }
  44. return '';
  45. }
  46. }],
  47. columnLines: true,
  48. store: Ext.create('Ext.data.Store',{
  49. fields: [{name: 'TYPE', type: 'string'}, {name: 'VALUE', type: 'string'}],
  50. proxy: {
  51. type: 'ajax',
  52. url:basePath+'pm/bomCheck/getBomCheckItems.action?caller=BomCheck',
  53. reader: {
  54. //数据格式为json
  55. type: 'json',
  56. root: 'data'
  57. }
  58. },
  59. autoLoad:true
  60. })
  61. }]
  62. });
  63. me.callParent(arguments);
  64. }
  65. });