ManuFactFee.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.co.cost.ManuFactFee', {
  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','co.cost.ManuFactFee','core.form.MultiField',
  8. 'core.button.Add','core.button.Submit','core.button.ResSubmit','core.button.Audit','core.button.Save','core.button.Close',
  9. 'core.button.Upload','core.button.Update','core.button.Delete','core.button.ResAudit','core.form.MonthDateField',
  10. 'core.trigger.TextAreaTrigger','core.trigger.DbfindTrigger','core.form.YnField'
  11. ],
  12. init:function(){
  13. var me = this;
  14. this.control({
  15. 'erpSaveButton': {
  16. click: function(btn){
  17. var form = me.getForm(btn);
  18. if(Ext.getCmp(form.codeField).value == null || Ext.getCmp(form.codeField).value == ''){
  19. me.BaseUtil.getRandomNumber();//自动添加编号
  20. }
  21. //保存之前的一些前台的逻辑判定
  22. this.FormUtil.beforeSave(this);
  23. }
  24. },
  25. 'erpDeleteButton' : {
  26. click: function(btn){
  27. me.FormUtil.onDelete(Ext.getCmp('mf_id').value);
  28. }
  29. },
  30. 'erpUpdateButton': {
  31. click: function(btn){
  32. this.FormUtil.onUpdate(this);
  33. }
  34. },
  35. 'erpAddButton': {
  36. click: function(){
  37. me.FormUtil.onAdd('addManuFactFee', '新增直接人工制造费用', 'jsps/co/cost/manuFactFee.jsp');
  38. }
  39. },
  40. 'erpCloseButton': {
  41. click: function(btn){
  42. me.FormUtil.beforeClose(me);
  43. }
  44. },
  45. 'erpSubmitButton': {
  46. afterrender: function(btn){
  47. var status = Ext.getCmp('mf_statuscode');
  48. if(status && status.value != 'ENTERING'){
  49. btn.hide();
  50. }
  51. },
  52. click: function(btn){
  53. me.FormUtil.onSubmit(Ext.getCmp('mf_id').value);
  54. }
  55. },
  56. 'erpResSubmitButton': {
  57. afterrender: function(btn){
  58. var status = Ext.getCmp('mf_statuscode');
  59. if(status && status.value != 'COMMITED'){
  60. btn.hide();
  61. }
  62. },
  63. click: function(btn){
  64. me.FormUtil.onResSubmit(Ext.getCmp('mf_id').value);
  65. }
  66. },
  67. 'erpAuditButton': {
  68. afterrender: function(btn){
  69. var status = Ext.getCmp('mf_statuscode');
  70. if(status && status.value != 'COMMITED'){
  71. btn.hide();
  72. }
  73. },
  74. click: function(btn){
  75. me.FormUtil.onAudit(Ext.getCmp('mf_id').value);
  76. }
  77. },
  78. 'erpResAuditButton': {
  79. afterrender: function(btn){
  80. var status = Ext.getCmp('mf_statuscode');
  81. if(status && status.value != 'AUDITED'){
  82. btn.hide();
  83. }
  84. },
  85. click: function(btn){
  86. me.FormUtil.onResAudit(Ext.getCmp('mf_id').value);
  87. }
  88. }
  89. });
  90. },
  91. getForm: function(btn){
  92. return btn.ownerCt.ownerCt;
  93. }
  94. });