|
|
@ -10,21 +10,21 @@ |
|
|
|
<form class="form-horizontal m" id="form-material-edit" th:object="${erpMaterial}"> |
|
|
|
<input name="id" th:field="*{id}" type="hidden"> |
|
|
|
<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"> |
|
|
|
<input readonly id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text"> |
|
|
|
<input readonly id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" required /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">物料名称:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text"> |
|
|
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">物料类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
|
|
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
|
|
|
<optgroup> |
|
|
|
<option value="">请选择</option> |
|
|
|
</optgroup> |
|
|
@ -39,7 +39,7 @@ |
|
|
|
<label class="col-sm-3 control-label is-required">半成品类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="processMethod" class="form-control m-b" th:field="*{processMethod}" th:with="type=${@dict.getType('processMethod')}" required> |
|
|
|
<option value=""></option> |
|
|
|
<option value="">未选择</option> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
@ -62,22 +62,22 @@ |
|
|
|
</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"> |
|
|
|
<input name="brand" th:field="*{brand}" class="form-control" type="text"> |
|
|
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" required/> |
|
|
|
</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"> |
|
|
|
<textarea name="describe" class="form-control">[[*{describe}]]</textarea> |
|
|
|
<textarea name="describe" class="form-control" required>[[*{describe}]]</textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">入库部门:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="warehouseDept" class="form-control m-b" th:field="*{warehouseDept}" th:with="type=${@dict.getType('warehouseDept')}"> |
|
|
|
<option value=""></option> |
|
|
|
<option value="">未选择</option> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
@ -86,7 +86,7 @@ |
|
|
|
<label class="col-sm-3 control-label">工程员:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="businessMembers" th:field="*{businessMembers}" id="businessMembers_edit" class="form-control m-b" required > |
|
|
|
<option value=""> </option> |
|
|
|
<option value="">未选择</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -106,9 +106,9 @@ |
|
|
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
<input id="photoAttachId" name = "photoAttachId" hidden th:field="*{photoAttachId}"> |
|
|
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden> |
|
|
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden> |
|
|
|
<input id="photoAttachId" name = "photoAttachId" hidden th:field="*{photoAttachId}" /> |
|
|
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden /> |
|
|
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden /> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
@ -131,11 +131,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
// 控制下拉框选中 |
|
|
|
var materialType = $("#materialType").val(); |
|
|
|
$("#selectMaterialType").val(materialType).trigger("change"); |
|
|
|
|
|
|
|
var that = this; |
|
|
|
// 页面渲染完成,可以执行需要的操作 |
|
|
|
console.log('页面已渲染完成'); |
|
|
@ -220,7 +216,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
var prefix = ctx + "erp/material"; |
|
|
|
$("#form-material-edit").validate({ |
|
|
|
onkeyup: false, |
|
|
@ -255,6 +251,8 @@ |
|
|
|
focusCleanup: true |
|
|
|
}); |
|
|
|
$(function(){ |
|
|
|
var materialType = $("#materialType").val(); |
|
|
|
$("#selectMaterialType").val(materialType).trigger("change"); |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'erp/material/getEngineerList', |
|
|
|
type: 'get', |
|
|
@ -271,7 +269,8 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
var materialType = $("#materialType").val(); |
|
|
|
$("#selectMaterialType").val(materialType).trigger("change"); |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
|