8 changed files with 675 additions and 461 deletions
@ -0,0 +1,246 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<title>仓库盘点</title> |
||||
|
<meta name="renderer" content="webkit"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/inputTag.css"> |
||||
|
<style> |
||||
|
.inputdiv { |
||||
|
display: flex; |
||||
|
background-color: #fff; |
||||
|
height: 38px; |
||||
|
line-height: 38px; |
||||
|
border: 1px solid rgb(238, 238, 238); |
||||
|
} |
||||
|
|
||||
|
.layui-card-body { |
||||
|
padding: 0px; |
||||
|
} |
||||
|
|
||||
|
.layui-form-label { |
||||
|
padding: 9px 0px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.layui-input-block { |
||||
|
margin-left: 80px; |
||||
|
} |
||||
|
|
||||
|
.layui-form-select { |
||||
|
width: 100%; |
||||
|
height: 38px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.lay-step { |
||||
|
display: none; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
|
||||
|
<div class="layuimini-container"> |
||||
|
<div class="layuimini-main"> |
||||
|
<div class="layui-fluid"> |
||||
|
<div class="layui-tab-content"> |
||||
|
<div class="layui-tab-item layui-show"> |
||||
|
<div carousel-item style="overflow: inherit"> |
||||
|
<div> |
||||
|
<form class="layui-form" |
||||
|
style="margin: 0 auto;max-width: 700px;" |
||||
|
id="form1"> |
||||
|
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px"> |
||||
|
<input th:value="${id}" style="display: none" id="id"> |
||||
|
<input th:value="${type}" style="display: none" id="type"> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">查看位置</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="localtion" id="localtion" autocomplete="off" |
||||
|
class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
<table class="layui-hide" id="currentTableForLocation" |
||||
|
lay-filter="currentTableFilterForLocation" |
||||
|
style="margin-top: 123px"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<script id="changeUnit" type="text/html"> |
||||
|
<a class="layui-btn layui-btn-xs" lay-event="more">{{d.unit}}<i class="layui-icon layui-icon-down"></i></a> |
||||
|
</script> |
||||
|
|
||||
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
||||
|
<script> |
||||
|
|
||||
|
function updateTableShowForLocation() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var depositoryId = "-1"; |
||||
|
var placeId = "0"; |
||||
|
|
||||
|
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
||||
|
var $ = layui.$, |
||||
|
table = layui.table, |
||||
|
inputTag = layui.inputTag, |
||||
|
dropdown = layui.dropdown, //下拉菜单 |
||||
|
step = layui.step; |
||||
|
let id = $("#id").val(); |
||||
|
let type = $("#type").val(); |
||||
|
|
||||
|
$(function () { |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: "/place/findLocationById", |
||||
|
data: JSON.stringify({"id": id, "type": type}), |
||||
|
type: 'post', |
||||
|
dataType: 'json', |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
beforeSend: function () { |
||||
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
||||
|
}, |
||||
|
success: function (res) { |
||||
|
layer.close(this.layerIndex); |
||||
|
let location = res.data; |
||||
|
if (location === null) { |
||||
|
layer.msg("该位置不存在,请重试", { |
||||
|
icon: 5, |
||||
|
time: 1000 |
||||
|
}, function () { |
||||
|
var index = parent.layer.getFrameIndex(window.name); |
||||
|
parent.layer.close(index); |
||||
|
}) |
||||
|
} else { |
||||
|
if ("d" === type) { |
||||
|
depositoryId = id; |
||||
|
$("#localtion").val(location.dname); |
||||
|
} else { |
||||
|
placeId = id; |
||||
|
depositoryId = location.did; |
||||
|
$("#localtion").val(location.depositoryName + "-" + location.kingdeecode); |
||||
|
} |
||||
|
updateTableShowForLocation(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
table.render({ |
||||
|
elem: "#currentTableForLocation", |
||||
|
url: '/material/findInventoryForStockTaking', |
||||
|
parseData: function (res) { //res 即为原始返回的数据 |
||||
|
return { |
||||
|
"status": res.status, //解析接口状态 |
||||
|
"message": res.statusInfo.message, //解析提示文本 |
||||
|
"count": res.count, //解析数据长度 |
||||
|
"data": res.data //解析数据列表 |
||||
|
}; |
||||
|
}, |
||||
|
request: { |
||||
|
pageName: 'page', //页码的参数名称,默认:page |
||||
|
limitName: 'size' //每页数据量的参数名,默认:limit |
||||
|
}, |
||||
|
response: { |
||||
|
statusName: 'status' //规定数据状态的字段名称,默认:code |
||||
|
, statusCode: 200 //规定成功的状态码,默认:0 |
||||
|
, msgName: 'message' //规定状态信息的字段名称,默认:msg |
||||
|
, countName: 'count' //规定数据总数的字段名称,默认:count |
||||
|
, dataName: 'data' //规定数据列表的字段名称,默认:data |
||||
|
}, |
||||
|
where: { |
||||
|
depositoryId: "-1" |
||||
|
}, |
||||
|
height: 'full-255',//固定高度-即固定表头固定第一行首行 |
||||
|
cols: [ |
||||
|
[ |
||||
|
{field: 'mcode', width: 150, title: '存货编码', fixed: 'left'}, |
||||
|
{field: 'mname', width: 150, title: '物料名称'}, |
||||
|
{field: 'typeName', width: 100, title: '物料种类'}, |
||||
|
{field: 'version', width: 150, title: '规格型号',}, |
||||
|
{field: 'kingdeecode', width: 150, title: '所处库位',}, |
||||
|
{title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, |
||||
|
{field: 'inventory', width: 100, title: '库存数'}, |
||||
|
] |
||||
|
], |
||||
|
limits: [10, 15, 20, 25, 50, 100], |
||||
|
limit: 10, |
||||
|
page: true, |
||||
|
skin: 'line', |
||||
|
done: function (res, curr, count) { |
||||
|
$.each(res['data'], function (i, j) { |
||||
|
let takingUnit = j["takingUnit"]; |
||||
|
if (takingUnit !== null) { |
||||
|
let parentItem = $("[lay-id='currentTableForLocation'] tr:eq(" + (i + 1) + ")"); |
||||
|
let unitHandleItem = parentItem.children()[5]; |
||||
|
let quantityHandleItem = parentItem.children()[6]; |
||||
|
unitHandleItem.childNodes[0].childNodes[1].childNodes[0].data = takingUnit; |
||||
|
quantityHandleItem.childNodes[0].innerText = j["splitInventory"][takingUnit]; |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
updateTableShowForLocation = function () { |
||||
|
let req = {}; |
||||
|
req.depositoryId = depositoryId; |
||||
|
req.placeId = placeId; |
||||
|
table.reload('currentTableForLocation', { |
||||
|
url: '/material/findInventoryForStockTaking', |
||||
|
page: { |
||||
|
curr: 1 |
||||
|
}, |
||||
|
where: req |
||||
|
}, 'data'); |
||||
|
}; |
||||
|
|
||||
|
// 用于监听下拉菜单 |
||||
|
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" |
||||
|
var data = obj.data //获得当前行数据 |
||||
|
, layEvent = obj.event; //获得 lay-event 对应的值 |
||||
|
if (layEvent === 'more') { |
||||
|
let splitInfoList = obj.data.splitInfoList; |
||||
|
if (splitInfoList.length > 0) { |
||||
|
let dropDownDataList = []; |
||||
|
for (var i = 0; i < splitInfoList.length; i++) { |
||||
|
let dropDownData = {}; |
||||
|
dropDownData.title = splitInfoList[i].newUnit; |
||||
|
dropDownData.id = obj.data.id; |
||||
|
dropDownDataList.push(dropDownData); |
||||
|
} |
||||
|
dropdown.render({ |
||||
|
elem: this //触发事件的 DOM 对象 |
||||
|
, show: true //外部事件触发即显示 |
||||
|
, data: dropDownDataList |
||||
|
, click: function (unit) { |
||||
|
this.elem[0].childNodes[0].data = unit.title; |
||||
|
obj.tr[0].childNodes[6].childNodes[0].innerText = obj.data.splitInventory[unit.title]; |
||||
|
} |
||||
|
, align: 'right' //右对齐弹出(v2.6.8 新增) |
||||
|
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式 |
||||
|
}) |
||||
|
} |
||||
|
//下拉菜单 |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
}) |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,261 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<title>仓库盘点</title> |
||||
|
<meta name="renderer" content="webkit"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/inputTag.css"> |
||||
|
<style> |
||||
|
.inputdiv { |
||||
|
display: flex; |
||||
|
background-color: #fff; |
||||
|
height: 38px; |
||||
|
line-height: 38px; |
||||
|
border: 1px solid rgb(238, 238, 238); |
||||
|
} |
||||
|
|
||||
|
.layui-card-body { |
||||
|
padding: 0px; |
||||
|
} |
||||
|
|
||||
|
.layui-form-label { |
||||
|
padding: 9px 0px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.layui-input-block { |
||||
|
margin-left: 80px; |
||||
|
} |
||||
|
|
||||
|
.layui-form-select { |
||||
|
width: 100%; |
||||
|
height: 38px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.lay-step { |
||||
|
display: none; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
|
||||
|
<div class="layuimini-container"> |
||||
|
<div class="layuimini-main"> |
||||
|
<div class="layui-fluid"> |
||||
|
<div class="layui-tab-content"> |
||||
|
<div class="layui-tab-item layui-show"> |
||||
|
<div carousel-item style="overflow: inherit"> |
||||
|
<div> |
||||
|
<form class="layui-form" |
||||
|
style="margin: 0 auto;max-width: 700px;" |
||||
|
id="form1"> |
||||
|
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px"> |
||||
|
<input th:value="${id}" style="display: none" id="id"> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">物料编码</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="mcode" id="mcode" autocomplete="off" |
||||
|
class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">物料名称</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="mname" id="mname" |
||||
|
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">物料型号</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="version" id="version" |
||||
|
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">物料类型</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="mtype" id="mtype" |
||||
|
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<label class="layui-form-label">物料材质</label> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="text" name="texture" id="texture" |
||||
|
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
<table class="layui-hide" id="currentTableForMaterial" |
||||
|
lay-filter="currentTableFilterForMaterial" |
||||
|
style="margin-top: 123px"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<script id="changeUnit" type="text/html"> |
||||
|
<a class="layui-btn layui-btn-xs" lay-event="more">{{d.unit}}<i class="layui-icon layui-icon-down"></i></a> |
||||
|
</script> |
||||
|
|
||||
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
||||
|
<script> |
||||
|
|
||||
|
function updateTableShowForMaterial() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
||||
|
var $ = layui.$, |
||||
|
table = layui.table, |
||||
|
inputTag = layui.inputTag, |
||||
|
dropdown = layui.dropdown, //下拉菜单 |
||||
|
step = layui.step; |
||||
|
let id = $("#id").val(); |
||||
|
|
||||
|
$(function () { |
||||
|
$.ajax({ |
||||
|
url: "/material/findOnlyMaterialById", |
||||
|
data: JSON.stringify({"id": id}), |
||||
|
type: 'post', |
||||
|
dataType: 'json', |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
beforeSend: function () { |
||||
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
||||
|
}, |
||||
|
success: function (res) { |
||||
|
layer.close(this.layerIndex); |
||||
|
let material = res.data; |
||||
|
if (material === null) { |
||||
|
layer.msg("该物料不存在,请重试", { |
||||
|
icon: 5, |
||||
|
time: 1000 |
||||
|
}, function () { |
||||
|
var index = parent.layer.getFrameIndex(window.name); |
||||
|
parent.layer.close(index); |
||||
|
}) |
||||
|
} else { |
||||
|
$("#mname").val(material.mname); |
||||
|
$("#mcode").val(material.code); |
||||
|
$("#version").val(material.version); |
||||
|
$("#mtype").val(material.typeName); |
||||
|
$("#texture").val(material.texture); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
updateTableShowForMaterial(); |
||||
|
}); |
||||
|
|
||||
|
table.render({ |
||||
|
elem: "#currentTableForMaterial", |
||||
|
url: '/material/findMaterialByConditionForStockTaking', |
||||
|
parseData: function (res) { //res 即为原始返回的数据 |
||||
|
return { |
||||
|
"status": res.status, //解析接口状态 |
||||
|
"message": res.statusInfo.message, //解析提示文本 |
||||
|
"count": res.count, //解析数据长度 |
||||
|
"data": res.data //解析数据列表 |
||||
|
}; |
||||
|
}, |
||||
|
request: { |
||||
|
pageName: 'page', //页码的参数名称,默认:page |
||||
|
limitName: 'size' //每页数据量的参数名,默认:limit |
||||
|
}, |
||||
|
response: { |
||||
|
statusName: 'status' //规定数据状态的字段名称,默认:code |
||||
|
, statusCode: 200 //规定成功的状态码,默认:0 |
||||
|
, msgName: 'message' //规定状态信息的字段名称,默认:msg |
||||
|
, countName: 'count' //规定数据总数的字段名称,默认:count |
||||
|
, dataName: 'data' //规定数据列表的字段名称,默认:data |
||||
|
}, |
||||
|
where: { |
||||
|
depositoryId: "-1" |
||||
|
}, |
||||
|
height: 'full-255',//固定高度-即固定表头固定第一行首行 |
||||
|
cols: [ |
||||
|
[ |
||||
|
{field: 'dname', width: 150, title: '所处仓库'}, |
||||
|
{field: 'kingdeecode', width: 80, title: '所处库位',}, |
||||
|
{title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, |
||||
|
{field: 'inventory', width: 100, title: '库存数'} |
||||
|
] |
||||
|
], |
||||
|
limits: [10, 15, 20, 25, 50, 100], |
||||
|
limit: 10, |
||||
|
page: true, |
||||
|
skin: 'line', |
||||
|
done: function (res, curr, count) { |
||||
|
$.each(res['data'], function (i, j) { |
||||
|
let takingUnit = j["takingUnit"]; |
||||
|
if (takingUnit !== null) { |
||||
|
let parentItem = $("[lay-id='currentTableForMaterial'] tr:eq(" + (i + 1) + ")"); |
||||
|
let unitHandleItem = parentItem.children()[6]; |
||||
|
let quantityHandleItem = parentItem.children()[7]; |
||||
|
unitHandleItem.childNodes[0].childNodes[1].childNodes[0].data = takingUnit; |
||||
|
quantityHandleItem.childNodes[0].innerText = j["splitInventory"][takingUnit]; |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
updateTableShowForMaterial = function () { |
||||
|
let req = {}; |
||||
|
req.mid = id; |
||||
|
table.reload('currentTableForMaterial', { |
||||
|
url: '/material/findMaterialByConditionForStockTaking', |
||||
|
page: { |
||||
|
curr: 1 |
||||
|
}, |
||||
|
where: req |
||||
|
}, 'data'); |
||||
|
}; |
||||
|
|
||||
|
// 用于监听下拉菜单 |
||||
|
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" |
||||
|
var data = obj.data //获得当前行数据 |
||||
|
, layEvent = obj.event; //获得 lay-event 对应的值 |
||||
|
if (layEvent === 'more') { |
||||
|
let splitInfoList = obj.data.splitInfoList; |
||||
|
if (splitInfoList.length > 0) { |
||||
|
let dropDownDataList = []; |
||||
|
for (var i = 0; i < splitInfoList.length; i++) { |
||||
|
let dropDownData = {}; |
||||
|
dropDownData.title = splitInfoList[i].newUnit; |
||||
|
dropDownData.id = obj.data.id; |
||||
|
dropDownDataList.push(dropDownData); |
||||
|
} |
||||
|
dropdown.render({ |
||||
|
elem: this //触发事件的 DOM 对象 |
||||
|
, show: true //外部事件触发即显示 |
||||
|
, data: dropDownDataList |
||||
|
, click: function (unit) { |
||||
|
this.elem[0].childNodes[0].data = unit.title; |
||||
|
obj.tr[0].childNodes[6].childNodes[0].innerText = obj.data.splitInventory[unit.title]; |
||||
|
} |
||||
|
, align: 'right' //右对齐弹出(v2.6.8 新增) |
||||
|
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式 |
||||
|
}) |
||||
|
} |
||||
|
//下拉菜单 |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
}) |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
Loading…
Reference in new issue