MakeSendLS.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. Ext.define('erp.view.pm.make.MakeSendLS', {
  2. extend : 'Ext.Viewport',
  3. layout : 'anchor',
  4. hideBorders : true,
  5. initComponent : function() {
  6. var me = this;
  7. Ext.apply(me, {
  8. items : [ {
  9. region : 'north',
  10. xtype : 'erpBatchDealFormPanel',
  11. anchor : '100% 30%',
  12. tbar : [ {
  13. name : 'query',
  14. id : 'query',
  15. text : $I18N.common.button.erpQueryButton,
  16. iconCls : 'x-button-icon-query',
  17. cls : 'x-btn-gray'
  18. }, '-', {
  19. text : '发料',
  20. id : 'add',
  21. iconCls : 'x-button-icon-add',
  22. style : {
  23. marginLeft : '10px'
  24. },
  25. cls : 'x-btn-gray'
  26. }, '-', {
  27. text : $I18N.common.button.erpCloseButton,
  28. iconCls : 'x-button-icon-close',
  29. style : {
  30. marginLeft : '10px'
  31. },
  32. cls : 'x-btn-gray',
  33. handler : function() {
  34. var main = parent.Ext.getCmp("content-panel");
  35. main.getActiveTab().close();
  36. }
  37. } ],
  38. }, {
  39. region : 'south',
  40. xtype : 'erpBatchDealGridPanel',
  41. id : 'batchDealGridPanel',
  42. anchor : '100% 70%',
  43. // selModel : Ext.create('Ext.selection.CheckboxModel', {}),
  44. plugins: Ext.create('Ext.grid.plugin.CellEditing', {
  45. clicksToEdit: 1
  46. }),
  47. viewConfig: {
  48. listeners: {
  49. render: function(view) {
  50. if(!view.tip) {
  51. view.tip = Ext.create('Ext.tip.ToolTip', {
  52. target: view.el,
  53. delegate: view.itemSelector,
  54. trackMouse: true,
  55. renderTo: Ext.getBody(),
  56. listeners: {
  57. beforeshow: function updateTipBody(tip) {
  58. var record = view.getRecord(tip.triggerElement),
  59. grid = view.ownerCt;
  60. if(record && grid.productwh) {
  61. var c = record.get('mm_prodcode'), pws = new Array();
  62. Ext.each(grid.productwh, function(d){
  63. if(d.PW_PRODCODE == c) {
  64. pws.push(d);
  65. }
  66. });
  67. tip.down('grid').setTitle(c);
  68. tip.down('grid').store.loadData(pws);
  69. }
  70. }
  71. },
  72. items: [{
  73. xtype: 'grid',
  74. width: 300,
  75. columns: [{
  76. text: '仓库编号',
  77. cls: 'x-grid-header-1',
  78. dataIndex: 'PW_WHCODE',
  79. width: 80
  80. },{
  81. text: '仓库名称',
  82. cls: 'x-grid-header-1',
  83. dataIndex: 'WH_DESCRIPTION',
  84. width: 120
  85. },{
  86. text: '库存',
  87. cls: 'x-grid-header-1',
  88. xtype: 'numbercolumn',
  89. align: 'right',
  90. dataIndex: 'PW_ONHAND',
  91. width: 90
  92. }],
  93. columnLines: true,
  94. title: '物料分仓库存',
  95. store: new Ext.data.Store({
  96. fields: ['PW_WHCODE', 'WH_DESCRIPTION', 'PW_ONHAND'],
  97. data: [{}]
  98. })
  99. }]
  100. });
  101. }
  102. },
  103. cellcontextmenu:function (){
  104. //alert('sdsd');
  105. }
  106. }
  107. }
  108. } ]
  109. });
  110. me.callParent(arguments);
  111. }
  112. });