Browse Source

[feat]生产管理:新增工序明细详情按钮与详情页面

dev
zhangsiqi 5 months ago
parent
commit
760a1ff878
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProcedureController.java
  2. 145
      ruoyi-admin/src/main/resources/templates/system/procedure/detail.html
  3. 111
      ruoyi-admin/src/main/resources/templates/system/procedure/procedure.html

11
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProcedureController.java

@ -104,7 +104,16 @@ public class SysProcedureController extends BaseController
mmap.put("sysProcedure", sysProcedure);
return prefix + "/edit";
}
/**
* 生产加工工序明细详情
*/
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{
SysProcedure sysProcedure = sysProcedureService.selectSysProcedureById(id);
mmap.put("sysProcedure", sysProcedure);
return prefix + "/detail";
}
/**
* 修改保存生产加工工序明细
*/

145
ruoyi-admin/src/main/resources/templates/system/procedure/detail.html

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('生产加工工序明细详情')" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-procedure-detail" th:object="${sysProcedure}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">工序id:</label>
<div class="col-sm-8">
<input name="procedureId" th:field="*{procedureId}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产设备型号:</label>
<div class="col-sm-8">
<input name="produceEquipModel" th:field="*{produceEquipModel}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工序编号:</label>
<div class="col-sm-8">
<input name="procedureCode" th:field="*{procedureCode}" class="form-control" type="text" readonly>
</div>
</div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">车间名称:</label>
<div class="col-sm-8">
&lt;!&ndash; <input name="workshopName" th:field="*{workshopName}" class="form-control" type="text">&ndash;&gt;
<select name="workshopName" class="form-control select-list js-example-tags" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">工序名称:</label>
<div class="col-sm-8">
<input name="procedureName" th:field="*{procedureName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">先后次序:</label>
<div class="col-sm-8">
<input name="sequence" th:field="*{sequence}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单间加工成本:</label>
<div class="col-sm-8">
<input name="eachCost" th:field="*{eachCost}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">加工工时:</label>
<div class="col-sm-8">
<input name="procedureWorkhour" th:field="*{procedureWorkhour}" class="form-control" type="text" readonly>
</div>
</div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list js-example-tags" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
&lt;!&ndash; <input name="associatedItem" th:field="*{associatedItem}" class="form-control" type="text">&ndash;&gt;
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">工序备注:</label>
<div class="col-sm-8">
<textarea name="procedureRemark" th:field="*{procedureRemark}" class="form-control" readonly></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/procedure";
var getData = [[${sysProcedure}]]
$("#form-procedure-detail").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/detail", $('#form-procedure-detail').serialize());
}
}
// $(document).ready(function(){
// $('.js-example-tags').select2({
// tags: true,
// insertTag: function (data, tag) {
// // Insert the tag at the end of the results
// data.push(tag);
// }
// });
// });
$(function () {
var workshopNameData = {
id: getData.workshopName,
text: getData.workshopName
};
if ($("#form-procedure-detail select[name='workshopName']").find("option[value='" + workshopNameData.id + "']").length) {
$("#form-procedure-detail select[name='workshopName']").val(workshopNameData.id).trigger('change');
} else {
// Create a DOM Option and pre-select by default
var newOption = new Option(workshopNameData.text, workshopNameData.id, true, true);
// Append it to the select
$("#form-procedure-detail select[name='workshopName']").append(newOption).trigger('change');
}
$("#form-procedure-detail select[name='workshopName']").select2({
tags: true
});
var associatedItemData = {
id: getData.associatedItem,
text: getData.associatedItem
};
if ($("#form-procedure-detail select[name='associatedItem']").find("option[value='" + associatedItemData.id + "']").length) {
$("#form-procedure-detail select[name='associatedItem']").val(associatedItemData.id).trigger('change');
} else {
// Create a DOM Option and pre-select by default
var newOption = new Option(associatedItemData.text, associatedItemData.id, true, true);
// Append it to the select
$("#form-procedure-detail select[name='associatedItem']").append(newOption).trigger('change');
}
$("#form-procedure-detail select[name='associatedItem']").select2({
tags: true
});
})
</script>
</body>
</html>

111
ruoyi-admin/src/main/resources/templates/system/procedure/procedure.html

@ -52,12 +52,12 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:procedure:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:procedure:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:procedure:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:procedure:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:procedure:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:procedure:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
@ -73,7 +73,6 @@
var removeFlag = [[${@permission.hasPermi('system:procedure:remove')}]];
var prefix = ctx + "system/procedure";
var datas = [[${@dict.getType('sys_dept_type')}]];
$(function() {
var options = {
url: prefix + "/list",
@ -81,78 +80,38 @@
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
clickToSelect: true,
pageList: [10, 25, 50],
pageSize: 10,
showColumns: false,
fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, // 冻结右列个数
height: $(window).height() - 100,
modalName: "生产加工工序明细",
columns: [{
checkbox: true
},
{
title: '主键ID',
field: 'id',
visible: false
},
{
field: 'procedureId',
title: '工序id'
},
{
field: 'procedureCode',
title: '工序编号'
},
{
field: 'produceEquipModel',
title: '生产设备型号'
},
{
field: 'workshopName',
title: '车间名称',
visible: false
},
{
field: 'procedureName',
title: '工序名称'
},
{
field: 'sequence',
title: '先后次序',
sortable: true
},
{
field: 'eachCost',
title: '单间加工成本'
},
{
field: 'procedureWorkhour',
title: '加工工时'
},
{
field: 'associatedItem',
title: '核算数量关联项',
visible: false
},
{
field: 'procedureRemark',
title: '工序备注'
},
{
field: 'createTime',
title: '录入时间'
},
{
field: 'updateTime',
title: '上次修改时间'
columns: [
{checkbox: true},
{title: '主键ID',field: 'id', visible: false},
{field: 'procedureId', title: '工序id'},
{field: 'procedureCode',title: '工序编号'},
{field: 'produceEquipModel',title: '生产设备型号'},
{field: 'workshopName',title: '车间名称',visible: false},
{field: 'procedureName',title: '工序名称' },
{field: 'sequence',title: '先后次序',sortable: true},
{field: 'eachCost',title: '单间加工成本'},
{field: 'procedureWorkhour',title: '加工工时' },
{field: 'associatedItem',title: '核算数量关联项',visible: false},
{field: 'procedureRemark',title: '工序备注'},
{field: 'createTime',title: '录入时间'},
{field: 'updateTime', title: '上次修改时间'},
{title: '操作',align: 'center',formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-primary btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.procedureId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.procedureId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);

Loading…
Cancel
Save