diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/add.html b/ruoyi-admin/src/main/resources/templates/erp/material/add.html index 2de03749..624b9e16 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/add.html @@ -23,7 +23,7 @@
- @@ -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(''); + }) + } 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; + // } + // } + // }); \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/detail.html b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html index fe1dd693..3174a8ba 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/detail.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html @@ -24,7 +24,7 @@
- @@ -38,7 +38,7 @@
-
@@ -46,7 +46,7 @@
-
@@ -66,7 +66,7 @@
-