|
@ -69,7 +69,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 name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" required> |
|
|
<select id="selectWarehouseDept" name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" required> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
@ -77,7 +77,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"> |
|
|
<input name="businessMembers" id="businessMembers_add" class="form-control m-b" disabled required /> |
|
|
<input name="businessMembers" id="businessMembers_add" class="form-control m-b" readonly required /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
@ -164,27 +164,10 @@ |
|
|
//获取工程员 |
|
|
//获取工程员 |
|
|
$(function(){ |
|
|
$(function(){ |
|
|
$("#businessMembers_add").val(loginName); |
|
|
$("#businessMembers_add").val(loginName); |
|
|
$("#businessMembers_add").text(userName); |
|
|
|
|
|
supplierName(); |
|
|
|
|
|
engineer(); |
|
|
engineer(); |
|
|
$("#add-weiwai").hide(); |
|
|
$("#add-weiwai").hide(); |
|
|
}) |
|
|
}) |
|
|
//获取供应商 |
|
|
|
|
|
function supplierName(){ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: ctx + 'system/supplier/getSupplier', |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
if (res.rows.length > 0) { |
|
|
|
|
|
var usertData = res.rows; |
|
|
|
|
|
for (let i in usertData) { |
|
|
|
|
|
$("#form-material-add select[name='supplierName']").append( |
|
|
|
|
|
"<option value='" + usertData[i].supplierName + "'>" + usertData[i].supplierName + "</option>"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
function engineer(){ |
|
|
function engineer(){ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
|
url: ctx + 'erp/material/getEngineerList', |
|
@ -194,7 +177,7 @@ |
|
|
var usertData = res.rows; |
|
|
var usertData = res.rows; |
|
|
for (let i in usertData) { |
|
|
for (let i in usertData) { |
|
|
$("select[name='businessMembers']").append( |
|
|
$("select[name='businessMembers']").append( |
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>"); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$.modal.msgError(res.msg); |
|
|
$.modal.msgError(res.msg); |
|
@ -255,6 +238,10 @@ |
|
|
|
|
|
|
|
|
function submitHandler() { |
|
|
function submitHandler() { |
|
|
if ($.validate.form()) { |
|
|
if ($.validate.form()) { |
|
|
|
|
|
$("#selectMaterialType").removeAttr("disabled"); |
|
|
|
|
|
$("#selectProcessMethod").removeAttr("disabled"); |
|
|
|
|
|
$("#selectUnit").removeAttr("disabled"); |
|
|
|
|
|
$("#selectWarehouseDept").removeAttr("disabled"); |
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
$('#materialType').val(materialType); |
|
|
$('#materialType').val(materialType); |
|
|
$.operate.save(prefix + "/add", $('#form-material-add').serialize()); |
|
|
$.operate.save(prefix + "/add", $('#form-material-add').serialize()); |
|
|