Sfoglia il codice sorgente

Merge branch 'permission' of http://106.52.242.177:3000/askqvn/crm-app

zhangxin 2 mesi fa
parent
commit
d4f44f6837
2 ha cambiato i file con 37 aggiunte e 32 eliminazioni
  1. 25 25
      pages/person/cards/index.vue
  2. 12 7
      store/modules/user.js

+ 25 - 25
pages/person/cards/index.vue

@@ -232,37 +232,37 @@ export default {
232
     },
232
     },
233
 
233
 
234
     methods: {
234
     methods: {
235
-        // getCardData() {
236
-        //     uni.$u.api.getPersonCards().then(res => {
237
-        //       if (res.code === 200) {
238
-        //         this.cardData = res.data;
239
-        //       }
240
-        //     });
241
-        // },
242
-        // getClueList() {
243
-        //     uni.$u.api.getPersonLatestClue().then(res => {
244
-        //         if (res.code === 200) {
245
-        //             this.clueList = res.data;
246
-        //         }
247
-        //     });
248
-        // },
249
-        // getChartData() {
250
-        //     uni.$u.api.getPersonRanking().then(res => {
251
-        //         if (res.code === 200) {
252
-        //             this.chartData.categories = res.data.map(item => item.x);
253
-        //             this.chartData.series[0].data = res.data.map(item => item.y);
254
-        //         }
255
-        //     });
256
-        // },
235
+        getCardData() {
236
+            uni.$u.api.getPersonCards().then(res => {
237
+              if (res.code === 200) {
238
+                this.cardData = res.data;
239
+              }
240
+            });
241
+        },
242
+        getClueList() {
243
+            uni.$u.api.getPersonLatestClue().then(res => {
244
+                if (res.code === 200) {
245
+                    this.clueList = res.data;
246
+                }
247
+            });
248
+        },
249
+        getChartData() {
250
+            uni.$u.api.getPersonRanking().then(res => {
251
+                if (res.code === 200) {
252
+                    this.chartData.categories = res.data.map(item => item.x);
253
+                    this.chartData.series[0].data = res.data.map(item => item.y);
254
+                }
255
+            });
256
+        },
257
         // 跳转私有线索页面
257
         // 跳转私有线索页面
258
         toPrivateClue() {
258
         toPrivateClue() {
259
             uni.switchTab({ url: '/pages/privateClue/index' });
259
             uni.switchTab({ url: '/pages/privateClue/index' });
260
         },
260
         },
261
     },
261
     },
262
     mounted() {
262
     mounted() {
263
-        this.getCardData();
264
-        this.getClueList();
265
-        this.getChartData();
263
+        // this.getCardData();
264
+        // this.getClueList();
265
+        // this.getChartData();
266
     },
266
     },
267
 
267
 
268
 };
268
 };

+ 12 - 7
store/modules/user.js

@@ -53,9 +53,9 @@ export default {
53
 		SET_USERINFO: (state, data) => {
53
 		SET_USERINFO: (state, data) => {
54
 			state.userInfo = data;
54
 			state.userInfo = data;
55
 			// 动态设置 tabBar
55
 			// 动态设置 tabBar
56
-			setTimeout(() => {
57
-				setupTabBar(data);
58
-			}, 100);
56
+				setTimeout(() => {
57
+					setupTabBar(data);
58
+				}, 100);
59
 		},
59
 		},
60
 		SET_TOKEN: (state, data) => {
60
 		SET_TOKEN: (state, data) => {
61
 			state.token = data;
61
 			state.token = data;
@@ -169,10 +169,6 @@ export default {
169
 }
169
 }
170
 
170
 
171
 function setupTabBar(userInfo) {
171
 function setupTabBar(userInfo) {
172
-		if (!userInfo || !userInfo.roles) {
173
-			return tabBarDefault;
174
-		}
175
-	
176
 		const roles = userInfo.roles;
172
 		const roles = userInfo.roles;
177
 		// 我的 是所有用户都有的
173
 		// 我的 是所有用户都有的
178
 		// 如果是销售经理SALESMAN,则也展示询价中心、核价中心、仓库
174
 		// 如果是销售经理SALESMAN,则也展示询价中心、核价中心、仓库
@@ -183,10 +179,19 @@ function setupTabBar(userInfo) {
183
 			uni.setTabBarItem({ index: 2,visible: true });//仓库
179
 			uni.setTabBarItem({ index: 2,visible: true });//仓库
184
 			uni.setTabBarItem({ index: 3,visible: true });//询价中心
180
 			uni.setTabBarItem({ index: 3,visible: true });//询价中心
185
 			uni.setTabBarItem({ index: 4,visible: true });//核价中心
181
 			uni.setTabBarItem({ index: 4,visible: true });//核价中心
182
+
183
+			uni.setTabBarItem({ index: 0,visible: false });//首页
184
+			uni.setTabBarItem({ index: 1,visible: false });//线索公海
185
+			uni.setTabBarItem({ index: 5,visible: false });//销售线索
186
+			uni.setTabBarItem({ index: 6,visible: false });//接单中心
186
 		}else{
187
 		}else{
187
 			uni.setTabBarItem({ index: 0,visible: true });//首页
188
 			uni.setTabBarItem({ index: 0,visible: true });//首页
188
 			uni.setTabBarItem({ index: 1,visible: true });//线索公海
189
 			uni.setTabBarItem({ index: 1,visible: true });//线索公海
189
 			uni.setTabBarItem({ index: 5,visible: true });//销售线索
190
 			uni.setTabBarItem({ index: 5,visible: true });//销售线索
190
 			uni.setTabBarItem({ index: 6,visible: true });//接单中心
191
 			uni.setTabBarItem({ index: 6,visible: true });//接单中心
192
+
193
+			uni.setTabBarItem({ index: 2,visible: false });//仓库
194
+			uni.setTabBarItem({ index: 3,visible: false });//询价中心
195
+			uni.setTabBarItem({ index: 4,visible: false });//核价中心
191
 		}
196
 		}
192
 }
197
 }