|
|
@ -22,13 +22,16 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">物料名称:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="materialName" class="form-control" type="text" readonly> |
|
|
|
<select class="form-control" id="materialName" name="materialName" required> |
|
|
|
|
|
|
|
</select> |
|
|
|
<!-- <input name="materialName" class="form-control" type="text" readonly>--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">物料类型:</label> |
|
|
|
<label class="col-sm-3 control-label is-required">物料类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
|
|
|
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required> |
|
|
|
<optgroup> |
|
|
|
<option value=""></option> |
|
|
|
</optgroup> |
|
|
@ -39,9 +42,9 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">加工方式:</label> |
|
|
|
<label class="col-sm-3 control-label is-required">加工方式:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> |
|
|
|
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required> |
|
|
|
<option value="" ></option> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
|
|
</select> |
|
|
@ -68,6 +71,14 @@ |
|
|
|
<textarea name="describe" class="form-control" readonly></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">工程员:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input type="text" name="createBy" class="form-control" readonly /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<div class="btn-group-sm" id="toolbar" role="group"> |
|
|
|
<a class="btn btn-success" onclick="insertRow()"> |
|
|
@ -162,8 +173,61 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#materialNo').on('select2:select', function (e) { |
|
|
|
debugger |
|
|
|
// debugger |
|
|
|
var data = e.params.data; |
|
|
|
$("#materialName").val(data.materialName).select2("trigger", "select", { |
|
|
|
data: { id: data.materialName, text: data.materialName } |
|
|
|
}) |
|
|
|
$("input[name='brand']").val(data.brand); |
|
|
|
$("textarea[name='describe']").val(data.describe); |
|
|
|
$("#selectMaterialType").val([data.materialType]).trigger("change"); |
|
|
|
$("#selectProcessMethod").val([data.processMethod]).trigger("change"); |
|
|
|
$("#selectUnit").val([data.unit]).trigger("change"); |
|
|
|
}); |
|
|
|
//todo 物料名称下拉框 |
|
|
|
$("#materialName").select2({ |
|
|
|
theme: "bootstrap", |
|
|
|
allowClear: true, |
|
|
|
placeholder: "请选择一个料号名称", |
|
|
|
ajax:{ |
|
|
|
type: "get", |
|
|
|
url:ctx + "erp/material/getMaterialSelList", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
data:function(params){ |
|
|
|
var searchVal = params.term; |
|
|
|
var obj = { |
|
|
|
keyword: searchVal |
|
|
|
}; |
|
|
|
return obj; |
|
|
|
}, |
|
|
|
cache:true, |
|
|
|
processResults: function (res, params) { |
|
|
|
var options = []; |
|
|
|
if(res.code==0){ |
|
|
|
var resultList = res.data; |
|
|
|
console.log(resultList); |
|
|
|
for(var i= 0, len=resultList.length;i<len;i++){ |
|
|
|
var option = resultList[i]; |
|
|
|
option.id = resultList[i]["materialNo"]; |
|
|
|
option.text = resultList[i]["materialName"]; |
|
|
|
options.push(option); |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
results: options |
|
|
|
}; |
|
|
|
}, |
|
|
|
escapeMarkup: function (markup) { return markup; }, |
|
|
|
minimumInputLength: 1 |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#materialName').on('select2:select', function (e) { |
|
|
|
// debugger |
|
|
|
var data = e.params.data; |
|
|
|
$("#materialNo").val(data.materialNo).select2("trigger", "select", { |
|
|
|
data: { id: data.materialNo, text: data.materialNo } |
|
|
|
}); |
|
|
|
$("input[name='materialName']").val(data.materialName); |
|
|
|
$("input[name='brand']").val(data.brand); |
|
|
|
$("textarea[name='describe']").val(data.describe); |
|
|
|