Commit ca09c205 by zhangtw

入库统计添加按入库时间查询条件

parent b7332f33
...@@ -101,6 +101,19 @@ ...@@ -101,6 +101,19 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="入库日期" prop="inboundDateRange">
<el-date-picker
v-model="inboundDateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</page-wrapper-search> </page-wrapper-search>
<!-- 表格区域 --> <!-- 表格区域 -->
...@@ -110,7 +123,7 @@ ...@@ -110,7 +123,7 @@
height="100%" height="100%"
:data="inboundList" :data="inboundList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
:row-key="(row) => row.materialId + '_' + row.orderId + '_' + row.warehousesName + '_' + row.locationName" :row-key="(row) => row.materialId + '_' + row.batchId +'_' + row.orderId + '_' + row.warehousesName + '_' + row.locationName"
> >
<el-table-column label="物料SAPNO" align="center" prop="sapNo" min-width="200"/> <el-table-column label="物料SAPNO" align="center" prop="sapNo" min-width="200"/>
<el-table-column label="物料名称" align="center" prop="materialName" min-width="200"/> <el-table-column label="物料名称" align="center" prop="materialName" min-width="200"/>
...@@ -184,6 +197,8 @@ export default { ...@@ -184,6 +197,8 @@ export default {
}, },
data() { data() {
return { return {
// 入库日期选择数组
inboundDateRange: null,
// 仓库选择相关 // 仓库选择相关
warehouseSelectorVisible: false, warehouseSelectorVisible: false,
queryWarehouseName: null, queryWarehouseName: null,
...@@ -212,7 +227,9 @@ export default { ...@@ -212,7 +227,9 @@ export default {
batchId: null, batchId: null,
warehouseId: null, warehouseId: null,
locationId: null, locationId: null,
labelColor: null labelColor: null,
inboundDateStart: null,
inboundDateEnd: null
} }
} }
}, },
...@@ -247,6 +264,14 @@ export default { ...@@ -247,6 +264,14 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
if (Array.isArray(this.inboundDateRange) && this.inboundDateRange.length === 2) {
this.queryParams.inboundDateStart = this.inboundDateRange[0];
this.queryParams.inboundDateEnd = this.inboundDateRange[1];
} else {
// 清空开始/结束日期(避免残留旧值)
this.queryParams.inboundDateStart = "";
this.queryParams.inboundDateEnd = "";
}
this.getList() this.getList()
}, },
...@@ -261,10 +286,13 @@ export default { ...@@ -261,10 +286,13 @@ export default {
batchId: null, batchId: null,
warehouseId: null, warehouseId: null,
locationId: null, locationId: null,
labelColor: null labelColor: null,
inboundDateStart: null,
inboundDateStart: null
} }
this.queryWarehouseName = null this.queryWarehouseName = null
this.queryLocationName = null this.queryLocationName = null
this.inboundDateRange = null
this.handleQuery() this.handleQuery()
}, },
......
...@@ -53,6 +53,9 @@ public class InboundDetailsVO { ...@@ -53,6 +53,9 @@ public class InboundDetailsVO {
@Excel(name = "入库时间") @Excel(name = "入库时间")
private Date inboundDate; private Date inboundDate;
// 开始入库日期结束日库日期,仅作查询
private Date inboundDateStart;
private Date inboundDateEnd;
public String getMaterialId() { public String getMaterialId() {
return materialId; return materialId;
...@@ -182,6 +185,22 @@ public class InboundDetailsVO { ...@@ -182,6 +185,22 @@ public class InboundDetailsVO {
this.sapNo = sapNo; this.sapNo = sapNo;
} }
public Date getInboundDateStart() {
return inboundDateStart;
}
public void setInboundDateStart(Date inboundDateStart) {
this.inboundDateStart = inboundDateStart;
}
public Date getInboundDateEnd() {
return inboundDateEnd;
}
public void setInboundDateEnd(Date inboundDateEnd) {
this.inboundDateEnd = inboundDateEnd;
}
@Override @Override
public String toString() { public String toString() {
return "InboundDetailsVO{" + return "InboundDetailsVO{" +
......
...@@ -367,7 +367,13 @@ ...@@ -367,7 +367,13 @@
left join warehouses w on ioi.warehouse_id = w.id left join warehouses w on ioi.warehouse_id = w.id
left join storage_locations sl on ioi.location_id = sl.id left join storage_locations sl on ioi.location_id = sl.id
<where> <where>
io.order_status = 2 io.order_status = 2
<if test="inboundDateStart != null">
AND DATE(io.inbound_date) &gt;= #{inboundDateStart}
</if>
<if test="inboundDateEnd != null">
AND DATE(io.inbound_date) &lt;= #{inboundDateEnd}
</if>
<if test="sapNo != null and sapNo != ''"> <if test="sapNo != null and sapNo != ''">
AND ms.sap_no = #{sapNo} AND ms.sap_no = #{sapNo}
</if> </if>
......
...@@ -84,10 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -84,10 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderStatus != null "> and order_status = #{orderStatus}</if> <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
<!-- 新增按照日期范围查询--> <!-- 新增按照日期范围查询-->
<if test="inboundDateStart != null"> <if test="inboundDateStart != null">
AND inbound_date &gt;= #{inboundDateStart} AND date(inbound_date) &gt;= #{inboundDateStart}
</if> </if>
<if test="inboundDateEnd != null"> <if test="inboundDateEnd != null">
AND inbound_date &lt;= #{inboundDateEnd} AND date(inbound_date) &lt;= #{inboundDateEnd}
</if> </if>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if> <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
<if test="totalPlannedQuantity != null "> and total_planned_quantity = #{totalPlannedQuantity}</if> <if test="totalPlannedQuantity != null "> and total_planned_quantity = #{totalPlannedQuantity}</if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论