LoadRelation.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * 载入替代关系
  3. */
  4. Ext.define('erp.view.core.button.LoadRelation',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpLoadRelationButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. text: $I18N.common.button.erpLoadRelationButton,
  10. style: {
  11. marginLeft: '10px'
  12. },
  13. width: 130,
  14. initComponent : function(){
  15. this.callParent(arguments);
  16. },
  17. listeners: {
  18. afterrender: function(btn){
  19. var status = Ext.getCmp("bo_statuscode");
  20. if(status && status.value != 'ENTERING'){
  21. btn.hide();
  22. }
  23. },
  24. click: function(m){
  25. m.turn();
  26. }
  27. },
  28. turn: function(){
  29. var win = new Ext.window.Window({
  30. id : 'win',
  31. x:'150',
  32. y:'300',
  33. height: "100%",
  34. width: "80%",
  35. maximizable : true,
  36. buttonAlign : 'center',
  37. layout : 'anchor',
  38. items: [{
  39. tag : 'iframe',
  40. frame : true,
  41. anchor : '100% 100%',
  42. layout : 'fit',
  43. html : '<iframe src="' + basePath + 'jsps/common/editorColumn.jsp?caller=LoadRelation'
  44. + "&condition=prr_usestatuscode='AUDITED' and NVL(bd_usestatus,' ')<>'DISABLE' and bd_bomid=" + Ext.getCmp("bo_id").value + '" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  45. }],
  46. buttons : [{
  47. name: 'confirm',
  48. text : $I18N.common.button.erpConfirmButton,
  49. iconCls: 'x-button-icon-confirm',
  50. cls: 'x-btn-gray',
  51. listeners: {
  52. buffer: 500,
  53. click: function(btn) {
  54. var _win = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow,
  55. grid = _win.Ext.getCmp("editorColumnGridPanel");
  56. btn.setDisabled(true);
  57. grid.updateAction('pm/bom/loadRelation.action');
  58. _win.location.reload();
  59. }
  60. }
  61. }, {
  62. text : $I18N.common.button.erpCloseButton,
  63. iconCls: 'x-button-icon-close',
  64. cls: 'x-btn-gray',
  65. handler : function(){
  66. Ext.getCmp('win').close();
  67. }
  68. }]
  69. });
  70. win.show();
  71. }
  72. });