From 203d8ab09fb972e62f5a0b4f6d120d9d7c22584a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Wed, 23 Oct 2024 10:37:50 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2=E6=96=99=E5=8F=B7=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E7=9B=91=E5=90=AC=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=BE=93=E5=85=A5=E7=AC=AC=E4=B8=80=E4=BD=8D?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E8=AE=BE=E7=BD=AE=E5=8A=A0=E5=B7=A5=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E6=8B=89=E6=A1=86=E9=80=89=E9=A1=B9=EF=BC=9B?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E6=96=B9=E5=BC=8F=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=96=B9=E6=B3=95=EF=BC=9B=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=89=A9=E6=96=99=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E4=B8=BAdisabled=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/erp/material/add.html | 92 +++++++++++-------- .../templates/erp/material/detail.html | 8 +- 2 files changed, 60 insertions(+), 40 deletions(-) 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 @@
-