Browse Source

[fix]工程模块,BOM信息详情信息添加无法编辑样式,bom信息的物料类型下拉框显示问题修改。

dev
zhangsiqi 8 months ago
parent
commit
941f834449
  1. 4
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  2. 89
      ruoyi-admin/src/main/resources/templates/erp/bom/detail.html
  3. 90
      ruoyi-admin/src/main/resources/templates/erp/bom/edit.html

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

@ -375,6 +375,8 @@
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{
actions.push('<a class="btn btn-default btn-xs" disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 已作废
if(row.useStatus=="2" && !row.restoreInstanceId){
@ -386,7 +388,7 @@
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName) || loginName == 'admin'){
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}

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

@ -25,10 +25,8 @@
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<select id="selectMaterialType" name = "materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<OPTGROUP>
<option value=""></option>
</OPTGROUP>
<select id="selectMaterialType" name = "materialType" class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" th:field="*{materialType}" disabled>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
@ -86,33 +84,13 @@
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/bom";
var materilaType1 = [[${erpBom.materialType}]];
$("select[name='materialType'] option[value='"+materilaType1+"']").attr("selected",true);
function selMaterialTb(){
var options = {
title: '物料选择',
url: ctx + "/erp/material/select",
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
var materilaType1 = [[${erpBom.materialType}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-bom-edit").validate({
focusCleanup: true
});
$("#form-bom-edit").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-bom-edit").serializeArray();
@ -133,64 +111,7 @@
}
$(function() {
$("#selectMaterialType").val(materilaType1).trigger("change");
// $("#selectMaterialType").val([erpBom.materialType]).trigger("change");
// $("#selectProcessMethod").val([erpBom.processMethod]).trigger("change");
// $("#selectUnit").val([erpBom.unit]).trigger("change");
$("#selMaterialNo").select2({
theme: "select2",
allowClear: true,
placeholder: "请选择一个料号",
ajax:{
type: "post",
url:ctx+"erp/material/list",
dataType:"json",
delay:250,
data:function(params){
var searchVal = params.term;
var obj = {
params:{
materialNo: searchVal
}
};
return obj;
/*return {
materialNo: params.term,
// page: params.page || 1
};*/
},
cache:true,
processResults: function (res, params) {
var resultList = res.rows;
var options = [];
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["materialNo"];
option.text = resultList[i]["materialNo"];
options.push(option);
}
return {
results: options,
pagination: {
// more:res["data"]["more"]
}
};
},
escapeMarkup: function (markup) { return markup; },
// minimumInputLength: 1
}
});
var materialNo = $("#materialNo").val();
$("#selMaterialNo").val([materialNo]).trigger("change");
$('#selMaterialNo').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='materialName']").val(data.materialName);
$("input[name='brand']").val(data.brand);
$("textarea[name='describe']").val(data.describe);
$("#selectMaterialType").val([data.materialType]).trigger("change");
$("#selectProcessMethod").val([data.processMethod]).trigger("change");
$("#selectUnit").val([data.unit]).trigger("change");
});
$("#selectMaterialType").val(materilaType1);
var options = {
url: prefix + "/oneLevelList",
id: 'bootstrap-sub-table-1',

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

@ -27,9 +27,6 @@
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<select disabled id="selectMaterialType" name = "materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup>
<option value=""></option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}" th:field="*{materialType}"></option>
</optgroup>
@ -88,7 +85,14 @@
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/bom";
// var erpBom = [[${erpBom}]];
var erpBom = [[${erpBom}]];
var materialType1 = [[${erpBom.materialType}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
$("#form-bom-edit").validate({ focusCleanup: true});
function selMaterialTb(){
var options = {
title: '物料选择',
@ -97,23 +101,12 @@
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-bom-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-bom-edit").serializeArray();
@ -134,66 +127,7 @@
}
$(function() {
// $("#selectMaterialType").val([erpBom.materialType]).trigger("change");
// $("#selectProcessMethod").val([erpBom.processMethod]).trigger("change");
// $("#selectUnit").val([erpBom.unit]).trigger("change");
$("#selMaterialNo").select2({
theme: "select2",
allowClear: true,
placeholder: "请选择一个料号",
ajax:{
type: "post",
url:ctx+"erp/material/list",
dataType:"json",
delay:250,
data:function(params){
var searchVal = params.term;
var obj = {
params:{
materialNo: searchVal
}
};
return obj;
/*return {
materialNo: params.term,
// page: params.page || 1
};*/
},
cache:true,
processResults: function (res, params) {
var resultList = res.rows;
var options = [];
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["materialNo"];
option.text = resultList[i]["materialNo"];
options.push(option);
}
return {
results: options,
pagination: {
// more:res["data"]["more"]
}
};
},
escapeMarkup: function (markup) { return markup; },
// minimumInputLength: 1
}
});
var materialNo = $("#materialNo").val();
$("#selMaterialNo").val([materialNo]).trigger("change");
$('#selMaterialNo').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='materialName']").val(data.materialName);
$("input[name='brand']").val(data.brand);
$("textarea[name='describe']").val(data.describe);
$("#selectMaterialType").val([data.materialType]).trigger("change");
$("#selectProcessMethod").val([data.processMethod]).trigger("change");
$("#selectUnit").val([data.unit]).trigger("change");
});
$("#selectMaterialType").val(materialType1);
var options = {
url: prefix + "/oneLevelList",
id: 'bootstrap-sub-table-1',
@ -317,7 +251,6 @@
]
};
$.table.init(options);
function optFormatter(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-search btn-xs optRow" href="javascript:void(0)"><i class="fa fa-search"></i>选择</a> ');
@ -338,8 +271,6 @@
curParams.parentId = $("#id").val();
return curParams;
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
@ -363,11 +294,8 @@
processMethod: rowData.processMethod,
}
})
layer.close(index);
}
/* 新增表格行 */
function insertRow(){
// var uuidStr = uuid();

Loading…
Cancel
Save