Commit f84588f8e182cb0eb001e0fa1f80edb70c56e233
1 parent
5652f5e0
feat: add remaining rights range filter and reset functionality
- Introduced a new filter for remaining rights range in the member portrait dialog and query input DTO. - Implemented a resetData method to clear all data when switching members to prevent displaying stale information. - Updated the fetchData method to clear lists upon member change. - Enhanced the LqKhxxService to handle remaining rights range in queries. - Improved the layout of the search form in the lqKhxx view for better usability.
Showing
5 changed files
with
139 additions
and
7 deletions
antis-ncc-admin/src/components/member-portrait-dialog.vue
| ... | ... | @@ -431,12 +431,35 @@ export default { |
| 431 | 431 | } |
| 432 | 432 | }, |
| 433 | 433 | methods: { |
| 434 | + /** 重置所有数据,避免二次进入时显示旧数据 */ | |
| 435 | + resetData() { | |
| 436 | + this.baseInfo = {} | |
| 437 | + this.behaviorSummary = {} | |
| 438 | + this.remainingItems = [] | |
| 439 | + this.monthlyTrend = [] | |
| 440 | + this.consumptionAnalysis = null | |
| 441 | + this.billingList = [] | |
| 442 | + this.billingPagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 443 | + this.consumeList = [] | |
| 444 | + this.consumePagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 445 | + this.refundList = [] | |
| 446 | + this.refundPagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 447 | + this.activeTab = 'overview' | |
| 448 | + }, | |
| 434 | 449 | async fetchData() { |
| 435 | 450 | if (!this.memberId) { |
| 436 | 451 | this.$message.warning('会员ID不能为空') |
| 437 | 452 | return |
| 438 | 453 | } |
| 439 | 454 | |
| 455 | + // 切换会员时清空列表数据,避免显示上一次的列表 | |
| 456 | + this.billingList = [] | |
| 457 | + this.billingPagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 458 | + this.consumeList = [] | |
| 459 | + this.consumePagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 460 | + this.refundList = [] | |
| 461 | + this.refundPagination = { pageIndex: 1, pageSize: 10, total: 0 } | |
| 462 | + | |
| 440 | 463 | this.loading = true |
| 441 | 464 | try { |
| 442 | 465 | const res = await request({ |
| ... | ... | @@ -715,6 +738,7 @@ export default { |
| 715 | 738 | this.trendChart.dispose() |
| 716 | 739 | this.trendChart = null |
| 717 | 740 | } |
| 741 | + this.resetData() | |
| 718 | 742 | this.$emit('update:visible', false) |
| 719 | 743 | this.$emit('closed') |
| 720 | 744 | } | ... | ... |
antis-ncc-admin/src/views/lqKhxx/index.vue
| 1 | -<template> | |
| 1 | +<template> | |
| 2 | 2 | <div class="NCC-common-layout"> |
| 3 | 3 | <div class="NCC-common-layout-center"> |
| 4 | 4 | <!-- 现代化筛选卡片 --> |
| ... | ... | @@ -80,7 +80,7 @@ |
| 80 | 80 | </el-col> |
| 81 | 81 | </el-row> |
| 82 | 82 | <el-row :gutter="16" class="search-row search-row-3"> |
| 83 | - <el-col :span="5"> | |
| 83 | + <el-col :span="6"> | |
| 84 | 84 | <el-form-item label="进店渠道"> |
| 85 | 85 | <el-select v-model="query.jdqd" placeholder="请选择渠道" clearable filterable |
| 86 | 86 | style="width: 100%"> |
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | </el-select> |
| 90 | 90 | </el-form-item> |
| 91 | 91 | </el-col> |
| 92 | - <el-col :span="5"> | |
| 92 | + <el-col :span="6"> | |
| 93 | 93 | <el-form-item label="沉睡天数"> |
| 94 | 94 | <el-select v-model="query.sleepDaysRange" placeholder="请选择天数范围" clearable |
| 95 | 95 | style="width: 100%"> |
| ... | ... | @@ -98,7 +98,18 @@ |
| 98 | 98 | </el-select> |
| 99 | 99 | </el-form-item> |
| 100 | 100 | </el-col> |
| 101 | - <el-col :span="5"> | |
| 101 | + <el-col :span="6"> | |
| 102 | + <el-form-item label="剩余权益"> | |
| 103 | + <div class="remaining-rights-range"> | |
| 104 | + <el-input v-model.number="query.remainingRightsMin" placeholder="最小(元)" | |
| 105 | + type="number" clearable style="flex: 1" /> | |
| 106 | + <span class="range-sep">-</span> | |
| 107 | + <el-input v-model.number="query.remainingRightsMax" placeholder="最大(元)" | |
| 108 | + type="number" clearable style="flex: 1" /> | |
| 109 | + </div> | |
| 110 | + </el-form-item> | |
| 111 | + </el-col> | |
| 112 | + <el-col :span="6"> | |
| 102 | 113 | <el-form-item label="注册时间"> |
| 103 | 114 | <el-date-picker v-model="query.zcsj" type="daterange" value-format="timestamp" |
| 104 | 115 | format="yyyy-MM-dd" start-placeholder="开始" end-placeholder="结束" |
| ... | ... | @@ -106,7 +117,9 @@ |
| 106 | 117 | </el-date-picker> |
| 107 | 118 | </el-form-item> |
| 108 | 119 | </el-col> |
| 109 | - <el-col :span="5"> | |
| 120 | + </el-row> | |
| 121 | + <el-row :gutter="16" class="search-row search-row-4"> | |
| 122 | + <el-col :span="6"> | |
| 110 | 123 | <el-form-item label="出生日期"> |
| 111 | 124 | <el-date-picker v-model="query.yanglsr" type="daterange" value-format="timestamp" |
| 112 | 125 | format="yyyy-MM-dd" start-placeholder="开始" end-placeholder="结束" |
| ... | ... | @@ -528,6 +541,8 @@ export default { |
| 528 | 541 | ml: undefined, |
| 529 | 542 | consumeLevel: undefined, // 消费等级 |
| 530 | 543 | sleepDaysRange: undefined, // 沉睡天数范围 |
| 544 | + remainingRightsMin: undefined, // 剩余权益最小值(元) | |
| 545 | + remainingRightsMax: undefined, // 剩余权益最大值(元) | |
| 531 | 546 | }, |
| 532 | 547 | list: [], |
| 533 | 548 | listLoading: true, |
| ... | ... | @@ -745,6 +760,15 @@ export default { |
| 745 | 760 | } |
| 746 | 761 | } |
| 747 | 762 | |
| 763 | + // 组装剩余权益范围为 "min,max" 格式(支持自定义输入) | |
| 764 | + const hasMin = _query.remainingRightsMin != null && _query.remainingRightsMin !== '' | |
| 765 | + const hasMax = _query.remainingRightsMax != null && _query.remainingRightsMax !== '' | |
| 766 | + if (hasMin || hasMax) { | |
| 767 | + const min = hasMin ? Number(_query.remainingRightsMin) : 0 | |
| 768 | + const max = hasMax ? Number(_query.remainingRightsMax) : 999999999 | |
| 769 | + _query.remainingRightsRange = `${min},${max}` | |
| 770 | + } | |
| 771 | + | |
| 748 | 772 | let query = {} |
| 749 | 773 | for (let key in _query) { |
| 750 | 774 | if (Array.isArray(_query[key])) { |
| ... | ... | @@ -837,6 +861,15 @@ export default { |
| 837 | 861 | } |
| 838 | 862 | } |
| 839 | 863 | |
| 864 | + // 组装剩余权益范围为 "min,max" 格式(支持自定义输入) | |
| 865 | + const hasMin = query.remainingRightsMin != null && query.remainingRightsMin !== '' | |
| 866 | + const hasMax = query.remainingRightsMax != null && query.remainingRightsMax !== '' | |
| 867 | + if (hasMin || hasMax) { | |
| 868 | + const min = hasMin ? Number(query.remainingRightsMin) : 0 | |
| 869 | + const max = hasMax ? Number(query.remainingRightsMax) : 999999999 | |
| 870 | + query.remainingRightsRange = `${min},${max}` | |
| 871 | + } | |
| 872 | + | |
| 840 | 873 | request({ |
| 841 | 874 | url: `/api/Extend/LqKhxx/Actions/Export`, |
| 842 | 875 | method: 'GET', |
| ... | ... | @@ -860,6 +893,15 @@ export default { |
| 860 | 893 | } |
| 861 | 894 | } |
| 862 | 895 | |
| 896 | + // 组装剩余权益范围为 "min,max" 格式(支持自定义输入) | |
| 897 | + const hasMinExp = query.remainingRightsMin != null && query.remainingRightsMin !== '' | |
| 898 | + const hasMaxExp = query.remainingRightsMax != null && query.remainingRightsMax !== '' | |
| 899 | + if (hasMinExp || hasMaxExp) { | |
| 900 | + const min = hasMinExp ? Number(query.remainingRightsMin) : 0 | |
| 901 | + const max = hasMaxExp ? Number(query.remainingRightsMax) : 999999999 | |
| 902 | + query.remainingRightsRange = `${min},${max}` | |
| 903 | + } | |
| 904 | + | |
| 863 | 905 | // 处理数组参数 |
| 864 | 906 | let exportQuery = {} |
| 865 | 907 | for (let key in query) { |
| ... | ... | @@ -2290,6 +2332,7 @@ export default { |
| 2290 | 2332 | .search-row { |
| 2291 | 2333 | margin-bottom: 0; |
| 2292 | 2334 | transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
| 2335 | + row-gap: 16px; | |
| 2293 | 2336 | |
| 2294 | 2337 | .el-col { |
| 2295 | 2338 | display: flex; |
| ... | ... | @@ -2373,6 +2416,7 @@ export default { |
| 2373 | 2416 | opacity: 1; |
| 2374 | 2417 | transform: translateY(0); |
| 2375 | 2418 | margin-bottom: 16px; |
| 2419 | + row-gap: 16px; | |
| 2376 | 2420 | |
| 2377 | 2421 | &:last-child { |
| 2378 | 2422 | margin-bottom: 0; |
| ... | ... | @@ -2575,6 +2619,23 @@ export default { |
| 2575 | 2619 | } |
| 2576 | 2620 | } |
| 2577 | 2621 | |
| 2622 | + .remaining-rights-range { | |
| 2623 | + display: flex; | |
| 2624 | + align-items: center; | |
| 2625 | + gap: 8px; | |
| 2626 | + width: 100%; | |
| 2627 | + | |
| 2628 | + .range-sep { | |
| 2629 | + color: #909399; | |
| 2630 | + font-size: 14px; | |
| 2631 | + flex-shrink: 0; | |
| 2632 | + } | |
| 2633 | + | |
| 2634 | + ::v-deep .el-input__inner { | |
| 2635 | + text-align: center; | |
| 2636 | + } | |
| 2637 | + } | |
| 2638 | + | |
| 2578 | 2639 | .search-actions-inline { |
| 2579 | 2640 | display: flex; |
| 2580 | 2641 | align-items: center; | ... | ... |
docs/美业系统升级项目需求拆分表.xlsx
No preview for this file type
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKhxx/LqKhxxListQueryInput.cs
| 1 | -using System.Collections.Generic; | |
| 1 | +using System.Collections.Generic; | |
| 2 | 2 | using NCC.Common.Filter; |
| 3 | 3 | |
| 4 | 4 | namespace NCC.Extend.Entitys.Dto.LqKhxx |
| ... | ... | @@ -129,6 +129,11 @@ namespace NCC.Extend.Entitys.Dto.LqKhxx |
| 129 | 129 | public string SleepDaysRange { get; set; } |
| 130 | 130 | |
| 131 | 131 | /// <summary> |
| 132 | + /// 剩余权益范围(格式: "最小值,最大值",单位:元) | |
| 133 | + /// </summary> | |
| 134 | + public string RemainingRightsRange { get; set; } | |
| 135 | + | |
| 136 | + /// <summary> | |
| 132 | 137 | /// 主健康师 |
| 133 | 138 | /// </summary> |
| 134 | 139 | public string mainHealthUser { get; set; } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqKhxxService.cs
| 1 | -using System; | |
| 1 | +using System; | |
| 2 | 2 | using System.Collections.Generic; |
| 3 | 3 | using System.IO; |
| 4 | 4 | using System.Linq; |
| ... | ... | @@ -140,6 +140,18 @@ namespace NCC.Extend.LqKhxx |
| 140 | 140 | minSleepDays = min; |
| 141 | 141 | maxSleepDays = max; |
| 142 | 142 | } |
| 143 | + | |
| 144 | + // 处理剩余权益范围 | |
| 145 | + List<string> queryRemainingRightsRange = input.RemainingRightsRange != null ? input.RemainingRightsRange.Split(',').ToObeject<List<string>>() : null; | |
| 146 | + decimal? minRemainingRights = null; | |
| 147 | + decimal? maxRemainingRights = null; | |
| 148 | + if (queryRemainingRightsRange != null && queryRemainingRightsRange.Count >= 2) | |
| 149 | + { | |
| 150 | + decimal.TryParse(queryRemainingRightsRange[0], out decimal min); | |
| 151 | + decimal.TryParse(queryRemainingRightsRange[1], out decimal max); | |
| 152 | + minRemainingRights = min; | |
| 153 | + maxRemainingRights = max; | |
| 154 | + } | |
| 143 | 155 | |
| 144 | 156 | var data = await _db.Queryable<LqKhxxEntity>() |
| 145 | 157 | .WhereIF(!string.IsNullOrEmpty(input.keyWord), p => p.Khmc.Contains(input.keyWord) || p.Sjh.Contains(input.keyWord) || p.Dah.Contains(input.keyWord)) |
| ... | ... | @@ -164,6 +176,8 @@ namespace NCC.Extend.LqKhxx |
| 164 | 176 | .WhereIF(input.ConsumeLevel.HasValue, p => p.ConsumeLevel == input.ConsumeLevel.Value) |
| 165 | 177 | .WhereIF(minSleepDays.HasValue, p => p.SleepDays >= minSleepDays.Value) |
| 166 | 178 | .WhereIF(maxSleepDays.HasValue, p => p.SleepDays <= maxSleepDays.Value) |
| 179 | + .WhereIF(minRemainingRights.HasValue, p => p.RemainingRightsAmount >= minRemainingRights.Value) | |
| 180 | + .WhereIF(maxRemainingRights.HasValue, p => p.RemainingRightsAmount <= maxRemainingRights.Value) | |
| 167 | 181 | .WhereIF(queryZcsj != null, p => p.CreateTime >= new DateTime(startZcsj.ToDate().Year, startZcsj.ToDate().Month, startZcsj.ToDate().Day, 0, 0, 0)) |
| 168 | 182 | .WhereIF(queryZcsj != null, p => p.CreateTime <= new DateTime(endZcsj.ToDate().Year, endZcsj.ToDate().Month, endZcsj.ToDate().Day, 23, 59, 59)) |
| 169 | 183 | .Select(it => new LqKhxxListOutput |
| ... | ... | @@ -285,6 +299,18 @@ namespace NCC.Extend.LqKhxx |
| 285 | 299 | minSleepDays = min; |
| 286 | 300 | maxSleepDays = max; |
| 287 | 301 | } |
| 302 | + | |
| 303 | + // 处理剩余权益范围 | |
| 304 | + List<string> queryRemainingRightsRange = input.RemainingRightsRange != null ? input.RemainingRightsRange.Split(',').ToObeject<List<string>>() : null; | |
| 305 | + decimal? minRemainingRights = null; | |
| 306 | + decimal? maxRemainingRights = null; | |
| 307 | + if (queryRemainingRightsRange != null && queryRemainingRightsRange.Count >= 2) | |
| 308 | + { | |
| 309 | + decimal.TryParse(queryRemainingRightsRange[0], out decimal min); | |
| 310 | + decimal.TryParse(queryRemainingRightsRange[1], out decimal max); | |
| 311 | + minRemainingRights = min; | |
| 312 | + maxRemainingRights = max; | |
| 313 | + } | |
| 288 | 314 | |
| 289 | 315 | var data = await _db.Queryable<LqKhxxEntity>() |
| 290 | 316 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| ... | ... | @@ -308,6 +334,8 @@ namespace NCC.Extend.LqKhxx |
| 308 | 334 | .WhereIF(input.ConsumeLevel.HasValue, p => p.ConsumeLevel == input.ConsumeLevel.Value) |
| 309 | 335 | .WhereIF(minSleepDays.HasValue, p => p.SleepDays >= minSleepDays.Value) |
| 310 | 336 | .WhereIF(maxSleepDays.HasValue, p => p.SleepDays <= maxSleepDays.Value) |
| 337 | + .WhereIF(minRemainingRights.HasValue, p => p.RemainingRightsAmount >= minRemainingRights.Value) | |
| 338 | + .WhereIF(maxRemainingRights.HasValue, p => p.RemainingRightsAmount <= maxRemainingRights.Value) | |
| 311 | 339 | .WhereIF(queryYanglsr != null, p => p.Yanglsr >= new DateTime(startYanglsr.ToDate().Year, startYanglsr.ToDate().Month, startYanglsr.ToDate().Day, 0, 0, 0)) |
| 312 | 340 | .WhereIF(queryYanglsr != null, p => p.Yanglsr <= new DateTime(endYanglsr.ToDate().Year, endYanglsr.ToDate().Month, endYanglsr.ToDate().Day, 23, 59, 59)) |
| 313 | 341 | .WhereIF(queryYinlsr != null, p => p.Yinlsr >= new DateTime(startYinlsr.ToDate().Year, startYinlsr.ToDate().Month, startYinlsr.ToDate().Day, 0, 0, 0)) |
| ... | ... | @@ -682,6 +710,18 @@ namespace NCC.Extend.LqKhxx |
| 682 | 710 | maxSleepDays = max; |
| 683 | 711 | } |
| 684 | 712 | |
| 713 | + // 处理剩余权益范围 | |
| 714 | + List<string> queryRemainingRightsRange = input.RemainingRightsRange != null ? input.RemainingRightsRange.Split(',').ToObeject<List<string>>() : null; | |
| 715 | + decimal? minRemainingRights = null; | |
| 716 | + decimal? maxRemainingRights = null; | |
| 717 | + if (queryRemainingRightsRange != null && queryRemainingRightsRange.Count >= 2) | |
| 718 | + { | |
| 719 | + decimal.TryParse(queryRemainingRightsRange[0], out decimal min); | |
| 720 | + decimal.TryParse(queryRemainingRightsRange[1], out decimal max); | |
| 721 | + minRemainingRights = min; | |
| 722 | + maxRemainingRights = max; | |
| 723 | + } | |
| 724 | + | |
| 685 | 725 | // 先查询客户基础数据(使用子查询方式,类似GetNoPagingList,但优化为批量查询关联数据) |
| 686 | 726 | var customerList = await _db.Queryable<LqKhxxEntity>() |
| 687 | 727 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| ... | ... | @@ -704,6 +744,8 @@ namespace NCC.Extend.LqKhxx |
| 704 | 744 | .WhereIF(input.ConsumeLevel.HasValue, p => p.ConsumeLevel == input.ConsumeLevel.Value) |
| 705 | 745 | .WhereIF(minSleepDays.HasValue, p => p.SleepDays >= minSleepDays.Value) |
| 706 | 746 | .WhereIF(maxSleepDays.HasValue, p => p.SleepDays <= maxSleepDays.Value) |
| 747 | + .WhereIF(minRemainingRights.HasValue, p => p.RemainingRightsAmount >= minRemainingRights.Value) | |
| 748 | + .WhereIF(maxRemainingRights.HasValue, p => p.RemainingRightsAmount <= maxRemainingRights.Value) | |
| 707 | 749 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) |
| 708 | 750 | .WhereIF(queryYanglsr != null, p => p.Yanglsr >= new DateTime(startYanglsr.ToDate().Year, startYanglsr.ToDate().Month, startYanglsr.ToDate().Day, 0, 0, 0)) |
| 709 | 751 | .WhereIF(queryYanglsr != null, p => p.Yanglsr <= new DateTime(endYanglsr.ToDate().Year, endYanglsr.ToDate().Month, endYanglsr.ToDate().Day, 23, 59, 59)) | ... | ... |