MakeMaterialIssue.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. Ext.define('erp.view.pm.make.MakeMaterialIssue',{
  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!issue',
  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('editorColumnGridPanel');
  55. grid.BaseUtil.exportexcel(grid);
  56. }
  57. }
  58. }]
  59. },{
  60. text: '生成领料单',
  61. id: 'create',
  62. width: 95,
  63. iconCls: 'x-button-icon-add',
  64. style: {
  65. marginLeft: '10px'
  66. },
  67. cls: 'x-btn-gray'
  68. },{
  69. text: '生成拨出单',
  70. id: 'createbc',
  71. width: 95,
  72. iconCls: 'x-button-icon-add',
  73. style: {
  74. marginLeft: '10px'
  75. },
  76. cls: 'x-btn-gray'
  77. },{
  78. name: 'close',
  79. text: $I18N.common.button.erpCloseButton,
  80. iconCls: 'x-button-icon-close',
  81. cls: 'x-btn-gray',
  82. style: {
  83. marginLeft: '10px'
  84. },
  85. handler: function(btn){
  86. var main = parent.Ext.getCmp("content-panel");
  87. if(main){
  88. main.getActiveTab().close();
  89. } else {
  90. window.close();
  91. }
  92. }
  93. },'->',{
  94. xtype: 'checkbox',
  95. id: 'ifnullwhman',
  96. boxLabel: '包含空',
  97. labelAlign: 'right',
  98. checked: true
  99. },{
  100. xtype: 'dbfindtrigger',
  101. hideLabel:true,
  102. emptyText:'仓管员',
  103. width:100,
  104. name:'pr_whmancode',
  105. id: 'pr_whmancode',
  106. value: '',
  107. listeners:{
  108. aftertrigger:function(t, d){
  109. t.ownerCt.down('textfield[name=pr_whmancode]').setValue(d.get('em_code'));
  110. }
  111. }
  112. },{
  113. xtype: 'checkbox',
  114. id: 'ifnulllocation',
  115. boxLabel: '包含空',
  116. labelAlign: 'right',
  117. checked: true
  118. },{
  119. xtype: 'textfield',
  120. hideLabel:true,
  121. emptyText:'储位',
  122. width:100,
  123. name:'pr_location',
  124. id: 'pr_location',
  125. value: '',
  126. },{
  127. margin: '3 0 0 0',
  128. xtype: 'checkbox',
  129. id: 'set',
  130. boxLabel: '按套数发料',
  131. labelAlign: 'right',
  132. checked: true
  133. },{
  134. xtype: 'checkbox',
  135. id: 'whcode',
  136. boxLabel: '按仓库分组',
  137. labelAlign: 'right',
  138. checked: true
  139. }]
  140. }
  141. },{
  142. xtype: 'erpEditorColumnGridPanel',
  143. caller: 'MakeMaterial!issue',
  144. condition: '1=2',
  145. anchor: '100% 68%',
  146. viewConfig: {
  147. listeners: {
  148. render: function(view) {
  149. if(!view.tip) {
  150. view.tip = Ext.create('Ext.tip.ToolTip', {
  151. target: view.el,
  152. delegate: view.itemSelector,
  153. trackMouse: true,
  154. renderTo: Ext.getBody(),
  155. listeners: {
  156. beforeshow: function updateTipBody(tip) {
  157. var record = view.getRecord(tip.triggerElement),
  158. grid = view.ownerCt.ownerCt;
  159. if(record && grid.productwh) {
  160. var c = record.get('mm_prodcode'), pws = new Array();
  161. Ext.each(grid.productwh, function(d){
  162. if(d.PW_PRODCODE == c) {
  163. pws.push(d);
  164. }
  165. });
  166. tip.down('grid').setTitle(c);
  167. tip.down('grid').store.loadData(pws);
  168. }
  169. }
  170. },
  171. items: [{
  172. xtype: 'grid',
  173. width: 300,
  174. columns: [{
  175. text: '仓库编号',
  176. cls: 'x-grid-header-1',
  177. dataIndex: 'PW_WHCODE',
  178. width: 80
  179. },{
  180. text: '仓库名称',
  181. cls: 'x-grid-header-1',
  182. dataIndex: 'WH_DESCRIPTION',
  183. width: 120
  184. },{
  185. text: '库存',
  186. cls: 'x-grid-header-1',
  187. xtype: 'numbercolumn',
  188. align: 'right',
  189. dataIndex: 'PW_ONHAND',
  190. width: 90
  191. }],
  192. columnLines: true,
  193. title: '物料分仓库存',
  194. store: new Ext.data.Store({
  195. fields: ['PW_WHCODE', 'WH_DESCRIPTION', 'PW_ONHAND'],
  196. data: [{}]
  197. })
  198. }]
  199. });
  200. }
  201. },
  202. cellcontextmenu:function (){
  203. //alert('sdsd');
  204. }
  205. }
  206. }
  207. }]
  208. }]
  209. });
  210. me.callParent(arguments);
  211. }
  212. });