Browse Source

修改:仓库库存查询,修改库存信息中仓库名字段修改为仓库名下拉列表。下列列表选择完成后需要把对弈仓库名中的仓库ID

修改:仓库库存盘点,修改库存信息中仓库名字段修改为仓库名下拉列表。修改库存信息中仓库名字段修改为仓库名下拉列表。下列列表选择完成后需要把对弈仓库名中的仓库ID。新增页面添加仓库盘点人默认为当前登录账号的登录名。
dev
zhangsiqi 3 months ago
parent
commit
1d4ce029e2
  1. 137
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html
  2. 113
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/detail.html
  3. 140
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html
  4. 2
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/add.html
  5. 8
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html
  6. 21
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html
  7. 110
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html

137
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html

@ -10,21 +10,24 @@
<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="inventoryCheckName" class="form-control" type="text"> <input name="inventoryCheckName" class="form-control" type="text" readonly />
</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">
<input name="warehouseCode" class="form-control" type="text"> <select id="stockName" name="warehouseName" class="form-control">
<option value="">请选择仓库名称</option>
</select>
</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">
<input name="warehouseName" class="form-control" type="text"> <input id="stockNO" name="warehouseCode" 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">库存盘点日期:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -64,10 +67,9 @@
<!--用于可以修改列表字段的插件--> <!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "warehouse/inventoryCheck" var prefix = ctx + "warehouse/inventoryCheck"
$("#form-inventoryCheck-add").validate({ $("#form-inventoryCheck-add").validate({focusCleanup: true});
focusCleanup: true
});
$("input[name='inventoryCheckDate']").datetimepicker({ $("input[name='inventoryCheckDate']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
@ -143,58 +145,19 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false {checkbox: false},
}, {title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false},
{ {title: '料号', field: 'materialNo',},
title: '库存盘点详情ID', {title: '物料名称', field: 'materialName',},
field: 'inventoryCheckDetailId', {title: '物料单位', field: 'materialUnit',},
visible: false {title: '物料描述', field: 'materialDescribe',},
}, {title: '盘点数量', field: 'inventoryCheckNum', editable:true},
{ {title: '当时库存账上数量', field: 'inventoryAccountNum', editable:true},
title: '料号', {title: '存放地址', field: 'warehouseStoreAddress', editable:true},
field: 'materialNo', {title: '批号', field: 'batchNumber', editable:true},
}, {title: '说明', field: 'remark', editable:true},
{ {title: '操作', align: 'center',
title: '物料名称',
field: 'materialName',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '盘点数量',
field: 'inventoryCheckNum',
editable:true
},
{
title: '当时库存账上数量',
field: 'inventoryAccountNum',
editable:true
},
{
title: '存放地址',
field: 'warehouseStoreAddress',
editable:true
},
{
title: '批号',
field: 'batchNumber',
editable:true
},
{
title: '说明',
field: 'remark',
editable:true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> ');
@ -204,9 +167,10 @@
] ]
}; };
$.table.init(options); $.table.init(options);
loadWarehouseCodes();
$("input[name='inventoryCheckName']").value(loginName);
}) })
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
console.log(uniqueId); console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
@ -231,13 +195,54 @@
// 逻辑删除前端的一行数据 // 逻辑删除前端的一行数据
function removeRow(materialNo){ function removeRow(materialNo){
$("#bootstrap-table").bootstrapTable('remove', { $("#bootstrap-table").bootstrapTable('remove', {field: 'materialNo', values: materialNo})
field: 'materialNo',
values: materialNo
})
} }
function loadWarehouseCodes() {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$("#stockName").select2({
ajax: {
theme: "bootstrap",
allowClear: true,
placeholder: "请选择一个料号",
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
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,
title: data[i].stockNO
};
options.push(option);
}
var moreDataAvaliable = (params.page * 30) < data.total_count;
return {
// 实现下拉实现填入stockName
results: options,
pagination: {
more: moreDataAvaliable // 是否还有更多数据
}
};
}
}
});
}
$('#stockName').on('select2:select', function(e) {
var data = e.params.data;
$("input[name='warehouseCode']").val(data.title);
});
</script> </script>
</body> </body>
</html> </html>

113
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/detail.html

@ -21,15 +21,17 @@
</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">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" disabled> <select id="stockName" name="warehouseName" class="form-control" th:field="*{warehouseName}" disabled />
<option value="">请选择仓库名称</option>
</select>
</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">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" disabled> <input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" disabled/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -147,53 +149,22 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false {checkbox: false},
}, {title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false},
{ {title: '料号', field: 'materialNo',},
title: '库存盘点详情ID', {title: '物料名称', field: 'materialName',},
field: 'inventoryCheckDetailId', {title: '物料单位', field: 'materialUnit',},
visible: false {title: '物料描述', field: 'materialDescribe',},
}, {title: '盘点数量', field: 'inventoryCheckNum',},
{ {title: '当时库存账上数量', field: 'inventoryAccountNum',},
title: '料号', {title: '存放地址', field: 'warehouseStoreAddress',},
field: 'materialNo', {title: '批号', field: 'batchNumber',},
}, {title: '说明', field: 'remark',},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '盘点数量',
field: 'inventoryCheckNum',
},
{
title: '当时库存账上数量',
field: 'inventoryAccountNum',
},
{
title: '存放地址',
field: 'warehouseStoreAddress',
},
{
title: '批号',
field: 'batchNumber',
},
{
title: '说明',
field: 'remark',
},
] ]
}; };
$.table.init(options); $.table.init(options);
loadWarehouseCodes();
}) })
function queryParams(params) { function queryParams(params) {
@ -235,7 +206,51 @@
values: materialNo values: materialNo
}) })
} }
function loadWarehouseCodes() {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$("#stockName").select2({
ajax: {
theme: "bootstrap",
allowClear: true,
placeholder: "请选择一个料号",
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
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,
title: data[i].stockNO
};
options.push(option);
}
var moreDataAvaliable = (params.page * 30) < data.total_count;
return {
// 实现下拉实现填入stockName
results: options,
pagination: {
more: moreDataAvaliable // 是否还有更多数据
}
};
}
}
});
}
$('#stockName').on('select2:select', function(e) {
var data = e.params.data;
$("input[name='warehouseCode']").val(data.title);
});
</script> </script>
</body> </body>

140
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html

@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('修改仓库库存盘点')" /> <th:block th:include="include :: header('修改仓库库存盘点')" />
<th:block th:include="include :: datetimepicker-css" /> <th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -21,15 +22,17 @@
</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">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text"> <select id="stockName" name="warehouseName" class="form-control" th:field="*{warehouseName}" />
<option value="">请选择仓库名称</option>
</select>
</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">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text"> <input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -70,21 +73,17 @@
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件--> <!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "warehouse/inventoryCheck"; var prefix = ctx + "warehouse/inventoryCheck";
var warehouseInventoryCheck = [[${warehouseInventoryCheck}]]; var warehouseInventoryCheck = [[${warehouseInventoryCheck}]];
$("#form-inventoryCheck-edit").validate({focusCleanup: true});
$("#form-inventoryCheck-edit").validate({
focusCleanup: true
});
$("input[name='inventoryCheckDate']").datetimepicker({ $("input[name='inventoryCheckDate']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
// 新增提交 // 新增提交
function submitHandler() { function submitHandler() {
// 获取表单数据 // 获取表单数据
@ -129,9 +128,6 @@
$.operate.saveJson(prefix + "/edit", jsonData); $.operate.saveJson(prefix + "/edit", jsonData);
} }
//添加物料信息 //添加物料信息
function insertRow() { function insertRow() {
var url = ctx + 'warehouse/inventoryCheck/materialSelect'; var url = ctx + 'warehouse/inventoryCheck/materialSelect';
@ -155,58 +151,19 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false {checkbox: false},
}, {title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false},
{ {title: '料号', field: 'materialNo',},
title: '库存盘点详情ID', {title: '物料名称', field: 'materialName',},
field: 'inventoryCheckDetailId', {title: '物料单位', field: 'materialUnit',},
visible: false {title: '物料描述', field: 'materialDescribe',},
}, {title: '盘点数量', field: 'inventoryCheckNum', editable:true},
{ {title: '当时库存账上数量', field: 'inventoryAccountNum', editable:true},
title: '料号', {title: '存放地址', field: 'warehouseStoreAddress', editable:true},
field: 'materialNo', {title: '批号', field: 'batchNumber', editable:true},
}, {title: '说明', field: 'remark', editable:true},
{ {title: '操作', align: 'center',
title: '物料名称',
field: 'materialName',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '盘点数量',
field: 'inventoryCheckNum',
editable:true
},
{
title: '当时库存账上数量',
field: 'inventoryAccountNum',
editable:true
},
{
title: '存放地址',
field: 'warehouseStoreAddress',
editable:true
},
{
title: '批号',
field: 'batchNumber',
editable:true
},
{
title: '说明',
field: 'remark',
editable:true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> ');
@ -216,6 +173,7 @@
] ]
}; };
$.table.init(options); $.table.init(options);
loadWarehouseCodes();
}) })
function queryParams(params) { function queryParams(params) {
@ -226,8 +184,6 @@
console.log(curParams); console.log(curParams);
return curParams; return curParams;
} }
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
console.log(uniqueId); console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
@ -249,7 +205,6 @@
}) })
layer.close(index); layer.close(index);
} }
// 逻辑删除前端的一行数据 // 逻辑删除前端的一行数据
function removeRow(materialNo){ function removeRow(materialNo){
$("#bootstrap-table").bootstrapTable('remove', { $("#bootstrap-table").bootstrapTable('remove', {
@ -257,7 +212,52 @@
values: materialNo values: materialNo
}) })
} }
// 加载仓库Id列表函数
function loadWarehouseCodes() {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$("#stockName").select2({
ajax: {
theme: "bootstrap",
allowClear: true,
placeholder: "请选择一个料号",
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
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,
title: data[i].stockNO
};
options.push(option);
}
var moreDataAvaliable = (params.page * 30) < data.total_count;
return {
// 实现下拉实现填入stockName
results: options,
pagination: {
more: moreDataAvaliable // 是否还有更多数据
}
};
}
}
});
}
$('#stockName').on('select2:select', function(e) {
var data = e.params.data;
$("input[name='warehouseCode']").val(data.title);
});
</script> </script>
</body> </body>

