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
6dd5c256
Commit
6dd5c256
authored
Dec 12, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修bug
parent
a1344fd8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
243 行增加
和
272 行删除
+243
-272
ruoyi-admin-vue/src/views/inventory/items/index.vue
+185
-127
ruoyi-admin-vue/src/views/inventory/locations/index.vue
+35
-108
ruoyi-admin-vue/src/views/inventory/warehouses/index.vue
+0
-18
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+23
-19
没有找到文件。
ruoyi-admin-vue/src/views/inventory/items/index.vue
View file @
6dd5c256
...
@@ -18,137 +18,152 @@
...
@@ -18,137 +18,152 @@
<div
class=
"page-container"
>
<div
class=
"page-container"
>
<!-- 物料查询表单 -->
<!-- 物料查询表单 -->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"主订单号"
prop=
"mainOrderId"
>
<el-form-item
label=
"主订单号"
prop=
"mainOrderId"
>
<el-input
<el-input
v-model=
"queryParams.mainOrderId"
v-model=
"queryParams.mainOrderId"
placeholder=
"请输入主订单号"
placeholder=
"请输入主订单号"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"时间段"
prop=
"dateRange"
>
<el-date-picker
v-model=
"queryParams.dateRange"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
clearable
/>
</el-form-item>
<el-form-item
label=
"货主"
prop=
"ownerId"
>
<el-input
v-model=
"queryOwnerName"
placeholder=
"请选择货主"
readonly
@
focus=
"openOwnerSelector"
:suffix-icon=
"''"
>
<
template
v-if=
"queryOwnerName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryOwner"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"物料"
prop=
"materialId"
>
<el-input
v-model=
"queryParams.materialId"
placeholder=
"请输入物料ID或编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"仓库"
prop=
"warehouseId"
>
<el-input
v-model=
"queryWarehouseName"
placeholder=
"请选择仓库"
readonly
@
focus=
"openWarehouseSelector"
:suffix-icon=
"''"
>
<
template
v-if=
"queryWarehouseName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryWarehouse"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"库位"
prop=
"locationId"
>
<el-input
v-model=
"queryLocationName"
placeholder=
"请选择库位"
readonly
@
focus=
"openLocationSelector"
:suffix-icon=
"''"
:disabled=
"!queryParams.warehouseId"
>
<
template
v-if=
"queryLocationName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryLocation"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"订单状态"
prop=
"orderStatus"
>
<el-select
v-model=
"queryParams.orderStatus"
placeholder=
"请选择订单状态"
clearable
class=
"w20"
>
<el-option
v-for=
"item in orderStatusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"时间段"
prop=
"dateRange"
>
<el-form-item>
<el-date-picker
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
v-model=
"queryParams.dateRange"
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
type=
"daterange"
</el-form-item>
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
clearable
/>
</el-form-item>
<el-form-item
label=
"货主"
prop=
"ownerId"
>
<el-input
v-model=
"queryOwnerName"
placeholder=
"请选择货主"
readonly
@
focus=
"openOwnerSelector"
:suffix-icon=
"''"
>
<
template
v-if=
"queryOwnerName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryOwner"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"物料"
prop=
"materialId"
>
<el-input
v-model=
"queryParams.materialId"
placeholder=
"请输入物料ID或编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"仓库"
prop=
"warehouseId"
>
<el-input
v-model=
"queryWarehouseName"
placeholder=
"请选择仓库"
readonly
@
focus=
"openWarehouseSelector"
:suffix-icon=
"''"
>
<
template
v-if=
"queryWarehouseName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryWarehouse"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"库位"
prop=
"locationId"
>
<el-input
v-model=
"queryLocationName"
placeholder=
"请选择库位"
readonly
@
focus=
"openLocationSelector"
:suffix-icon=
"''"
:disabled=
"!queryParams.warehouseId"
>
<
template
v-if=
"queryLocationName"
#
suffix
>
<i
class=
"el-icon-circle-close el-input__icon"
style=
"cursor: pointer;"
@
click
.
stop=
"clearQueryLocation"
></i>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"订单状态"
prop=
"orderStatus"
>
<el-select
v-model=
"queryParams.orderStatus"
placeholder=
"请选择订单状态"
clearable
class=
"w20"
>
<el-option
v-for=
"item in orderStatusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
</el-form>
<!-- 物料查询表格 -->
<!-- 物料查询表格
(折叠面板分组)
-->
<div
class=
"table-container"
>
<div
class=
"table-container"
>
<el-table
v-loading=
"loading"
:data=
"returnOrderItemList"
border
height=
"100%"
style=
"width: 100%"
>
<el-collapse
v-loading=
"loading"
accordion
>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
align=
"center"
fixed=
"left"
/>
<!-- 遍历SAP分组 -->
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
min-width=
"150"
show-overflow-tooltip
/>
<el-collapse-item
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
width=
"120"
/>
v-for=
"(group, groupIndex) in groupedList"
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
width=
"120"
/>
:key=
"groupIndex"
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazardId"
width=
"120"
/>
:title=
"`SAP物料号:${group.sapNo || '未分类'}(共${group.items.length}条)`"
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
width=
"120"
/>
:name=
"group.sapNo || `uncategorized-${groupIndex}`"
<el-table-column
label=
"计量单位"
align=
"center"
prop=
"materialUnit"
width=
"120"
/>
>
<el-table-column
label=
"单位重量"
align=
"center"
prop=
"unitWeight"
width=
"120"
>
<el-table
<
template
slot-scope=
"scope"
>
:data=
"group.items"
{{
formatAmount
(
scope
.
row
.
unitWeight
||
0
)
}}
border
</
template
>
style=
"width: 100%; margin-top: 8px;"
</el-table-column>
>
<el-table-column
label=
"计划数量"
align=
"center"
prop=
"plannedQuantity"
width=
"100"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
align=
"center"
/>
<el-table-column
label=
"实际数量"
align=
"center"
prop=
"actualQuantity"
width=
"100"
/>
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
min-width=
"150"
show-overflow-tooltip
/>
<el-table-column
label=
"总额"
align=
"center"
prop=
"totalAmount"
width=
"100"
>
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
width=
"120"
/>
<
template
slot-scope=
"scope"
>
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazardId"
width=
"120"
/>
{{
formatAmount
(
scope
.
row
.
totalAmount
||
0
)
}}
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
width=
"120"
/>
</
template
>
<el-table-column
label=
"计量单位"
align=
"center"
prop=
"materialUnit"
width=
"120"
/>
</el-table-column>
<el-table-column
label=
"单位重量"
align=
"center"
prop=
"unitWeight"
width=
"120"
>
<el-table-column
label=
"操作"
align=
"center"
width=
"100"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
formatAmount
(
scope
.
row
.
unitWeight
||
0
)
}}
<el-button
</
template
>
size=
"mini"
</el-table-column>
type=
"text"
<el-table-column
label=
"计划数量"
align=
"center"
prop=
"plannedQuantity"
width=
"100"
/>
icon=
"el-icon-view"
<el-table-column
label=
"实际数量"
align=
"center"
prop=
"actualQuantity"
width=
"100"
/>
@
click=
"handleViewDetail(scope.row)"
<el-table-column
label=
"总额"
align=
"center"
prop=
"totalAmount"
width=
"100"
>
>
详情
</el-button>
<
template
slot-scope=
"scope"
>
</
template
>
{{
formatAmount
(
scope
.
row
.
totalAmount
||
0
)
}}
</el-table-column>
</
template
>
</el-table>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
width=
"100"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"handleViewDetail(scope.row)"
>
详情
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-collapse-item>
<!-- 无数据提示 -->
<div
v-if=
"!loading && groupedList.length === 0"
class=
"no-data"
>
暂无数据
</div>
</el-collapse>
</div>
</div>
<!-- 分页组件 -->
<!-- 分页组件
(全局分页,按原始数据总数分页)
-->
<pagination
<pagination
v-show=
"total>0"
v-show=
"total>0"
:total=
"total"
:total=
"total"
...
@@ -310,7 +325,7 @@ export default {
...
@@ -310,7 +325,7 @@ export default {
loading
:
true
,
loading
:
true
,
showSearch
:
true
,
showSearch
:
true
,
total
:
0
,
total
:
0
,
returnOrderItemList
:
[],
groupedList
:
[],
// 按SAP分组后的列表
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
...
@@ -371,11 +386,36 @@ export default {
...
@@ -371,11 +386,36 @@ export default {
delete
params
.
dateRange
delete
params
.
dateRange
listInboundOutboundStatistics
(
params
).
then
(
response
=>
{
listInboundOutboundStatistics
(
params
).
then
(
response
=>
{
this
.
returnOrderItem
List
=
response
.
rows
||
[]
const
raw
List
=
response
.
rows
||
[]
this
.
total
=
response
.
total
||
0
this
.
total
=
response
.
total
||
0
// 核心:按sapNo分组
const
groupedMap
=
{}
rawList
.
forEach
(
item
=>
{
// sapNo为空时归为"未分类"
const
sapKey
=
item
.
sapNo
||
'未分类'
if
(
!
groupedMap
[
sapKey
])
{
groupedMap
[
sapKey
]
=
[]
}
groupedMap
[
sapKey
].
push
(
item
)
})
// 转换为分组列表(用于折叠面板渲染)
this
.
groupedList
=
Object
.
keys
(
groupedMap
).
map
(
sapNo
=>
({
sapNo
,
items
:
groupedMap
[
sapNo
],
expanded
:
false
// 默认全部折叠,可改为 true 全部展开
}))
// 默认展开第一个分组(可选)
if
(
this
.
groupedList
.
length
>
0
)
{
this
.
groupedList
[
0
].
expanded
=
true
}
this
.
loading
=
false
this
.
loading
=
false
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
groupedList
=
[]
})
})
},
},
handleQuery
()
{
handleQuery
()
{
...
@@ -569,4 +609,21 @@ export default {
...
@@ -569,4 +609,21 @@ export default {
.w20
{
.w20
{
width
:
150px
;
width
:
150px
;
}
}
.no-data
{
text-align
:
center
;
padding
:
20px
;
color
:
#999
;
font-size
:
14px
;
}
/* 折叠面板样式优化 */
::v-deep
.el-collapse-item__header
{
font-size
:
14px
;
font-weight
:
500
;
}
::v-deep
.el-collapse-item__content
{
padding
:
0
!important
;
}
</
style
>
</
style
>
\ No newline at end of file
ruoyi-admin-vue/src/views/inventory/locations/index.vue
View file @
6dd5c256
...
@@ -222,7 +222,7 @@
...
@@ -222,7 +222,7 @@
</el-row>
</el-row>
<el-row
:gutter=
"20"
style=
"margin: 10px 0;"
>
<el-row
:gutter=
"20"
style=
"margin: 10px 0;"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<div><strong>
允许存放物料名称:
</strong>
{{
scope
.
row
.
material
Names
||
'-'
}}
</div>
<div><strong>
允许存放物料名称:
</strong>
{{
scope
.
row
.
allowedCategory
Names
||
'-'
}}
</div>
</el-col>
</el-col>
</el-row>
</el-row>
</
template
>
</
template
>
...
@@ -263,7 +263,7 @@
...
@@ -263,7 +263,7 @@
<el-table-column
label=
"库位容量(千克)"
align=
"center"
prop=
"capacity"
width=
"120"
/>
<el-table-column
label=
"库位容量(千克)"
align=
"center"
prop=
"capacity"
width=
"120"
/>
<el-table-column
label=
"体积容量(立方米)"
align=
"center"
prop=
"volumeCapacity"
width=
"120"
/>
<el-table-column
label=
"体积容量(立方米)"
align=
"center"
prop=
"volumeCapacity"
width=
"120"
/>
<el-table-column
label=
"允许存放的危险等级"
align=
"center"
prop=
"allowedHazardLevels"
width=
"140"
/>
<el-table-column
label=
"允许存放的危险等级"
align=
"center"
prop=
"allowedHazardLevels"
width=
"140"
/>
<el-table-column
label=
"允许存放的
分类
名称"
align=
"center"
prop=
"allowedCategoryNames"
width=
"200"
>
<el-table-column
label=
"允许存放的
物料
名称"
align=
"center"
prop=
"allowedCategoryNames"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
<el-tooltip
:content=
"scope.row.allowedCategoryNames"
:content=
"scope.row.allowedCategoryNames"
...
@@ -294,22 +294,13 @@
...
@@ -294,22 +294,13 @@
</el-tooltip>
</el-tooltip>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"允许存放物料编码"
align=
"center"
prop=
"materialCodes"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
:content=
"scope.row.materialCodes"
placement=
"top"
>
<div
class=
"material-names"
>
{{
scope
.
row
.
materialCodes
?
(
scope
.
row
.
materialCodes
.
length
>
20
?
scope
.
row
.
materialCodes
.
substring
(
0
,
20
)
+
'...'
:
scope
.
row
.
materialCodes
)
:
'-'
}}
</div>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
label=
"温区"
align=
"center"
prop=
"temperatureZone"
width=
"100"
/>
<el-table-column
label=
"温区"
align=
"center"
prop=
"temperatureZone"
width=
"100"
/>
<el-table-column
label=
"应用状态"
align=
"center"
prop=
"isEnabled"
width=
"100"
>
<el-table-column
label=
"应用状态"
align=
"center"
prop=
"isEnabled"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.is_enabled"
:value=
"scope.row.isEnabled"
/>
<dict-tag
:options=
"dict.type.is_enabled"
:value=
"scope.row.isEnabled"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"排序"
align=
"center"
prop=
"sortNo"
width=
"80"
/>
<el-table-column
label=
"创建日期"
align=
"center"
prop=
"createTime"
width=
"160"
/>
<el-table-column
label=
"创建日期"
align=
"center"
prop=
"createTime"
width=
"160"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"120"
fixed=
"right"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"120"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -520,21 +511,14 @@
...
@@ -520,21 +511,14 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"允许存放物料"
prop=
"
materialCode
s"
>
<el-form-item
label=
"允许存放物料"
prop=
"
allowedCategoryId
s"
>
<div
style=
"display: flex; align-items: center; flex-direction: column; gap: 8px;"
>
<div
style=
"display: flex; align-items: center; flex-direction: column; gap: 8px;"
>
<el-input
<el-input
v-model=
"form.materialNames"
v-model=
"form.allowedCategoryNames"
@
click=
"initMaterialSelector"
placeholder=
"请选择允许存放的物料"
placeholder=
"请选择允许存放的物料"
readonly
style=
"width: 100%;"
style=
"width: 100%;"
/>
/>
<!-- 修复:点击事件改为初始化方法 -->
<el-button
type=
"primary"
size=
"small"
@
click
.
stop=
"initMaterialSelector"
style=
"align-self: flex-end;"
>
选择物料
</el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -548,17 +532,7 @@
...
@@ -548,17 +532,7 @@
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"排序"
prop=
"sortNo"
>
<el-input-number
v-model=
"form.sortNo"
placeholder=
"请输入排序"
:min=
"0"
:step=
"1"
style=
"width: 100%;"
/>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
...
@@ -586,7 +560,7 @@
...
@@ -586,7 +560,7 @@
<materialsSeletor
<materialsSeletor
ref=
"materialsSeletor"
ref=
"materialsSeletor"
@
selection-change=
"handleMaterialSelectionChange"
@
selection-change=
"handleMaterialSelectionChange"
:selected-material-codes=
"form.
materialCodes ? form.materialCode
s.split(',').filter(u => u.trim()) : []"
:selected-material-codes=
"form.
allowedCategoryIds ? form.allowedCategoryId
s.split(',').filter(u => u.trim()) : []"
:multiple=
"true"
:multiple=
"true"
:default-category-codes=
"form.allowedCategoryIds ? form.allowedCategoryIds.split(',').filter(c => c.trim()) : []"
:default-category-codes=
"form.allowedCategoryIds ? form.allowedCategoryIds.split(',').filter(c => c.trim()) : []"
/>
/>
...
@@ -669,10 +643,8 @@ export default {
...
@@ -669,10 +643,8 @@ export default {
capacity
:
null
,
capacity
:
null
,
volumeCapacity
:
null
,
volumeCapacity
:
null
,
allowedHazardLevels
:
null
,
allowedHazardLevels
:
null
,
materialCodes
:
null
,
allowedCategoryIds
:
null
,
// 原materialCodes
materialNames
:
null
,
allowedCategoryNames
:
null
,
// 原materialNames
allowedCategoryIds
:
null
,
allowedCategoryNames
:
null
,
temperatureZone
:
null
,
temperatureZone
:
null
,
isEnabled
:
1
,
isEnabled
:
1
,
isUsed
:
1
,
isUsed
:
1
,
...
@@ -750,8 +722,8 @@ export default {
...
@@ -750,8 +722,8 @@ export default {
console
.
log
(
'【初始化物料选择器】清空残留数据'
)
console
.
log
(
'【初始化物料选择器】清空残留数据'
)
// 1. 清空临时选择数据(区分新增/修改)
// 1. 清空临时选择数据(区分新增/修改)
this
.
tempSelectedMaterials
=
{
this
.
tempSelectedMaterials
=
{
materialCodes
:
this
.
form
.
id
?
(
this
.
form
.
materialCodes
?
this
.
form
.
materialCode
s
.
split
(
','
).
filter
(
u
=>
u
.
trim
())
:
[])
:
[],
materialCodes
:
this
.
form
.
id
?
(
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryId
s
.
split
(
','
).
filter
(
u
=>
u
.
trim
())
:
[])
:
[],
names
:
this
.
form
.
id
?
(
this
.
form
.
materialNames
?
this
.
form
.
material
Names
.
split
(
','
).
filter
(
n
=>
n
.
trim
())
:
[])
:
[],
names
:
this
.
form
.
id
?
(
this
.
form
.
allowedCategoryNames
?
this
.
form
.
allowedCategory
Names
.
split
(
','
).
filter
(
n
=>
n
.
trim
())
:
[])
:
[],
categoryIds
:
this
.
form
.
id
?
(
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryIds
.
split
(
','
).
filter
(
c
=>
c
.
trim
())
:
[])
:
[]
categoryIds
:
this
.
form
.
id
?
(
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryIds
.
split
(
','
).
filter
(
c
=>
c
.
trim
())
:
[])
:
[]
}
}
// 2. 延迟打开弹窗,确保数据先清空
// 2. 延迟打开弹窗,确保数据先清空
...
@@ -993,29 +965,29 @@ export default {
...
@@ -993,29 +965,29 @@ export default {
let
materialCodes
=
[]
let
materialCodes
=
[]
let
materialNames
=
[]
let
materialNames
=
[]
// 优先从
materialIds数组读取
// 优先从
allowedCategoryIds数组读取(原materialIds)
if
(
Array
.
isArray
(
rowData
.
materialIds
)
&&
rowData
.
material
Ids
.
length
)
{
if
(
Array
.
isArray
(
rowData
.
allowedCategoryIds
)
&&
rowData
.
allowedCategory
Ids
.
length
)
{
materialCodes
=
rowData
.
material
Ids
materialCodes
=
rowData
.
allowedCategory
Ids
.
filter
(
code
=>
code
&&
code
.
trim
())
.
filter
(
code
=>
code
&&
code
.
trim
())
.
map
(
code
=>
code
.
trim
().
toUpperCase
())
.
map
(
code
=>
code
.
trim
().
toUpperCase
())
.
filter
((
code
,
index
,
self
)
=>
self
.
indexOf
(
code
)
===
index
)
.
filter
((
code
,
index
,
self
)
=>
self
.
indexOf
(
code
)
===
index
)
}
}
// 兼容字符串格式
// 兼容字符串格式
else
if
(
rowData
.
materialCode
s
)
{
else
if
(
rowData
.
allowedCategoryId
s
)
{
materialCodes
=
rowData
.
materialCode
s
.
split
(
','
)
materialCodes
=
rowData
.
allowedCategoryId
s
.
split
(
','
)
.
filter
(
code
=>
code
&&
code
.
trim
())
.
filter
(
code
=>
code
&&
code
.
trim
())
.
map
(
code
=>
code
.
trim
().
toUpperCase
())
.
map
(
code
=>
code
.
trim
().
toUpperCase
())
.
filter
((
code
,
index
,
self
)
=>
self
.
indexOf
(
code
)
===
index
)
.
filter
((
code
,
index
,
self
)
=>
self
.
indexOf
(
code
)
===
index
)
}
}
// 处理物料名称
// 处理物料名称
if
(
Array
.
isArray
(
rowData
.
names
)
&&
rowData
.
n
ames
.
length
)
{
if
(
Array
.
isArray
(
rowData
.
allowedCategoryNames
)
&&
rowData
.
allowedCategoryN
ames
.
length
)
{
materialNames
=
rowData
.
n
ames
materialNames
=
rowData
.
allowedCategoryN
ames
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
}
}
else
if
(
rowData
.
material
Names
)
{
else
if
(
rowData
.
allowedCategory
Names
)
{
materialNames
=
rowData
.
material
Names
.
split
(
','
)
materialNames
=
rowData
.
allowedCategory
Names
.
split
(
','
)
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
}
}
...
@@ -1026,36 +998,12 @@ export default {
...
@@ -1026,36 +998,12 @@ export default {
})
})
}
}
// 处理分类ID
// 处理分类ID(现在存储的是物料编码)
let
categoryIds
=
[]
let
categoryIds
=
materialCodes
if
(
Array
.
isArray
(
rowData
.
categoryIds
)
&&
rowData
.
categoryIds
.
length
)
{
categoryIds
=
rowData
.
categoryIds
.
filter
(
id
=>
id
&&
id
.
trim
())
.
filter
((
id
,
index
,
self
)
=>
self
.
indexOf
(
id
)
===
index
)
}
else
if
(
rowData
.
allowedCategoryIds
)
{
categoryIds
=
rowData
.
allowedCategoryIds
.
split
(
','
)
.
filter
(
id
=>
id
&&
id
.
trim
())
.
filter
((
id
,
index
,
self
)
=>
self
.
indexOf
(
id
)
===
index
)
}
// 更新表单数据
// 更新表单数据
this
.
form
.
materialCodes
=
materialCodes
.
join
(
','
)
this
.
form
.
allowedCategoryIds
=
materialCodes
.
join
(
','
)
this
.
form
.
materialNames
=
materialNames
.
join
(
','
)
this
.
form
.
allowedCategoryNames
=
materialNames
.
join
(
','
)
this
.
form
.
allowedCategoryIds
=
categoryIds
.
join
(
','
)
// 处理分类名称
if
(
categoryIds
.
length
&&
this
.
$refs
.
materialsSeletor
)
{
const
categoryNames
=
categoryIds
.
map
(
code
=>
{
const
rawCode
=
code
.
replace
(
/-/g
,
''
)
return
this
.
$refs
.
materialsSeletor
.
categoryMap
?.[
rawCode
]
||
code
})
this
.
form
.
allowedCategoryNames
=
categoryNames
.
join
(
','
)
console
.
log
(
'【修改库位】处理后的分类名称:'
,
categoryNames
)
}
else
if
(
rowData
.
allowedCategoryNames
)
{
this
.
form
.
allowedCategoryNames
=
rowData
.
allowedCategoryNames
console
.
log
(
'【修改库位】使用原始分类名称:'
,
rowData
.
allowedCategoryNames
)
}
// 更新临时选择数据
// 更新临时选择数据
this
.
tempSelectedMaterials
=
{
this
.
tempSelectedMaterials
=
{
...
@@ -1065,9 +1013,8 @@ export default {
...
@@ -1065,9 +1013,8 @@ export default {
}
}
console
.
log
(
'【修改库位】处理后的物料数据:'
,
{
console
.
log
(
'【修改库位】处理后的物料数据:'
,
{
materialCodes
:
this
.
form
.
materialCodes
,
allowedCategoryIds
:
this
.
form
.
allowedCategoryIds
,
materialNames
:
this
.
form
.
materialNames
,
allowedCategoryNames
:
this
.
form
.
allowedCategoryNames
categoryIds
:
this
.
form
.
allowedCategoryIds
})
})
this
.
open
=
true
this
.
open
=
true
...
@@ -1095,8 +1042,6 @@ export default {
...
@@ -1095,8 +1042,6 @@ export default {
return
result
return
result
}
}
this
.
form
.
materialCodes
=
formatField
(
this
.
form
.
materialCodes
)
this
.
form
.
materialNames
=
formatField
(
this
.
form
.
materialNames
)
this
.
form
.
allowedCategoryIds
=
formatField
(
this
.
form
.
allowedCategoryIds
)
this
.
form
.
allowedCategoryIds
=
formatField
(
this
.
form
.
allowedCategoryIds
)
this
.
form
.
allowedCategoryNames
=
formatField
(
this
.
form
.
allowedCategoryNames
)
this
.
form
.
allowedCategoryNames
=
formatField
(
this
.
form
.
allowedCategoryNames
)
...
@@ -1176,10 +1121,8 @@ export default {
...
@@ -1176,10 +1121,8 @@ export default {
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
(
name
=>
name
&&
name
.
trim
())
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
.
filter
((
name
,
index
,
self
)
=>
self
.
indexOf
(
name
)
===
index
)
// 分类ID取selectedData.categoryIds
// 分类ID取selectedData.categoryIds(现在存储的是物料编码)
const
categoryIds
=
(
selectedData
.
categoryIds
||
[])
const
categoryIds
=
materialCodes
.
filter
(
id
=>
id
&&
id
.
trim
())
.
filter
((
id
,
index
,
self
)
=>
self
.
indexOf
(
id
)
===
index
)
this
.
tempSelectedMaterials
=
{
this
.
tempSelectedMaterials
=
{
materialCodes
,
materialCodes
,
...
@@ -1196,8 +1139,8 @@ export default {
...
@@ -1196,8 +1139,8 @@ export default {
this
.
showMaterialSelect
=
false
this
.
showMaterialSelect
=
false
// 恢复原有选择状态
// 恢复原有选择状态
this
.
tempSelectedMaterials
=
{
this
.
tempSelectedMaterials
=
{
materialCodes
:
this
.
form
.
materialCodes
?
this
.
form
.
materialCode
s
.
split
(
','
).
filter
(
u
=>
u
.
trim
())
:
[],
materialCodes
:
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryId
s
.
split
(
','
).
filter
(
u
=>
u
.
trim
())
:
[],
names
:
this
.
form
.
materialNames
?
this
.
form
.
material
Names
.
split
(
','
).
filter
(
n
=>
n
.
trim
())
:
[],
names
:
this
.
form
.
allowedCategoryNames
?
this
.
form
.
allowedCategory
Names
.
split
(
','
).
filter
(
n
=>
n
.
trim
())
:
[],
categoryIds
:
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryIds
.
split
(
','
).
filter
(
c
=>
c
.
trim
())
:
[]
categoryIds
:
this
.
form
.
allowedCategoryIds
?
this
.
form
.
allowedCategoryIds
.
split
(
','
).
filter
(
c
=>
c
.
trim
())
:
[]
}
}
console
.
log
(
'【取消物料选择】恢复后的临时选择数据:'
,
this
.
tempSelectedMaterials
)
console
.
log
(
'【取消物料选择】恢复后的临时选择数据:'
,
this
.
tempSelectedMaterials
)
...
@@ -1215,24 +1158,10 @@ export default {
...
@@ -1215,24 +1158,10 @@ export default {
}
}
// 更新表单数据(确保去重和过滤)
// 更新表单数据(确保去重和过滤)
this
.
form
.
materialCodes
=
this
.
tempSelectedMaterials
.
materialCodes
.
join
(
','
)
this
.
form
.
allowedCategoryIds
=
this
.
tempSelectedMaterials
.
materialCodes
.
join
(
','
)
this
.
form
.
materialNames
=
this
.
tempSelectedMaterials
.
names
.
join
(
','
)
this
.
form
.
allowedCategoryNames
=
this
.
tempSelectedMaterials
.
names
.
join
(
','
)
this
.
form
.
allowedCategoryIds
=
this
.
tempSelectedMaterials
.
categoryIds
.
join
(
','
)
// 生成分类名称
if
(
this
.
$refs
.
materialsSeletor
&&
this
.
tempSelectedMaterials
.
categoryIds
.
length
)
{
const
categoryNames
=
this
.
tempSelectedMaterials
.
categoryIds
.
map
(
code
=>
{
const
rawCode
=
code
.
replace
(
/-/g
,
''
)
return
this
.
$refs
.
materialsSeletor
.
categoryMap
?.[
rawCode
]
||
code
}).
filter
(
name
=>
name
&&
name
.
trim
())
this
.
form
.
allowedCategoryNames
=
categoryNames
.
join
(
','
)
console
.
log
(
'【确认物料选择】生成的分类名称:'
,
categoryNames
)
}
console
.
log
(
'【确认物料选择】更新后的表单物料数据:'
,
{
console
.
log
(
'【确认物料选择】更新后的表单物料数据:'
,
{
materialCodes
:
this
.
form
.
materialCodes
,
materialNames
:
this
.
form
.
materialNames
,
allowedCategoryIds
:
this
.
form
.
allowedCategoryIds
,
allowedCategoryIds
:
this
.
form
.
allowedCategoryIds
,
allowedCategoryNames
:
this
.
form
.
allowedCategoryNames
allowedCategoryNames
:
this
.
form
.
allowedCategoryNames
})
})
...
@@ -1264,10 +1193,8 @@ export default {
...
@@ -1264,10 +1193,8 @@ export default {
capacity
:
null
,
capacity
:
null
,
volumeCapacity
:
null
,
volumeCapacity
:
null
,
allowedHazardLevels
:
null
,
allowedHazardLevels
:
null
,
materialCodes
:
null
,
allowedCategoryIds
:
null
,
// 原materialCodes
materialNames
:
null
,
allowedCategoryNames
:
null
,
// 原materialNames
allowedCategoryIds
:
null
,
allowedCategoryNames
:
null
,
temperatureZone
:
null
,
temperatureZone
:
null
,
isEnabled
:
1
,
isEnabled
:
1
,
isUsed
:
1
,
isUsed
:
1
,
...
...
ruoyi-admin-vue/src/views/inventory/warehouses/index.vue
View file @
6dd5c256
...
@@ -133,7 +133,6 @@
...
@@ -133,7 +133,6 @@
</el-tag>
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"排序"
align=
"center"
prop=
"sortNo"
width=
"80"
/>
<el-table-column
label=
"创建日期"
align=
"center"
prop=
"createTime"
width=
"160"
/>
<el-table-column
label=
"创建日期"
align=
"center"
prop=
"createTime"
width=
"160"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"120"
fixed=
"right"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"120"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -232,19 +231,6 @@
...
@@ -232,19 +231,6 @@
</el-col>
</el-col>
</el-row>
</el-row>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"排序"
prop=
"sortNo"
>
<el-input-number
v-model=
"form.sortNo"
placeholder=
"请输入排序"
:min=
"0"
:step=
"1"
style=
"width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"仓库地点"
prop=
"address"
>
<el-form-item
label=
"仓库地点"
prop=
"address"
>
<el-input
v-model=
"form.address"
type=
"textarea"
placeholder=
"请输入内容"
:rows=
"3"
/>
<el-input
v-model=
"form.address"
type=
"textarea"
placeholder=
"请输入内容"
:rows=
"3"
/>
...
@@ -374,10 +360,6 @@ export default {
...
@@ -374,10 +360,6 @@ export default {
isEnabled
:
[
isEnabled
:
[
{
required
:
true
,
message
:
'应用状态不能为空'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'应用状态不能为空'
,
trigger
:
'change'
}
],
],
sortNo
:
[
{
required
:
true
,
message
:
'排序不能为空'
,
trigger
:
'blur'
},
{
type
:
'number'
,
message
:
'排序必须为数字值'
,
trigger
:
'blur'
}
],
area
:
[
area
:
[
{
{
validator
:
(
rule
,
value
,
callback
)
=>
{
validator
:
(
rule
,
value
,
callback
)
=>
{
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
6dd5c256
...
@@ -49,7 +49,21 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -49,7 +49,21 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
@Override
@Override
public
StorageLocations
selectStorageLocationsById
(
String
id
)
public
StorageLocations
selectStorageLocationsById
(
String
id
)
{
{
return
storageLocationsMapper
.
selectStorageLocationsById
(
id
);
StorageLocations
storageLocations
=
storageLocationsMapper
.
selectStorageLocationsById
(
id
);
String
[]
AllowedCategoryIds
=
storageLocations
.
getAllowedCategoryIds
().
split
(
","
);
String
AllowedCategoryName
=
""
;
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
Materials
materials
=
materialsMapper
.
selectMaterialsById
(
AllowedCategoryId
);
if
(
materials
!=
null
&&
materials
.
getMaterialName
()
!=
null
)
{
String
categoryName
=
materials
.
getMaterialName
().
trim
();
// 去除首尾空格
if
(
AllowedCategoryName
!=
""
)
{
AllowedCategoryName
+=
","
;
}
AllowedCategoryName
+=
categoryName
;
}
}
storageLocations
.
setAllowedCategoryNames
(
AllowedCategoryName
);
return
storageLocations
;
}
}
@Override
@Override
...
@@ -77,18 +91,14 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -77,18 +91,14 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
if
(
storageLocations2
.
getAllowedCategoryIds
()
!=
null
&&
!
storageLocations2
.
getAllowedCategoryIds
().
isEmpty
()){
if
(
storageLocations2
.
getAllowedCategoryIds
()
!=
null
&&
!
storageLocations2
.
getAllowedCategoryIds
().
isEmpty
()){
String
[]
AllowedCategoryIds
=
storageLocations2
.
getAllowedCategoryIds
().
split
(
","
);
String
[]
AllowedCategoryIds
=
storageLocations2
.
getAllowedCategoryIds
().
split
(
","
);
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
Materials
materials
=
materialsMapper
.
selectMaterialsById
(
AllowedCategoryId
);
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBySapNo
(
AllowedCategoryId
);
if
(
materials
!=
null
&&
materials
.
getMaterialName
()
!=
null
)
{
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
String
categoryName
=
materials
.
getMaterialName
().
trim
();
// 去除首尾空格
Materials
materials1
=
materials
.
get
(
0
);
if
(
materials1
!=
null
&&
materials1
.
getMaterialName
()
!=
null
)
{
String
categoryName
=
materials1
.
getMaterialName
().
trim
();
// 去除首尾空格
if
(
AllowedCategoryName
!=
""
)
{
if
(
AllowedCategoryName
!=
""
)
{
AllowedCategoryName
+=
","
;
AllowedCategoryName
+=
","
;
}
}
AllowedCategoryName
+=
categoryName
;
AllowedCategoryName
+=
categoryName
;
}
}
}
}
}
}
}
storageLocations2
.
setAllowedCategoryNames
(
AllowedCategoryName
);
storageLocations2
.
setAllowedCategoryNames
(
AllowedCategoryName
);
...
@@ -123,11 +133,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -123,11 +133,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
storageLocationsCategory
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBySapNo
(
categoryId
);
Materials
materials
=
materialsMapper
.
selectMaterialsById
(
categoryId
);
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
storageLocationsCategory
.
setCategoryName
(
materials
.
getMaterialName
());
Materials
materials1
=
materials
.
get
(
0
);
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
}
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
}
}
}
}
...
@@ -162,11 +169,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -162,11 +169,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setUpdateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
storageLocationsCategory
.
setUpdateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBySapNo
(
categoryId
);
Materials
materials
=
materialsMapper
.
selectMaterialsById
(
categoryId
);
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
storageLocationsCategory
.
setCategoryName
(
materials
.
getMaterialName
());
Materials
materials1
=
materials
.
get
(
0
);
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
}
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论