SODDetail.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.oa.officialDocument.sendODManagement.SODDetail', {
  3. extend: 'Ext.app.Controller',
  4. BaseUtil: Ext.create('erp.util.BaseUtil'),
  5. FormUtil: Ext.create('erp.util.FormUtil'),
  6. views:[
  7. 'oa.officialDocument.sendODManagement.SODDetail','oa.officialDocument.sendODManagement.SODDetailForm',
  8. 'core.button.Update','core.button.Delete','core.button.Submit','core.button.ResSubmit','core.button.Audit',
  9. 'core.button.ResAudit'
  10. ],
  11. init:function(){
  12. var me = this;
  13. this.control({
  14. 'button[id=close]': {
  15. click: function(){
  16. me.FormUtil.onClose();
  17. }
  18. },
  19. 'erpUpdateButton': {
  20. afterrender: function(btn){
  21. var status = Ext.getCmp('sod_statuscode');
  22. if(status && status.value != null && status.value != 'ENTERING'){
  23. btn.hide();
  24. }
  25. },
  26. click: function(btn){
  27. this.FormUtil.onUpdate(this);
  28. }
  29. },
  30. 'erpSubmitButton': {
  31. afterrender: function(btn){
  32. var status = Ext.getCmp('sod_statuscode');
  33. if(status && status.value != null && status.value != 'ENTERING'){
  34. btn.hide();
  35. }
  36. },
  37. click: function(btn){
  38. this.FormUtil.onSubmit(Ext.getCmp('sod_id').value);
  39. }
  40. },
  41. 'erpResSubmitButton': {
  42. afterrender: function(btn){
  43. var status = Ext.getCmp('sod_statuscode');
  44. if(status && status.value != 'COMMITED'){
  45. btn.hide();
  46. }
  47. },
  48. click: function(btn){
  49. this.FormUtil.onResSubmit(Ext.getCmp('sod_id').value);
  50. }
  51. },
  52. 'erpAuditButton': {
  53. afterrender: function(btn){
  54. var status = Ext.getCmp('sod_statuscode');
  55. if(status && status.value != 'COMMITED'){
  56. btn.hide();
  57. }
  58. },
  59. click: function(btn){
  60. this.FormUtil.onAudit(Ext.getCmp('sod_id').value);
  61. }
  62. },
  63. 'erpResAuditButton': {
  64. afterrender: function(btn){
  65. var status = Ext.getCmp('sod_statuscode');
  66. if(status && status.value != 'AUDITED'){
  67. btn.hide();
  68. }
  69. },
  70. click: function(btn){
  71. this.FormUtil.onResAudit(Ext.getCmp('sod_id').value);
  72. }
  73. },
  74. 'erpDeleteButton': {
  75. afterrender: function(btn){
  76. var status = Ext.getCmp('sod_statuscode');
  77. if(status && status.value != null && status.value != 'ENTERING'){
  78. btn.hide();
  79. }
  80. },
  81. click: function(btn){
  82. me.FormUtil.onDelete(Ext.getCmp('sod_id').value);
  83. }
  84. },
  85. 'button[id=distribute]': {
  86. afterrender: function(btn){
  87. var flag = getUrlParam('flag');
  88. if(flag == 'query'){
  89. btn.setVisible(false);
  90. }
  91. },
  92. click: function(){
  93. var me = this;
  94. var id = Ext.getCmp('sod_id').value;
  95. var panel = Ext.getCmp("dsod" + id);
  96. var main = parent.Ext.getCmp("content-panel");
  97. if(!panel){
  98. var title = "发文转收文";
  99. panel = {
  100. title : title,
  101. tag : 'iframe',
  102. tabConfig:{tooltip: Ext.getCmp('sod_title').value},
  103. frame : true,
  104. border : false,
  105. layout : 'fit',
  106. iconCls : 'x-tree-icon-tab-tab1',
  107. html : '<iframe id="iframe_' + id + '" src="' + basePath + "jsps/oa/officialDocument/receiveODManagement/register.jsp?id=" + id + '" height="100%" width="100%" frameborder="0" scrolling="yes"></iframe>',
  108. closable : true,
  109. listeners : {
  110. close : function(){
  111. main.setActiveTab(main.getActiveTab().id);
  112. }
  113. }
  114. };
  115. me.FormUtil.openTab(panel, "dsod" + id);
  116. }else{
  117. main.setActiveTab(panel);
  118. }
  119. }
  120. }
  121. });
  122. }
  123. });