| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- Ext.define('erp.view.pm.outsource.MakeMaterialScrap',{
- 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!OS!Scrap',
- 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'
- },{
- xtype: 'erpCreateDetailButton'
- },{
- xtype: 'erpPrintDetailButton'
- },{
- 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);
- }
- }
- }]
- },{
- 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();
- }
- }
- },{
- text: '打印备料单',
- id: 'print',
- width: 95,
- iconCls: 'x-button-icon-print',
- style: {
- marginLeft: '10px'
- },
- cls: 'x-btn-gray'
- },{
- text: '生成报废单',
- id: 'retreat',
- width: 95,
- iconCls: 'x-button-icon-add',
- style: {
- marginLeft: '10px'
- },
- cls: 'x-btn-gray'
- },'->']
- }
- },{
- xtype: 'erpEditorColumnGridPanel',
- caller: 'MakeMaterial!OS!Scrap',
- 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);
- }
- });
|