PackageTransfer.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. Ext.define('erp.view.pm.mes.PackageTransfer',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. id:'form',
  10. title:'包装转移',
  11. xtype: 'form',
  12. anchor: '100% 25%',
  13. bodyStyle: 'background: #f1f1f1;',
  14. bodyPadding:5,
  15. autoScroll: true,
  16. scrollable: true,
  17. items:[{
  18. xtype: 'fieldcontainer',
  19. defaults: {
  20. width: 250
  21. },
  22. layout: {
  23. type: 'table',
  24. columns: 5
  25. },
  26. items: [{
  27. xtype: 'textfield',
  28. fieldLabel: '箱号',
  29. colspan: 1,
  30. allowBlank:false,
  31. id:'pa_outboxcode',
  32. name:'pa_outboxcode',
  33. fieldStyle : "background:rgb(224, 224, 255);",
  34. labelStyle:"color:red;",
  35. emptyText:'请录入需要转移的箱号'
  36. },{
  37. xtype: 'textfield',
  38. fieldLabel: '箱内数量',
  39. readOnly:true,
  40. colspan: 1,
  41. id:'pa_totalqty',
  42. name:'pa_totalqty'
  43. },{
  44. xtype: 'boxcodetrigger2',
  45. fieldLabel: '目标箱号',
  46. colspan: 1,
  47. id:'pa_outboxnew',
  48. name:'pa_outboxnew',
  49. fieldStyle : "background:rgb(224, 224, 255);",
  50. labelStyle:"color:red;",
  51. emptyText:'请录入目标箱号'
  52. },{
  53. xtype: 'textfield',
  54. fieldLabel: '箱内数量',
  55. colspan: 1,
  56. readOnly:true,
  57. id:'pa_totalqtynew' ,
  58. name:'pa_totalqtynew',
  59. allowBlank:false,
  60. fieldStyle : "background:rgb(224, 224, 255);",
  61. labelStyle:"color:red;"
  62. }]
  63. }],
  64. buttonAlign: 'center',
  65. buttons: [{
  66. xtype: 'erpCloseButton'
  67. }]
  68. },{
  69. xtype: 'grid',
  70. anchor: '100% 40%',
  71. id:'querygrid',
  72. plugins: [Ext.create('erp.view.core.plugin.CopyPasteMenu')],
  73. columns: [{
  74. text: '箱号',
  75. dataIndex: 'pd_outboxcode',
  76. flex: 1
  77. },{
  78. text: '序列号/子箱号',
  79. dataIndex: 'pd_barcode',
  80. flex: 1
  81. },{
  82. text: '数量',
  83. dataIndex: 'pd_innerqty',
  84. flex: 1
  85. }],
  86. columnLines: true,
  87. store: Ext.create('Ext.data.Store',{
  88. fields: ['pd_outboxcode','pd_barcode','pd_innerqty'],
  89. data: [ {},{},{},{},{},{},{},{},{},{},{}],
  90. autoLoad:true
  91. })
  92. },{
  93. xtype: 'dataview',
  94. anchor: '100% 15%',
  95. id: 't_result',
  96. autoScroll: true,
  97. scrollable: true,
  98. store: new Ext.data.Store({
  99. fields: ['type', 'text']
  100. }),
  101. cls: 'msg-body',
  102. tpl: new Ext.XTemplate(
  103. '<audio id="audio-success" src="' + basePath + 'resource/audio/success.wav"></audio>',
  104. '<audio id="audio-error" src="' + basePath + 'resource/audio/error.wav"></audio>',
  105. '<tpl for=".">',
  106. '<div class="msg-item">',
  107. '<tpl if="type == \'success\'"><span class="text-info">{text}</span></tpl>',
  108. '<tpl if="type == \'error\'"><span class="text-warning">{text}</span></tpl>',
  109. '</div>',
  110. '</tpl>'
  111. ),
  112. itemSelector: 'div.msg-item',
  113. emptyText: '提示信息',
  114. deferEmptyText: false,
  115. autoScroll: true,
  116. append: function(text, type) {
  117. type = type || 'success';
  118. this.getStore().add({text: text, type: type});
  119. this.getEl().scroll("b", this.getEl().getHeight(), true);
  120. var el = Ext.get('audio-' + type).dom;
  121. el.play();
  122. }
  123. },{
  124. xtype: 'form',
  125. anchor: '100% 20%',
  126. bodyStyle: 'background: #f1f1f1;',
  127. items: [{
  128. xtype: 'fieldcontainer',
  129. autoScroll: true,
  130. scrollable: true,
  131. defaults: {
  132. width: 250
  133. },
  134. layout: {
  135. type: 'table',
  136. columns: 4
  137. },
  138. items: [{
  139. xtype: 'fieldcontainer',
  140. fieldLabel : '操作',
  141. defaultType: 'radiofield',
  142. layout: 'hbox',
  143. colspan: 4,
  144. width: 500,
  145. defaults: {
  146. flex: 1
  147. },
  148. items: [ {
  149. boxLabel : '序列号',
  150. inputValue: 'serial',
  151. name: 'operator',
  152. id : 'serial',
  153. checked: true
  154. },{
  155. boxLabel : '子箱号',
  156. inputValue: 'package',
  157. name: 'operator',
  158. id : 'package'
  159. }]
  160. },{
  161. xtype: 'textfield',
  162. fieldLabel: '录入框',
  163. id:'entercode',
  164. colspan: 1,
  165. allowBlank: false,
  166. fieldStyle : "background:rgb(224, 224, 255);",
  167. labelStyle:"color:red;"
  168. },{
  169. xtype: 'combo',
  170. fieldLabel: '打印选择',
  171. id:'choose',
  172. colspan: 1,
  173. store: Ext.create('Ext.data.Store', {
  174. fields: ['display', 'value'],
  175. data : [{"display": '新箱号', "value": '0'},
  176. {"display": '旧箱号', "value": '1'},
  177. {"display": '新旧箱号', "value": '2'}]
  178. }),
  179. displayField: 'display',
  180. valueField: 'value',
  181. queryMode: 'local'
  182. },{
  183. xtype: 'erpPrintButton' ,
  184. width:'80px'
  185. }]
  186. }]
  187. }]
  188. });
  189. me.callParent(arguments);
  190. }
  191. });