|
|
@ -28,8 +28,7 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">物料类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<!-- <input name="materialType" class="form-control" readonly />--> |
|
|
|
<select disabled id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" readonly> |
|
|
|
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
|
|
|
<optgroup> |
|
|
|
<option value=""></option> |
|
|
|
</optgroup> |
|
|
@ -38,13 +37,11 @@ |
|
|
|
</optgroup> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<input type="text" readonly id="materialType" name="materialType" hidden /> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">加工方式:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<!-- <input name="processMethod" class="form-control" type="text" readonly/>--> |
|
|
|
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" readonly> |
|
|
|
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> |
|
|
|
<option value="" ></option> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
|
|
</select> |
|
|
@ -53,8 +50,7 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">单位:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<!-- <input name="unit" class="form-control" type="text" readonly/>--> |
|
|
|
<select disabled id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" readonly> |
|
|
|
<select disabled id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> |
|
|
|
<option value=""></option> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
|
|
</select> |
|
|
@ -166,6 +162,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#materialNo').on('select2:select', function (e) { |
|
|
|
debugger |
|
|
|
var data = e.params.data; |
|
|
|
$("input[name='materialName']").val(data.materialName); |
|
|
|
$("input[name='brand']").val(data.brand); |
|
|
@ -342,12 +339,18 @@ |
|
|
|
};*/ |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
$("#selectMaterialType").removeAttr("disabled"); |
|
|
|
$("#selectProcessMethod").removeAttr("disabled"); |
|
|
|
$("#selectUnit").removeAttr("disabled"); |
|
|
|
var formData = $("#form-bom-add").serializeArray(); |
|
|
|
console.log("formData",formData); |
|
|
|
var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData'); |
|
|
|
console.log("tableData",JSON.stringify(tableData)) |
|
|
|
var rows = tableData.length; |
|
|
|
if(rows==0){ |
|
|
|
$("#selectMaterialType").attr("disabled","disabled"); |
|
|
|
$("#selectProcessMethod").attr("disabled","disabled"); |
|
|
|
$("#selectUnit").attr("disabled","disabled"); |
|
|
|
$.modal.alertWarning("子表数据不能为空!"); |
|
|
|
}else{ |
|
|
|
formData.push({"name": "erpBomList", "value": tableData}); |
|
|
|