Browse Source

[fix]品质管理:

制程检验
修改制程检验新增页面的列表样式
修改检验报告的列表样式
新增查询所有制程工序编号接口
新增根据制程工序编号查询对应制程工序详情
新增添加不合格分类按钮
dev
liuxiaoxu 6 months ago
parent
commit
b2bccc875b
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java
  2. 10
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingProcessController.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingProcessService.java
  5. 9
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingProcessServiceImpl.java
  6. 5
      ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml
  7. 270
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html

11
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java

@ -208,6 +208,17 @@ public class QualityManufacturingCheckoutController extends BaseController
} }
/*
* 查找制程工序编号列表
* */
@ResponseBody
@PostMapping("/getProcessCodeList")
public TableDataInfo getProcessCodeList(){
startPage();
List<QualityManufacturingProcess> list = qualityManufacturingCheckoutService.selectAllProcess();
return getDataTable(list);
}
/** /**
* 点击详情的时候查询数据库中已有的物料信息 * 点击详情的时候查询数据库中已有的物料信息
* */ * */

10
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingProcessController.java

@ -172,5 +172,15 @@ public class QualityManufacturingProcessController extends BaseController
return toAjax(qualityManufacturingProcessService.restoreQualityManufacturingProcessById(id)); return toAjax(qualityManufacturingProcessService.restoreQualityManufacturingProcessById(id));
} }
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
@GetMapping("/getProcessByCode/{manufacturingProcessCode}")
@ResponseBody
public AjaxResult getProcessByCode(@PathVariable("manufacturingProcessCode") String manufacturingProcessCode)
{
QualityManufacturingProcess qualityManufacturingProcess = qualityManufacturingProcessService.selectQualityManufacturingProcessByCode(manufacturingProcessCode);
return AjaxResult.success(qualityManufacturingProcess);
}
} }

5
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java

@ -96,4 +96,9 @@ public interface QualityManufacturingProcessMapper
* 查找制程工序列表 * 查找制程工序列表
* */ * */
List<QualityManufacturingProcess> selectAllProcess(); List<QualityManufacturingProcess> selectAllProcess();
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
QualityManufacturingProcess selectQualityManufacturingProcessByCode(String manufacturingProcessCode);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingProcessService.java

@ -81,4 +81,9 @@ public interface IQualityManufacturingProcessService
* @return * @return
*/ */
int restoreQualityManufacturingProcessById(Long manufacturingProcessAutoid); int restoreQualityManufacturingProcessById(Long manufacturingProcessAutoid);
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
QualityManufacturingProcess selectQualityManufacturingProcessByCode(String manufacturingProcessCode);
} }

9
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingProcessServiceImpl.java

@ -191,4 +191,13 @@ public class QualityManufacturingProcessServiceImpl implements IQualityManufactu
{ {
return qualityManufacturingProcessMapper.restoreQualityManufacturingProcessById(manufacturingProcessAutoid); return qualityManufacturingProcessMapper.restoreQualityManufacturingProcessById(manufacturingProcessAutoid);
} }
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
@Override
public QualityManufacturingProcess selectQualityManufacturingProcessByCode(String manufacturingProcessCode) {
return qualityManufacturingProcessMapper.selectQualityManufacturingProcessByCode(manufacturingProcessCode);
}
} }

5
ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml

@ -49,6 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where manufacturing_process_autoid = #{manufacturingProcessAutoid} where manufacturing_process_autoid = #{manufacturingProcessAutoid}
</select> </select>
<select id="selectQualityManufacturingProcessByCode" parameterType="Long" resultMap="QualityManufacturingProcessResult">
<include refid="selectQualityManufacturingProcessVo"/>
where manufacturing_process_code = #{manufacturingProcessCode}
</select>
<insert id="insertQualityManufacturingProcess" parameterType="QualityManufacturingProcess" useGeneratedKeys="true" keyProperty="manufacturingProcessAutoid"> <insert id="insertQualityManufacturingProcess" parameterType="QualityManufacturingProcess" useGeneratedKeys="true" keyProperty="manufacturingProcessAutoid">
insert into quality_manufacturing_process insert into quality_manufacturing_process
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

270
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html

