Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
maintain_service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘帅
maintain_service
Commits
25cc5dcc
Commit
25cc5dcc
authored
Sep 05, 2025
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.出库时库存错误问题修复
2.样式优化
parent
9375b80f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
63 deletions
+49
-63
ErpMaterialInventoryRecordServiceImpl.java
...s/service/impl/ErpMaterialInventoryRecordServiceImpl.java
+1
-1
ErpMaterialInventoryRecordMapper.xml
...ain/resources/mapper/ErpMaterialInventoryRecordMapper.xml
+33
-52
index.vue
maintain-ui/src/views/business/material/index.vue
+1
-1
add.vue
maintain-ui/src/views/business/materialPicking/add.vue
+1
-1
index.vue
maintain-ui/src/views/business/materialPicking/index.vue
+10
-5
index.vue
maintain-ui/src/views/business/materialReturns/index.vue
+2
-2
index.vue
maintain-ui/src/views/business/materialStock/index.vue
+1
-1
No files found.
maintain-business/src/main/java/com/maintain/business/service/impl/ErpMaterialInventoryRecordServiceImpl.java
View file @
25cc5dcc
...
...
@@ -87,7 +87,7 @@ public class ErpMaterialInventoryRecordServiceImpl implements IErpMaterialInvent
.
eq
(
"t.type"
,
1
)
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getMaterialName
()),
"t.material_name"
,
bo
.
getMaterialName
())
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getMaterialCode
()),
"t.material_code"
,
bo
.
getMaterialCode
())
.
like
(
null
!=
bo
.
getVendorId
(),
"t.vendor_id"
,
bo
.
getVendorId
())
.
eq
(
null
!=
bo
.
getVendorId
(),
"t.vendor_id"
,
bo
.
getVendorId
())
.
like
(
null
!=
bo
.
getWarehouseId
(),
"t.warehouse_id"
,
bo
.
getWarehouseId
())
.
in
(
null
!=
bo
.
getWarehouseIdList
(),
"t.warehouse_id"
,
bo
.
getWarehouseIdList
())
.
ge
(
null
!=
bo
.
getInventory
(),
"t.inventory"
,
bo
.
getInventory
())
...
...
maintain-business/src/main/resources/mapper/ErpMaterialInventoryRecordMapper.xml
View file @
25cc5dcc
...
...
@@ -83,8 +83,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) t
</sql>
<sql
id=
"list"
>
SELECT t.* FROM (SELECT
r.id as recordId,
SELECT
t.*
FROM
(
SELECT
r.id AS recordId,
r.info_id,
r.material_id,
r.warehouse_id,
...
...
@@ -92,8 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
r.price,
r.type,
r.create_time,
IFNULL(put.put_number, 0) - IFNULL(ret.ret_number, 0) - IFNULL(pic.out_number, 0) + IFNULL(back.back_number, 0) AS inventory,
m.material_code,
IFNULL( put.putaway_number, 0 ) - IFNULL( put.issued_number, 0 ) - IFNULL( put.returned_number, 0 ) AS inventory,m.material_code,
m.material_name,
m.material_specifications,
m.material_unit,
...
...
@@ -105,35 +108,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.selling_price,
m.material_url,
v.vendor_name,
w.name as warehouseName
FROM erp_material_inventory_record r
w.NAME AS warehouseName
FROM
erp_material_inventory_record r
LEFT JOIN erp_material m ON r.material_id = m.id
LEFT JOIN erp_warehouse w ON r.warehouse_id = w.id
LEFT JOIN erp_material_vendor v ON r.vendor_id = v.id
LEFT JOIN (
SELECT material_id, warehouse_id, vendor_id, SUM(number) AS put_number
FROM erp_material_inventory_record
WHERE type = '1'
GROUP BY material_id, warehouse_id, vendor_id
) put ON r.material_id = put.material_id AND r.warehouse_id = put.warehouse_id AND r.vendor_id = put.vendor_id
LEFT JOIN (
SELECT material_id, warehouse_id, vendor_id, SUM(number) AS ret_number
FROM erp_material_inventory_record
WHERE type = '2'
GROUP BY material_id, warehouse_id, vendor_id
) ret ON r.material_id = ret.material_id AND r.warehouse_id = ret.warehouse_id AND r.vendor_id = ret.vendor_id
LEFT JOIN (
SELECT material_id, warehouse_id, vendor_id, SUM(number) AS out_number
FROM erp_material_inventory_record
WHERE type = '3'
GROUP BY material_id, warehouse_id, vendor_id
) pic ON r.material_id = pic.material_id AND r.warehouse_id = pic.warehouse_id AND r.vendor_id = pic.vendor_id
LEFT JOIN (
SELECT material_id, warehouse_id, vendor_id, SUM(number) AS back_number
FROM erp_material_inventory_record
WHERE type = '4'
GROUP BY material_id, warehouse_id, vendor_id
) back ON r.material_id = back.material_id AND r.warehouse_id = back.warehouse_id AND r.vendor_id = back.vendor_id
LEFT JOIN erp_material_putaway_info put ON r.info_id = put.id
) t
</sql>
<select
id=
"customQueryPageInventoryList"
resultType=
"com.maintain.business.domain.vo.ErpMaterialInventoryRecordVo"
>
...
...
maintain-ui/src/views/business/material/index.vue
View file @
25cc5dcc
...
...
@@ -149,7 +149,7 @@
</el-table-column>
<!-- <el-table-column label="所在仓库" align="center" prop="warehouseName" />-->
<!-- <el-table-column label="分类名称" align="center" prop="materialTypeName" />-->
<el-table-column
label=
"适用车型"
align=
"center"
prop=
"compatibleWith"
/>
<el-table-column
label=
"适用车型"
align=
"center"
prop=
"compatibleWith"
show-overflow-tooltip
/>
<el-table-column
label=
"物资图片"
align=
"center"
prop=
"materialUrl"
>
<
template
slot-scope=
"scope"
>
<image-preview
:src=
"scope.row.materialUrl"
style=
"width: 50px; height: 50px"
/>
...
...
maintain-ui/src/views/business/materialPicking/add.vue
View file @
25cc5dcc
...
...
@@ -331,7 +331,7 @@ export default {
this
.
tempSelection
=
[];
// 手动设置勾选(匹配外部已选数据)
this
.
materialList
.
forEach
(
row
=>
{
const
isSelected
=
this
.
form
.
pickingInfoList
.
some
(
item
=>
item
.
warehouseId
===
row
.
warehouseId
&&
item
.
materialId
===
row
.
material
Id
);
const
isSelected
=
this
.
form
.
pickingInfoList
.
some
(
item
=>
item
.
recordId
===
row
.
record
Id
);
this
.
$refs
.
selectionTable
.
toggleRowSelection
(
row
,
isSelected
);
});
});
...
...
maintain-ui/src/views/business/materialPicking/index.vue
View file @
25cc5dcc
...
...
@@ -343,7 +343,7 @@
<
el
-
table
-
column
label
=
"
物资编码
"
align
=
"
center
"
prop
=
"
materialCode
"
/>
<
el
-
table
-
column
label
=
"
物资名称
"
align
=
"
center
"
prop
=
"
materialName
"
/>
<
el
-
table
-
column
label
=
"
物资规格
"
align
=
"
center
"
prop
=
"
materialSpecifications
"
/>
<
el
-
table
-
column
label
=
"
物资单位
"
align
=
"
center
"
prop
=
"
materialUnit
"
width
=
"
8
0
"
>
<
el
-
table
-
column
label
=
"
物资单位
"
align
=
"
center
"
prop
=
"
materialUnit
"
width
=
"
5
0
"
>
<
template
slot
-
scope
=
"
scope
"
>
<
dict
-
tag
:
options
=
"
dict.type.material_unit
"
:
value
=
"
scope.row.materialUnit
"
/>
<
/template
>
...
...
@@ -351,7 +351,8 @@
<!--
<
el
-
table
-
column
label
=
"
质保期
"
align
=
"
center
"
prop
=
"
materialWarrantyPeriod
"
/>-->
<
el
-
table
-
column
label
=
"
参考价
"
align
=
"
center
"
prop
=
"
referencePrice
"
width
=
"
100
"
/>
<
el
-
table
-
column
label
=
"
销售价
"
align
=
"
center
"
prop
=
"
sellingPrice
"
width
=
"
100
"
/>
<
el
-
table
-
column
label
=
"
库存
"
align
=
"
center
"
prop
=
"
inventory
"
width
=
"
100
"
/>
<
el
-
table
-
column
label
=
"
库存
"
align
=
"
center
"
prop
=
"
inventory
"
width
=
"
80
"
/>
<
el
-
table
-
column
label
=
"
入库时间
"
align
=
"
center
"
prop
=
"
createTime
"
width
=
"
160
"
/>
<
/el-table
>
<
pagination
v
-
show
=
"
materialTotal>0
"
:
total
=
"
materialTotal
"
:
page
.
sync
=
"
queryMaterialParams.pageNum
"
:
limit
.
sync
=
"
queryMaterialParams.pageSize
"
@
pagination
=
"
getMaterialList
"
/>
<
div
slot
=
"
footer
"
class
=
"
dialog-footer
"
>
...
...
@@ -486,6 +487,7 @@ export default {
queryMaterialParams
:
{
pageNum
:
1
,
pageSize
:
10
,
vendorId
:
undefined
,
vendorName
:
undefined
,
warehouseId
:
undefined
,
warehouseIdList
:
[],
...
...
@@ -567,11 +569,11 @@ export default {
return
}
this
.
open1
=
true
this
.
queryMaterialParams
.
vendorId
=
this
.
form
.
vendorId
;
this
.
getMaterialList
()
}
,
/** 供应商改变 */
vendorIdChange
(
vendorId
)
{
this
.
queryMaterialParams
.
vendorId
=
vendorId
;
this
.
form
.
pickingInfoList
=
[]
}
,
/** 搜索按钮操作 */
...
...
@@ -581,7 +583,10 @@ export default {
}
,
/** 重置按钮操作 */
resetMaterialQuery
()
{
this
.
resetForm
(
"
queryMaterialForm
"
);
this
.
queryMaterialParams
.
materialCode
=
undefined
;
this
.
queryMaterialParams
.
materialName
=
undefined
;
this
.
queryMaterialParams
.
pageNum
=
1
this
.
queryMaterialParams
.
pageSize
=
10
this
.
handleMaterialQuery
();
}
,
/** 查询物资列表 */
...
...
@@ -597,7 +602,7 @@ export default {
this
.
tempSelection
=
[];
// 手动设置勾选(匹配外部已选数据)
this
.
materialList
.
forEach
(
row
=>
{
const
isSelected
=
this
.
form
.
pickingInfoList
.
some
(
item
=>
item
.
warehouseId
===
row
.
warehouseId
&&
item
.
materialId
===
row
.
material
Id
);
const
isSelected
=
this
.
form
.
pickingInfoList
.
some
(
item
=>
item
.
recordId
===
row
.
record
Id
);
this
.
$refs
.
selectionTable
.
toggleRowSelection
(
row
,
isSelected
);
}
);
}
);
...
...
maintain-ui/src/views/business/materialReturns/index.vue
View file @
25cc5dcc
...
...
@@ -513,12 +513,12 @@ export default {
this
.
form
.
returnsInfoBoList
=
this
.
materialList
let
isTrue
=
false
;
this
.
form
.
returnsInfoBoList
.
forEach
(
item
=>
{
if
(
item
.
returnsNumber
<
1
)
{
if
(
item
.
returnsNumber
<
0.
1
)
{
isTrue
=
true
;
}
}
)
if
(
isTrue
)
{
this
.
$modal
.
msgError
(
'
退货数量不能小于1
'
)
this
.
$modal
.
msgError
(
'
退货数量不能小于
0.
1
'
)
this
.
buttonLoading
=
false
;
return
}
...
...
maintain-ui/src/views/business/materialStock/index.vue
View file @
25cc5dcc
...
...
@@ -58,7 +58,7 @@
</
template
>
</el-table-column>
<!-- <el-table-column label="采购标的" align="center" prop="procurementSubject" />-->
<el-table-column
label=
"适用车型"
align=
"center"
prop=
"compatibleWith"
/>
<el-table-column
label=
"适用车型"
align=
"center"
prop=
"compatibleWith"
show-overflow-tooltip
/>
<el-table-column
label=
"物资图片"
align=
"center"
prop=
"materialUrl"
>
<
template
slot-scope=
"scope"
>
<image-preview
:src=
"scope.row.materialUrl"
style=
"width: 50px; height: 50px"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment