PurchaseSend.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.scm.purchase.PurchaseSend', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'scm.purchase.PurchaseSend','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',
  10. 'core.trigger.TextAreaTrigger','core.trigger.DbfindTrigger'
  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. 'erpUpdateButton': {
  30. click: function(btn){
  31. this.FormUtil.onUpdate(this);
  32. }
  33. },
  34. 'erpDeleteButton': {
  35. click: function(btn){
  36. this.FormUtil.onDelete([]);
  37. }
  38. },
  39. 'erpAuditButton': {
  40. click: function(btn){
  41. this.FormUtil.onAudit(Ext.getCmp('ve_id').value);
  42. }
  43. },
  44. 'erpResAuditButton': {
  45. click: function(btn){
  46. this.FormUtil.onResAudit(Ext.getCmp('ve_id').value);
  47. }
  48. },
  49. 'erpSubmitButton': {
  50. click: function(btn){
  51. this.FormUtil.onSubmit(Ext.getCmp('ve_id').value);
  52. }
  53. },
  54. 'erpResSubmitButton': {
  55. click: function(btn){
  56. this.FormUtil.onResSubmit(Ext.getCmp('ve_id').value);
  57. }
  58. },
  59. 'erpBannedButton': {
  60. click: function(btn){
  61. this.FormUtil.onBanned(Ext.getCmp('ve_id').value);
  62. }
  63. },
  64. 'erpResBannedButton': {
  65. click: function(btn){
  66. this.FormUtil.onResBanned(Ext.getCmp('ve_id').value);
  67. }
  68. }
  69. });
  70. },
  71. getForm: function(btn){
  72. return btn.ownerCt.ownerCt;
  73. }
  74. });