Browse Source

修改库存查询移动端页面

lwx_dev
erdanergou 3 years ago
parent
commit
8e5a4da46f
  1. 6
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java
  2. 3
      src/main/java/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml
  3. 5
      src/main/java/com/dreamchaser/depository_manage/pojo/MaterialAndPlaceForViewP.java
  4. 6
      src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java
  5. 155
      src/main/resources/templates/pages/showInventory/showInventoryForLocation.html
  6. 145
      src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html
  7. 574
      src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html
  8. 3
      target/classes/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml
  9. 155
      target/classes/templates/pages/showInventory/showInventoryForLocation.html
  10. 145
      target/classes/templates/pages/showInventory/showInventoryForMaterial.html

6
src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

@ -1677,6 +1677,12 @@ public class MaterialController {
} }
/**
* 用于库存盘点时根据物料查询所处位置
* @param map
* @param request
* @return
*/
@GetMapping("/findMaterialByConditionForStockTaking") @GetMapping("/findMaterialByConditionForStockTaking")
public RestResponse findMaterialByConditionForStockTaking(@RequestParam Map<String, Object> map, HttpServletRequest request) { public RestResponse findMaterialByConditionForStockTaking(@RequestParam Map<String, Object> map, HttpServletRequest request) {
if (map.containsKey("mid")) { if (map.containsKey("mid")) {

3
src/main/java/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml

@ -53,6 +53,7 @@
<result column="mname" property="mname" jdbcType="VARCHAR"/> <result column="mname" property="mname" jdbcType="VARCHAR"/>
<result column="adminorg" property="adminorg" jdbcType="VARCHAR"/> <result column="adminorg" property="adminorg" jdbcType="VARCHAR"/>
<result column="kingdeecode" property="kingdeecode" jdbcType="VARCHAR"/> <result column="kingdeecode" property="kingdeecode" jdbcType="VARCHAR"/>
<result column="mbrand" property="mbrand" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 表查询字段 --> <!-- 表查询字段 -->
@ -65,7 +66,7 @@
</sql> </sql>
<sql id="allColumnsForView"> <sql id="allColumnsForView">
depository_id,mname,type_id,tname,mcode,version,price,unit,texture,pcode,dname,adminorg,dcode,iid,inventory,id,pid,mid,kingdeecode depository_id,mname,type_id,tname,mcode,version,price,unit,texture,pcode,dname,adminorg,dcode,iid,inventory,id,pid,mid,kingdeecode,mbrand
</sql> </sql>

5
src/main/java/com/dreamchaser/depository_manage/pojo/MaterialAndPlaceForViewP.java

@ -62,6 +62,11 @@ public class MaterialAndPlaceForViewP {
*/ */
private String version; private String version;
/**
* 物料品牌
*/
private String mbrand;
/** /**
* 物料单价 * 物料单价
*/ */

6
src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java

@ -586,6 +586,9 @@ public class MaterialServiceImpl implements MaterialService {
for (MaterialAndPlaceForViewP materialByDidsAndMid : placeAndMaterialByDidsAndMid for (MaterialAndPlaceForViewP materialByDidsAndMid : placeAndMaterialByDidsAndMid
) { ) {
materialByDidsAndMid.setInventory(materialByDidsAndMid.getInventory() / 100); materialByDidsAndMid.setInventory(materialByDidsAndMid.getInventory() / 100);
if(materialByDidsAndMid.getMbrand() == null){
materialByDidsAndMid.setMbrand("");
}
} }
return packMpvList(placeAndMaterialByDidsAndMid, map); return packMpvList(placeAndMaterialByDidsAndMid, map);
} }
@ -2698,6 +2701,9 @@ public class MaterialServiceImpl implements MaterialService {
for (MaterialAndPlaceForViewP placeAndPlaceForViewP : placeAndMaterialByCondition for (MaterialAndPlaceForViewP placeAndPlaceForViewP : placeAndMaterialByCondition
) { ) {
placeAndPlaceForViewP.setInventory(placeAndPlaceForViewP.getInventory() / 100); placeAndPlaceForViewP.setInventory(placeAndPlaceForViewP.getInventory() / 100);
if(placeAndPlaceForViewP.getMbrand() == null){
placeAndPlaceForViewP.setMbrand("");
}
} }
return packMpvList(placeAndMaterialByCondition, map); return packMpvList(placeAndMaterialByCondition, map);
} }

155
src/main/resources/templates/pages/showInventory/showInventoryForLocation.html

@ -67,9 +67,7 @@
</div> </div>
</div> </div>
</form> </form>
<table class="layui-hide" id="currentTableForLocation" <ul class="flow-default" id="LAY_InventoryShow"></ul>
lay-filter="currentTableFilterForLocation"
style="margin-top: 123px"></table>
</div> </div>
</div> </div>
@ -79,10 +77,6 @@
</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/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 src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script> <script>
@ -94,14 +88,16 @@
var depositoryId = "-1"; var depositoryId = "-1";
var placeId = "0"; var placeId = "0";
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { layui.use(['form', 'step', 'flow', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
table = layui.table,
inputTag = layui.inputTag, inputTag = layui.inputTag,
flow = layui.flow,
dropdown = layui.dropdown, //下拉菜单 dropdown = layui.dropdown, //下拉菜单
step = layui.step; step = layui.step;
let id = $("#id").val(); let id = $("#id").val();
let type = $("#type").val(); let type = $("#type").val();
let takingPre = 0;
let size = 8;
$(function () { $(function () {
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
@ -141,104 +137,67 @@
layer.close(loading2); layer.close(loading2);
}); });
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 () { updateTableShowForLocation = function () {
let req = {}; let req = {};
req.depositoryId = depositoryId; req.depositoryId = depositoryId;
req.placeId = placeId; req.placeId = placeId;
table.reload('currentTableForLocation', { flow.load({
url: '/material/findInventoryForStockTaking', elem: '#LAY_InventoryShow' //流加载容器
page: { , done: function (page, next) { //执行下一页的回调
curr: 1 let result;
}, let lis = [];
where: req let req = {};
}, 'data'); req.depositoryId = depositoryId;
}; req.placeId = placeId;
req.size = size;
// 用于监听下拉菜单 req.page = page;
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" $.ajax({
var data = obj.data //获得当前行数据 url:"/material/findInventoryForStockTaking",
, layEvent = obj.event; //获得 lay-event 对应的值 data: req,
if (layEvent === 'more') { type: 'get',
let splitInfoList = obj.data.splitInfoList; dataType: 'json',
if (splitInfoList.length > 0) { contentType: "application/json;charset=utf-8",
let dropDownDataList = []; success: function (res) {
for (var i = 0; i < splitInfoList.length; i++) { result = res.data;
let dropDownData = {}; lis.push("<div class='clearfix'>");
dropDownData.title = splitInfoList[i].newUnit; for (let i = 0; i < result.length; i++) {
dropDownData.id = obj.data.id; let splitInventory = result[i].splitInventory;
dropDownDataList.push(dropDownData); let keys = Object.keys(splitInventory);
} let InventoryItem = "";
dropdown.render({ let brandItem ='<p>' + "物料品牌:"+result[i].mbrand + '</p>';
elem: this //触发事件的 DOM 对象 if(result[i].mbrand === ""){
, show: true //外部事件触发即显示 brandItem = "";
, data: dropDownDataList }
, click: function (unit) { for (let j = 0; j < keys.length; j++) {
this.elem[0].childNodes[0].data = unit.title; let key = keys[j];
obj.tr[0].childNodes[6].childNodes[0].innerText = obj.data.splitInventory[unit.title]; let item = '<p>' + "计量单位:" + key + ";库存数量:" + splitInventory[key] + '</p>';
InventoryItem += item;
}
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1"><div class="layui-card-header"><h2>' + "物料名称:" + result[i].mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+ '<p>' + "物料编码:"+result[i].mcode + '</p>'
+ '<p>' + "物料型号:"+result[i].version + '</p>'
+ brandItem
+ '<p>' + "所处位置:"+result[i].dname+"-"+result[i].kingdeecode + '</p>'
+ InventoryItem
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
} }
, align: 'right' //右对齐弹出(v2.6.8 新增)
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式
}) })
} }
//下拉菜单
}
}); });
};
}) })

