From fc9730dfdc22876e8eda36d92235f8a4a0fc6d37 Mon Sep 17 00:00:00 2001
From: zhongwenkai <3478244299@qq.com>
Date: Tue, 23 Jun 2026 18:12:33 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=93=E5=82=A8=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E7=89=A9=E6=96=99=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/mes/sparepart.js | 9 +
src/locales/zh-CN.js | 18 +
src/pages.json | 14 +
.../pages/materialInventory/detail.vue | 288 ++++++++++
.../pages/materialInventory/index.vue | 534 ++++++++++++++++++
.../pages/sparepartInventory/detail.vue | 3 +-
.../pages/sparepartInventory/index.vue | 31 +-
src/utils/permissionMenu.js | 2 +
8 files changed, 872 insertions(+), 27 deletions(-)
create mode 100644 src/pages_function/pages/materialInventory/detail.vue
create mode 100644 src/pages_function/pages/materialInventory/index.vue
diff --git a/src/api/mes/sparepart.js b/src/api/mes/sparepart.js
index f54ab92..7f7bf50 100644
--- a/src/api/mes/sparepart.js
+++ b/src/api/mes/sparepart.js
@@ -75,6 +75,15 @@ export function getSparepartInventoryPage(params) {
})
}
+// 物料库存查询(分页)
+export function getMaterialInventoryPage(params) {
+ return request({
+ url: '/admin-api/erp/stock/page',
+ method: 'get',
+ params
+ })
+}
+
// 仓库简单列表
export function getWarehouseSimpleList() {
return request({
diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js
index 34b56b2..9157821 100644
--- a/src/locales/zh-CN.js
+++ b/src/locales/zh-CN.js
@@ -1730,5 +1730,23 @@ export default {
recentInTime: '最近入库',
recentOutTime: '最近出库',
empty: '暂无备件库存数据'
+ },
+ materialInventory: {
+ moduleName: '物料库存查询',
+ searchPlaceholder: '请输入物料编码或名称',
+ allArea: '全部库区',
+ areaPlaceholder: '库区筛选',
+ productName: '物料名称',
+ barCode: '物料编码',
+ warehouse: '仓库',
+ area: '库区',
+ count: '基本数量',
+ stockDisplay: '库存展示',
+ unit: '单位',
+ category: '物料小类',
+ packagingRule: '包装/换算规则',
+ recentInTime: '最近入库',
+ recentOutTime: '最近出库',
+ empty: '暂无物料库存数据'
}
}
diff --git a/src/pages.json b/src/pages.json
index ff272fb..0a15a39 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -535,6 +535,20 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "materialInventory/index",
+ "style": {
+ "navigationBarTitleText": "物料库存查询",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "materialInventory/detail",
+ "style": {
+ "navigationBarTitleText": "物料详情",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "materialInbound/index",
"style": {
diff --git a/src/pages_function/pages/materialInventory/detail.vue b/src/pages_function/pages/materialInventory/detail.vue
new file mode 100644
index 0000000..8bde891
--- /dev/null
+++ b/src/pages_function/pages/materialInventory/detail.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+ 物料基本信息
+
+
+
+
+
+ 📦
+
+
+ 物料名称{{ textValue(detail.name) }}
+ 物料编码{{ textValue(detail.barCode) }}
+ 物料小类{{ textValue(detail.categoryName) }}
+
+
+
+ 仓库{{ textValue(warehouseName) }}
+ 库区{{ textValue(areaName) }}
+ 库存展示{{ textValue(detail.stockDisplay) }}
+ 基本数量{{ textValue(stockCount) }}{{ stockUnit !== '-' ? stockUnit : '' }}
+ 包装/换算规则{{ textValue(packagingRule) }}
+ 最近入库{{ formatDateTime(recentInTime) }}
+ 最近出库{{ formatDateTime(recentOutTime) }}
+
+
+
+
+ 加载中...
+ 加载失败
+
+
+
+
+
+
diff --git a/src/pages_function/pages/materialInventory/index.vue b/src/pages_function/pages/materialInventory/index.vue
new file mode 100644
index 0000000..3a6f6ae
--- /dev/null
+++ b/src/pages_function/pages/materialInventory/index.vue
@@ -0,0 +1,534 @@
+
+
+
+
+
+
+
+
+
+ {{ selectedAreaLabel || t('materialInventory.allArea') }}
+
+
+ {{ t('functionCommon.reset') }}
+
+
+
+
+
+
+
+ {{ textValue(item.barCode) }}
+
+
+ {{ t('materialInventory.productName') }}
+ {{ textValue(item.productName) }}
+
+
+ {{ t('materialInventory.area') }}
+ {{ textValue(item.areaName) }}
+
+
+ {{ t('materialInventory.stockDisplay') }}
+ {{ textValue(item.stockDisplay) }}
+
+
+ {{ t('materialInventory.count') }}
+ {{ textValue(item.count) }}{{ textUnit(item.unitName) }}
+
+
+
+
+ {{ t('functionCommon.loading') }}
+ {{ t('materialInventory.empty') }}
+ {{ t('functionCommon.loadingMore') }}
+ {{ t('functionCommon.noMoreData') }}
+
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+ ✓
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages_function/pages/sparepartInventory/detail.vue b/src/pages_function/pages/sparepartInventory/detail.vue
index e572aaf..6793a34 100644
--- a/src/pages_function/pages/sparepartInventory/detail.vue
+++ b/src/pages_function/pages/sparepartInventory/detail.vue
@@ -26,8 +26,7 @@
仓库{{ textValue(warehouseName) }}
库区{{ textValue(areaName) }}
库存展示{{ textValue(detail.stockDisplay) }}
- 基本数量{{ textValue(stockCount) }}
- 单位{{ textValue(stockUnit) }}
+ 基本数量{{ textValue(stockCount) }}{{ stockUnit !== '-' ? stockUnit : '' }}
包装/换算规则{{ textValue(packagingRule) }}
最近入库{{ formatDateTime(recentInTime) }}
最近出库{{ formatDateTime(recentOutTime) }}
diff --git a/src/pages_function/pages/sparepartInventory/index.vue b/src/pages_function/pages/sparepartInventory/index.vue
index 000273e..0a9f01d 100644
--- a/src/pages_function/pages/sparepartInventory/index.vue
+++ b/src/pages_function/pages/sparepartInventory/index.vue
@@ -38,14 +38,6 @@
{{ t('sparepartInventory.productName') }}
{{ textValue(item.productName) }}
-
- {{ t('sparepartInventory.category') }}
- {{ textValue(item.categoryName) }}
-
-
- {{ t('sparepartInventory.warehouse') }}
- {{ textValue(item.warehouseName) }}
-
{{ t('sparepartInventory.area') }}
{{ textValue(item.areaName) }}
@@ -56,23 +48,7 @@
{{ t('sparepartInventory.count') }}
- {{ textValue(item.count) }}
-
-
- {{ t('sparepartInventory.unit') }}
- {{ textValue(item.unitName) }}
-
-
- {{ t('sparepartInventory.packagingRule') }}
- {{ textValue(item.packagingRule) }}
-
-
- {{ t('sparepartInventory.recentInTime') }}
- {{ formatDateTime(item.recentInTime) }}
-
-
- {{ t('sparepartInventory.recentOutTime') }}
- {{ formatDateTime(item.recentOutTime) }}
+ {{ textValue(item.count) }}{{ textUnit(item.unitName) }}
@@ -335,6 +311,11 @@ function textValue(value) {
return text || '-'
}
+function textUnit(v) {
+ if (v == null || v === '') return ''
+ return String(v).trim()
+}
+
function formatDateTime(value) {
if (!value) return '-'
if (Array.isArray(value) && value.length >= 3) {
diff --git a/src/utils/permissionMenu.js b/src/utils/permissionMenu.js
index e9a36b2..7042de1 100644
--- a/src/utils/permissionMenu.js
+++ b/src/utils/permissionMenu.js
@@ -113,6 +113,8 @@ const MENU_ROUTE_MAP = {
'物料出库': '/pages_function/pages/materialOutbound/index',
sparepartinventory: '/pages_function/pages/sparepartInventory/index',
'备件库存查询': '/pages_function/pages/sparepartInventory/index',
+ materialinventory: '/pages_function/pages/materialInventory/index',
+ '物料库存查询': '/pages_function/pages/materialInventory/index',
keypart: '/pages_function/pages/keypart/index',
product: '/pages_function/pages/product/index'
}