@ -3,6 +3,28 @@
<head> <head>
<th:block th:include="include :: header('制程检验报告')" /> <th:block th:include="include :: header('制程检验报告')" />
<th:block th:include="include :: datetimepicker-css" /> <th:block th:include="include :: datetimepicker-css" />
<style>
.table-striped{
height: 135px;
}
.table-striped-two{
overflow: hidden;
scroll: auto;
}
.bordered-container {
/* 自动高度,根据内容自动调整 */
min-height: 0; /* 确保高度能收缩至内容高度 */
/* 自动宽度,对于块级元素已经是默认行为,但如果你想强调这一点或针对特定情况,可以显式声明 */
width: auto;
height: auto;
border: 2px solid #888; /* 灰色边框,可根据需要调整颜色 */
/* 以下可选,根据需要添加,用于控制内外边距和布局 */
padding: 1rem;
box-sizing: border-box; /* 包含边框和内边距在宽度计算中 */
margin-bottom: 20px;
}
</style>
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -33,47 +55,32 @@
</div> </div>
</div> </div>
<!-- <div class="form-row">--> <div class="container mt-5">
<!-- <div class="container">--> <div class="btn-group-sm">
<!-- <div class="form-row">--> <span>选择制程工序</span>
<!-- <div class="btn-group-sm" id="toolbar" role="group">--> <a class="btn btn-success" onclick="insertRow()">
<!-- <span>选择制程工序</span>--> <i class="fa fa-plus"></i> 添加制程工序
<!-- <a class="btn btn-success" onclick="addManufacturingProcess()">--> </a>
<!-- <i class="fa fa-plus"></i> 添加制程工序-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">检验完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="checkoutCompletionTime" th:value="${#dates.format(qualityManufacturingCheckoutMaterial.checkoutCompletionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div> </div>
</div> <div id="contentArea" class="mt-3">
<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>
</div> </div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var manufacturingProcessNameDatas = [[${@dict.getType('manufacturing_process_name')}]]; var manufacturingProcessNameDatas = [[${@dict.getType('manufacturing_process_name')}]];
var prefix = ctx + "quality/checkoutMaterial"; var prefix = ctx + "quality/checkoutMaterial";
$("#form-checkoutMaterial-edit").validate({
focusCleanup: true
});
$("#form-checkoutMaterial-edit").validate({focusCleanup: true});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
@ -93,23 +100,68 @@
autoclose: true autoclose: true
}); });
function insertRow() {
var currentTimeStamp = new Date().getTime(); // 获取当前时间的时间戳
var uniqueId = "ID_" + currentTimeStamp; // 为ID添加前缀并使用时间戳
console.log(uniqueId);
var newItem =
"<div class='container bordered-container'>" +
"<div class='col-sm-12 my-3'>" +
"<h5>制程工序</h5>" +
"<div class='col-sm-12 select-table table-striped'>" +
'<table class="table-container checkoutMaterial-edit-table" id="bootstrap-manufacturingProcess-table-'+uniqueId+'"></table>' +
"</div>" +
"</div>" +
"<div class='col-sm-12 my-3'>" +
"<h5>合格数</h5>" +
'<form id="form-manfa-'+ uniqueId +'"> ' +
"<div class='form-group'> "+
"<label for='okAcceptedNum'>OK允收数:</label>" +
"<input type='text' class='form-control' id='okAcceptedNum'>"+
"</div>"+
" <div class='form-group'> "+
"<label for='qualifiedNum'>特采/让步数:</label>" +
"<input type='text' class='form-control' id='specialConcessionsNum' >"+
"</div>"+
"</form>"+
"</div>" +
//制程工序展示列表 "<div class='col-sm-12 my-3'>" +
$(function() { "<span>不合格数</span>" +
var options = { "<div class='btn-group-sm'> " +
id:'bootstrap-manufacturingProcess-table', "<a class='btn btn-success' onclick='insertUnqualifiedRow(\"#bootstrap-unqualifiedClass-table-" + uniqueId + "\")'>"+
"<i class='fa fa-plus'></i> 添加 " +"</a>" +
"</div>" +
"<div class='col-sm-12 select-table table-striped-two'>" +
'<table class="table-container checkoutMaterial-edit-table" id="bootstrap-unqualifiedClass-table-' + uniqueId + '"></table>' +
"</div>" +
"</div>" +
"</div>";
$("#contentArea").append(newItem);
var options1 = {
id:'bootstrap-manufacturingProcess-table-' + uniqueId,
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
showColumns: false, showColumns: false,
pagination: false, // 设置不分页 pagination: false, // 设置不分页
modalName: "选择制程工序", modalName: "选择制程工序",
height:30,
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {
title: '制程工序编号', title: '制程工序编号',
field: 'manufacturingProcessCode', field: 'manufacturingProcessCode',
formatter: function (value,row,index){
var action = [];
var td = '<select name="manufacturingProcessCode" id="select-manufacturingProcess-'+uniqueId+'"></select>';
action.push(td);
return action.join('');
// var data = [{ index: curIndex, type: value }];
// return $("#manufacturingProcessCode" + uniqueId).tmpl(data).html();
}
}, },
{ {
title: '制程工序名称', title: '制程工序名称',
@ -148,86 +200,120 @@
return actions.join(''); return actions.join('');
} }
}, },
] ],
}; onEditableSave:function (index,row,$el){
$.table.init(options); var url=ctx+'quality/manufacturingCheckout/getProcessCodeList/'+row.manufacturingProcessCode;
$.ajax({
url:url,
type:'GET',
dataType:'json',
success:function (res){
row.modName = res.data.modName;
row.manufacturingProcessCode=res.data.manufacturingProcessCode;
row.manufacturingProcessName=res.data.manufacturingProcessName;
row.deviceName=res.data.deviceName;
row.deviceModelCode=res.data.deviceModelCode;
row.processSequence=res.data.processSequence;
row.workshopName=res.data.workshopName;
row.modName=res.data.modName;
}
}) })
}
};
$(function() { $.table.init(options1);
var options = { //不合格数
id:'bootstrap-manufacturingProcess-table', var options2 = {
modalName: "选择制程工序", id:'bootstrap-unqualifiedClass-table-' + uniqueId,
height:50, showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "添加不合格分类",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {
title: '制程工序编号', title: '不合格分类Id',
field: 'manufacturingProcessCode', field: 'manufacturingUnqualifiedClassId',
visible: false
}, },
{ {
title: '制程工序名称', title: '不良分类',
field: 'manufacturingProcessName', field: 'processBadClassification',
formatter: function(value, row, index) {
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
}
}, },
{ {
title: '设备名称', title: '不良等级',
field: 'deviceName', field: 'processBadGrade',
}, },
{ {
title: '设备型号', title: '不良数量',
field: 'deviceModelCode', field: 'processBadNum',
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.manufacturingProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeUnqualifiedClassRow(\'' + row.manufacturingUnqualifiedClassId + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join(''); return actions.join('');
} }
} },
] ]
}; };
$.table.init(options); $.table.init(options2);
}) $("#bootstrap-manufacturingProcess-table-" +uniqueId ).bootstrapTable('insertRow', {
index: 1,
/*添加制程工序按钮*/ row: {
// function insertRow() { manufacturingProcessCode: '',
// var url = ctx + 'quality/manufacturingCheckout/manufacturingProcessSelect'; manufacturingProcessName: '',
// var options = { deviceName: '',
// title: '选制程工序', deviceModelCode: '',
// url: url, processSequence: '',
// callBack: doSubmit workshopName: '',
// }; modName: ''
// $.modal.openOptions(options); }
// } });
// };
// // 新增 insertUnqualifiedRow 函数
// function doSubmit(index, layero,uniqueId){ function insertUnqualifiedRow(tableId) {
// console.log(uniqueId); var $table = $(tableId); // 使用传入的ID获取表格实例
// var iframeWin = window[layero.find('iframe')[0]['name']]; var newRow = {
// var rowData = iframeWin.$('#bootstrap-manufacturingProcessSelect-table').bootstrapTable('getSelections')[0]; manufacturingUnqualifiedClassId: 'UC_' + new Date().getTime(), // 示例生成唯一ID
// console.log("rowData: "+rowData); processBadClassification: '',
// $("#bootstrap-manufacturingProcess-table").bootstrapTable('insertRow', { processBadGrade: '',
// index:1, processBadNum: ''
// row: { };
// manufacturingProcessCode:rowData.manufacturingProcessCode, $table.bootstrapTable('insertRow', {
// manufacturingProcessName:rowData.manufacturingProcessName, index: 1, // 在第一行后插入新行,可根据需要调整
// deviceName: rowData.deviceName, row: newRow
// deviceModelCode: rowData.deviceModelCode, });
// processSequence: rowData.processSequence, selectProcessCode();
// workshopName: rowData.workshopName, }
// modName: rowData.modName, //查询所有的制程工序编号
// } function selectProcessCode(){
// }) $.ajax({
// layer.close(index); url: ctx + 'quality/manufacturingCheckout/getProcessCodeList',
// } type: "post",
dataType: "json",
success: function (res) {
console.log(res);
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-checkoutMaterial-edit select[name='manufacturingProcessCode']").append(
"<option value='" + usertData[i].manufacturingProcessCode + "'>" + usertData[i].manufacturingProcessCode + "</option>");
}
}else {
$.modal.error("数据为空");
}
}
});
}
function removeUnqualifiedClassRow(id) {
alert("实施删除不合格分类行操作,id: " + id); // 实现删除逻辑
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save