JProClassify.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.common.JProClassify', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'core.form.Panel','common.JProcess.JProClassify','core.grid.Panel','core.button.Add','core.button.Submit','core.button.Audit',
  8. 'core.button.Save','core.button.Close','core.button.Print','core.button.Upload','core.button.Update','core.button.Delete',
  9. 'core.trigger.TextAreaTrigger','core.trigger.DbfindTrigger'
  10. ],
  11. init:function(){
  12. var me = this;
  13. this.control({
  14. 'erpSaveButton': {
  15. click: function(btn){
  16. /*var form = me.getForm(btn);*/
  17. var form = me.getForm(btn);
  18. if(Ext.getCmp(form.codeField).value == null || Ext.getCmp(form.codeField).value == ''){
  19. me.BaseUtil.getRandomNumber();//自动添加编号
  20. }
  21. me.FormUtil.beforeSave(me);
  22. }
  23. },
  24. 'erpDeleteButton' : {
  25. beforerender:function(btn){
  26. btn.hidden=false;
  27. },
  28. click: function(btn){
  29. me.FormUtil.onDelete(Ext.getCmp('jc_id').value);
  30. }
  31. },
  32. 'erpPostButton' : {
  33. click:function(btn){
  34. me.FormUtil.onPost(Ext.getCmp('jc_id').value);
  35. }
  36. },
  37. 'erpUpdateButton': {
  38. afterrender:function(btn){
  39. btn.show();
  40. },
  41. click: function(btn){
  42. me.beforeUpdate();
  43. }
  44. },
  45. 'erpAddButton': {
  46. click: function(){
  47. me.FormUtil.onAdd('JProClassify', '新增流程设置', 'jsps/common/jproClassify.jsp?whoami='+caller);
  48. }
  49. },
  50. 'erpCloseButton': {
  51. click: function(btn){
  52. me.FormUtil.beforeClose(me);
  53. }
  54. }
  55. });},
  56. getForm: function(btn){
  57. return btn.ownerCt.ownerCt;
  58. },
  59. beforeUpdate: function(){
  60. var bool = true;
  61. if(bool)
  62. this.FormUtil.onUpdate(this);
  63. }
  64. });