fuelDiary.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.oa.vehicle.fuelDiary', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'oa.vehicle.fuelDiary','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','core.button.Scan'
  11. ],
  12. init:function(){
  13. var me = this;
  14. this.control({
  15. 'erpSaveButton': {
  16. click: function(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. this.FormUtil.beforeSave(this);
  22. }
  23. },
  24. 'erpCloseButton': {
  25. click: function(btn){
  26. this.FormUtil.beforeClose(this);
  27. }
  28. },
  29. 'erpAddButton': {
  30. click: function(btn){
  31. me.FormUtil.onAdd('addFuelDiary', '新增加油记录', 'jsps/oa/vehicle/fuelDiary.jsp');
  32. }
  33. },
  34. 'erpUpdateButton': {
  35. click: function(btn){
  36. this.FormUtil.onUpdate(this);
  37. }
  38. },
  39. 'erpDeleteButton': {
  40. click: function(btn){
  41. me.FormUtil.onDelete((Ext.getCmp('fd_id').value));
  42. }
  43. },
  44. 'erpAuditButton': {
  45. click: function(btn){
  46. this.FormUtil.onAudit(Ext.getCmp('fd_id').value);
  47. }
  48. },
  49. 'erpResAuditButton': {
  50. click: function(btn){
  51. this.FormUtil.onResAudit(Ext.getCmp('fd_id').value);
  52. }
  53. },
  54. 'erpSubmitButton': {
  55. click: function(btn){
  56. this.FormUtil.onSubmit(Ext.getCmp('fd_id').value);
  57. }
  58. },
  59. 'erpResSubmitButton': {
  60. click: function(btn){
  61. this.FormUtil.onResSubmit(Ext.getCmp('fd_id').value);
  62. }
  63. }
  64. });
  65. },
  66. getForm: function(btn){
  67. return btn.ownerCt.ownerCt;
  68. }
  69. });