Browse Source

[fix]

工程管理 物料信息
修改添加页面料号输入框监听函数,根据输入第一位数字设置加工方式下拉框选项;
新增重新加载加工方式下拉框选项方法;
修改物料详情页面下拉框为disabled;
dev
王晓迪 1 month ago
parent
commit
203d8ab09f
  1. 92
      ruoyi-admin/src/main/resources/templates/erp/material/add.html
  2. 8
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html

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

@ -23,7 +23,7 @@
<div class="form-group">
<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')}" required>
<select disabled id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required>
<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>
@ -177,6 +177,8 @@
var prefix = ctx + "erp/material";
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
//获取工程员
$(function(){
var options = {
@ -228,18 +230,26 @@
$("#add-process").hide();
$("#materialNo").on('input', function (event) {
var value = $(this).val();
reloadSelections();
// 检查输入是否为空
if (value) {
// 截取第一个字符
var firstChar = value.charAt(0);
if (firstChar >= '1' && firstChar <= '9') {
var materialType;
var $processMethodSelect = $("select[name='processMethod']");
switch (firstChar) {
case '1':
materialType = 'jgmpyl';
$processMethodSelect.find('option[value="1"]').remove();
$processMethodSelect.find('option[value="2"]').remove();
$processMethodSelect.find('option[value="3"]').remove();
break;
case '2':
materialType = 'bzjgj';
$processMethodSelect.find('option[value="1"]').remove();
$processMethodSelect.find('option[value="2"]').remove();
$processMethodSelect.find('option[value="3"]').remove();
break;
case '3':
materialType = 'scy';
@ -249,9 +259,13 @@
break;
case '5':
materialType = 'dbmcljgj';
$processMethodSelect.find('option[value="1"]').remove();
$processMethodSelect.find('option[value="3"]').remove();
break;
case '6':
materialType = 'lj';
$processMethodSelect.find('option[value="1"]').remove();
$processMethodSelect.find('option[value="3"]').remove();
break;
case '7':
materialType = 'zhj';
@ -260,7 +274,7 @@
materialType = 'chcpsb';
break;
case '9':
materialType = 'qt';
materialType = 'qtyflswl';
break;
default:
materialType = ''; // 默认情况下不设置
@ -276,6 +290,12 @@
})
function reloadSelections(){
$("select[name='processMethod']").empty();
processMethodDatas.forEach(function (process){
$("select[name='processMethod']").append('<option value="' + process.dictValue + '">' + process.dictLabel + '</option>');
})
}
function engineer(){
$.ajax({
url: ctx + 'erp/material/getEngineerList',
@ -468,40 +488,40 @@
// 数字7开头的为半成品-组合件;
// 数宇8开头的为成品:
// 缴字9开头的为其它
$("#materialNo").on("change", function () {
var val = $(this).val();
if (val.length == 10) {
switch (val.substring(0, 1)) {
case '1':
$("#selectMaterialType").val("jgmpyl").trigger("change");
break;
case '2':
$("#selectMaterialType").val("bzjgj").trigger("change");
break;
case '3':
$("#selectMaterialType").val("scy").trigger("change");
break;
case '4':
$("#selectMaterialType").val("fscy").trigger("change");
break;
case '5':
$("#selectMaterialType").val("dbmcljgj").trigger("change");
break;
case '6':
$("#selectMaterialType").val("lj").trigger("change");
break;
case '7':
$("#selectMaterialType").val("zhj").trigger("change");
break;
case '8':
$("#selectMaterialType").val("chcpsb").trigger("change");
break;
case '9':
$("#selectMaterialType").val("qt").trigger("change");
break;
}
}
});
// $("#materialNo").on("change", function () {
// var val = $(this).val();
// if (val.length == 10) {
// switch (val.substring(0, 1)) {
// case '1':
// $("#selectMaterialType").val("jgmpyl").trigger("change");
// break;
// case '2':
// $("#selectMaterialType").val("bzjgj").trigger("change");
// break;
// case '3':
// $("#selectMaterialType").val("scy").trigger("change");
// break;
// case '4':
// $("#selectMaterialType").val("fscy").trigger("change");
// break;
// case '5':
// $("#selectMaterialType").val("dbmcljgj").trigger("change");
// break;
// case '6':
// $("#selectMaterialType").val("lj").trigger("change");
// break;
// case '7':
// $("#selectMaterialType").val("zhj").trigger("change");
// break;
// case '8':
// $("#selectMaterialType").val("chcpsb").trigger("change");
// break;
// case '9':
// $("#selectMaterialType").val("qtyflswl").trigger("change");
// break;
// }
// }
// });
</script>
</body>
</html>

8
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -24,7 +24,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<select readonly id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<select disabled readonly id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup>
<option value="">请选择</option>
</optgroup>
@ -38,7 +38,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">加工方式:</label>
<div class="col-sm-8">
<select readonly name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<select disabled readonly name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select>
</div>
@ -46,7 +46,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8">
<select readonly name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<select disabled readonly name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select>
</div>
@ -66,7 +66,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">入库部门:</label>
<div class="col-sm-8">
<select readonly name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}">
<select disabled readonly name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option>
</select>
</div>

Loading…
Cancel
Save