d479e82561b8b4c7d41bc4e0a19645335e53f3bb.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ResultShow = function() {
  2. /** 定义变量* */
  3. var _this = this;
  4. _this.listGrid = null;// 数据列表
  5. _this.listGrid1 = null;// 数据列表
  6. function goback(){
  7. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/evaluate/score/Score.jsp");
  8. }
  9. function initComplete(){
  10. $(".cell_card").each(function(){
  11. var tableStr="<table id='tempTableId' border='1' cellspacing='0' style='1px solid;width:100%'></table>";
  12. $(this).tip({"arrowDirection":"left","auto":true,arrowDistanceY:12,content:tableStr});
  13. $(this).hover(function(){
  14. var url = $.pathname() + '/ws/scoreGrade/ScoreGradeService/getCompanyWeight';
  15. var params = {companyId:$(this).attr('companyId'),gradeId:$(this).attr('gradeId'),trunkId:$(this).attr('trunkId')};
  16. $.post(url,params,function(data){
  17. if(data.isTrunk == 0){
  18. var trData = "<tr align='center'><td>体系名</td><td>项目级别</td><td>项目名称</td><td>权重</td></tr>";
  19. for(var i = 0;i < data.rows.length;i++){
  20. var rowdata = data.rows[i];
  21. trData += "<tr><td>"+rowdata.TRUNK_NAME+"</td><td>"+rowdata.LEVEL+"</td><td>"+rowdata.POJECT_NAME+"</td><td>"+rowdata.WEIGHT+"</td></tr>";
  22. }
  23. $("#tempTableId").html(trData);
  24. $(this).addClass("cell_card_over");
  25. }else{
  26. var trData = "<tr align='center'><td>项目级别</td><td>项目名称</td><td>得分</td></tr>";
  27. for(var i = 0;i < data.rows.length;i++){
  28. var rowdata = data.rows[i];
  29. trData += "<tr><td>"+rowdata.LEVEL+"</td><td>"+rowdata.POJECT_NAME+"</td><td>"+rowdata.SCORE+"</td></tr>";
  30. }
  31. $("#tempTableId").html(trData);
  32. $(this).addClass("cell_card_over");
  33. }
  34. },'json');
  35. },function(){
  36. $(this).removeClass("cell_card_over");
  37. })
  38. })
  39. }
  40. return {
  41. init : function() {
  42. var gradeId = $("#gradeId").val();
  43. var resultTrunk = $("#resultTrunk").val();
  44. var cols = [{display : '得分单位',name : 'DEPT_NAME',showTitle:true,width : "20%"},
  45. {display : '权重得分',name : 'WEIGHT_SCORE',width : "14%",render:function(rowdata, rowindex, value, column){
  46. return "<div style='width:80px;float:left;padding:4px 0 0 2px;'>"+value+"</div><div style='float:left;'><span class='cell_card' trunkId='' gradeId='"+gradeId+"' companyId='"+rowdata.COMAPNY_ID+"'></span></div><div class='clear'></div>";
  47. }},
  48. {display : '总分',name : 'TOTAL_SCORE',showTitle:true,width : "14%"},
  49. ];
  50. resultTrunk = resultTrunk.split(',');
  51. var len = resultTrunk.length;
  52. for(var i = 0;i< len;i++){
  53. var trunk = resultTrunk[i].split('$');
  54. var trunk = {display : trunk[1],name :'a'+trunk[0]+'$',width : "13%",render:function(rowdata, rowindex, value, column){
  55. var name = column.name;
  56. return "<div style='width:80px;float:left;padding:4px 0 0 2px;'>"+value+"</div><div style='float:left;'><span class='cell_card' trunkId='"+(name.split('a')[1]).split('$')[0]+"' gradeId='"+gradeId+"' companyId='"+rowdata.COMAPNY_ID+"'></span></div><div class='clear'></div>";
  57. }}
  58. cols.push(trunk);
  59. }
  60. _this.loadParams = {
  61. gradeId:gradeId
  62. };
  63. _this.listGrid = $("#dataGrid").quiGrid({
  64. columns: cols,
  65. url :$.pathname() + '/ws/scoreGrade/ScoreGradeService/getDetailScoreById',
  66. params: _this.loadParams,
  67. width:"100%",
  68. height:'auto',
  69. type:'post',
  70. onAfterShowData:function(data){
  71. initComplete();
  72. },
  73. usePager: false
  74. });
  75. _this.listGrid1 = $("#dataGrid1").quiGrid({
  76. columns: cols,
  77. url :$.pathname() + '/ws/scoreGrade/ScoreGradeService/getDetailScoreById',
  78. params: _this.loadParams,
  79. width:"100%",
  80. height:'auto',
  81. type:'post',
  82. onAfterShowData:function(data){
  83. initComplete();
  84. },
  85. usePager: false
  86. });
  87. $('#back').bind('click',function(){
  88. goback();
  89. });
  90. }
  91. };
  92. }();
  93. $(function() {
  94. ResultShow.init();
  95. });