zhangxin 1 settimana fa
parent
commit
0827ba4ae6

+ 1 - 0
components/inquiry-verification-list/index.vue

@@ -34,6 +34,7 @@
34 34
                     </view>
35 35
                 </view>
36 36
             </view>
37
+            <u-empty v-if="list.length === 0"></u-empty>
37 38
         </scroll-view>
38 39
 
39 40
         <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :isShowHistory="true" :type="type" :title="type == '1' ? '询价' : '核价'" @submitSuccess="onRefresh" />

+ 5 - 1
components/remote-search-select/index.vue

@@ -198,7 +198,7 @@ export default {
198 198
                 sizeType: ['compressed'],
199 199
                 sourceType: ['album', 'camera'],
200 200
                 success: (res) => {
201
-                    this.$emit('upload',res)
201
+                    this.$emit('upload',res.tempFilePaths[0])
202 202
                 }
203 203
             })
204 204
         },
@@ -250,6 +250,10 @@ export default {
250 250
             this.croppedImages = []
251 251
         },
252 252
         handleSelectImg(item) {
253
+            if(!item.record.model){
254
+                uni.$u.toast("型号为空,请重新选择")
255
+                return
256
+            }
253 257
             this.$emit('select-img', item)
254 258
             this.closeImgPopup()
255 259
         },

+ 2 - 4
pages/clue/components/trend.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <u-modal :show="trendModal" title="价格趋势" @confirm="closeTrendModal" confirmText="关闭弹窗" height="93%"><view class="trend_modal">
3 3
             <RemoteSearchSelect ref="searchSelect" :value="model" placeholder="请输入关键词" :resultsShow="resultsShow" :currentUrl="currentImg" :searchResults="searchResults" :imgResults="imgResults" :loading="loading"
4
-                :cameraEnabled="true" @search="handleSearch" @select="handleSelect" @select-img="handleSelectImg" @select-crop-img="handleSelectCropImg" @load-more="loadMore" @load-more-img="loadMoreImg" @clear="handleClear" @focus="handleFocus" @upload="uploadImage"></RemoteSearchSelect>
4
+                :cameraEnabled="true" @search="handleSearch" @select="handleSelect" @select-img="handleSelectImg" @select-crop-img="handleSelectCropImg" @load-more="loadMore" @load-more-img="loadMoreImg" @clear="handleClear" @focus="handleFocus" @upload="handleSelectCropImg"></RemoteSearchSelect>
5 5
             <view class="charts_box" v-if="chartShow">
6 6
                 <u--text type="primary" :text="`最大价格:${Math.max(...maxPrice)}元`"></u--text>
7 7
                 <u--text type="warning" :text="`最小价格:${Math.min(...minPrice)}元`"></u--text>
@@ -208,7 +208,7 @@ export default {
208 208
         handleSelectCropImg(file) {
209 209
             this.imgPageNum = 1
210 210
             this.imgTotal = 0
211
-            
211
+            this.imgResults = []
212 212
             const data = {
213 213
                 tempFilePaths:[file]
214 214
             }
@@ -335,9 +335,7 @@ export default {
335 335
                         uni.$u.toast('未匹配到型号,请换一张图或手动输入');
336 336
                     }
337 337
                 }).catch((err) => {
338
-    
339 338
                     console.log(err);
340
-                    
341 339
                     uni.$u.toast('识别失败,请重试');
342 340
                 });
343 341
             })

+ 5 - 0
pages/wareHouse/components/fieldPermissions.vue

@@ -103,6 +103,7 @@
103 103
 </template>
104 104
 
105 105
 <script>
106
+import {updateFieldPermissions,updateButtonPermissions} from "@/utils/util.js";
106 107
 const FIELD_LABELS = {
107 108
 	goodPicFileList: '商品图片', desc: '商品描述', origin: '来源', type: '商品分类', dictLabel: '品牌',
108 109
 	series: '系列', model: '型号', dialType: '机芯类型', caseMaterial: '表壳材质', dialDiameter: '表盘直径',
@@ -219,6 +220,8 @@ export default {
219 220
 					this.loadConfigLoading = false;
220 221
 				});
221 222
 		},
