|
|
@@ -12,16 +12,30 @@
|
|
|
<text class="stat-unit">家</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="update-tip">
|
|
|
- <text class="tip-icon">🕒</text>
|
|
|
- <text
|
|
|
- >数据更新时间:{{
|
|
|
- formatDate(
|
|
|
- new Date().setDate(new Date().getDate() - 1),
|
|
|
- "YYYY-MM-DD",
|
|
|
- ) || "--"
|
|
|
- }}</text
|
|
|
- >
|
|
|
+ <view class="header-toolbar">
|
|
|
+ <view class="update-tip">
|
|
|
+ <text class="tip-icon">🕒</text>
|
|
|
+ <text
|
|
|
+ >更新:{{
|
|
|
+ formatDate(
|
|
|
+ new Date().setDate(new Date().getDate() - 1),
|
|
|
+ "YYYY-MM-DD",
|
|
|
+ ) || "--"
|
|
|
+ }}</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 class="header-circle circle-1"></view>
|
|
|
@@ -90,10 +104,49 @@
|
|
|
</scroll-view>
|
|
|
|
|
|
<view class="footer-btn-area">
|
|
|
+ <button class="action-btn history-btn" @click="handleHistory">
|
|
|
+ 历史记录
|
|
|
+ </button>
|
|
|
<button class="action-btn export-btn" @click="handleExport">
|
|
|
导出至邮箱
|
|
|
</button>
|
|
|
</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"
|
|
|
+ @input="onProvinceSearch"
|
|
|
+ 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>
|
|
|
|
|
|
@@ -102,7 +155,6 @@ import EmptyView from "../../../wigets/empty.vue";
|
|
|
import request from "../../../request/index.js";
|
|
|
import { formatDate } from "../../../utils/utils.js";
|
|
|
|
|
|
-const PROVINCES = ["北京市", "上海市", "广东省", "浙江省", "江苏省"];
|
|
|
const NATURES = ["协议客户", "非协议客户", "商业客户", "终端客户"];
|
|
|
|
|
|
export default {
|
|
|
@@ -118,14 +170,30 @@ export default {
|
|
|
hasMore: true,
|
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
|
+ dropdownProvinceOpen: false,
|
|
|
+ provinceSearchText: "",
|
|
|
+ provinceList: [""],
|
|
|
+ selectedProvince: "",
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.resetFetch();
|
|
|
+ this.getProviceList();
|
|
|
},
|
|
|
methods: {
|
|
|
formatDate,
|
|
|
|
|
|
+ getProviceList() {
|
|
|
+ request("/common/getProviceList", {
|
|
|
+ path: "traceabilityReport/pages/blacklist/index.vue",
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const _data = res.data || [];
|
|
|
+ this.provinceList = ["", ..._data.map((item) => item.regionName)];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
generateFakeData() {
|
|
|
const newRows = [];
|
|
|
const codes = [
|
|
|
@@ -135,6 +203,10 @@ export default {
|
|
|
"91441581761581268X",
|
|
|
"91510106768621824L",
|
|
|
];
|
|
|
+ const provinces =
|
|
|
+ this.provinceList.length > 1
|
|
|
+ ? this.provinceList.slice(1)
|
|
|
+ : ["北京市", "上海市", "广东省", "浙江省", "江苏省"];
|
|
|
|
|
|
const startIdx = (this.pageNum - 1) * this.pageSize;
|
|
|
const endIdx = Math.min(startIdx + this.pageSize, this.totalCount);
|
|
|
@@ -149,7 +221,7 @@ export default {
|
|
|
id: i,
|
|
|
receiverName: `测试收货企业${i + 1}有限公司`,
|
|
|
companyCode: codes[i % codes.length],
|
|
|
- receiverProvince: PROVINCES[i % PROVINCES.length],
|
|
|
+ receiverProvince: provinces[i % provinces.length],
|
|
|
customerNature: NATURES[i % NATURES.length],
|
|
|
});
|
|
|
}
|
|
|
@@ -201,6 +273,12 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ handleHistory() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/traceCodePackages/traceabilityReport/pages/blacklist/history/index",
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
handleExport() {
|
|
|
uni.showModal({
|
|
|
title: "导出至邮箱",
|
|
|
@@ -223,6 +301,29 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ toggleProvinceDropdown() {
|
|
|
+ this.dropdownProvinceOpen = !this.dropdownProvinceOpen;
|
|
|
+ },
|
|
|
+
|
|
|
+ closeProvinceDropdown() {
|
|
|
+ this.dropdownProvinceOpen = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ selectProvince(province) {
|
|
|
+ this.selectedProvince = province || "";
|
|
|
+ this.dropdownProvinceOpen = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ filteredProvinceList() {
|
|
|
+ if (!this.provinceSearchText) {
|
|
|
+ return this.provinceList;
|
|
|
+ }
|
|
|
+ return this.provinceList.filter((p) =>
|
|
|
+ p?.toLowerCase()?.includes(this.provinceSearchText.toLowerCase()),
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -292,6 +393,14 @@ export default {
|
|
|
opacity: 0.8;
|
|
|
}
|
|
|
|
|
|
+.header-toolbar {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ position: relative;
|
|
|
+ z-index: 3;
|
|
|
+}
|
|
|
+
|
|
|
.update-tip {
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
@@ -300,8 +409,6 @@ export default {
|
|
|
border-radius: 30rpx;
|
|
|
font-size: 22rpx;
|
|
|
backdrop-filter: blur(10px);
|
|
|
- position: relative;
|
|
|
- z-index: 2;
|
|
|
}
|
|
|
|
|
|
.tip-icon {
|
|
|
@@ -309,6 +416,108 @@ 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;
|
|
|
+}
|
|
|
+
|
|
|
/* Header Decor Circles */
|
|
|
.header-circle {
|
|
|
position: absolute;
|
|
|
@@ -503,10 +712,12 @@ export default {
|
|
|
bottom: 0;
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ gap: 24rpx;
|
|
|
}
|
|
|
|
|
|
.action-btn {
|
|
|
- width: 100%;
|
|
|
+ flex: 1;
|
|
|
height: 88rpx;
|
|
|
line-height: 88rpx;
|
|
|
border-radius: 44rpx;
|
|
|
@@ -525,6 +736,13 @@ export default {
|
|
|
transform: scale(0.96);
|
|
|
}
|
|
|
|
|
|
+.history-btn {
|
|
|
+ background: #fff;
|
|
|
+ color: #1890ff;
|
|
|
+ border: 2rpx solid #1890ff;
|
|
|
+ box-shadow: 0 4rpx 12rpx rgba(24, 144, 255, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
.export-btn {
|
|
|
background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
|
|
|
color: #fff;
|