From caf1f99e718ca2ac07fa64e7a71a6d7fa88b8989 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 20 十二月 2023 17:57:18 +0800
Subject: [PATCH] 报价单列表和对应产品列表的数据调试

---
 src/components/layout/components/appsidebar/index.vue |   90 ++++++++++++++++++++++++++------------------
 1 files changed, 53 insertions(+), 37 deletions(-)

diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue
index db1ae8b..7be1f15 100644
--- a/src/components/layout/components/appsidebar/index.vue
+++ b/src/components/layout/components/appsidebar/index.vue
@@ -4,60 +4,51 @@
     <div class="box">
       <el-menu
         router
+        unique-opened
         :default-active="$route.path"
         class="el-menu-vertical-demo"
         @select="handleOpen"
         @close="handleClose"
-        background-color="#545c64"
-        text-color="#fff"
-        active-text-color="#ffd04b"
+        background-color="#314255"
+        text-color="#bfcbd9"
+        active-text-color="#fff"
       >
-        <el-submenu index="">
+        <el-submenu v-for="item in menus" :key="item.id" :index="item.id.toString()" >
+          <template slot="title">
+            <i class="el-icon-money icon"></i>
+            <span>{{ item.title }}</span>
+          </template>
+          <el-menu-item v-for="itm in item.children" :key="itm.id" :index="itm.path">{{ itm.title }}</el-menu-item>
+          
+          <!-- <el-menu-item index="/client/salesLead">閿�鍞嚎绱�</el-menu-item>
+          <el-menu-item index="/client/clientManage">瀹㈡埛绠$悊</el-menu-item>
+          <el-menu-item index="/client/contacts">鑱旂郴浜�</el-menu-item>
+          <el-menu-item index="/client/followupRecords">璺熻繘璁板綍</el-menu-item> -->
+        </el-submenu>
+        
+
+        <!-- <el-submenu index="4">
           <template slot="title">
             <i class="el-icon-location"></i>
-            <span>瀹㈡埛绠$悊</span>
+            <span>鍚庡彴閰嶇疆</span>
           </template>
-          <el-menu-item index="/custom/salesLead">閿�鍞嚎绱�</el-menu-item>
-          <el-menu-item index="/custom/customManage">瀹㈡埛绠$悊</el-menu-item>
-          <el-menu-item index="/custom/contacts">鑱旂郴浜�</el-menu-item>
-          <el-menu-item index="/custom/followupRecords">璺熻繘璁板綍</el-menu-item>
-        </el-submenu>
-        <el-submenu index="2">
-          <template slot="title">
-            <i class="el-icon-location"></i>
-            <span>閿�鍞鐞�</span>
-          </template>
-          <el-menu-item index="/sales/salesOpportunity">閿�鍞満浼�</el-menu-item>
-          <el-menu-item index="/sales/quotation">鎶ヤ环鍗�</el-menu-item>
-          <el-menu-item index="/sales/masterOrder">閿�鍞�诲崟</el-menu-item>
-          <el-menu-item index="/sales/subOrder">閿�鍞瓙鍗�</el-menu-item>
-          <el-menu-item index="/sales/salesDetails">閿�鍞槑缁嗗崟</el-menu-item>
-          <el-menu-item index="/sales/salesReturn">閿�鍞��璐у崟</el-menu-item>
-          <el-menu-item index="/sales/refundForm">閿�鍞��娆惧崟</el-menu-item>
-          <el-menu-item index="/sales/contractManage">鍚堝悓绠$悊</el-menu-item>
-          <el-menu-item index="/sales/productPlan">鐢熶骇璁″垝</el-menu-item>
-        </el-submenu>
-        <el-submenu index="3">
-          <template slot="title">
-            <i class="el-icon-location"></i>
-            <span>鏈嶅姟绠$悊</span>
-          </template>
-          <el-menu-item index="/service/serviceContract">鏈嶅姟鍚堝悓</el-menu-item>
-          <el-menu-item index="/service/orderManage">宸ュ崟绠$悊</el-menu-item>
-          <el-menu-item index="/service/serviceFollowup">鏈嶅姟鍥炶鍗�</el-menu-item>
-          <el-menu-item index="/service/serviceFeeManage">鏈嶅姟鏀惰垂绠$悊</el-menu-item>
-        </el-submenu>
+          <el-menu-item index="/backgroundConfig/memberManage">鎴愬憳绠$悊</el-menu-item>
+          <el-menu-item index="/backgroundConfig/rolePermssion">瑙掕壊鏉冮檺</el-menu-item>
+        </el-submenu> -->
       </el-menu>
     </div>
   </div>
 </template>
 
 <script>
+import {getMenuTreeByRole} from "@/api/menus/index"
 export default {
   name: "AppSidebar",
   props: {},
   data() {
-    return {}
+    return {
+      menus:[]
+    }
   },
   watch: {
     // $route: {
@@ -67,14 +58,39 @@
   },
   created() {
     this.initNavMenu()
+    this.getMenuTreeByRole()
   },
   methods: {
+    getMenuTreeByRole(){
+      getMenuTreeByRole().then((res)=>{
+        console.log(res.data.list,"crm鑿滃崟")
+        res.data.list.map((item)=>{
+          if(item.systemType===2){
+            let newList= JSON.parse(JSON.stringify([...item.menus]))
+            // 闅愯棌浜� 鐢熸垚璁″垝 鍜� 鏈嶅姟鏀惰垂绠$悊妯″潡
+            if(newList[1]){
+              const found = newList[1].children.find(obj => obj.title === "鐢熸垚璁″垝")
+              if(found){
+                newList[1].children=[...newList[1].children.slice(0, -1)];  
+              }
+            }
+            if(newList[2]){
+              const found1 = newList[2].children.find(obj => obj.title === "鏈嶅姟鏀惰垂绠$悊")
+              if(found1){
+                newList[2].children=[...newList[2].children.slice(0, -1)];  
+              }
+            }
+            this.menus=newList
+          }
+        }) 
+      })
+    },
     // 鐩戝惉璺敱
     initNavMenu() {
       // console.log(this.$route.name)
     },
     handleOpen(index) {
-      console.log("aaa", index)
+      console.log(index)
     },
     handleClose() {}
   }

--
Gitblit v1.8.0