TurnProdAppropriationOut.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * 销售通知单转拨出单按钮
  3. */
  4. Ext.define('erp.view.core.button.TurnProdAppropriationOut',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpTurnProdAppropriationOutButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. text: $I18N.common.button.erpTurnProdAppropriationOutButton,
  10. style: {
  11. marginLeft: '10px'
  12. },
  13. width: 110,
  14. initComponent : function(){
  15. this.callParent(arguments);
  16. },
  17. listeners: {
  18. click: function(m){
  19. m.turn('SendNotify!ToProdIN!Deal', 'snd_snid=' + Ext.getCmp('sn_id').value +' and snd_yqty < snd_outqty', 'scm/sale/turnProdOut.action?type=ProdInOut!AppropriationOut');
  20. }
  21. },
  22. turn: function(nCaller, condition, url){
  23. var win = new Ext.window.Window({
  24. id : 'win',
  25. height: "100%",
  26. width: "80%",
  27. maximizable : true,
  28. buttonAlign : 'center',
  29. layout : 'anchor',
  30. items: [{
  31. tag : 'iframe',
  32. frame : true,
  33. anchor : '100% 100%',
  34. layout : 'fit',
  35. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  36. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  37. }],
  38. buttons : [{
  39. name: 'confirm',
  40. text : $I18N.common.button.erpConfirmButton,
  41. iconCls: 'x-button-icon-confirm',
  42. cls: 'x-btn-gray',
  43. listeners: {
  44. buffer: 500,
  45. click: function(btn) {
  46. var grid = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow.Ext.getCmp("editorColumnGridPanel");
  47. btn.setDisabled(true);
  48. grid.updateAction(url);
  49. window.location.reload();
  50. }
  51. }
  52. }, {
  53. text : $I18N.common.button.erpCloseButton,
  54. iconCls: 'x-button-icon-close',
  55. cls: 'x-btn-gray',
  56. handler : function(){
  57. Ext.getCmp('win').close();
  58. }
  59. }]
  60. });
  61. win.show();
  62. }
  63. });