ApplicationInvalid.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.scm.purchase.ApplicationInvalid', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'scm.purchase.ApplicationInvalid','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.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 = getForm(btn);
  18. var code = Ext.getCmp(form.codeField);
  19. if(code.value == null || code.value == '' || code.value == 'null'){
  20. code.setValue(me.BaseUtil.getRandomNumber());
  21. }
  22. this.FormUtil.beforeSave(this);
  23. Ext.getCmp('ve_id').show();
  24. }
  25. },
  26. 'erpCloseButton': {
  27. click: function(btn){
  28. this.FormUtil.beforeClose(this);
  29. }
  30. },
  31. 'erpUpdateButton': {
  32. click: function(btn){
  33. this.FormUtil.onUpdate(this);
  34. }
  35. },
  36. 'erpDeleteButton': {
  37. click: function(btn){
  38. this.FormUtil.onDelete([]);
  39. }
  40. },
  41. 'erpAuditButton': {
  42. click: function(btn){
  43. this.FormUtil.onAudit(Ext.getCmp('ve_id').value);
  44. }
  45. },
  46. 'erpResAuditButton': {
  47. click: function(btn){
  48. this.FormUtil.onResAudit(Ext.getCmp('ve_id').value);
  49. }
  50. },
  51. 'erpSubmitButton': {
  52. click: function(btn){
  53. this.FormUtil.onSubmit(Ext.getCmp('ve_id').value);
  54. }
  55. },
  56. 'erpResSubmitButton': {
  57. click: function(btn){
  58. this.FormUtil.onResSubmit(Ext.getCmp('ve_id').value);
  59. }
  60. },
  61. 'erpBannedButton': {
  62. click: function(btn){
  63. this.FormUtil.onBanned(Ext.getCmp('ve_id').value);
  64. }
  65. },
  66. 'erpResBannedButton': {
  67. click: function(btn){
  68. this.FormUtil.onResBanned(Ext.getCmp('ve_id').value);
  69. }
  70. }
  71. });
  72. },
  73. getForm: function(btn){
  74. return btn.ownerCt.ownerCt;
  75. }
  76. });