BatchPrint.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * 打印按钮
  3. */
  4. Ext.define('erp.view.core.button.BatchPrint',{
  5. id:'print',
  6. extend: 'Ext.Button',
  7. alias: 'widget.erpBatchPrintButton',
  8. iconCls: 'x-button-icon-print',
  9. cls: 'x-btn-gray',
  10. text: $I18N.common.button.erpBatchPrintButton,
  11. style: {
  12. marginLeft: '10px'
  13. },
  14. width: 100,
  15. initComponent : function(){
  16. this.callParent(arguments);
  17. },
  18. handler : function (){
  19. if(caller == 'NewBar!BaPrint'){
  20. lps_barcaller = 'PdaBarcodePrint';
  21. }
  22. var bool = false;
  23. var grid = Ext.getCmp('batchDealGridPanel');
  24. var items = grid.selModel.getSelection();
  25. Ext.each(items, function(item, index){
  26. if(this.data[grid.keyField] != null && this.data[grid.keyField] != ''
  27. && this.data[grid.keyField] != '0' && this.data[grid.keyField] != 0){
  28. bool = true;
  29. }
  30. });
  31. if(bool){
  32. var win = new Ext.window.Window({
  33. id : 'win',
  34. maximizable : true,
  35. buttonAlign : 'center',
  36. layout : 'anchor',
  37. title: '打印模板选择',
  38. modal : true,
  39. items: [{
  40. tag : 'iframe',
  41. frame : true,
  42. anchor : '100% 100%',
  43. layout : 'fit',
  44. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/scm/reserve/selPrintTemplate.jsp?whoami='+lps_barcaller+'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  45. }]
  46. });
  47. win.show();
  48. }else{
  49. showError("没有勾选需要打印的行,请勾选");
  50. }
  51. }
  52. });