You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
484 lines
20 KiB
484 lines
20 KiB
<!DOCTYPE html>
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<th:block th:include="include :: header('新增库存调整')"/>
|
|
<th:block th:include="include :: datetimepicker-css"/>
|
|
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
|
|
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
|
|
</head>
|
|
<body class="white-bg">
|
|
<div class="container-div">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
|
|
</div>
|
|
<form class="form-horizontal m" id="form-stockAdjust-add">
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">登记日期:</label>
|
|
<div class="col-sm-8">
|
|
<div class="input-group date">
|
|
<input name="registerDate" class="form-control time-input" placeholder="yyyy-MM-dd" type="text"
|
|
disabled>
|
|
<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>
|
|
<div class="col-sm-8">
|
|
<select name="itemType" class="form-control m-b"
|
|
th:with="type=${@dict.getType('ck_meterialt_type')}">
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
|
th:value="${dict.dictValue}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">仓库号:</label>
|
|
<div class="col-sm-8">
|
|
<select name="stockNo" class="form-control m-b" disabled>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">仓库名称:</label>
|
|
<div class="col-sm-8">
|
|
<select name="stockName" class="form-control m-b">
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">物料代码:</label>
|
|
<div class="col-sm-8">
|
|
<input name="itemCode" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">物料名称:</label>
|
|
<div class="col-sm-8">
|
|
<input name="itemName" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">机种:</label>
|
|
<div class="col-sm-8">
|
|
<input name="machineType" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">规格型号:</label>
|
|
<div class="col-sm-8">
|
|
<input name="itemSpecification" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">单位:</label>
|
|
<div class="col-sm-8">
|
|
<input name="unit" 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 name="customerNo" class="form-control m-b" disabled>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">客户名称:</label>
|
|
<div class="col-sm-8">
|
|
<select name="customerName" class="form-control m-b">
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">批号:</label>
|
|
<div class="col-sm-8">
|
|
<input name="batchNumber" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">调整数量:</label>
|
|
<div class="col-sm-8">
|
|
<input name="adjustQty" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">调整卷/PCS量:</label>
|
|
<div class="col-sm-8">
|
|
<input name="adjustReel" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">备注:</label>
|
|
<div class="col-sm-8">
|
|
<input name="remark" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare1" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare2" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare3" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare4" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare5" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- <div class="form-group"> -->
|
|
<!-- <label class="col-sm-3 control-label">:</label>-->
|
|
<!-- <div class="col-sm-8">-->
|
|
<!-- <input name="spare6" class="form-control" type="text">-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
</form>
|
|
|
|
<div class="modal inmodal" id="itemModal" tabindex="-1"
|
|
role="dilog" aria-hidden="true" style="padding-bottom: 100px;">
|
|
<div class="modal-dialog" style="width: 800px;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal"
|
|
aria-hidden="true"></button>
|
|
<h4 class="modal-title">选择物料</h4>
|
|
</div>
|
|
<div class="modal-body" style="text-align: center;">
|
|
<div class="row" style="margin-bottom: 20px;">
|
|
<div class="col-md-5">
|
|
<form id="formId">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-4">物料代码:</label>
|
|
<div class="col-md-8">
|
|
<input type="text" class="form-control"
|
|
id="wlCode" name="wlCode">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="button" class="btn btn-success" id="wlCodeSearch">搜索</button>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-responsive">
|
|
<table id="wlTable"
|
|
class="table table-striped table-responsive">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary"
|
|
onClick="selectWl();">选择
|
|
</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal" name="close">关闭</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<th:block th:include="include :: footer"/>
|
|
<th:block th:include="include :: datetimepicker-js"/>
|
|
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
|
|
<script th:inline="javascript">
|
|
var prefix = ctx + "stock/stockAdjust"
|
|
$("#form-stockAdjust-add").validate({
|
|
focusCleanup: true
|
|
});
|
|
|
|
function submitHandler() {
|
|
if ($.validate.form()) {
|
|
$.operate.save(prefix + "/add", $('#form-stockAdjust-add').serialize());
|
|
}
|
|
}
|
|
|
|
//鼠标移入,显示完整的数据
|
|
function paramsMatter(value, row, index) {
|
|
var span = document.createElement("span");
|
|
span.setAttribute("title", value);
|
|
span.innerHTML = value;
|
|
return span.outerHTML;
|
|
}
|
|
|
|
//获取仓库名
|
|
$.ajax({
|
|
url: ctx + "stock/stockInfo/all",
|
|
type: "post",
|
|
dataType: "json",
|
|
success: function (resp) {
|
|
if (resp.code === 0) {
|
|
let data = resp.data;
|
|
//alert(JSON.stringify(data));
|
|
for (let i in data) {
|
|
$("select[name='stockName']").append("<option value='" + data[i].stockname + "'>" + data[i].stockname + "</option>");
|
|
$("select[name='stockNo']").append("<option value='" + data[i].stockNO + "'>" + data[i].stockNO + "</option>");
|
|
}
|
|
} else {
|
|
$.modal.msgError(resp.msg);
|
|
}
|
|
},
|
|
error: function () {
|
|
$.modal.msgError("后台出错啦!");
|
|
}
|
|
})
|
|
|
|
//修改仓库名时 改变仓库号
|
|
$("select[name='stockName']").change(function () {
|
|
let stockName = $(this).val();
|
|
$.ajax({
|
|
url: ctx + "stock/stockInfo/all",
|
|
data: {"Stockname": stockName},
|
|
type: "post",
|
|
resultType: "json",
|
|
success: function (resp) {
|
|
if (resp.code === 0) {
|
|
let stockList = resp.data;
|
|
//alert(JSON.stringify(stockList));
|
|
$("select[name='stockNo']").val(stockList[0].stockNO).trigger("change");
|
|
} else {
|
|
$.modal.msgError(resp.msg);
|
|
}
|
|
},
|
|
error: function () {
|
|
$.modal.msgError("出错了!");
|
|
}
|
|
})
|
|
})
|
|
|
|
//获取客户代码和名称
|
|
$.ajax({
|
|
url: ctx + "finance/customer/getName",
|
|
type: "post",
|
|
dataType: "json",
|
|
success: function (resp) {
|
|
if (resp.code === 0) {
|
|
if (resp.data.length > 0) {
|
|
// $("select[name='customerName']").empty();
|
|
let data = resp.data;
|
|
//alert(data);
|
|
for (let i in data) {
|
|
$("select[name='customerName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
|
|
$("select[name='customerNo']").append("<option value='" + data[i].pCode + "'>" + data[i].pCode + "</option>");
|
|
}
|
|
}
|
|
} else {
|
|
$.modal.msgError(resp.msg);
|
|
}
|
|
},
|
|
error: function () {
|
|
$.modal.msgError("出错啦!");
|
|
}
|
|
})
|
|
|
|
//修改客户名称时 改变客户号
|
|
$("select[name='customerName']").change(function () {
|
|
let customerName = $(this).val();
|
|
$.ajax({
|
|
url: ctx + "finance/customer/item",
|
|
data: {"pName": customerName},
|
|
type: "post",
|
|
resultType: "json",
|
|
success: function (resp) {
|
|
if (resp.code === 0) {
|
|
let list = resp.data;
|
|
//alert(JSON.stringify(stockList));
|
|
$("select[name='customerNo']").val(list[0].pCode).trigger("change");
|
|
} else {
|
|
$.modal.msgError(resp.msg);
|
|
}
|
|
},
|
|
error: function () {
|
|
$.modal.msgError("出错了!");
|
|
}
|
|
})
|
|
})
|
|
|
|
//获取今天日期
|
|
let today = new Date();
|
|
today.setTime(today.getTime());
|
|
let time = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
|
|
$("input[name='registerDate']").val(time);
|
|
|
|
//打开选择物料页面
|
|
$("input[name='itemCode']").on("click", function () {
|
|
//$("#itemModal").show();
|
|
$("#itemModal").modal("show");
|
|
})
|
|
|
|
//搜索物料列表
|
|
$("#wlCodeSearch").on("click", function () {
|
|
$("#wlTable").bootstrapTable('refresh');
|
|
$("#wlCode").val("");
|
|
})
|
|
|
|
//选择物料列表
|
|
$('#wlTable').bootstrapTable({
|
|
url: '/stock/warehouse/list',
|
|
pagination: true,
|
|
pageNumber: 1,
|
|
pageSize: 10,
|
|
pageList: [10, 25, 50, 100],
|
|
showRefresh: true,
|
|
method: "post",
|
|
contentType: "application/x-www-form-urlencoded",
|
|
striped: true, // 是否显示行间隔色
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
cardView: false, // 是否显示详细视图
|
|
detailView: false, // 是否显示父子表
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
showExport: false, // 是否显示导出按钮
|
|
singleSelect: true,
|
|
height: 400,
|
|
queryParams: function (params) {
|
|
//console.log("123");
|
|
var curParams = {
|
|
// 传递参数查询参数
|
|
pageSize: params.limit,
|
|
pageNum: params.offset / params.limit + 1,
|
|
searchValue: params.search,
|
|
orderByColumn: params.sort,
|
|
isAsc: params.order
|
|
};
|
|
//console.log(curParams);
|
|
var json = $.extend(curParams, $.common.formToJSON("formId"));
|
|
//console.log(json);
|
|
return json;
|
|
},
|
|
columns: [
|
|
{
|
|
checkbox: true
|
|
}, {
|
|
field: 'wlCode',
|
|
title: '物料代码',
|
|
cellStyle: function (value, row, index) {
|
|
return {
|
|
css: {
|
|
"min-width": "130px",
|
|
"text-overflow": "ellipsis",
|
|
"overflow": "hidden",
|
|
"max-width": "150px",
|
|
"white-space": "nowrap"
|
|
}
|
|
}
|
|
},
|
|
formatter: paramsMatter
|
|
}, {
|
|
field: 'itemName',
|
|
title: '物料名称',
|
|
cellStyle: function (value, row, index) {
|
|
return {
|
|
css: {
|
|
"min-width": "130px",
|
|
"text-overflow": "ellipsis",
|
|
"overflow": "hidden",
|
|
"max-width": "150px",
|
|
"white-space": "nowrap"
|
|
}
|
|
}
|
|
},
|
|
formatter: paramsMatter
|
|
}, {
|
|
field: 'itemStandard',
|
|
title: '规格型号',
|
|
cellStyle: function (value, row, index) {
|
|
return {
|
|
css: {
|
|
"min-width": "130px",
|
|
"text-overflow": "ellipsis",
|
|
"overflow": "hidden",
|
|
"max-width": "150px",
|
|
"white-space": "nowrap"
|
|
}
|
|
}
|
|
},
|
|
formatter: paramsMatter
|
|
}, {
|
|
field: 'machineNo',
|
|
title: '机种',
|
|
cellStyle: function (value, row, index) {
|
|
return {
|
|
css: {
|
|
"min-width": "130px",
|
|
"text-overflow": "ellipsis",
|
|
"overflow": "hidden",
|
|
"max-width": "150px",
|
|
"white-space": "nowrap"
|
|
}
|
|
}
|
|
},
|
|
formatter: paramsMatter
|
|
}, {
|
|
field: 'stockDw',
|
|
title: '单位'
|
|
},
|
|
{
|
|
field: 'qty',
|
|
title: '数量'
|
|
},
|
|
{
|
|
field: 'warehouseName',
|
|
title: '仓库名称',
|
|
cellStyle: function (value, row, index) {
|
|
return {
|
|
css: {
|
|
"min-width": "130px",
|
|
"text-overflow": "ellipsis",
|
|
"overflow": "hidden",
|
|
"max-width": "150px",
|
|
"white-space": "nowrap"
|
|
}
|
|
}
|
|
},
|
|
formatter: paramsMatter
|
|
},
|
|
{
|
|
field: 'warehouseNo',
|
|
title: '仓库号'
|
|
},
|
|
]
|
|
});
|
|
|
|
//点击选择物料
|
|
function selectWl() {
|
|
let row = $("#wlTable").bootstrapTable("getSelections");
|
|
//console.log(row);
|
|
//$("#itemModal").hide();
|
|
$("#itemModal").modal("hide");
|
|
$("input[name='itemCode']").val(row[0].wlCode);
|
|
$("input[name='itemName']").val(row[0].itemName);
|
|
$("input[name='machineType']").val(row[0].machineNo);
|
|
$("input[name='itemSpecification']").val(row[0].itemStandard);
|
|
$("input[name='unit']").val(row[0].stockDw);
|
|
$("select[name='stockName']").val(row[0].warehouseName).trigger("change");
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|