Sfoglia il codice sorgente

feat:权限添加ADMIN字符判断、线索公海询价完成刷新列表、仓库排版优化

zhangxin 1 mese fa
parent
commit
adf35d8982

+ 2 - 0
components/add-inquiry-dialog/index.vue

@@ -55,6 +55,7 @@ export default {
55 55
         },
56 56
 	},
57 57
     emits: ['submitSuccess'],
58
+    inject: ['refreshData'],
58 59
 	data() {
59 60
 		return {
60 61
 			showModal: false,
@@ -166,6 +167,7 @@ export default {
166 167
                 uni.$u.toast(this.type == 1 ? "询价成功" : "核价成功")
167 168
                 this.closeDialog()
168 169
                 this.$emit('submitSuccess')
170
+                if(this.type == 1 && this.clueId !== '') this.refreshData.resetData(); //线索公海页面需要刷新列表
169 171
             }).catch((err) => {
170 172
                 uni.$u.toast(err)
171 173
             })

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

@@ -2,7 +2,13 @@ import pullUpRefresh from "@/utils/pullUpRefresh";
2 2
 import dayjs from "dayjs";
3 3
 export default {
4 4
 	mixins: [pullUpRefresh],
5
-
5
+	provide() {
6
+		return {
7
+			refreshData: {
8
+				resetData: this.resetData
9
+			}
10
+		}
11
+	},
6 12
 	computed: {
7 13
 		currentIndex() {
8 14
 			return this.queryParams.type == 1 ? 0 : 1;
@@ -397,6 +403,11 @@ export default {
397 403
 				url: `/pages/clueDetail/index?clueId=${id}&name=${name}&type=${this.queryParams.type}`,
398 404
 			});
399 405
 		},
406
+		inquirySuccess() {
407
+			console.log('inquirySuccess');
408
+			
409
+			this.resetData();
410
+		},
400 411
 		async getList() {
401 412
 			const {
402 413
 				pageNum,

+ 1 - 5
pages/clue/post/index.vue

@@ -64,7 +64,7 @@
64 64
 			<image src='/static/publicClue/littlePlane.png' mode="aspectFit" class="sendOrder_img"></image>
65 65
 			<view>发单</view>
66 66
 		</view>
67
-		<add-inquiry-dialog ref="inquiryDialog" :clueId="clueId" :editOrAdd="editOrAdd" :editInfo="editInfo" @success="handleInquirySuccess" @cancel="handleInquiryCancel" :type="1"/>
67
+		<add-inquiry-dialog ref="inquiryDialog" :clueId="clueId" :editOrAdd="editOrAdd" :editInfo="editInfo" @cancel="handleInquiryCancel" :type="1"/>
68 68
 	</view>
69 69
 </template>
70 70
 
@@ -189,10 +189,6 @@ export default {
189 189
 				this.$refs.inquiryDialog.showDialog()
190 190
 			}
191 191
 		},
192
-		// 询价成功
193
-		handleInquirySuccess() {
194
-			this.$refs.inquiryDialog.closeDialog()
195
-		},
196 192
 		// 询价取消
197 193
 		handleInquiryCancel() {
198 194
 			this.$refs.inquiryDialog.closeDialog()

+ 1 - 1
pages/privateClue/index.vue

@@ -36,7 +36,7 @@
36 36
 			<show-emtry v-if="listData.length === 0"></show-emtry>
37 37
 			<view class="case_main_wrap" v-else>
38 38
 				<post v-for="(item,index) in listData" :key="item.id + index" :item="item" :dicts="dicts"
39
-					:type="queryParams.type" @click.native="handleToDetail(item)">
39
+					:type="queryParams.type" @click.native="handleToDetail(item)" @inquirySuccess="inquirySuccess">
40 40
 				</post>
41 41
 				<u-loadmore :status="finished ? 'nomore' : loadStatus" icon line />
42 42
 			</view>

+ 6 - 6
pages/wareHouse/components/edit.vue

@@ -9,7 +9,7 @@
9 9
                 </view>
10 10
             </u-navbar>
11 11
             <view class="form_list">
12
-                <u--form labelPosition="top" :model="formData" :rules="rules" ref="addForm" labelWidth="100%">
12
+                <u--form labelPosition="top" :model="formData" :rules="rules" ref="addForm" labelWidth="auto">
13 13
                     <u-form-item borderBottom class="u-form-item-col">
14 14
                         <u--textarea v-model="recognitionContent" placeholder='品牌:-
15 15
 来源:-
@@ -26,7 +26,7 @@
26 26
                                 @click="handlePasteRecognition(recognitionContent)"></u-button>
27 27
                         </view>
28 28
                     </u-form-item>
29
-                    <u-form-item label="商品图片" required prop="goodPicFileList" borderBottom>
29
+                    <u-form-item :label="'商品图片(' + (formData.goodPicFileList.length || 0) + '张)'" required prop="goodPicFileList" borderBottom>
30 30
                         <view class="imgs_scroll">
31 31
                             <ImgsRowScroll v-if="formData.goodPicFileList.length > 0" :isShowDeleteIcon="true"
32 32
                                 @deleteImgInfo="getDeleteGoodPicInfo" imgMode="aspectFill" :totalWidth="400"
@@ -83,7 +83,7 @@
83 83
                             @tabChange="handleTabChangeProductCondition" :colNum="2" mode="single" :echoInfo="echoInfoProductCondition">
84 84
                         </TabSelect>
85 85
                     </u-form-item>
86
-                    <u-form-item label="细节图" borderBottom>
86
+                    <u-form-item :label="'细节图(' + (formData.detailPicFileList.length || 0) + '张)'" borderBottom>
87 87
                         <!-- <view class="detail_pic_container"> -->
88 88
                         <!-- <view>
89 89
                                 <text class="tip">视频:</text>
@@ -175,7 +175,7 @@
175 175
                         <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员"
176 176
                             @selectPerson="handleSelectRecyclePerson"></PersonPicker>
177 177
                     </u-form-item>
178
-                    <u-form-item label="回收留底图" borderBottom>
178
+                    <u-form-item :label="'回收留底图(' + (formData.recycleBottomFileList.length || 0) + '张)'" borderBottom>
179 179
                         <view class="recycle_bottom_desc">
180 180
                             <u--textarea v-model="formData.recycleBottomDesc" clearable count autoHeight maxlength="250"
181 181
                                 height="100" confirmType="done"></u--textarea>
@@ -217,7 +217,7 @@
217 217
                         <u--input v-model="formData.cardYear" placeholder="不填写默认空白保卡" clearable
218 218
                             border="none"></u--input>
219 219
                     </u-form-item>
220
-                    <u-form-item label="保卡图片或独立编码照片留底(仅内部人员可见)" borderBottom>
220
+                    <u-form-item :label="'保卡图片或独立编码照片留底(' + (formData.productCardPicFileList.length || 0) + '张)'" borderBottom>
221 221
                         <view class="imgs_scroll">
222 222
                             <ImgsRowScroll v-if="formData.productCardPicFileList.length > 0" :isShowDeleteIcon="true"
223 223
                                 @deleteImgInfo="getDeleteProductCardPicInfo" imgMode="aspectFill" :totalWidth="400"
@@ -234,7 +234,7 @@
234 234
                         <u--input v-model="formData.productAttachment" placeholder="请输入" clearable
235 235
                             border="none"></u--input>
236 236
                     </u-form-item>
237
-                    <u-form-item label="备注(仅内部人员可见)" borderBottom>
237
+                    <u-form-item :label="'备注(' + (formData.productDescPicFileList.length || 0) + '张)'" borderBottom>
238 238
                         <view class="recycle_bottom_desc">
239 239
                             <u--textarea v-model="formData.productDesc" clearable count autoHeight maxlength="250"
240 240
                                 height="100" confirmType="done"></u--textarea>

+ 5 - 5
pages/wareHouse/index.vue

@@ -83,16 +83,16 @@
83 83
 								<view class="info-content">
84 84
 									<view class="goods-brand">
85 85
 										<view>
86
-											{{ goods.dictLabel || '' }}
86
+											{{ goods.dictLabel || '-' }}
87 87
 										</view>
88
-										<image v-if="goods.indentifyCode" src="../../static/icons/code.png"
88
+										<!-- <image v-if="goods.indentifyCode" src="../../static/icons/code.png"
89 89
 											class="code-icon" mode="aspectFill" lazy-load></image>
90 90
 										<view>
91 91
 											{{ goods.indentifyCode || '' }}
92
-										</view>
92
+										</view> -->
93 93
 									</view>
94
-									<text class="goods-name">{{ goods.model || '' }}</text>
95
-
94
+									<text class="goods-name">型号:{{ goods.model || '-' }}</text>
95
+									<text class="goods-name">编码:{{ goods.indentifyCode || '-' }}</text>
96 96
 									<view class="price-group">
97 97
 										<view class="price-item" v-if="isWareHouseRole">
98 98
 											<text class="price-type">成本价</text>

+ 2 - 1
pages/wareHouse/styles/index.scss

@@ -320,6 +320,7 @@
320 320
 
321 321
       .info-content {
322 322
         flex: 1;
323
+        line-height: 1.4;
323 324
 
324 325
         .goods-brand {
325 326
           font-size: 32rpx;
@@ -341,7 +342,7 @@
341 342
           font-size: 26rpx;
342 343
           color: #666666;
343 344
           display: block;
344
-          font-weight: 600;
345
+          font-weight: 550;
345 346
           line-height: 1.4;
346 347
           word-break: break-all;
347 348
         }

+ 1 - 8
store/modules/user.js

@@ -60,7 +60,7 @@ export default {
60 60
 			
61 61
 			const validRoles = [];
62 62
 			
63
-			const hasAdminRole = roles.some(role => role.roleKey === 'admin');
63
+			const hasAdminRole = roles.some(role => role.roleKey && role.roleKey.includes('admin' || 'ADMIN'));
64 64
 			const hasCrmRole = roles.some(role => role.roleKey && role.roleKey.includes('CRM'));
65 65
 			const hasWarehouser = roles.some(role => role.roleKey === 'WAREHOUSER');
66 66
 			const hasSalesman = roles.some(role => role.roleKey === 'SALESMAN');
@@ -92,13 +92,6 @@ export default {
92 92
 				});
93 93
 				const currentRole = validRoles[0] || '';
94 94
 				switch (currentRole) {
95
-					case 'admin':
96
-						// 展示首页、线索公海、销售线索、接单中心、我的
97
-						uni.setTabBarItem({ index: 0, visible: true }); // 首页
98
-						uni.setTabBarItem({ index: 1, visible: true }); // 线索公海
99
-						uni.setTabBarItem({ index: 5, visible: true }); // 销售线索
100
-						uni.setTabBarItem({ index: 6, visible: true }); // 接单中心
101
-						break;
102 95
 					case 'WAREandSALE':
103 96
 						// 展示仓库、核价中心、询价中心、我的
104 97
 						uni.setTabBarItem({ index: 2, visible: true }); // 仓库