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));
}
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
@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();
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
QualityManufacturingProcess selectQualityManufacturingProcessByCode(String manufacturingProcessCode);
}

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

@ -81,4 +81,9 @@ public interface IQualityManufacturingProcessService
* @return
*/
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);
}
/*
* 查找与制程检验有关的制程工序通过制程工序编号
* */
@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}
</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 into quality_manufacturing_process
<trim prefix="(" suffix=")" suffixOverrides=",">

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

@ -3,6 +3,28 @@
<head>
<th:block th:include="include :: header('制程检验报告')" />
<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>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -33,47 +55,32 @@
</div>
</div>
<!-- <div class="form-row">-->
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择制程工序</span>-->
<!-- <a class="btn btn-success" onclick="addManufacturingProcess()">-->
<!-- <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 class="container mt-5">
<div class="btn-group-sm">
<span>选择制程工序</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加制程工序
</a>
</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 id="contentArea" class="mt-3">
<!-- 初始内容可以在这里,例如一个列表项和一个表单 -->
</div>
</div>
</form>
</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 manufacturingProcessNameDatas = [[${@dict.getType('manufacturing_process_name')}]];
var prefix = ctx + "quality/checkoutMaterial";
$("#form-checkoutMaterial-edit").validate({
focusCleanup: true
});
$("#form-checkoutMaterial-edit").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
@ -93,23 +100,68 @@
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>" +
//制程工序展示列表
$(function() {
var options = {
id:'bootstrap-manufacturingProcess-table',
"<div class='col-sm-12 my-3'>" +
"<span>不合格数</span>" +
"<div class='btn-group-sm'> " +
"<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,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "选择制程工序",
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: '制程工序名称',
@ -148,86 +200,120 @@
return actions.join('');
}
},
]
};
$.table.init(options);
],
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;
}
})
$(function() {
var options = {
id:'bootstrap-manufacturingProcess-table',
modalName: "选择制程工序",
height:50,
}
};
$.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: '制程工序编号',
field: 'manufacturingProcessCode',
title: '不合格分类Id',
field: 'manufacturingUnqualifiedClassId',
visible: false
},
{
title: '制程工序名称',
field: 'manufacturingProcessName',
formatter: function(value, row, index) {
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
}
title: '不良分类',
field: 'processBadClassification',
},
{
title: '设备名称',
field: 'deviceName',
title: '不良等级',
field: 'processBadGrade',
},
{
title: '设备型号',
field: 'deviceModelCode',
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="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('');
}
}
},
]
};
$.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);
// }
$.table.init(options2);
$("#bootstrap-manufacturingProcess-table-" +uniqueId ).bootstrapTable('insertRow', {
index: 1,
row: {
manufacturingProcessCode: '',
manufacturingProcessName: '',
deviceName: '',
deviceModelCode: '',
processSequence: '',
workshopName: '',
modName: ''
}
});
};
// 新增 insertUnqualifiedRow 函数
function insertUnqualifiedRow(tableId) {
var $table = $(tableId); // 使用传入的ID获取表格实例
var newRow = {
manufacturingUnqualifiedClassId: 'UC_' + new Date().getTime(), // 示例生成唯一ID
processBadClassification: '',
processBadGrade: '',
processBadNum: ''
};
$table.bootstrapTable('insertRow', {
index: 1, // 在第一行后插入新行,可根据需要调整
row: newRow
});
selectProcessCode();
}
//查询所有的制程工序编号
function selectProcessCode(){
$.ajax({
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>
</body>
</html>
Loading…
Cancel
Save