TurnPurcOut.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * 转采购验退单
  3. */
  4. Ext.define('erp.view.core.button.TurnPurcOut',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpTurnPurcOutButton',
  7. iconCls: 'x-button-icon-submit',
  8. cls: 'x-btn-gray',
  9. id:'turnPurcOut',
  10. text: $I18N.common.button.erpTurnPurcOutButton,
  11. style: {
  12. marginLeft: '10px'
  13. },
  14. width: 130,
  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('turnPurcOut').turn('ProdIN!ToProdPurcOut!Deal', ' pd_piid=' + Ext.getCmp('pi_id').value +' and nvl(pd_yqty,0) < nvl(pd_inqty,0) + nvl(pd_outqty,0)', 'scm/reserve/turnDefectOut.action?type=ProdInOut!PurcCheckout');
  27. }
  28. },
  29. turn: function(nCaller, condition, url){
  30. var win = new Ext.window.Window({
  31. id : 'win',
  32. height: "100%",
  33. width: "80%",
  34. maximizable : true,
  35. buttonAlign : 'center',
  36. layout : 'anchor',
  37. items: [{
  38. tag : 'iframe',
  39. frame : true,
  40. anchor : '100% 100%',
  41. layout : 'fit',
  42. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  43. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  44. }],
  45. buttons : [{
  46. name: 'confirm',
  47. text : $I18N.common.button.erpConfirmButton,
  48. iconCls: 'x-button-icon-confirm',
  49. cls: 'x-btn-gray',
  50. listeners: {
  51. buffer: 500,
  52. click: function(btn) {
  53. var grid = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow.Ext.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. });