Purchase.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Ext.define('erp.view.scm.purchase.Purchase',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. initComponent : function(){
  5. var me = this;
  6. Ext.apply(me, {
  7. items: [{
  8. xtype: 'erpFormPanel',
  9. anchor: '100% 50%',
  10. saveUrl: 'scm/purchase/savePurchase.action',
  11. deleteUrl: 'scm/purchase/deletePurchase.action',
  12. updateUrl: 'scm/purchase/updatePurchase.action',
  13. auditUrl: 'scm/purchase/auditPurchase.action',
  14. resAuditUrl: 'scm/purchase/resAuditPurchase.action',
  15. printUrl: 'scm/purchase/printPurchase.action',
  16. b2bUrl: 'scm/purchase/b2bPurchase.action',
  17. submitUrl: 'scm/purchase/submitPurchase.action',
  18. resSubmitUrl: 'scm/purchase/resSubmitPurchase.action',
  19. getIdUrl: 'common/getId.action?seq=PURCHASE_SEQ',
  20. keyField: 'pu_id',
  21. codeField: 'pu_code',
  22. statusField: 'pu_status',
  23. statuscodeField: 'pu_statuscode'
  24. },{
  25. xtype: 'erpGridPanel2',
  26. anchor: '100% 50%',
  27. detno: 'pd_detno',
  28. necessaryField: 'pd_prodcode',
  29. keyField: 'pd_id',
  30. mainField: 'pd_puid',
  31. allowExtraButtons: true,
  32. binds: [{
  33. refFields:['pd_sourcecode'],
  34. fields:['pd_prodcode']
  35. }],
  36. plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
  37. clicksToEdit: 1,
  38. listeners:{
  39. beforeedit:function(e){
  40. var g=e.grid,r=e.record,f=e.field;
  41. if(g.binds){
  42. var bool=true;
  43. Ext.Array.each(g.binds,function(item){
  44. if(Ext.Array.contains(item.fields,f)){
  45. Ext.each(item.refFields,function(field){
  46. if(r.get(field)!=null && r.get(field)!=0 && r.get(field)!='' && r.get(field)!='0'){
  47. bool=false;
  48. }
  49. });
  50. }
  51. });
  52. return bool;
  53. }
  54. }
  55. }
  56. }), Ext.create('erp.view.core.plugin.CopyPasteMenu')
  57. , Ext.create('erp.view.scm.purchase.plugin.Reply')],
  58. }]
  59. });
  60. me.callParent(arguments);
  61. }
  62. });