portal html css js resource

cmp-needShow.js 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. $(document).ready(function() {
  2. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  3. var demandId = GetQueryString("demandId");
  4. var orgId = $.cookie("orgId");
  5. if(orgId == "" || orgId == null || orgId == "null"){
  6. location.href = "cmp-settled-log.html";
  7. }
  8. function angleDemand() {
  9. $.ajax({
  10. url: "/ajax/demand/queryOne",
  11. type: "GET",
  12. timeout: 10000,
  13. dataType: "json",
  14. data: {
  15. "demandId": demandId,
  16. },
  17. beforeSend: function() {},
  18. success: function(data, textState) {
  19. if(data.success) {
  20. console.log(data);
  21. var $data = data.data;
  22. var oTime, oDemandType;
  23. $("#dialog_consultTitle").text($data.demandTitle);
  24. oTime = $data["createTime"].substr(0, 4) + "年" + $data.createTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  25. $data.createTime.substr(8, 2) + ":" + $data.createTime.substr(10, 2);
  26. $("#dialog_consultTime").text(oTime);
  27. if($data.closeTime) {
  28. $("#dil_consultStatus").text("已关闭");
  29. var oCloseTime = $data["closeTime"].substr(0, 4) + "年" + $data.closeTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  30. $data.closeTime.substr(8, 2) + ":" + $data.closeTime.substr(10, 2);
  31. $("#dialog_consultTime1").text(oCloseTime);
  32. $(".closeBtn").hide();
  33. } else {
  34. $("#dil_consultStatus").text("发布中");
  35. }
  36. if($data.demandType == 1) {
  37. oDemandType = "个人需求"
  38. } else {
  39. oDemandType = "企业需求"
  40. }
  41. $("#dialog_consultType1").text(oDemandType);
  42. if($data.demandAim == 1) {
  43. oDemandAim = "技术咨询"
  44. } else if($data.demandAim == 2) {
  45. oDemandAim = "资源咨询"
  46. } else if($data.demandAim == 3) {
  47. oDemandAim = "其他咨询"
  48. }
  49. $("#dialog_consultType2").text(oDemandAim);
  50. $("#dialog_consultContent").text($data.demandContent);
  51. if($data.professor.hasHeadImage){
  52. $("#oimg").attr("src","/images/head/" + $data.professor.id + "_l.jpg")
  53. }else{
  54. $("#oimg").attr("src","../images/default-photo.jpg")
  55. }
  56. $("#userName").text($data.professor.name);
  57. var oString = todStr($data.professor.title, $data.professor.office, $data.professor.department);
  58. $("#offt").text(oString);
  59. if($data.organization.hasOrgLogo){
  60. $("#organizationImg").attr("src", "/images/org/" + $data.organization.id + ".jpg");
  61. }else{
  62. $("#organizationImg").attr("src", "../images/default-icon.jpg");
  63. }
  64. $("#organName").text($data.organization.name);
  65. if($data.organization.authStatus){
  66. $("#authCompany").addClass("authicon-com-ok");
  67. $("#authCompany").attr("title","认证企业")
  68. }else{
  69. /*$("#authCompany").addClass("authicon-com-no");
  70. $("#authCompany").attr("title","未认证企业")*/
  71. }
  72. if($data.organization.industry){
  73. $(".ellipsisSty").text($data.organization.industry);
  74. }
  75. var oClass = autho($data.professor.authType, $data.professor.orgAuth, $data.professor.authStatus);
  76. $("#authFlag").addClass(oClass.sty).attr("title",oClass.title);
  77. }
  78. },
  79. error: function(XMLHttpRequest, textStats, errorThrown) {
  80. }
  81. })
  82. }
  83. angleDemand();
  84. $(".closeBtn").click(function() {
  85. $.MsgBox.Confirm("消息", "确认关闭此需求?——关闭后,专家将看不到此需求,但不会影响进行中的相关咨询。", closeDemand)
  86. })
  87. function closeDemand() {
  88. $.ajax({
  89. url: "/ajax/demand/close",
  90. type: "POST",
  91. timeout: 10000,
  92. dataType: "json",
  93. data: {
  94. "demandId": demandId,
  95. },
  96. beforeSend: function() {},
  97. success: function(data, textState) {
  98. if(data.success) {
  99. $(".closeBtn").hide();
  100. $("#dil_consultStatus").text("已关闭");
  101. }
  102. },
  103. error: function(XMLHttpRequest, textStats, errorThrown) {
  104. }
  105. })
  106. }
  107. /*职位职称所属机构*/
  108. function todStr() {
  109. var arr = new Array(),
  110. i;
  111. for(i in arguments) {
  112. if(arguments[i]) {
  113. arr.push(arguments[i])
  114. }
  115. }
  116. return arr.join();
  117. }
  118. })