Browse Source

[feat]品质管理:

退检管理
新增退检管理详情页面
detail.html
新增退检管理查看详情接口
returnInspection.html 退检管理列表新增详情按钮
dev
liuxiaoxu 6 months ago
parent
commit
99cb93841b
  1. 23
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java
  2. 11
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java
  3. 8
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java
  4. 332
      ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html
  5. 24
      ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspection.html

23
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java

@ -114,6 +114,29 @@ public class QualityReturnInspectionController extends BaseController
return toAjax(qualityReturnInspectionService.updateQualityReturnInspection(erpMaterialReturnInspection));
}
/**
* 退检管理列表详情
*/
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{
ErpMaterialReturnInspection erpMaterialReturnInspection = qualityReturnInspectionService.selectQualityReturnInspectionById(id);
mmap.put("erpMaterialReturnInspection", erpMaterialReturnInspection);
return prefix + "/detail";
}
/**
* 修改保存退检管理单
*/
@RequiresPermissions("quality:returnInspection:detail")
@Log(title = "物料退检单", businessType = BusinessType.UPDATE)
@PostMapping("/detail")
@ResponseBody
public AjaxResult detailSave(ErpMaterialReturnInspection erpMaterialReturnInspection)
{
return toAjax(qualityReturnInspectionService.detailQualityReturnInspection(erpMaterialReturnInspection));
}
}

11
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java

@ -24,7 +24,7 @@ public interface IQualityReturnInspectionService
/**
* 查询物料退检单列表
*
* @param qualityReturnInspection 物料退检单
* @param erpMaterialReturnInspection 物料退检单
* @return 物料退检单集合
*/
public List<ErpMaterialReturnInspection> selectQualityReturnInspectionList(ErpMaterialReturnInspection erpMaterialReturnInspection);
@ -32,7 +32,7 @@ public interface IQualityReturnInspectionService
/**
* 新增物料退检单
*
* @param qualityReturnInspection 物料退检单
* @param erpMaterialReturnInspection 物料退检单
* @return 结果
*/
public int insertQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection);
@ -40,7 +40,7 @@ public interface IQualityReturnInspectionService
/**
* 修改物料退检单
*
* @param qualityReturnInspection 物料退检单
* @param erpMaterialReturnInspection 物料退检单
* @return 结果
*/
public int updateQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection);
@ -50,4 +50,9 @@ public interface IQualityReturnInspectionService
* 导出列表查询
* */
List<ErpMaterialReturnInspectionExcelDto> selectExportList(ErpMaterialReturnInspection erpMaterialReturnInspection);
/*
* 退检管理详情
* */
int detailQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection);
}

8
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java

@ -137,4 +137,12 @@ public class QualityReturnInspectionServiceImpl implements IQualityReturnInspect
public List<ErpMaterialReturnInspectionExcelDto> selectExportList(ErpMaterialReturnInspection erpMaterialReturnInspection) {
return erpMaterialReturnInspectionMapper.selectExportList(erpMaterialReturnInspection);
}
/*
* 退检管理详情
* */
@Override
public int detailQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection) {
return 1;
}
}

332
ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html

