BusinessChanceBasis.js 961 B

12345678910111213141516171819202122232425262728293031323334
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.crm.chance.BusinessChanceBasis', {
  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','crm.chance.BusinessChanceBasis',
  8. 'core.button.Save','core.button.Close','core.button.Update','core.button.Delete',
  9. ],
  10. init:function(){
  11. var me = this;
  12. this.control({
  13. 'erpDeleteButton' : {
  14. click: function(btn){
  15. me.FormUtil.onDelete(Ext.getCmp('bb_id').value);
  16. }
  17. },
  18. 'erpUpdateButton': {
  19. click: function(btn){
  20. me.beforeUpdate();
  21. }
  22. },
  23. 'erpCloseButton': {
  24. click: function(btn){
  25. me.FormUtil.beforeClose(me);
  26. }
  27. }
  28. });},
  29. beforeUpdate: function(){
  30. if(Ext.getCmp('bb_id').value)this.FormUtil.onUpdate(this);
  31. else this.FormUtil.beforeSave(this);
  32. }
  33. });