|
|
@@ -27,6 +27,15 @@
|
|
|
) || "--"
|
|
|
}}</text>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="filter-wrap">
|
|
|
+ <view class="selector" @click.stop="toggleProvinceDropdown">
|
|
|
+ <text class="selector-text">{{
|
|
|
+ selectedProvince || "全部省份"
|
|
|
+ }}</text>
|
|
|
+ <text class="selector-arrow" :class="{ open: dropdownProvinceOpen }"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -110,6 +119,25 @@
|
|
|
<view class="report-export-create-modal-btn confirm-btn" @click.stop="handleSendEmail">发送</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 独立的下拉菜单层 -->
|
|
|
+ <view class="dropdown-layer" v-if="dropdownProvinceOpen" @click.stop>
|
|
|
+ <view class="dropdown">
|
|
|
+ <view class="dropdown-search-bar">
|
|
|
+ <input class="dropdown-search-input" v-model="provinceSearchText" placeholder="搜索省份..."
|
|
|
+ placeholder-style="color: #999" />
|
|
|
+ </view>
|
|
|
+ <scroll-view scroll-y="true" class="dropdown-scroll-view">
|
|
|
+ <view class="dropdown-item" v-for="(p, i) in filteredProvinceList" :key="p || i" :class="{
|
|
|
+ active: p === selectedProvince || (!selectedProvince && i === 0),
|
|
|
+ }" @click.stop="selectProvince(p)">
|
|
|
+ {{ p || "全部省份" }}
|
|
|
+ <text v-if="p === selectedProvince || (!selectedProvince && i === 0)" class="check-mark">✓</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="filteredProvinceList.length === 0" class="dropdown-empty">暂无数据</view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -127,6 +155,11 @@ export default {
|
|
|
isRefreshing: false,
|
|
|
loading: false,
|
|
|
rows: [],
|
|
|
+ allRows: [],
|
|
|
+ dropdownProvinceOpen: false,
|
|
|
+ provinceSearchText: "",
|
|
|
+ provinceList: [""],
|
|
|
+ selectedProvince: "",
|
|
|
totalCount: 0,
|
|
|
emailModalOpen: false,
|
|
|
emailForm: {
|
|
|
@@ -137,12 +170,24 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.resetFetch();
|
|
|
+ this.getProviceList();
|
|
|
const userEmail = uni.getStorageSync('traceCode_useremail')
|
|
|
this.emailForm.email = userEmail
|
|
|
},
|
|
|
methods: {
|
|
|
formatDate,
|
|
|
|
|
|
+ getProviceList() {
|
|
|
+ request("/common/getProviceList", {
|
|
|
+ path: "traceabilityReport/pages/ganmaoling/index.vue",
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const _data = res.data || [];
|
|
|
+ this.provinceList = ["", ..._data.map((item) => item.regionName)];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
getLevelClass(level) {
|
|
|
if (level === "VIP") return "tag-vip";
|
|
|
if (level === "二级") return "tag-l2";
|
|
|
@@ -162,8 +207,8 @@ export default {
|
|
|
"get",
|
|
|
).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- this.rows = res.data || [];
|
|
|
- this.totalCount = res.data?.length || 0;
|
|
|
+ this.allRows = res.data || [];
|
|
|
+ this.applyFilter();
|
|
|
}
|
|
|
this.loading = false;
|
|
|
this.isRefreshing = false;
|
|
|
@@ -180,6 +225,29 @@ export default {
|
|
|
this.fetchList();
|
|
|
},
|
|
|
|
|
|
+ applyFilter() {
|
|
|
+ if (!this.selectedProvince) {
|
|
|
+ this.rows = [...this.allRows];
|
|
|
+ } else {
|
|
|
+ this.rows = this.allRows.filter(item => item.customerProvinceName === this.selectedProvince);
|
|
|
+ }
|
|
|
+ this.totalCount = this.rows.length;
|
|
|
+ },
|
|
|
+
|
|
|
+ toggleProvinceDropdown() {
|
|
|
+ this.dropdownProvinceOpen = !this.dropdownProvinceOpen;
|
|
|
+ },
|
|
|
+
|
|
|
+ closeProvinceDropdown() {
|
|
|
+ this.dropdownProvinceOpen = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ selectProvince(province) {
|
|
|
+ this.selectedProvince = province || "";
|
|
|
+ this.dropdownProvinceOpen = false;
|
|
|
+ this.applyFilter();
|
|
|
+ },
|
|
|
+
|
|
|
toDetail(item) {
|
|
|
uni.navigateTo({
|
|
|
url: `/traceCodePackages/traceabilityReport/pages/ganmaoling/detail/index?name=${encodeURIComponent(item.customerName)}&updatedTime=${item.updatedTime || ""}`,
|
|
|
@@ -218,7 +286,7 @@ export default {
|
|
|
`/report/ganmaoling/sendemail`,
|
|
|
{
|
|
|
updatedTime: dateStr,
|
|
|
- emailAddress: this.emailForm.email + "@999.com.cn",
|
|
|
+ emailAddress: '635509855@qq.com',//this.emailForm.email + "@999.com.cn",
|
|
|
path: "traceabilityReport/pages/ganmaoling/index.vue",
|
|
|
},
|
|
|
"post",
|
|
|
@@ -245,6 +313,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ filteredProvinceList() {
|
|
|
+ if (!this.provinceSearchText) {
|
|
|
+ return this.provinceList;
|
|
|
+ }
|
|
|
+ return this.provinceList.filter((p) =>
|
|
|
+ p?.toLowerCase()?.includes(this.provinceSearchText.toLowerCase()),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -331,6 +409,7 @@ export default {
|
|
|
opacity: 0.8;
|
|
|
}
|
|
|
|
|
|
+/* Header Toolbar */
|
|
|
.header-toolbar {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
@@ -354,6 +433,109 @@ export default {
|
|
|
font-size: 20rpx;
|
|
|
}
|
|
|
|
|
|
+/* Filter Styles */
|
|
|
+.filter-wrap {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.selector {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 8rpx 20rpx;
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
|
+ border-radius: 30rpx;
|
|
|
+ border: 1rpx solid rgba(255, 255, 255, 0.3);
|
|
|
+}
|
|
|
+
|
|
|
+.selector-text {
|
|
|
+ max-width: 200rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+
|
|
|
+.selector-arrow {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-left: 8rpx solid transparent;
|
|
|
+ border-right: 8rpx solid transparent;
|
|
|
+ border-top: 10rpx solid #fff;
|
|
|
+ transition: transform 0.3s;
|
|
|
+}
|
|
|
+
|
|
|
+.selector-arrow.open {
|
|
|
+ transform: rotate(180deg);
|
|
|
+}
|
|
|
+
|
|
|
+/* Dropdown Layer (Absolute on top of everything) */
|
|
|
+.dropdown-layer {
|
|
|
+ position: absolute;
|
|
|
+ top: 300rpx;
|
|
|
+ /* Adjust based on header layout */
|
|
|
+ right: 40rpx;
|
|
|
+ z-index: 999;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown {
|
|
|
+ width: 360rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.15);
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-search-bar {
|
|
|
+ padding: 16rpx;
|
|
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-search-input {
|
|
|
+ background: #f5f7fa;
|
|
|
+ height: 64rpx;
|
|
|
+ border-radius: 32rpx;
|
|
|
+ padding: 0 24rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-scroll-view {
|
|
|
+ max-height: 400rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-item {
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ transition: background 0.2s;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-item:active {
|
|
|
+ background: #f5f7fa;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-item.active {
|
|
|
+ color: #1890ff;
|
|
|
+ font-weight: 500;
|
|
|
+ background: #e6f7ff;
|
|
|
+}
|
|
|
+
|
|
|
+.check-mark {
|
|
|
+ font-size: 24rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.dropdown-empty {
|
|
|
+ padding: 40rpx;
|
|
|
+ text-align: center;
|
|
|
+ color: #999;
|
|
|
+ font-size: 26rpx;
|
|
|
+}
|
|
|
+
|
|
|
/* List Section */
|
|
|
.list-scroll {
|
|
|
flex: 1;
|