Browse Source

限制下单系统-订单管理: 只有采购角色才可以进行新建订单

lxf 1 year ago
parent
commit
f7d6500b1d
1 changed files with 16 additions and 4 deletions
  1. 16 4
      src/views/subsidiary/order/management/index.vue

+ 16 - 4
src/views/subsidiary/order/management/index.vue

@@ -9,10 +9,12 @@
         :searchConfig="searchConfig"
         highlight-current-row
         :action-list="[
-          {
-            text: '新建订单',
-            action: () => clickAddOrder(),
-          },
+          judgeRoles()
+            ? {
+                text: '新建订单',
+                action: () => clickAddOrder(),
+              }
+            : {},
         ]"
         @get-list="getList"
         @clickReset="clickReset">
@@ -451,6 +453,16 @@ watch(refreshStore().refresh, (val) => {
     getList();
   }
 });
+const judgeRoles = () => {
+  let status = false;
+  if (proxy.useUserStore().user.roles && proxy.useUserStore().user.roles.length > 0) {
+    let list = proxy.useUserStore().user.roles.filter((item) => ["purchasingOfficer", "sypurchasing", "bzpurchasing"].includes(item.roleKey));
+    if (list && list.length > 0) {
+      status = true;
+    }
+  }
+  return status;
+};
 </script>
 
 <style lang="scss" scoped>