diff --git a/pages/plugin/inList.vue b/pages/plugin/inList.vue index a0b9bfe..24ea8cb 100644 --- a/pages/plugin/inList.vue +++ b/pages/plugin/inList.vue @@ -3,10 +3,23 @@ 返回入库列表 + + + + 🔍 + + + - + 📦 - 暂无入库数据 + {{searchKeyword ? '未找到匹配的入库批次' : '暂无入库数据'}} @@ -57,6 +70,7 @@ name: '', duty: '', inListData: [], + searchKeyword: '', currentPage: 1, pageSize: 20, totalItems: 0, @@ -64,14 +78,28 @@ } }, computed: { + filteredInListData() { + if (!this.searchKeyword) { + return this.inListData + } + return this.inListData.filter(item => { + return item.in_ware_batch && item.in_ware_batch.includes(this.searchKeyword) + }) + }, currentPageData() { const start = (this.currentPage - 1) * this.pageSize const end = start + this.pageSize - return this.inListData.slice(start, end) + return this.filteredInListData.slice(start, end) } }, watch: { inListData(newVal) { + this.currentPage = 1 + }, + searchKeyword() { + this.currentPage = 1 + }, + filteredInListData(newVal) { this.totalItems = newVal.length this.totalPages = Math.ceil(this.totalItems / this.pageSize) if (this.currentPage > this.totalPages && this.totalPages > 0) { @@ -122,6 +150,10 @@ } else if (direction === 'next' && this.currentPage < this.totalPages) { this.currentPage++ } + }, + // 清空搜索 + clearSearch() { + this.searchKeyword = '' } } } @@ -133,6 +165,39 @@ height: 100vh; } + /* 搜索框 */ + .search-box { + margin: 12rpx; + padding: 0 24rpx; + background-color: #fff; + border-radius: 30rpx; + display: flex; + align-items: center; + box-shadow: 0 2rpx 12rpx rgba(74, 144, 226, 0.15); + border: 1px solid #e1e8f0; + } + + .search-input { + flex: 1; + height: 70rpx; + font-size: 26rpx; + color: #333; + } + + .search-placeholder { + color: #999; + } + + .search-icon, .clear-icon { + font-size: 28rpx; + margin-left: 10rpx; + } + + .clear-icon { + color: #999; + padding: 10rpx; + } + /* 空数据容器 */ .empty-container { display: flex; diff --git a/pages/plugin/outDetails.vue b/pages/plugin/outDetails.vue new file mode 100644 index 0000000..67ff12c --- /dev/null +++ b/pages/plugin/outDetails.vue @@ -0,0 +1,338 @@ + + + + + diff --git a/pages/plugin/outList.vue b/pages/plugin/outList.vue new file mode 100644 index 0000000..5afe52a --- /dev/null +++ b/pages/plugin/outList.vue @@ -0,0 +1,362 @@ + + + + +