FeederUse.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. Ext.define('erp.view.pm.mes.FeederUse',{
  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% 55%',
  14. items:[{
  15. xtype: 'erpQueryGridPanel',
  16. title:'适用Feeder规格列表'
  17. },{
  18. title:'已领Feeder列表',
  19. items: [],
  20. layout: 'anchor',
  21. id: 'tab-list'
  22. }]
  23. },{
  24. xtype: 'form',
  25. anchor: '100% 25%',
  26. bodyStyle: 'background: #f1f1f1;',
  27. layout: 'border',
  28. items: [{
  29. xtype: 'fieldcontainer',
  30. region: 'center',
  31. autoScroll: true,
  32. scrollable: true,
  33. defaults: {
  34. width: 300
  35. },
  36. items: [{
  37. xtype: 'textfield',
  38. fieldLabel: '操作人员',
  39. readOnly:true,
  40. id:'man',
  41. allowBlank: false,
  42. value: em_name
  43. },{
  44. xtype: 'fieldcontainer',
  45. fieldLabel : '操作',
  46. defaultType: 'radiofield',
  47. layout: 'hbox',
  48. defaults: {
  49. flex: 1
  50. },
  51. items: [{
  52. boxLabel : '领用',
  53. inputValue: 'get',
  54. name: 'operator',
  55. id : 'get',
  56. checked: true
  57. }, {
  58. boxLabel : '退回',
  59. inputValue: 'back',
  60. name: 'operator',
  61. id : 'back'
  62. }]
  63. },{
  64. xtype: 'textareatrigger',
  65. fieldLabel: '原因',
  66. id:'reason'
  67. },{
  68. xtype: 'erpYnField',
  69. fieldLabel: '是否停用',
  70. id:'isuse',
  71. value: 0
  72. },{
  73. xtype: 'textfield',
  74. fieldLabel: 'Feeder编号',
  75. readOnly:false,
  76. id:'feedercode',
  77. emptyText: '请采集飞达编号',
  78. allowBlank: false
  79. }]
  80. },{
  81. xtype: 'dataview',
  82. region : 'east',
  83. width: 300,
  84. id: 't_result',
  85. store: new Ext.data.Store({
  86. fields: ['type', 'text']
  87. }),
  88. cls: 'msg-body',
  89. tpl: new Ext.XTemplate(
  90. '<audio id="audio-success" src="' + basePath + 'resource/audio/success.wav"></audio>',
  91. '<audio id="audio-error" src="' + basePath + 'resource/audio/error.wav"></audio>',
  92. '<tpl for=".">',
  93. '<div class="msg-item">',
  94. '<tpl if="type == \'success\'"><span class="text-info">{text}</span></tpl>',
  95. '<tpl if="type == \'error\'"><span class="text-warning">{text}</span></tpl>',
  96. '</div>',
  97. '</tpl>'
  98. ),
  99. itemSelector: 'div.msg-item',
  100. emptyText: '提示信息',
  101. deferEmptyText: false,
  102. autoScroll: true,
  103. append: function(text, type) {
  104. type = type || 'success';
  105. this.getStore().add({text: text, type: type});
  106. this.getEl().scroll("b", this.getEl().getHeight(), true);
  107. var el = Ext.get('audio-' + type).dom;
  108. el.play();
  109. }
  110. }],
  111. buttonAlign: 'center',
  112. buttons: [{
  113. xtype: 'button',
  114. id : 'confirm',
  115. text: $I18N.common.button.erpConfirmButton,
  116. cls: 'x-btn-gray',
  117. style: {
  118. marginLeft: '10px'
  119. },
  120. width: 80
  121. },{
  122. xtype: 'button',
  123. id : 'returnAll',
  124. text: $I18N.common.button.erpReturnAllButton,
  125. cls: 'x-btn-gray',
  126. width: 80,
  127. style: {
  128. marginLeft: '10px'
  129. }
  130. }]
  131. }]
  132. });
  133. me.callParent(arguments);
  134. }
  135. });