Browse Source

[feat] 库存管理

库存查询列表页面:修改库存查询的表头按钮的样式,为统一样式,去掉库存历史按钮和其对应的方法;新增库存履历按钮和其对应的方法;
按照新版prd,新增库存履历前端页面;
新增 修改仓库库存履历后端接口和修改保存仓库库存履历后端接口
dev
liuxiaoxu 3 months ago
parent
commit
c6506d1adb
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryInquiryController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryInquiryService.java
  3. 10
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryInquiryServiceImpl.java
  4. 45
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html
  5. 28
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html

12
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryInquiryController.java

@ -126,18 +126,18 @@ public class WarehouseInventoryInquiryController extends BaseController
}
/**
* 修改仓库库存历
* 修改仓库库存
*/
@GetMapping("/inventoryHistory/{materialNo}")
public String inventoryHistory(@PathVariable("materialNo") String materialNo, ModelMap mmap)
@GetMapping("/inventoryHistory/{inventoryInquiryId}")
public String inventoryHistory(@PathVariable("inventoryInquiryId") Long inventoryInquiryId, ModelMap mmap)
{
WarehouseInventoryInquiry warehouseInventoryInquiry = warehouseInventoryInquiryService.selectWarehouseInventoryInquiryByMaterialNo(materialNo);
WarehouseInventoryInquiry warehouseInventoryInquiry = warehouseInventoryInquiryService.selectWarehouseInventoryInquiryById(inventoryInquiryId);
mmap.put("warehouseInventoryInquiry", warehouseInventoryInquiry);
return prefix + "/inventoryHistory";
}
/**
* 修改保存仓库库存历
* 修改保存仓库库存
*/
@RequiresPermissions("warehouse:inventoryInquiry:inventoryHistory")
@Log(title = "仓库库存查询", businessType = BusinessType.UPDATE)
@ -145,7 +145,7 @@ public class WarehouseInventoryInquiryController extends BaseController
@ResponseBody
public AjaxResult inventoryHistorySave(WarehouseInventoryInquiry warehouseInventoryInquiry)
{
return toAjax(warehouseInventoryInquiryService.updateWarehouseInventoryInquiry(warehouseInventoryInquiry));
return toAjax(warehouseInventoryInquiryService.updateWarehouseInventoryHistory(warehouseInventoryInquiry));
}
/**

4
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryInquiryService.java

@ -108,4 +108,8 @@ public interface IWarehouseInventoryInquiryService {
Integer calculateFixedAvailableStockNum(String materialNo);
/**
* 修改保存库存履历
* */
int updateWarehouseInventoryHistory(WarehouseInventoryInquiry warehouseInventoryInquiry);
}

10
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryInquiryServiceImpl.java

@ -295,4 +295,14 @@ public class WarehouseInventoryInquiryServiceImpl implements IWarehouseInventory
//【可用库存数】-【共享可用库存数】
return null;
}
/**
* 修改保存库存履历
* */
@Override
public int updateWarehouseInventoryHistory(WarehouseInventoryInquiry warehouseInventoryInquiry) {
return 1;
}
}

45
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html

