From 725a9f8c9594399c613ea7bf1b7a606e290687ad Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 01 四月 2021 14:26:36 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/ioWorks/stockIn.js | 152 +++++++++++++++++++++++++++++++------
src/main/webapp/views/ioWorks/stockIn.html | 23 +++++
src/main/java/zy/cloud/wms/manager/controller/NodeController.java | 14 +++
3 files changed, 162 insertions(+), 27 deletions(-)
diff --git a/src/main/java/zy/cloud/wms/manager/controller/NodeController.java b/src/main/java/zy/cloud/wms/manager/controller/NodeController.java
index 71dfff8..7c4f356 100644
--- a/src/main/java/zy/cloud/wms/manager/controller/NodeController.java
+++ b/src/main/java/zy/cloud/wms/manager/controller/NodeController.java
@@ -50,6 +50,20 @@
return R.ok(nodeService.selectPage(new Page<>(curr, limit), wrapper));
}
+ @RequestMapping(value = "/node/tree/auth")
+ @ManagerAuth
+ public R tree(@RequestParam(defaultValue = "1")Integer curr,
+ @RequestParam(defaultValue = "10")Integer limit,
+ @RequestParam(required = false)String orderByField,
+ @RequestParam(required = false)String orderByType,
+ @RequestParam Map<String, Object> param){
+ EntityWrapper<Node> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ convert(param, wrapper);
+ if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+ return R.parse("0-鎿嶄綔鎴愬姛").add(nodeService.selectList(wrapper));
+ }
+
private void convert(Map<String, Object> map, EntityWrapper wrapper){
for (Map.Entry<String, Object> entry : map.entrySet()){
String val = String.valueOf(entry.getValue());
diff --git a/src/main/webapp/static/js/ioWorks/stockIn.js b/src/main/webapp/static/js/ioWorks/stockIn.js
index 674e01b..fab1446 100644
--- a/src/main/webapp/static/js/ioWorks/stockIn.js
+++ b/src/main/webapp/static/js/ioWorks/stockIn.js
@@ -10,12 +10,17 @@
return cols;
}
-layui.use(['table','laydate', 'form'], function() {
+layui.config({
+ base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'treeTable'], function() {
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
var layDate = layui.laydate;
var form = layui.form;
+ var admin = layui.admin;
+ var xmSelect = layui.xmSelect;
+ var treeTable = layui.treeTable;
tableIns = table.render({
elem: '#chooseData',
@@ -42,7 +47,7 @@
var checkStatus = table.checkStatus(obj.config.id);
var data = checkStatus.data;
switch(obj.event) {
- case 'comb':
+ case 'confirm':
// 鍒ゆ柇鏄惁瀛樺湪鐗╂枡
if (matCodeData.length === 0) {
layer.msg("璇峰厛娣诲姞鐗╂枡");
@@ -59,29 +64,32 @@
return;
}
}
- $.ajax({
- url: baseUrl+"/full/store/put/start",
- headers: {'token': localStorage.getItem('token')},
- data: JSON.stringify({
- devpNo: Number($('#putSiteSelect').val()),
- list: matCodeData
- }),
- contentType:'application/json;charset=UTF-8',
- method: 'POST',
- async: false,
- success: function (res) {
- if (res.code === 200){
- layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data);
- matCodeData = [];
- tableIns.reload({data: matCodeData,done:function (res) { limit();}});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- break;
+
+ showNodeSelect();
+
+ // $.ajax({
+ // url: baseUrl+"/full/store/put/start",
+ // headers: {'token': localStorage.getItem('token')},
+ // data: JSON.stringify({
+ // devpNo: Number($('#putSiteSelect').val()),
+ // list: matCodeData
+ // }),
+ // contentType:'application/json;charset=UTF-8',
+ // method: 'POST',
+ // async: false,
+ // success: function (res) {
+ // if (res.code === 200){
+ // layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data);
+ // matCodeData = [];
+ // tableIns.reload({data: matCodeData,done:function (res) { limit();}});
+ // } else if (res.code === 403){
+ // top.location.href = baseUrl+"/";
+ // }else {
+ // layer.msg(res.msg)
+ // }
+ // }
+ // })
+ // break;
}
});
@@ -131,6 +139,100 @@
}});
}
+ /* 鏄剧ず琛ㄥ崟寮圭獥 */
+ function showNodeSelect() {
+ admin.open({
+ type: 1,
+ area: '400px',
+ title: '閫夋嫨鍏ュ簱璐т綅',
+ content: $('#nodeSelect').html(),
+ success: function (layero, dIndex) {
+ // 琛ㄥ崟鎻愪氦浜嬩欢
+ form.on('submit(pakin)', function (data) {
+ data.field.parentId = insXmSel.getValue('valueStr');
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/work/stock/pakin",
+ headers: {'token': localStorage.getItem('token')},
+ data: JSON.stringify({
+ devpNo: Number($('#putSiteSelect').val()),
+ list: matCodeData
+ }),
+ contentType:'application/json;charset=UTF-8',
+ method: 'POST',
+ async: false,
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data);
+ matCodeData = [];
+ tableIns.reload({data: matCodeData,done:function (res) { limit();}});
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ // 娓叉煋涓嬫媺鏍�
+ var insXmSel = xmSelect.render({
+ el: '#nodeSel',
+ height: '250px',
+ data: insTb.options.data,
+ initValue: [],
+ model: {label: {type: 'text'}},
+ prop: {
+ name: 'name',
+ value: 'id'
+ },
+ radio: true,
+ clickClose: true,
+ tree: {
+ show: true,
+ indent: 15,
+ strict: false,
+ expandedKeys: true
+ }
+ });
+ // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯
+ $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ layui.form.render('select');
+ }
+ });
+ }
+
+ var insTb = treeTable.render({
+ elem: '#node',
+ url: baseUrl+'/node/tree/auth',
+ headers: {token: localStorage.getItem('token')},
+ height: 'full-200',
+ tree: {
+ iconIndex: 2, // 鎶樺彔鍥炬爣鏄剧ず鍦ㄧ鍑犲垪
+ isPidData: true, // 鏄惁鏄痠d銆乸id褰㈠紡鏁版嵁
+ idName: 'id', // id瀛楁鍚嶇О
+ pidName: 'parentId' // pid瀛楁鍚嶇О
+ },
+ cols: [[
+ {type: 'checkbox'}
+ ,{type: 'numbers'}
+ ,{field: 'name', align: 'left',title: '鍚嶇О', minWidth: 150}
+ ,{field: 'type$', align: 'center',title: '绫诲瀷'}
+ ,{field: 'leading', align: 'center',title: '璐熻矗浜�'}
+ ,{field: 'sort', align: 'center',title: '鎺掑簭', hide: true}
+ ,{field: 'status$', align: 'center',title: '鐘舵��'}
+ ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
+ ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳', hide: true}
+ ,{field: 'memo', align: 'center',title: '澶囨敞', hide: true}
+ ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+ ]],
+ done: function (data) {
+ $('.ew-tree-table-box').css('height', '100%');
+ insTb.expandAll();
+ tbDataList = data;
+ }
+ });
+
});
// 鎻愬彇鐗╂枡
diff --git a/src/main/webapp/views/ioWorks/stockIn.html b/src/main/webapp/views/ioWorks/stockIn.html
index 43c4470..fbe637a 100644
--- a/src/main/webapp/views/ioWorks/stockIn.html
+++ b/src/main/webapp/views/ioWorks/stockIn.html
@@ -9,6 +9,7 @@
<link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../static/css/cool.css" media="all">
<link rel="stylesheet" href="../../static/css/common.css" media="all">
+ <link rel="stylesheet" href="../../static/css/admin.css" media="all">
<style>
html {
height: 100%;
@@ -78,6 +79,10 @@
margin-left: 20px;
display: none;
}
+ #detail {
+ margin: 0;
+ padding: 25px 30px 0 0;
+ }
</style>
</head>
<body>
@@ -96,7 +101,7 @@
<div class="layui-form">
<div class="layui-btn-container">
<!-- 鍚姩鍑哄簱 -->
- <button class="layui-btn layui-btn-lg" id="btn-inbound" lay-event="comb" style="">纭鍏ュ簱</button>
+ <button class="layui-btn layui-btn-lg" id="btn-inbound" lay-event="confirm" style="">纭鍏ュ簱</button>
</div>
</div>
</script>
@@ -108,7 +113,7 @@
<table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
</div>
-
+<!--<table id="node" style="display: none"></table>-->
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
@@ -121,6 +126,20 @@
<option value="{{this}}">{{this}}</option>
{{/each}}
</script>
+<script type="text/html" id="nodeSelect">
+ <form id="detail" lay-filter="detail" class="layui-form">
+ <div class="layui-form-item">
+ <label class="layui-form-label">璐т綅</label>
+ <div class="layui-input-block">
+ <div id="nodeSel" class="ew-xmselect-tree"></div>
+ </div>
+ </div>
+ <div class="layui-form-item text-right">
+ <button class="layui-btn" lay-filter="pakin" lay-submit="">鍏ュ簱</button>
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+ </div>
+ </form>
+</script>
</body>
</html>
--
Gitblit v1.9.1