SerialTrace.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. Ext.define('erp.view.pm.mes.SerialTrace',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'erpFormPanel',
  10. anchor: '100% 20%'
  11. },{
  12. xtype:'tabpanel',
  13. anchor: '100% 80%',
  14. items:[{
  15. xtype: 'erpQueryGridPanel',
  16. title:'上料信息',
  17. caller: 'SerialTrace',
  18. id : 'grid1',
  19. viewConfig: {
  20. listeners: {
  21. render: function(view) {
  22. if(!view.tip) {
  23. view.tip = Ext.create('Ext.tip.ToolTip', {
  24. target: view.el,
  25. delegate: view.itemSelector,
  26. trackMouse: true,
  27. width: 500,
  28. renderTo: Ext.getBody(),
  29. listeners: {
  30. beforeshow: function(tip) {
  31. var record = view.getRecord(tip.triggerElement),
  32. grid = view.ownerCt;
  33. if(record && grid.barData) {
  34. var c = record.get('cm_barcode'), tipData = {};
  35. for(var i = 0;i < grid.barData.length;i++) {
  36. if(grid.barData[i].BAR_CODE == c) {
  37. tipData = grid.barData[i];
  38. break;
  39. }
  40. }
  41. tip.down('form').setTitle(c);
  42. tip.down('form').getForm().setValues(tipData);
  43. }
  44. }
  45. },
  46. items: [{
  47. xtype: 'form',
  48. bodyStyle: 'background: #f1f1f1;',
  49. title: '原材料信息追溯条',
  50. defaults: {
  51. xtype: 'textfield',
  52. margin: '5',
  53. flex: 1
  54. },
  55. items: [{
  56. fieldLabel: '采购单号',
  57. name: 'BAR_PUCODE'
  58. },{
  59. fieldLabel: '供应商号',
  60. name: 'BAR_VENDCODE'
  61. },{
  62. fieldLabel: '来料日期',
  63. name: 'BAR_INDATE',
  64. xtype: 'datefield'
  65. },{
  66. fieldLabel: '有效日期',
  67. name: 'BAR_VALIDDATE',
  68. xtype: 'datefield'
  69. },{
  70. fieldLabel: '生产日期',
  71. name: 'BAR_MADEDATE',
  72. xtype: 'datefield'
  73. }]
  74. }]
  75. });
  76. }
  77. }
  78. }
  79. }
  80. },{
  81. title:'不良记录',
  82. items: [],
  83. id : 'grid2-tab',
  84. layout: 'anchor',
  85. }]
  86. }]
  87. });
  88. me.callParent(arguments);
  89. }
  90. });