Browse Source

[feat]仓库管理:

出库单
新增 销售单-准备物料详情页面 prepareMaterialDetail.html
新增 销售单-准备物料详情按钮
新增 销售单-准备物料详情修改保存后端接口
新增销售单-准备物料详情查询后端接口
dev
liuxiaoxu 5 months ago
parent
commit
dcf797d865
  1. 24
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java
  2. 225
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterialDetail.html
  3. 11
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html

24
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java

@ -142,6 +142,30 @@ public class WarehouseOutOrderController extends BaseController
} }
/**
* 销售单-准备物料详情
*/
@GetMapping("/prepareMaterialDetail/{outOrderId}")
public String prepareMaterialDetail(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
{
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId);
mmap.put("warehouseOutOrder", warehouseOutOrder);
return prefix + "/prepareMaterialDetail";
}
/**
* 修改保存销售单-准备物料详情
*/
@RequiresPermissions("warehouse:warehouseOutOrder:prepareMaterialDetail")
@Log(title = "仓库出库单", businessType = BusinessType.UPDATE)
@PostMapping("/prepareMaterialDetail")
@ResponseBody
public AjaxResult prepareMaterialDetailSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder));
}
/** /**
* 销售单-准备物料 物料相关信息 * 销售单-准备物料 物料相关信息
*/ */

225
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterialDetail.html

@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('销售单-准备物料详情')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-prepareMaterialDetail-edit" th:object="${warehouseOutOrder}">
<input name="outOrderId" th:field="*{outOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="warehouseOrderType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_order_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人员:</label>
<div class="col-sm-8">
<input name="applyName" th:field="*{applyName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label>
<div class="col-sm-8">
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var warehouseOutOrder = [[${warehouseOutOrder}]];
var prefix = ctx + "warehouse/warehouseOutOrder";
$("#form-prepareMaterialDetail-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const warehouseOutOrderData = $("#form-prepareMaterialDetail-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"outOrderDetailId":item.outOrderDetailId,
"outOrderCode":item.outOrderCode,
"materialNo": item.materialNo, // 假设id对应materialId
"prepareOutOrderSum":item.prepareOutOrderSum,
// ...其他字段
};
});
const combinedData = Object.assign({}, warehouseOutOrderData, {
warehouseOutOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/prepareMaterialDetail", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: ctx + "warehouse/warehouseOutOrder/getMaterialListByOutOrderCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '出库单详情ID',
field: 'outOrderDetailId',
visible: false
},
{
title: '出库单号',
field: 'outOrderCode',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '准备出库数',
field: 'prepareOutOrderSum',
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: warehouseOutOrder.outOrderCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>

11
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html

@ -75,6 +75,9 @@
var refundsExchangesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:refundsExchangesOutWarehouse')}]]; var refundsExchangesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:refundsExchangesOutWarehouse')}]];
var prepareMaterialDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:prepareMaterialDetail')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]]; var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]];
@ -176,10 +179,10 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
/*销售单-准备物料*/ /*销售单-准备物料*/
if (row.warehouseOutStatus == 0 && row.warehouseOrderType == 0 && row.warehouseOutType == 0){ if (row.warehouseOutStatus == 0 && row.warehouseOrderType == 0 && row.warehouseOutType == 0){
actions.push('<a class="btn btn-success btn-xs ' + prepareMaterialFlag + '" href="javascript:void(0)" onclick="prepareMaterial(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>准备物料</a> '); actions.push('<a class="btn btn-success btn-xs ' + prepareMaterialFlag + '" href="javascript:void(0)" onclick="prepareMaterial(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>准备物料</a> ');
actions.push('<a class="btn btn-success btn-xs ' + prepareMaterialDetailFlag + '" href="javascript:void(0)" onclick="prepareMaterialDetail(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
} }
/*销售单-出库*/ /*销售单-出库*/
if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 0 && row.warehouseOutType == 0){ if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 0 && row.warehouseOutType == 0){
@ -211,6 +214,12 @@
$.modal.open("准备物料",url); $.modal.open("准备物料",url);
} }
/*销售单-准备物料详情*/
function prepareMaterialDetail(outOrderId){
var url = ctx + 'warehouse/warehouseOutOrder/prepareMaterialDetail/' + outOrderId;
$.modal.open("准备物料详情",url);
}
/*销售单-出库*/ /*销售单-出库*/
function salesOutWarehouse(outOrderId){ function salesOutWarehouse(outOrderId){
var url = ctx + 'warehouse/warehouseOutOrder/salesOutWarehouse/' + outOrderId; var url = ctx + 'warehouse/warehouseOutOrder/salesOutWarehouse/' + outOrderId;

Loading…
Cancel
Save