2
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/add.html

@ -124,12 +124,12 @@
$("#form-inventoryInquiry-add").validate({ $("#form-inventoryInquiry-add").validate({
focusCleanup: true focusCleanup: true
}); });
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-inventoryInquiry-add').serialize()); $.operate.save(prefix + "/add", $('#form-inventoryInquiry-add').serialize());
} }
} }
</script> </script>
</body> </body>
</html> </html>

8
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html

@ -33,7 +33,13 @@
<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="materialType" th:field="*{materialType}" class="form-control" type="text" disabled> <select id="selectMaterialType" name="materialType"
class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" required disabled>
<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>
</optgroup>
</select>
</div> </div>
</div> </div>
</form> </form>

21
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html

@ -69,6 +69,13 @@
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "仓库库存查询", modalName: "仓库库存查询",
height: $(window).height() - 200,
modalWidth: 1200,
fixedColumns:true,
fixedNumber: 1,
fixedRightNumber: 1,
search: false,
showExport: true,
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '库存查询id', field: 'inventoryInquiryId', visible: false}, {title: '库存查询id', field: 'inventoryInquiryId', visible: false},
@ -114,13 +121,13 @@
{title: '录入人', field: 'createBy',}, {title: '录入人', field: 'createBy',},
{title: '更新人', field: 'updateBy',}, {title: '更新人', field: 'updateBy',},
{title: '上次更新时间', field: 'updateTime',}, {title: '上次更新时间', field: 'updateTime',},
{title: '操作', align: 'center', // {title: '操作', align: 'center',
formatter: function(value, row, index) { // formatter: function(value, row, index) {
var actions = []; // var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inventoryInquiryId + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inventoryInquiryId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
return actions.join(''); // return actions.join('');
} // }
} // }
] ]
}; };
$.table.init(options); $.table.init(options);

110
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html

@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('新增仓库库存报损')" /> <th:block th:include="include :: header('新增仓库库存报损')" />
<th:block th:include="include :: datetimepicker-css" /> <th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -16,36 +17,36 @@
<!-- </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="makeNo" class="form-control" type="text"> <input name="applyDept" class="form-control" type="text" 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">
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> <div class="input-group date">
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:checked="${dict.default}"> <input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</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">
<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> </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>
<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> </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">
<input name="materialNo" class="form-control" type="text"> <input name="materialNo" class="form-control" type="text">
@ -68,17 +69,17 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input name="numTotal" class="form-control" type="text"> <input name="numTotal" class="form-control" type="text">
</div> </div>
</div> </div> -->
<div class="form-group"> <div class="form-group is-required">
<label class="col-sm-3 control-label">仓库ID:</label> <label class="col-sm-3 control-label">仓库ID:</label>
<div class="col-sm-8"> <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> </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="warehouseName" class="form-control" type="text"> <input name="warehouseName" class="form-control" type="text" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -97,23 +98,84 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "warehouse/inventoryReportDamage" var prefix = ctx + "warehouse/inventoryReportDamage"
$("#form-inventoryReportDamage-add").validate({ $("#form-inventoryReportDamage-add").validate({focusCleanup: true});
focusCleanup: true
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-inventoryReportDamage-add').serialize()); $.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({ $("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
minView: "month", minView: "month",
autoclose: true 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> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save