万材erp项目
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.
 
 
 
 

285 lines
11 KiB

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('盘底列表')"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>盘底单号:</label>
<input type="text" name="checkId"/>
</li>
<li>
<label>仓库名称:</label>
<select name="stockName" class="form-control m-b">
<option value="">所有</option>
</select>
</li>
<li class="select-time">
<label>盘底日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginCheckDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endCheckDate]"/>
</li>
<li>
<label>物料代码:</label>
<input type="text" name="itemCode"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="itemName"/>
</li>
<li>
<label>更新否:</label>
<select name="isUpdate" class="form-control m-b">
<option value="">所有</option>
<option value="1">已更新</option>
<option value="0">未更新</option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="stock:checkHead:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="edit()"
shiro:hasPermission="stock:checkHead:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="" disabled
shiro:hasPermission="stock:checkHead:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="stock:checkHead:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-primary single disabled" onclick="updateInventory()"
shiro:hasPermission="stock:checkHead:edit">
<i class="fa fa-edit"></i> 更新库存
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('stock:checkHead:edit')}]];
var removeFlag = [[${@permission.hasPermi('stock:checkHead:remove')}]];
var prefix = ctx + "stock/checkHead";
//鼠标移入,显示完整的数据
function paramsMatter(value, row, index) {
var span = document.createElement("span");
span.setAttribute("title", value);
span.innerHTML = value;
return span.outerHTML;
}
$(function () {
var options = {
url: prefix + "/headWithList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "盘底",
columns: [{
checkbox: true
},
{
field: 'checkId',
title: '盘底单号'
},
{
field: 'stockName',
title: '仓库名称'
},
{
field: 'checkDate',
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: 'itemCode',
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: 'itemSpecification',
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: 'unit',
title: '单位'
}, {
field: 'checkQty',
title: '盘底数量'
},
{
field: 'batchNumber',
title: '批号'
},
{
field: 'isUpdate',
title: '更新否',
formatter: function (val) {
if (val === "1") {
return "已更新"
} else {
return "未更新"
}
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="" disabled><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="" disabled><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
//获取仓库名
$.ajax({
url: ctx + "stock/stockInfo/all",
type: "post",
dataType: "json",
success: function (resp) {
if (resp.code === 0) {
let data = resp.data;
//alert(data);
for (let i in data) {
$("select[name='stockName']").append("<option value='" + data[i].stockname + "'>" + data[i].stockname + "</option>");
}
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
function reset(){
$("select[name='stockName']").val("").select2();
$("select[name='isUpdate']").val("").select2();
$.form.reset();
}
function edit(){
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].isUpdate==="1"){
$.modal.msgError("已更新,无法修改!");
return false;
}
$.operate.edit();
}
//更新库存
function updateInventory(){
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].isUpdate==="1"){
$.modal.msgError("已更新,无法再次更新!");
return false;
}
$.modal.confirm("是否确定更新?", function () {
$.ajax({
url: ctx + "stock/checkList/inventory",
type: "post",
dataType: "json",
data: {"checkId":row[0].checkId,"itemCode":row[0].itemCode},
success: function (resp) {
if (resp.code === 0) {
//$.modal.msgSuccess("更新成功!");
alert("更新成功!");
window.location.reload();
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
});
}
</script>
</body>
</html>