Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mini-wms
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
周海峰
mini-wms
Commits
4f51b614
Commit
4f51b614
authored
Dec 03, 2025
by
zhangtw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入库结合物料组件,bug修复
parent
e1b0bfb8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
70 行增加
和
37 行删除
+70
-37
ruoyi-admin-vue/src/views/inventory/inbound/index.vue
+10
-4
ruoyi-admin-vue/src/views/inventory/inbound_items/index.vue
+50
-33
ruoyi-admin-vue/src/views/inventory/materials/materialsSeletor.vue
+10
-0
没有找到文件。
ruoyi-admin-vue/src/views/inventory/inbound/index.vue
View file @
4f51b614
...
...
@@ -572,9 +572,14 @@ export default {
// 打开物料选择弹窗
showMaterials
(
status
)
{
this
.
materialSelectOpen
=
status
;
// 清空之前的选择
this
.
selectedMaterialIds
=
[];
this
.
selectedMaterials
=
[];
if
(
status
)
{
// 只有打开弹窗时才清空选择
this
.
selectedMaterialIds
=
[];
// 先清空父组件数据
this
.
selectedMaterials
=
[];
this
.
$nextTick
(()
=>
{
// 确保弹窗渲染完成后再调用子组件方法
this
.
$refs
.
materialSelector
?.
clearSelection
();
}
);
}
}
,
// 物料选择变化回调
...
...
@@ -598,7 +603,7 @@ export default {
if
(
!
exists
)
{
this
.
form
.
inboundOrderItemsList
.
push
({
material
Code
:
material
.
materialCode
,
// 存储物料编码
material
Id
:
material
.
materialCode
,
// 存储物料编码
materialName
:
material
.
materialName
,
// 仅用于展示
// 其他需要的字段...
}
);
...
...
@@ -606,6 +611,7 @@ export default {
}
);
this
.
materialSelectOpen
=
false
;
this
.
$refs
.
inboundItemsRef
.
handleAddItem
(
this
.
selectedMaterials
)
this
.
$message
.
success
(
`成功添加 ${this.selectedMaterials.length
}
个物料`
);
}
,
/** 确认入库操作 */
...
...
ruoyi-admin-vue/src/views/inventory/inbound_items/index.vue
View file @
4f51b614
...
...
@@ -9,7 +9,7 @@
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAddItem"
@
click=
"handleAddItem
Click
"
>
新增物料
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
...
...
@@ -224,11 +224,25 @@ export default {
columns
:
{
type
:
Array
,
default
:
()
=>
[
{
prop
:
'materialId'
,
label
:
'货物ID'
,
width
:
'120'
,
editable
:
true
},
{
prop
:
'material
sName'
,
label
:
'货物名称'
,
width
:
'120'
,
editable
:
tru
e
},
{
prop
:
'materialId'
,
label
:
'货物ID'
,
width
:
'120'
,
editable
:
false
},
{
prop
:
'material
Name'
,
label
:
'货物名称'
,
width
:
'120'
,
editable
:
fals
e
},
// { prop: 'batchId', label: '批次ID', width: '120', editable: true },
{
prop
:
'warehouseId'
,
label
:
'仓库ID'
,
width
:
'120'
,
editable
:
true
},
{
prop
:
'locationId'
,
label
:
'库位ID'
,
width
:
'120'
,
editable
:
true
},
{
prop
:
'warehouseId'
,
label
:
'仓库ID'
,
width
:
'120'
,
editable
:
true
,
type
:
'select'
,
// 指定类型为select
options
:
[
// 下拉选项列表
{
label
:
'仓库A'
,
value
:
'WH001'
},
{
label
:
'仓库B'
,
value
:
'WH002'
},
{
label
:
'仓库C'
,
value
:
'WH003'
}
]
},
{
prop
:
'locationId'
,
label
:
'库位ID'
,
width
:
'120'
,
editable
:
true
,
type
:
'select'
,
// 指定类型为select
options
:
[
// 下拉选项列表
{
label
:
'库位A1'
,
value
:
'LOC001'
},
{
label
:
'库位A2'
,
value
:
'LOC002'
},
{
label
:
'库位B1'
,
value
:
'LOC003'
}
]
},
{
prop
:
'plannedQuantity'
,
label
:
'计划数量'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'actualQuantity'
,
label
:
'实际数量'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'plannedPackages'
,
label
:
'计划件数'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
...
...
@@ -245,6 +259,7 @@ export default {
},
data
()
{
return
{
selectedMaterials
:
[],
loading
:
false
,
selectedRows
:
[],
total
:
0
,
...
...
@@ -380,35 +395,37 @@ export default {
return
row
.
id
||
row
.
tempId
},
// 新增物料
handleAddItem
()
{
handleAddItem
Click
()
{
this
.
$emit
(
'show-materials'
,
true
)
const
newItem
=
{
id
:
null
,
orderId
:
this
.
orderId
,
materialId
:
null
,
batchId
:
null
,
warehouseId
:
null
,
locationId
:
null
,
plannedQuantity
:
0
,
actualQuantity
:
0
,
plannedPackages
:
0
,
actualPackages
:
0
,
unitPrice
:
0
,
remark
:
null
,
editable
:
true
,
tempId
:
Date
.
now
()
+
Math
.
random
()
}
this
.
displayData
.
push
(
newItem
)
// 自动跳转到最后一页
const
totalPages
=
Math
.
ceil
(
this
.
displayData
.
length
/
this
.
queryParams
.
pageSize
)
if
(
totalPages
>
this
.
queryParams
.
pageNum
)
{
this
.
queryParams
.
pageNum
=
totalPages
}
this
.
$emit
(
'item-added'
,
newItem
)
},
handleAddItem
(
selectedMaterials
){
selectedMaterials
.
forEach
(
material
=>
{
const
newItem
=
{
id
:
null
,
orderId
:
this
.
orderId
,
materialId
:
material
.
materialId
,
materialName
:
material
.
materialName
,
batchId
:
null
,
warehouseId
:
null
,
locationId
:
null
,
plannedQuantity
:
0
,
actualQuantity
:
0
,
plannedPackages
:
0
,
actualPackages
:
0
,
unitPrice
:
0
,
remark
:
null
,
editable
:
true
,
tempId
:
Date
.
now
()
+
Math
.
random
()
}
this
.
displayData
.
push
(
newItem
)
// 自动跳转到最后一页
const
totalPages
=
Math
.
ceil
(
this
.
displayData
.
length
/
this
.
queryParams
.
pageSize
)
if
(
totalPages
>
this
.
queryParams
.
pageNum
)
{
this
.
queryParams
.
pageNum
=
totalPages
}
this
.
$emit
(
'item-added'
,
newItem
)
})
console
.
log
(
this
.
displayData
)
},
// 行编辑
handleRowEdit
(
row
)
{
...
...
ruoyi-admin-vue/src/views/inventory/materials/materialsSeletor.vue
View file @
4f51b614
...
...
@@ -66,6 +66,7 @@
<!-- 物料表格(隐藏操作列,保留选择功能) -->
<el-table
ref=
"materialTable"
v-loading=
"loading"
:data=
"materialsList"
@
selection-change=
"handleSelectionChange"
...
...
@@ -317,6 +318,15 @@ export default {
// 提供外部调用的方法:获取选中的物料详情
getSelectedMaterials
()
{
return
this
.
selectedRows
;
},
// 清空复选框选择
clearSelection
()
{
if
(
this
.
$refs
.
materialTable
)
{
this
.
$refs
.
materialTable
.
clearSelection
();
// 直接清空表格选择
this
.
selectedRows
=
[];
// 同步清空选中数据
this
.
$emit
(
'change'
,
[]);
// 通知父组件
this
.
$emit
(
'input'
,
[]);
// 更新v-model绑定值
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论