Bladeren bron

客诉统计bug修改

wangxiaoming 7 jaren geleden
bovenliggende
commit
7d8ecc42ae
1 gewijzigde bestanden met toevoegingen van 27 en 6 verwijderingen
  1. 27 6
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/report/customer_report.ftl

+ 27 - 6
watero-rst-web/src/main/webapp/WEB-INF/views/cm/report/customer_report.ftl

@@ -60,6 +60,9 @@
 
     var period = "";
 
+    /*表示总数量*/
+    var ALL_NUM = 0;
+
     $(function (){
         showTime();
 
@@ -117,12 +120,15 @@
                 var typeList = data.returnMsg.complaintTypeInfoList;
                 var num = data.returnMsg.num;
 
+                ALL_NUM = data.returnMsg.num;
+
                 var arrayTile = new Array(); // 表格标题数组
                 arrayTile.push("日期");
                 arrayTile.push("类型");
                 arrayTile.push("数量");
                 arrayTile.push("类型");
                 arrayTile.push("数量");
+                arrayTile.push("百分比");
                 arrayTile.push("客诉问题");
                 arrayTile.push("数量");
                 arrayTile.push("百分比");
@@ -179,13 +185,14 @@
                 "width: 10%;",
                 "width: 12%;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
                 "width: 12%;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
+                "width: 6%;",
                 "width: 32%;text-align: left !important;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
                 "width: 10%;background: linear-gradient(to left, #fffcfc, #ff84d4);background-repeat: no-repeat;"
             ];
 
@@ -203,10 +210,10 @@
                             case 4:
                                 str += '<td class="text-c" style="'+ style_array[i] +'"><a href="javascript:void(0);" style="color: #06c;" onclick="showPieChart(' + table_array[index][i+1] + ',\'small\')">' + table_array[index][i] + '<a></td>';
                                 break;
-                            case 7:
+                            case 8:
                                 str += '<td class="text-c" style="'+ style_array[i] +'"><a href="javascript:void(0);" style="color: #06c;" onclick="to_customer_list(' + table_array[index][i+1] + ')">' + table_array[index][i] + '<a></td>';
                                 break;
-                            case 10:
+                            case 11:
                                 str += '<td class="text-c" style="'+ style_array[i] +'background-size: ' + table_array[index][i] + ' 100%;">' + table_array[index][i] + '</td>';
                                 break;
                             default:
@@ -228,6 +235,7 @@
 //            arrayColumn.push(3);
             arrayColumn.push(4);
             arrayColumn.push(5);
+
 //            arrayColumn.push(6);
 
             //合并单元格
@@ -243,12 +251,20 @@
                 if(tdIsStyle){
                     $(this).find("td").eq(3).css("display","none");
                 }
+
                 var td4Rowspan = $(this).find("td").eq(4).attr("rowspan");
                 var td4IsStyle = $(this).find("td").eq(4).css("display")=="none"
                 $(this).find("td").eq(6).attr("rowspan",td4Rowspan);
                 if(td4IsStyle){
                     $(this).find("td").eq(6).css("display","none");
                 }
+
+                var td8Rowspan = $(this).find("td").eq(4).attr("rowspan");
+                var td8IsStyle = $(this).find("td").eq(4).css("display")=="none"
+                $(this).find("td").eq(7).attr("rowspan",td8Rowspan);
+                if(td8IsStyle){
+                    $(this).find("td").eq(7).css("display","none");
+                }
             });
 
         },
@@ -270,7 +286,12 @@
                                     tb_array.push(allTableArray[i].complaintNum)
                                     tb_array.push(small.smallClassName);
                                     tb_array.push(small.smallClassId);
-                                    tb_array.push(small.smallClassNum);
+
+                                    tb_array.push(small.smallClassNum);    //二级分类总数除以总数
+
+                                    var x = (Math.round((small.smallClassNum/allTableArray[i].complaintNum) * 10000)/100).toFixed(2) + '%';
+                                    tb_array.push(x);
+
                                     tb_array.push(question.questionName);
                                     tb_array.push(question.questionId);
                                     tb_array.push(question.questionNum);