diff --git a/src/api/mes/moldget.js b/src/api/mes/moldget.js
index 44fdb21..c1d333a 100644
--- a/src/api/mes/moldget.js
+++ b/src/api/mes/moldget.js
@@ -61,3 +61,12 @@ export function getSimpleUserList() {
method: 'get'
})
}
+
+// 仓库库区列表(根据仓库ID获取)
+export function getWarehouseAreaSimpleList(warehouseId) {
+ return request({
+ url: '/admin-api/erp/warehouse-area/simple-list',
+ method: 'get',
+ params: { warehouseId }
+ })
+}
diff --git a/src/api/mes/sparepart.js b/src/api/mes/sparepart.js
new file mode 100644
index 0000000..7b7ba32
--- /dev/null
+++ b/src/api/mes/sparepart.js
@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+// 备件列表(分页查询全部产品,前端按 categoryType=5 过滤备件)
+export function getSparepartSimpleList(pageNo = 1) {
+ return request({
+ url: '/admin-api/erp/product/page',
+ method: 'get',
+ params: {
+ pageNo,
+ pageSize: 100
+ }
+ })
+}
diff --git a/src/api/mes/sparepartInbound.js b/src/api/mes/sparepartInbound.js
new file mode 100644
index 0000000..c4ff7a8
--- /dev/null
+++ b/src/api/mes/sparepartInbound.js
@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+// 备件入库单创建
+export function createSparepartInbound(data) {
+ return request({
+ url: '/admin-api/erp/stock-in/create',
+ method: 'post',
+ data: { ...data, inType: '备件入库' }
+ })
+}
+// 备件入库单分页查询(待入库/待审核)
+export function getSparepartInboundPage(params = {}) {
+ return request({
+ url: '/admin-api/erp/stock-in/page',
+ method: 'get',
+ params: { ...params, inType: '备件入库' }
+ })
+}
+
+// 备件入库单审核(status: 20=通过, 1=驳回)
+export function auditSparepartInbound(data) {
+ return request({
+ url: '/admin-api/erp/stock-in/audit',
+ method: 'put',
+ data
+ })
+}
+
+// 备件入库单删除
+export function deleteSparepartInbound(id) {
+ return request({
+ url: '/admin-api/erp/stock-in/delete',
+ method: 'delete',
+ params: { ids: String(id) }
+ })
+}
diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js
index ea2ae7f..4529fc8 100644
--- a/src/locales/zh-CN.js
+++ b/src/locales/zh-CN.js
@@ -749,7 +749,7 @@ export default {
barCode: '物料条码',
name: '物料名称',
category: '物料分类',
- unit: '单位',
+ unit: '库存单位',
standard: '规格',
expiryDay: '保质期天数',
status: '状态',
@@ -787,7 +787,7 @@ export default {
code: 'BOM编码',
version: '版本',
product: '产品',
- unit: '单位',
+ unit: '库存单位',
yieldRate: '良品率',
isEnable: '是否启用',
enableYes: '是',
@@ -1364,5 +1364,46 @@ export default {
validatorRepairStatusRequired: '请选择维修结果',
validatorFinishDateRequired: '请选择完成日期',
validatorConfirmDateRequired: '请选择验收日期'
+ },
+ sparepartInbound: {
+ moduleName: '备件入库',
+ tabPending: '待提交',
+ tabAuditing: '待审核',
+ searchPlaceholder: '搜索入库单号',
+ sparepartInfo: '备件信息',
+ inboundTime: '入库时间',
+ creator: '创建人',
+ quantity: '数量',
+ reviewer: '审核人',
+ approve: '已通过',
+ reject: '驳回',
+ confirmApprove: '确定审核通过该入库单吗?',
+ confirmReject: '确定驳回该入库单吗?',
+ approveSuccess: '审核通过',
+ rejectSuccess: '已驳回',
+ deleteSuccess: '删除成功',
+ empty: '暂无入库单据',
+ createTitle: '新增备件入库',
+ scanSparepart: '扫备件码',
+ selectSparepart: '选择备件',
+ searchSparepartPlaceholder: '搜索备件编码/名称',
+ sparepartCode: '备件编码',
+ category: '分类',
+ spec: '规格',
+ unit: '库存单位',
+ purchaseUnit: '采购单位',
+ convertRatio: '换算关系',
+ defaultWarehouse: '默认仓库/库区',
+ selectSparepart: '选择备件',
+ selectedSpareparts: '已选备件',
+ noSelectedSparepart: '请扫码或选择备件',
+ alreadySelected: '该备件已添加',
+ confirmRemove: '确定移除此备件吗?',
+ currentStock: '当前库存',
+ minStockUnit: '最小库存单位',
+ inboundQuantity: '入库数量',
+ qtyPlaceholder: '请输入',
+ noSparepartData: '暂无备件数据',
+ validatorSparepartRequired: '请选择备件'
}
}
diff --git a/src/pages.json b/src/pages.json
index 5ca6cd6..f4c1a77 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -365,6 +365,30 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "sparepartInbound/index",
+ "style": {
+ "navigationBarTitleText": "备件入库",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "sparepartInbound/create",
+ "style": {
+ "navigationBarTitleText": "新增备件入库",
+ "navigationStyle": "custom"
+ }
+ },
+
+
+ {
+ "path": "sparepartInbound/sparepartSelect",
+ "style": {
+ "navigationBarTitleText": "选择备件",
+ "navigationStyle": "custom"
+ }
+ },
+
{
"path": "keypart/index",
"style": {
diff --git a/src/pages_function/pages/sparepartInbound/create.vue b/src/pages_function/pages/sparepartInbound/create.vue
new file mode 100644
index 0000000..9c9c8ad
--- /dev/null
+++ b/src/pages_function/pages/sparepartInbound/create.vue
@@ -0,0 +1,1002 @@
+
+
+
+
+
+
+
+
+
+
+ {{ t('sparepartInbound.scanSparepart') }}
+
+
+
+
+
+ {{ t('sparepartInbound.selectSparepart') }}
+
+
+
+
+
+
+
+ {{ t('sparepartInbound.selectedSpareparts') }}
+
+
+
+
+
+
+
+
+ 📦
+
+
+
+
+
+ 备件名称:
+ {{ textValue(selectedSparepart.name) }}
+
+
+ 规格:
+ {{ textValue(selectedSparepart.standard || selectedSparepart.deviceSpec) }}
+
+
+ 当前库存:
+ {{ textValue(selectedSparepart.stock) }}{{ textUnit(selectedSparepart.minStockUnitName) }}
+
+
+
+
+
+
+
+
+ 采购单位:
+ {{ textValue(selectedSparepart.purchaseUnitName) }}
+
+
+ 库存单位:
+ {{ textValue(selectedSparepart.unitName || selectedSparepart.minStockUnitName) }}
+
+
+
+ 换算关系:
+ 1{{ textValue(selectedSparepart.purchaseUnitName) }}={{ textValue(selectedSparepart.purchaseUnitConvertQuantity) }}{{ stockUnitLabel(selectedSparepart) }}
+
+
+ 默认仓库
+ {{ selectedSparepart.warehouseName ? textValue(selectedSparepart.warehouseName) : '库区/备件仓' }}
+
+
+
+
+
+
+
+
+ 入库数量
+
+
+
+ 入库数量
+
+ 单位:{{ textValue(selectedSparepart.purchaseUnitName) }}
+
+
+
+ 折算后库存数量:
+ {{ calculatedStock }}
+ {{ stockUnitLabel(selectedSparepart) }}
+
+
+ {{ inboundQty || 0 }}{{ textValue(selectedSparepart.purchaseUnitName) }} × {{ textValue(selectedSparepart.purchaseUnitConvertQuantity) }}{{ stockUnitLabel(selectedSparepart) }} = {{ calculatedStock }}{{ stockUnitLabel(selectedSparepart) }}
+
+
+
+
+
+
+ 供应商
+
+
+
+
+ {{ supplierInfo.name || '请选择供应商' }}
+
+ ▼
+
+
+
+
+
+
+ 经办人
+
+
+
+
+ {{ selectedOperator ? selectedOperator.label : '请选择经办人' }}
+
+ ▼
+
+
+
+
+ {{ item.label }}
+ ✓
+
+ 暂无数据
+
+
+
+
+
+
+
+ 仓库/库区
+
+
+
+
+
+ 仓库
+
+
+
+ {{ selectedWarehouse ? selectedWarehouse.label : '请选择' }}
+
+ ▼
+
+
+
+
+ {{ item.label }}
+ ✓
+
+ 暂无数据
+
+
+
+
+
+
+ 库区
+
+
+
+ {{ selectedArea ? selectedArea.label : (loadingAreas ? '加载中...' : '请选择') }}
+
+ ▼
+
+
+
+
+ {{ item.label }}
+ ✓
+
+ 暂无数据
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('sparepartInbound.noSelectedSparepart') }}
+
+
+
+
+ 取消
+ 确认入库
+
+
+
+
+
+
+
diff --git a/src/pages_function/pages/sparepartInbound/index.vue b/src/pages_function/pages/sparepartInbound/index.vue
new file mode 100644
index 0000000..bdc7497
--- /dev/null
+++ b/src/pages_function/pages/sparepartInbound/index.vue
@@ -0,0 +1,594 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ currentStatusLabel }}
+
+
+
+ {{ t('functionCommon.reset') }}
+
+
+
+
+
+
+
+
+
+ {{ t('sparepartInbound.sparepartInfo') }}
+ {{ textValue(item.productNames) }}
+
+
+ {{ t('sparepartInbound.inboundTime') }}
+ {{ formatDateTime(item.inTime || item.createTime) }}
+
+
+ {{ t('sparepartInbound.creator') }}
+ {{ textValue(item.creatorName || item.creator) }}
+
+
+ {{ t('sparepartInbound.quantity') }}
+ {{ textValue(item.totalCount) }}
+
+
+ {{ t('sparepartInbound.reviewer') }}
+ {{ textValue(item.auditUserName) }}
+
+
+
+
+ {{ t('sparepartInbound.approve') }}
+ {{ t('sparepartInbound.reject') }}
+
+
+
+ {{ t('functionCommon.loading') }}
+ {{ t('sparepartInbound.empty') }}
+ {{ t('functionCommon.loadingMore') }}
+ {{ t('functionCommon.noMoreData') }}
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
diff --git a/src/pages_function/pages/sparepartInbound/sparepartSelect.vue b/src/pages_function/pages/sparepartInbound/sparepartSelect.vue
new file mode 100644
index 0000000..7730636
--- /dev/null
+++ b/src/pages_function/pages/sparepartInbound/sparepartSelect.vue
@@ -0,0 +1,295 @@
+
+
+
+
+
+
+
+
+
+ ✕
+
+
+
+
+
+
+
+
+
+ {{ t('sparepartInbound.sparepartCode') }}
+ {{ textValue(item.barCode) }}
+
+
+ {{ t('sparepartInbound.spec') }}
+ {{ textValue(item.standard || item.deviceSpec) }}
+
+
+ {{ t('sparepartInbound.category') }}
+ {{ textValue(item.categoryName) }}
+
+
+ {{ t('sparepartInbound.unit') }}
+ {{ textValue(item.unitName) }}
+
+
+ {{ t('sparepartInbound.purchaseUnit') }}
+ {{ textValue(item.purchaseUnitName) }}
+
+
+ {{ t('sparepartInbound.convertRatio') }}
+ 1{{ textValue(item.purchaseUnitName) }}={{ textValue(item.purchaseUnitConvertQuantity) }}{{ textValue(item.unitName) }}
+
+
+
+
+
+
+
+ {{ t('functionCommon.loading') }}
+ {{ t('sparepartInbound.noSparepartData') }}
+
+
+
+
+
+ {{ t('functionCommon.confirm') }}
+
+
+
+
+
+
+
+
diff --git a/src/pages_function/pages/sparepartInbound/userSelect.vue b/src/pages_function/pages/sparepartInbound/userSelect.vue
new file mode 100644
index 0000000..e69de29
diff --git a/src/utils/permissionMenu.js b/src/utils/permissionMenu.js
index f61f7e5..ef56ef7 100644
--- a/src/utils/permissionMenu.js
+++ b/src/utils/permissionMenu.js
@@ -87,6 +87,10 @@ const MENU_ROUTE_MAP = {
mold: '/pages_function/pages/mold/index',
equipment: '/pages_function/pages/equipment/index',
spare: '/pages_function/pages/spare/index',
+ sparepartInbound: '/pages_function/pages/sparepartInbound/index',
+ sparepartinbound: '/pages_function/pages/sparepartInbound/index',
+ sparepartIn: '/pages_function/pages/sparepartInbound/index',
+ '备件入库': '/pages_function/pages/sparepartInbound/index',
keypart: '/pages_function/pages/keypart/index',
product: '/pages_function/pages/product/index'
}