@ -0,0 +1,332 @@
<!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" id="form-materialReturnInspection-edit" th:object="${erpMaterialReturnInspection}">
<div class="row">
<div class="col-sm-6">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-4 control-label">退检单号:</label>
<div class="col-sm-8">
<input id="returnInspectionNo" name="returnInspectionNo" th:field="*{returnInspectionNo}" class="form-control" type="text" readonly>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">生产单号:</label>
<div class="col-sm-8">
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">退料时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="returnMaterialTime" th:value="${#dates.format(erpMaterialReturnInspection.returnMaterialTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">紧急程度:</label>
<div class="col-sm-8">
<select name="urgencyLevel" class="form-control" th:with="type=${@dict.getType('urgency_level')}" readonly disabled>
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{urgencyLevel}"></option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">是否结案:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
<input type="radio"
th:id="${'isClosed_' + dict.dictCode}"
name="isClosed"
th:value="${dict.dictValue}"
th:field="*{isClosed}"
disabled="disabled"> <!-- 添加disabled属性到这里 -->
<label th:for="${'isClosed_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!-- <a class="btn btn-success btn-sm" onclick="insertRow()">-->
<!-- <i class="fa fa-plus"></i> 新增行-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple btn-sm" onclick="removeRow()">-->
<!-- <i class="fa fa-remove"></i> 删除选择行-->
<!-- </a>-->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/jquery.tmpl.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "quality/returnInspection";
var urgencyLevelDatas = [[${@dict.getType('urgency_level')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$(function(){
var options = {
url: ctx + "erp/materialReturnInspectionDetail/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
columns: [{
checkbox: true
},
{
field: 'id',
title: '主键id'
},
{
field: 'materialNo',
align: 'center',
title: '料号'
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
align: 'center',
title: '物料名称'
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'returnInspectionNum',
align: 'center',
title: '退检数量'
},
{
field: 'returnInspectionType',
align: 'center',
title: '退检类型'
},
{
field: 'urgencyLevel',
align: 'center',
title: '紧急程度',
// 如果urgencyLevelTpl是用于生成可编辑内容的模板,这里也需要调整或移除
formatter: function(value, row, index) {
return $.table.selectDictLabel(urgencyLevelDatas, value);
}
},
{
field: 'pickMaterialTime',
align: 'center',
title: '领料时间'
},
{
field: 'returnInspectionRemark',
align: 'center',
title: '退检备注'
}
]
};
$.table.init(options);
})();
function queryParams(params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
searchValue: params.search,
orderByColumn: params.sort,
isAsc: params.order
};
// 额外传参
curParams.returnInspectionNo = $("#returnInspectionNo").val();
return curParams;
}
function selectMakeOrder() {
var url = ctx + "system/makeorder/selectMakeorder";
var options = {
title: '选择生产订单',
url: url,
callBack: doSubmit1
};
$.modal.openOptions(options);
}
function doSubmit1(index, layero){
debugger
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
$("#makeNo").val(rowData.makeNo);
$.modal.close(index);
}
/* 新增表格行 */
function insertRow(){
var makeNo = $("#makeNo").val();
if(!makeNo){
$.modal.msgWarning("请先选择生产单号!");
return;
}
var url = ctx + "system/makeorder/selectMakeorderDetail/"+makeNo;
var options = {
title: '选择料号',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(){
var ids = $.table.selectColumns("id");
if (ids.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$("#bootstrap-sub-table-1").bootstrapTable('remove', {
field: 'id',
values: ids
})
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
console.log("rowData:"+rowData);
$("#bootstrap-sub-table-1").bootstrapTable('insertRow',{
index: 1,
row: {
id: totalNum+1,
materialNo: rowData.materialNo,
photoUrl: rowData.photoUrl,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
returnInspectionNum: '',
returnInspectionType: '',
urgencyLevel: '',
pickMaterialTime: '',
returnInspectionRemark: ''
}
})
layer.close(index);
}
$("#form-materialReturnInspection-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/detail", $('#form-materialReturnInspection-edit').serialize());
}
}
$("input[name='returnMaterialTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("#bootstrap-sub-table-1").on("post-body.bs.table", function (e, args) {
$("input[name$='Time']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
pickerPosition:'top-right'
});
});
</script>
</body>
</html>
<!-- 紧急程度 -->
<script id="urgencyLevelTpl" type="text/x-jquery-tmpl">
<div>
<select class='form-control' name='inspectionDetails[${index}].urgencyLevel'>
<option value=""></option>
<option value="0" {{if type==="0"}}selected{{/if}}>一般</option>
<option value="1" {{if type==="1"}}selected{{/if}}>紧急</option>
</select>
</div>
</script>

24
ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspection.html

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('物料退检单列表')" />
<th:block th:include="include :: header('退检管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -53,10 +53,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:materialReturnInspection:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:materialReturnInspection:export">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="quality:returnInspection:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -68,20 +65,17 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('erp:materialReturnInspection:edit')}]];
var removeFlag = [[${@permission.hasPermi('erp:materialReturnInspection:remove')}]];
var detailFlag = [[${@permission.hasPermi('quality:returnInspection:detail')}]];
// 字典
var urgencyLevelDatas = [[${@dict.getType('urgency_level')}]];
var yesOrNoDatas = [[${@dict.getType('yes_or_no')}]];
var prefix = ctx + "erp/materialReturnInspection";
var prefix = ctx + "quality/returnInspection";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "物料退检单",
columns: [{
@ -123,13 +117,21 @@
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-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-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
/*详情按钮*/
function detail(id){
var url = ctx + 'quality/returnInspection/detail/'+id;
$.modal.open("退检详情",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save