SingleForm.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.excel.SingleForm', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. GridUtil:Ext.create('erp.util.GridUtil'),
  7. views:[
  8. 'excel.SingleForm','core.form.DyConditionField','excel.ExcelPanel','core.button.Save','core.button.Close'
  9. ],
  10. init:function(){
  11. var me = this;
  12. this.control({
  13. 'erpSaveButton':{
  14. 'click':function(btn){
  15. me.save(this);
  16. }
  17. },
  18. 'erpCloseButton':{
  19. 'click':function(){
  20. parent.Ext.getCmp('win').close();
  21. }
  22. }
  23. });
  24. },
  25. getSeqId: function(form){
  26. if(!form){
  27. form = Ext.getCmp('form');
  28. }
  29. Ext.Ajax.request({
  30. url : basePath + form.getIdUrl,
  31. method : 'get',
  32. async: false,
  33. callback : function(options,success,response){
  34. var rs = new Ext.decode(response.responseText);
  35. if(rs.exceptionInfo){
  36. showError(rs.exceptionInfo);return;
  37. }
  38. if(rs.success){
  39. Ext.getCmp(form.keyField).setValue(rs.id);
  40. }
  41. }
  42. });
  43. },
  44. save:function(){
  45. }
  46. });