change - 申请领料显示bom需要的物料数量,申请数量要小于等于bom数量,非bom内物料显示所有的物料

master
yinq 2 weeks ago
parent 1c501eca86
commit 61d7066359

@ -144,6 +144,32 @@ public class WmsStockTotal extends BaseEntity {
private String unitName; private String unitName;
/**
* BOM
*/
private BigDecimal standardAmount;
/**
*
*/
private BigDecimal realOutstockAmount;
public BigDecimal getStandardAmount() {
return standardAmount;
}
public void setStandardAmount(BigDecimal standardAmount) {
this.standardAmount = standardAmount;
}
public BigDecimal getRealOutstockAmount() {
return realOutstockAmount;
}
public void setRealOutstockAmount(BigDecimal realOutstockAmount) {
this.realOutstockAmount = realOutstockAmount;
}
public String getWarehouseName() { public String getWarehouseName() {
return warehouseName; return warehouseName;
} }

@ -29,6 +29,8 @@
<result property="saleorderCode" column="saleorder_code"/> <result property="saleorderCode" column="saleorder_code"/>
<result property="materialClassfication" column="material_classfication"/> <result property="materialClassfication" column="material_classfication"/>
<result property="unitName" column="unit_name"/> <result property="unitName" column="unit_name"/>
<result property="standardAmount" column="standard_amount"/>
<result property="realOutstockAmount" column="real_outstock_amount"/>
</resultMap> </resultMap>
<resultMap type="WmsStockTotal" id="WmsStockTotal4ApplyResult"> <resultMap type="WmsStockTotal" id="WmsStockTotal4ApplyResult">
@ -186,15 +188,38 @@
<select id="selectWmsStockTotalJoinListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult"> <select id="selectWmsStockTotalJoinListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id, select wst.stock_total_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,wst.sale_order_id, wst.warehouse_id,
mbmi.material_code,mbmi.material_name,mbmi.material_spec, wst.warehouse_floor,
(select sum(wro.outstock_amount) from wms_raw_outstock wro where wro.stock_total_id=wst.stock_total_id and wst.stock_type,
wro.plan_code=#{planCode} and wro.plan_detail_code=#{planDetailCode} and wro.audit_status!='2' and wro.execute_status!='2') outstock_amount wst.material_id,
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id wst.total_amount,
wst.frozen_amount,
wst.occupy_amount,
wst.safe_flag,
wst.sale_order_id,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
(select sum(wro.outstock_amount)
from wms_raw_outstock wro
where wro.stock_total_id = wst.stock_total_id
and wro.plan_code=#{planCode}
and wro.plan_detail_code=#{planDetailCode}
and wro.audit_status != '2'
and wro.execute_status != '2') outstock_amount,
(select sum(wro.real_outstock_amount)
from wms_raw_outstock wro
where wro.stock_total_id = wst.stock_total_id
and wro.plan_code=#{planCode}
and wro.plan_detail_code=#{planDetailCode}
and wro.audit_status != '2') real_outstock_amount,
mmb.standard_amount
from mes_material_bom mmb
left join wms_stock_total wst on wst.material_id = mmb.material_id
left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where> <where>
and wst.total_amount>0 mmb.ancestors like concat(#{ancestors},'%') and wst.total_amount > 0
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if> <if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if> <if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
@ -211,8 +236,8 @@
or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%')) or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%'))
</if> </if>
<if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='0'</if> <if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='0'</if>
<if test="ancestors != null and ancestors != ''">and exists (select 1 from mes_material_bom mmb where <!-- <if test="ancestors != null and ancestors != ''">and exists (select 1 from mes_material_bom mmb where-->
mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if> <!-- mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if>-->
</where> </where>
</select> </select>

@ -94,6 +94,18 @@
prop="outstockAmount" prop="outstockAmount"
> >
</el-table-column> </el-table-column>
<el-table-column
label="已出库数量"
prop="realOutstockAmount"
width="100"
>
</el-table-column>
<el-table-column
label="BOM标准数量"
prop="standardAmount"
width="120"
>
</el-table-column>
<el-table-column <el-table-column
label="领取数量" label="领取数量"
prop="planAmount" prop="planAmount"
@ -322,6 +334,8 @@ export default {
availableAmount: parseFloat(r.totalAmount - r.occupyAmount - r.frozenAmount).toFixed(2), availableAmount: parseFloat(r.totalAmount - r.occupyAmount - r.frozenAmount).toFixed(2),
unavailableAmount: parseFloat(r.occupyAmount + r.frozenAmount).toFixed(2), unavailableAmount: parseFloat(r.occupyAmount + r.frozenAmount).toFixed(2),
outstockAmount: parseFloat(r.outstockAmount ? r.outstockAmount : 0).toFixed(2), outstockAmount: parseFloat(r.outstockAmount ? r.outstockAmount : 0).toFixed(2),
standardAmount: parseFloat(r.standardAmount ? r.standardAmount : 0).toFixed(2),
realOutstockAmount: parseFloat(r.realOutstockAmount ? r.realOutstockAmount : 0).toFixed(2),
planAmount: this.planAmount planAmount: this.planAmount
} }
}) })
@ -377,6 +391,11 @@ export default {
this.$modal.msgWarning("请输入领取数量"); this.$modal.msgWarning("请输入领取数量");
return; return;
} }
let checkDetailList = this.wmsRawOutstockDetailList.filter(detail => detail.planAmount > detail.standardAmount);
if (checkDetailList.length > 0) {
this.$modal.msgWarning("申请数量需要小于等于BOM标准数量");
return;
}
this.submitloading = true; this.submitloading = true;
this.form.wmsRawOutstockDetailList = realOutstockDetailList; this.form.wmsRawOutstockDetailList = realOutstockDetailList;
applyRawOutstock(this.form).then(e => { applyRawOutstock(this.form).then(e => {

Loading…
Cancel
Save