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. 7
      ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml
  7. 402
      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);
}
} }

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

@ -48,7 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectQualityManufacturingProcessVo"/> <include refid="selectQualityManufacturingProcessVo"/>
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=",">

402
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,141 +100,220 @@
autoclose: true autoclose: true
}); });
function insertRow() {
var currentTimeStamp = new Date().getTime(); // 获取当前时间的时间戳
var uniqueId = "ID_" + currentTimeStamp; // 为ID添加前缀并使用时间戳
console.log(uniqueId);
//制程工序展示列表 var newItem =
$(function() { "<div class='container bordered-container'>" +
var options = { "<div class='col-sm-12 my-3'>" +
id:'bootstrap-manufacturingProcess-table', "<h5>制程工序</h5>" +
showSearch: false, "<div class='col-sm-12 select-table table-striped'>" +
showRefresh: false, '<table class="table-container checkoutMaterial-edit-table" id="bootstrap-manufacturingProcess-table-'+uniqueId+'"></table>' +
showToggle: false, "</div>" +
showColumns: false, "</div>" +
pagination: false, // 设置不分页 "<div class='col-sm-12 my-3'>" +
modalName: "选择制程工序", "<h5>合格数</h5>" +
columns: [{ '<form id="form-manfa-'+ uniqueId +'"> ' +
checkbox: true "<div class='form-group'> "+
}, "<label for='okAcceptedNum'>OK允收数:</label>" +
{ "<input type='text' class='form-control' id='okAcceptedNum'>"+
title: '制程工序编号', "</div>"+
field: 'manufacturingProcessCode', " <div class='form-group'> "+
}, "<label for='qualifiedNum'>特采/让步数:</label>" +
{ "<input type='text' class='form-control' id='specialConcessionsNum' >"+
title: '制程工序名称', "</div>"+
field: 'manufacturingProcessName', "</form>"+
formatter: function(value, row, index) { "</div>" +
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
} "<div class='col-sm-12 my-3'>" +
}, "<span>不合格数</span>" +
{ "<div class='btn-group-sm'> " +
title: '设备名称', "<a class='btn btn-success' onclick='insertUnqualifiedRow(\"#bootstrap-unqualifiedClass-table-" + uniqueId + "\")'>"+
field: 'deviceName', "<i class='fa fa-plus'></i> 添加 " +"</a>" +
}, "</div>" +
{ "<div class='col-sm-12 select-table table-striped-two'>" +
title: '设备型号', '<table class="table-container checkoutMaterial-edit-table" id="bootstrap-unqualifiedClass-table-' + uniqueId + '"></table>' +
field: 'deviceModelCode', "</div>" +
}, "</div>" +
{ "</div>";
title: '工序顺序', $("#contentArea").append(newItem);
field: 'processSequence', var options1 = {
}, id:'bootstrap-manufacturingProcess-table-' + uniqueId,
{ showSearch: false,
title: '车间名称', showRefresh: false,
field: 'workshopName', showToggle: false,
}, showColumns: false,
{ pagination: false, // 设置不分页
title: '零件名称', modalName: "选择制程工序",
field: 'modName', height:30,
columns: [{
checkbox: true
}, },
{
title: '制程工序编号',
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: '制程工序名称',
field: 'manufacturingProcessName',
formatter: function(value, row, index) {
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
}
},
{
title: '设备名称',
field: 'deviceName',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '工序顺序',
field: 'processSequence',
},
{
title: '车间名称',
field: 'workshopName',
},
{
title: '零件名称',
field: 'modName',
},
{ {
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="removeRow(\'' + row.manufacturingProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join(''); return actions.join('');
} }
},
],
onEditableSave:function (index,row,$el){
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;
}
})
}
};
$.table.init(options1);
//不合格数
var options2 = {
id:'bootstrap-unqualifiedClass-table-' + uniqueId,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "添加不合格分类",
columns: [{
checkbox: true
}, },
] {
title: '不合格分类Id',
field: 'manufacturingUnqualifiedClassId',
visible: false
},
{
title: '不良分类',
field: 'processBadClassification',
},
{
title: '不良等级',
field: 'processBadGrade',
},
{
title: '不良数量',
field: 'processBadNum',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
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('');
}
},
]
};
$.table.init(options2);
$("#bootstrap-manufacturingProcess-table-" +uniqueId ).bootstrapTable('insertRow', {
index: 1,
row: {
manufacturingProcessCode: '',
manufacturingProcessName: '',
deviceName: '',
deviceModelCode: '',
processSequence: '',
workshopName: '',
modName: ''
}
});
}; };
$.table.init(options); // 新增 insertUnqualifiedRow 函数
}) function insertUnqualifiedRow(tableId) {
var $table = $(tableId); // 使用传入的ID获取表格实例
var newRow = {
$(function() { manufacturingUnqualifiedClassId: 'UC_' + new Date().getTime(), // 示例生成唯一ID
var options = { processBadClassification: '',
id:'bootstrap-manufacturingProcess-table', processBadGrade: '',
modalName: "选择制程工序", processBadNum: ''
height:50, };
columns: [{ $table.bootstrapTable('insertRow', {
checkbox: true index: 1, // 在第一行后插入新行,可根据需要调整
}, row: newRow
{ });
title: '制程工序编号', selectProcessCode();
field: 'manufacturingProcessCode', }
}, //查询所有的制程工序编号
{ function selectProcessCode(){
title: '制程工序名称', $.ajax({
field: 'manufacturingProcessName', url: ctx + 'quality/manufacturingCheckout/getProcessCodeList',
formatter: function(value, row, index) { type: "post",
return $.table.selectDictLabel(manufacturingProcessNameDatas, value); dataType: "json",
} success: function (res) {
}, console.log(res);
{ if (res.rows.length > 0) {
title: '设备名称', var usertData = res.rows;
field: 'deviceName', for (let i in usertData) {
}, $("#form-checkoutMaterial-edit select[name='manufacturingProcessCode']").append(
{ "<option value='" + usertData[i].manufacturingProcessCode + "'>" + usertData[i].manufacturingProcessCode + "</option>");
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
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> ');
return actions.join('');
} }
}else {
$.modal.error("数据为空");
} }
] }
}; });
$.table.init(options); }
})
/*添加制程工序按钮*/
// function insertRow() {
// var url = ctx + 'quality/manufacturingCheckout/manufacturingProcessSelect';
// var options = {
// title: '选制程工序',
// url: url,
// callBack: doSubmit
// };
// $.modal.openOptions(options);
// }
//
//
// function doSubmit(index, layero,uniqueId){
// console.log(uniqueId);
// var iframeWin = window[layero.find('iframe')[0]['name']];
// var rowData = iframeWin.$('#bootstrap-manufacturingProcessSelect-table').bootstrapTable('getSelections')[0];
// console.log("rowData: "+rowData);
// $("#bootstrap-manufacturingProcess-table").bootstrapTable('insertRow', {
// index:1,
// row: {
// manufacturingProcessCode:rowData.manufacturingProcessCode,
// manufacturingProcessName:rowData.manufacturingProcessName,
// deviceName: rowData.deviceName,
// deviceModelCode: rowData.deviceModelCode,
// processSequence: rowData.processSequence,
// workshopName: rowData.workshopName,
// modName: rowData.modName,
// }
// })
// layer.close(index);
// }
function removeUnqualifiedClassRow(id) {
alert("实施删除不合格分类行操作,id: " + id); // 实现删除逻辑
}
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save