Formr.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Ext.define('erp.view.oa.info.Formr',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpPagingFormPanelr',
  4. id: 'formr', //
  5. region: 'north',
  6. frame : true,
  7. layout : 'column',
  8. autoScroll : true,
  9. defaultType : 'textfield',
  10. labelSeparator : ':',
  11. buttonAlign : 'center',
  12. fieldDefaults : {
  13. margin : '4 2 4 2',
  14. fieldStyle : "background:#FFFAFA;color:#515151;",
  15. labelAlign : "right",
  16. blankText : $I18N.common.form.blankText
  17. },
  18. FormUtil: Ext.create('erp.util.FormUtil'),
  19. BaseUtil: Ext.create('erp.util.BaseUtil'),
  20. tbar: [{
  21. name: 'query',
  22. text: $I18N.common.button.erpQueryButton,
  23. iconCls: 'x-button-icon-query',
  24. cls: 'x-btn-gray',
  25. handler: function(){
  26. var grid = Ext.getCmp('grid');
  27. var condition = 'prd_recipientid=' + em_uu;
  28. if(Ext.getCmp('pr_releaserid').value != null && Ext.getCmp('pr_releaserid').value != ''){
  29. condition += " AND pr_releaserid=" + Ext.getCmp('pr_releaserid').value;
  30. }
  31. if(Ext.getCmp('pr_date').value != null && Ext.getCmp('pr_date').value != ''){
  32. if(condition == ''){
  33. condition += " (pr_date " + Ext.getCmp('pr_date').value + ")";
  34. } else {
  35. condition += " AND (pr_date " + Ext.getCmp('pr_date').value + ")";
  36. }
  37. }
  38. if(Ext.getCmp('pr_context').value != null && Ext.getCmp('pr_context').value != ''){
  39. if(condition == ''){
  40. condition += " pr_context like'%" + Ext.getCmp('pr_context').value + "%'";
  41. } else {
  42. condition += " AND pr_context like'%" + Ext.getCmp('pr_context').value + "%'";
  43. }
  44. }
  45. if(condition != ''){
  46. grid.getCount('PagingRelease', condition);
  47. } else {
  48. showError('请填写筛选条件');return;
  49. }
  50. }
  51. }, '-', {
  52. text: $I18N.common.button.erpCloseButton,
  53. iconCls: 'x-button-icon-close',
  54. cls: 'x-btn-gray',
  55. handler: function(){
  56. var main = parent.Ext.getCmp("content-panel");
  57. main.getActiveTab().close();
  58. }
  59. }, '->', {
  60. id: 'vastdelete',
  61. iconCls: 'group-delete',
  62. cls: 'x-btn-gray',
  63. text: $I18N.common.button.erpDeleteButton
  64. }/*,'-',{
  65. iconCls: 'group-read',
  66. text: "回复",
  67. cls: 'x-btn-gray',
  68. handler: function(){
  69. }
  70. }*/,'-',{
  71. id:'relay',
  72. iconCls: 'group-post',
  73. text: "转发",
  74. cls: 'x-btn-gray'
  75. },'-',{
  76. id: 'all',
  77. iconCls: 'group-all',
  78. text: "查看所有寻呼",
  79. cls: 'x-btn-gray'
  80. },'-',{
  81. id: 'read',
  82. iconCls: 'group-read',
  83. text: "查看已阅寻呼",
  84. cls: 'x-btn-gray'
  85. },'-',{
  86. id: 'unread',
  87. iconCls: 'group-unread',
  88. text: "查看未阅寻呼",
  89. cls: 'x-btn-gray'
  90. },'-',{
  91. id: 'draft',
  92. iconCls: 'group-draft',
  93. text: "保留",
  94. cls: 'x-btn-gray'
  95. }],
  96. initComponent : function(){
  97. var param = {caller: caller, condition: ''};
  98. this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action', param);
  99. this.callParent(arguments);
  100. }
  101. });