CustSendSample.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.b2b.product.CustSendSample', {
  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','b2b.product.CustSendSample','core.form.FileField',
  8. 'core.button.Close','core.button.CustSendToProdInout','core.button.Close',
  9. 'core.button.Update','core.button.Delete','core.button.ResAudit','core.button.Audit','core.button.Submit','core.button.ResSubmit',
  10. 'core.trigger.DbfindTrigger','core.trigger.TextAreaTrigger','core.form.YnField','core.form.MonthDateField'
  11. ],
  12. init:function(){
  13. var me = this;
  14. this.control({
  15. 'erpCloseButton': {
  16. click: function(btn){
  17. me.FormUtil.beforeClose(me);
  18. }
  19. },
  20. 'erpCustSendToProdInoutButton':{
  21. afterrender: function(btn){
  22. var status = Ext.getCmp('ss_statuscode');
  23. if(status && status.value != 'AUDITED'){
  24. btn.hide();
  25. }
  26. }
  27. },
  28. 'erpCloseButton': {
  29. click: function(btn){
  30. this.FormUtil.beforeClose(this);
  31. }
  32. },
  33. 'erpUpdateButton': {
  34. click: function(btn){
  35. this.FormUtil.onUpdate(this);
  36. }
  37. },
  38. 'erpDeleteButton': {
  39. click: function(btn){
  40. me.FormUtil.onDelete(Ext.getCmp('ss_id').value);
  41. }
  42. },
  43. 'erpSubmitButton': {
  44. afterrender: function(btn){
  45. var status = Ext.getCmp('ss_statuscode');
  46. if(status && status.value != 'ENTERING'){
  47. btn.hide();
  48. }
  49. },
  50. click: function(btn){
  51. me.FormUtil.onSubmit(Ext.getCmp('ss_id').value);
  52. }
  53. },
  54. 'erpResSubmitButton': {
  55. afterrender: function(btn){
  56. var status = Ext.getCmp('ss_statuscode');
  57. if(status && status.value != 'COMMITED'){
  58. btn.hide();
  59. }
  60. },
  61. click: function(btn){
  62. me.FormUtil.onResSubmit(Ext.getCmp('ss_id').value);
  63. }
  64. },
  65. 'erpAuditButton': {
  66. afterrender: function(btn){
  67. var status = Ext.getCmp('ss_statuscode');
  68. if(status && status.value != 'COMMITED'){
  69. btn.hide();
  70. }
  71. },
  72. click: function(btn){
  73. me.FormUtil.onAudit(Ext.getCmp('ss_id').value);
  74. }
  75. },
  76. 'erpResAuditButton': {
  77. afterrender: function(btn){
  78. var status = Ext.getCmp('ss_statuscode');
  79. if(status && status.value != 'AUDITED'){
  80. btn.hide();
  81. }
  82. },
  83. click: function(btn){
  84. me.FormUtil.onResAudit(Ext.getCmp('ss_id').value);
  85. }
  86. }
  87. });
  88. },
  89. getForm: function(btn){
  90. return btn.ownerCt.ownerCt;
  91. }
  92. });