WorkPlanForm2.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. Ext.define('erp.view.oa.persontask.workPlan.WorkPlanForm2',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpWorkPlanFormPanel2',
  4. id: 'form',
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. region: 'center',
  7. frame : true,
  8. autoScroll:true,
  9. fieldDefaults: {
  10. labelWidth: 80,
  11. cls: 'form-field-allowBlank'
  12. },
  13. layout: {
  14. type: 'column',
  15. align: 'stretch' // Child items are stretched to full width子面板高度充满父容器
  16. },
  17. items: [{
  18. }],
  19. // tbar: [{
  20. // id: 'save',
  21. // text: '保存',
  22. // iconCls: 'x-button-icon-save',
  23. // cls: 'x-btn-gray',
  24. //// handler: function(){
  25. //// alert(Ext.getCmp('wp_summary').value);
  26. //// }
  27. // },{
  28. // id: 'over',
  29. // text: '结束',
  30. // iconCls: 'x-button-icon-save',
  31. // cls: 'x-btn-gray'
  32. // }],
  33. initComponent : function(){
  34. // var nextworkplan = getUrlParam('nextworkplan');
  35. // var lastworkplan = getUrlParam('lastworkplan');
  36. this.callParent(arguments);
  37. // this.getLast(lastworkplan);
  38. // this.getNext(nextworkplan);
  39. // this.getRODDetail(getUrlParam('id'));
  40. },
  41. getNext: function(nextworkplan){
  42. if(nextworkplan!=null && nextworkplan!=''){
  43. var id = nextworkplan.split('IS')[1];
  44. Ext.Ajax.request({
  45. url : basePath + 'oa/persontask/workPlan/getWorkPlan.action',
  46. params : {
  47. id: id
  48. },
  49. method : 'post',
  50. async: false,
  51. callback : function(options,success,response){
  52. // me.getActiveTab().setLoading(false);
  53. var res = new Ext.decode(response.responseText);
  54. if(res.success){
  55. Ext.getCmp('wp_id').setValue(res.workplan.wp_id);
  56. Ext.getCmp('wp_type').setValue(res.workplan.wp_type);
  57. Ext.getCmp('wp_typeid').setValue(res.workplan.wp_typeid);
  58. Ext.getCmp('wp_emp').setValue(res.workplan.wp_emp);
  59. Ext.getCmp('wp_empid').setValue(res.workplan.wp_empid);
  60. Ext.getCmp('wp_summary').setValue(res.workplan.wp_summary);
  61. Ext.getCmp('wp_status').setValue(res.workplan.wp_status);
  62. Ext.getCmp('wp_statuscode').setValue(res.workplan.wp_statuscode);
  63. Ext.getCmp('wp_sumattachs').setValue(res.workplan.wp_sumattachs);
  64. Ext.getCmp('wp_planattachs').setValue(res.workplan.wp_planattachs);
  65. if(res.workplan.wp_updatetime){
  66. Ext.getCmp('wp_committime').setValue(Ext.util.Format.date(new Date(res.workplan.wp_committime),"Y-m-d H:i:s"));
  67. }
  68. if(res.workplan.wp_updatetime){
  69. Ext.getCmp('wp_updatetime').setValue(Ext.util.Format.date(new Date(res.workplan.wp_updatetime),"Y-m-d H:i:s"));
  70. }
  71. Ext.getCmp('wp_time').setValue(res.workplan.wp_time);
  72. Ext.getCmp('wp_title').setValue(res.workplan.wp_title);
  73. var values = '';
  74. for(var i=0; i<res.workplandetaillist.length; i++){
  75. if(i==res.workplandetaillist.length-1){
  76. values += res.workplandetaillist[i].wpd_plan;
  77. } else {
  78. values += res.workplandetaillist[i].wpd_plan + '==###==';
  79. }
  80. }
  81. Ext.getCmp('nextplan').setValue(values);
  82. } else{
  83. saveFailure();//@i18n/i18n.js
  84. }
  85. }
  86. });
  87. }
  88. },
  89. getLast: function(lastworkplan){
  90. if(lastworkplan!=null && lastworkplan!=''){
  91. var id = lastworkplan.split('IS')[1];
  92. Ext.Ajax.request({
  93. url : basePath + 'oa/persontask/workPlan/getWorkPlanDetail.action',
  94. params : {
  95. id: id
  96. },
  97. method : 'post',
  98. async: false,
  99. callback : function(options,success,response){
  100. // me.getActiveTab().setLoading(false);
  101. var res = new Ext.decode(response.responseText);
  102. if(res.success){
  103. var values = '';
  104. for(var i=0; i<res.workplandetaillist.length; i++){
  105. if(i==res.workplandetaillist.length-1){
  106. values += res.workplandetaillist[i].wpd_plan;
  107. } else {
  108. values += res.workplandetaillist[i].wpd_plan + '==###==';
  109. }
  110. }
  111. Ext.getCmp('lastplan').setValue(values);
  112. } else{
  113. saveFailure();//@i18n/i18n.js
  114. }
  115. }
  116. });
  117. }
  118. }
  119. });