TurnProdIO.js 3.1 KB

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