|
|
@ -3,6 +3,7 @@ |
|
|
|
<head> |
|
|
|
<th:block th:include="include :: header('新增仓库库存报损')" /> |
|
|
|
<th:block th:include="include :: datetimepicker-css" /> |
|
|
|
<th:block th:include="include :: select2-css" /> |
|
|
|
</head> |
|
|
|
<body class="white-bg"> |
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
@ -16,36 +17,36 @@ |
|
|
|
<!-- </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="makeNo" class="form-control" type="text"> |
|
|
|
<input name="applyDept" 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"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|
|
|
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|
|
|
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
|
<div class="input-group date"> |
|
|
|
<input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required> |
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<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"> |
|
|
|
<input name="applyDept" class="form-control" type="text"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|
|
|
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|
|
|
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">申请时间:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<div class="input-group date"> |
|
|
|
<input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
|
|
</div> |
|
|
|
<div class="form-group" id="makeNoInput"> |
|
|
|
<label class="col-sm-3 control-label is-required">关联生产单号:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="makeNo" class="form-control" type="text" required> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<!-- <div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">料号:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="materialNo" class="form-control" type="text"> |
|
|
@ -68,17 +69,17 @@ |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="numTotal" class="form-control" type="text"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
</div> --> |
|
|
|
<div class="form-group is-required"> |
|
|
|
<label class="col-sm-3 control-label">仓库ID:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="warehouseCode" class="form-control" type="text"> |
|
|
|
<select id="stockNoSelct" name="warehouseCode" class="form-control" required></select> |
|
|
|
</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="warehouseName" class="form-control" type="text"> |
|
|
|
<input name="warehouseName" class="form-control" type="text" required> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -97,23 +98,84 @@ |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
|
<th:block th:include="include :: select2-js" /> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var prefix = ctx + "warehouse/inventoryReportDamage" |
|
|
|
$("#form-inventoryReportDamage-add").validate({ |
|
|
|
focusCleanup: true |
|
|
|
}); |
|
|
|
|
|
|
|
$("#form-inventoryReportDamage-add").validate({focusCleanup: true}); |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
$.operate.save(prefix + "/add", $('#form-inventoryReportDamage-add').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|
$(function () { |
|
|
|
loadWarehouseCodes(); |
|
|
|
changeWhetherMakeNo(); |
|
|
|
}); |
|
|
|
//单选改变是否关联生产单号显示关联生产单号输入框 |
|
|
|
$("input[name='whetherMakeNo']").change(function () { |
|
|
|
changeWhetherMakeNo(); |
|
|
|
}); |
|
|
|
|
|
|
|
//根据是否关联生产单号显示关联生产单号输入框 |
|
|
|
function changeWhetherMakeNo() { |
|
|
|
$("#makeNoInput").display = function () { |
|
|
|
var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val(); |
|
|
|
if (whetherMakeNo == 1) { |
|
|
|
$("#makeNoInput").show(); |
|
|
|
} else { |
|
|
|
$("#makeNoInput").hide(); |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
$("input[name='applyTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
function loadWarehouseCodes() { |
|
|
|
var url = ctx + 'stock/stockInfo/getAllWarehouseCode'; |
|
|
|
$("#stockNoSelct").select2({ |
|
|
|
ajax: { |
|
|
|
theme: "bootstrap", |
|
|
|
allowClear: true, |
|
|
|
placeholder: "请选择", |
|
|
|
type: 'GET', // 请求类型 |
|
|
|
url: url, // 后端接口URL |
|
|
|
dataType: 'json', // 预期服务器返回的数据类型 |
|
|
|
delay:250, |
|
|
|
timeout: 10000, // 设置超时时间为10秒 |
|
|
|
cache:true, |
|
|
|
data: function(params) { |
|
|
|
return { |
|
|
|
q: params.term, // 搜索关键词 |
|
|
|
// 当前页码 |
|
|
|
page: params.page || 1 , pageSize: 30 |
|
|
|
}; |
|
|
|
}, |
|
|
|
processResults: function(data, params) { |
|
|
|
params.page = params.page || 1; |
|
|
|
var options = []; |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
var option = {id: data[i].stockName, text: data[i].stockName,}; |
|
|
|
options.push(option); |
|
|
|
} |
|
|
|
var moreDataAvaliable = (params.page * 30) < data.total_count; |
|
|
|
return { |
|
|
|
// 实现下拉实现填入stockName |
|
|
|
results: options, |
|
|
|
pagination: {more: moreDataAvaliable,}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
escapeMarkup: function (markup) { return markup; }, |
|
|
|
minimumInputLength: 1 |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
$('#stockNoSelct').on('select2:select', function(e) { |
|
|
|
var data = e.params.data; |
|
|
|
$("input[name='warehouseCode']").val(data.stockNO); |
|
|
|
$("input[name='warehouseStoreAddress']").val(data.stockAddress); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |