From 7d815082555cb538bad8d5fd5b28f3dd745f7bf8 Mon Sep 17 00:00:00 2001
From: zm2000 <18386612143@163.com>
Date: Mon, 4 May 2026 18:19:05 +0800
Subject: [PATCH] feat(order-picking): add picking mode and picking detail
workflow
---
pages.json | 14 +
pages/home/edit-quick-actions.vue | 3 +-
pages/index/index.vue | 53 ++--
pages/work/order/detail.vue | 288 ++++++++++++++++++
pages/work/order/picking.vue | 479 ++++++++++++++++++++++++++++++
5 files changed, 817 insertions(+), 20 deletions(-)
create mode 100644 pages/work/order/detail.vue
create mode 100644 pages/work/order/picking.vue
diff --git a/pages.json b/pages.json
index 58d103f..6a3517f 100644
--- a/pages.json
+++ b/pages.json
@@ -141,6 +141,20 @@
{
"titleNView": false
}
+ },
+ {
+ "path" : "pages/work/order/picking",
+ "style" :
+ {
+ "titleNView": false
+ }
+ },
+ {
+ "path" : "pages/work/order/detail",
+ "style" :
+ {
+ "titleNView": false
+ }
}
],
diff --git a/pages/home/edit-quick-actions.vue b/pages/home/edit-quick-actions.vue
index dcb7c96..19c4a26 100644
--- a/pages/home/edit-quick-actions.vue
+++ b/pages/home/edit-quick-actions.vue
@@ -313,6 +313,7 @@
toPath(item) {
const menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
+ const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货'));
const rawPath = item?.component || item?.path || '';
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation';
@@ -326,7 +327,7 @@
}
const targetPath = isGoodsQuery
? '/pages/work/product/query'
- : normalizedPath;
+ : (isOrderPicking ? '/pages/work/order/picking' : normalizedPath);
if (!targetPath) {
uni.showToast({
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a3e9b99..c7ff6c2 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -289,6 +289,26 @@
},
methods: {
+ async getLatestUserInfo() {
+ try {
+ const latestUser = await this.$store.dispatch('getUserInfo');
+ if (latestUser && typeof latestUser === 'object') {
+ this.userInfo = latestUser;
+ return latestUser;
+ }
+ } catch (error) {
+ console.warn('拉取最新用户信息失败,回退本地用户缓存:', error);
+ }
+
+ const fallbackUser = this.$store.getters.user || this.userInfo || null;
+ if (fallbackUser && typeof fallbackUser === 'object') {
+ this.userInfo = fallbackUser;
+ return fallbackUser;
+ }
+
+ return null;
+ },
+
createDefaultDragPreviewSnapshot() {
return {
name: '未命名菜单',
@@ -439,21 +459,7 @@
},
async loadUserInfo() {
- // 等待用户信息加载
- await new Promise(resolve => setTimeout(resolve, 100));
-
- if (!this.$store.getters.user) {
- console.log('等待用户信息...');
- setTimeout(() => this.loadUserInfo(), 100);
- return;
- }
-
- const userData = this.$store.getters.user;
- if (userData) {
- this.isLoading = false;
- this.userInfo = userData;
- await this.refreshQuickActions();
- }
+ await this.refreshQuickActions();
},
// 刷新快捷入口
@@ -461,8 +467,16 @@
this.isLoading = true;
try {
+ const latestUser = await this.getLatestUserInfo();
+ if (!latestUser) {
+ console.log('用户信息不可用,快捷入口置空');
+ this.quickActions = [];
+ this.ensureCurrentPageInRange();
+ return;
+ }
+
// 1. 获取用户当前可用的菜单
- const userMenus = this.getUserMenus();
+ const userMenus = this.getUserMenus(latestUser);
const latestActions = this.processMenus(userMenus, null);
// 2. 从Vuex获取已固定的菜单
@@ -1040,8 +1054,8 @@
},
// 获取用户菜单
- getUserMenus() {
- const user = this.$store.getters.user;
+ getUserMenus(userData = null) {
+ const user = userData || this.userInfo || this.$store.getters.user;
if (!user) return [];
// 从用户信息中获取菜单
@@ -1133,6 +1147,7 @@
toPath(item) {
const menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
+ const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货'));
const rawPath = item?.component || item?.path || '';
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation';
@@ -1146,7 +1161,7 @@
}
const targetPath = isGoodsQuery
? '/pages/work/product/query'
- : normalizedPath;
+ : (isOrderPicking ? '/pages/work/order/picking' : normalizedPath);
if (!targetPath) {
uni.showToast({
diff --git a/pages/work/order/detail.vue b/pages/work/order/detail.vue
new file mode 100644
index 0000000..22c63c5
--- /dev/null
+++ b/pages/work/order/detail.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+ {{ orderInfo.orderNo || '--' }}
+ {{ pickModeText }}
+
+ 客户:{{ orderInfo.customerName || '--' }}
+ 波次:{{ orderInfo.waveNo || '--' }}
+ 状态:{{ statusText }}
+ 拣货进度:{{ orderInfo.pickedQty || 0 }}/{{ orderInfo.needQty || 0 }}
+
+
+ 拣货明细
+
+
+
+ {{ line.skuName }}
+ {{ line.space }}
+
+ SKU:{{ line.skuCode }}
+ 条码:{{ line.barcode || '--' }}
+ 应拣:{{ line.needQty }}
+ 已拣:{{ line.pickedQty }}
+
+
+
+
+ 开始拣货
+ 完成拣货
+ 已完成
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/work/order/picking.vue b/pages/work/order/picking.vue
new file mode 100644
index 0000000..b37622e
--- /dev/null
+++ b/pages/work/order/picking.vue
@@ -0,0 +1,479 @@
+
+
+
+
+
+
+
+
+ 暂无订单
+
+
+
+
+ 客户:{{ item.customerName || '--' }}
+ 波次:{{ item.waveNo || '--' }}
+ SKU数:{{ item.skuCount }}
+ 应拣数量:{{ item.needQty }}
+ 已拣数量:{{ item.pickedQty }}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file