|
@ -12,21 +12,21 @@ |
|
|
<input name="bomNo" th:field="*{bomNo}" type="text" hidden> |
|
|
<input name="bomNo" th:field="*{bomNo}" type="text" hidden> |
|
|
<div class="form-group"> |
|
|
<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"> |
|
|
<div class="col-sm-8"> |
|
|
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly /> |
|
|
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly required/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<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"> |
|
|
<div class="col-sm-8"> |
|
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> |
|
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<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"> |
|
|
<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 required id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
|
|
<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)}" th:field="*{materialType}"></option> |
|
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}" th:field="*{materialType}"></option> |
|
|
</optgroup> |
|
|
</optgroup> |
|
@ -35,9 +35,9 @@ |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<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"> |
|
|
<div class="col-sm-8"> |
|
|
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> |
|
|
<select required id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> |
|
|
<option value=""></option> |
|
|
<option value=""></option> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
|
|
</select> |
|
|
</select> |
|
@ -46,7 +46,7 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-3 control-label">单位:</label> |
|
|
<label class="col-sm-3 control-label">单位:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<select disabled id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> |
|
|
<select id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> |
|
|
<option value=""></option> |
|
|
<option value=""></option> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
|
|
</select> |
|
|
</select> |
|
@ -56,20 +56,19 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-3 control-label">品牌:</label> |
|
|
<label class="col-sm-3 control-label">品牌:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly> |
|
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" > |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<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"> |
|
|
<div class="col-sm-8"> |
|
|
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> |
|
|
<textarea name="describe" class="form-control" required>[[*{describe}]]</textarea> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-3 control-label">工程员:</label> |
|
|
<label class="col-sm-3 control-label">工程员:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<select name="businessMembers" class="form-control"> |
|
|
<select name="businessMembers" class="form-control"> |
|
|
<option value="">请选择</option> |
|
|
|
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -125,6 +124,15 @@ |
|
|
if(rows==0){ |
|
|
if(rows==0){ |
|
|
$.modal.alertWarning("子表数据不能为空!"); |
|
|
$.modal.alertWarning("子表数据不能为空!"); |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
for(var i=0;i<tableData.length;i++){ |
|
|
|
|
|
if(tableData[i].useNum == null || tableData[i].useNum == ''){ |
|
|
|
|
|
$("#selectMaterialType").attr("disabled","disabled"); |
|
|
|
|
|
$("#selectProcessMethod").attr("disabled","disabled"); |
|
|
|
|
|
$("#selectUnit").attr("disabled","disabled"); |
|
|
|
|
|
$.modal.alertWarning("子表数据用量不能为空!"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
formData.push({"name": "erpBomList", "value": tableData}); |
|
|
formData.push({"name": "erpBomList", "value": tableData}); |
|
|
var jsonData = $.common.formDataToJson(formData); |
|
|
var jsonData = $.common.formDataToJson(formData); |
|
|
console.log("jsonData"); |
|
|
console.log("jsonData"); |
|
@ -133,7 +141,6 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$(function() { |
|
|
$(function() { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
@ -142,9 +149,10 @@ |
|
|
if (res.rows.length > 0) { |
|
|
if (res.rows.length > 0) { |
|
|
var usertData = res.rows; |
|
|
var usertData = res.rows; |
|
|
for (let i in usertData) { |
|
|
for (let i in usertData) { |
|
|
$("select[name='businessMembers']").append( |
|
|
$("#form-bom-edit select[name='businessMembers']").append( |
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
} |
|
|
} |
|
|
|
|
|
$("#form-bom-edit select[name='businessMembers']").val(erpBom.createBy); |
|
|
} else { |
|
|
} else { |
|
|
$.modal.msgError(res.msg); |
|
|
$.modal.msgError(res.msg); |
|
|
} |
|
|
} |
|
@ -235,6 +243,9 @@ |
|
|
if (isNaN(value)) { |
|
|
if (isNaN(value)) { |
|
|
return '用量必须为数字'; |
|
|
return '用量必须为数字'; |
|
|
} |
|
|
} |
|
|
|
|
|
if(value < 0){ |
|
|
|
|
|
return "输入数值不能小于0"; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -310,6 +321,18 @@ |
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|
|
console.log(rowData.materialName); |
|
|
console.log(rowData.materialName); |
|
|
|
|
|
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
|
|
|
|
|
if($("#materialNo").val()==rowData.materialNo){ |
|
|
|
|
|
$.modal.alertError("不能选择与主体bom相同的料号"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
for(var i=0;i<rows;i++){ |
|
|
|
|
|
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i]; |
|
|
|
|
|
if(data.materialNo==rowData.materialNo){ |
|
|
|
|
|
$.modal.alertError("不能选择已添加过的相同料号"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
var timestamp = new Date().getTime(); |
|
|
var timestamp = new Date().getTime(); |
|
|
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
|
|
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
|
|
$("#bootstrap-sub-table-1").bootstrapTable('insertRow', { |
|
|
$("#bootstrap-sub-table-1").bootstrapTable('insertRow', { |
|
|