Kaynağa Gözat

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

zhangxin 2 ay önce
ebeveyn
işleme
e3dce0540e

+ 84 - 34
pages.json

@@ -302,6 +302,33 @@
302 302
 				"navigationBarBackgroundColor": "#108cff",
303 303
 				"navigationStyle": "custom"
304 304
 			}
305
+		},
306
+		{
307
+			"path": "pages/inquiry/index",
308
+			"style": {
309
+				"navigationBarTitleText": "询价中心",
310
+				"enablePullDownRefresh": false,
311
+				"navigationBarBackgroundColor": "#108cff",
312
+				"navigationStyle": "custom"
313
+			}
314
+		},
315
+		{
316
+			"path": "pages/inquiry/add",
317
+			"style": {
318
+				"navigationBarTitleText": "询价中心-新增",
319
+				"enablePullDownRefresh": false,
320
+				"navigationBarBackgroundColor": "#108cff",
321
+				"navigationStyle": "custom"
322
+			}
323
+		},
324
+		{
325
+			"path": "pages/verification/index",
326
+			"style": {
327
+				"navigationBarTitleText": "核价中心",
328
+				"enablePullDownRefresh": false,
329
+				"navigationBarBackgroundColor": "#108cff",
330
+				"navigationStyle": "custom"
331
+			}
305 332
 		}
306 333
 	],
307 334
 	"globalStyle": {
@@ -317,40 +344,63 @@
317 344
 		"height": "70px",
318 345
 		"fontSize": "12px",
319 346
 		"list": [
320
-		{
321
-			"text": "首页",
322
-			"pagePath": "pages/index/index",
323
-			"iconPath": "static/tabs/home.png",
324
-			"selectedIconPath": "static/tabs/home1.png"
325
-		},
326
-		{
327
-			"text": "线索公海",
328
-			"pagePath": "pages/publicClue/index",
329
-			"iconPath": "static/tabs/public.png",
330
-			"selectedIconPath": "static/tabs/public1.png"
331
-		}, 
332
-		{
333
-			"text": "仓库",
334
-			"pagePath": "pages/wareHouse/index",
335
-			"iconPath": "static/tabs/warehouse.png",
336
-			"selectedIconPath": "static/tabs/warehouse-active.png"
337
-		}, 
338
-		{
339
-			"text": "销售线索",
340
-			"pagePath": "pages/privateClue/index",
341
-			"iconPath": "static/tabs/private.png",
342
-			"selectedIconPath": "static/tabs/private1.png"
343
-		}, {
344
-			"text": "接单中心",
345
-			"pagePath": "pages/order/index",
346
-			"iconPath": "static/tabs/order.png",
347
-			"selectedIconPath": "static/tabs/order1.png"
348
-		},{
349
-			"text": "我的",
350
-			"pagePath": "pages/person/index",
351
-			"iconPath": "static/tabs/user.png",
352
-			"selectedIconPath": "static/tabs/user1.png"
353
-		}]
347
+			{
348
+				"text": "首页",
349
+				"pagePath": "pages/index/index",
350
+				"iconPath": "static/tabs/home.png",
351
+				"selectedIconPath": "static/tabs/home1.png",
352
+				"visible": false
353
+			},
354
+			{
355
+				"text": "线索公海",
356
+				"pagePath": "pages/publicClue/index",
357
+				"iconPath": "static/tabs/public.png",
358
+				"selectedIconPath": "static/tabs/public1.png",
359
+				"visible": false
360
+			},
361
+			{
362
+				"text": "仓库",
363
+				"pagePath": "pages/wareHouse/index",
364
+				"iconPath": "static/tabs/warehouse.png",
365
+				"selectedIconPath": "static/tabs/warehouse1.png",
366
+				"visible": false
367
+			},
368
+			{
369
+				"text": "询价中心",
370
+				"pagePath": "pages/inquiry/index",
371
+				"iconPath": "static/tabs/xunjia.png",
372
+				"selectedIconPath": "static/tabs/xunjia1.png",
373
+				"visible": false
374
+			},
375
+			{
376
+				"text": "核价中心",
377
+				"pagePath": "pages/verification/index",
378
+				"iconPath": "static/tabs/hejia.png",
379
+				"selectedIconPath": "static/tabs/hejia1.png",
380
+				"visible": false
381
+			},
382
+			{
383
+				"text": "销售线索",
384
+				"pagePath": "pages/privateClue/index",
385
+				"iconPath": "static/tabs/private.png",
386
+				"selectedIconPath": "static/tabs/private1.png",
387
+				"visible": false		
388
+			}, 
389
+			{
390
+				"text": "接单中心",
391
+				"pagePath": "pages/order/index",
392
+				"iconPath": "static/tabs/order.png",
393
+				"selectedIconPath": "static/tabs/order1.png",
394
+				"visible": false
395
+			}, 
396
+			{
397
+				"text": "我的",
398
+				"pagePath": "pages/person/index",
399
+				"iconPath": "static/tabs/user.png",
400
+				"selectedIconPath": "static/tabs/user1.png",
401
+				"visible": true
402
+			}
403
+		]
354 404
 	},
355 405
 	"uniIdRouter": {},
356 406
 	"easycom": {

+ 1 - 0
pages/clue/mixins/clue.js

@@ -270,6 +270,7 @@ export default {
270 270
 					v.repetitionOperWeixinName = result;
271 271
 				}
272 272
 			})
273
+			
273 274
 			return rows;
274 275
 		}
275 276
 	}

+ 22 - 2
pages/clue/post/index.vue

@@ -26,11 +26,14 @@
26 26
 			</view>
27 27
 			<view class="info">
28 28
 				<view class="createTime">{{ item.createTime }}</view>
29
+			</view>
30
+			<view class="info">
29 31
 				<view>{{ item.appName }}</view>
30 32
 			</view>
31 33
 			<view class="info">
32
-				<view class="owner" style="margin-right: 20px;">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}
33
-				</view>
34
+				<view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
35
+			</view>
36
+			<view class="info">
34 37
 				<view class="operation">运营人 {{ item.clueOperationName ? item.clueOperationName : "-" }}</view>
35 38
 			</view>
36 39
 		</view>
@@ -47,6 +50,10 @@
47 50
 				</view>
48 51
 			</view>
49 52
 		</view>
53
+		<view class="sendOrder inquiry" @click.stop="handleInquiry(item)">
54
+			<image src='/static/publicClue/inquiry.png' mode="aspectFit" class="sendOrder_img"></image>
55
+			<view>询价</view>
56
+		</view>
50 57
 		<view class="sendOrder" @click.stop="handleSendOrder(item)">
51 58
 			<image src='/static/publicClue/littlePlane.png' mode="aspectFit" class="sendOrder_img"></image>
52 59
 			<view>发单</view>
@@ -146,6 +153,12 @@ export default {
146 153
 				}
147 154
 			}
148 155
 		},
156
+		// 询价
157
+		async handleInquiry(item) {
158
+			uni.navigateTo({
159
+				url: `/pages/inquiry/add?clueId=${item.id}`
160
+			})
161
+		},
149 162
 	},
150 163
 }
151 164
 </script>
@@ -222,6 +235,7 @@ export default {
222 235
 	}
223 236
 
224 237
 
238
+
225 239
 	.sendOrder {
226 240
 		width: 50px;
227 241
 		height: 50px;
@@ -247,5 +261,11 @@ export default {
247 261
 			height: 20px;
248 262
 		}
249 263
 	}
264
+	.inquiry {
265
+		right: 140rpx;
266
+		color: #2563eb;
267
+		border: 1px solid #2563eb;
268
+		background-color: #fff;
269
+	}
250 270
 }
251 271
 </style>

+ 25 - 0
pages/inquiry/add.vue

