From 79d410680b500d5673bf645eb27ca8dab21ec69b Mon Sep 17 00:00:00 2001
From: zm2000 <18386612143@163.com>
Date: Mon, 23 Nov 2026 15:04:24 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=93=E4=BD=8D=E6=9F=A5=E8=AF=A2?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AD=9B=E9=80=89=E4=B8=8E=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=BA=93=E4=BD=8D=E5=BE=85=E7=A7=BB=E5=BA=93?=
=?UTF-8?q?=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 库位查询页新增筛选功能(全部/库存>0/可移库存>0/两者),并新增底部合计栏
- 库位查询支持 ?space_id 直接按库位ID查询、?filter_type 预置筛选条件
- 优化库存/可移库存展示:库存=可用数量+锁定数量,字段缺失时回退原始库存字段
- 首页新增「未移库临时库位 / 未移库临时库位可分配储位」待移库商品种类数统计
- 顶部统计面板仅展示看板类统计,临时库位两项仅在走马灯与通知弹窗展示
- 通知弹窗临时库位项支持点击跳转库位查询(带库位ID并预置库存>0筛选)
- 修复 u-popup 圆角属性(border-radius 改为 round)
- 版本号升级 1.0.147 → 1.0.148
---
package.json | 2 +-
src/manifest.json | 4 +-
src/pages/index/index.vue | 129 ++++++++-
src/pages/warehouse/locationInquiry.vue | 346 ++++++++++++++++++++++--
4 files changed, 449 insertions(+), 32 deletions(-)
diff --git a/package.json b/package.json
index b79e542..985be48 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "wms-pda",
- "version": "1.0.147",
+ "version": "1.0.148",
"private": true,
"description": "天豹云仓 WMS_PDA(uni-app Vue2 + @vue/cli 4.5)",
"scripts": {
diff --git a/src/manifest.json b/src/manifest.json
index f341bd4..eb7e0a0 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -2,8 +2,8 @@
"name" : "WMS_PDA",
"appid" : "__UNI__0B3DAD3",
"description" : "多平台快速开发的UI框架",
- "versionName" : "1.0.147",
- "versionCode" : 1000147,
+ "versionName" : "1.0.148",
+ "versionCode" : 1000148,
"transformPx" : false,
"app-plus" : {
"statusbar" : {
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 2b9cd3c..8321ef7 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -3,9 +3,9 @@
@@ -130,7 +175,10 @@ export default {
querying: false,
queried: false,
spaceInfo: null,
- goodsList: []
+ goodsList: [],
+ // 筛选(仅支持:可移库存 > 0 / 库存 > 0)
+ filterVisible: false,
+ filterType: ''
}
},
computed: {
@@ -139,14 +187,55 @@ export default {
const s = this.spaceInfo;
if (!s) return '--';
return String(s.custom_name ?? s.customName ?? s.space_code ?? s.spaceCode ?? s.name ?? '--').trim() || '--';
+ },
+ // 过滤后的商品列表(不改动原始 goodsList)
+ displayGoodsList() {
+ if (!this.filterType) {
+ return this.goodsList;
+ }
+ if (this.filterType === 'both') {
+ return this.goodsList.filter(goods => {
+ const available = this.sortQuantityOf(goods, false);
+ const stock = this.sortQuantityOf(goods, true);
+ return available !== null && available > 0 && stock !== null && stock > 0;
+ });
+ }
+ const isStock = this.filterType === 'stock';
+ return this.goodsList.filter(goods => {
+ const v = this.sortQuantityOf(goods, isStock);
+ return v !== null && v > 0;
+ });
+ },
+ activeFilterLabel() {
+ if (this.filterType === 'available') {
+ return '可移库存 大于 0';
+ }
+ if (this.filterType === 'stock') {
+ return '库存 大于 0';
+ }
+ if (this.filterType === 'both') {
+ return '库存 大于 0 且 可移库存 大于 0';
+ }
+ return '';
}
},
onLoad(options = {}) {
- // 支持通过 ?keyword=xxx 预填库位编码/条码并自动查询
- const preset = String(options.keyword || '').trim();
- if (preset) {
- this.keyword = preset;
- this.$nextTick(() => this.handleQuery());
+ // 支持 ?space_id=xxx 直接按库位ID查询
+ const presetId = String(options.space_id || '').trim();
+ if (presetId) {
+ this.$nextTick(() => this.querySpace(presetId));
+ } else {
+ // 支持通过 ?keyword=xxx 预填库位编码/条码并自动查询
+ const preset = String(options.keyword || '').trim();
+ if (preset) {
+ this.keyword = preset;
+ this.$nextTick(() => this.handleQuery());
+ }
+ }
+ // 支持 ?filter_type=xxx 预置筛选条件(stock=库存>0 等)
+ const presetFilter = String(options.filter_type || '').trim();
+ if (presetFilter) {
+ this.filterType = presetFilter;
}
this.safeDispatchBroadcast('setCallbacks', { onResult: this.handleBroadcastResult });
this.safeDispatchBroadcast('start');
@@ -200,6 +289,42 @@ export default {
toast(title, icon = 'none') {
uni.showToast({ title, icon });
},
+ // 提取用于筛选的数值:stock=库存(可用 + 锁定),available=可移库存
+ sortQuantityOf(goods, isStock) {
+ if (!goods || typeof goods !== 'object') {
+ return null;
+ }
+ if (isStock) {
+ // 库存 = 可用数量 + 锁定数量,都取不到时回退原始库存字段
+ const locked = this.goodsLockedQuantity(goods);
+ const available = this.goodsAvailableQuantity(goods, locked);
+ if (available !== null || locked !== null) {
+ return (available === null ? 0 : available) + (locked === null ? 0 : locked);
+ }
+ return this.goodsToNumberOrNull(
+ goods.quantity
+ ?? goods.actual_quantity
+ ?? goods.stock
+ ?? goods.total_quantity
+ ?? goods.qty
+ );
+ }
+ return this.goodsToNumberOrNull(
+ goods.available_quantity
+ ?? goods.movable_quantity
+ ?? goods.moveable_quantity
+ ?? goods.can_move_quantity
+ ?? goods.free_quantity
+ ?? goods.usable_quantity
+ );
+ },
+ openFilter() {
+ this.filterVisible = true;
+ },
+ applyFilterType(type) {
+ this.filterType = type;
+ this.filterVisible = false;
+ },
handleBack() {
const pages = getCurrentPages();
if (pages.length > 1) {
@@ -236,13 +361,88 @@ export default {
goodsStoreName(goods) {
return String(goods?.store_name ?? '').trim() || '--';
},
+ // 总数量:参考商品查询页,库存 = 可用数量 + 锁定数量,都取不到时回退原始库存字段
goodsCount(goods) {
- const v = goods?.quantity;
- return v === null || v === undefined || v === '' ? '--' : String(v);
+ if (!goods || typeof goods !== 'object') {
+ return '--';
+ }
+ const locked = this.goodsLockedQuantity(goods);
+ const available = this.goodsAvailableQuantity(goods, locked);
+ if (available !== null || locked !== null) {
+ return String((available === null ? 0 : available) + (locked === null ? 0 : locked));
+ }
+ return this.goodsValueOrDash(
+ goods.quantity
+ ?? goods.actual_quantity
+ ?? goods.stock
+ ?? goods.total_quantity
+ ?? goods.qty
+ );
},
+ // 可移数量:参考商品查询页,直接取可用数量字段
goodsCopyCount(goods) {
- const v = goods?.available_quantity;
- return v === null || v === undefined || v === '' ? '--' : String(v);
+ if (!goods || typeof goods !== 'object') {
+ return '--';
+ }
+ return this.goodsValueOrDash(
+ goods.available_quantity
+ ?? goods.movable_quantity
+ ?? goods.moveable_quantity
+ ?? goods.can_move_quantity
+ ?? goods.free_quantity
+ ?? goods.usable_quantity
+ );
+ },
+ goodsLockedQuantity(goods) {
+ if (!goods || typeof goods !== 'object') {
+ return null;
+ }
+ return this.goodsToNumberOrNull(
+ goods.locked_quantity
+ ?? goods.lock_quantity
+ ?? goods.frozen_quantity
+ ?? goods.freeze_quantity
+ );
+ },
+ goodsAvailableQuantity(goods, locked = null) {
+ if (!goods || typeof goods !== 'object') {
+ return null;
+ }
+ const available = this.goodsToNumberOrNull(
+ goods.available_quantity
+ ?? goods.movable_quantity
+ ?? goods.moveable_quantity
+ ?? goods.can_move_quantity
+ ?? goods.free_quantity
+ ?? goods.usable_quantity
+ );
+ if (available !== null) {
+ return available;
+ }
+ const quantity = this.goodsToNumberOrNull(
+ goods.quantity
+ ?? goods.actual_quantity
+ ?? goods.stock
+ ?? goods.total_quantity
+ ?? goods.qty
+ );
+ if (quantity !== null && locked !== null) {
+ return quantity - locked;
+ }
+ return null;
+ },
+ goodsToNumberOrNull(value) {
+ if (value === null || value === undefined || value === '') {
+ return null;
+ }
+ const num = Number(value);
+ return Number.isNaN(num) ? null : num;
+ },
+ goodsValueOrDash(value) {
+ if (value === null || value === undefined || value === '') {
+ return '--';
+ }
+ return String(value);
},
// 商品图片:优先取已拉取的 images 列表,其次商品/库存对象上的单图字段
goodsImage(goods) {
@@ -581,8 +781,18 @@ export default {
color: #333;
}
-.header__placeholder {
- width: 80rpx;
+.header__filter {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #2979ff;
+ border-radius: 8rpx;
+}
+
+.header__filter-text {
+ font-size: 36rpx;
+ color: #ffffff;
+ padding: 8rpx 20rpx;
}
.content_box {
@@ -812,8 +1022,106 @@ export default {
/* 底部安全区 */
.safe-area-bottom {
- height: constant(safe-area-inset-bottom);
- height: env(safe-area-inset-bottom);
+ height: calc(40rpx + constant(safe-area-inset-bottom));
+ height: calc(40rpx + env(safe-area-inset-bottom));
+}
+
+/* 底部合计栏 */
+.total-bar {
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 20rpx 24rpx;
+ padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
+ padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
+ background: #ffffff;
+ border-top: 1rpx solid #f0f0f0;
+}
+
+.total-bar__label {
+ font-size: 36rpx;
+ color: #606266;
+}
+
+.total-bar__left {
+ display: flex;
+ align-items: center;
+}
+
+.total-bar__filter {
+ margin-left: 8rpx;
+ font-size: 34rpx;
+ color: #FF8C42;
+}
+
+.total-bar__value {
+ font-size: 38rpx;
+ font-weight: bold;
+ color: #2979ff;
+}
+
+/* 筛选弹窗 */
+.filter-panel {
+ background: #ffffff;
+ border-radius: 20px 20px 0 0;
+ overflow: hidden;
+ padding: 32rpx 24rpx 40rpx;
+ box-sizing: border-box;
+}
+
+.filter-panel__header {
+ text-align: center;
+ padding-bottom: 20rpx;
+}
+
+.filter-panel__title {
+ font-size: 40rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.filter-panel__options {
+ display: flex;
+ flex-wrap: wrap;
+ margin: -8rpx;
+}
+
+.filter-panel__option {
+ flex: 0 0 calc(50% - 16rpx);
+ margin: 8rpx;
+ box-sizing: border-box;
+ padding: 24rpx 0;
+ text-align: center;
+ background: #f6f8fb;
+ border-radius: 12rpx;
+ font-size: 36rpx;
+ color: #606266;
+}
+
+.filter-panel__option--active {
+ background: #eaf2ff;
+ color: #2979ff;
+ font-weight: 600;
+}
+
+.filter-panel__actions {
+ display: flex;
+ margin-top: 32rpx;
+}
+
+.filter-panel__btn {
+ flex: 1;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ border-radius: 12rpx;
+ font-size: 36rpx;
+}
+
+.filter-panel__btn--close {
+ background: #f6f8fb;
+ color: #606266;
}
/* 库位选择弹窗 */