masterManage.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Ext.define('erp.view.ma.logic.masterManage',{
  2. extend: 'Ext.Viewport',
  3. layout: 'border',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: "form",
  10. autoShow: true,
  11. region:'center',
  12. bodyStyle:'background:#ffffff',
  13. layout:'column',
  14. margin:'100% 100% 100% 100%',
  15. title:'禁用/启用账套(√为已启用帐套,*标记为主账套)',
  16. id:'master',
  17. bbar: ['->',{xtype: 'erpConfirmButton'},{ xtype: 'erpCloseButton'},'->']
  18. }]
  19. });
  20. me.callParent(arguments);
  21. this.show();
  22. this.showMasters();
  23. },
  24. showMasters: function() {
  25. Ext.Ajax.request({
  26. async:true,
  27. url : basePath + 'common/getMasters.action',
  28. method : 'post',
  29. callback : function(opt,s,res){
  30. var data = Ext.decode(res.responseText);
  31. var form=Ext.getCmp('master');
  32. var check=true;
  33. var disabled=true;
  34. for(var i=0;i<data.masters.length;i++){
  35. /*如果账套不可用,则不勾选*/
  36. if(data.masters[i].ma_enable!=1){
  37. check=false;
  38. }
  39. /*主账套不可勾选*/
  40. if(data.masters[i].ma_name!=data.defaultSob){
  41. disabled=false;
  42. }else{
  43. data.masters[i].ma_function=data.masters[i].ma_function+"*";
  44. }
  45. var conitem=[{
  46. xtype: 'checkbox',
  47. inputValue: data.masters[i].ma_id,
  48. checked:check,
  49. disabled : disabled,
  50. columnWidth:0.25,
  51. margin:'10 0 0 10',
  52. text:data.masters[i].ma_enable,
  53. boxLabel: data.masters[i].ma_function
  54. }];
  55. check=true;
  56. disabled=true;
  57. form.add(conitem);
  58. }
  59. }
  60. });
  61. },
  62. });