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

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

2.样式优化
parent 9375b80f
...@@ -87,7 +87,7 @@ public class ErpMaterialInventoryRecordServiceImpl implements IErpMaterialInvent ...@@ -87,7 +87,7 @@ public class ErpMaterialInventoryRecordServiceImpl implements IErpMaterialInvent
.eq("t.type", 1) .eq("t.type", 1)
.like(StringUtils.isNotBlank(bo.getMaterialName()),"t.material_name", bo.getMaterialName()) .like(StringUtils.isNotBlank(bo.getMaterialName()),"t.material_name", bo.getMaterialName())
.like(StringUtils.isNotBlank(bo.getMaterialCode()),"t.material_code", bo.getMaterialCode()) .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()) .like(null != bo.getWarehouseId(), "t.warehouse_id", bo.getWarehouseId())
.in(null != bo.getWarehouseIdList(), "t.warehouse_id", bo.getWarehouseIdList()) .in(null != bo.getWarehouseIdList(), "t.warehouse_id", bo.getWarehouseIdList())
.ge(null != bo.getInventory(), "t.inventory", bo.getInventory()) .ge(null != bo.getInventory(), "t.inventory", bo.getInventory())
......
...@@ -83,58 +83,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,58 +83,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) t ) t
</sql> </sql>
<sql id="list"> <sql id="list">
SELECT t.* FROM (SELECT SELECT
r.id as recordId, t.*
r.info_id, FROM
r.material_id, (
r.warehouse_id, SELECT
r.vendor_id, r.id AS recordId,
r.price, r.info_id,
r.type, r.material_id,
r.create_time, r.warehouse_id,
IFNULL(put.put_number, 0) - IFNULL(ret.ret_number, 0) - IFNULL(pic.out_number, 0) + IFNULL(back.back_number, 0) AS inventory, r.vendor_id,
m.material_code, r.price,
m.material_name, r.type,
m.material_specifications, r.create_time,
m.material_unit, IFNULL( put.putaway_number, 0 ) - IFNULL( put.issued_number, 0 ) - IFNULL( put.returned_number, 0 ) AS inventory,m.material_code,
m.material_brand, m.material_name,
m.procurement_subject, m.material_specifications,
m.compatible_with, m.material_unit,
m.material_warranty_period, m.material_brand,
m.reference_price, m.procurement_subject,
m.selling_price, m.compatible_with,
m.material_url, m.material_warranty_period,
v.vendor_name, m.reference_price,
w.name as warehouseName m.selling_price,
FROM erp_material_inventory_record r m.material_url,
LEFT JOIN erp_material m ON r.material_id = m.id v.vendor_name,
LEFT JOIN erp_warehouse w ON r.warehouse_id = w.id w.NAME AS warehouseName
LEFT JOIN erp_material_vendor v ON r.vendor_id = v.id FROM
LEFT JOIN ( erp_material_inventory_record r
SELECT material_id, warehouse_id, vendor_id, SUM(number) AS put_number LEFT JOIN erp_material m ON r.material_id = m.id
FROM erp_material_inventory_record LEFT JOIN erp_warehouse w ON r.warehouse_id = w.id
WHERE type = '1' LEFT JOIN erp_material_vendor v ON r.vendor_id = v.id
GROUP BY material_id, warehouse_id, vendor_id LEFT JOIN erp_material_putaway_info put ON r.info_id = put.id
) put ON r.material_id = put.material_id AND r.warehouse_id = put.warehouse_id AND r.vendor_id = put.vendor_id ) t
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
) t
</sql> </sql>
<select id="customQueryPageInventoryList" resultType="com.maintain.business.domain.vo.ErpMaterialInventoryRecordVo"> <select id="customQueryPageInventoryList" resultType="com.maintain.business.domain.vo.ErpMaterialInventoryRecordVo">
<include refid="list"/> <include refid="list"/>
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
</el-table-column> </el-table-column>
<!-- <el-table-column label="所在仓库" align="center" prop="warehouseName" />--> <!-- <el-table-column label="所在仓库" align="center" prop="warehouseName" />-->
<!-- <el-table-column label="分类名称" align="center" prop="materialTypeName" />--> <!-- <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"> <el-table-column label="物资图片" align="center" prop="materialUrl">
<template slot-scope="scope"> <template slot-scope="scope">
<image-preview :src="scope.row.materialUrl" style="width: 50px; height: 50px" /> <image-preview :src="scope.row.materialUrl" style="width: 50px; height: 50px" />
......
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
this.tempSelection = []; this.tempSelection = [];
// 手动设置勾选(匹配外部已选数据) // 手动设置勾选(匹配外部已选数据)
this.materialList.forEach(row => { 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); this.$refs.selectionTable.toggleRowSelection(row, isSelected);
}); });
}); });
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
<el-table-column label="物资编码" align="center" prop="materialCode" /> <el-table-column label="物资编码" align="center" prop="materialCode" />
<el-table-column label="物资名称" align="center" prop="materialName" /> <el-table-column label="物资名称" align="center" prop="materialName" />
<el-table-column label="物资规格" align="center" prop="materialSpecifications" /> <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"> <template slot-scope="scope">
<dict-tag :options="dict.type.material_unit" :value="scope.row.materialUnit" /> <dict-tag :options="dict.type.material_unit" :value="scope.row.materialUnit" />
</template> </template>
...@@ -351,7 +351,8 @@ ...@@ -351,7 +351,8 @@
<!-- <el-table-column label="质保期" align="center" prop="materialWarrantyPeriod" />--> <!-- <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="referencePrice" width="100" />
<el-table-column label="销售价" align="center" prop="sellingPrice" 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> </el-table>
<pagination v-show="materialTotal>0" :total="materialTotal" :page.sync="queryMaterialParams.pageNum" :limit.sync="queryMaterialParams.pageSize" @pagination="getMaterialList"/> <pagination v-show="materialTotal>0" :total="materialTotal" :page.sync="queryMaterialParams.pageNum" :limit.sync="queryMaterialParams.pageSize" @pagination="getMaterialList"/>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -486,6 +487,7 @@ export default { ...@@ -486,6 +487,7 @@ export default {
queryMaterialParams: { queryMaterialParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
vendorId: undefined,
vendorName: undefined, vendorName: undefined,
warehouseId: undefined, warehouseId: undefined,
warehouseIdList: [], warehouseIdList: [],
...@@ -567,11 +569,11 @@ export default { ...@@ -567,11 +569,11 @@ export default {
return return
} }
this.open1 = true this.open1 = true
this.queryMaterialParams.vendorId = this.form.vendorId;
this.getMaterialList() this.getMaterialList()
}, },
/** 供应商改变 */ /** 供应商改变 */
vendorIdChange(vendorId) { vendorIdChange(vendorId) {
this.queryMaterialParams.vendorId = vendorId;
this.form.pickingInfoList = [] this.form.pickingInfoList = []
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -581,7 +583,10 @@ export default { ...@@ -581,7 +583,10 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetMaterialQuery() { resetMaterialQuery() {
this.resetForm("queryMaterialForm"); this.queryMaterialParams.materialCode = undefined;
this.queryMaterialParams.materialName = undefined;
this.queryMaterialParams.pageNum = 1
this.queryMaterialParams.pageSize = 10
this.handleMaterialQuery(); this.handleMaterialQuery();
}, },
/** 查询物资列表 */ /** 查询物资列表 */
...@@ -597,7 +602,7 @@ export default { ...@@ -597,7 +602,7 @@ export default {
this.tempSelection = []; this.tempSelection = [];
// 手动设置勾选(匹配外部已选数据) // 手动设置勾选(匹配外部已选数据)
this.materialList.forEach(row => { 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); this.$refs.selectionTable.toggleRowSelection(row, isSelected);
}); });
}); });
......
...@@ -513,12 +513,12 @@ export default { ...@@ -513,12 +513,12 @@ export default {
this.form.returnsInfoBoList = this.materialList this.form.returnsInfoBoList = this.materialList
let isTrue = false; let isTrue = false;
this.form.returnsInfoBoList.forEach(item => { this.form.returnsInfoBoList.forEach(item => {
if (item.returnsNumber < 1) { if (item.returnsNumber < 0.1) {
isTrue = true; isTrue = true;
} }
}) })
if (isTrue) { if (isTrue) {
this.$modal.msgError('退货数量不能小于1') this.$modal.msgError('退货数量不能小于0.1')
this.buttonLoading = false; this.buttonLoading = false;
return return
} }
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购标的" align="center" prop="procurementSubject" />--> <!-- <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"> <el-table-column label="物资图片" align="center" prop="materialUrl">
<template slot-scope="scope"> <template slot-scope="scope">
<image-preview :src="scope.row.materialUrl" style="width: 50px; height: 50px" /> <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