MakeBad.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. Ext.define('erp.view.pm.mes.MakeBad',{
  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. autoScroll: true,
  15. scrollable: true,
  16. items:[{
  17. xtype: 'fieldcontainer',
  18. defaults: {
  19. width: 250
  20. },
  21. layout: {
  22. type: 'table',
  23. columns: 4
  24. },
  25. items: [{
  26. xtype: 'dbfindtrigger',
  27. fieldLabel: '资源编号',
  28. colspan: 1,
  29. allowBlank:false,
  30. id:'scCode',
  31. name:'scCode',
  32. fieldStyle : "background:rgb(224, 224, 255);",
  33. labelStyle:"color:red;"
  34. },{
  35. xtype: 'textfield',
  36. fieldLabel: '资源名称',
  37. readOnly:true,
  38. colspan: 1,
  39. id:'scName',
  40. name:'scName',
  41. fieldStyle : 'background:#f0f0f0;border: 0px solid #8B8970;font-color:blue'
  42. },{
  43. xtype: 'textfield',
  44. fieldLabel: '工序编号',
  45. readOnly:true,
  46. colspan: 1,
  47. id:'stCode',
  48. name:'stCode',
  49. fieldStyle : 'background:#f0f0f0;border: 0px solid #8B8970;font-color:blue'
  50. },{
  51. xtype: 'textfield',
  52. fieldLabel: '工序名称',
  53. readOnly:true,
  54. colspan: 1,
  55. id:'stName',
  56. name:'stName',
  57. fieldStyle : 'background:#f0f0f0;border: 0px solid #8B8970;font-color:blue'
  58. },{
  59. xtype: 'textfield',
  60. fieldLabel: '序列号',
  61. colspan: 1,
  62. id:'ms_sncode',
  63. name:'ms_sncode',
  64. emptyText: '请录入序列号',
  65. fieldStyle : "background:rgb(224, 224, 255);",
  66. labelStyle:"color:red;"
  67. },{
  68. xtype: 'textfield',
  69. fieldLabel: '制造单号',
  70. colspan: 1,
  71. id:'mc_makecode' ,
  72. name:'mc_makecode',
  73. readOnly:true,
  74. fieldStyle : 'background:#f0f0f0;border: 0px solid #8B8970;font-color:blue'
  75. },{
  76. xtype: 'dbfindtrigger',
  77. fieldLabel: '回流工艺',
  78. colspan: 1,
  79. id:'cr_code',
  80. name:'cr_code'
  81. },{
  82. xtype: 'dbfindtrigger',
  83. fieldLabel: '回流工序',
  84. colspan: 1,
  85. id:'cd_stepcode',
  86. name:'cd_stepcode'
  87. }]
  88. }],
  89. defaults: {
  90. margin: '5'
  91. },
  92. buttonAlign: 'center',
  93. buttons: [{
  94. xtype: 'button',
  95. id:'finishFix',
  96. text:'完成维修' ,
  97. cls: 'x-btn-gray'
  98. },{
  99. xtype: 'button',
  100. id:'scrap',
  101. text:'报废',
  102. cls: 'x-btn-gray'
  103. },{
  104. xtype: 'erpCloseButton'
  105. }]
  106. },{
  107. xtype: 'form',
  108. id:'fixForm',
  109. anchor: '100% 25%',
  110. title:'维修处理信息',
  111. bodyStyle: 'background: #f1f1f1;',
  112. items: [{
  113. xtype: 'fieldcontainer',
  114. autoScroll: true,
  115. scrollable: true,
  116. defaults: {
  117. width: 250
  118. },
  119. layout: 'column',
  120. items: [{
  121. xtype: 'textfield',
  122. fieldLabel: 'ID',
  123. id:'mb_id',
  124. hidden : true,
  125. hideLabel : true
  126. },{
  127. xtype: 'combo',
  128. fieldLabel: '不良组别',
  129. id:'bc_groupcode',
  130. name:'bc_groupcode',
  131. allowBlank: false,
  132. fieldStyle : "background:rgb(224, 224, 255);",
  133. labelStyle:"color:red;" ,
  134. autoSelect:true,
  135. store: Ext.create('Ext.data.Store', {
  136. fields: ['bg_code'],
  137. proxy: {
  138. type: 'ajax',
  139. url : basePath + 'pm/mes/getBadGroup.action',
  140. reader: {
  141. type: 'json',
  142. root: 'data'
  143. },
  144. headers: {
  145. 'Content-Type': 'application/json;charset=utf-8'
  146. }
  147. }
  148. }),
  149. displayField: 'bg_code',
  150. valueField: 'bg_code'
  151. },{
  152. xtype: 'combo',
  153. fieldLabel: '不良原因',
  154. id:'mb_badcode',
  155. editable : false,
  156. queryMode: 'remote',
  157. autoSelect:true,
  158. defaultListConfig:{ //取消loading的Mask
  159. loadMask: false
  160. },
  161. store: Ext.create('Ext.data.Store', {
  162. fields: ['bc_code','bc_name'],
  163. proxy: {
  164. type: 'ajax',
  165. url : basePath + 'pm/mes/getBadCode.action',
  166. extraParams:{condition:''},
  167. reader: {
  168. type: 'json',
  169. root: 'data'
  170. },
  171. headers: {
  172. 'Content-Type': 'application/json;charset=utf-8'
  173. }
  174. }
  175. }),
  176. displayField: 'bc_name',
  177. valueField: 'bc_code'
  178. },{
  179. xtype: 'textareatrigger',
  180. fieldLabel: '不良备注',
  181. id:'mb_badremark'
  182. },{
  183. xtype: 'combo',
  184. fieldLabel: '维修结果',
  185. id:'mb_status',
  186. store: Ext.create('Ext.data.Store', {
  187. fields: ['display', 'value'],
  188. data : [{"display": '待维修', "value": '0'},
  189. {"display": '已维修', "value": '1'},
  190. {"display": '不可维修', "value": '2'},
  191. {"display": '无不良', "value": '-1'}]
  192. }),
  193. displayField: 'display',
  194. valueField: 'value',
  195. queryMode: 'local',
  196. value:'0',
  197. editable: false
  198. }]
  199. }],
  200. defaults: {
  201. margin: '5'
  202. },
  203. buttonAlign: 'center',
  204. buttons: [{
  205. xtype: 'erpSaveButton'
  206. },{
  207. xtype:'erpAddButton'
  208. },{
  209. xtype:'erpDeleteButton'
  210. }]
  211. },{
  212. xtype: 'grid',
  213. anchor: '100% 40%',
  214. id:'querygrid',
  215. plugins: [Ext.create('erp.view.core.plugin.CopyPasteMenu')],
  216. columns: [{
  217. text: 'ID',
  218. dataIndex: 'mb_id',
  219. flex: 1,
  220. hidden:true
  221. },{
  222. text: 'bc_groupcode',
  223. dataIndex: 'bc_groupcode',
  224. flex: 1,
  225. hidden:true
  226. },{
  227. text: '序列号',
  228. dataIndex: 'mb_sncode',
  229. flex: 1
  230. },{
  231. text: '不良原因码',
  232. dataIndex: 'mb_badcode',
  233. flex: 1
  234. },{
  235. text: '不良原因',
  236. dataIndex: 'bc_name',
  237. flex: 1
  238. },{
  239. text: '不良备注',
  240. dataIndex: 'mb_badremark',
  241. flex: 1
  242. },{
  243. text: '解决方案',
  244. dataIndex: 'bc_note',
  245. flex: 1
  246. },{
  247. text: '责任方',
  248. dataIndex: 'bc_dutyman',
  249. flex: 1
  250. },{
  251. text:'维修结果',
  252. dataIndex:'mb_status',
  253. flex:1,
  254. xtype:"combocolumn",
  255. editor: {
  256. xtype: 'combo',
  257. displayField: 'display',
  258. valueField: 'value',
  259. queryMode: 'local',
  260. editable: false,
  261. store: {
  262. fields: ['display', 'value'],
  263. data : [{"display": '待维修', "value": '0'},
  264. {"display": '已维修', "value": '1'},
  265. {"display": '不可维修', "value": '2'},
  266. {"display": '无不良', "value": '-1'}]
  267. }
  268. }
  269. }],
  270. columnLines: true,
  271. store: Ext.create('Ext.data.Store',{
  272. fields: ['mb_id','bc_groupcode','mb_sncode','mb_badcode','bc_name','mb_badremark','bc_note','bc_dutyman','mb_status'],
  273. data: [ {},{},{},{},{},{},{},{},{},{},{}],
  274. autoLoad:true
  275. })
  276. }]
  277. });
  278. me.callParent(arguments);
  279. }
  280. });