ECNCheck.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * 制造ECN评审
  3. */
  4. Ext.define('erp.view.core.button.ECNCheck',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpECNCheckButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. id:'ecncheck',
  10. text: $I18N.common.button.erpECNCheckButton,
  11. style: {
  12. marginLeft: '10px'
  13. },
  14. width: 110,
  15. initComponent : function(){
  16. this.callParent(arguments);
  17. },
  18. listeners: {
  19. afterrender: function(btn){
  20. var status = Ext.getCmp("ecn_checkstatuscode");
  21. if(status && status.value != 'COMMITED'){
  22. btn.hide();
  23. }
  24. },
  25. click: function(m){
  26. Ext.getCmp('ecncheck').turn('ECNCheck', ' mc_ecncode=\'' + Ext.getCmp('ecn_code').value +'\' and ma_id>0');
  27. }
  28. },
  29. turn: function(nCaller, condition){
  30. var win = new Ext.window.Window({
  31. id : 'win',
  32. height: "100%",
  33. width: "80%",
  34. maximizable : true,
  35. buttonAlign : 'center',
  36. layout : 'anchor',
  37. items: [{
  38. tag : 'iframe',
  39. frame : true,
  40. anchor : '100% 100%',
  41. layout : 'fit',
  42. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  43. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  44. }],
  45. buttons : [{
  46. name: 'confirm',
  47. text : $I18N.common.button.erpConfirmButton,
  48. iconCls: 'x-button-icon-confirm',
  49. cls: 'x-btn-gray',
  50. listeners: {
  51. buffer: 500,
  52. click: function(btn) {
  53. var _win = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow,
  54. grid = _win.Ext.getCmp("editorColumnGridPanel");
  55. btn.setDisabled(true);
  56. grid.updateAction('pm/bom/confirmECN.action');
  57. _win.location.reload();
  58. }
  59. }
  60. },{
  61. name: 'cancel',
  62. text : $I18N.common.button.erpCancelButton,
  63. iconCls: 'x-button-icon-close',
  64. cls: 'x-btn-gray',
  65. listeners: {
  66. buffer: 500,
  67. click: function(btn) {
  68. var _win = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow,
  69. grid = _win.Ext.getCmp("editorColumnGridPanel");
  70. btn.setDisabled(true);
  71. grid.updateAction('pm/bom/cancelECN.action');
  72. _win.location.reload();
  73. }
  74. }
  75. }, {
  76. text : $I18N.common.button.erpCloseButton,
  77. iconCls: 'x-button-icon-close',
  78. cls: 'x-btn-gray',
  79. handler : function(){
  80. Ext.getCmp('win').close();
  81. }
  82. }]
  83. });
  84. win.show();
  85. }
  86. });