145
src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html

@ -78,6 +78,13 @@
autocomplete="off" class="layui-input"> autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">物料品牌</label>
<div class="layui-input-block">
<input type="text" name="brand" id="brand"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">物料类型</label> <label class="layui-form-label">物料类型</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -94,9 +101,9 @@
</div> </div>
</div> </div>
</form> </form>
<table class="layui-hide" id="currentTableForMaterial"
lay-filter="currentTableFilterForMaterial" <ul class="flow-default" id="LAY_InventoryShow"></ul>
style="margin-top: 123px"></table>
</div> </div>
</div> </div>
@ -106,26 +113,25 @@
</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/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 src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script> <script>
function updateTableShowForMaterial() { function updateFlowShowForMaterial() {
} }
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () {
layui.use(['form', 'step', 'flow', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
table = layui.table,
inputTag = layui.inputTag, inputTag = layui.inputTag,
dropdown = layui.dropdown, //下拉菜单 dropdown = layui.dropdown, //下拉菜单
step = layui.step; flow = layui.flow;
let id = $("#id").val(); let id = $("#id").val();
let takingPre = 0;
let size = 8;
$(function () { $(function () {
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({ $.ajax({
@ -151,105 +157,42 @@
$("#version").val(material.version); $("#version").val(material.version);
$("#mtype").val(material.typeName); $("#mtype").val(material.typeName);
$("#texture").val(material.texture); $("#texture").val(material.texture);
$("#brand").val(material.brand);
} }
} }
}); });
updateTableShowForMaterial();
layer.close(loading2); layer.close(loading2);
}); });
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');
};
// 用于监听下拉菜单 flow.load({
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" elem: '#LAY_InventoryShow' //流加载容器
var data = obj.data //获得当前行数据 , done: function (page, next) { //执行下一页的回调
, layEvent = obj.event; //获得 lay-event 对应的值 let result;
if (layEvent === 'more') { let lis = [];
let splitInfoList = obj.data.splitInfoList; $.get('/material/findMaterialByConditionForStockTaking?page=' + page + '&size=' + size + '&mid=' + id, function (res) {
if (splitInfoList.length > 0) { result = res.data;
let dropDownDataList = []; lis.push("<div class='clearfix'>");
for (var i = 0; i < splitInfoList.length; i++) { for (let i = 0; i < result.length; i++) {
let dropDownData = {}; let splitInventory = result[i].splitInventory;
dropDownData.title = splitInfoList[i].newUnit; let keys = Object.keys(splitInventory);
dropDownData.id = obj.data.id; let InventoryItem = "";
dropDownDataList.push(dropDownData); for (let j = 0; j < keys.length; j++) {
} let key = keys[j];
dropdown.render({ let item = '<p>' + "计量单位:" + key + ";库存数量:" + splitInventory[key] + '</p>';
elem: this //触发事件的 DOM 对象 InventoryItem += item;
, 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 新增) lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1"><div class="layui-card-header"><h2>' + "所处位置:" + result[i].dname+"-"+result[i].kingdeecode + '</h2></div>');
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式 lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
}) + InventoryItem
+ '</div></div></li>');
} }
//下拉菜单 lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
});
} }
}); });

