change - 1、物料信息添加是否超安全库存筛选条件,物料信息内的物料可以根据安全库存数量与实际库存比较并筛选。2、“自动出库标识”“bom内物料标识”等字段无需展示,展示出库存数量。当库存数量小于安全库存数时,库存数量标红。

master
yinq 1 week ago
parent 61d7066359
commit 9cd5594255

@ -153,6 +153,32 @@ public class MesBaseMaterialInfo extends BaseEntity
private String unitName; private String unitName;
/**
*
*/
private BigDecimal availableAmount;
/**
*
*/
private String isExceeded;
public BigDecimal getAvailableAmount() {
return availableAmount;
}
public void setAvailableAmount(BigDecimal availableAmount) {
this.availableAmount = availableAmount;
}
public String getIsExceeded() {
return isExceeded;
}
public void setIsExceeded(String isExceeded) {
this.isExceeded = isExceeded;
}
public Long getPurchasePriceUnitId() { public Long getPurchasePriceUnitId() {
return purchasePriceUnitId; return purchasePriceUnitId;
} }

@ -108,6 +108,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
public MesBaseStationInfo getLoginStationInfo() { public MesBaseStationInfo getLoginStationInfo() {
String ipAddress = IpUtils.getIpAddr(); String ipAddress = IpUtils.getIpAddr();
// ipAddress = "192.168.2.25"; // ipAddress = "192.168.2.25";
log.info(ipAddress+"---"+SecurityUtils.getLoginUser().getIpaddr()); log.info(ipAddress+"---"+SecurityUtils.getLoginUser().getIpaddr());
MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress); MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress);

@ -46,6 +46,8 @@
<result property="purchasePriceUnitId" column="purchase_price_unit_id"/> <result property="purchasePriceUnitId" column="purchase_price_unit_id"/>
<result property="stockAmount" column="stock_amount"/> <result property="stockAmount" column="stock_amount"/>
<result property="unitName" column="unit_name"/> <result property="unitName" column="unit_name"/>
<result property="availableAmount" column="availableAmount"/>
<result property="isExceeded" column="isExceeded"/>
</resultMap> </resultMap>
<sql id="selectMesBaseMaterialInfoVo"> <sql id="selectMesBaseMaterialInfoVo">
@ -88,10 +90,15 @@
bmi.approve_date, bmi.approve_date,
bmi.erp_modify_date, bmi.erp_modify_date,
bmi.safe_stock_amount, bmi.safe_stock_amount,
mbui.unit_name mbui.unit_name,
wst.availableAmount,
IF(wst.availableAmount >= bmi.safe_stock_amount, '1', '0') isExceeded
from mes_base_material_info bmi from mes_base_material_info bmi
left join mes_base_material_type bmt on bmt.matrial_type_id = bmi.material_type_id left join mes_base_material_type bmt on bmt.matrial_type_id = bmi.material_type_id
left join mes_base_unit_info mbui on bmi.material_unit_id = mbui.erp_id left join mes_base_unit_info mbui on bmi.material_unit_id = mbui.erp_id
left join (select material_id, SUM(total_amount - occupy_amount) availableAmount
from wms_stock_total
GROUP BY material_id) wst on bmi.material_id = wst.material_id
</sql> </sql>
<select id="selectMesBaseMaterialInfoList" parameterType="MesBaseMaterialInfo" <select id="selectMesBaseMaterialInfoList" parameterType="MesBaseMaterialInfo"
@ -135,6 +142,7 @@
<if test="accessoriesFlag != null and accessoriesFlag != ''">and bmi.accessories_flag = #{accessoriesFlag}</if> <if test="accessoriesFlag != null and accessoriesFlag != ''">and bmi.accessories_flag = #{accessoriesFlag}</if>
<if test="lowValueConsumableFlag != null and lowValueConsumableFlag != ''">and bmi.low_value_consumable_flag = #{lowValueConsumableFlag}</if> <if test="lowValueConsumableFlag != null and lowValueConsumableFlag != ''">and bmi.low_value_consumable_flag = #{lowValueConsumableFlag}</if>
<if test="alwaysFlag != null and alwaysFlag != ''">and bmi.always_flag = #{alwaysFlag}</if> <if test="alwaysFlag != null and alwaysFlag != ''">and bmi.always_flag = #{alwaysFlag}</if>
<if test="isExceeded != null and isExceeded != ''">and IF(wst.availableAmount >= bmi.safe_stock_amount, '1', '0') = #{isExceeded}</if>
<if test="selectType != null and selectType !=''">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if> <if test="selectType != null and selectType !=''">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if>

@ -59,36 +59,36 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="自动出库标识" prop="autoOutstockFlag"> <!-- <el-form-item label="自动出库标识" prop="autoOutstockFlag">-->
<el-select v-model="queryParams.autoOutstockFlag" placeholder="请选择自动出库标识" clearable> <!-- <el-select v-model="queryParams.autoOutstockFlag" placeholder="请选择自动出库标识" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in dict.type.mes_material_auto_outstock_flag" <!-- v-for="dict in dict.type.mes_material_auto_outstock_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="bom内物料标识" prop="accessoriesFlag"> <!-- <el-form-item label="bom内物料标识" prop="accessoriesFlag">-->
<el-select v-model="queryParams.accessoriesFlag" placeholder="请选择bom内物料标识" clearable> <!-- <el-select v-model="queryParams.accessoriesFlag" placeholder="请选择bom内物料标识" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in dict.type.mes_material_accessories_flag" <!-- v-for="dict in dict.type.mes_material_accessories_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="易耗品标识" prop="lowValueConsumableFlag"> <!-- <el-form-item label="易耗品标识" prop="lowValueConsumableFlag">-->
<el-select v-model="queryParams.lowValueConsumableFlag" placeholder="请选择易耗品标识" clearable> <!-- <el-select v-model="queryParams.lowValueConsumableFlag" placeholder="请选择易耗品标识" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in dict.type.mes_material_low_value_consumable_flag" <!-- v-for="dict in dict.type.mes_material_low_value_consumable_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="批次标识" prop="batchFlag"> <el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable> <el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option <el-option
@ -109,6 +109,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否超安全库存" prop="isExceeded">
<el-select v-model="queryParams.isExceeded" placeholder="请选择是否超安全库存" clearable>
<el-option
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -198,21 +208,21 @@
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.alwaysFlag"/> <dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.alwaysFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="自动出库标识" align="center" prop="autoOutstockFlag"> <!-- <el-table-column label="自动出库标识" align="center" prop="autoOutstockFlag">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.mes_material_auto_outstock_flag" :value="scope.row.autoOutstockFlag"/> <!-- <dict-tag :options="dict.type.mes_material_auto_outstock_flag" :value="scope.row.autoOutstockFlag"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="bom内物料标识" align="center" prop="accessoriesFlag"> <!-- <el-table-column label="bom内物料标识" align="center" prop="accessoriesFlag">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.mes_material_accessories_flag" :value="scope.row.accessoriesFlag"/> <!-- <dict-tag :options="dict.type.mes_material_accessories_flag" :value="scope.row.accessoriesFlag"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="易耗品标识" align="center" prop="lowValueConsumableFlag"> <!-- <el-table-column label="易耗品标识" align="center" prop="lowValueConsumableFlag">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.mes_material_low_value_consumable_flag" :value="scope.row.lowValueConsumableFlag"/> <!-- <dict-tag :options="dict.type.mes_material_low_value_consumable_flag" :value="scope.row.lowValueConsumableFlag"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="批次标识" align="center" prop="batchFlag"> <el-table-column label="批次标识" align="center" prop="batchFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_batch_flag" :value="scope.row.batchFlag"/> <dict-tag :options="dict.type.mes_material_batch_flag" :value="scope.row.batchFlag"/>
@ -220,6 +230,13 @@
</el-table-column> </el-table-column>
<el-table-column label="批次数量" align="center" prop="batchAmount"/> <el-table-column label="批次数量" align="center" prop="batchAmount"/>
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount"/> <el-table-column label="安全库存数量" align="center" prop="safeStockAmount"/>
<el-table-column label="库存数量" align="center" prop="availableAmount" >
<template slot-scope="scope">
<span :style="setCellClassName(scope.row)">
{{scope.row.availableAmount}}
</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="activeFlag"> <el-table-column label="状态" align="center" prop="activeFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_status" :value="scope.row.activeFlag"/> <dict-tag :options="dict.type.mes_material_status" :value="scope.row.activeFlag"/>
@ -312,49 +329,49 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item label="自动出库" placeholder="请选择自动出库标识" prop="autoOutstockFlag"> <!-- <el-form-item label="自动出库" placeholder="请选择自动出库标识" prop="autoOutstockFlag">-->
<el-radio-group v-model="form.autoOutstockFlag"> <!-- <el-radio-group v-model="form.autoOutstockFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.mes_material_auto_outstock_flag" <!-- v-for="dict in dict.type.mes_material_auto_outstock_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{ dict.label }} <!-- >{{ dict.label }}-->
</el-radio> <!-- </el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> </el-row>
<el-row> <!-- <el-row>-->
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item placeholder="请选择bom内物料标识" label="bom内物料标识" prop="accessoriesFlag"> <!-- <el-form-item placeholder="请选择bom内物料标识" label="bom内物料标识" prop="accessoriesFlag">-->
<el-radio-group v-model="form.accessoriesFlag"> <!-- <el-radio-group v-model="form.accessoriesFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.mes_material_accessories_flag" <!-- v-for="dict in dict.type.mes_material_accessories_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{ dict.label }} <!-- >{{ dict.label }}-->
</el-radio> <!-- </el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item placeholder="请选择易耗品标识" label="易耗品标识" prop="lowValueConsumableFlag"> <!-- <el-form-item placeholder="请选择易耗品标识" label="易耗品标识" prop="lowValueConsumableFlag">-->
<el-radio-group v-model="form.lowValueConsumableFlag"> <!-- <el-radio-group v-model="form.lowValueConsumableFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.mes_material_low_value_consumable_flag" <!-- v-for="dict in dict.type.mes_material_low_value_consumable_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{ dict.label }} <!-- >{{ dict.label }}-->
</el-radio> <!-- </el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
@ -689,7 +706,17 @@ export default {
}).then(() => { }).then(() => {
this.$modal.msgSuccess("执行成功"); this.$modal.msgSuccess("执行成功");
}).catch(() => {}); }).catch(() => {});
},
setCellClassName(row) {
const availableAmount = parseFloat(row.availableAmount) || 0;
const safeStockAmount = parseFloat(row.safeStockAmount) || 0;
if (availableAmount < safeStockAmount) {
return 'color: #f56c6c';
} }
return '';
}
} }
}; };
</script> </script>

Loading…
Cancel
Save