Browse Source

合并盘点时通过物料盘点与位置盘点的表格页面

lwx_dev
erdanergou 3 years ago
parent
commit
460b45af49
  1. 5
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  2. 16
      src/main/resources/templates/pages/post/selectManager.html
  3. 9
      src/main/resources/templates/pages/stockTaking/stockTaking.html
  4. 1
      target/classes/static/js/lay-module/inputTag.js
  5. 16
      target/classes/templates/pages/post/selectManager.html
  6. 9
      target/classes/templates/pages/stockTaking/stockTaking.html

5
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -593,8 +593,11 @@ public class PageController {
// 负责人树形菜单页面 // 负责人树形菜单页面
@GetMapping("/selectManager") @GetMapping("/selectManager")
public ModelAndView selectManager() { public ModelAndView selectManager(@RequestParam Map<String,Object> map) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
if(map.containsKey("type")){
mv.addObject("type",map.get("type"));
}
mv.setViewName("pages/post/selectManager"); mv.setViewName("pages/post/selectManager");
return mv; return mv;
} }

16
src/main/resources/templates/pages/post/selectManager.html

@ -10,6 +10,7 @@
<link rel="stylesheet" href="/static/css/public.css" media="all"> <link rel="stylesheet" href="/static/css/public.css" media="all">
</head> </head>
<body> <body>
<input id="type" th:value="${type}" style="display: none">
<div id="test2" class="demo-tree"></div> <div id="test2" class="demo-tree"></div>
<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> <script>
@ -26,16 +27,13 @@
if (data.children !== undefined) { if (data.children !== undefined) {
return false; return false;
} }
let type = $("#type").val();
var idForMaterial = $("#departmentManagerIdForMaterial", window.parent.document).val(); var id = $("#departmentManagerIdFor"+type, window.parent.document).val();
$("#departmentManagerForMaterial", window.parent.document).val(data.title); $("#departmentManagerFor"+type, window.parent.document).val(data.title);
$("#departmentManagerForLocation", window.parent.document).val(data.title); if (id === undefined || id === null || id === "") {
if (idForMaterial === undefined || idForMaterial === null || idForMaterial === "") { $("#departmentManagerIdFor"+type, window.parent.document).val(data.id + ",");
$("#departmentManagerIdForMaterial", window.parent.document).val(data.id + ",");
$("#departmentManagerIdForLocation", window.parent.document).val(data.id + ",");
} else { } else {
$("#departmentManagerIdForMaterial", window.parent.document).val(idForMaterial + data.id + ","); $("#departmentManagerIdFor"+type, window.parent.document).val(id + data.id + ",");
$("#departmentManagerIdForLocation", window.parent.document).val(idForMaterial + data.id + ",");
} }
var index = parent.layer.getFrameIndex(window.name); var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index); parent.layer.close(index);

9
src/main/resources/templates/pages/stockTaking/stockTaking.html

