Commit dfdc44af49836dfb9ad6cdc0c8ff9970b6ba8228
1 parent
7822e88d
组盘页面增加筛选功能
Showing
5 changed files
with
410 additions
and
363 deletions
src/main/java/com/huaheng/framework/aspectj/lang/constant/DataSourceName.java
... | ... | @@ -2,7 +2,7 @@ package com.huaheng.framework.aspectj.lang.constant; |
2 | 2 | |
3 | 3 | /** |
4 | 4 | * 多数据源别名 |
5 | - * | |
5 | + * | |
6 | 6 | * @author huaheng |
7 | 7 | * |
8 | 8 | */ |
... | ... | @@ -13,4 +13,7 @@ public class DataSourceName |
13 | 13 | |
14 | 14 | /** 从库 */ |
15 | 15 | public static final String SLAVE = "slave"; |
16 | + | |
17 | + /** wcs库*/ | |
18 | + public static final String WCS = "wcs"; | |
16 | 19 | } |
... | ... |
src/main/java/com/huaheng/framework/config/DruidConfig.java
... | ... | @@ -6,6 +6,7 @@ import javax.sql.DataSource; |
6 | 6 | |
7 | 7 | import com.alibaba.druid.support.http.StatViewServlet; |
8 | 8 | import com.alibaba.druid.support.http.WebStatFilter; |
9 | +import org.springframework.beans.factory.annotation.Qualifier; | |
9 | 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
10 | 11 | import org.springframework.boot.context.properties.ConfigurationProperties; |
11 | 12 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
... | ... | @@ -19,7 +20,7 @@ import com.huaheng.framework.datasource.DynamicDataSource; |
19 | 20 | |
20 | 21 | /** |
21 | 22 | * druid 配置多数据源 |
22 | - * | |
23 | + * | |
23 | 24 | * @author huaheng |
24 | 25 | */ |
25 | 26 | @Configuration |
... | ... | @@ -40,9 +41,17 @@ public class DruidConfig |
40 | 41 | return DruidDataSourceBuilder.create().build(); |
41 | 42 | } |
42 | 43 | |
44 | +// @Bean(name = "wcs") | |
45 | +// @ConfigurationProperties("spring.datasource.druid.wcs") | |
46 | +// public DataSource wcsDataSource() | |
47 | +// { | |
48 | +// return DruidDataSourceBuilder.create().build(); | |
49 | +// } | |
50 | + | |
43 | 51 | @Bean(name = "dynamicDataSource") |
44 | 52 | @Primary |
45 | - public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource) | |
53 | + public DynamicDataSource dataSource(DataSource masterDataSource, | |
54 | + DataSource slaveDataSource) | |
46 | 55 | { |
47 | 56 | Map<Object, Object> targetDataSources = new HashMap<>(); |
48 | 57 | targetDataSources.put(DataSourceName.MASTER, masterDataSource); |
... | ... |
src/main/java/com/huaheng/pc/config/container/controller/ContainerController.java
... | ... | @@ -97,7 +97,7 @@ public class ContainerController extends BaseController { |
97 | 97 | |
98 | 98 | @PostMapping("/emptyContainer") |
99 | 99 | @ResponseBody |
100 | - public TableDataInfo emptyContainer() { | |
100 | + public TableDataInfo emptyContainer(String containerType) { | |
101 | 101 | LambdaQueryWrapper<Container> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
102 | 102 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
103 | 103 | Integer pageNum = pageDomain.getPageNum(); |
... | ... | @@ -105,6 +105,7 @@ public class ContainerController extends BaseController { |
105 | 105 | lambdaQueryWrapper |
106 | 106 | .eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY) |
107 | 107 | .isNotNull(Container::getLocationCode) |
108 | + .eq(StringUtils.isNotEmpty(containerType),Container::getContainerType,containerType) | |
108 | 109 | .ne(Container::getLocationCode, "") |
109 | 110 | .eq(Container::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
110 | 111 | .eq(Container::getEnable,true) |
... | ... |
src/main/resources/templates/index.html
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | <li th:each="menu : ${menus}"> |
68 | 68 | <a href="#"> |
69 | 69 | <i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i> |
70 | - <span class="nav-label" th:text="${menu.menuName}">一级菜单</span> | |
70 | + <span class="nav-label" th:text="${menu.menuName}">一级菜单</span> | |
71 | 71 | <span class="fa arrow"></span> |
72 | 72 | </a> |
73 | 73 | <ul class="nav nav-second-level collapse"> |
... | ... | @@ -91,7 +91,7 @@ |
91 | 91 | </div> |
92 | 92 | </nav> |
93 | 93 | <!--左侧导航结束--> |
94 | - | |
94 | + | |
95 | 95 | <!--右侧部分开始--> |
96 | 96 | <div id="page-wrapper" class="gray-bg dashbard-1"> |
97 | 97 | |
... | ... | @@ -120,6 +120,11 @@ |
120 | 120 | <i class="fa fa-envelope"></i> <sup></sup> <!--<span class="label label-warning">16</span>--> |
121 | 121 | </a> |
122 | 122 | <ul class="dropdown-menu dropdown-messages" id="notice"> |
123 | + <li> | |
124 | + <div> | |
125 | + | |
126 | + </div> | |
127 | + </li> | |
123 | 128 | <li th:each="notice : ${notices}"> |
124 | 129 | <div class="dropdown-messages-box"> |
125 | 130 | <div class="media-body"> |
... | ... |
src/main/resources/templates/receipt/receiving/receiving.html
... | ... | @@ -3,87 +3,112 @@ |
3 | 3 | <meta charset="utf-8"> |
4 | 4 | <head th:include="include :: header"></head> |
5 | 5 | <style> |
6 | - .table-striped-left{ | |
7 | - width: 41%; | |
8 | - /*margin-right: 4px;*/ | |
9 | - } | |
10 | - .table-striped-right{ | |
11 | - /*right: -10px;*/ | |
12 | - width: 58%; | |
13 | - float: right; | |
14 | - } | |
15 | - .info_text{ | |
16 | - float: right; | |
17 | - } | |
18 | - .info_text li{ | |
19 | - font-size: 16px; | |
20 | - } | |
21 | - .info_text li span{ | |
22 | - font-size: 20px; | |
23 | - font-weight: bold; | |
24 | - color: rgb(28,132,198); | |
25 | - } | |
6 | + .table-striped-left { | |
7 | + width: 41%; | |
8 | + /*margin-right: 4px;*/ | |
9 | + } | |
10 | + | |
11 | + .table-striped-right { | |
12 | + /*right: -10px;*/ | |
13 | + width: 58%; | |
14 | + float: right; | |
15 | + } | |
16 | + | |
17 | + .info_text { | |
18 | + float: right; | |
19 | + } | |
20 | + | |
21 | + .info_text li { | |
22 | + font-size: 16px; | |
23 | + } | |
24 | + | |
25 | + .info_text li span { | |
26 | + font-size: 20px; | |
27 | + font-weight: bold; | |
28 | + color: rgb(28, 132, 198); | |
29 | + } | |
30 | + | |
31 | + .top_text { | |
32 | + position: relative; | |
33 | + top: 10px; | |
34 | + } | |
26 | 35 | </style> |
27 | 36 | <body class="gray-bg"> |
28 | 37 | <div class="container-div"> |
29 | 38 | |
30 | - <div class="row"> | |
31 | - <div class="col-sm-12 select-info"> | |
32 | - <form id="dept-form"> | |
33 | - <div class="select-list"> | |
34 | - <ul> | |
35 | - <li> | |
36 | - 收货单号:<input type="text" id="code" name="deptName"/> | |
37 | - </li> | |
38 | - <li> | |
39 | - <a class="btn btn-primary btn-rounded btn-sm" id="list-btn"><i class="fa fa-search"></i> 搜索</a> | |
40 | - </li> | |
41 | - </ul> | |
42 | - <ul class="info_text"> | |
43 | - <li>物料总数:<span id="material_length"></span></li> | |
44 | - <li>总单据数量:<span id="qty_length"></span></li> | |
45 | - <li>已收货数量:<span id="qtyCompleted_length"></span></li> | |
46 | - </ul> | |
47 | - </div> | |
48 | - </form> | |
49 | - </div> | |
50 | - | |
51 | - <div class="col-sm-12 select-info table-striped-left" style="padding-top: 20px;"> | |
52 | - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> | |
53 | - </div> | |
54 | - <div class="col-sm-12 select-info table-striped-right"> | |
55 | - <ul class="select-list"> | |
56 | - <li style="display: none">id:<input type="text" id="detailId" /></li> | |
57 | - <li>收货数量:<input type="text" id="receiveNum" /></li> | |
58 | - <li>容器编号:<input type="text" id="containerCode" /></li> | |
59 | - <li><button class="btn btn-sm btn-success" onclick="receipt()">组盘</button></li> | |
60 | - </ul> | |
61 | - <div class="btn-group hidden-xs" id="toolbar1" role="group"> | |
62 | - <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add"> | |
63 | - <i class="fa fa-map-pin"></i> 定位 | |
64 | - </a> | |
65 | - <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()" shiro:hasPermission="receipt:receiptDetail:remove"> | |
66 | - <i class="fa fa-times"></i> 取消定位 | |
67 | - </a> | |
68 | - <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()" shiro:hasPermission="receipt:receiptDetail:remove"> | |
69 | - <i class="fa fa-trash-o"></i> 取消收货 | |
70 | - </a> | |
71 | - <a class="btn btn-outline btn-warning btn-rounded" onclick="createTask()" shiro:hasPermission="receipt:receiptContainer:add"> | |
72 | - <i class="fa fa-edit"></i> 生成任务 | |
73 | - </a> | |
74 | - </div> | |
75 | - <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> | |
76 | - <hr style="border-top:1px solid white;"> | |
77 | - <ul class="select-list"> | |
78 | - <li><span class="table-title">本物料库存</span></li> | |
79 | - </ul> | |
80 | - <table id="bootstrap-table2" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> | |
81 | - <ul class="select-list"> | |
82 | - <li><span class="table-title">空料盒</span></li> | |
83 | - </ul> | |
84 | - <table id="bootstrap-table3" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> | |
85 | - </div> | |
86 | - </div> | |
39 | + <div class="row"> | |
40 | + <div class="col-sm-12 select-info"> | |
41 | + <form id="dept-form"> | |
42 | + <div class="select-list"> | |
43 | + <ul> | |
44 | + <li> | |
45 | + 收货单号:<input type="text" id="code" name="deptName"/> | |
46 | + </li> | |
47 | + <li> | |
48 | + <a class="btn btn-primary btn-rounded btn-sm" id="list-btn"><i class="fa fa-search"></i> 搜索</a> | |
49 | + </li> | |
50 | + </ul> | |
51 | + <ul class="info_text"> | |
52 | + <li>物料总数:<span id="material_length"></span></li> | |
53 | + <li>总单据数量:<span id="qty_length"></span></li> | |
54 | + <li>已收货数量:<span id="qtyCompleted_length"></span></li> | |
55 | + </ul> | |
56 | + </div> | |
57 | + </form> | |
58 | + </div> | |
59 | + | |
60 | + <div class="col-sm-12 select-info table-striped-left" style="padding-top: 20px;"> | |
61 | + <table id="bootstrap-table" data-mobile-responsive="true" | |
62 | + class="table table-bordered table-hover text-nowrap"></table> | |
63 | + </div> | |
64 | + <div class="col-sm-12 select-info table-striped-right"> | |
65 | + <ul class="select-list"> | |
66 | + <li style="display: none">id:<input type="text" id="detailId"/></li> | |
67 | + <li>收货数量:<input type="text" id="receiveNum"/></li> | |
68 | + <li>容器编号:<input type="text" id="containerCode"/></li> | |
69 | + <li> | |
70 | + <button class="btn btn-sm btn-success" onclick="receipt()">组盘</button> | |
71 | + </li> | |
72 | + </ul> | |
73 | + <div class="btn-group hidden-xs" id="toolbar1" role="group"> | |
74 | + <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" | |
75 | + shiro:hasPermission="receipt:receiptDetail:add"> | |
76 | + <i class="fa fa-map-pin"></i> 定位 | |
77 | + </a> | |
78 | + <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()" | |
79 | + shiro:hasPermission="receipt:receiptDetail:remove"> | |
80 | + <i class="fa fa-times"></i> 取消定位 | |
81 | + </a> | |
82 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()" | |
83 | + shiro:hasPermission="receipt:receiptDetail:remove"> | |
84 | + <i class="fa fa-trash-o"></i> 取消收货 | |
85 | + </a> | |
86 | + <a class="btn btn-outline btn-warning btn-rounded" onclick="createTask()" | |
87 | + shiro:hasPermission="receipt:receiptContainer:add"> | |
88 | + <i class="fa fa-edit"></i> 生成任务 | |
89 | + </a> | |
90 | + </div> | |
91 | + <table id="bootstrap-table1" data-mobile-responsive="true" | |
92 | + class="table table-bordered table-hover text-nowrap"></table> | |
93 | + <ul class="select-list top_text"> | |
94 | + <li><span class="table-title">本物料库存</span></li> | |
95 | + </ul> | |
96 | + <table id="bootstrap-table2" data-mobile-responsive="true" | |
97 | + class="table table-bordered table-hover text-nowrap"></table> | |
98 | + | |
99 | + <ul class="select-list top_text"> | |
100 | + <li>空料盒 容器类型:<select name="type" id="containerType" th:with="typeList=${@containerType.getCode()}"> | |
101 | + <option value="">所有</option> | |
102 | + <option th:each="c:${typeList}" th:text="${c['name']}" th:value="${c['code']}"></option> | |
103 | + </select></li> | |
104 | + <li> | |
105 | + <button class="btn btn-sm btn-success" onclick="containerTypeSearch()">搜索</button> | |
106 | + </li> | |
107 | + </ul> | |
108 | + <table id="bootstrap-table3" data-mobile-responsive="true" | |
109 | + class="table table-bordered table-hover text-nowrap"></table> | |
110 | + </div> | |
111 | + </div> | |
87 | 112 | </div> |
88 | 113 | <div th:include="include :: footer"></div> |
89 | 114 | <script th:inline="javascript"> |
... | ... | @@ -91,30 +116,30 @@ |
91 | 116 | var removeFlag = [[${@permission.hasPermi('receipt:receiving:remove')}]]; |
92 | 117 | var prefix = ctx + "receipt/receiving"; |
93 | 118 | var Types = [[${@dict.getType('taskType')}]]; |
94 | - var Status=[[${@dict.getType('receiptContainerHeaderStatus')}]]; | |
95 | - var inventoryStatus =[[${@dict.getType('inventoryStatus')}]]; | |
96 | - | |
97 | - $(function () { | |
98 | - $("#bootstrap-table3").bootstrapTable({ | |
99 | - url: ctx+'config/container/emptyContainer', | |
100 | - iconSize: "outline", | |
101 | - modalName: "空盒", | |
102 | - pagination: true, // 是否显示分页(*) | |
103 | - pageNumber: 1,// 初始化加载第一页,默认第一页 | |
104 | - method: 'post', | |
105 | - pageSize: 5, // 每页的记录行数(*) | |
106 | - showRefresh: true, | |
107 | - pageList: [10, 25, 50], | |
108 | - contentType: "application/x-www-form-urlencoded", | |
109 | - columns: [{ | |
110 | - field : 'code', | |
111 | - title : '容器编号' | |
112 | - },{ | |
113 | - field : 'locationCode', | |
114 | - title : '库位编号' | |
115 | - }] | |
116 | - }); | |
117 | - }); | |
119 | + var Status = [[${@dict.getType('receiptContainerHeaderStatus')}]]; | |
120 | + var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; | |
121 | + | |
122 | + $(function () { | |
123 | + $("#bootstrap-table3").bootstrapTable({ | |
124 | + url: ctx + 'config/container/emptyContainer', | |
125 | + iconSize: "outline", | |
126 | + modalName: "空盒", | |
127 | + pagination: true, // 是否显示分页(*) | |
128 | + pageNumber: 1,// 初始化加载第一页,默认第一页 | |
129 | + method: 'post', | |
130 | + pageSize: 5, // 每页的记录行数(*) | |
131 | + showRefresh: true, | |
132 | + pageList: [10, 25, 50], | |
133 | + contentType: "application/x-www-form-urlencoded", | |
134 | + columns: [{ | |
135 | + field: 'code', | |
136 | + title: '容器编号' | |
137 | + }, { | |
138 | + field: 'locationCode', | |
139 | + title: '库位编号' | |
140 | + }] | |
141 | + }); | |
142 | + }); | |
118 | 143 | |
119 | 144 | function list_select(code) { |
120 | 145 | $.ajax({ |
... | ... | @@ -124,39 +149,38 @@ |
124 | 149 | data: { |
125 | 150 | code: code |
126 | 151 | }, |
127 | - error:function (response) { | |
152 | + error: function (response) { | |
128 | 153 | console.log(response); |
129 | 154 | }, |
130 | 155 | success: function (value) { |
131 | - var qty_show=0; | |
132 | - var qtyCompleted_show=0; | |
156 | + var qty_show = 0; | |
157 | + var qtyCompleted_show = 0; | |
133 | 158 | $("#bootstrap-table").bootstrapTable('removeAll'); |
134 | - if(value.data){ | |
159 | + if (value.data) { | |
135 | 160 | for (var i = 0; i < value.data.length; i++) { |
136 | 161 | if (value.data[i].totalQty > value.data[i].openQty) { |
137 | 162 | $("#bootstrap-table").bootstrapTable('insertRow', { |
138 | 163 | index: 0, row: { |
139 | - projectNo:value.data[i].project, | |
164 | + projectNo: value.data[i].project, | |
140 | 165 | id: value.data[i].id, |
141 | - materialName: value.data[i].materialName, | |
166 | + materialName: value.data[i].materialName, | |
142 | 167 | receiptId: value.data[i].receiptId, |
143 | 168 | receiptCode: value.data[i].receiptCode, |
144 | 169 | materialCode: value.data[i].materialCode, |
145 | 170 | totalQty: value.data[i].totalQty, |
146 | 171 | openQty: value.data[i].openQty, |
147 | 172 | inventorySts: value.data[i].inventorySts, |
148 | - materialUnit: value.data[i].materialUnit | |
173 | + materialUnit: value.data[i].materialUnit | |
149 | 174 | } |
150 | 175 | }); |
151 | 176 | } |
152 | - qty_show=value.data[i].totalQty + qty_show; | |
153 | - qtyCompleted_show=value.data[i].openQty + qtyCompleted_show; | |
177 | + qty_show = value.data[i].totalQty + qty_show; | |
178 | + qtyCompleted_show = value.data[i].openQty + qtyCompleted_show; | |
154 | 179 | } |
155 | 180 | $("#material_length").text(value.data.length); |
156 | 181 | $("#qty_length").text(qty_show); |
157 | 182 | $("#qtyCompleted_length").text(qtyCompleted_show); |
158 | - } | |
159 | - else { | |
183 | + } else { | |
160 | 184 | console.log("收货单不存在!") |
161 | 185 | } |
162 | 186 | } |
... | ... | @@ -171,19 +195,19 @@ |
171 | 195 | data: { |
172 | 196 | code: code |
173 | 197 | }, |
174 | - error:function (response) { | |
198 | + error: function (response) { | |
175 | 199 | console.log(response); |
176 | 200 | }, |
177 | 201 | success: function (value) { |
178 | 202 | $("#bootstrap-table1").bootstrapTable('removeAll'); |
179 | - if(value.data){ | |
203 | + if (value.data) { | |
180 | 204 | for (var i = 0; i < value.data.length; i++) { |
181 | 205 | $("#bootstrap-table1").bootstrapTable('insertRow', { |
182 | 206 | index: 0, row: { |
183 | - projectNo :value.data[i].projectNo, | |
207 | + projectNo: value.data[i].projectNo, | |
184 | 208 | id: value.data[i].id, |
185 | - receiptContainerId:value.data[i].receiptContainerId, | |
186 | - receiptDetailId:value.data[i].receiptDetailId, | |
209 | + receiptContainerId: value.data[i].receiptContainerId, | |
210 | + receiptDetailId: value.data[i].receiptDetailId, | |
187 | 211 | containerCode: value.data[i].containerCode, |
188 | 212 | locationCode: value.data[i].locationCode, |
189 | 213 | materialCode: value.data[i].materialCode, |
... | ... | @@ -196,8 +220,7 @@ |
196 | 220 | } |
197 | 221 | }); |
198 | 222 | } |
199 | - } | |
200 | - else { | |
223 | + } else { | |
201 | 224 | console.log("没有查找到入库容器!") |
202 | 225 | } |
203 | 226 | } |
... | ... | @@ -206,7 +229,7 @@ |
206 | 229 | |
207 | 230 | $("#list-btn").click(initTable); |
208 | 231 | |
209 | - $("body").bind("keypress",function(e){ | |
232 | + $("body").bind("keypress", function (e) { | |
210 | 233 | // 兼容FF和IE和Opera |
211 | 234 | var theEvent = e || window.event; |
212 | 235 | var code = theEvent.keyCode || theEvent.which || theEvent.charCode; |
... | ... | @@ -214,17 +237,17 @@ |
214 | 237 | e.preventDefault(); |
215 | 238 | //回车执行查询 |
216 | 239 | initTable(); |
217 | - // list_select($("#code").val()); | |
240 | + // list_select($("#code").val()); | |
218 | 241 | } |
219 | 242 | }); |
220 | 243 | |
221 | - function initTable(){ | |
222 | - var receiptCode=$("#code").val(); | |
244 | + function initTable() { | |
245 | + var receiptCode = $("#code").val(); | |
223 | 246 | list_select(receiptCode); |
224 | 247 | list_receiptInfo(receiptCode); |
225 | - $("#bootstrap-table1").bootstrapTable('removeAll'); | |
226 | - $("#bootstrap-table2").bootstrapTable('removeAll'); | |
227 | - } | |
248 | + $("#bootstrap-table1").bootstrapTable('removeAll'); | |
249 | + $("#bootstrap-table2").bootstrapTable('removeAll'); | |
250 | + } | |
228 | 251 | |
229 | 252 | $("#bootstrap-table").bootstrapTable({ |
230 | 253 | // url: prefix + "/list", |
... | ... | @@ -234,23 +257,23 @@ |
234 | 257 | contentType: "application/x-www-form-urlencoded", |
235 | 258 | clickToSelect: true, |
236 | 259 | modalName: "收货", |
237 | - onRefresh: function(){ | |
260 | + onRefresh: function () { | |
238 | 261 | |
239 | - }, | |
240 | - onClickRow:function(row,ele,field){ | |
241 | - let code=$("#code").val(); | |
262 | + }, | |
263 | + onClickRow: function (row, ele, field) { | |
264 | + let code = $("#code").val(); | |
242 | 265 | $("#detailId").val(row.id); |
243 | - $("#receiveNum").val(row.totalQty-row.openQty); | |
266 | + $("#receiveNum").val(row.totalQty - row.openQty); | |
244 | 267 | $.ajax({ |
245 | - url:prefix+'/getInventoryInfo', | |
246 | - type:'post', | |
247 | - data:{ | |
248 | - code:code, | |
249 | - id:row.id | |
268 | + url: prefix + '/getInventoryInfo', | |
269 | + type: 'post', | |
270 | + data: { | |
271 | + code: code, | |
272 | + id: row.id | |
250 | 273 | }, |
251 | - success:res=>{ | |
274 | + success: res => { | |
252 | 275 | // $("#bootstrap-table1").bootstrapTable('load',res.data.list); |
253 | - $("#bootstrap-table2").bootstrapTable('load',res.data.inventoryList); | |
276 | + $("#bootstrap-table2").bootstrapTable('load', res.data.inventoryList); | |
254 | 277 | // $("#bootstrap-table3").bootstrapTable('load',res.data.containerList); |
255 | 278 | } |
256 | 279 | }) |
... | ... | @@ -265,57 +288,57 @@ |
265 | 288 | // title : '收货单编码' |
266 | 289 | // }, |
267 | 290 | { |
268 | - field : 'id', | |
269 | - title : '明细id' | |
291 | + field: 'id', | |
292 | + title: '明细id' | |
270 | 293 | }, |
271 | 294 | { |
272 | - field : 'materialCode', | |
273 | - title : '物料编码' | |
295 | + field: 'materialCode', | |
296 | + title: '物料编码' | |
274 | 297 | }, |
275 | 298 | { |
276 | 299 | field: "materialName", |
277 | 300 | title: "名称" |
278 | 301 | }, |
279 | 302 | { |
280 | - field : 'totalQty', | |
281 | - title : '单据数量' | |
303 | + field: 'totalQty', | |
304 | + title: '单据数量' | |
282 | 305 | }, |
283 | 306 | { |
284 | - field : 'openQty', | |
285 | - title : '已入数量' | |
307 | + field: 'openQty', | |
308 | + title: '已入数量' | |
286 | 309 | }, |
287 | 310 | { |
288 | - field : 'inventorySts', | |
289 | - title : '库存状态' | |
311 | + field: 'inventorySts', | |
312 | + title: '库存状态' | |
290 | 313 | }, |
291 | 314 | { |
292 | - field : 'projectNo', | |
293 | - title : '项目号' | |
315 | + field: 'projectNo', | |
316 | + title: '项目号' | |
294 | 317 | }, |
295 | 318 | { |
296 | - field : 'materialUnit', | |
297 | - title : '单位' | |
319 | + field: 'materialUnit', | |
320 | + title: '单位' | |
298 | 321 | }, |
299 | 322 | |
300 | - ] | |
323 | + ] | |
301 | 324 | }); |
302 | 325 | |
303 | 326 | $("#bootstrap-table1").bootstrapTable({ |
304 | 327 | removeUrl: ctx + "receipt/receiptContainerDetail/remove", |
305 | 328 | // search: true, //搜索 |
306 | 329 | showRefresh: true, //刷新 |
307 | - showToggle:true, //视图切换 | |
330 | + showToggle: true, //视图切换 | |
308 | 331 | clickToSelect: true, |
309 | - showColumns:true, //列选择 | |
332 | + showColumns: true, //列选择 | |
310 | 333 | // detailView:true, |
311 | - toolbar: "#toolbar1", | |
334 | + toolbar: "#toolbar1", | |
312 | 335 | showExport: true, //导出 |
313 | 336 | exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 |
314 | 337 | modalName: "入库组盘", |
315 | 338 | iconSize: "outline", |
316 | 339 | toolbar: "#toolbar1", |
317 | 340 | contentType: "application/x-www-form-urlencoded", |
318 | - onRefresh: function(){ | |
341 | + onRefresh: function () { | |
319 | 342 | list_receiptInfo($("#code").val()); |
320 | 343 | }, |
321 | 344 | columns: [ |
... | ... | @@ -323,139 +346,139 @@ |
323 | 346 | checkbox: true |
324 | 347 | }, |
325 | 348 | { |
326 | - field : 'id', | |
327 | - title : '组盘明细id', | |
349 | + field: 'id', | |
350 | + title: '组盘明细id', | |
328 | 351 | visible: false |
329 | 352 | }, |
330 | 353 | { |
331 | - field : 'receiptContainerId', | |
332 | - title : '组盘头id', | |
333 | - visible: false | |
354 | + field: 'receiptContainerId', | |
355 | + title: '组盘头id', | |
356 | + visible: false | |
334 | 357 | }, |
335 | 358 | { |
336 | - field : 'containerCode', | |
337 | - title : '容器编号' | |
359 | + field: 'containerCode', | |
360 | + title: '容器编号' | |
338 | 361 | }, |
339 | 362 | { |
340 | - field : 'locationCode', | |
341 | - title : '库位编号' | |
363 | + field: 'locationCode', | |
364 | + title: '库位编号' | |
342 | 365 | }, |
343 | 366 | { |
344 | - field : 'materialCode', | |
345 | - title : '物料编码' | |
367 | + field: 'materialCode', | |
368 | + title: '物料编码' | |
346 | 369 | }, |
347 | 370 | { |
348 | - field:"materialName", | |
349 | - title:"物料名称" | |
371 | + field: "materialName", | |
372 | + title: "物料名称" | |
350 | 373 | }, |
351 | 374 | { |
352 | - field:"materialSpec", | |
353 | - title:"物料规格" | |
375 | + field: "materialSpec", | |
376 | + title: "物料规格" | |
354 | 377 | }, |
355 | 378 | { |
356 | - field : 'qty', | |
357 | - title : '数量' | |
379 | + field: 'qty', | |
380 | + title: '数量' | |
358 | 381 | }, |
359 | 382 | { |
360 | - field : 'project', | |
361 | - title : '项目号', | |
362 | - visible: false | |
383 | + field: 'project', | |
384 | + title: '项目号', | |
385 | + visible: false | |
363 | 386 | }, |
364 | 387 | { |
365 | - field : 'status', | |
366 | - title : '组盘状态', | |
388 | + field: 'status', | |
389 | + title: '组盘状态', | |
367 | 390 | align: 'center', |
368 | - formatter: function(value, row, index) { | |
391 | + formatter: function (value, row, index) { | |
369 | 392 | return $.table.selectDictLabel(Status, value); |
370 | 393 | } |
371 | 394 | }, |
372 | 395 | { |
373 | - field : 'receiptDetailId', | |
374 | - title : '入库单明细id' | |
396 | + field: 'receiptDetailId', | |
397 | + title: '入库单明细id' | |
375 | 398 | }, |
376 | 399 | { |
377 | - field : 'created', | |
378 | - title : '创建时间' | |
400 | + field: 'created', | |
401 | + title: '创建时间' | |
379 | 402 | }, |
380 | 403 | { |
381 | - field : 'createdBy', | |
382 | - title : '创建人' | |
404 | + field: 'createdBy', | |
405 | + title: '创建人' | |
383 | 406 | }, |
384 | 407 | { |
385 | 408 | title: '操作', |
386 | 409 | align: 'center', |
387 | - events:'operateEvents', | |
388 | - formatter: function(value, row, index) { | |
410 | + events: 'operateEvents', | |
411 | + formatter: function (value, row, index) { | |
389 | 412 | var actions = []; |
390 | 413 | if (row.status == 0) { |
391 | 414 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a>'); |
392 | - } | |
415 | + } | |
393 | 416 | return actions.join(''); |
394 | 417 | } |
395 | 418 | }] |
396 | 419 | }); |
397 | 420 | |
398 | - $("#bootstrap-table2").bootstrapTable({ | |
399 | - removeUrl: ctx + "receipt/receiptContainerDetail/remove", | |
400 | - clickToSelect: true, | |
401 | - showColumns:true, //列选择 | |
402 | - showExport: true, //导出 | |
403 | - iconSize: "outline", | |
404 | - toolbar: "#toolbar", | |
405 | - exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 | |
406 | - modalName: "入库组盘", | |
407 | - pagination: true, // 是否显示分页(*) | |
408 | - pageNumber: 1, // 初始化加载第一页,默认第一页 | |
409 | - pageSize: 5, // 每页的记录行数(*) | |
410 | - pageList: [10, 25, 50], | |
411 | - contentType: "application/x-www-form-urlencoded", | |
412 | - columns: [ | |
413 | - { | |
414 | - field : 'containerCode', | |
415 | - title : '容器编号' | |
416 | - }, | |
417 | - { | |
418 | - field : 'materialCode', | |
419 | - title : '存货编码' | |
420 | - }, | |
421 | - { | |
422 | - field : 'materialName', | |
423 | - title : '物料名称' | |
424 | - }, | |
425 | - { | |
426 | - field : 'materialSpec', | |
427 | - title : '物料规格' | |
428 | - }, | |
429 | - { | |
430 | - field : 'qty', | |
431 | - title : '数量' | |
432 | - }, | |
433 | - { | |
434 | - field : 'companyName', | |
435 | - title : '货主' | |
436 | - }, | |
437 | - { | |
438 | - field : 'locationCode', | |
439 | - title : '库位编号' | |
440 | - }, | |
441 | - { | |
442 | - field : 'status', | |
443 | - title : '库存状态' , | |
444 | - align: 'center', | |
445 | - formatter: function(value, row, index) { | |
446 | - return $.table.selectDictLabel(inventoryStatus, value); | |
447 | - } | |
448 | - }, | |
449 | - ] | |
450 | - }); | |
421 | + $("#bootstrap-table2").bootstrapTable({ | |
422 | + removeUrl: ctx + "receipt/receiptContainerDetail/remove", | |
423 | + clickToSelect: true, | |
424 | + showColumns: true, //列选择 | |
425 | + showExport: true, //导出 | |
426 | + iconSize: "outline", | |
427 | + toolbar: "#toolbar", | |
428 | + exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 | |
429 | + modalName: "入库组盘", | |
430 | + pagination: true, // 是否显示分页(*) | |
431 | + pageNumber: 1, // 初始化加载第一页,默认第一页 | |
432 | + pageSize: 5, // 每页的记录行数(*) | |
433 | + pageList: [10, 25, 50], | |
434 | + contentType: "application/x-www-form-urlencoded", | |
435 | + columns: [ | |
436 | + { | |
437 | + field: 'containerCode', | |
438 | + title: '容器编号' | |
439 | + }, | |
440 | + { | |
441 | + field: 'materialCode', | |
442 | + title: '存货编码' | |
443 | + }, | |
444 | + { | |
445 | + field: 'materialName', | |
446 | + title: '物料名称' | |
447 | + }, | |
448 | + { | |
449 | + field: 'materialSpec', | |
450 | + title: '物料规格' | |
451 | + }, | |
452 | + { | |
453 | + field: 'qty', | |
454 | + title: '数量' | |
455 | + }, | |
456 | + { | |
457 | + field: 'companyName', | |
458 | + title: '货主' | |
459 | + }, | |
460 | + { | |
461 | + field: 'locationCode', | |
462 | + title: '库位编号' | |
463 | + }, | |
464 | + { | |
465 | + field: 'status', | |
466 | + title: '库存状态', | |
467 | + align: 'center', | |
468 | + formatter: function (value, row, index) { | |
469 | + return $.table.selectDictLabel(inventoryStatus, value); | |
470 | + } | |
471 | + }, | |
472 | + ] | |
473 | + }); | |
451 | 474 | window.operateEvents = { |
452 | 475 | 'click #qty': function (e, value, row, index) { |
453 | 476 | var url = prefix + '/add?'; |
454 | - jQuery.each(row, function(key, val) { | |
477 | + jQuery.each(row, function (key, val) { | |
455 | 478 | url = url + key + "=" + encodeURI(val) + "&"; |
456 | 479 | }); |
457 | - var modalName="入库组盘"; | |
458 | - $.modal.open("添加"+modalName,url); | |
480 | + var modalName = "入库组盘"; | |
481 | + $.modal.open("添加" + modalName, url); | |
459 | 482 | } |
460 | 483 | }; |
461 | 484 | |
... | ... | @@ -464,104 +487,104 @@ |
464 | 487 | $("#code").val(receiving_code); |
465 | 488 | if (receiving_code) { |
466 | 489 | initTable(); |
467 | - } | |
490 | + } | |
468 | 491 | localStorage.removeItem("receiving_code"); |
469 | 492 | } |
470 | 493 | |
471 | 494 | receiving_refresh(); |
472 | 495 | |
473 | 496 | function remove(id) { |
474 | - $.modal.confirm("确定删除该组盘?", function() { | |
497 | + $.modal.confirm("确定删除该组盘?", function () { | |
475 | 498 | var url = ctx + "receipt/receiptContainerDetail/remove"; |
476 | - var data = { "ids": id }; | |
477 | - $.operate.submitAndCallback(url, "post", "json", data, initTable); | |
499 | + var data = {"ids": id}; | |
500 | + $.operate.submitAndCallback(url, "post", "json", data, initTable); | |
478 | 501 | }); |
479 | 502 | } |
480 | 503 | |
481 | - function positioning() { | |
482 | - let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
483 | - if (rows.length == 0) { | |
484 | - $.modal.alertWarning("请至少选择一条记录"); | |
485 | - return; | |
486 | - } | |
487 | - var url = ctx+"receipt/receiptContainerHeader/position"; | |
488 | - var ids = ""; | |
489 | - for (var i = 0; i<rows.length; i++){ | |
490 | - ids += rows[i].receiptContainerId; | |
491 | - ids += ","; | |
492 | - } | |
493 | - var data = { "ids": ids }; | |
494 | - $.modal.loading("正在处理中,请稍后..."); | |
495 | - var config = { | |
496 | - url: url, | |
497 | - type: "post", | |
498 | - dataType: "json", | |
499 | - data: data, | |
500 | - success: function(result) { | |
501 | - $.operate.ajaxSuccess(result); | |
502 | - list_receiptInfo($("#code").val()); | |
503 | - } | |
504 | - }; | |
505 | - $.ajax(config) | |
506 | - $.table.refresh("bootstrap-table1"); | |
507 | - } | |
508 | - | |
509 | - function cancelPositioning() { | |
510 | - let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
511 | - if (rows.length == 0) { | |
512 | - $.modal.alertWarning("请至少选择一条记录"); | |
513 | - return; | |
514 | - } | |
515 | - var url = ctx+"receipt/receiptContainerHeader/cancelPosition"; | |
516 | - var ids = ""; | |
517 | - for (var i = 0; i<rows.length; i++){ | |
518 | - ids += rows[i].receiptContainerId; | |
519 | - ids += ","; | |
520 | - } | |
521 | - var data = { "ids": ids }; | |
522 | - | |
523 | - $.modal.loading("正在处理中,请稍后..."); | |
524 | - var config = { | |
525 | - url: url, | |
526 | - type: "post", | |
527 | - dataType: "json", | |
528 | - data: data, | |
529 | - success: function(result) { | |
530 | - $.operate.ajaxSuccess(result); | |
531 | - list_receiptInfo($("#code").val()); | |
532 | - } | |
533 | - }; | |
534 | - $.ajax(config) | |
535 | - $.table.refresh("bootstrap-table1"); | |
536 | - } | |
537 | - | |
538 | - function batRemove() { | |
539 | - let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
540 | - if (rows.length == 0) { | |
541 | - $.modal.alertWarning("请至少选择一条记录"); | |
542 | - return; | |
543 | - } | |
544 | - var url = ctx+"receipt/receiptContainerDetail/remove"; | |
545 | - var ids = ""; | |
546 | - for (var i = 0; i<rows.length; i++){ | |
547 | - ids += rows[i].id; | |
548 | - ids += ","; | |
549 | - } | |
550 | - var data = { "ids": ids }; | |
551 | - var config = { | |
552 | - url: url, | |
553 | - type: "post", | |
554 | - dataType: "json", | |
555 | - data: data, | |
556 | - success: function(result) { | |
557 | - $.operate.ajaxSuccess(result); | |
558 | - list_receiptInfo($("#code").val()); | |
559 | - list_select($("#code").val()); | |
560 | - } | |
561 | - }; | |
562 | - $.ajax(config); | |
563 | - $.table.refresh("bootstrap-table1"); | |
564 | - } | |
504 | + function positioning() { | |
505 | + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
506 | + if (rows.length == 0) { | |
507 | + $.modal.alertWarning("请至少选择一条记录"); | |
508 | + return; | |
509 | + } | |
510 | + var url = ctx + "receipt/receiptContainerHeader/position"; | |
511 | + var ids = ""; | |
512 | + for (var i = 0; i < rows.length; i++) { | |
513 | + ids += rows[i].receiptContainerId; | |
514 | + ids += ","; | |
515 | + } | |
516 | + var data = {"ids": ids}; | |
517 | + $.modal.loading("正在处理中,请稍后..."); | |
518 | + var config = { | |
519 | + url: url, | |
520 | + type: "post", | |
521 | + dataType: "json", | |
522 | + data: data, | |
523 | + success: function (result) { | |
524 | + $.operate.ajaxSuccess(result); | |
525 | + list_receiptInfo($("#code").val()); | |
526 | + } | |
527 | + }; | |
528 | + $.ajax(config) | |
529 | + $.table.refresh("bootstrap-table1"); | |
530 | + } | |
531 | + | |
532 | + function cancelPositioning() { | |
533 | + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
534 | + if (rows.length == 0) { | |
535 | + $.modal.alertWarning("请至少选择一条记录"); | |
536 | + return; | |
537 | + } | |
538 | + var url = ctx + "receipt/receiptContainerHeader/cancelPosition"; | |
539 | + var ids = ""; | |
540 | + for (var i = 0; i < rows.length; i++) { | |
541 | + ids += rows[i].receiptContainerId; | |
542 | + ids += ","; | |
543 | + } | |
544 | + var data = {"ids": ids}; | |
545 | + | |
546 | + $.modal.loading("正在处理中,请稍后..."); | |
547 | + var config = { | |
548 | + url: url, | |
549 | + type: "post", | |
550 | + dataType: "json", | |
551 | + data: data, | |
552 | + success: function (result) { | |
553 | + $.operate.ajaxSuccess(result); | |
554 | + list_receiptInfo($("#code").val()); | |
555 | + } | |
556 | + }; | |
557 | + $.ajax(config) | |
558 | + $.table.refresh("bootstrap-table1"); | |
559 | + } | |
560 | + | |
561 | + function batRemove() { | |
562 | + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
563 | + if (rows.length == 0) { | |
564 | + $.modal.alertWarning("请至少选择一条记录"); | |
565 | + return; | |
566 | + } | |
567 | + var url = ctx + "receipt/receiptContainerDetail/remove"; | |
568 | + var ids = ""; | |
569 | + for (var i = 0; i < rows.length; i++) { | |
570 | + ids += rows[i].id; | |
571 | + ids += ","; | |
572 | + } | |
573 | + var data = {"ids": ids}; | |
574 | + var config = { | |
575 | + url: url, | |
576 | + type: "post", | |
577 | + dataType: "json", | |
578 | + data: data, | |
579 | + success: function (result) { | |
580 | + $.operate.ajaxSuccess(result); | |
581 | + list_receiptInfo($("#code").val()); | |
582 | + list_select($("#code").val()); | |
583 | + } | |
584 | + }; | |
585 | + $.ajax(config); | |
586 | + $.table.refresh("bootstrap-table1"); | |
587 | + } | |
565 | 588 | |
566 | 589 | function receipt() { |
567 | 590 | let containerCode = $("#containerCode").val(); |
... | ... | @@ -574,26 +597,25 @@ |
574 | 597 | * @param locationCode |
575 | 598 | * @param containerCode |
576 | 599 | */ |
577 | - function Receiving(locationCode,containerCode) { | |
578 | - let receiptCode=$("#code").val(); | |
579 | - let num=$("#receiveNum").val(); | |
580 | - let receiptDetailId=$("#detailId").val(); | |
600 | + function Receiving(locationCode, containerCode) { | |
601 | + let receiptCode = $("#code").val(); | |
602 | + let num = $("#receiveNum").val(); | |
603 | + let receiptDetailId = $("#detailId").val(); | |
581 | 604 | $.ajax({ |
582 | - url:ctx + "receipt/receiving/save", | |
583 | - type:'post', | |
584 | - data:{ | |
585 | - receiptCode:receiptCode, | |
605 | + url: ctx + "receipt/receiving/save", | |
606 | + type: 'post', | |
607 | + data: { | |
608 | + receiptCode: receiptCode, | |
586 | 609 | qty: num, |
587 | - receiptDetailId:receiptDetailId, | |
588 | - locationCode:locationCode, | |
589 | - containerCode:containerCode | |
610 | + receiptDetailId: receiptDetailId, | |
611 | + locationCode: locationCode, | |
612 | + containerCode: containerCode | |
590 | 613 | }, |
591 | - success:function (data) { | |
592 | - if(data.code===200){ | |
614 | + success: function (data) { | |
615 | + if (data.code === 200) { | |
593 | 616 | $.modal.msgSuccess('成功'); |
594 | 617 | initTable(); |
595 | - } | |
596 | - else{ | |
618 | + } else { | |
597 | 619 | $.modal.msg(data.msg); |
598 | 620 | } |
599 | 621 | } |
... | ... | @@ -602,24 +624,24 @@ |
602 | 624 | |
603 | 625 | |
604 | 626 | function createTask() { |
605 | - let rows=$("#bootstrap-table1").bootstrapTable('getSelections'); | |
606 | - if (rows.length == 0) { | |
607 | - $.modal.alertWarning("请至少选择一条记录"); | |
608 | - return; | |
609 | - } | |
627 | + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); | |
628 | + if (rows.length == 0) { | |
629 | + $.modal.alertWarning("请至少选择一条记录"); | |
630 | + return; | |
631 | + } | |
610 | 632 | let url = ctx + "receipt/receiptContainerHeader/createTask"; |
611 | 633 | let ids = ""; |
612 | - for(let i=0; i<rows.length; i++) { | |
634 | + for (let i = 0; i < rows.length; i++) { | |
613 | 635 | ids = ids + rows[i].receiptContainerId + "," |
614 | 636 | } |
615 | - let data = { "ids": ids.substring(0, ids.length-1) }; | |
637 | + let data = {"ids": ids.substring(0, ids.length - 1)}; | |
616 | 638 | $.modal.loading("正在处理中,请稍后..."); |
617 | 639 | var config = { |
618 | 640 | url: url, |
619 | 641 | type: "post", |
620 | 642 | dataType: "json", |
621 | 643 | data: data, |
622 | - success: function(result) { | |
644 | + success: function (result) { | |
623 | 645 | if (result.code == web_status.SUCCESS) { |
624 | 646 | $.modal.msgSuccess(result.msg); |
625 | 647 | $.table.refresh("bootstrap-table1"); |
... | ... | @@ -631,7 +653,14 @@ |
631 | 653 | }; |
632 | 654 | $.ajax(config) |
633 | 655 | |
634 | - } | |
656 | + } | |
657 | + | |
658 | + function containerTypeSearch() { | |
659 | + var params = { | |
660 | + query:{containerType:$("#containerType").val()} | |
661 | + } | |
662 | + $("#bootstrap-table3").bootstrapTable('refresh',params); | |
663 | + } | |
635 | 664 | </script> |
636 | 665 | </body> |
637 | 666 | </html> |
... | ... |