MakeMaterialGive.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Ext.define('erp.view.pm.outsource.MakeMaterialGive',{
  2. extend: 'Ext.Viewport',
  3. layout: 'fit',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. layout: 'anchor',
  10. items: [{
  11. xtype: 'erpGridPanel5',
  12. anchor: '100% 32%',
  13. caller: 'Make!OS!Give',
  14. necessaryField: 'ma_code',
  15. bbar: {
  16. xtype: 'toolbar',
  17. items: [{
  18. xtype: 'tool',
  19. type: 'restore',
  20. tooltip: '最大化',
  21. listeners:{
  22. click: function(btn){
  23. window.open(window.location.href);
  24. }
  25. }
  26. },'->',{
  27. name: 'query',
  28. id: 'query',
  29. text: $I18N.common.button.erpQueryButton,
  30. iconCls: 'x-button-icon-query',
  31. cls: 'x-btn-gray'
  32. },{
  33. name: 'export',
  34. text: $I18N.common.button.erpExportButton,
  35. iconCls: 'x-button-icon-excel',
  36. cls: 'x-btn-gray',
  37. style: {
  38. marginLeft: '10px'
  39. },
  40. menu: [{
  41. iconCls: 'main-msg',
  42. text: '补料主表',
  43. listeners: {
  44. click: function(m){
  45. var grid = Ext.getCmp('grid');
  46. grid.BaseUtil.exportexcel(grid);
  47. }
  48. }
  49. },{
  50. iconCls: 'main-msg',
  51. text: '补料从表',
  52. listeners: {
  53. click: function(m){
  54. var grid = Ext.getCmp('makeMaterialGrid');
  55. grid.BaseUtil.exportexcel(grid);
  56. }
  57. }
  58. }]
  59. },{
  60. name: 'close',
  61. text: $I18N.common.button.erpCloseButton,
  62. iconCls: 'x-button-icon-close',
  63. cls: 'x-btn-gray',
  64. style: {
  65. marginLeft: '10px'
  66. },
  67. handler: function(btn){
  68. var main = parent.Ext.getCmp("content-panel");
  69. if(main){
  70. main.getActiveTab().close();
  71. } else {
  72. window.close();
  73. }
  74. }
  75. },{
  76. text: '生成补料单',
  77. id: 'create',
  78. width: 95,
  79. iconCls: 'x-button-icon-add',
  80. style: {
  81. marginLeft: '10px'
  82. },
  83. cls: 'x-btn-gray'
  84. },'->',{
  85. xtype: 'checkbox',
  86. id: 'ifnulllocation',
  87. boxLabel: '包含空',
  88. labelAlign: 'right',
  89. checked: true
  90. },{
  91. xtype: 'textfield',
  92. hideLabel:true,
  93. emptyText:'储位',
  94. width:100,
  95. name:'pr_location',
  96. id: 'pr_location',
  97. value: '',
  98. },{
  99. xtype: 'checkbox',
  100. id: 'whcode',
  101. boxLabel: '按仓库分组',
  102. labelAlign: 'right',
  103. checked: true
  104. }]
  105. }
  106. },{
  107. xtype: 'erpEditorColumnGridPanel',
  108. caller: 'MakeMaterial!Give',
  109. condition: '1=2',
  110. detno: 'mm_detno',
  111. anchor: '100% 68%',
  112. viewConfig: {
  113. listeners: {
  114. render: function(view) {
  115. if(!view.tip) {
  116. view.tip = Ext.create('Ext.tip.ToolTip', {
  117. target: view.el,
  118. delegate: view.itemSelector,
  119. trackMouse: true,
  120. renderTo: Ext.getBody(),
  121. listeners: {
  122. beforeshow: function updateTipBody(tip) {
  123. var record = view.getRecord(tip.triggerElement),
  124. grid = view.ownerCt.ownerCt;
  125. if(record && grid.productwh) {
  126. var c = record.get('mm_prodcode'), pws = new Array();
  127. Ext.each(grid.productwh, function(d){
  128. if(d.PW_PRODCODE == c) {
  129. pws.push(d);
  130. }
  131. });
  132. tip.down('grid').setTitle(c);
  133. tip.down('grid').store.loadData(pws);
  134. }
  135. }
  136. },
  137. items: [{
  138. xtype: 'grid',
  139. width: 300,
  140. columns: [{
  141. text: '仓库编号',
  142. cls: 'x-grid-header-1',
  143. dataIndex: 'PW_WHCODE',
  144. width: 80
  145. },{
  146. text: '仓库名称',
  147. cls: 'x-grid-header-1',
  148. dataIndex: 'WH_DESCRIPTION',
  149. width: 120
  150. },{
  151. text: '库存',
  152. cls: 'x-grid-header-1',
  153. xtype: 'numbercolumn',
  154. align: 'right',
  155. dataIndex: 'PW_ONHAND',
  156. width: 90
  157. }],
  158. columnLines: true,
  159. title: '物料分仓库存',
  160. store: new Ext.data.Store({
  161. fields: ['PW_WHCODE', 'WH_DESCRIPTION', 'PW_ONHAND'],
  162. data: [{}]
  163. })
  164. }]
  165. });
  166. }
  167. }
  168. }
  169. }
  170. }]
  171. }]
  172. });
  173. me.callParent(arguments);
  174. }
  175. });