From cc0218f57c44340dbb200d57501e28383106bc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Tue, 22 Oct 2024 15:19:10 +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=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=96=99=E5=8F=B7=E8=BE=93=E5=85=A5=E6=A1=86=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E6=A0=B9=E6=8D=AE=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=BD=8D=E6=95=B0=E5=AD=97=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E7=89=A9=E6=96=99=E7=B1=BB=E5=9E=8B=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/erp/material/add.html | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) 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 713bbd0a..2de03749 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/add.html @@ -226,6 +226,54 @@ engineer(); $("#add-process-text").hide(); $("#add-process").hide(); + $("#materialNo").on('input', function (event) { + var value = $(this).val(); + // 检查输入是否为空 + if (value) { + // 截取第一个字符 + var firstChar = value.charAt(0); + if (firstChar >= '1' && firstChar <= '9') { + var materialType; + switch (firstChar) { + case '1': + materialType = 'jgmpyl'; + break; + case '2': + materialType = 'bzjgj'; + break; + case '3': + materialType = 'scy'; + break; + case '4': + materialType = 'fscy'; + break; + case '5': + materialType = 'dbmcljgj'; + break; + case '6': + materialType = 'lj'; + break; + case '7': + materialType = 'zhj'; + break; + case '8': + materialType = 'chcpsb'; + break; + case '9': + materialType = 'qt'; + break; + default: + materialType = ''; // 默认情况下不设置 + break; + } + $("#selectMaterialType").val(materialType).trigger('change'); + } + } else { + // 如果输入框为空,清空下拉框的值 + $("#selectMaterialType").val('').trigger('change'); + } + }); + }) function engineer(){