Browse Source

[fix]物料类型改为必选项不能为空,关联料号改为不可修改。BOM添加时物料名称改为下拉选择框,损耗率改为百分比标题,物料信息添加了工程员字段

dev
zhangsiqi 9 months ago
parent
commit
90c5ce0e1f
  1. 76
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html
  2. 14
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  3. 12
      ruoyi-admin/src/main/resources/templates/erp/material/add.html

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

@ -22,13 +22,16 @@
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8">
<input name="materialName" class="form-control" type="text" readonly>
<select class="form-control" id="materialName" name="materialName" required>
</select>
<!-- <input name="materialName" class="form-control" type="text" readonly>-->
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<label class="col-sm-3 control-label is-required">物料类型:</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')}">
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required>
<optgroup>
<option value=""></option>
</optgroup>
@ -39,9 +42,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">加工方式:</label>
<label class="col-sm-3 control-label is-required">加工方式:</label>
<div class="col-sm-8">
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required>
<option value="" ></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
@ -68,6 +71,14 @@
<textarea name="describe" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<input type="text" name="createBy" class="form-control" readonly />
</div>
</div>
</form>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="insertRow()">
@ -162,8 +173,61 @@
}
});
$('#materialNo').on('select2:select', function (e) {
debugger
// debugger
var data = e.params.data;
$("#materialName").val(data.materialName).select2("trigger", "select", {
data: { id: data.materialName, text: 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");
});
//todo 物料名称下拉框
$("#materialName").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择一个料号名称",
ajax:{
type: "get",
url:ctx + "erp/material/getMaterialSelList",
dataType:"json",
delay:250,
data:function(params){
var searchVal = params.term;
var obj = {
keyword: searchVal
};
return obj;
},
cache:true,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.data;
console.log(resultList);
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["materialNo"];
option.text = resultList[i]["materialName"];
options.push(option);
}
}
return {
results: options
};
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 1
}
});
$('#materialName').on('select2:select', function (e) {
// debugger
var data = e.params.data;
$("#materialNo").val(data.materialNo).select2("trigger", "select", {
data: { id: data.materialNo, text: data.materialNo }
});
$("input[name='materialName']").val(data.materialName);
$("input[name='brand']").val(data.brand);
$("textarea[name='describe']").val(data.describe);

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

@ -65,6 +65,7 @@
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>反向BOM</a>
</li>
</ul>
</div>
@ -161,6 +162,17 @@
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
field: 'createBy',
title: '工程员',
formatter: function(value, row, index) {
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'bomNo',
title: 'bom号',
@ -568,7 +580,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value + "%";
}
}
},

12
ruoyi-admin/src/main/resources/templates/erp/material/add.html

@ -56,9 +56,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required>
<optgroup>
<option value="">请选择</option>
</optgroup>
@ -70,9 +70,9 @@
<input type="text" id="materialType" name="materialType" hidden />
</div>
<div class="form-group">
<label class="col-sm-3 control-label">加工方式:</label>
<label class="col-sm-3 control-label is-required">加工方式:</label>
<div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
@ -98,9 +98,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库部门:</label>
<label class="col-sm-3 control-label is-required">入库部门:</label>
<div class="col-sm-8">
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}">
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>

Loading…
Cancel
Save