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
f3d69c31
Commit
f3d69c31
authored
Dec 15, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修bug
parent
e57792fc
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
175 行增加
和
415 行删除
+175
-415
ruoyi-admin-vue/src/views/inventory/items/index.vue
+7
-8
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
+43
-54
ruoyi-admin-vue/src/views/inventory/orders/index.vue
+91
-123
ruoyi-admin-vue/src/views/inventory/warehouses/index.vue
+1
-8
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/InventoryTransactions.java
+4
-213
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItems.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Owners.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+5
-6
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
+1
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+7
-1
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+6
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryTransactionsMapper.xml
+2
-0
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
+6
-0
没有找到文件。
ruoyi-admin-vue/src/views/inventory/items/index.vue
View file @
f3d69c31
...
...
@@ -16,16 +16,15 @@
<!-- 页面容器 -->
<div
class=
"page-container"
>
<!-- 物料查询表单 -->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<
el-form-item
label=
"主订单号"
prop=
"mainO
rderId"
>
<
!-- <el-form-item label="主订单号" prop="o
rderId">
<el-input
v-model=
"queryParams.
mainO
rderId"
v-model="queryParams.
o
rderId"
placeholder="请输入主订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form-item>
-->
<el-form-item
label=
"时间段"
prop=
"dateRange"
>
<el-date-picker
v-model=
"queryParams.dateRange"
...
...
@@ -253,7 +252,7 @@
style=
"width: 100%"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
align=
"center"
/>
<el-table-column
label=
"主订单号"
align=
"center"
prop=
"
mainO
rderId"
width=
"150"
/>
<el-table-column
label=
"主订单号"
align=
"center"
prop=
"
o
rderId"
width=
"150"
/>
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
min-width=
"150"
show-overflow-tooltip
/>
<el-table-column
label=
"批次"
align=
"center"
prop=
"batchCode"
width=
"120"
/>
<el-table-column
label=
"仓库"
align=
"center"
prop=
"warehouseName"
width=
"120"
/>
...
...
@@ -314,7 +313,7 @@ export default {
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
mainO
rderId
:
null
,
o
rderId
:
null
,
startDate
:
null
,
endDate
:
null
,
ownerId
:
null
,
...
...
@@ -339,7 +338,7 @@ export default {
detailQueryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
mainO
rderId
:
null
,
o
rderId
:
null
,
materialId
:
null
,
warehouseId
:
null
,
warehousesCode
:
null
,
...
...
@@ -466,7 +465,7 @@ export default {
this
.
detailQueryParams
=
{
pageNum
:
1
,
pageSize
:
10
,
mainOrderId
:
row
.
mainO
rderId
,
orderId
:
row
.
o
rderId
,
materialId
:
row
.
materialId
,
warehouseId
:
null
,
warehousesCode
:
null
,
...
...
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
View file @
f3d69c31
...
...
@@ -121,6 +121,41 @@
</div>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"计划数量"
prop=
"plannedQuantity"
required
>
<el-input
v-model
.
number=
"currentSelectedRow.plannedQuantity"
type=
"number"
min=
"1"
:max=
"(currentSelectedRow.quantity || 0) - (currentSelectedRow.lockedQuantity || 0)"
@
input=
"handleRowPlannedQtyInput(currentSelectedRow); syncDetails(false)"
placeholder=
"输入计划数量"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"单价"
prop=
"unitPrice"
required
>
<el-input
v-model
.
number=
"currentSelectedRow.unitPrice"
placeholder=
"请输入单价"
type=
"number"
min=
"0"
step=
"0.01"
@
input=
"syncDetails(false)"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"凭证号"
prop=
"voucherNumber"
>
<el-input
v-model=
"currentSelectedRow.voucherNumber"
placeholder=
"请输入凭证号"
@
input=
"syncDetails(false)"
/>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
style=
"margin-top: 10px;"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"约数"
prop=
"divisor"
>
<el-input
v-model
.
number=
"currentSelectedRow.divisor"
...
...
@@ -148,32 +183,6 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"计划数量"
prop=
"plannedQuantity"
>
<el-input
v-model
.
number=
"currentSelectedRow.plannedQuantity"
type=
"number"
min=
"1"
:max=
"(currentSelectedRow.quantity || 0) - (currentSelectedRow.lockedQuantity || 0)"
@
input=
"handleRowPlannedQtyInput(currentSelectedRow); syncDetails(false)"
placeholder=
"输入计划数量"
/>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
style=
"margin-top: 10px;"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"单价"
prop=
"unitPrice"
>
<el-input
v-model
.
number=
"currentSelectedRow.unitPrice"
placeholder=
"请输入单价"
type=
"number"
min=
"0"
step=
"0.01"
@
input=
"syncDetails(false)"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"发货方"
prop=
"shippedBy"
>
<el-input
v-model=
"currentSelectedRow.shippedBy"
...
...
@@ -182,16 +191,8 @@
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"凭证号"
prop=
"voucherNumber"
>
<el-input
v-model=
"currentSelectedRow.voucherNumber"
placeholder=
"请输入凭证号"
@
input=
"syncDetails(false)"
/>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
style=
"margin-top: 10px;"
>
<el-col
:span=
"16"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
...
...
@@ -226,6 +227,7 @@
<el-table-column
prop=
"batchId"
label=
"批次ID"
width=
"150"
/>
<el-table-column
prop=
"warehousesName"
label=
"仓库名称"
width=
"120"
/>
<el-table-column
prop=
"locationName"
label=
"库位名称"
width=
"120"
/>
<el-table-column
prop=
"plannedQuantity"
label=
"计划数量"
width=
"100"
/>
<el-table-column
prop=
"actualQuantity"
label=
"实际数量"
width=
"100"
fixed=
"right"
/>
<el-table-column
prop=
"unitPrice"
label=
"单价"
width=
"100"
/>
...
...
@@ -637,31 +639,18 @@ syncDetails(strict = true) {
if
(
row
.
plannedQuantity
>
availableQty
)
{
rowErrors
.
push
(
`计划数量不能超过可用库存(
${
availableQty
}
)`
);
}
}
else
{
rowErrors
.
push
(
`请填写计划数量`
);
}
// 3. 除数(有值才校验,无值不提示)
if
(
row
.
divisor
!==
null
&&
row
.
divisor
!==
undefined
)
{
if
(
row
.
unitPrice
!==
null
&&
row
.
unitPrice
!==
undefined
)
{
// 若有值但为0/负数,可补充校验(按需)
if
(
row
.
divisor
<=
0
)
{
rowErrors
.
push
(
'
换算率(除数)必须大于0
'
);
if
(
row
.
unitPrice
<=
0
)
{
rowErrors
.
push
(
'
请填写单价
'
);
}
}
// 4. 标签颜色(有值才校验,空字符串算不合规)
if
(
row
.
labelColor
!==
undefined
&&
row
.
labelColor
===
''
)
{
rowErrors
.
push
(
'请填写标签颜色'
);
}
// 5. 凭证号(有值才校验,空字符串算不合规)
if
(
row
.
voucherNumber
!==
undefined
&&
row
.
voucherNumber
===
''
)
{
rowErrors
.
push
(
'请填写凭证号'
);
}
// 6. 发货人(有值才校验,空字符串算不合规)
if
(
row
.
shippedBy
!==
undefined
&&
row
.
shippedBy
===
''
)
{
rowErrors
.
push
(
'请填写发货人'
);
}
// 收集当前行的错误(仅有值但不合规的字段)
if
(
rowErrors
.
length
>
0
)
{
errorMessages
.
push
(
`
${
rowName
}
:
${
rowErrors
.
join
(
'、'
)}
`
);
...
...
ruoyi-admin-vue/src/views/inventory/orders/index.vue
View file @
f3d69c31
...
...
@@ -125,6 +125,16 @@
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"出库日期"
prop=
"inboundDate"
>
<el-date-picker
clearable
v-model=
"queryParams.inboundDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择出库日期"
style=
"width: 100%"
/>
</el-form-item>
<el-form-item
label=
"订单状态"
prop=
"orderStatus"
>
<el-select
v-model=
"queryParams.orderStatus"
...
...
@@ -140,16 +150,6 @@
/>
</el-select>
</el-form-item>
<el-form-item
label=
"出库日期"
prop=
"inboundDate"
>
<el-date-picker
clearable
v-model=
"queryParams.inboundDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择出库日期"
style=
"width: 100%"
/>
</el-form-item>
<el-form-item
label=
"目的地"
prop=
"destination"
>
<el-input
v-model=
"queryParams.destination"
...
...
@@ -255,6 +255,7 @@
v
-
if
=
"scope.row.orderStatus===1"
@
click
=
"handleShip(scope.row)"
v
-
hasPermi
=
"['inventory:orders:edit']"
:
loading
=
"shipLoading[scope.row.id]"
>
出货
<
/el-button
>
<
el
-
button
size
=
"mini"
...
...
@@ -311,27 +312,6 @@
<
/el-col
>
<!--
新增:订单类型表单项
-->
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"订单类型"
prop
=
"orderType"
>
<
el
-
select
v
-
model
=
"form.orderType"
placeholder
=
"请选择订单类型"
:
disabled
=
"isViewDetail || formDisabled.orderType"
style
=
"width: 100%"
>
<
el
-
option
v
-
for
=
"item in dict.type.order_type"
:
key
=
"item.value"
:
label
=
"item.label"
:
value
=
"item.value"
>
<
span
style
=
"margin-left: 8px;"
>
{{
item
.
label
}}
<
/span
>
<
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"批次ID"
prop
=
"batchCode"
>
<
el
-
input
v
-
model
=
"form.batchCode"
placeholder
=
"请输入批次ID"
:
disabled
=
"isViewDetail || formDisabled.batchCode"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"仓库"
prop
=
"warehouseId"
>
<
el
-
input
v
-
model
=
"form.warehouseName"
...
...
@@ -356,6 +336,26 @@
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"批次ID"
prop
=
"batchCode"
>
<
el
-
input
v
-
model
=
"form.batchCode"
placeholder
=
"请输入批次ID"
:
disabled
=
"isViewDetail || formDisabled.batchCode"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"出库日期"
prop
=
"inboundDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.inboundDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择出库日期"
:
disabled
=
"isViewDetail"
style
=
"width: 100%"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"货主"
prop
=
"ownerId"
>
<
el
-
input
v
-
model
=
"form.ownerName"
...
...
@@ -378,18 +378,21 @@
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"出库日期"
prop
=
"inboundDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.inboundDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择出库日期"
:
disabled
=
"isViewDetail"
style
=
"width: 100%"
/>
<
el
-
form
-
item
label
=
"订单类型"
prop
=
"orderType"
>
<
el
-
select
v
-
model
=
"form.orderType"
placeholder
=
"请选择订单类型"
:
disabled
=
"isViewDetail || formDisabled.orderType"
style
=
"width: 100%"
>
<
el
-
option
v
-
for
=
"item in dict.type.order_type"
:
key
=
"item.value"
:
label
=
"item.label"
:
value
=
"item.value"
>
<
span
style
=
"margin-left: 8px;"
>
{{
item
.
label
}}
<
/span
>
<
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
...
...
@@ -527,7 +530,6 @@
/>
<
/div
>
<
/template
>
<
script
>
import
{
listOrders
,
getOrders
,
delOrders
,
addOrders
,
updateOrders
,
ship
}
from
"@/api/inventory/orders"
import
{
getMaterialsdicts
}
from
"@/api/inventory/materials"
...
...
@@ -557,6 +559,8 @@ export default {
tableKey
:
1
,
// 遮罩层
loading
:
true
,
// 出货loading(按订单ID存储,支持多订单同时操作)
shipLoading
:
{
}
,
// 新增:出货loading状态
// 选中数组
ids
:
[],
// 非单个禁用
...
...
@@ -657,9 +661,9 @@ export default {
rules
:
{
orderId
:
[{
required
:
true
,
message
:
'请输入出库单号'
,
trigger
:
'blur'
}
],
warehouseId
:
[{
required
:
true
,
message
:
'请选择仓库'
,
trigger
:
'blur'
}
],
ownerId
:
[{
required
:
true
,
message
:
'请选择货主'
,
trigger
:
'blur'
}
],
inboundDate
:
[{
required
:
true
,
message
:
'请选择出库日期'
,
trigger
:
'change'
}
],
orderType
:
[{
required
:
true
,
message
:
'请选择订单类型'
,
trigger
:
'change'
}
],
// 新增:订单类型校验
orderTypeId
:
[{
required
:
true
,
message
:
'请选择出库类型'
,
trigger
:
'change'
}
],
batchCode
:
[{
required
:
true
,
message
:
'请选输入批次号'
,
trigger
:
'change'
}
],
}
,
// 货主/仓库选择相关
ownerSelectorVisible
:
false
,
...
...
@@ -678,9 +682,24 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
getList
()
}
)
this
.
handleShip
=
this
.
debounce
(
this
.
handleShip
,
500
)
}
,
methods
:
{
debounce
(
fn
,
delay
=
300
)
{
let
timer
=
null
;
let
pendingPromise
=
null
;
return
async
function
(...
args
)
{
if
(
timer
)
clearTimeout
(
timer
);
pendingPromise
=
new
Promise
((
resolve
)
=>
{
timer
=
setTimeout
(
async
()
=>
{
const
result
=
await
fn
.
apply
(
this
,
args
);
resolve
(
result
);
timer
=
null
;
}
,
delay
);
}
);
return
pendingPromise
;
}
;
}
,
handleOrderTypeChange
(
selection
)
{
this
.
form
.
orderTypeId
=
selection
}
,
...
...
@@ -722,7 +741,7 @@ export default {
this
.
ownerSelectorVisible
=
true
}
,
// 货主选择回调(核心缺失方法)
handleOwnerSelected
(
owner
)
{
handleOwnerSelected
(
owner
)
{
if
(
!
owner
)
return
if
(
this
.
ownerSelectTarget
===
'query'
)
{
this
.
queryParams
.
ownerId
=
owner
.
ownerId
||
owner
.
id
...
...
@@ -739,7 +758,7 @@ handleOwnerSelected(owner) {
}
}
this
.
ownerSelectorVisible
=
false
}
,
}
,
// 打开仓库选择器
openWarehouseSelector
(
target
=
'form'
)
{
this
.
warehouseSelectTarget
=
target
...
...
@@ -796,26 +815,35 @@ handleOwnerSelected(owner) {
calcGroupAmount
(
items
)
{
return
items
.
reduce
((
sum
,
item
)
=>
sum
+
(
Number
(
item
.
amount
)
||
0
),
0
).
toFixed
(
2
)
}
,
// 核心出货方法
// 核心出货方法
(添加loading+弹窗确认)
async
handleShip
(
row
)
{
// 新增:出货前弹窗确认
this
.
$modal
.
confirm
(
`是否确认对出库单【${row.orderId
}
】执行出货操作?`
).
then
(
async
()
=>
{
try
{
// 调用ship接口提交数据到后端
console
.
log
(
"handleShip"
,
row
)
// 设置当前订单出货loading
this
.
$set
(
this
.
shipLoading
,
row
.
id
,
true
)
// 原有业务逻辑
console
.
log
(
"handleShip"
,
row
)
await
ship
({
...
row
,
orderId
:
row
.
orderId
,
// 用户填写的出货单号
outboundOrderId
:
row
.
id
// 主表ID作为outboundOrderId
}
)
// 提示成功并刷新列表
this
.
$modal
.
msgSuccess
(
"出货操作成功,数据已提交到后端"
)
this
.
getList
()
}
catch
(
error
)
{
// 错误处理
this
.
$modal
.
msgError
(
error
.
msg
||
"出货操作失败"
)
}
finally
{
// 关闭loading
this
.
$delete
(
this
.
shipLoading
,
row
.
id
)
}
}
,
// 修复:获取要传递给子组件的初始化明细数据(按物料分组)
}
).
catch
(()
=>
{
// 取消确认时不执行任何操作
}
)
}
,
// 修复:获取要传递给子组件的初始化明细数据(按物料分组)
getInitDetails
()
{
// 编辑场景:传递当前物料分组的所有明细(确保子组件反显)
if
(
this
.
isEditDetail
&&
this
.
currentMaterialId
)
{
...
...
@@ -941,7 +969,7 @@ handleOwnerSelected(owner) {
this
.
detailDialogOpen
=
true
}
)
}
,
handleDetailSubmit
(
details
)
{
handleDetailSubmit
(
details
)
{
// 确保是数组格式
const
detailList
=
Array
.
isArray
(
details
)
?
details
:
[
details
];
if
(
detailList
.
length
===
0
)
{
...
...
@@ -1050,7 +1078,7 @@ handleDetailSubmit(details) {
this
.
detailDialogOpen
=
false
;
// 强制更新视图
this
.
$forceUpdate
();
}
,
}
,
// 计算主表总数量和总金额
calcTotalQuantity
()
{
let
totalPlanned
=
0
...
...
@@ -1213,7 +1241,7 @@ handleDetailSubmit(details) {
resetQuery
()
{
// 检查ref存在性
if
(
this
.
$refs
.
queryForm
)
{
this
.
queryParams
=
{
this
.
queryParams
=
{
pageNum
:
1
,
pageSize
:
10
,
orderId
:
null
,
...
...
@@ -1436,6 +1464,9 @@ handleDetailSubmit(details) {
this
.
$refs
[
"form"
].
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
// 新增:提交前弹窗确认
const
confirmText
=
this
.
form
.
id
?
'修改'
:
'新增'
this
.
$modal
.
confirm
(
`是否确认${confirmText
}
出库单【${this.form.orderId || '未命名'
}
】?`
).
then
(
async
()
=>
{
// 检查是否有明细数据
const
hasDetails
=
Object
.
values
(
this
.
outboundOrderItemsGroup
).
some
(
group
=>
group
.
items
.
length
>
0
)
if
(
!
hasDetails
)
{
...
...
@@ -1512,6 +1543,9 @@ handleDetailSubmit(details) {
this
.
$modal
.
msgError
(
errorMsg
)
}
}
}
).
catch
(()
=>
{
// 取消确认时不执行任何操作
}
)
}
}
)
}
,
...
...
@@ -1538,69 +1572,3 @@ handleDetailSubmit(details) {
}
}
<
/script>
\ No newline at end of file
<
style
scoped
>
/* 页面容器样式 */
.
page
-
container
{
background
:
#
fff
;
padding
:
16
px
;
border
-
radius
:
4
px
;
box
-
shadow
:
0
2
px
12
px
0
rgba
(
0
,
0
,
0
,
0.04
);
margin
-
top
:
16
px
;
}
/* 表格容器样式 */
.
table
-
container
{
margin
-
top
:
16
px
;
height
:
calc
(
100
vh
-
280
px
);
}
/* 弹窗内表单滚动优化 */
.
el
-
dialog__body
{
max
-
height
:
70
vh
;
overflow
-
y
:
auto
;
padding
-
right
:
10
px
;
}
/* 自定义滚动条 */
.
el
-
dialog__body
::
-
webkit
-
scrollbar
{
width
:
6
px
;
}
.
el
-
dialog__body
::
-
webkit
-
scrollbar
-
thumb
{
background
-
color
:
#
ddd
;
border
-
radius
:
3
px
;
}
/* 明细表格样式优化 */
.
el
-
table
{
--
el
-
table
-
row
-
hover
-
bg
-
color
:
#
f8f9fa
;
}
/* 空数据提示样式 */
.
empty
-
tip
{
color
:
#
999
;
font
-
size
:
14
px
;
}
/* 物料分组样式 */
.
material
-
group
{
border
:
1
px
solid
#
e6e6e6
;
border
-
radius
:
6
px
;
padding
:
10
px
;
}
.
group
-
header
{
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
space
-
between
;
}
.
mb10
{
margin
-
bottom
:
10
px
;
}
.
mb8
{
margin
-
bottom
:
8
px
;
}
<
/style>
\ No newline at end of file
ruoyi-admin-vue/src/views/inventory/warehouses/index.vue
View file @
f3d69c31
...
...
@@ -36,14 +36,7 @@
@
click=
"handleExport"
v-hasPermi=
"['inventory:warehouses:export']"
>
导出
</el-button>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"medium"
@
click=
"handleImport"
v-hasPermi=
"['inventory:warehouses:add']"
>
导入
</el-button>
</
template
>
</PageTitle>
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/InventoryTransactions.java
View file @
f3d69c31
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.inventory.domain;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.annotation.Excel
;
...
...
@@ -13,6 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2025-12-02
*/
@Data
public
class
InventoryTransactions
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -91,218 +93,7 @@ public class InventoryTransactions extends BaseEntity
@Excel
(
name
=
"排序号"
)
private
String
updateUserCode
;
public
String
getInventoryId
()
{
return
inventoryId
;
}
@Excel
(
name
=
"单价"
)
private
String
unitPrice
;
public
void
setInventoryId
(
String
inventoryId
)
{
this
.
inventoryId
=
inventoryId
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getId
()
{
return
id
;
}
public
void
setTransactionType
(
Long
transactionType
)
{
this
.
transactionType
=
transactionType
;
}
public
Long
getTransactionType
()
{
return
transactionType
;
}
public
void
setReferenceId
(
String
referenceId
)
{
this
.
referenceId
=
referenceId
;
}
public
String
getReferenceId
()
{
return
referenceId
;
}
public
void
setReferenceItemId
(
String
referenceItemId
)
{
this
.
referenceItemId
=
referenceItemId
;
}
public
String
getReferenceItemId
()
{
return
referenceItemId
;
}
public
void
setMaterialId
(
String
materialId
)
{
this
.
materialId
=
materialId
;
}
public
String
getMaterialId
()
{
return
materialId
;
}
public
void
setBatchCode
(
String
batchCode
)
{
this
.
batchCode
=
batchCode
;
}
public
String
getBatchCode
()
{
return
batchCode
;
}
public
void
setWarehouseId
(
String
warehouseId
)
{
this
.
warehouseId
=
warehouseId
;
}
public
String
getWarehouseId
()
{
return
warehouseId
;
}
public
void
setLocationId
(
String
locationId
)
{
this
.
locationId
=
locationId
;
}
public
String
getLocationId
()
{
return
locationId
;
}
public
void
setOwnerId
(
String
ownerId
)
{
this
.
ownerId
=
ownerId
;
}
public
String
getOwnerId
()
{
return
ownerId
;
}
public
void
setQuantityBefore
(
Long
quantityBefore
)
{
this
.
quantityBefore
=
quantityBefore
;
}
public
Long
getQuantityBefore
()
{
return
quantityBefore
;
}
public
void
setQuantityChange
(
Long
quantityChange
)
{
this
.
quantityChange
=
quantityChange
;
}
public
Long
getQuantityChange
()
{
return
quantityChange
;
}
public
void
setQuantityAfter
(
Long
quantityAfter
)
{
this
.
quantityAfter
=
quantityAfter
;
}
public
Long
getQuantityAfter
()
{
return
quantityAfter
;
}
public
void
setTransactionTime
(
Date
transactionTime
)
{
this
.
transactionTime
=
transactionTime
;
}
public
Date
getTransactionTime
()
{
return
transactionTime
;
}
public
void
setOperatedBy
(
String
operatedBy
)
{
this
.
operatedBy
=
operatedBy
;
}
public
String
getOperatedBy
()
{
return
operatedBy
;
}
public
void
setIsUsed
(
Long
isUsed
)
{
this
.
isUsed
=
isUsed
;
}
public
Long
getIsUsed
()
{
return
isUsed
;
}
public
void
setSortNo
(
Long
sortNo
)
{
this
.
sortNo
=
sortNo
;
}
public
Long
getSortNo
()
{
return
sortNo
;
}
public
void
setCreateUserCode
(
String
createUserCode
)
{
this
.
createUserCode
=
createUserCode
;
}
public
String
getCreateUserCode
()
{
return
createUserCode
;
}
public
void
setUpdateUserCode
(
String
updateUserCode
)
{
this
.
updateUserCode
=
updateUserCode
;
}
public
String
getUpdateUserCode
()
{
return
updateUserCode
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"transactionType"
,
getTransactionType
())
.
append
(
"referenceId"
,
getReferenceId
())
.
append
(
"referenceItemId"
,
getReferenceItemId
())
.
append
(
"materialId"
,
getMaterialId
())
.
append
(
"batchCode"
,
getBatchCode
())
.
append
(
"warehouseId"
,
getWarehouseId
())
.
append
(
"locationId"
,
getLocationId
())
.
append
(
"ownerId"
,
getOwnerId
())
.
append
(
"quantityBefore"
,
getQuantityBefore
())
.
append
(
"quantityChange"
,
getQuantityChange
())
.
append
(
"quantityAfter"
,
getQuantityAfter
())
.
append
(
"transactionTime"
,
getTransactionTime
())
.
append
(
"operatedBy"
,
getOperatedBy
())
.
append
(
"remark"
,
getRemark
())
.
append
(
"isUsed"
,
getIsUsed
())
.
append
(
"sortNo"
,
getSortNo
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUserCode"
,
getCreateUserCode
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"updateUserCode"
,
getUpdateUserCode
())
.
toString
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItems.java
View file @
f3d69c31
...
...
@@ -66,7 +66,7 @@ public class OutboundOrderItems extends BaseEntity
/** 单价 */
@Excel
(
name
=
"单价"
)
private
Long
unitPrice
;
private
Double
unitPrice
;
/** 计划数量 */
@Excel
(
name
=
"计划数量"
)
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Owners.java
View file @
f3d69c31
...
...
@@ -28,7 +28,7 @@ public class Owners extends BaseEntity
@Excel
(
name
=
"货主名称"
)
private
String
ownerName
;
@Excel
(
name
=
"
货主
名称"
)
@Excel
(
name
=
"
英文
名称"
)
private
String
englishName
;
/** 货主类型 1-供应商 2-客户 3-内部 检索条件 */
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
f3d69c31
...
...
@@ -159,14 +159,16 @@ public class InventoryServiceImpl implements IInventoryService
// 库存操作表插入数据
InventoryTransactions
transactions
=
new
InventoryTransactions
();
transactions
.
setId
(
IdUtils
.
simpleUUID
());
transactions
.
setTransactionType
(
2L
);
// 事务类型-盘点
transactions
.
setTransactionType
(
2L
);
// 事务类型-出库
transactions
.
setBatchCode
(
outboundOrderItem
.
getBatchCode
());
transactions
.
setUnitPrice
(
String
.
valueOf
(
outboundOrderItem
.
getUnitPrice
()));
transactions
.
setInventoryId
(
inventory
.
getId
());
// 库存表Id
transactions
.
setReferenceId
(
outboundOrderItem
.
getOutboundOrderId
());
//关联单号,相当于主记录-盘点主表
transactions
.
setReferenceItemId
(
outboundOrderItem
.
getId
());
// 盘点子表id
transactions
.
setMaterialId
(
outboundOrderItem
.
getMaterialId
());
transactions
.
setWarehouseId
(
outboundOrderItem
.
getWarehouseId
());
transactions
.
setLocationId
(
outboundOrderItem
.
getLocationId
());
OutboundOrders
outboundOrders
=
outboundOrderMapper
.
selectOutboundOrdersById
(
outboundOrderItem
.
get
Warehouse
Id
());
OutboundOrders
outboundOrders
=
outboundOrderMapper
.
selectOutboundOrdersById
(
outboundOrderItem
.
get
OutboundOrder
Id
());
transactions
.
setOwnerId
(
outboundOrders
.
getOwnerId
());
transactions
.
setQuantityBefore
(
Long
.
valueOf
(
quantity
));
// 变更前数量
transactions
.
setQuantityAfter
(
inventory
.
getQuantity
());
// 变更后数量
...
...
@@ -175,10 +177,7 @@ public class InventoryServiceImpl implements IInventoryService
transactions
.
setTransactionTime
(
nowDate
);
transactions
.
setOperatedBy
(
SystemUtils
.
getUserName
());
int
inventoryTransactions
=
insertInventoryTransactions
.
insertInventoryTransactions
(
transactions
);
if
(
inventoryTransactions
<
0
)
{
return
-
1
;
}
insertInventoryTransactions
.
insertInventoryTransactions
(
transactions
);
}
RefreshInventory
(
inventoryIds
);
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
View file @
f3d69c31
...
...
@@ -413,6 +413,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
itemsList
.
setWarehousesId
(
itemDO
.
getWarehouseId
());
itemsList
.
setMaterialId
(
itemDO
.
getMaterialId
());
itemsList
.
setLocationId
(
itemDO
.
getLocationId
());
itemsList
.
setInventoryType
(
Long
.
valueOf
(
orderType
));
List
<
Inventory
>
inventory
=
inventoryService
.
selectInventoryList
(
itemsList
);
if
(
CollectionUtils
.
isEmpty
(
inventory
))
{
throw
new
ServiceException
(
String
.
format
(
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
f3d69c31
...
...
@@ -50,8 +50,10 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
public
StorageLocations
selectStorageLocationsById
(
String
id
)
{
StorageLocations
storageLocations
=
storageLocationsMapper
.
selectStorageLocationsById
(
id
);
String
[]
AllowedCategoryIds
=
storageLocations
.
getAllowedCategoryIds
().
split
(
","
);
String
AllowedCategoryName
=
""
;
if
(
storageLocations
.
getAllowedCategoryIds
()
!=
null
)
{
String
[]
AllowedCategoryIds
=
storageLocations
.
getAllowedCategoryIds
().
split
(
","
);
if
(
AllowedCategoryIds
!=
null
&&
AllowedCategoryIds
.
length
>
0
)
{
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
Materials
materials
=
materialsMapper
.
selectMaterialsById
(
AllowedCategoryId
);
if
(
materials
!=
null
&&
materials
.
getMaterialName
()
!=
null
)
{
...
...
@@ -62,6 +64,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
AllowedCategoryName
+=
categoryName
;
}
}
}
}
storageLocations
.
setAllowedCategoryNames
(
AllowedCategoryName
);
return
storageLocations
;
}
...
...
@@ -260,6 +264,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
StorageLocations
storageLocations
=
new
StorageLocations
();
// 拷贝基础属性
BeanUtils
.
copyProperties
(
templateVO
,
storageLocations
);
storageLocations
.
setLocationName
(
templateVO
.
getLocationCode
());
// 字段类型转换与赋值
storageLocations
.
setId
(
UUID
.
randomUUID
().
toString
());
...
...
@@ -274,6 +279,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocations
.
setCreateBy
(
operId
);
storageLocations
.
setCreateTime
(
now
);
storageLocations
.
setCreateUserCode
(
operId
);
storageLocations
.
setWarehousesCode
(
"固定仓库"
);
storageLocations
.
setWarehousesId
(
"572ba484-199c-45d9-9735-610928ed5c70"
);
// 设置默认值
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
f3d69c31
...
...
@@ -563,6 +563,9 @@ and inventory_status = '1'
and i.unit_price > 0
and i.last_inbound_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.last_inbound_time
<
DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc, m.material_name asc
</select>
...
...
@@ -577,6 +580,9 @@ and inventory_status = '1'
and i.is_used = 1
and i.last_inbound_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.last_inbound_time
<
DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc, m.material_name asc
</select>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryTransactionsMapper.xml
View file @
f3d69c31
...
...
@@ -87,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUserCode != null"
>
create_user_code,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"updateUserCode != null"
>
update_user_code,
</if>
<if
test=
"unitPrice != null"
>
unit_price,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
...
...
@@ -111,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUserCode != null"
>
#{createUserCode},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"updateUserCode != null"
>
#{updateUserCode},
</if>
<if
test=
"unitPrice != null"
>
#{unitPrice},
</if>
</trim>
</insert>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
View file @
f3d69c31
...
...
@@ -315,6 +315,9 @@
and ooi.is_used = 1
and ooi.shipped_at >= DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00')
and ooi.shipped_at
<
DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01 00:00:00')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc
limit 10;
...
...
@@ -330,6 +333,9 @@
and ooi.is_used = 1
and ooi.shipped_at >= DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00')
and ooi.shipped_at
<
DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01 00:00:00')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc
limit 10;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论