TurnProdIO.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. text : $I18N.common.button.erpTurnProdIOButton,
  10. style : {
  11. marginLeft : '10px'
  12. },
  13. width : 110,
  14. initComponent : function() {
  15. this.callParent(arguments);
  16. },
  17. listeners : {
  18. click : function(btn) {
  19. btn.turn('SendNotify!ToProdIN!Deal', 'snd_snid=' + Ext.getCmp('sn_id').value
  20. + ' and nvl(snd_yqty,0) < nvl(snd_outqty,0) and snd_statuscode=\'AUDITED\'',
  21. 'scm/sale/turnProdOut.action?type=ProdInOut!Sale');
  22. }
  23. },
  24. turn : function(nCaller, condition, url) {
  25. var win = new Ext.window.Window(
  26. {
  27. id : 'win',
  28. height : "100%",
  29. width : "80%",
  30. maximizable : true,
  31. buttonAlign : 'center',
  32. layout : 'anchor',
  33. items : [ {
  34. tag : 'iframe',
  35. frame : true,
  36. anchor : '100% 100%',
  37. layout : 'fit',
  38. html : '<iframe id="iframe_' + caller + '" src="' + basePath
  39. + 'jsps/common/editorColumn.jsp?caller=' + nCaller + "&condition=" + condition
  40. + '" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  41. } ],
  42. buttons : [
  43. {
  44. name : 'confirm',
  45. text : $I18N.common.button.erpConfirmButton,
  46. iconCls : 'x-button-icon-confirm',
  47. cls : 'x-btn-gray',
  48. listeners : {
  49. buffer : 500,
  50. click : function(btn) {
  51. var grid = Ext.getCmp('win').items.items[0].body.dom
  52. .getElementsByTagName('iframe')[0].contentWindow.Ext
  53. .getCmp("editorColumnGridPanel");
  54. btn.setDisabled(true);
  55. grid.updateAction(url);
  56. window.location.reload();
  57. }
  58. }
  59. }, {
  60. text : $I18N.common.button.erpCloseButton,
  61. iconCls : 'x-button-icon-close',
  62. cls : 'x-btn-gray',
  63. handler : function() {
  64. Ext.getCmp('win').close();
  65. }
  66. } ]
  67. });
  68. win.show();
  69. }
  70. });