Browse Source

[fix]

工程管理 物料信息
新增料号输入框监听函数,根据输入第一位数字自动跳转物料类型;
dev
王晓迪 1 month ago
parent
commit
cc0218f57c
  1. 48
      ruoyi-admin/src/main/resources/templates/erp/material/add.html

48
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(){

Loading…
Cancel
Save