574
src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html

@ -0,0 +1,574 @@
<!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">
<ul class="layui-tab-title" style="text-align: center">
<li class="layui-this">物料盘点</li>
<li class="layui-this">位置盘点</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; ">
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;"
lay-filter="form1" id="form1">
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px">
<div class="layui-form-item">
<label class="layui-form-label" style="height: 40px;">物料名称:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input type="text" placeholder="请选择物料" class="layui-input"
style="border-style: none"
id="openSonByMaterial"
onblur="selectMaterialByName(this)"
lay-verify="required"/>
<i class="layui-icon layui-icon-search"
style="display: inline;"
id="selectMaterial" onclick="selectMaterial(this)"></i>
</div>
<input type="text" name="mid" class="layui-input" id="mid"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="height: 40px;">物料编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input id="code" name="code" type="text"
placeholder="请填写入物料编码"
value=""
onblur="selectCode(this)"
class="layui-input" lay-verify="required"
style="border-style: none">
<img src="/static/images/search.ico" height="16" width="16"
id="qrCodeImg"
style="margin-top: 10px"
onclick="scanCodeForMaterial(this)">
<input id="qrCode" name="qrCode" type="text"
style="display:none;">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="height: 40px;">负责人:</label>
<div class="layui-input-block">
<div class="fairy-tag-container" style="border-style: none">
<div class="inputdiv">
<input type="text" id="departmentManagerForMaterial"
style="display: none"
th:value="${departmentHeadName}"/>
<i class="layui-icon layui-icon-search"
style="display: inline;right: 0;position: absolute;"
id="selectdepartmentManagerForMaterial"></i>
<input type="text" id="departmentManagerIdForMaterial"
name="departmentManagerId"
th:value="${departmentHeadId}"
class="layui-input" style="display: none"
lay-verify="required"/>
</div>
</div>
</div>
</div>
</div>
</form>
<table class="layui-hide" id="currentTableForMaterial"
lay-filter="currentTableFilterForMaterial"
style="margin-top: 123px"></table>
<!-- 提交按钮-->
<div class="layui-form-item" style="margin-top: 10px;">
<div class="layui-input-block">
<button type="button" class="layui-btn layui-btn-normal layui-btn-lg"
submitType="Material"
lay-submit
lay-filter="formStep">
&emsp;提交&emsp;
</button>
</div>
</div>
</div>
<!-- 下一步-->
<div>
<form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
<div style="text-align: center;margin-top: 90px;">
<i class="layui-icon layui-circle"
style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;">&#xe605;</i>
<div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
提交成功
</div>
<div style="text-align: center;margin-top: 50px;">
<button class="layui-btn next">再填写一次</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="layui-carousel" id="stepForm1" lay-filter="stepForm" style="margin: 0 auto; ">
<div carousel-item style="overflow: inherit">
<div>
<div class="layui-card">
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;"
lay-filter="form1">
<div class="layui-card-body" style="padding-right: 0px">
<div class="layui-form-item">
<label class="layui-form-label" style="height: 40px;">盘点位置:</label>
<div class="layui-input-block">
<div class="inputdiv">
<input type="text" placeholder="请选择盘点位置" class="layui-input"
style="border-style: none"
id="openSonByDepository" readonly
lay-verify="required"/>
<img src="/static/images/search.ico" height="16" width="16"
id="scanCodeImg"
style="margin-top: 10px" onclick="scanCode(this)">
</div>
<input type="text" name="depositoryId" class="layui-input"
id="depositoryId"
style="display: none" lay-verify="required"/>
<input type="text" name="placeId" class="layui-input"
id="placeId"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="height: 40px;">负责人:</label>
<div class="layui-input-block">
<div class="fairy-tag-container" style="border-style: none">
<div class="inputdiv">
<input type="text" id="departmentManagerForLocation"
style="display: none"
th:value="${departmentHeadName}"/>
<i class="layui-icon layui-icon-search"
id="selectdepartmentManagerForLocation"
style="display: inline;right: 0;position: absolute;"
></i>
<input type="text" id="departmentManagerIdForLocation"
name="departmentManagerId"
th:value="${departmentHeadId}"
class="layui-input" style="display: none"
lay-verify="required"/>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="layui-tab">
<ul class="layui-tab-title" style="text-align: center">
<li class="layui-this">表格</li>
<li class="layui-this">卡片</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<table class="layui-hide" lay-filter="currentTableFilterForLocation"
id="currentTableForLocation"
style="margin-top: 123px"></table>
<!-- 提交按钮-->
<div class="layui-form-item" style="margin-top: 10px;">
<div class="layui-input-block">
<button type="button"
class="layui-btn layui-btn-normal layui-btn-lg"
submitType="Location"
lay-submit
lay-filter="formStep">
&emsp;提交&emsp;
</button>
</div>
</div>
</div>
<div class="layui-tab-item">
<form class="layui-form" id="locationCard">
<fieldset class="table-search-fieldset">
<legend>盘点明细</legend>
<div class="layui-card-body" id="InventoryDetails"
style="padding-right: 0px">
<hr>
<i class="layui-icon layui-icon-subtraction"
style="display: inline"
onclick="deleteItem(this)"></i>
<div class="layui-form-item">
<label class="layui-form-label"
style="height: 40px;">物料名称:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input type="text" placeholder="请选择物料"
class="layui-input fairy-tag-input"
style="border-style: none"
id="openSonByMaterialForLocation"
onblur="selectMaterialByNameForLocation(this)"
lay-verify="required"/>
<i class="layui-icon layui-icon-search"
style="display: inline"
id="selectMaterialForLocation"
onclick="selectMaterialForLocation(this)"></i>
</div>
<input type="text" name="mid"
class="layui-input" id="midForLocation"
style="display: none"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"
style="height: 40px;">物料编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input id="codeForLocation" name="code"
type="text" placeholder="请填写入物料编码"
value=""
onblur="selectCodeForLocation(this)"
class="layui-input"
lay-verify="required"
style="border-style: none">
<img src="/static/images/search.ico"
height="16" width="16"
style="margin-top: 10px"
onclick="scanMaterialCodeForTaking(this)">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">物料类型:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择物料类型"
class="layui-input"
id="openSonByMateralType" readonly
lay-verify="required"/>
<input type="text" id="materialTypeId"
name="typeId"
placeholder="请选择物料类型" class="layui-input"
style="display: none"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">材质:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写材质名称"
class="layui-input" readonly
name="texture"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">规格型号:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写规格型号"
class="layui-input" readonly
name="version"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<select id="unit"
onchange="changeSelectValueForUnit(this)"
class="layui-form-select"
name="unit"></select>
</div>
</div>
<div class="layui-form-item" style="display: none"
id="producedDateItem">
<label class="layui-form-label">生产日期:</label>
<div class="layui-input-block">
<!-- <input type="text" name="producedDate" id="producedDate" placeholder="请填写生产日期" onclick="selectDate(this)"-->
<!-- autocomplete="off" class="layui-input">-->
<select name="producedDate" id="producedDate"
onchange="changeSelectValueForProducedDate(this)"
class="layui-form-select">
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">库存数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
readonly id="oldInventory"
name="oldInventory"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
onblur="calculate(this)"
name="newInventory"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点结果:</label>
<div class="layui-input-block">
<select name="takingResult" id="result"
class="layui-form-select">
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盈亏数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
readonly
id="Inventory_number"
name="inventory" lay-verify="required"/>
</div>
</div>
<i class="layui-icon layui-icon-addition"
style="display: inline"
onclick="addItem(this)"></i>
</div>
<div class="layui-form-item" style="margin-top: 10px;">
<div class="layui-input-block">
<button type="button"
class="layui-btn layui-btn-normal layui-btn-lg"
lay-submit
lay-filter="formStep3">
&emsp;提交&emsp;
</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 下一步-->
<div>
<form class="layui-form"
style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
<div style="text-align: center;margin-top: 90px;">
<i class="layui-icon layui-circle"
style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;">&#xe605;</i>
<div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
提交成功
</div>
<div style="text-align: center;margin-top: 50px;">
<button class="layui-btn next">再填写一次</button>
</div>
</div>
</form>
</div>
</div>
</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 src="/static/js/stockTaking/stockTakingForMaterial.js" charset="utf-8"></script>
<script src="/static/js/stockTaking/stockTakingForLocationTable.js" charset="utf-8"></script>
<script src="/static/js/stockTaking/stockTakingForLocationCard.js" charset="utf-8"></script>
<script>
// 用于存储当前选择的盘点位置
let depositoryId;
let placeId;
// 用于存储当前选择的负责人
let departmentManagerIdForMaterial;
// 用于存储当前选择的负责人
let departmentManagerIdForLocation;
// 用于标志是否为第一次提交
let flagForForm = false;
let flagForForm1 = false;
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () {
var $ = layui.$,
form = layui.form,
table = layui.table,
inputTag = layui.inputTag,
dropdown = layui.dropdown, //下拉菜单
step = layui.step;
// 用于分步表单加载
step.render({
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
height: '900px',
stepItems: [{
title: '填写信息'
}, {
title: '提交成功'
}]
});
// 用于分步表单加载
step.render({
elem: '#stepForm1',
filter: 'stepForm',
width: '100%', //设置容器宽度
height: '900px',
stepItems: [{
title: '填写信息'
}, {
title: '提交成功'
}]
});
// 用于提交盘点情况
form.on('submit(formStep)', function (data) {
if(!flagForForm){
flagForForm = true;
data = data.field;
data.depositoryId = depositoryId;
data.placeId = placeId;
let submitType = this.getAttribute("submitType");
if ("Material" === submitType) {
data.departmentManager = departmentManagerIdForMaterial;
} else if ("Location" === submitType) {
data.departmentManager = departmentManagerIdForLocation;
}
$.ajax({
url: "/stockTaking/submitStockTaking",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.msg("申请提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function () {
step.next('#stepForm');
});
},
complete: function () {
layer.close(this.layerIndex);
}
});
}
});
form.on('submit(formStep2)', function (data) {
step.next('#stepForm');
return false;
});
// 用于提交盘点情况
form.on('submit(formStep3)', function (data) {
if(!flagForForm1){
flagForForm1 = true;
data = data.field;
data.params = params;
data.departmentManagerId = departmentManagerIdForLocation;
data.depositoryId = depositoryId;
data.placeId = placeId;
$.ajax({
url: "/stockTaking/addStockTakingRecord",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.msg("申请提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function () {
step.next('#stepForm');
});
},
complete: function () {
layer.close(this.layerIndex);
}
});
}
});
$('.pre').click(function () {
step.pre('#stepForm');
});
$('.next').click(function () {
step.next('#stepForm');
});
})
</script>
</body>
</html>

3
target/classes/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml

@ -53,6 +53,7 @@
<result column="mname" property="mname" jdbcType="VARCHAR"/> <result column="mname" property="mname" jdbcType="VARCHAR"/>
<result column="adminorg" property="adminorg" jdbcType="VARCHAR"/> <result column="adminorg" property="adminorg" jdbcType="VARCHAR"/>
<result column="kingdeecode" property="kingdeecode" jdbcType="VARCHAR"/> <result column="kingdeecode" property="kingdeecode" jdbcType="VARCHAR"/>
<result column="mbrand" property="mbrand" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 表查询字段 --> <!-- 表查询字段 -->
@ -65,7 +66,7 @@
</sql> </sql>
<sql id="allColumnsForView"> <sql id="allColumnsForView">
depository_id,mname,type_id,tname,mcode,version,price,unit,texture,pcode,dname,adminorg,dcode,iid,inventory,id,pid,mid,kingdeecode depository_id,mname,type_id,tname,mcode,version,price,unit,texture,pcode,dname,adminorg,dcode,iid,inventory,id,pid,mid,kingdeecode,mbrand
</sql> </sql>

155
target/classes/templates/pages/showInventory/showInventoryForLocation.html

@ -67,9 +67,7 @@
</div> </div>
</div> </div>
</form> </form>
<table class="layui-hide" id="currentTableForLocation" <ul class="flow-default" id="LAY_InventoryShow"></ul>
lay-filter="currentTableFilterForLocation"
style="margin-top: 123px"></table>
</div> </div>
</div> </div>
@ -79,10 +77,6 @@
</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/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 src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script> <script>
@ -94,14 +88,16 @@
var depositoryId = "-1"; var depositoryId = "-1";
var placeId = "0"; var placeId = "0";
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { layui.use(['form', 'step', 'flow', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
table = layui.table,
inputTag = layui.inputTag, inputTag = layui.inputTag,
flow = layui.flow,
dropdown = layui.dropdown, //下拉菜单 dropdown = layui.dropdown, //下拉菜单
step = layui.step; step = layui.step;
let id = $("#id").val(); let id = $("#id").val();
let type = $("#type").val(); let type = $("#type").val();
let takingPre = 0;
let size = 8;
$(function () { $(function () {
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
@ -141,104 +137,67 @@
layer.close(loading2); layer.close(loading2);
}); });
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 () { updateTableShowForLocation = function () {
let req = {}; let req = {};
req.depositoryId = depositoryId; req.depositoryId = depositoryId;
req.placeId = placeId; req.placeId = placeId;
table.reload('currentTableForLocation', { flow.load({
url: '/material/findInventoryForStockTaking', elem: '#LAY_InventoryShow' //流加载容器
page: { , done: function (page, next) { //执行下一页的回调
curr: 1 let result;
}, let lis = [];
where: req let req = {};
}, 'data'); req.depositoryId = depositoryId;
}; req.placeId = placeId;
req.size = size;
// 用于监听下拉菜单 req.page = page;
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" $.ajax({
var data = obj.data //获得当前行数据 url:"/material/findInventoryForStockTaking",
, layEvent = obj.event; //获得 lay-event 对应的值 data: req,
if (layEvent === 'more') { type: 'get',
let splitInfoList = obj.data.splitInfoList; dataType: 'json',
if (splitInfoList.length > 0) { contentType: "application/json;charset=utf-8",
let dropDownDataList = []; success: function (res) {
for (var i = 0; i < splitInfoList.length; i++) { result = res.data;
let dropDownData = {}; lis.push("<div class='clearfix'>");
dropDownData.title = splitInfoList[i].newUnit; for (let i = 0; i < result.length; i++) {
dropDownData.id = obj.data.id; let splitInventory = result[i].splitInventory;
dropDownDataList.push(dropDownData); let keys = Object.keys(splitInventory);
} let InventoryItem = "";
dropdown.render({ let brandItem ='<p>' + "物料品牌:"+result[i].mbrand + '</p>';
elem: this //触发事件的 DOM 对象 if(result[i].mbrand === ""){
, show: true //外部事件触发即显示 brandItem = "";
, data: dropDownDataList }
, click: function (unit) { for (let j = 0; j < keys.length; j++) {
this.elem[0].childNodes[0].data = unit.title; let key = keys[j];
obj.tr[0].childNodes[6].childNodes[0].innerText = obj.data.splitInventory[unit.title]; let item = '<p>' + "计量单位:" + key + ";库存数量:" + splitInventory[key] + '</p>';
InventoryItem += item;
}
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1"><div class="layui-card-header"><h2>' + "物料名称:" + result[i].mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+ '<p>' + "物料编码:"+result[i].mcode + '</p>'
+ '<p>' + "物料型号:"+result[i].version + '</p>'
+ brandItem
+ '<p>' + "所处位置:"+result[i].dname+"-"+result[i].kingdeecode + '</p>'
+ InventoryItem
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
} }
, align: 'right' //右对齐弹出(v2.6.8 新增)
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式
}) })
} }
//下拉菜单
}
}); });
};
}) })

145
target/classes/templates/pages/showInventory/showInventoryForMaterial.html

@ -78,6 +78,13 @@
autocomplete="off" class="layui-input"> autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">物料品牌</label>
<div class="layui-input-block">
<input type="text" name="brand" id="brand"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">物料类型</label> <label class="layui-form-label">物料类型</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -94,9 +101,9 @@
</div> </div>
</div> </div>
</form> </form>
<table class="layui-hide" id="currentTableForMaterial"
lay-filter="currentTableFilterForMaterial" <ul class="flow-default" id="LAY_InventoryShow"></ul>
style="margin-top: 123px"></table>
</div> </div>
</div> </div>
@ -106,26 +113,25 @@
</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/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 src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script> <script>
function updateTableShowForMaterial() { function updateFlowShowForMaterial() {
} }
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () {
layui.use(['form', 'step', 'flow', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
table = layui.table,
inputTag = layui.inputTag, inputTag = layui.inputTag,
dropdown = layui.dropdown, //下拉菜单 dropdown = layui.dropdown, //下拉菜单
step = layui.step; flow = layui.flow;
let id = $("#id").val(); let id = $("#id").val();
let takingPre = 0;
let size = 8;
$(function () { $(function () {
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({ $.ajax({
@ -151,105 +157,42 @@
$("#version").val(material.version); $("#version").val(material.version);
$("#mtype").val(material.typeName); $("#mtype").val(material.typeName);
$("#texture").val(material.texture); $("#texture").val(material.texture);
$("#brand").val(material.brand);
} }
} }
}); });
updateTableShowForMaterial();
layer.close(loading2); layer.close(loading2);
}); });
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');
};
// 用于监听下拉菜单 flow.load({
table.on('tool(currentTableFilter)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" elem: '#LAY_InventoryShow' //流加载容器
var data = obj.data //获得当前行数据 , done: function (page, next) { //执行下一页的回调
, layEvent = obj.event; //获得 lay-event 对应的值 let result;
if (layEvent === 'more') { let lis = [];
let splitInfoList = obj.data.splitInfoList; $.get('/material/findMaterialByConditionForStockTaking?page=' + page + '&size=' + size + '&mid=' + id, function (res) {
if (splitInfoList.length > 0) { result = res.data;
let dropDownDataList = []; lis.push("<div class='clearfix'>");
for (var i = 0; i < splitInfoList.length; i++) { for (let i = 0; i < result.length; i++) {
let dropDownData = {}; let splitInventory = result[i].splitInventory;
dropDownData.title = splitInfoList[i].newUnit; let keys = Object.keys(splitInventory);
dropDownData.id = obj.data.id; let InventoryItem = "";
dropDownDataList.push(dropDownData); for (let j = 0; j < keys.length; j++) {
} let key = keys[j];
dropdown.render({ let item = '<p>' + "计量单位:" + key + ";库存数量:" + splitInventory[key] + '</p>';
elem: this //触发事件的 DOM 对象 InventoryItem += item;
, 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 新增) lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1"><div class="layui-card-header"><h2>' + "所处位置:" + result[i].dname+"-"+result[i].kingdeecode + '</h2></div>');
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式 lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
}) + InventoryItem
+ '</div></div></li>');
} }
//下拉菜单 lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
});
} }
}); });

Loading…
Cancel
Save