PackageCollection.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. Ext.define('erp.view.pm.mes.PackageCollection',{
  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% 35%',
  13. bodyStyle: 'background: #f1f1f1;',
  14. bodyPadding:5,
  15. autoScroll: true,
  16. scrollable: true,
  17. items:[{
  18. xtype: 'fieldcontainer',
  19. defaults: {
  20. width: 250,
  21. msgTarget:'side'
  22. },
  23. layout: 'column',
  24. items: [{
  25. xtype: 'dbfindtrigger',
  26. fieldLabel: '资源编号',
  27. allowBlank:false,
  28. id:'sc_code',
  29. name:'sc_code',
  30. fieldStyle : "background:rgb(224, 224, 255);",
  31. labelStyle:"color:red;"
  32. },{
  33. xtype: 'textfield',
  34. fieldLabel: '资源名称',
  35. readOnly:true,
  36. id:'sc_name',
  37. name:'sc_name'
  38. },{
  39. xtype: 'textfield',
  40. fieldLabel: '工序编号',
  41. readOnly:true,
  42. id:'st_code',
  43. name:'st_code'
  44. },{
  45. xtype: 'textfield',
  46. fieldLabel: '工序名称',
  47. readOnly:true,
  48. id:'st_name',
  49. name:'st_name'
  50. },{
  51. xtype: 'dbfindtrigger',
  52. fieldLabel: '作业单号',
  53. id:'mc_code' ,
  54. name:'mc_code',
  55. allowBlank:false,
  56. fieldStyle : "background:rgb(224, 224, 255);",
  57. labelStyle:"color:red;"
  58. },{
  59. xtype: 'textfield',
  60. fieldLabel: '制造单号',
  61. id:'mc_makecode' ,
  62. name:'mc_makecode',
  63. allowBlank:false,
  64. hidden : true,
  65. hideLabel:true
  66. },{
  67. xtype: 'textfield',
  68. fieldLabel: '产品编号',
  69. readOnly:true,
  70. id:'mc_prodcode',
  71. name:'mc_prodcode'
  72. },{
  73. xtype: 'textfield',
  74. fieldLabel: '产品名称',
  75. readOnly:true,
  76. id:'pr_detail',
  77. name:'pr_detail'
  78. },{
  79. xtype: 'textfield',
  80. fieldLabel: '产品ID',
  81. id:'pr_id',
  82. name:'pr_id',
  83. hidden : true,
  84. hideLabel : true
  85. },{
  86. xtype: 'textfield',
  87. fieldLabel: '数量',
  88. readOnly:true,
  89. id:'mc_qty',
  90. name:'mc_qty'
  91. },{
  92. xtype: 'boxcodetrigger',
  93. fieldLabel: '箱号',
  94. allowBlank:false,
  95. id:'pa_code',
  96. name:'pa_code',
  97. fieldStyle : "background:rgb(224, 224, 255);",
  98. labelStyle:"color:red",
  99. },{
  100. xtype: 'textfield',
  101. fieldLabel: '箱内容量',
  102. allowBlank:false,
  103. id:'pa_totalqty',
  104. name:'pa_totalqty',
  105. fieldStyle : "background:rgb(224, 224, 255);",
  106. labelStyle:"color:red;"
  107. },{
  108. xtype: 'textfield',
  109. fieldLabel: '已装数量',
  110. readOnly : true,
  111. id:'pa_inqty'
  112. },{
  113. xtype: 'textfield',
  114. fieldLabel: '剩余可装数',
  115. readOnly : true,
  116. id:'pa_restqty'
  117. }]
  118. }],
  119. buttonAlign: 'center',
  120. buttons: [{
  121. xtype: 'erpQueryButton'
  122. },{
  123. xtype: 'erpCloseButton'
  124. }]
  125. },{
  126. xtype: 'grid',
  127. anchor: '100% 40%',
  128. id:'querygrid',
  129. plugins: [Ext.create('erp.view.core.plugin.CopyPasteMenu')],
  130. columns: [{
  131. text: '箱号',
  132. dataIndex: 'pd_outboxcode',
  133. flex: 1
  134. },{
  135. text: '序列号',
  136. dataIndex: 'pd_barcode',
  137. flex: 1
  138. },{
  139. text: '数量',
  140. dataIndex: 'pd_innerqty',
  141. flex: 1
  142. }],
  143. columnLines: true,
  144. store: Ext.create('Ext.data.Store',{
  145. fields: ['pd_outboxcode','pd_barcode','pd_innerqty'],
  146. data: [ {},{},{},{},{},{},{},{},{},{},{}],
  147. autoLoad:true
  148. })
  149. },{
  150. xtype: 'dataview',
  151. anchor: '100% 15%',
  152. id: 't_result',
  153. autoScroll: true,
  154. scrollable: true,
  155. store: new Ext.data.Store({
  156. fields: ['type', 'text']
  157. }),
  158. cls: 'msg-body',
  159. tpl: new Ext.XTemplate(
  160. '<audio id="audio-success" src="' + basePath + 'resource/audio/success.wav"></audio>',
  161. '<audio id="audio-error" src="' + basePath + 'resource/audio/error.wav"></audio>',
  162. '<tpl for=".">',
  163. '<div class="msg-item">',
  164. '<tpl if="type == \'success\'"><span class="text-info">{text}</span></tpl>',
  165. '<tpl if="type == \'error\'"><span class="text-warning">{text}</span></tpl>',
  166. '</div>',
  167. '</tpl>'
  168. ),
  169. itemSelector: 'div.msg-item',
  170. emptyText: '提示信息',
  171. deferEmptyText: false,
  172. autoScroll: true,
  173. append: function(text, type) {
  174. type = type || 'success';
  175. this.getStore().add({text: text, type: type});
  176. this.getEl().scroll("b", this.getEl().getHeight(), true);
  177. var el = Ext.get('audio-' + type).dom;
  178. el.play();
  179. }
  180. },{
  181. xtype: 'form',
  182. anchor: '100% 10%',
  183. bodyStyle: 'background: #f1f1f1;',
  184. bodyPadding:5,
  185. items: [{
  186. xtype: 'fieldcontainer',
  187. autoScroll: true,
  188. scrollable: true,
  189. defaults: {
  190. width: 250
  191. },
  192. layout: {
  193. type: 'table',
  194. columns: 4
  195. },
  196. items: [{
  197. xtype: 'textfield',
  198. fieldLabel: '序列号',
  199. id:'ms_sncode',
  200. colspan: 1,
  201. allowBlank: false,
  202. fieldStyle : "background:rgb(224, 224, 255);",
  203. labelStyle:"color:red;"
  204. },{
  205. xtype: 'textfield',
  206. fieldLabel: '序列号开头',
  207. id:'ms_codeB',
  208. colspan: 1
  209. },{
  210. xtype: 'textfield',
  211. fieldLabel: '序列号长度',
  212. id:'ms_codeLength',
  213. colspan: 1
  214. },{
  215. xtype: 'erpPrintButton' ,
  216. width:'80px'
  217. }]
  218. }]
  219. }]
  220. });
  221. me.callParent(arguments);
  222. }
  223. });