d3946eb4765d48f5687b6e8f44dffdfd076feea0.svn-base 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 : 'LEVEL',showTitle:true,width : "20%"}];
  45. resultTrunk = resultTrunk.split(',');
  46. var len = resultTrunk.length;
  47. for(var i = 0;i< len;i++){
  48. var trunk = resultTrunk[i].split('$');
  49. var trunk = {display : trunk[1],name :'a'+trunk[0]+'$',width : "13%"}
  50. cols.push(trunk);
  51. }
  52. _this.loadParams = {
  53. gradeId:gradeId
  54. };
  55. _this.listGrid = $("#dataGrid").quiGrid({
  56. columns: cols,
  57. title:'各局整体得分率比较',
  58. url :$.pathname() + '/ws/scoreGrade/ScoreGradeService/getScoreGradeId',
  59. params: _this.loadParams,
  60. width:'100%',
  61. height:'auto',
  62. type:'post',
  63. onAfterShowData:function(data){
  64. // initComplete();
  65. },
  66. usePager: false
  67. });
  68. $('#backback').bind('click',function(){
  69. goback();
  70. });
  71. }
  72. };
  73. }();
  74. $(function() {
  75. ResultShow.init();
  76. /* $('#back').bind('click',function(){
  77. goback();
  78. });*/
  79. });