|
|
@ -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> |