@ -5,7 +5,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inventoryHistory-edit" th:object="${warehouseInventoryInquiry}">
<form class="form-horizontal m" id="form-inventoryHistory-inventoryHistory" th:object="${warehouseInventoryInquiry}">
<input name="inventoryInquiryId" th:field="*{inventoryInquiryId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
@ -58,16 +58,19 @@
var prefix = ctx + "warehouse/inventoryInquiry";
var warehouseInventoryInquiry = [[${warehouseInventoryInquiry}]];
var inventoryHistoricalType = [[${@dict.getType('inventory_historical_type')}]];
var inventoryIncreaseDecrease = [[${@dict.getType('inventory_increase_decrease')}]];
var inquiryBusinessType = [[${@dict.getType('inquiry_business_type')}]];
var inquiryOrderType = [[${@dict.getType('inquiry_order_type')}]];
var inquiryWarehouseType = [[${@dict.getType('inquiry_warehouse_type')}]]
$("#form-inventoryHistory-edit").validate({
$("#form-inventoryHistory-inventoryHistory").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-inventoryHistory-edit').serialize());
$.operate.save(prefix + "/inventoryHistory", $('#form-inventoryHistory-inventoryHistory').serialize());
}
}
@ -76,7 +79,7 @@
$(function() {
var options = {
modalName: "选择物料",
url: ctx + "warehouse/inventoryInquiry/getMaterialInventoryHistoricalList",
url: prefix + "/getMaterialInventoryHistoricalList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
@ -88,25 +91,31 @@
{title: '库存查询详情id', field: 'inventoryInquiryDetailId', visible: false},
{title: '物料号', field: 'materialNo', visible: false},
{title: '时间', field: 'inventoryHistoricalTime',},
{title: '类型', field: 'inventoryHistoricalType',
{title: '库存增减', field: 'inventoryIncreaseDecrease',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryHistoricalType, value);
return $.table.selectDictLabel(inventoryIncreaseDecrease, value);
}
},
{title: '库存增减', field: 'inventoryIncreaseDecrease',
{title: '单号', field: 'correlationCode'},
{title: '出货设备ID', field: 'shippingDeviceId'},
{title: '数量', field: 'increaseDecreaseNum'},
{title: '业务类型', field: 'inquiryBusinessType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryIncreaseDecrease, value);
return $.table.selectDictLabel(inquiryBusinessType, value);
}
},
{title: '数量', field: 'availableStockNum'},
{title: '库存历史数量', field: 'inventoryHistoricalNum',visible: false},
{title: '不含税采购总价', field: 'purchasePriceExcludingTax',},
{title: '含税总价', field: 'purchasePriceIncludesTax',},
{title: '采购单号', field: 'purchaseOrderCode',},
{title: '供应商ID', field: 'supplierCode',},
{title: '供应商名称', field: 'supplierName',},
{title: '库存归属单号', field: 'inventoryAttributionCode',},
{title: '库存使用单号', field: 'inventoryUseCode',},
{title: '订单类型', field: 'inquiryOrderType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inquiryOrderType, value);
}
},
{title: '出入库类型', field: 'inquiryWarehouseType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inquiryWarehouseType, value);
}
},
]
};
$.table.init(options);

28
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html

@ -34,10 +34,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a id="addRefundsButton" class="btn btn-success" onclick="add()" shiro:hasPermission="quality:refundsExchanges:add">
<i class="fa fa-plus"></i> 库存历史
</a>
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="warehouse:inventoryInquiry:export">
<a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="warehouse:inventoryInquiry:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -49,8 +46,8 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('warehouse:inventoryInquiry:edit')}]];
var editAvailableStockFlag = [[${@permission.hasPermi('warehouse:inventoryInquiry:editAvailableStockFlag')}]];
var inventoryHistoryFlag = [[${@permission.hasPermi('warehouse:inventoryInquiry:inventoryHistory')}]];
var materialUseStatusDatas = [[${@dict.getType('useStatus')}]];
@ -136,6 +133,8 @@
//生产加工和生产装配的不支持转化
actions.push('<a class=" ' + editAvailableStockFlag + '" href="javascript:void(0)" onclick="editAvailableStock(\'' + row.inventoryInquiryId + '\')"><i class="fa fa-edit"></i>修改可用库存</a> ');
}
actions.push('<a class=" ' + inventoryHistoryFlag + '" href="javascript:void(0)" onclick="inventoryHistory(\'' + row.inventoryInquiryId + '\')"><i class="fa fa-edit"></i>库存履历</a> ');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
@ -145,18 +144,6 @@
$.table.init(options);
});
/*查看库存历史*/
function add() {
var rows = $("#bootstrap-table").bootstrapTable('getSelections');
console.log("rows" + rows);
if (rows.length == 1){
var url = ctx + 'warehouse/inventoryInquiry/inventoryHistory/' +rows[0].materialNo;
$.modal.open("库存历史",url);
}else{
$.modal.msgWarning("只能查看一种物料的库存历史!")
}
};
// 导出
function exportExcel() {
var ids = $.table.selectColumns("materialNo");
@ -186,6 +173,13 @@
var url = prefix + "/editAvailableStock/" + inventoryInquiryId;
$.modal.open("修改可用库存", url);
}
//库存履历
function inventoryHistory(inventoryInquiryId) {
var url = prefix + "/inventoryHistory/" + inventoryInquiryId;
$.modal.open("库存履历", url);
}
</script>
</body>
</html>
Loading…
Cancel
Save