checkFirst.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Ext.define('erp.view.pm.mes.checkFirst',{
  2. extend: 'Ext.Viewport',
  3. layout: 'fit',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. layout: 'anchor',
  10. items: [{
  11. xtype: 'erpFormPanel',
  12. anchor: '100% 50%',
  13. autoScroll: true,
  14. saveUrl: 'pm/mes/saveCheckFirst.action',
  15. deleteUrl: 'pm/mes/deleteCheckFirst.action',
  16. updateUrl: 'pm/mes/updateCheckFirst.action',
  17. submitUrl: 'pm/mes/submitCheckFirst.action',
  18. resSubmitUrl: 'pm/mes/resSubmitCheckFirst.action',
  19. auditUrl: 'pm/mes/auditCheckFirst.action',
  20. resAuditUrl: 'pm/mes/resAuditCheckFirst.action',
  21. getIdUrl: 'common/getId.action?seq=SPOTCHECKRECORD_SEQ',
  22. keyField: 'sr_id',
  23. codeField: 'sr_code',
  24. statusField: 'sr_status',
  25. statuscodeField:'sr_statuscode'
  26. },{
  27. xtype: 'erpGridPanel2',
  28. anchor: '100% 50%',
  29. detno: 'srd_detno',
  30. keyField: 'srd_id',
  31. mainField: 'srd_srid',
  32. allowExtraButtons: true,
  33. plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
  34. clicksToEdit: 1,
  35. listeners:{
  36. beforeedit:function(e){
  37. var g=e.grid,r=e.record,f=e.field;
  38. if(g.binds){
  39. var bool=true;
  40. Ext.Array.each(g.binds,function(item){
  41. if(Ext.Array.contains(item.fields,f)){
  42. Ext.each(item.refFields,function(field){
  43. if(r.get(field)!=null && r.get(field)!=0 && r.get(field)!='' && r.get(field)!='0'){
  44. bool=false;
  45. }
  46. });
  47. }
  48. });
  49. return bool;
  50. }
  51. }
  52. }
  53. }), Ext.create('erp.view.core.plugin.CopyPasteMenu')]
  54. }]
  55. }]
  56. });
  57. me.callParent(arguments);
  58. }
  59. });