223
+		updateFieldPermissions:updateFieldPermissions,
224
+		updateButtonPermissions:updateButtonPermissions,
222 225
 		saveConfig() {
223 226
 			const roleId = this.currentRoleId;
224 227
 			const roleKey = this.currentRoleKey;
@@ -245,6 +248,7 @@ export default {
245 248
 				.finally(() => {
246 249
 					this.saveLoading = false;
247 250
 				});
251
+			this.updateFieldPermissions();
248 252
 		},
249 253
 		saveButtonConfig() {
250 254
 			const roleId = this.currentRoleId;
@@ -268,6 +272,7 @@ export default {
268 272
 				.finally(() => {
269 273
 					this.saveLoading = false;
270 274
 				});
275
+			this.updateButtonPermissions();
271 276
 		},
272 277
 		clearConfig() {
273 278
 			if (!this.currentRoleId) return;

+ 7 - 17
store/modules/user.js

@@ -1,6 +1,8 @@
1 1
 import permision from "@/js_sdk/wa-permission/permission.js";
2 2
 import {
3
-	getMacAddress
3
+	getMacAddress,
4
+	updateFieldPermissions,
5
+	updateButtonPermissions,
4 6
 } from "../../utils/util";
5 7
 import {
6 8
 	systemList
@@ -29,8 +31,8 @@ export default {
29 31
 		netConfig: {
30 32
 			// http://59.42.9.166:9520/proxy
31 33
 			// http://10.0.7.100:9500
32
-			// ip: "https://crm.nanjingshiyu.com/prod-api/", // ip
33
-			ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
34
+			ip: "https://crm.nanjingshiyu.com/prod-api/", // ip
35
+			// ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
34 36
 			// ip : "/api", // 测试环境ip
35 37
 			// ip : "http://47.113.184.101", // 测试环境ip
36 38
 			// ip: "http://172.16.7.200", // ip
@@ -230,20 +232,8 @@ export default {
230 232
 					} else {
231 233
 						commit("SET_PERMISSIONS", []);
232 234
 					}
233
-					// 登录后拉取仓库字段权限并存到 store(按当前用户角色合并)
234
-					uni.$u.api.wareHouseFieldPermissions({}).then((permRes) => {
235
-						const list = (permRes && permRes.data && Array.isArray(permRes.data)) ? permRes.data : [];
236
-						commit("SET_WAREHOUSE_FIELD_PERMISSIONS", list);
237
-					}).catch(() => {
238
-						commit("SET_WAREHOUSE_FIELD_PERMISSIONS", []);
239
-					});
240
-					// 登录后拉取仓库按钮权限并存到 store(按当前用户角色合并)
241
-					uni.$u.api.wareHouseButtonPermissions({}).then((permRes) => {
242
-						const list = (permRes && permRes.data && Array.isArray(permRes.data)) ? permRes.data : [];
243
-						commit("SET_WAREHOUSE_BUTTON_PERMISSIONS", list);
244
-					}).catch(() => {
245
-						commit("SET_WAREHOUSE_BUTTON_PERMISSIONS", []);
246
-					});
235
+					updateFieldPermissions();
236
+					updateButtonPermissions();
247 237
 					commit("SET_BELONGSYSTEM", {
248 238
 						code: state.system.value,
249 239
 						callback: (flag) => {

+ 20 - 2
utils/util.js

@@ -416,10 +416,28 @@ export function getWarehouseFieldPermissions(field,permission) {
416 416
 }
417 417
 export function getWarehouseButtonPermissions(buttonKey) {
418 418
     const permissionItem = store.state.user.warehouseButtonPermissions?.find(item=>item.buttonKey === buttonKey);
419
-	console.log(permissionItem)
420
-	if(!permissionItem.enabled){
419
+	if(!permissionItem || !permissionItem.enabled){
421 420
 		uni.$u.toast('无权限');
421
+		return false;
422 422
 	}else{
423 423
 		return true
424 424
 	}
425 425
 }
426
+// 拉取仓库字段权限并存到 store
427
+export function updateFieldPermissions(){
428
+	uni.$u.api.wareHouseFieldPermissions({}).then((permRes) => {
429
+		const list = (permRes && permRes.data && Array.isArray(permRes.data)) ? permRes.data : [];
430
+		store.commit("user/SET_WAREHOUSE_FIELD_PERMISSIONS", list);
431
+	}).catch(() => {
432
+		store.commit("user/SET_WAREHOUSE_FIELD_PERMISSIONS", []);
433
+	});
434
+}
435
+// 拉取仓库按钮权限并存到 store
436
+export function updateButtonPermissions(){
437
+	uni.$u.api.wareHouseButtonPermissions({}).then((permRes) => {
438
+		const list = (permRes && permRes.data && Array.isArray(permRes.data)) ? permRes.data : [];
439
+		store.commit("user/SET_WAREHOUSE_BUTTON_PERMISSIONS", list);
440
+	}).catch(() => {
441
+		store.commit("user/SET_WAREHOUSE_BUTTON_PERMISSIONS", []);
442
+	});
443
+}