Consign.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * 转发货按钮
  3. */
  4. Ext.define('erp.view.core.button.Consign',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpConsignButton',
  7. iconCls: 'x-button-icon-delete',
  8. cls: 'x-btn-gray',
  9. text: '转通知单',
  10. id: 'consign',
  11. style: {
  12. marginLeft: '10px'
  13. },
  14. width: 110,
  15. listeners: {
  16. click: function(m){
  17. Ext.getCmp('consign').turn('Sale!ToAccept!Deal', 'sd_said=' + Ext.getCmp('sa_id').value + ' AND nvl(sd_yqty,0)<nvl(sd_qty,0) and sd_statuscode=\'AUDITED\'', 'scm/sale/turnNotify.action');
  18. }
  19. },
  20. initComponent : function(){
  21. this.callParent(arguments);
  22. },
  23. turn: function(nCaller, condition, url){
  24. var win = new Ext.window.Window({
  25. id : 'win',
  26. height: "100%",
  27. width: "80%",
  28. maximizable : true,
  29. buttonAlign : 'center',
  30. layout : 'anchor',
  31. items: [{
  32. tag : 'iframe',
  33. frame : true,
  34. anchor : '100% 100%',
  35. layout : 'fit',
  36. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/common/editorColumn.jsp?caller=' + nCaller
  37. + "&condition=" + condition +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  38. }],
  39. buttons : [{
  40. name: 'confirm',
  41. text : $I18N.common.button.erpConfirmButton,
  42. iconCls: 'x-button-icon-confirm',
  43. cls: 'x-btn-gray',
  44. listeners: {
  45. buffer: 500,
  46. click: function(btn) {
  47. var grid = Ext.getCmp('win').items.items[0].body.dom.getElementsByTagName('iframe')[0].contentWindow.Ext.getCmp("editorColumnGridPanel");
  48. btn.setDisabled(true);
  49. grid.updateAction(url);
  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. });