CopyPower.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.ma.CopyPower', {
  3. extend : 'Ext.app.Controller',
  4. views : [ 'ma.CopyPower', 'core.button.CopyPower', 'core.grid.Panel4', 'core.trigger.DbfindTrigger','core.toolbar.Toolbar3' ],
  5. FormUtil: Ext.create('erp.util.FormUtil'),
  6. BaseUtil: Ext.create('erp.util.BaseUtil'),
  7. GridUtil: Ext.create('erp.util.GridUtil'),
  8. init : function() {
  9. var me = this;
  10. this.control({
  11. 'button[id=copypower]': {// 复制权限
  12. click: function(btn) {
  13. me.CopyPower();
  14. }
  15. },
  16. '#search': {
  17. click: function(btn) {
  18. var grid = btn.ownerCt.ownerCt;
  19. grid.GridUtil.loadNewStore(grid,{
  20. caller:caller,
  21. condition:'cp_haschange<>0 order by cp_id desc'
  22. });
  23. }
  24. },
  25. '#close': {
  26. click: function() {
  27. this.BaseUtil.getActiveTab().close();
  28. }
  29. },
  30. 'erpGridPanel4':{
  31. itemclick:this.GridUtil.onGridItemClick
  32. }
  33. });
  34. },
  35. CopyPower : function() {
  36. var grid=Ext.getCmp('grid');
  37. var param=grid.GridUtil.getGridStore(grid);
  38. param = param == null ? [] : "[" + param.toString() + "]";
  39. grid.setLoading(true);
  40. Ext.Ajax.request({
  41. url: basePath + 'ma/power/copypowerFromStandard.action',
  42. params: {
  43. param:unescape(param.toString())
  44. },
  45. callback : function(o, s, r) {
  46. grid.setLoading(false);
  47. if( s ) {
  48. var local = new Ext.decode(r.responseText);
  49. if(local.success){
  50. grid.GridUtil.loadNewStore(grid,{caller:caller,condition:'1=2'});
  51. }
  52. }
  53. }
  54. });
  55. }
  56. });