chenrj-PC\chenrj 9 anni fa
parent
commit
a58891a4e5

+ 16 - 9
VisualInspection/js/statistics/assess_ranking.js

@@ -44,14 +44,14 @@ function getEmployeeInfos(url,param){
     post_common_service( url,param,function(data){
         var strTbody='';
         for(var i=0;i<data.length;i++){
-            strTbody+="<tr><td>"+(i+1)+"</td><td>"+data[i].user.fee_station_name+"</td>"
-                +"<td>"+data[i].user.truename+"</td><td>"+"</td>"
-                +"<td>"+data[i].user.workno+"</td><td>"+ getItemScore(data[i], '环境') +"</td>"
-                +"<td>"+getItemScore(data[i], '仪容仪表')+"</td><td>"+getItemScore(data[i], '表情')+"</td>"
-                +"<td>"+getItemScore(data[i], '动作')+"</td><td>"+getItemScore(data[i], '文明用语')+"</td>"
-                +"<td>"+ getItemScore(data[i], '工作纪律') +"</td><td>"+data[i].check_all_score+"</td>"
-                +"<td>"+filter(data[i].checked_num,'0')+"</td><td>"+"</td>"
-                +"<td>"+"</td><td>"+"</td></tr>";
+            strTbody+="<tr><td width='67px;'>"+(i+1)+"</td><td width='87px;'>"+data[i].user.fee_station_name+"</td>"
+                +"<td width='67px;'>"+data[i].user.truename+"</td><td width='67px;'>"+"</td>"
+                +"<td width='77px;'>"+data[i].user.workno+"</td><td width='67px;'>"+ getItemScore(data[i], '环境') +"</td>"
+                +"<td width='67px;'>"+getItemScore(data[i], '仪容仪表')+"</td><td width='67px;'>"+getItemScore(data[i], '表情')+"</td>"
+                +"<td width='67px;'>"+getItemScore(data[i], '动作')+"</td><td width='67px;'>"+getItemScore(data[i], '文明用语')+"</td>"
+                +"<td width='67px;'>"+ getItemScore(data[i], '工作纪律') +"</td><td width='67px;'>"+data[i].check_all_score+"</td>"
+                +"<td width='67px;'>"+filter(data[i].checked_num,'0')+"</td><td width='67px;'>"+average(data[i])+"</td>"
+                +"<td width='75px;'>"+"</td><td>"+"</td></tr>";
         }
        $(".table-tbody").append(strTbody);   
     },function(error){
@@ -59,6 +59,14 @@ function getEmployeeInfos(url,param){
     });
 }
 
+function average(obj){
+    if(filter(obj.checked_num,'0') == 0){
+        return 0 ;
+    }else{
+        return obj.check_all_score / filter(obj.checked_num,'1')
+    }
+}
+
 /**
  * 过滤undefined
  * @param {*} value 
@@ -85,7 +93,6 @@ function getItemScore(obj, check_item_name){
 
     for(var i=0;i<names.length ;i++){
         if( names[i].indexOf(check_item_name) > -1){
-            console.log(obj);
             return scores[i] ;
         }
     }

+ 43 - 20
VisualInspection/view/statistics/emp_ranking.html

@@ -24,33 +24,56 @@
     <div class="table-title"><span>温馨服务考核情况反馈表(所有员工排名)</span></div>
 
     <div class="row">
-          <!-- 使用一个div来显示数据表格 -->
-          <div class="datatable" data-checkable="false" data-sortable="false">
-              <div class="table-head" >
-                  <table border="1" width="100%" height="90px" align="center">
-                      <thead class="table-thead" align="center">
-                  <tr>
-                  <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="67px">站名</th><th rowspan="2" width="67px">姓名</th>
-                  <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="67px">工号</th><th colspan="7" height="40px">考核扣分</th>
-                  <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th>
-                  <th rowspan="2" width="75px">服务评价</th><th rowspan="2" width="75px">备注</th>
-                  </tr>
-                  <tr> 
-                  <th width="67px">环境卫生</th><th width="67px">仪容仪表</th><th width="67px">表情</th>
-                  <th width="67px">收费动作</th><th width="67px">文明用语</th><th width="67px">工作纪律</th>
-                  <th width="67px">扣分合计</th>
-                  </tr>
-                      </thead>
-                      <tbody class="table-tbody" style="background:white" align="center">
+          <!-- 使用一个div来显示数据表格   -->
+          <div class="datatable" data-checkable="false" style="margin-bottom: 0px;margin-right:10px;" data-sortable="false">
+                <div class="table-head"  > 
+                    <table border="1" width="100%"  align="center">
+                        <thead class="table-thead" align="center">
+                            <tr>
+                            <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="87px">站名</th><th rowspan="2" width="67px">姓名</th>
+                            <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="77px">工号</th><th colspan="7" height="40px">考核扣分</th>
+                            <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th>
+                            <th rowspan="2" width="75px">服务评价</th><th rowspan="2">备注</th>
+                            </tr>
+                            <tr> 
+                            <th width="67px">环境卫生</th><th width="67px">仪容仪表</th><th width="67px">表情</th>
+                            <th width="67px">收费动作</th><th width="67px">文明用语</th><th width="67px">工作纪律</th>
+                            <th width="67px">扣分合计</th>
+                            </tr>
+                        </thead>
+                       
 
-                      </tbody>
+                    </table>
+                </div>
+            </div>
+            <div id="scrollTable" style="height:300px;overflow:scroll;">
+                 <table style="border-top:0;" border="1" width="100%"  align="center">
+                    <thead class="table-thead" style="height:0;" align="center">
+                        <tr style="display:none;">
+                            <th rowspan="2" width="67px;"></th><th rowspan="2" width="77px"></th><th rowspan="2" width="67px"></th>
+                            <th rowspan="2" width="67px"></th><th rowspan="2" width="67px"></th><th colspan="7" height="40px"></th>
+                            <th rowspan="2" width="67px"></th><th rowspan="2" width="67px"></th>
+                            <th rowspan="2" width="75px"></th><th rowspan="2" width="75px"></th>
+                        </tr>
+                        <tr style="display:none;"> 
+                            <th width="67px"></th><th width="67px"></th><th width="67px"></th>
+                            <th width="67px"></th><th width="67px"></th><th width="67px"></th>
+                            <th width="67px"></th>
+                        </tr>
+                    </thead>
+                    <tbody class="table-tbody" style="background:white; " align="center">
 
-                  </table></div>
+                    </tbody>   
+                 </table>  
             </div>
     </div>
 </div>
 <script>
     $(document).ready(function() {
+
+        // 设置滚动表格的高度
+        $("#scrollTable").height(  document.body.clientHeight  - 360 );
+
         // 仅选择日期
         $("#start-time").datetimepicker(
         {