Ext.define('erp.view.pm.make.MakeMaterialGive',{ extend: 'Ext.Viewport', layout: 'fit', hideBorders: true, initComponent : function(){ var me = this; Ext.apply(me, { items: [{ layout: 'anchor', items: [{ xtype: 'erpGridPanel5', anchor: '100% 32%', caller: 'Make!Give', necessaryField: 'ma_code', bbar: { xtype: 'toolbar', items: [{ xtype: 'tool', type: 'restore', tooltip: '最大化', listeners:{ click: function(btn){ window.open(window.location.href); } } },'->',{ name: 'query', id: 'query', text: $I18N.common.button.erpQueryButton, iconCls: 'x-button-icon-query', cls: 'x-btn-gray' },{ name: 'export', text: $I18N.common.button.erpExportButton, iconCls: 'x-button-icon-excel', cls: 'x-btn-gray', style: { marginLeft: '10px' }, menu: [{ iconCls: 'main-msg', text: '补料主表', listeners: { click: function(m){ var grid = Ext.getCmp('grid'); grid.BaseUtil.exportexcel(grid); } } },{ iconCls: 'main-msg', text: '补料从表', listeners: { click: function(m){ var grid = Ext.getCmp('makeMaterialGrid'); grid.BaseUtil.exportexcel(grid); } } }] },{ text: '生成补料单', id: 'create', width: 95, iconCls: 'x-button-icon-add', style: { marginLeft: '10px' }, cls: 'x-btn-gray' },{ name: 'close', text: $I18N.common.button.erpCloseButton, iconCls: 'x-button-icon-close', cls: 'x-btn-gray', style: { marginLeft: '10px' }, handler: function(btn){ var main = parent.Ext.getCmp("content-panel"); if(main){ main.getActiveTab().close(); } else { window.close(); } } },'->', { xtype: 'checkbox', id: 'ifnulllocation', boxLabel: '包含空', labelAlign: 'right', checked: true },{ xtype: 'textfield', hideLabel:true, emptyText:'储位', width:100, name:'pr_location', id: 'pr_location', value: '', },{ xtype: 'checkbox', id: 'whcode', boxLabel: '按仓库分组', labelAlign: 'right', checked: true }] } },{ xtype: 'erpEditorColumnGridPanel', caller: 'MakeMaterial!Give', condition: '1=2', anchor: '100% 68%', viewConfig: { listeners: { render: function(view) { if(!view.tip) { view.tip = Ext.create('Ext.tip.ToolTip', { target: view.el, delegate: view.itemSelector, trackMouse: true, renderTo: Ext.getBody(), listeners: { beforeshow: function updateTipBody(tip) { var record = view.getRecord(tip.triggerElement), grid = view.ownerCt.ownerCt; if(record && grid.productwh) { var c = record.get('mm_prodcode'), pws = new Array(); Ext.each(grid.productwh, function(d){ if(d.PW_PRODCODE == c) { pws.push(d); } }); tip.down('grid').setTitle(c); tip.down('grid').store.loadData(pws); } } }, items: [{ xtype: 'grid', width: 300, columns: [{ text: '仓库编号', cls: 'x-grid-header-1', dataIndex: 'PW_WHCODE', width: 80 },{ text: '仓库名称', cls: 'x-grid-header-1', dataIndex: 'WH_DESCRIPTION', width: 120 },{ text: '库存', cls: 'x-grid-header-1', xtype: 'numbercolumn', align: 'right', dataIndex: 'PW_ONHAND', width: 90 }], columnLines: true, title: '物料分仓库存', store: new Ext.data.Store({ fields: ['PW_WHCODE', 'WH_DESCRIPTION', 'PW_ONHAND'], data: [{}] }) }] }); } } } } }] }] }); me.callParent(arguments); } });