MobileCondition.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. Ext.define('erp.view.ma.MobileCondition',{
  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: 'grid',
  10. id: 'mobileCondition-grid',
  11. anchor: '100% 100%',
  12. tbar: ['->',{
  13. cls: 'x-btn-blue',
  14. id: 'refresh',
  15. text: $I18N.common.button.erpRefreshButton,
  16. width: 80,
  17. margin: '0 0 0 5'
  18. },{
  19. cls: 'x-btn-blue',
  20. id: 'close',
  21. text: $I18N.common.button.erpCloseButton,
  22. width: 80,
  23. margin: '0 0 0 5'
  24. },'->',{
  25. xtype: 'tbtext',
  26. id: 'mobile_count'
  27. }],
  28. plugins: [Ext.create('erp.view.core.grid.HeaderFilter')],
  29. columns: [{
  30. text: '登录账号',
  31. dataIndex: 'EM_CODE',
  32. cls: 'x-grid-header-1',
  33. flex: 0.8,
  34. filter: {xtype:"textfield", filterName:"EM_CODE"}
  35. },{
  36. text: '姓名',
  37. dataIndex: 'EM_NAME',
  38. cls: 'x-grid-header-1',
  39. flex: 0.8,
  40. filter: {xtype:"textfield", filterName:"EM_NAME"}
  41. },{
  42. text: '账套',
  43. dataIndex: 'MA_USER',
  44. cls: 'x-grid-header-1',
  45. flex: 0.5,
  46. filter: {xtype:"textfield", filterName:"MA_USER"}
  47. },{
  48. text: '账套名称',
  49. dataIndex: 'MA_FUNCTION',
  50. cls: 'x-grid-header-1',
  51. flex: 0.5,
  52. filter: {xtype:"textfield", filterName:"MA_FUNCTION"}
  53. },{
  54. text: '最近登陆时间',
  55. dataIndex: 'EM_MOLOGINTIME',
  56. cls: 'x-grid-header-1',
  57. flex: 1.5,
  58. filter: {xtype:"datefield", filterName:"EM_MOLOGINTIME"},
  59. renderer: function(val) {
  60. if(val != null) {
  61. return Ext.Date.format(new Date(val), 'Y-m-d H:i:s');
  62. }
  63. return null;
  64. }
  65. }],
  66. columnLines: true,
  67. enableColumnResize: true,
  68. store: Ext.create('Ext.data.Store',{
  69. fields: ['EM_CODE', 'EM_NAME', 'MA_USER', 'MA_FUNCTION', 'EM_MOLOGINTIME'],
  70. proxy: {
  71. type: 'ajax',
  72. url : basePath + 'mobile/ma/user/getLoginedEmployees.action',
  73. reader: {
  74. type: 'json',
  75. root: 'data'
  76. }
  77. },
  78. autoLoad: true,
  79. listeners: {
  80. load: function(store, items) {
  81. Ext.getCmp('mobile_count').setText('共' + items.length + '人使用过移动客户端');
  82. }
  83. }
  84. }),
  85. selModel: new Ext.selection.CellModel()
  86. }]
  87. });
  88. me.callParent(arguments);
  89. }
  90. });