WorkPlanQueryForm.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Ext.define('erp.view.oa.persontask.workPlan.WorkPlanQueryForm',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpWorkPlanQueryFormPanel',
  4. id: 'form',
  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 form = Ext.getCmp('form');
  28. var condition = '(ag_arrange_id=' + em_uu + ")";
  29. var con = '';
  30. if(Ext.getCmp('ag_start').value != null && Ext.getCmp('ag_start').value != ''){
  31. con += " AND (ag_date " + Ext.getCmp('ag_date').value + ")";
  32. }
  33. if(Ext.getCmp('ag_end').value != null && Ext.getCmp('ag_end').value != ''){
  34. con += " AND (ag_end " + Ext.getCmp('ag_end').value + ")";
  35. }
  36. if(Ext.getCmp('ag_title').value != null && Ext.getCmp('ag_title').value != ''){
  37. con += " AND (ag_title like '%" + Ext.getCmp('ag_title').value + "%')";
  38. }
  39. if(Ext.getCmp('ag_content').value != null && Ext.getCmp('ag_content').value != ''){
  40. con += " AND (ag_content like '%" + Ext.getCmp('ag_content').value + "%')";
  41. }
  42. if(Ext.getCmp('ag_executor_id').value != null && Ext.getCmp('ag_executor_id').value != ''){
  43. con += " AND (ag_executor_id like '%" + Ext.getCmp('ag_executor_id').value + "%')";
  44. }
  45. if(con != ''){
  46. grid.getCount('Arrange!Query', condition + con);
  47. } else {
  48. showError('请填写筛选条件');return;
  49. }
  50. console.log(condition);
  51. }
  52. }, '-', {
  53. text: $I18N.common.button.erpCloseButton,
  54. iconCls: 'x-button-icon-close',
  55. cls: 'x-btn-gray',
  56. handler: function(){
  57. var main = parent.Ext.getCmp("content-panel");
  58. main.getActiveTab().close();
  59. }
  60. }],
  61. initComponent : function(){
  62. var param = {caller: caller, condition: ''};
  63. this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action', param);
  64. this.callParent(arguments);
  65. },
  66. getGroupDa : function(condition, page, pageSize){
  67. var me = Ext.getCmp('grid');
  68. if(!page){
  69. page = 1;
  70. }
  71. if(!pageSize){
  72. pageSize = 15;
  73. }
  74. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  75. Ext.Ajax.request({//拿到grid的columns
  76. url : basePath + url,
  77. params: {
  78. page: page,
  79. pageSize: pageSize,
  80. condition: condition
  81. },
  82. method : 'post',
  83. async: false,
  84. callback : function(options, success, response){
  85. // console.log(response);
  86. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  87. var res = new Ext.decode(response.responseText);
  88. if(res.exceptionInfo){
  89. showError(res.exceptionInfo);return;
  90. }
  91. if(!res.success){
  92. return;
  93. } else {
  94. console.log(res.success);
  95. dataCount = res.count;
  96. me.store.loadData(res.success);
  97. }
  98. }
  99. });
  100. }
  101. });