SelPrintTemplate.js.svn-base 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Ext.define('erp.view.scm.reserve.SelPrintTemplate',{
  2. extend: 'Ext.Viewport',
  3. layout: 'fit',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. anchor:'100% 100%',
  10. xtype:'form',
  11. id :'printLabelForm',
  12. buttonAlign : 'center',
  13. items:[{
  14. xtype: 'combo',
  15. id: 'template',
  16. fieldLabel: '打印模板',
  17. store: Ext.create('Ext.data.Store', {
  18. autoLoad: true,
  19. fields: ['la_code','la_id'],
  20. proxy: {
  21. type: 'ajax',
  22. url : basePath + 'scm/reserve/getFields.action',
  23. extraParams:{condition:caller},
  24. reader: {
  25. type: 'json',
  26. root: 'datas'
  27. },
  28. headers: {
  29. 'Content-Type': 'application/json;charset=utf-8'
  30. }
  31. },
  32. listeners:{
  33. load : function (store){
  34. Ext.getCmp('template').select(store.getAt(0));
  35. }
  36. }
  37. }),
  38. displayField: 'la_code',
  39. valueField: 'la_id',
  40. width:200,
  41. allowBlank:false,
  42. style:'margin-left:15px;margin-top:15px;',
  43. }],
  44. dockedItems:[{
  45. xtype: 'toolbar',
  46. dock: 'bottom',
  47. layout: {
  48. pack: 'center' //放置位置
  49. },
  50. defaults: {
  51. style: {
  52. marginLeft: '10px',
  53. marginBottom:'15px'
  54. }
  55. },
  56. items:[{
  57. xtype: 'button',
  58. name: 'barPrint',
  59. id: 'barPrint',
  60. text: '打印',
  61. cls: 'x-btn-gray',
  62. iconCls: 'x-button-icon-print',
  63. width:60,
  64. formBind: true//form.isValid() == false时,按钮disabled,
  65. },{
  66. xtype: 'button',
  67. name: 'barPrintPreview',
  68. id: 'barPrintPreview',
  69. text: '打印预览',
  70. cls: 'x-btn-gray',
  71. iconCls: 'x-button-icon-preview',
  72. width:100,
  73. formBind: true//form.isValid() == false时,按钮disabled,
  74. },{
  75. xtype: 'erpCloseButton'
  76. }]
  77. }]
  78. }]
  79. });
  80. me.callParent(arguments);
  81. }
  82. });