Procházet zdrojové kódy

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

zhangxin před 1 měsícem
rodič
revize
adf35d8982

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

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

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

@@ -2,7 +2,13 @@ import pullUpRefresh from "@/utils/pullUpRefresh";
2
 import dayjs from "dayjs";
2
 import dayjs from "dayjs";
3
 export default {
3
 export default {
4
 	mixins: [pullUpRefresh],
4
 	mixins: [pullUpRefresh],
5
-
5
+	provide() {
6
+		return {
7
+			refreshData: {
8
+				resetData: this.resetData
9
+			}
10
+		}
11
+	},
6
 	computed: {
12
 	computed: {
7
 		currentIndex() {
13
 		currentIndex() {
8
 			return this.queryParams.type == 1 ? 0 : 1;
14
 			return this.queryParams.type == 1 ? 0 : 1;
@@ -397,6 +403,11 @@ export default {
397
 				url: `/pages/clueDetail/index?clueId=${id}&name=${name}&type=${this.queryParams.type}`,
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
 		async getList() {
411
 		async getList() {
401
 			const {
412
 			const {
402
 				pageNum,
413
 				pageNum,

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

@@ -64,7 +64,7 @@
64
 			<image src='/static/publicClue/littlePlane.png' mode="aspectFit" class="sendOrder_img"></image>
64
 			<image src='/static/publicClue/littlePlane.png' mode="aspectFit" class="sendOrder_img"></image>
65
 			<view>发单</view>
65
 			<view>发单</view>
66
 		</view>
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
 	</view>
68
 	</view>
69
 </template>
69
 </template>
70
 
70
 
@@ -189,10 +189,6 @@ export default {
189
 				this.$refs.inquiryDialog.showDialog()
189
 				this.$refs.inquiryDialog.showDialog()
190
 			}
190
 			}
191
 		},
191
 		},
192
-		// 询价成功
193
-		handleInquirySuccess() {
194
-			this.$refs.inquiryDialog.closeDialog()
195
-		},
196
 		// 询价取消
192
 		// 询价取消
197
 		handleInquiryCancel() {
193
 		handleInquiryCancel() {
198
 			this.$refs.inquiryDialog.closeDialog()
194
 			this.$refs.inquiryDialog.closeDialog()

+ 1 - 1
pages/privateClue/index.vue

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

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

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

+ 5 - 5
pages/wareHouse/index.vue

@@ -83,16 +83,16 @@
83
 								<view class="info-content">
83
 								<view class="info-content">
84
 									<view class="goods-brand">
84
 									<view class="goods-brand">
85
 										<view>
85
 										<view>
86
-											{{ goods.dictLabel || '' }}
86
+											{{ goods.dictLabel || '-' }}
87
 										</view>
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
 											class="code-icon" mode="aspectFill" lazy-load></image>
89
 											class="code-icon" mode="aspectFill" lazy-load></image>
90
 										<view>
90
 										<view>
91
 											{{ goods.indentifyCode || '' }}
91
 											{{ goods.indentifyCode || '' }}
92
-										</view>
92
+										</view> -->
93
 									</view>
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
 									<view class="price-group">
96
 									<view class="price-group">
97
 										<view class="price-item" v-if="isWareHouseRole">
97
 										<view class="price-item" v-if="isWareHouseRole">
98
 											<text class="price-type">成本价</text>
98
 											<text class="price-type">成本价</text>

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

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

+ 1 - 8
store/modules/user.js

@@ -60,7 +60,7 @@ export default {
60
 			
60
 			
61
 			const validRoles = [];
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
 			const hasCrmRole = roles.some(role => role.roleKey && role.roleKey.includes('CRM'));
64
 			const hasCrmRole = roles.some(role => role.roleKey && role.roleKey.includes('CRM'));
65
 			const hasWarehouser = roles.some(role => role.roleKey === 'WAREHOUSER');
65
 			const hasWarehouser = roles.some(role => role.roleKey === 'WAREHOUSER');
66
 			const hasSalesman = roles.some(role => role.roleKey === 'SALESMAN');
66
 			const hasSalesman = roles.some(role => role.roleKey === 'SALESMAN');
@@ -92,13 +92,6 @@ export default {
92
 				});
92
 				});
93
 				const currentRole = validRoles[0] || '';
93
 				const currentRole = validRoles[0] || '';
94
 				switch (currentRole) {
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
 					case 'WAREandSALE':
95
 					case 'WAREandSALE':
103
 						// 展示仓库、核价中心、询价中心、我的
96
 						// 展示仓库、核价中心、询价中心、我的
104
 						uni.setTabBarItem({ index: 2, visible: true }); // 仓库
97
 						uni.setTabBarItem({ index: 2, visible: true }); // 仓库