diff --git a/pages/main/inventory.vue b/pages/main/inventory.vue index c5ca9fd..8525b0f 100644 --- a/pages/main/inventory.vue +++ b/pages/main/inventory.vue @@ -2,27 +2,29 @@ 返回科室汇总 - + + + 🔍 + + - --> - + - + 📭 - 本日医废数据为空 + {{searchKeyword ? '未找到匹配的科室' : '本日医废数据为空'}} - + @@ -74,7 +76,19 @@ name: '', duty: '', stockBasisInfo: [], - stockDetailsInfo: [] + stockDetailsInfo: [], + searchKeyword: '' + } + }, + computed: { + // 过滤后的数据 + filteredData() { + if (!this.searchKeyword) { + return this.stockDetailsInfo + } + return this.stockDetailsInfo.filter(item => + item.department && item.department.includes(this.searchKeyword) + ) } }, mounted(){ @@ -95,11 +109,19 @@ this.itemShow = true } }, + // 搜索输入事件 + onSearchInput() { + // 通过计算属性自动过滤 + }, + // 清除搜索 + clearSearch() { + this.searchKeyword = '' + }, // 获取库存的基本信息 getStockBasisInfo(){ let that = this; uni.request({ - url: 'https://lekapi.opmonitor.com/?c=app_api&a=getStockBasisInfo', + url: 'https://mtx.mini.opmonitor.com/?c=app_api&a=getStockBasisInfo', data: {hospital: that.hospital, sortHospital: that.sortHospital, department: that.department, duty: that.duty}, header: { 'Content-type': 'application/json' @@ -116,7 +138,7 @@ getStockDetailsInfo(){ let that = this; uni.request({ - url: 'https://lekapi.opmonitor.com/?c=app_api&a=getStockDetailsInfo', + url: 'https://mtx.mini.opmonitor.com/?c=app_api&a=getStockDetailsInfo', data: {hospital: that.hospital, sortHospital: that.sortHospital, department: that.department, duty: that.duty}, header: { 'Content-type': 'applicaation/json' @@ -139,6 +161,37 @@ height: 100Vh; } + /* 搜索容器 */ + .search-container { + padding: 20rpx; + background-color: #fff; + } + + .search-box { + display: flex; + align-items: center; + padding: 20rpx 30rpx; + background-color: #f5f5f5; + border-radius: 50rpx; + } + + .search-icon { + font-size: 32rpx; + margin-right: 16rpx; + } + + .search-input { + flex: 1; + font-size: 28rpx; + color: #333; + } + + .clear-icon { + font-size: 32rpx; + color: #999; + padding: 10rpx; + } + .show { display: block; }