TurnRenewApply.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * 转借货归还单
  3. */
  4. Ext.define('erp.view.core.button.TurnRenewApply',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpTurnRenewApplyButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. id:'turnRenewApply',
  10. text: '转续借申请单',
  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("pi_statuscode");
  21. if(status && status.value != 'POSTED'){
  22. btn.hide();
  23. }
  24. },
  25. click: function(m){
  26. Ext.getCmp('turnRenewApply').turn('ProdInOut!JHCH!ToRenewApply',
  27. ' pd_piid=' + Ext.getCmp('pi_id').value +' and nvl(pd_returnqty,0)<nvl(pd_outqty,0) order by pd_pdno',
  28. 'scm/reserve/turnRenewApply.action');
  29. }
  30. },
  31. turn: function(nCaller, condition, url){
  32. var win = new Ext.window.Window({
  33. id : 'win',
  34. height: "100%",
  35. width: "80%",
  36. maximizable : true,
  37. buttonAlign : 'center',
  38. layout : 'anchor',
  39. items: [{
  40. tag : 'iframe',
  41. frame : true,
  42. anchor : '100% 100%',
  43. layout : 'fit',
  44. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  45. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  46. }],
  47. buttons : [{
  48. name: 'confirm',
  49. text : $I18N.common.button.erpConfirmButton,
  50. iconCls: 'x-button-icon-confirm',
  51. cls: 'x-btn-gray',
  52. listeners: {
  53. buffer: 500,
  54. click: function(btn) {
  55. var grid = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow.Ext.getCmp("editorColumnGridPanel");
  56. btn.setDisabled(true);
  57. grid.updateAction(url);
  58. window.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. });