Răsfoiți Sursa

添加收费员权限

minitiger 8 ani în urmă
părinte
comite
ec73e5ba3d

+ 9 - 2
VisualInspection/js/statistics/change_attendance.js

@@ -17,12 +17,16 @@ $(function(){
             dept = getCurrentUser().organid;     
         }
         $("#fs_station").val(dept);
+        var userId;
+        if (hasRole("ROLE_STATION")) {
+            userId = getCurrentUser().id;
+        }
         // 初始化收费站下的人数
         getFsEmployee(GV("#fs_station"),function(obj){
             $("#fs_employee").html(obj);
             // 检索
             getFsWorkInfo(0);
-        });
+        },userId);
     });
 
     $.jeDate("#sel_month",{
@@ -190,5 +194,8 @@ function setVisit(){
 	}
 	if(roleContains("ROAD_MANAGER")){
 		$("#center_manage").attr("disabled","disabled");
-	}
+    }
+    if (hasRole("ROLE_STATION")) {
+        $("#fs_employee").attr("disabled", "disabled");
+    }
 }

+ 9 - 2
VisualInspection/js/statistics/common_attendance.js

@@ -22,12 +22,16 @@ $(function(){
         dept = getCurrentUser().organid;     
         }
         $("#fs_station").val(dept);
+        var userId;
+        if (hasRole("ROLE_STATION")) {
+            userId = getCurrentUser().id;
+        }
         // 初始化收费站下的人数
         getFsEmployee(GV("#fs_station"),function(obj){
             $("#fs_employee").html(obj);
             // 检索
             getFsWorkInfo(0);
-        });
+        },userId);
     });
 
     // 当初始化月份值
@@ -194,5 +198,8 @@ function setVisit(){
 	}
 	if(roleContains("ROAD_MANAGER")){
 		$("#center_manage").attr("disabled","disabled");
-	}
+    }
+    if (hasRole("ROLE_STATION")) {
+        $("#fs_employee").attr("disabled", "disabled");
+    }
 }

+ 6 - 2
VisualInspection/js/statistics/common_statistic.js

@@ -50,7 +50,7 @@ function getD(date){
  * param: fs_station_id , func 异步回调
  * return: String , List Option
  */
-function getFsEmployee(fs_station_id , func){ 
+function getFsEmployee(fs_station_id , func, selectId){ 
     var param = {
             "organid":fs_station_id
     }
@@ -59,7 +59,11 @@ function getFsEmployee(fs_station_id , func){
         if(data.length > 0){
             resultStr = "<option value=''>全部</option>";  
             for(var i=0;i<data.length;i++){
-                resultStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";  
+                if(selectId == data[i].id){
+                    resultStr += "<option value="+data[i].id+" selected='selected'>"+data[i].truename+"</option>";  
+                }else{
+                    resultStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";  
+                }
             }
         }
         func(resultStr);

+ 13 - 1
VisualInspection/js/statistics/personal_data_statistics.js

@@ -282,10 +282,18 @@ $(function() {
         }
         post_common_service("user/getFsUserList", param, function(data) {
             if (data.length != 0) {
+                var userId;
+                if (hasRole("ROLE_STATION")) {
+                    userId = getCurrentUser().id;
+                }
                 for (var i = 0; i < data.length; i++) {
                     for (var j = 33; j <= 53; j++) {
                         if (select_road == j) {
-                            tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
+                            if(data[i].id==userId){
+                                tempStr += "<option value=" + data[i].id + " selected='selected'>" + data[i].truename + "</option>";
+                            }else{
+                                tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
+                            }
                         }
                     }
                     sec.innerHTML = tempStr;
@@ -496,4 +504,8 @@ function setVisit() {
     if (roleContains("STATION")) {
         $("#select-dept").attr("disabled", "disabled");
     }
+
+    if (hasRole("ROLE_STATION")) {
+        $("#select-personal").attr("disabled", "disabled");
+    }
 }