StepTest.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. Ext.define('erp.view.pm.mes.StepTest',{
  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% 30%',
  13. bodyStyle: 'background: #f1f1f1;',
  14. bodyPadding:5,
  15. items:[{
  16. xtype: 'fieldcontainer',
  17. region: 'center',
  18. autoScroll: true,
  19. scrollable: true,
  20. defaults: {
  21. width: 250,
  22. fieldStyle : 'background:#f0f0f0;border: 0px solid #8B8970;font-color:blue'
  23. },
  24. layout: {
  25. type: 'table',
  26. columns: 4
  27. },
  28. items: [{
  29. xtype: 'dbfindtrigger',
  30. fieldLabel: '资源编号',
  31. colspan: 1,
  32. id:'sc_code',
  33. name:'sc_code',
  34. fieldStyle : "background:rgb(224, 224, 255);",
  35. labelStyle:"color:red;",
  36. emptyText:'请录入资源编号'
  37. },{
  38. xtype: 'textfield',
  39. fieldLabel: '资源名称',
  40. readOnly:true,
  41. colspan: 1,
  42. id:'sc_name',
  43. name:'sc_name'
  44. },{
  45. xtype: 'textfield',
  46. fieldLabel: '工序编号',
  47. readOnly:true,
  48. colspan: 1,
  49. id:'st_code',
  50. name:'st_code'
  51. },{
  52. xtype: 'textfield',
  53. fieldLabel: '工序名称',
  54. readOnly:true,
  55. colspan: 1,
  56. id:'st_name',
  57. name:'st_name'
  58. },{
  59. xtype: 'dbfindtrigger',
  60. fieldLabel: '作业单号 ',
  61. colspan: 1,
  62. id:'mc_code',
  63. name:'mc_code',
  64. fieldStyle : "background:rgb(224, 224, 255);",
  65. labelStyle:"color:red;",
  66. emptyText:'请录入作业单号'
  67. },{
  68. xtype: 'textfield',
  69. fieldLabel: '制造单号',
  70. readOnly:true,
  71. colspan: 1,
  72. id:'mc_makecode' ,
  73. name:'mc_makecode'
  74. },{
  75. xtype: 'textfield',
  76. fieldLabel: '产品编号',
  77. readOnly:true,
  78. colspan: 1,
  79. id:'mc_prodcode',
  80. name:'mc_prodcode'
  81. },{
  82. xtype: 'textfield',
  83. fieldLabel: '产品名称',
  84. readOnly:true,
  85. colspan: 1,
  86. id:'pr_detail',
  87. name:'pr_detail'
  88. },{
  89. xtype: 'textfield',
  90. fieldLabel: '数量',
  91. readOnly:true,
  92. colspan: 1,
  93. id:'mc_qty' ,
  94. name:'mc_qty'
  95. },{
  96. xtype: 'textfield',
  97. fieldLabel: '已采集',
  98. readOnly:true,
  99. colspan: 1,
  100. id:'mcd_inqty',
  101. name:'mcd_inqty'
  102. },{
  103. xtype: 'textfield',
  104. fieldLabel: '待采集',
  105. readOnly:true,
  106. colspan: 1,
  107. id:'mc_restqty',
  108. name:'mc_restqty'
  109. }]
  110. }]
  111. },{
  112. xtype: 'form',
  113. id:'testform',
  114. anchor: '100% 20%',
  115. bodyStyle: 'background: #f1f1f1;',
  116. bodyPadding:'8,5,5,5',
  117. autoScroll: true,
  118. scrollable: true,
  119. items: [{
  120. xtype: 'fieldcontainer',
  121. items:[{
  122. layout:'column',
  123. bodyStyle: 'background: #f1f1f1;',
  124. border:false,
  125. items:[{
  126. xtype: 'textfield',
  127. fieldLabel: '序列号',
  128. readOnly: false,
  129. id:'ms_code',
  130. columnWidth : 0.55,
  131. allowBlank: false,
  132. emptyText: '请录入序列号'
  133. },{
  134. xtype: 'button',
  135. text:'合格通过',
  136. id:'confirmBtn',
  137. width:'90px;',
  138. cls: 'x-btn-gray',
  139. style: {
  140. marginLeft: '60px',
  141. marginRight: '70px'
  142. }
  143. },{
  144. xtype: 'dbfindtrigger',
  145. fieldLabel: '返修工序',
  146. id:'st_rcode',
  147. name:'st_rcode'
  148. },{
  149. xtype: 'button',
  150. text: '转返修',
  151. id:'confirmRepairStep',
  152. width:'90px;',
  153. cls: 'x-btn-gray',
  154. style: {
  155. marginLeft: '10px'
  156. }
  157. }]
  158. },{
  159. bodyStyle: 'background: #f1f1f1;',
  160. border:false,
  161. defaults: {
  162. width: 250
  163. },
  164. layout: {
  165. type: 'table',
  166. columns: 4
  167. },
  168. items:[{
  169. xtype: 'combo',
  170. fieldLabel: '不良组别',
  171. id:'bc_groupcode',
  172. name:'bc_groupcode',
  173. autoSelect:true,
  174. store: Ext.create('Ext.data.Store', {
  175. fields: ['bg_code'],
  176. proxy: {
  177. type: 'ajax',
  178. url : basePath + 'pm/mes/getBadGroup.action',
  179. reader: {
  180. type: 'json',
  181. root: 'data'
  182. },
  183. headers: {
  184. 'Content-Type': 'application/json;charset=utf-8'
  185. }
  186. }
  187. }),
  188. displayField: 'bg_code',
  189. valueField: 'bg_code'
  190. },{
  191. xtype: 'combo',
  192. fieldLabel: '不良原因',
  193. id:'bc_reason',
  194. editable : false,
  195. autoSelect:true,
  196. queryMode: 'remote',
  197. defaultListConfig:{ //取消loading的Mask
  198. loadMask: false
  199. },
  200. store: Ext.create('Ext.data.Store', {
  201. fields: ['bc_code','bc_name'],
  202. proxy: {
  203. type: 'ajax',
  204. url : basePath + 'pm/mes/getBadCode.action',
  205. extraParams:{condition:''},
  206. reader: {
  207. type: 'json',
  208. root: 'data'
  209. },
  210. headers: {
  211. 'Content-Type': 'application/json;charset=utf-8'
  212. }
  213. },
  214. listeners:{
  215. load : function (store){
  216. Ext.getCmp('bc_reason').select(store.getAt(0));
  217. }
  218. }
  219. }),
  220. displayField: 'bc_name',
  221. valueField: 'bc_code'
  222. },{
  223. xtype: 'textareatrigger',
  224. fieldLabel: '不良备注',
  225. id:'bc_remark',
  226. allowBlank: true
  227. },{
  228. xtype: 'button',
  229. text: '保存不良原因',
  230. id:'saveBad',
  231. width:'90px;',
  232. cls: 'x-btn-gray',
  233. style: {
  234. marginLeft: '10px'
  235. }
  236. }]
  237. }]
  238. }]
  239. },{
  240. xtype: 'grid',
  241. anchor: '100% 50%',
  242. id:'querygrid',
  243. plugins: [Ext.create('erp.view.core.plugin.CopyPasteMenu')],
  244. tbar : [
  245. '->',{ xtype: 'button', text: '删除',cls: 'x-btn-gray', width: 60,iconCls: 'x-button-icon-delete',id:'deletebutton' }
  246. ],
  247. selModel: Ext.create('Ext.selection.CheckboxModel',{
  248. checkOnly : true,
  249. ignoreRightMouseSelection : false,
  250. listeners:{
  251. selectionchange:function(selModel, selected, options){
  252. selModel.view.ownerCt.selectall = false;
  253. }
  254. },
  255. getEditor: function(){
  256. return null;
  257. },
  258. onHeaderClick: function(headerCt, header, e) {
  259. if (header.isCheckerHd) {
  260. e.stopEvent();
  261. var isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');
  262. if (isChecked && this.getSelection().length > 0) {//先全选,再筛选后再全选时,无法响应的bug
  263. this.deselectAll(true);
  264. } else {
  265. this.selectAll(true);
  266. this.view.ownerCt.selectall = true;
  267. }
  268. }
  269. }
  270. }),
  271. columns: [{
  272. text: 'ID',
  273. dataIndex: 'mb_id',
  274. flex: 1,
  275. hidden:true
  276. },{
  277. text: 'bc_groupcode',
  278. dataIndex: 'bc_groupcode',
  279. flex: 1,
  280. hidden:true
  281. },{
  282. text: '序列号',
  283. dataIndex: 'mb_sncode',
  284. flex: 1
  285. },{
  286. text: '不良原因码',
  287. dataIndex: 'mb_badcode',
  288. flex: 1
  289. },{
  290. text: '不良原因',
  291. dataIndex: 'bc_name',
  292. flex: 1
  293. },{
  294. text: '不良备注',
  295. dataIndex: 'mb_badremark',
  296. flex: 1
  297. },{
  298. text: '解决方案',
  299. dataIndex: 'bc_note',
  300. flex: 1
  301. },{
  302. text: '责任方',
  303. dataIndex: 'bc_dutyman',
  304. flex: 1
  305. },{
  306. text:'维修结果',
  307. dataIndex:'mb_status',
  308. flex:1,
  309. xtype:"combocolumn",
  310. editor: {
  311. xtype: 'combo',
  312. displayField: 'display',
  313. valueField: 'value',
  314. queryMode: 'local',
  315. editable: false,
  316. store: {
  317. fields: ['display', 'value'],
  318. data : [{"display": '待维修', "value": '0'},
  319. {"display": '已维修', "value": '1'},
  320. {"display": '不可维修', "value": '2'},
  321. {"display": '无不良', "value": '-1'}]
  322. }
  323. }
  324. }],
  325. columnLines: true,
  326. store: Ext.create('Ext.data.Store',{
  327. fields: ['mb_id','bc_groupcode','mb_sncode','mb_badcode','bc_name','mb_badremark','bc_note','bc_dutyman','mb_status'],
  328. data: [ {},{},{},{},{},{},{},{},{},{},{}],
  329. autoLoad:true
  330. })
  331. }]
  332. });
  333. me.callParent(arguments);
  334. }
  335. });