projectManagementEdit.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * 项目管理
  3. */
  4. shr.defineClass("shr.project.projectManagementEdit",shr.framework.Edit,{
  5. initalizeDOM : function() {
  6. shr.project.projectManagementEdit.superClass.initalizeDOM.call(this);
  7. var _self = this;
  8. window.onload = function () {
  9. var projectStateElement = document.getElementById('projectState');
  10. if (projectStateElement) {
  11. // var projectStateValue = projectStateElement.options[projectStateElement.selectedIndex].text;
  12. var projectStateValue = projectStateElement.value;
  13. console.log('项目状态值为:', projectStateValue);
  14. if (projectStateValue =="1") {
  15. $("#edit").hide();
  16. }
  17. if (projectStateValue == "1" || projectStateValue == "2") {
  18. $("#enable").hide();
  19. }
  20. } else {
  21. console.log('未找到项目状态元素');
  22. }
  23. };
  24. },
  25. /**
  26. * 启用
  27. */
  28. enableAction : function(){
  29. var that = this;
  30. shr.showConfirm('是否现在启用?', function() {
  31. top.Messenger().hideAll();
  32. that.remoteCall({
  33. method : "enablePorject",
  34. param : {
  35. billId : that.billId
  36. },
  37. success : function(data) {
  38. if(data && data.state == "success"){
  39. parent.location.reload();
  40. shr.showSuccess({
  41. message : "启用成功!"
  42. });
  43. $.block.hide();
  44. }else{
  45. shr.showWarning({
  46. message : data.errorMsg
  47. });
  48. }
  49. }
  50. });
  51. });
  52. },
  53. /**
  54. * 禁用
  55. */
  56. disableAction : function(){
  57. var that = this;
  58. shr.showConfirm('是否现在禁用?', function() {
  59. top.Messenger().hideAll();
  60. that.remoteCall({
  61. method : "disablePorject",
  62. param : {
  63. billId : that.billId
  64. },
  65. success : function(data) {
  66. if(data && data.state == "success"){
  67. parent.location.reload();
  68. shr.showSuccess({
  69. message : "禁用成功!"
  70. });
  71. $.block.hide();
  72. }else{
  73. shr.showWarning({
  74. message : data.errorMsg
  75. });
  76. }
  77. }
  78. });
  79. });
  80. },
  81. });