askLeave.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.oa.attendance.askLeave', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'oa.attendance.askLeave','core.form.Panel',
  8. 'core.button.Add','core.button.Submit','core.button.Audit','core.button.Save','core.button.Close','core.button.Print',
  9. 'core.button.Upload','core.button.Update','core.button.Delete','core.button.ResAudit','core.button.ResSubmit',
  10. 'core.form.YnField','core.trigger.DbfindTrigger'
  11. ],
  12. init:function(){
  13. var me = this;
  14. this.control({
  15. 'erpSaveButton': {
  16. click: function(btn){
  17. this.FormUtil.beforeSave(this);
  18. }
  19. },
  20. 'erpCloseButton': {
  21. click: function(btn){
  22. this.FormUtil.beforeClose(this);
  23. }
  24. },
  25. 'erpAddButton': {
  26. click: function(btn){
  27. me.FormUtil.onAdd('addAskLeave', '新增请假单', 'jsps/oa/attendance/askLeave.jsp');
  28. }
  29. },
  30. 'erpUpdateButton': {
  31. click: function(btn){
  32. this.FormUtil.onUpdate(this);
  33. }
  34. },
  35. 'erpDeleteButton': {
  36. click: function(btn){
  37. me.FormUtil.onDelete((Ext.getCmp('al_id').value));
  38. }
  39. },
  40. 'erpAuditButton': {
  41. click: function(btn){
  42. this.FormUtil.onAudit(Ext.getCmp('al_id').value);
  43. }
  44. },
  45. 'erpResAuditButton': {
  46. click: function(btn){
  47. this.FormUtil.onResAudit(Ext.getCmp('al_id').value);
  48. }
  49. },
  50. 'erpSubmitButton': {
  51. click: function(btn){
  52. this.FormUtil.onSubmit(Ext.getCmp('al_id').value);
  53. }
  54. },
  55. 'erpResSubmitButton': {
  56. click: function(btn){
  57. this.FormUtil.onResSubmit(Ext.getCmp('al_id').value);
  58. }
  59. }
  60. });
  61. },
  62. getForm: function(btn){
  63. return btn.ownerCt.ownerCt;
  64. }
  65. });