Commit 257fada7 by yubin

Merge remote-tracking branch 'origin/master'

parents c2ea7e08 adc69b18
...@@ -583,7 +583,7 @@ export default { ...@@ -583,7 +583,7 @@ export default {
referenceNo: null, referenceNo: null,
plannedArrivalDate: undefined, plannedArrivalDate: undefined,
actualArrivalDate: undefined, actualArrivalDate: undefined,
inboundDate: null, // 入库日期 inboundDate: this.formatDate(new Date()), // 入库日期
totalPlannedQuantity: null, totalPlannedQuantity: null,
totalActualQuantity: null, totalActualQuantity: null,
totalPackages: null, totalPackages: null,
...@@ -625,6 +625,14 @@ export default { ...@@ -625,6 +625,14 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
// 日期格式化方法(兼容不同浏览器的日期格式)
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,补0
const day = String(date.getDate()).padStart(2, '0'); // 日期补0
return `${year}-${month}-${day}`;
},
/** 查询入库列表 */ /** 查询入库列表 */
getList() { getList() {
this.loading = true this.loading = true
...@@ -739,8 +747,8 @@ export default { ...@@ -739,8 +747,8 @@ export default {
this.form = response.data || {}; this.form = response.data || {};
// 货主回显 // 货主回显
this.form.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId; this.form.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId;
// 仓库回显 // // 仓库回显
this.form.warehousesName = response.data.warehousesName || response.data.warehouseId || '-'; // this.form.warehousesName = response.data.warehousesName || response.data.warehouseId || '-';
// 明细行回显(核心:同步仓库/库位名称) // 明细行回显(核心:同步仓库/库位名称)
if (this.form.inboundOrderItemsList && this.form.inboundOrderItemsList.length) { if (this.form.inboundOrderItemsList && this.form.inboundOrderItemsList.length) {
...@@ -750,10 +758,11 @@ export default { ...@@ -750,10 +758,11 @@ export default {
warehousesName: item.warehousesName || item.warehouseId || '-', warehousesName: item.warehousesName || item.warehouseId || '-',
// 库位名称/编码兜底 // 库位名称/编码兜底
locationName: item.locationName || item.locationCode || item.locationId || '-', locationName: item.locationName || item.locationCode || item.locationId || '-',
locationCode: item.locationCode || item.locationId || '-' locationCode: item.locationCode || item.locationId || '-',
orderTypeId: item.orderTypeId || 1
})); }));
} }
console.log(this.form.inboundOrderItemsList)
this.inboundOrderId = id; this.inboundOrderId = id;
// 强制触发子组件的 value 监听(关键) // 强制触发子组件的 value 监听(关键)
this.$nextTick(() => { this.$nextTick(() => {
...@@ -771,7 +780,14 @@ export default { ...@@ -771,7 +780,14 @@ export default {
this.isEditable = false this.isEditable = false
getInbound(id).then(response => { getInbound(id).then(response => {
// 加载明细数据到详情 // 加载明细数据到详情
this.detailForm = response.data this.detailForm = response.data;
if(this.detailForm.inboundOrderItemsList && this.detailForm.inboundOrderItemsList.length){
this.detailForm.inboundOrderItemsList = this.detailForm.inboundOrderItemsList.map(item => ({
...item,
orderTypeId: this.detailForm.orderTypeId
}));
}
// 适配货主回显 // 适配货主回显
this.detailForm.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId this.detailForm.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId
this.detailForm.inboundOrderId = id this.detailForm.inboundOrderId = id
...@@ -1051,7 +1067,7 @@ export default { ...@@ -1051,7 +1067,7 @@ export default {
referenceNo: null, referenceNo: null,
plannedArrivalDate: null, plannedArrivalDate: null,
actualArrivalDate: null, actualArrivalDate: null,
inboundDate: null, inboundDate: this.formatDate(new Date()),
totalPlannedQuantity: 0, totalPlannedQuantity: 0,
totalActualQuantity: 0, totalActualQuantity: 0,
totalPackages: 0, totalPackages: 0,
......
...@@ -384,16 +384,16 @@ ...@@ -384,16 +384,16 @@
AND DATE(io.inbound_date) <= #{inboundDateEnd} AND DATE(io.inbound_date) <= #{inboundDateEnd}
</if> </if>
<if test="sapNo != null and sapNo != ''"> <if test="sapNo != null and sapNo != ''">
AND ms.sap_no = #{sapNo} AND ms.sap_no like concat('%', #{sapNo}, '%')
</if> </if>
<if test="materialName != null and materialName != ''"> <if test="materialName != null and materialName != ''">
AND ms.material_name LIKE CONCAT('%', #{materialName}, '%') AND ms.material_name LIKE CONCAT('%', #{materialName}, '%')
</if> </if>
<if test="orderId != null and orderId != ''"> <if test="orderId != null and orderId != ''">
AND ioi.order_id = #{orderId} AND ioi.order_id like concat('%', #{orderId}, '%')
</if> </if>
<if test="batchId != null and batchId != ''"> <if test="batchId != null and batchId != ''">
AND ioi.batch_id = #{batchId} AND ioi.batch_id like concat('%', #{batchId}, '%')
</if> </if>
<if test="warehouseId != null and warehouseId != ''"> <if test="warehouseId != null and warehouseId != ''">
AND ioi.warehouse_id = #{warehouseId} AND ioi.warehouse_id = #{warehouseId}
......
...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="itemStatus" column="item_status" /> <result property="itemStatus" column="item_status" />
<result property="receivedAt" column="received_at" /> <result property="receivedAt" column="received_at" />
<result property="receivedBy" column="received_by" /> <result property="receivedBy" column="received_by" />
<result property="labelQuantity" column="label_quantity" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="isUsed" column="is_used" /> <result property="isUsed" column="is_used" />
<result property="sortNo" column="sort_no" /> <result property="sortNo" column="sort_no" />
...@@ -75,10 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -75,10 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectInboundOrdersVo"/> <include refid="selectInboundOrdersVo"/>
<where> <where>
<if test="id != null and Id != ''"> and id = #{Id}</if> <if test="id != null and Id != ''"> and id = #{Id}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="systemNo != null and systemNo != ''"> and system_no = #{systemNo}</if> <if test="systemNo != null and systemNo != ''"> and system_no like concat('%', #{systemNo}, '%')</if>
<if test="orderTypeId != null and orderTypeId != ''"> and order_type_id = #{orderTypeId}</if> <if test="orderTypeId != null and orderTypeId != ''"> and order_type_id = #{orderTypeId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if> <if test="batchId != null and batchId != ''"> and batch_id like concat('%', #{batchId}, '%') </if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if> <if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
<if test="orderStatus != null "> and order_status = #{orderStatus}</if> <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
...@@ -115,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -115,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select ioi.id, ioi.order_id, ioi.material_id, m.sap_no, m.material_name, ioi.batch_id, ioi.warehouse_id, w.warehouses_name, select ioi.id, ioi.order_id, ioi.material_id, m.sap_no, m.material_name, ioi.batch_id, ioi.warehouse_id, w.warehouses_name,
ioi.location_id, sl.location_name, ioi.planned_quantity, ioi.actual_quantity, ioi.planned_packages, ioi.location_id, sl.location_name, ioi.planned_quantity, ioi.actual_quantity, ioi.planned_packages,
ioi.actual_packages, ioi.divisor, ioi.label_color, ioi.voucher_number, ioi.unit_price, ioi.item_status, ioi.actual_packages, ioi.divisor, ioi.label_color, ioi.voucher_number, ioi.unit_price, ioi.item_status,
ioi.received_at, ioi.received_by, ioi.remark, ioi.is_used, ioi.sort_no, ioi.create_time, ioi.create_user_code, ioi.received_at, ioi.received_by, ioi.label_quantity, ioi.remark, ioi.is_used, ioi.sort_no, ioi.create_time, ioi.create_user_code,
ioi.update_time, ioi.update_user_code, ioi.inbound_order_id ioi.update_time, ioi.update_user_code, ioi.inbound_order_id
from inbound_order_items as ioi from inbound_order_items as ioi
left join warehouses as w on ioi.warehouse_id = w.id left join warehouses as w on ioi.warehouse_id = w.id
...@@ -232,6 +233,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -232,6 +233,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from inbound_order_items where inbound_order_id = #{id} delete from inbound_order_items where inbound_order_id = #{id}
</delete> </delete>
<insert id="batchInboundOrders">
insert into inbound_orders
( id, order_id, system_no, order_type_id, batch_id, warehouse_id, owner_id, order_status, inbound_date,
order_type, total_planned_quantity, total_actual_quantity, total_packages, remark, op_user_name,
is_used, sort_no, create_time, create_user_code, update_time, update_user_code, is_import)
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.orderId}, #{item.systemNo}, #{item.orderTypeId}, #{item.batchId}, #{item.warehouseId},
#{item.ownerId}, #{item.orderStatus}, #{item.inboundDate}, #{item.orderType}, #{item.totalPlannedQuantity},
#{item.totalActualQuantity}, #{item.totalPackages}, #{item.remark}, #{item.opUserName}, #{item.isUsed},
#{item.sortNo}, #{item.createTime}, #{item.createUserCode}, #{item.updateTime}, #{item.updateUserCode},
#{item.isImport} )
</foreach>
</insert>
<!-- 批量插入入库明细-->
<insert id="batchInboundOrderItems"> <insert id="batchInboundOrderItems">
insert into inbound_order_items( id, order_id, material_id, batch_id, warehouse_id, location_id, planned_quantity, actual_quantity, planned_packages, actual_packages, divisor, label_color, voucher_number, unit_price, item_status, received_at, received_by, label_quantity, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code, inbound_order_id) values insert into inbound_order_items( id, order_id, material_id, batch_id, warehouse_id, location_id, planned_quantity, actual_quantity, planned_packages, actual_packages, divisor, label_color, voucher_number, unit_price, item_status, received_at, received_by, label_quantity, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code, inbound_order_id) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论