Browse Source

界面权限更新

flower_bs 1 month ago
parent
commit
7852b1fde4

+ 3 - 3
data_base/test_permission.py

@@ -6,8 +6,8 @@ from datetime import datetime
 import sys
 def setup_django():
     """设置Django环境"""
-    project_path = "D:/Document/code/vue/greater_wms"
-    # project_path = "D:/code/vue/greater_wms"
+    # project_path = "D:/Document/code/vue/greater_wms"
+    project_path = "D:/code/vue/greater_wms"
     sys.path.append(project_path)
     os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'greaterwms.settings')
     django.setup()
@@ -104,7 +104,7 @@ PAGES = [
     {"primary_page":"warehouse","path": "/warehouse/product", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},
     
     # 员工管理
-    {"primary_page": "staff", "path": "/permission/roles", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},
+    {"primary_page": "staff", "path": "/staff/roles", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},
     {"primary_page":"staff","path": "/staff/stafflist", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},
     {"primary_page":"staff","path": "/staff/stafflist_check_code", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},
     {"primary_page":"staff","path": "/staff/stafftype", "components": ["view", "edit", "add", "delete", "export", "confirm","adjust","download"]},

+ 2 - 2
staff/views.py

@@ -100,7 +100,7 @@ class APIViewSet(viewsets.ModelViewSet):
 
     def get_serializer_class(self):
 
-        staff_type = ListModel.objects.filter(openid=self.request.auth.openid, is_delete=False).first().staff_type
+        staff_type = ListModel.objects.filter(appid=self.request.auth.appid, is_delete=False).first().staff_type
         if staff_type not in ['admin', '主管', '管理员','经理']:
             if self.action in ['list', 'retrieve', 'destroy']:
                 return serializers.userStaffGetSerializer
@@ -467,7 +467,7 @@ class RolePermissionViewSet(viewsets.ViewSet):
             {"primary_page": "warehouse", "path": "/warehouse/boundbusiness", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
             {"primary_page": "warehouse", "path": "/warehouse/status", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
             {"primary_page": "warehouse", "path": "/warehouse/product", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
-            {"primary_page": "staff", "path": "/permission/roles", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
+            {"primary_page": "staff", "path": "/staff/roles", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
             {"primary_page": "staff", "path": "/staff/stafflist", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
             {"primary_page": "staff", "path": "/staff/stafflist_check_code", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},
             {"primary_page": "staff", "path": "/staff/stafftype", "components": ["view", "edit", "add", "delete", "export", "confirm", "adjust", "download"]},

+ 1 - 1
templates/src/pages/staff/staff.vue

@@ -54,7 +54,7 @@
             <!-- 人员管理 -->
             <transition appear enter-active-class="animated zoomIn">
           <q-route-tab
-                v-if="hasPermission('permission')"
+                v-if="hasPermission('roles')"
                 name="permission"
                 :label="'人员管理'"
                 icon="perm_identity"

+ 6 - 6
templates/src/pages/stock/stock.vue

@@ -29,7 +29,7 @@
             </transition>
 
             <!-- 空仓位 -->
-            <transition appear enter-active-class="animated zoomIn">
+            <!-- <transition appear enter-active-class="animated zoomIn">
               <q-route-tab
                 v-if="hasPermission('emptybin')"
                 name="emptybin"
@@ -38,10 +38,10 @@
                 :to="{ name: 'emptybin' }"
                 exact
               />
-            </transition>
+            </transition> -->
 
             <!-- 占用仓位 -->
-            <transition appear enter-active-class="animated zoomIn">
+            <!-- <transition appear enter-active-class="animated zoomIn">
               <q-route-tab
                 v-if="hasPermission('occupiedbin')"
                 name="occupiedbin"
@@ -50,7 +50,7 @@
                 :to="{ name: 'occupiedbin' }"
                 exact
               />
-            </transition>
+            </transition> -->
 
             <!-- 库存日志 -->
             <transition appear enter-active-class="animated zoomIn">
@@ -65,7 +65,7 @@
             </transition>
 
             <!-- 手工盘点 -->
-            <transition appear enter-active-class="animated zoomIn">
+            <!-- <transition appear enter-active-class="animated zoomIn">
               <q-route-tab
                 v-if="hasPermission('handcount')"
                 name="handcount"
@@ -74,7 +74,7 @@
                 :to="{ name: 'handcount' }"
                 exact
               />
-            </transition>
+            </transition> -->
           </q-tabs>
         </div>
       </div>