@ -314,6 +314,7 @@
// 用于存储当前选择的负责人 // 用于存储当前选择的负责人
let departmentManagerIdForMaterial; let departmentManagerIdForMaterial;
let departmentManagerIdForLocation; let departmentManagerIdForLocation;
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
@ -476,7 +477,7 @@
area: ['70%', '70%'], area: ['70%', '70%'],
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
content: '/selectManager', content: '/selectManager?type=Material',
end: function () { end: function () {
departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val(); departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val();
tagLabel.createItem(); tagLabel.createItem();
@ -503,7 +504,7 @@
area: ['70%', '70%'], area: ['70%', '70%'],
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
content: '/selectManager', content: '/selectManager?type=Location',
end: function () { end: function () {
departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val();
tagLabel1.createItem(); tagLabel1.createItem();
@ -725,6 +726,9 @@
}; };
// 通过位置盘点物料页面
table.render({ table.render({
elem: "#currentTableForLocation", elem: "#currentTableForLocation",
url: '/material/findInventoryForStockTaking', url: '/material/findInventoryForStockTaking',
@ -842,6 +846,7 @@
}) })
}; };
table.on('edit(currentTableFilterForLocation)', function (obj) { table.on('edit(currentTableFilterForLocation)', function (obj) {
obj.update({stockTakingQuantity: obj.value});//修改当前行数据 obj.update({stockTakingQuantity: obj.value});//修改当前行数据
calculateForLocation(obj); calculateForLocation(obj);

1
target/classes/static/js/lay-module/inputTag.js

@ -77,7 +77,6 @@
createItem() { createItem() {
var value = this.elem.val().trim(); var value = this.elem.val().trim();
if (this.options.beforeCreate && typeof this.options.beforeCreate === 'function') { if (this.options.beforeCreate && typeof this.options.beforeCreate === 'function') {
var modifiedValue = this.options.beforeCreate(this.copyData, value); var modifiedValue = this.options.beforeCreate(this.copyData, value);
if (typeof modifiedValue == 'string' && modifiedValue) { if (typeof modifiedValue == 'string' && modifiedValue) {

16
target/classes/templates/pages/post/selectManager.html

@ -10,6 +10,7 @@
<link rel="stylesheet" href="/static/css/public.css" media="all"> <link rel="stylesheet" href="/static/css/public.css" media="all">
</head> </head>
<body> <body>
<input id="type" th:value="${type}" style="display: none">
<div id="test2" class="demo-tree"></div> <div id="test2" class="demo-tree"></div>
<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> <script>
@ -26,18 +27,13 @@
if (data.children !== undefined) { if (data.children !== undefined) {
return false; return false;
} }
var name = $("#departmentManager", window.parent.document).val(); let type = $("#type").val();
var id = $("#departmentManagerIdFor"+type, window.parent.document).val();
var id = $("#departmentManagerId", window.parent.document).val(); $("#departmentManagerFor"+type, window.parent.document).val(data.title);
$("#departmentManager", window.parent.document).val(data.title);
// if (name === undefined || name === null || name === "") {
// } else {
// $("#departmentManager", window.parent.document).val(name + data.title);
// }
if (id === undefined || id === null || id === "") { if (id === undefined || id === null || id === "") {
$("#departmentManagerId", window.parent.document).val(data.id + ","); $("#departmentManagerIdFor"+type, window.parent.document).val(data.id + ",");
} else { } else {
$("#departmentManagerId", window.parent.document).val(id + data.id + ","); $("#departmentManagerIdFor"+type, window.parent.document).val(id + data.id + ",");
} }
var index = parent.layer.getFrameIndex(window.name); var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index); parent.layer.close(index);

9
target/classes/templates/pages/stockTaking/stockTaking.html

@ -314,6 +314,7 @@
// 用于存储当前选择的负责人 // 用于存储当前选择的负责人
let departmentManagerIdForMaterial; let departmentManagerIdForMaterial;
let departmentManagerIdForLocation; let departmentManagerIdForLocation;
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () {
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
@ -476,7 +477,7 @@
area: ['70%', '70%'], area: ['70%', '70%'],
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
content: '/selectManager', content: '/selectManager?type=Material',
end: function () { end: function () {
departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val(); departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val();
tagLabel.createItem(); tagLabel.createItem();
@ -503,7 +504,7 @@
area: ['70%', '70%'], area: ['70%', '70%'],
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
content: '/selectManager', content: '/selectManager?type=Location',
end: function () { end: function () {
departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val();
tagLabel1.createItem(); tagLabel1.createItem();
@ -725,6 +726,9 @@
}; };
// 通过位置盘点物料页面
table.render({ table.render({
elem: "#currentTableForLocation", elem: "#currentTableForLocation",
url: '/material/findInventoryForStockTaking', url: '/material/findInventoryForStockTaking',
@ -842,6 +846,7 @@
}) })
}; };
table.on('edit(currentTableFilterForLocation)', function (obj) { table.on('edit(currentTableFilterForLocation)', function (obj) {
obj.update({stockTakingQuantity: obj.value});//修改当前行数据 obj.update({stockTakingQuantity: obj.value});//修改当前行数据
calculateForLocation(obj); calculateForLocation(obj);

Loading…
Cancel
Save