@@ -0,0 +1,25 @@
1
+<template>
2
+    <view class="add_wrap">
3
+        <view class="container">
4
+			新增
5
+        </view>
6
+    </view>
7
+</template>
8
+<script>
9
+    export default {
10
+        data() {
11
+            return {
12
+                clueId: ''
13
+            }
14
+        },
15
+        onLoad(options) {
16
+            console.log(options);
17
+            
18
+            this.clueId = options.clueId
19
+        }
20
+    }
21
+</script>
22
+
23
+<style lang="scss">
24
+    @import "./styles/index.scss";
25
+</style>

+ 12 - 0
pages/inquiry/index.vue

@@ -0,0 +1,12 @@
1
+<template>
2
+    <view class="inquiry_wrap">
3
+        <view class="container">
4
+			<u-navbar class="nav-bar" title="询价中心" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
5
+        </view>
6
+    </view>
7
+</template>
8
+<script></script>
9
+
10
+<style lang="scss">
11
+    @import "./styles/index.scss";
12
+</style>

+ 0 - 0
pages/inquiry/styles/add.scss


+ 0 - 0
pages/inquiry/styles/index.scss


+ 1 - 1
pages/publicClue/index.vue

@@ -75,7 +75,7 @@
75 75
 		mixins: [clue],
76 76
 		onLoad() {
77 77
 			this.queryParams.type = 1;
78
-		},
78
+		}
79 79
 	}
80 80
 </script>
81 81
 

+ 12 - 0
pages/verification/index.vue

@@ -0,0 +1,12 @@
1
+<template>
2
+    <view class="verification_wrap">
3
+        <view class="container">
4
+			<u-navbar class="nav-bar" title="核价中心" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
5
+        </view>
6
+    </view>
7
+</template>
8
+<script></script>
9
+
10
+<style lang="scss">
11
+	@import "./styles/index.scss";
12
+</style>

+ 0 - 0
pages/verification/styles/index.scss


BIN
static/publicClue/inquiry.png


BIN
static/tabs/hejia.png


BIN
static/tabs/hejia1.png


static/tabs/warehouse-active.png → static/tabs/warehouse1.png


BIN
static/tabs/xunjia.png


BIN
static/tabs/xunjia1.png


+ 27 - 0
store/modules/user.js

@@ -52,6 +52,10 @@ export default {
52 52
 		},
53 53
 		SET_USERINFO: (state, data) => {
54 54
 			state.userInfo = data;
55
+			// 动态设置 tabBar
56
+			setTimeout(() => {
57
+				setupTabBar(data);
58
+			}, 100);
55 59
 		},
56 60
 		SET_TOKEN: (state, data) => {
57 61
 			state.token = data;
@@ -162,4 +166,27 @@ export default {
162 166
 			})
163 167
 		},
164 168
 	}
169
+}
170
+
171
+function setupTabBar(userInfo) {
172
+		if (!userInfo || !userInfo.roles) {
173
+			return tabBarDefault;
174
+		}
175
+	
176
+		const roles = userInfo.roles;
177
+		// 我的 是所有用户都有的
178
+		// 如果是销售经理SALESMAN,则也展示询价中心、核价中心、仓库
179
+		// 如果是其他角色,则也展示首页、线索公海、接单中心
180
+		// 下标index从0开始
181
+		const hasSalesmanRole = roles.some(role => role.roleKey === 'SALESMAN');
182
+		if (hasSalesmanRole) {
183
+			uni.setTabBarItem({ index: 2,visible: true });//仓库
184
+			uni.setTabBarItem({ index: 3,visible: true });//询价中心
185
+			uni.setTabBarItem({ index: 4,visible: true });//核价中心
186
+		}else{
187
+			uni.setTabBarItem({ index: 0,visible: true });//首页
188
+			uni.setTabBarItem({ index: 1,visible: true });//线索公海
189
+			uni.setTabBarItem({ index: 5,visible: true });//销售线索
190
+			uni.setTabBarItem({ index: 6,visible: true });//接单中心
191
+		}
165 192
 }