SmQuery.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Ext.define('erp.view.fa.ars.SmQuery', {
  2. extend : 'Ext.Viewport',
  3. layout : 'fit',
  4. initComponent : function() {
  5. var me = this;
  6. Ext.apply(me, {
  7. items : [ {
  8. xtype: 'erpGridPanel2',
  9. bbar: null,
  10. tbar: [{
  11. name: 'query',
  12. text: $I18N.common.button.erpQueryButton,
  13. iconCls: 'x-button-icon-query',
  14. cls: 'x-btn-gray',
  15. margin: '0 0 0 3'
  16. }, {
  17. xtype: 'tbtext',
  18. name: 'info',
  19. tpl: Ext.create('Ext.XTemplate',
  20. '<span>{cm_yearmonth:this.getYearmonth}</span>', {
  21. getYearmonth: function(v) {
  22. if(v instanceof Object) {
  23. var v1 = String(v.begin), v2 = String(v.end);
  24. return ' 期间: 从' + v1.substr(0, 4) + '年' + v1.substr(4) + '月 到 ' +
  25. v2.substr(0, 4) + '年' + v2.substr(4) + '月';
  26. }
  27. }
  28. })
  29. } ,'->',{
  30. name: 'refresh',
  31. text: $I18N.common.button.erpRefreshButton,
  32. iconCls: 'x-button-icon-reset',
  33. cls: 'x-btn-gray'
  34. },'-',{
  35. name: 'export',
  36. text: $I18N.common.button.erpExportButton,
  37. iconCls: 'x-button-icon-excel',
  38. cls: 'x-btn-gray',
  39. margin: '0 4 0 0'
  40. },'-',{
  41. name: 'print',
  42. text: $I18N.common.button.erpPrintButton,
  43. iconCls: 'x-button-icon-print',
  44. margin: '0 4 0 0',
  45. cls: 'x-btn-gray'
  46. },'-',{
  47. text: $I18N.common.button.erpCloseButton,
  48. iconCls: 'x-button-icon-close',
  49. id:'close',
  50. cls: 'x-btn-gray',
  51. margin: '0 5 0 0',
  52. handler: function(){
  53. var main = parent.Ext.getCmp("content-panel");
  54. main.getActiveTab().close();
  55. }
  56. }],
  57. setLoading : function(b) {
  58. var mask = this.mask;
  59. if (!mask) {
  60. this.mask = mask = new Ext.LoadMask(Ext.getBody(), {
  61. msg : "处理中,请稍后...",
  62. msgCls : 'z-index:10000;'
  63. });
  64. }
  65. if (b)
  66. mask.show();
  67. else
  68. mask.hide();
  69. },
  70. cls: 'custom-grid',
  71. viewConfig: {
  72. getRowClass: function(record) {
  73. var s = null, t = record.get('sm_showtype');
  74. switch(t) {
  75. case '1':
  76. s = 'custom';break;
  77. case '2':
  78. s = 'custom';break;
  79. case '3':
  80. s = null;break;
  81. case '4':
  82. s = null;break;
  83. case '5':
  84. s = null;break;
  85. }
  86. return s;
  87. }
  88. }
  89. } ]
  90. });
  91. me.callParent(arguments);
  92. }
  93. });