SMTFeed.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. Ext.define('erp.view.pm.mes.SMTFeed',{
  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: 'erpQueryGridPanel',
  13. anchor: '100% 55%'
  14. },{
  15. xtype: 'form',
  16. anchor: '100% 25%',
  17. id:'sform',
  18. bodyStyle: 'background: #f1f1f1;',
  19. layout: 'border',
  20. items: [{
  21. xtype: 'fieldcontainer',
  22. region: 'center',
  23. autoScroll: true,
  24. scrollable: true,
  25. defaults: {
  26. width: 300
  27. },
  28. layout: {
  29. type: 'table',
  30. columns: 2
  31. },
  32. items: [{
  33. xtype: 'textfield',
  34. fieldLabel: '备料单号',
  35. readOnly: false,
  36. emptyText: '可锁定备料单号以防止上错料卷',
  37. id:'mpcode',
  38. colspan: 2,
  39. width: 600,
  40. allowBlank: false
  41. },{
  42. xtype: 'fieldcontainer',
  43. fieldLabel : '操作',
  44. defaultType: 'radiofield',
  45. layout: 'hbox',
  46. colspan: 2,
  47. width: 500,
  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. boxLabel : '换料卷',
  64. inputValue: 'change',
  65. name: 'operator',
  66. id : 'change'
  67. },{
  68. boxLabel : '接料',
  69. inputValue: 'add',
  70. name: 'operator',
  71. id : 'add'
  72. },]
  73. },{
  74. xtype: 'textfield',
  75. fieldLabel: '站位',
  76. readOnly:true,
  77. colspan: 1,
  78. id:'mlscode',
  79. plugins: [Ext.create("Ext.ux.form.field.ClearButton")]
  80. },{
  81. xtype: 'textfield',
  82. fieldLabel: '料卷编号',
  83. readOnly:true,
  84. colspan: 1,
  85. id:'barcode',
  86. plugins: [Ext.create("Ext.ux.form.field.ClearButton")]
  87. },{
  88. xtype: 'textfield',
  89. fieldLabel: '飞达编号',
  90. readOnly:true,
  91. colspan: 1,
  92. id:'fecode',
  93. plugins: [Ext.create("Ext.ux.form.field.ClearButton")]
  94. },{
  95. xtype: 'textfield',
  96. fieldLabel: '录入框',
  97. readOnly:false,
  98. colspan: 1,
  99. id:'input',
  100. allowBlank: true,
  101. emptyText:'请录入站位编号'
  102. },{
  103. xtype: 'textfield',
  104. fieldLabel: '卷料数量',
  105. readOnly:true,
  106. colspan: 1,
  107. id:'number'
  108. },{
  109. xtype: 'combo',
  110. fieldLabel: '版面',
  111. colspan: 1,
  112. id:'tableAB',
  113. store: Ext.create('Ext.data.Store', {
  114. fields: ['display', 'value'],
  115. data : [{"display": 'A', "value": 'A'},
  116. {"display": 'B', "value": 'B'}]
  117. }),
  118. displayField: 'display',
  119. valueField: 'value',
  120. queryMode: 'local'
  121. }]
  122. },{
  123. xtype: 'dataview',
  124. region : 'east',
  125. width: 300,
  126. id: 't_result',
  127. store: new Ext.data.Store({
  128. fields: ['type', 'text']
  129. }),
  130. cls: 'msg-body',
  131. tpl: new Ext.XTemplate(
  132. '<audio id="audio-success" src="' + basePath + 'resource/audio/success.wav"></audio>',
  133. '<audio id="audio-error" src="' + basePath + 'resource/audio/error.wav"></audio>',
  134. '<tpl for=".">',
  135. '<div class="msg-item">',
  136. '<tpl if="type == \'success\'"><span class="text-info">{text}</span></tpl>',
  137. '<tpl if="type == \'error\'"><span class="text-warning">{text}</span></tpl>',
  138. '</div>',
  139. '</tpl>'
  140. ),
  141. itemSelector: 'div.msg-item',
  142. emptyText: '提示信息',
  143. deferEmptyText: false,
  144. autoScroll: true,
  145. append: function(text, type) {
  146. type = type || 'success';
  147. this.getStore().add({text: text, type: type});
  148. this.getEl().scroll("b", this.getEl().getHeight(), true);
  149. var el = Ext.get('audio-' + type).dom;
  150. el.play();
  151. }
  152. }],
  153. buttonAlign: 'center',
  154. buttons: [{
  155. xtype: 'button',
  156. id : 'confirm',
  157. text: $I18N.common.button.erpConfirmButton,
  158. cls: 'x-btn-gray',
  159. style: {
  160. marginLeft: '10px'
  161. },
  162. width: 60
  163. },{
  164. xtype: 'button',
  165. id : 'blankAll',
  166. text: $I18N.common.button.erpBlankAllButton,
  167. cls: 'x-btn-gray',
  168. width: 80,
  169. style: {
  170. marginLeft: '10px'
  171. }
  172. }]
  173. }]
  174. });
  175. me.callParent(arguments);
  176. }
  177. });