DocumentSet.js 2.2 KB

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