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">
<i class="fa fa-plus"></i> 添加
</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">
<i class="fa fa-download"></i> 导出
</a>
@ -140,11 +134,14 @@
exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
pageList: [5, 10, 25, 50],
pageSize: 5,
modalName: "bom",
detailView: true,
fixedColumns: true, // 启用冻结列
rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数
height: $(window).height() - 100,
//指定父id列
onExpandRow : function(index, row, $detail) {
$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>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text">
<label class="control-label is-required">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text" required>
</div>
<div class="form-group col-sm-6">
<label class="control-label">ok报告图片:</label>
@ -49,8 +49,8 @@
</div>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label">特采/让步数:</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text">
<label class="control-label is-required">特采/让步数:</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text" required>
</div>
<div class="form-group col-sm-6">
<label class="control-label">特采报告图片:</label>
@ -102,7 +102,7 @@
var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({
focusCleanup: true
@ -188,22 +188,18 @@
field: 'qualityOrderReportId',
visible: false
},
{
title: '不良分类',
field: 'processBadClassification',
formatter: function(index, row, value) {
return dictToSelectWithEvent(processBadClassificationDatas, value, "processBadClassification", "bootstrap-unqualified-table");
{title: '不良分类',field: 'processBadClassification',
formatter:function (value, row, index) {
return processBadClassificationFormatter(value,row,index);
}
},
{
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: '数量',
field: 'processBadNum',
@ -228,20 +224,7 @@
]
};
$.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) {
var selectHtml = $("<select>", {
"class": "form-control",
"name": name,
"onchange": "updateTableRow('" + tableId + "', this);"
// 列中获取不良分类的下拉改变数据
function onProcessBadClassification(selectElement, rowIndex) {
var processBadClassificationValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
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>")
.val(dict.dictValue)
.text(dict.dictLabel)
.attr("selected", dict.dictValue === value)
.appendTo(selectHtml);
selectHtml += '</select>';
return 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>
</body>
</html>
Loading…
Cancel
Save