Selaa lähdekoodia

fix:1.4.2优化项

zhangxin 1 viikko sitten
vanhempi
commit
b50836b308

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__DDAE2E0",
4 4
     "description" : "",
5
-    "versionName" : "1.4.1",
6
-    "versionCode" : 141,
5
+    "versionName" : "1.4.2",
6
+    "versionCode" : 142,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {
9 9
         "webView" : {

+ 2 - 2
pages.json

@@ -30,7 +30,7 @@
30 30
 			"path": "pages/index/index",
31 31
 			"style": {
32 32
 				"navigationBarTitleText": "首页",
33
-				"enablePullDownRefresh": false,
33
+				"enablePullDownRefresh": true,
34 34
 				"navigationBarBackgroundColor": "#ffffff",
35 35
 				"navigationStyle": "custom"
36 36
 			}
@@ -153,7 +153,7 @@
153 153
 			"path": "pages/publicClue/index",
154 154
 			"style": {
155 155
 				"navigationBarTitleText": "线索公海",
156
-				"enablePullDownRefresh": false,
156
+				"enablePullDownRefresh": true,
157 157
 				"navigationStyle": "custom"
158 158
 			}
159 159
 		},

+ 12 - 6
pages/clue/components/trend.vue

@@ -14,23 +14,23 @@
14 14
             <view class="card-container" v-if="cardData.length > 0">
15 15
                 <view class="card-item" v-for="(item, index) in cardData" :key="index">
16 16
                     <view class="card-row">
17
-                        <span class="card-label">型号</span>
17
+                        <span class="card-label">型号:</span>
18 18
                         <span class="card-value">{{ item.model }}</span>
19 19
                     </view>
20 20
                     <view class="card-row">
21
-                        <span class="card-label">日期</span>
21
+                        <span class="card-label">日期:</span>
22 22
                         <span class="card-value">{{ item.recycleTime }}</span>
23 23
                     </view>
24 24
                     <view class="card-row">
25
-                        <span class="card-label">价格</span>
25
+                        <span class="card-label">价格:</span>
26 26
                         <span class="card-value">{{ item.price }}元</span>
27 27
                     </view>
28 28
                     <view class="card-row">
29
-                        <span class="card-label">回收情况</span>
29
+                        <span class="card-label">回收情况:</span>
30 30
                         <span class="card-value">{{ item.recycleSituation }}</span>
31 31
                     </view>
32 32
                     <view class="card-row">
33
-                        <span class="card-label">备注</span>
33
+                        <span class="card-label">备注:</span>
34 34
                         <span class="card-value">{{ item.remark || '-' }}</span>
35 35
                     </view>
36 36
                 </view>
@@ -348,6 +348,10 @@ export default {
348 348
             return item ? item.name : '-'
349 349
         },
350 350
         handleChartClick(event) {
351
+            if (!event.currentIndex || event.currentIndex.index === undefined) {
352
+                this.cardData = [];
353
+                return;
354
+            }
351 355
             const index = event.currentIndex.index;
352 356
             // 获取点击的日期
353 357
             const date = this.chartData.categories[index];
@@ -357,7 +361,7 @@ export default {
357 361
             const cardData = [];
358 362
             this.chartData.series.forEach(series => {
359 363
                 const price = series.data[index];
360
-                if (price !== null) {
364
+                if (price !== null && price !== undefined) {
361 365
                     cardData.push({
362 366
                         model: this.model,
363 367
                         price: price,
@@ -431,6 +435,8 @@ export default {
431 435
     border-radius: 8rpx;
432 436
     padding: 16rpx;
433 437
     box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
438
+    display:grid;
439
+    grid-template-columns: 1fr 1fr;
434 440
 }
435 441
 
436 442
 .card-row {

+ 1 - 1
pages/index/components/workingAchievement/index.vue

@@ -72,7 +72,7 @@
72 72
 				this.clueStateList = data;
73 73
 			},
74 74
 			dateSelectChange(queryParams){
75
-				queryParams.type = this.type;
75
+				queryParams.type = this.type
76 76
 				this.statisticsCaseState(queryParams);
77 77
 			},
78 78
 			handleToClue(){

+ 10 - 2
pages/index/index.vue

@@ -28,8 +28,8 @@
28 28
 			</view> -->
29 29
 		</u-sticky>
30 30
 		<view class="main_warp" id="main_warp">
31
-			<team :class="[activeTab !== 'team' ? 'hidden' : '' ]"	ref="team"></team>
32
-			<personage :class="[activeTab !== 'personage' ? 'hidden' : '' ]" ref="personage"></personage>
31
+			<team :class="[activeTab !== 'team' ? 'hidden' : '' ]"	ref="teamRef"></team>
32
+			<personage :class="[activeTab !== 'personage' ? 'hidden' : '' ]" ref="personageRef"></personage>
33 33
 		</view>
34 34
 
35 35
 	</view>
@@ -68,6 +68,14 @@
68 68
 				this.activeTab = value;
69 69
 			}
70 70
 		},
71
+		onPullDownRefresh() {
72
+			if (this.activeTab === 'team') {
73
+				this.$refs.teamRef.refresh();
74
+			} else if (this.activeTab === 'personage') {
75
+				this.$refs.personageRef.refresh();
76
+			}
77
+			uni.stopPullDownRefresh();
78
+		},
71 79
 	}
72 80
 </script>
73 81
 

+ 5 - 1
pages/index/personage/index.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
 	<view>
3
-		<working-achievement :list="clueStateList" type="2"></working-achievement>
3
+		<working-achievement :list="clueStateList" type="2" ref="workingAchievementRef"></working-achievement>
4 4
 		<briefReport ref="teamReport" type="2"></briefReport>
5 5
 	</view>
6 6
 </template>
@@ -34,6 +34,10 @@
34 34
 			async teamReportInit(){
35 35
 				this.$refs.teamReport.handleInit();
36 36
 			},
37
+			refresh(){
38
+				this.$refs.workingAchievementRef.dateSelectChange({type : "2"});
39
+				this.$refs.teamReport.dateSelectChange({type : "2"});
40
+			}
37 41
 		},
38 42
 		mounted() {
39 43
 		}

+ 6 - 1
pages/index/team/index.vue

@@ -45,7 +45,7 @@
45 45
 				</view>
46 46
 			</view>
47 47
 		</view>
48
-		<working-achievement type="1"></working-achievement>
48
+		<working-achievement type="1" ref="workingAchievementRef"></working-achievement>
49 49
 		<briefReport type="1" ref="teamReport"></briefReport>
50 50
 		<filterQuery ref="filter" v-model="promotionStatsQueryParams" @getList="selectPromotionStats"></filterQuery>
51 51
 	</view>
@@ -102,6 +102,11 @@
102 102
 			},
103 103
 			handleInit(){
104 104
 				this.selectPromotionStats();
105
+			},
106
+			refresh(){
107
+				this.handleInit();
108
+				this.$refs.workingAchievementRef.dateSelectChange({type : "1"});
109
+				this.$refs.teamReport.dateSelectChange({type : "1"});
105 110
 			}
106 111
 		},
107 112
 		mounted() {

+ 5 - 7
pages/person/cards/index.vue

@@ -266,13 +266,11 @@ export default {
266 266
         },
267 267
     },
268 268
     mounted() {
269
-        if (this.$store.state.user.userInfo.userId === '12234') {
270
-            this.getCardData();
271
-            this.getClueList();
272
-            this.$nextTick(() => {
273
-                this.getChartData();
274
-            })
275
-        }
269
+        this.getCardData();
270
+        this.getClueList();
271
+        this.$nextTick(() => {
272
+            this.getChartData();
273
+        })
276 274
     },
277 275
 
278 276
 };

+ 4 - 0
pages/wareHouse/components/detail.vue

@@ -335,6 +335,7 @@ export default {
335 335
         },
336 336
         // 锁单
337 337
         lockGoods() {
338
+            if(!this.getWarehouseButtonPermissions('lockOrder')) return false
338 339
             if (this.globalEditMode) {
339 340
                 uni.showToast({
340 341
                     title: '编辑状态下不能操作',
@@ -403,6 +404,7 @@ export default {
403 404
         },
404 405
         // 打开销售业务开单页面
405 406
         handleOpenOrder() {
407
+            if(!getWarehouseButtonPermissions('openOrder')) return false
406 408
             if (this.lockStatus === '1') {
407 409
                 uni.showToast({
408 410
                     title: '已锁单,不能开单',
@@ -445,6 +447,7 @@ export default {
445 447
             this.submitEdit(this.coreInfo)
446 448
         },
447 449
         viewLog() {
450
+            if(!getWarehouseButtonPermissions('viewLog')) return false
448 451
             uni.$u.api.wareHouseLog({
449 452
                 id: this.goodsId,
450 453
                 userId: this.$store.state.user.userInfo.userId,
@@ -456,6 +459,7 @@ export default {
456 459
 
457 460
         // 立即下架按钮
458 461
         handleOffShelf() {
462
+            if(!getWarehouseButtonPermissions('shelf')) return false
459 463
             if (this.lockStatus === '1') {
460 464
                 uni.showToast({
461 465
                     title: '已锁单,不能下架',

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

@@ -178,7 +178,7 @@
178 178
                         <Cell :val="formData.recyclePerson" :isDelete="true" @handleClear="clear('recyclePerson')"></Cell>
179 179
                         <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员" @selectPerson="handleSelectRecyclePerson"></PersonPicker>
180 180
                     </u-form-item>
181
-                    <u-form-item :label="'回收留底图(' + (formData.recycleBottomFileList.length || 0) + '张)'" borderBottom>
181
+                    <u-form-item v-if="getWarehouseFieldPermissions('recycleBottomDesc','read') || getWarehouseFieldPermissions('recycleBottomFileList','read')" :label="'回收留底图(' + (formData.recycleBottomFileList.length || 0) + '张)'" borderBottom>
182 182
                         <view class="recycle_bottom_desc">
183 183
                             <u--textarea v-if="getWarehouseFieldPermissions('recycleBottomDesc','read')" v-model="formData.recycleBottomDesc" clearable count autoHeight maxlength="250"
184 184
                                 height="100" confirmType="done"></u--textarea>
@@ -239,7 +239,7 @@
239 239
                         <u--input v-model="formData.productAttachment" placeholder="请输入" clearable
240 240
                             border="none"></u--input>
241 241
                     </u-form-item>
242
-                    <u-form-item  :label="'备注(' + (formData.productDescPicFileList.length || 0) + '张)'" borderBottom>
242
+                    <u-form-item v-if="getWarehouseFieldPermissions('productDesc','read') || getWarehouseFieldPermissions('productDescPicFileList','read')" :label="'备注(' + (formData.productDescPicFileList.length || 0) + '张)'" borderBottom>
243 243
                         <view class="recycle_bottom_desc">
244 244
                             <u--textarea v-if="getWarehouseFieldPermissions('productDesc','read')" v-model="formData.productDesc" clearable count autoHeight maxlength="250"
245 245
                                 height="100" confirmType="done"></u--textarea>

+ 25 - 11
pages/wareHouse/components/fieldPermissions.vue

@@ -27,10 +27,6 @@
27 27
 						<text class="input-label">角色Key</text>
28 28
 						<u--input v-model="formRoleKey" placeholder="如 WAREHOUSER" border="surround"></u--input>
29 29
 					</view>
30
-				</view>
31
-				<view class="btn-row">
32
-					<u-button type="error" plain size="small" :disabled="!currentRoleId"
33
-						@click="clearConfig">清空该角色配置</u-button>
34 30
 					<u-button type="primary" size="small" :loading="loadConfigLoading"
35 31
 						@click="loadConfig">加载配置</u-button>
36 32
 				</view>
@@ -83,6 +79,10 @@
83 79
 				<view class="section-head">
84 80
 					<text class="section-title">按钮权限</text>
85 81
 					<view class="btn-group">
82
+						<u-button type="success" plain size="mini" 
83
+							:disabled="!currentRoleId || buttonPermissionList.length === 0" @click="openAllButtonPermissions">一键全开</u-button>
84
+						<u-button type="error" plain size="mini" 
85
+							:disabled="!currentRoleId || buttonPermissionList.length === 0" @click="closeAllButtonPermissions">一键全关</u-button>
86 86
 						<u-button type="primary" size="mini" :loading="saveLoading"
87 87
 							:disabled="!currentRoleId || !buttonPermissionList.length" @click="saveButtonConfig">保存配置</u-button>
88 88
 					</view>
@@ -177,6 +177,9 @@ export default {
177 177
 					const list = (res && res.data) ? (Array.isArray(res.data) ? res.data : []) : [];
178 178
 					this.roleList = list.map((r) => ({ roleId: r.roleId, roleName: r.roleName || r.roleKey || '', roleKey: r.roleKey || '' }));
179 179
 					this.roleIndex = 0;
180
+					if (this.roleList.length > 0) {
181
+						this.loadConfig();
182
+					}
180 183
 				})
181 184
 				.catch(() => {
182 185
 					this.roleList = [];
@@ -185,6 +188,7 @@ export default {
185 188
 		onRoleChange(e) {
186 189
 			this.roleIndex = e.detail.value;
187 190
 			this.permissionList = [];
191
+			this.loadConfig()
188 192
 		},
189 193
 		loadConfig() {
190 194
 			const roleId = this.currentRoleId;
@@ -267,6 +271,8 @@ export default {
267 271
 				return;
268 272
 			}
269 273
 			this.saveLoading = true;
274
+			console.log(this.buttonPermissionList);
275
+			
270 276
 			uni.$u.api.wareHouseButtonPermissionsConfigSave({
271 277
 				roleId,
272 278
 				roleKey,
@@ -322,6 +328,20 @@ export default {
322 328
 			});
323 329
 			uni.$u.toast('已关闭所有权限');
324 330
 		},
331
+		// 一键打开所有按钮权限
332
+		openAllButtonPermissions() {
333
+			this.buttonPermissionList.forEach(item => {
334
+				item.enabled = true;
335
+			});
336
+			uni.$u.toast('已打开所有按钮权限');
337
+		},
338
+		// 一键关闭所有按钮权限
339
+		closeAllButtonPermissions() {
340
+			this.buttonPermissionList.forEach(item => {
341
+				item.enabled = false;
342
+			});
343
+			uni.$u.toast('已关闭所有按钮权限');
344
+		},
325 345
 	},
326 346
 };
327 347
 </script>
@@ -435,16 +455,10 @@ export default {
435 455
 			}
436 456
 		}
437 457
 	}
438
-
439
-	.btn-row {
440
-		display: flex;
441
-		gap: 20rpx;
442
-		// flex-wrap: wrap;
443
-	}
444 458
 }
445 459
 
446 460
 .list-wrap {
447
-	max-height: 30vh;
461
+	max-height: 35vh;
448 462
 }
449 463
 
450 464
 .loading-wrap {

+ 77 - 1
pages/wareHouse/components/searchFilter.vue

@@ -36,6 +36,11 @@
36 36
             <u-form-item label="是否入库" labelWidth="70">
37 37
                 <TabSelect :tabList="stockStatusListAll" :colNum="4" :echoInfo="formData.stockStatus" mode="single" @tabChange="handleTabChangeStockStatus"></TabSelect>
38 38
             </u-form-item>
39
+			<u-form-item label="排序方式" labelWidth="70" @click="openSortPicker">
40
+				<Cell :val="curSortType.label" :isDelete="false" :border="true"></Cell>
41
+                <u-picker ref="sortPicker" :show="sortPickerShow" :columns="sortColumns" keyName="label" @confirm="handleSortChange"
42
+                    @cancel="sortPickerShow = false"></u-picker>
43
+			</u-form-item>
39 44
         </u--form>
40 45
         <view class="btns">
41 46
             <u-button text="重置" @click="resetForm"></u-button>
@@ -85,6 +90,41 @@ export default {
85 90
             // 将导入的变量在data中重新定义,确保模板能够访问
86 91
             productAttributeList: productAttributeList,
87 92
             stockStatusListAll: stockStatusListAll,
93
+			curSortType: {
94
+				id: 4,
95
+				label: '按入库最新',
96
+			},
97
+			sortPickerShow: false,
98
+			sortColumns: [[
99
+				{
100
+					label: '按最久未下载',
101
+					id: 1
102
+				},
103
+				{
104
+					label: '按最近更新',
105
+					id: 2
106
+				},
107
+				{
108
+					label: '按最久更新',
109
+					id: 3
110
+				},
111
+				{
112
+					label: '按入库最新',
113
+					id: 4
114
+				},
115
+				{
116
+					label: '按入库最久',
117
+					id: 5
118
+				},
119
+				{
120
+					label: '按价格最高',
121
+					id: 6
122
+				},
123
+				{
124
+					label: '按价格最低',
125
+					id: 7
126
+				},
127
+			]],
88 128
            
89 129
         }
90 130
     },
@@ -93,7 +133,9 @@ export default {
93 133
     emits: [],
94 134
     methods: {
95 135
         handleSearch() {
96
-            this.$emit('confirm', this.formData);
136
+			const filters = { ...this.formData, sortType: this.curSortType.id };
137
+			const text = this.generateSelectText(filters);
138
+            this.$emit('confirm', { filters, text });
97 139
             this.close();
98 140
         },
99 141
         resetForm() {
@@ -112,6 +154,8 @@ export default {
112 154
                 productAttribute: [],
113 155
                 stockStatus: '',
114 156
             };
157
+			this.time = '';
158
+			this.$emit('confirm', { filters: this.formData, text: '' });
115 159
         },
116 160
         open() {
117 161
             this.show = true
@@ -189,6 +233,38 @@ export default {
189 233
         handleTabChangeStockStatus(e) {
190 234
             this.formData.stockStatus = e;
191 235
         },
236
+		openSortPicker() {
237
+			this.sortPickerShow = true;
238
+			const selectedIndex = this.sortColumns[0].findIndex(item => item.id === this.curSortType.id);
239
+			this.$nextTick(() => {
240
+				this.$refs.sortPicker.setIndexs(selectedIndex > -1 ? [selectedIndex] : [0]);
241
+			});
242
+		},
243
+		handleSortChange(e) {
244
+			this.curSortType = e.value[0];
245
+			this.sortPickerShow = false;
246
+		},
247
+		generateSelectText(filters) {
248
+			let parts = [];
249
+			if (filters.dictLabel) parts.push(`品牌: ${filters.dictLabel}`);
250
+			if (filters.minPrice || filters.maxPrice) parts.push(`实价范围: ${filters.minPrice || '不限'} - ${filters.maxPrice || '不限'}`);
251
+			if (filters.location) parts.push(`位置: ${filters.location}`);
252
+			if (filters.startTime || filters.endTime) parts.push(`回收时间: ${filters.startTime || ''} 至 ${filters.endTime || ''}`);
253
+			if (filters.recyclePerson) parts.push(`回收人员: ${filters.recyclePerson}`);
254
+			if (filters.identifyingPerson) parts.push(`鉴定人员: ${filters.identifyingPerson}`);
255
+			if (filters.productAttribute && filters.productAttribute.length > 0) {
256
+				const attrNames = filters.productAttribute.map(val => {
257
+					const item = this.productAttributeList.find(i => i.value === val);
258
+					return item ? item.name : '';
259
+				}).filter(Boolean).join(', ');
260
+				if (attrNames) parts.push(`商品属性: ${attrNames}`);
261
+			}
262
+			if (filters.stockStatus) {
263
+				const status = this.stockStatusListAll.find(i => i.value === filters.stockStatus);
264
+				if (status) parts.push(`是否入库: ${status.name}`);
265
+			}
266
+			return parts.join(' | ');
267
+		},
192 268
     }
193 269
 }
194 270
 </script>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 94 - 132
pages/wareHouse/index.vue


+ 4 - 0
pages/wareHouse/styles/index.scss

@@ -265,6 +265,10 @@
265 265
         color: #333;
266 266
         font-size: 24rpx;
267 267
       }
268
+      .sort-text {
269
+        font-size: 22rpx;
270
+        color: #333;
271
+      }
268 272
     }
269 273
   }
270 274
 }

+ 1 - 1
utils/util.js

@@ -417,7 +417,7 @@ export function getWarehouseFieldPermissions(field,permission) {
417 417
 export function getWarehouseButtonPermissions(buttonKey) {
418 418
     const permissionItem = store.state.user.warehouseButtonPermissions?.find(item=>item.buttonKey === buttonKey);
419 419
 	if(!permissionItem || !permissionItem.enabled){
420
-		uni.$u.toast('无权限');
420
+		uni.$u.toast('此用户无权限,请联系管理员添加权限!');
421 421
 		return false;
422 422
 	}else{
423 423
 		return true