|
@ -23,7 +23,7 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-3 control-label is-required">物料类型:</label> |
|
|
<label class="col-sm-3 control-label is-required">物料类型:</label> |
|
|
<div class="col-sm-8"> |
|
|
<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}"> |
|
|
<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> |
|
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
|
|
</optgroup> |
|
|
</optgroup> |
|
@ -177,6 +177,8 @@ |
|
|
var prefix = ctx + "erp/material"; |
|
|
var prefix = ctx + "erp/material"; |
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
|
|
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
|
|
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
|
|
|
|
|
//获取工程员 |
|
|
//获取工程员 |
|
|
$(function(){ |
|
|
$(function(){ |
|
|
var options = { |
|
|
var options = { |
|
@ -228,18 +230,26 @@ |
|
|
$("#add-process").hide(); |
|
|
$("#add-process").hide(); |
|
|
$("#materialNo").on('input', function (event) { |
|
|
$("#materialNo").on('input', function (event) { |
|
|
var value = $(this).val(); |
|
|
var value = $(this).val(); |
|
|
|
|
|
reloadSelections(); |
|
|
// 检查输入是否为空 |
|
|
// 检查输入是否为空 |
|
|
if (value) { |
|
|
if (value) { |
|
|
// 截取第一个字符 |
|
|
// 截取第一个字符 |
|
|
var firstChar = value.charAt(0); |
|
|
var firstChar = value.charAt(0); |
|
|
if (firstChar >= '1' && firstChar <= '9') { |
|
|
if (firstChar >= '1' && firstChar <= '9') { |
|
|
var materialType; |
|
|
var materialType; |
|
|
|
|
|
var $processMethodSelect = $("select[name='processMethod']"); |
|
|
switch (firstChar) { |
|
|
switch (firstChar) { |
|
|
case '1': |
|
|
case '1': |
|
|
materialType = 'jgmpyl'; |
|
|
materialType = 'jgmpyl'; |
|
|
|
|
|
$processMethodSelect.find('option[value="1"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="2"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="3"]').remove(); |
|
|
break; |
|
|
break; |
|
|
case '2': |
|
|
case '2': |
|
|
materialType = 'bzjgj'; |
|
|
materialType = 'bzjgj'; |
|
|
|
|
|
$processMethodSelect.find('option[value="1"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="2"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="3"]').remove(); |
|
|
break; |
|
|
break; |
|
|
case '3': |
|
|
case '3': |
|
|
materialType = 'scy'; |
|
|
materialType = 'scy'; |
|
@ -249,9 +259,13 @@ |
|
|
break; |
|
|
break; |
|
|
case '5': |
|
|
case '5': |
|
|
materialType = 'dbmcljgj'; |
|
|
materialType = 'dbmcljgj'; |
|
|
|
|
|
$processMethodSelect.find('option[value="1"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="3"]').remove(); |
|
|
break; |
|
|
break; |
|
|
case '6': |
|
|
case '6': |
|
|
materialType = 'lj'; |
|
|
materialType = 'lj'; |
|
|
|
|
|
$processMethodSelect.find('option[value="1"]').remove(); |
|
|
|
|
|
$processMethodSelect.find('option[value="3"]').remove(); |
|
|
break; |
|
|
break; |
|
|
case '7': |
|
|
case '7': |
|
|
materialType = 'zhj'; |
|
|
materialType = 'zhj'; |
|
@ -260,7 +274,7 @@ |
|
|
materialType = 'chcpsb'; |
|
|
materialType = 'chcpsb'; |
|
|
break; |
|
|
break; |
|
|
case '9': |
|
|
case '9': |
|
|
materialType = 'qt'; |
|
|
materialType = 'qtyflswl'; |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
materialType = ''; // 默认情况下不设置 |
|
|
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(){ |
|
|
function engineer(){ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
@ -468,40 +488,40 @@ |
|
|
// 数字7开头的为半成品-组合件; |
|
|
// 数字7开头的为半成品-组合件; |
|
|
// 数宇8开头的为成品: |
|
|
// 数宇8开头的为成品: |
|
|
// 缴字9开头的为其它 |
|
|
// 缴字9开头的为其它 |
|
|
$("#materialNo").on("change", function () { |
|
|
// $("#materialNo").on("change", function () { |
|
|
var val = $(this).val(); |
|
|
// var val = $(this).val(); |
|
|
if (val.length == 10) { |
|
|
// if (val.length == 10) { |
|
|
switch (val.substring(0, 1)) { |
|
|
// switch (val.substring(0, 1)) { |
|
|
case '1': |
|
|
// case '1': |
|
|
$("#selectMaterialType").val("jgmpyl").trigger("change"); |
|
|
// $("#selectMaterialType").val("jgmpyl").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '2': |
|
|
// case '2': |
|
|
$("#selectMaterialType").val("bzjgj").trigger("change"); |
|
|
// $("#selectMaterialType").val("bzjgj").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '3': |
|
|
// case '3': |
|
|
$("#selectMaterialType").val("scy").trigger("change"); |
|
|
// $("#selectMaterialType").val("scy").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '4': |
|
|
// case '4': |
|
|
$("#selectMaterialType").val("fscy").trigger("change"); |
|
|
// $("#selectMaterialType").val("fscy").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '5': |
|
|
// case '5': |
|
|
$("#selectMaterialType").val("dbmcljgj").trigger("change"); |
|
|
// $("#selectMaterialType").val("dbmcljgj").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '6': |
|
|
// case '6': |
|
|
$("#selectMaterialType").val("lj").trigger("change"); |
|
|
// $("#selectMaterialType").val("lj").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '7': |
|
|
// case '7': |
|
|
$("#selectMaterialType").val("zhj").trigger("change"); |
|
|
// $("#selectMaterialType").val("zhj").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '8': |
|
|
// case '8': |
|
|
$("#selectMaterialType").val("chcpsb").trigger("change"); |
|
|
// $("#selectMaterialType").val("chcpsb").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
case '9': |
|
|
// case '9': |
|
|
$("#selectMaterialType").val("qt").trigger("change"); |
|
|
// $("#selectMaterialType").val("qtyflswl").trigger("change"); |
|
|
break; |
|
|
// break; |
|
|
} |
|
|
// } |
|
|
} |
|
|
// } |
|
|
}); |
|
|
// }); |
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |