TurnProdInOutSale.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * 转出货单
  3. */
  4. Ext.define('erp.view.core.button.TurnProdInOutSale',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpTurnProdInOutSaleButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. id:'turnprodinoutsale',
  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. buffer : 5000,
  20. click: function(m){
  21. Ext.getCmp('turnprodinoutsale').turn('Sale!ToProdIO!Deal', 'sd_said=' + Ext.getCmp('sa_id').value + ' AND nvl(sd_yqty,0)<nvl(sd_qty,0)', 'scm/vastTurnProdIN2.action');
  22. }
  23. },
  24. turn: function(nCaller, condition, url){
  25. var win = new Ext.window.Window({
  26. id : 'win',
  27. height: "100%",
  28. width: "80%",
  29. maximizable : true,
  30. buttonAlign : 'center',
  31. layout : 'anchor',
  32. items: [{
  33. tag : 'iframe',
  34. frame : true,
  35. anchor : '100% 100%',
  36. layout : 'fit',
  37. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  38. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  39. }],
  40. buttons : [{
  41. name: 'confirm',
  42. text : $I18N.common.button.erpConfirmButton,
  43. iconCls: 'x-button-icon-confirm',
  44. cls: 'x-btn-gray',
  45. listeners: {
  46. buffer: 500,
  47. click: function(btn) {
  48. var grid = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow.Ext.getCmp("editorColumnGridPanel");
  49. btn.setDisabled(true);
  50. grid.updateAction(url);
  51. }
  52. }
  53. }, {
  54. text : $I18N.common.button.erpCloseButton,
  55. iconCls: 'x-button-icon-close',
  56. cls: 'x-btn-gray',
  57. handler : function(){
  58. Ext.getCmp('win').close();
  59. }
  60. }]
  61. });
  62. win.show();
  63. }
  64. });