Commit 25cc5dcc authored by 刘帅's avatar 刘帅

1.出库时库存错误问题修复

2.样式优化
parent 9375b80f
......@@ -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())
......
......@@ -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">
......
......@@ -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" />
......
......@@ -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.materialId);
const isSelected = this.form.pickingInfoList.some(item => item.recordId === row.recordId);
this.$refs.selectionTable.toggleRowSelection(row, isSelected);
});
});
......
......@@ -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="80">
<el-table-column label="物资单位" align="center" prop="materialUnit" width="50">
<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.materialId);
const isSelected = this.form.pickingInfoList.some(item => item.recordId === row.recordId);
this.$refs.selectionTable.toggleRowSelection(row, isSelected);
});
});
......
......@@ -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
}
......
......@@ -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" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment