Browse Source

[feat]工程管理:针对于无左右滑动框,信息查看不方便的问题,修改物料bom表的高度,以及物料信息的高度

dev
zhangsiqi 6 months ago
parent
commit
84c6f8ca71
  1. 9
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  2. 109
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html

9
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -76,12 +76,6 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:bom:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:bom:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:bom:edit">
<i class="fa fa-edit"></i> 修改
</a>
- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:bom:remove">
<i class="fa fa-remove"></i> 删除
</a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:bom:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:bom:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -140,11 +134,14 @@
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
importUrl: prefix + "/importData", importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate", importTemplateUrl: prefix + "/importTemplate",
pageList: [5, 10, 25, 50],
pageSize: 5,
modalName: "bom", modalName: "bom",
detailView: true, detailView: true,
fixedColumns: true, // 启用冻结列 fixedColumns: true, // 启用冻结列
rightFixedColumns:1, rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数 fixedRightNumber: 1, // 冻结右列个数
height: $(window).height() - 100,
//指定父id列 //指定父id列
onExpandRow : function(index, row, $detail) { onExpandRow : function(index, row, $detail) {
$detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' + $detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' +

109
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html

@ -39,8 +39,8 @@
<h3>合格数</h3> <h3>合格数</h3>
<div class="row"> <div class="row">
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label">ok允收数:</label> <label class="control-label is-required">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text"> <input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text" required>
</div> </div>
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label">ok报告图片:</label> <label class="control-label">ok报告图片:</label>
@ -49,8 +49,8 @@
</div> </div>
<div class="row"> <div class="row">
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label">特采/让步数:</label> <label class="control-label is-required">特采/让步数:</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text"> <input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text" required>
</div> </div>
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label">特采报告图片:</label> <label class="control-label">特采报告图片:</label>
@ -102,7 +102,7 @@
var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]]; var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]]; var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder"; var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({ $("#form-qualityOrderReport-edit").validate({
focusCleanup: true focusCleanup: true
@ -188,22 +188,18 @@
field: 'qualityOrderReportId', field: 'qualityOrderReportId',
visible: false visible: false
}, },
{
title: '不良分类', {title: '不良分类',field: 'processBadClassification',
field: 'processBadClassification', formatter:function (value, row, index) {
formatter: function(index, row, value) { return processBadClassificationFormatter(value,row,index);
return dictToSelectWithEvent(processBadClassificationDatas, value, "processBadClassification", "bootstrap-unqualified-table");
} }
}, },
{
title: '不良等级',
field: 'processBadGrade',
formatter: function(index, row, value) {
return dictToSelectWithEvent(processBadGradeDatas, value, "processBadGrade", "bootstrap-unqualified-table");
}
{title: '不良等级',field: 'processBadGrade',
formatter:function (value, row, index) {
return processBadGradeFormatter(value,row,index);
}
}, },
{ {
title: '数量', title: '数量',
field: 'processBadNum', field: 'processBadNum',
@ -228,20 +224,7 @@
] ]
}; };
$.table.init(options); $.table.init(options);
});
// 添加全局事件处理器
window.updateTableRow = function(tableId, element) {
var $table = $("#" + tableId);
var rowIndex = $($element).closest('tr[data-index]').data('index');
var fieldName = $(element).attr('name');
var newValue = $(element).val();
// 直接更新Bootstrap Table的数据源
var data = $table.bootstrapTable('getData');
data[rowIndex][fieldName] = newValue;
$table.bootstrapTable('load', data);
};
})
// 逻辑删除不合格数前端的一行数据 // 逻辑删除不合格数前端的一行数据
@ -255,22 +238,60 @@
} }
// 数据字典转下拉框,并添加事件监听 // 列中获取不良分类的下拉改变数据
function dictToSelectWithEvent(datas, value, name, tableId) { function onProcessBadClassification(selectElement, rowIndex) {
var selectHtml = $("<select>", { var processBadClassificationValue = $(selectElement).val();
"class": "form-control", var tableData = $table.bootstrapTable('getData');
"name": name, var newRow = tableData[rowIndex]; // 获取当前行数据
"onchange": "updateTableRow('" + tableId + "', this);" // 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadClassification = processBadClassificationValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良分类的格式化函数
function processBadClassificationFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadClassification(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadClassificationDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
}); });
$.each(datas, function(index, dict) {
$("<option>") selectHtml += '</select>';
.val(dict.dictValue) return selectHtml;
.text(dict.dictLabel) }
.attr("selected", dict.dictValue === value)
.appendTo(selectHtml);
// 列中获取不良等级的下拉改变数据
function onProcessBadGrade(selectElement, rowIndex) {
var processBadGradeValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadGrade = processBadGradeValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良等级的格式化函数
function processBadGradeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadGrade(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadGradeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
}); });
return selectHtml.prop("outerHTML");
selectHtml += '</select>';
return selectHtml;
} }
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save