Commit ae39af12a41a9201030dfbe963be26fa8b318600

Authored by xqs
1 parent 1146e47e

库存明细页面及库存交易页面排错

src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java
... ... @@ -12,20 +12,14 @@ import com.huaheng.framework.web.controller.BaseController;
12 12 import com.huaheng.framework.web.page.PageDomain;
13 13 import com.huaheng.framework.web.page.TableDataInfo;
14 14 import com.huaheng.framework.web.page.TableSupport;
15   -import com.huaheng.pc.general.material.domain.Material;
16 15 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
17   -import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader;
18 16 import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
19 17 import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
20 18 import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
21   -import org.apache.shiro.authz.annotation.RequiresPermissions;
22 19 import org.springframework.stereotype.Controller;
23 20 import org.springframework.ui.ModelMap;
24 21 import org.springframework.web.bind.annotation.*;
25   -
26 22 import javax.annotation.Resource;
27   -import java.math.BigDecimal;
28   -import java.text.NumberFormat;
29 23 import java.util.ArrayList;
30 24 import java.util.List;
31 25  
... ... @@ -57,11 +51,11 @@ public class InventoryTransactionController extends BaseController{
57 51 /**
58 52 * 查询库存交易列表
59 53 */
60   - //@RequiresPermissions("inventory:inventoryTransaction:list")
  54 + //@RequiresPermissions("inventory:inventoryTransaction:inventoryTransactionList")
61 55 @Log(title = "库存-库存交易",operating = "查看库存交易列表", action = BusinessType.GRANT)
62   - @PostMapping("/list")
  56 + @PostMapping("/inventoryTransactionList")
63 57 @ResponseBody
64   - public TableDataInfo list(InventoryTransaction inventoryTransaction,String createdBegin, String createdEnd)
  58 + public TableDataInfo inventoryTransactionList(InventoryTransaction inventoryTransaction,String createdBegin, String createdEnd)
65 59 {
66 60 LambdaQueryWrapper<InventoryTransaction> lambdaQueryWrapper = Wrappers.lambdaQuery();
67 61 PageDomain pageDomain = TableSupport.buildPageRequest();
... ... @@ -69,6 +63,10 @@ public class InventoryTransactionController extends BaseController{
69 63 Integer pageSize = pageDomain.getPageSize();
70 64  
71 65 lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),InventoryTransaction::getCreated, createdBegin)
  66 + .le(StringUtils.isNotEmpty(createdEnd), InventoryTransaction::getCreated, createdEnd)//创建时间范围
  67 + .eq(InventoryTransaction::getWarehouseCode,ShiroUtils.getWarehouseCode())//仓库
  68 +
  69 +
72 70 .orderByDesc(InventoryTransaction::getId);
73 71  
74 72 if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
... ...
src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java
... ... @@ -91,9 +91,9 @@ public class InventoryTransaction implements Serializable {
91 91 /**
92 92 * 数量
93 93 */
94   - @TableField(value = "qty")
95   - @ApiModelProperty(value="数量")
96   - private Integer taskqty;
  94 + @TableField(value = "taskQty")
  95 + @ApiModelProperty(value="任务数量")
  96 + private Integer taskQty;
97 97  
98 98 /**
99 99 * 库存状态
... ... @@ -278,6 +278,11 @@ public class InventoryTransaction implements Serializable {
278 278 @ApiModelProperty(value = "单据明细ID")
279 279 private Integer billDetailId;
280 280  
281   -
  281 + /**
  282 + * 供应商编码
  283 + * */
  284 + @TableField(value = "supplierCode")
  285 + @ApiModelProperty(value = "供应商编码")
  286 + private String supplierCode;
282 287  
283 288 }
284 289 \ No newline at end of file
... ...
src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
... ... @@ -10,13 +10,13 @@
10 10 <div class="select-list">
11 11 <ul>
12 12 <li>
13   - 库存头ID:<input type="text" name="inventoryHeaderId"/>
  13 + 库存头ID:<input id="inventoryHeaderId" type="text" name="inventoryHeaderId"/>
14 14 </li>
15 15 <li>
16   - 库位编号:<input type="text" name="locationCode"/>
  16 + 库位编号:<input id="locationCode" type="text" name="locationCode"/>
17 17 </li>
18 18 <li>
19   - 容器编号:<input type="text" name="containerCode"/>
  19 + 容器编号:<input id="containerCode" type="text" name="containerCode"/>
20 20 </li>
21 21 <li>
22 22 物料编码:<input type="text" name="materialCode"/>
... ... @@ -300,26 +300,32 @@
300 300 visible: false
301 301 }
302 302 ]
303   - };
304   - let url = location.search; //获取url中"?"符后的字串
305   - let str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
306   - let strs = str.split("="); //用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
307   - if (url.indexOf("?") === -1) {options.url=prefix + "/inventoryDetailLook"} //判断是否有参数
308   - $.table.init(options);
309   - $.ajax({
310   - url: prefix + "/inventoryDetailLook",
311   - type: "post",
312   - data: {
313   - inventoryHeaderId: strs[1] || null
314   - },
315   - success: function (res) {
316   - $("#bootstrap-table").bootstrapTable('removeAll');
317   - for (let i = 0; i < res.data.length; i++) {
318   - $("#bootstrap-table").bootstrapTable('insertRow', {index: i, row: res.data[i]});
  303 + },url = location.search.substr(1);
  304 + let strs = url.split("&");
  305 + $("#inventoryHeaderId").val(strs[0]);
  306 + $("#locationCode").val(strs[1]);
  307 + $("#containerCode").val(strs[2]);
  308 + if (location.search.indexOf("?") === -1) {
  309 + options.url = prefix + "/inventoryDetailLook";
  310 + $.table.init(options);
  311 + }
  312 + else{
  313 + $.table.init(options);
  314 + $.ajax({
  315 + url: prefix + "/inventoryDetailLook",
  316 + type: "post",
  317 + data: {
  318 + inventoryHeaderId: strs[0] || null
  319 + },
  320 + success: function (res) {
  321 + $("#bootstrap-table").bootstrapTable('removeAll');
  322 + for (let i = 0; i < res.data.length; i++) {
  323 + $("#bootstrap-table").bootstrapTable('insertRow', {index: i, row: res.data[i]});
319 324  
  325 + }
320 326 }
321   - }
322   - })
  327 + })
  328 + }
323 329 }
324 330  
325 331 function checkOut() {
... ...
src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
... ... @@ -202,11 +202,8 @@
202 202  
203 203 });
204 204  
205   - function detail(id) {
206   - let url = ctx + "inventory/inventoryDetail"; //明细网页地址
207   - if (id) {
208   - url = ctx + "inventory/inventoryDetail?inventoryHeaderId=" + id;
209   - }
  205 + $('#bootstrap-table').on('dbl-click-row.bs.table', function (row, value) {
  206 + let url = `${ctx}inventory/inventoryDetail?${value.id}&${value.locationCode}&${value.containerCode}`;
210 207 $("#tabDetail").children().remove();
211 208 $("#myTab li").removeClass("active");
212 209 var height = $(document).height() - 100 + 'px';
... ... @@ -216,7 +213,23 @@
216 213 $(".tab-pane").removeClass("in active");
217 214 $("#myTab li:eq(1)").addClass("active");
218 215 $("#tabDetail").addClass("in active");
219   - }
  216 + });
  217 +
  218 + // function detail(id) {
  219 + // let url = ctx + "inventory/inventoryDetail"; //明细网页地址
  220 + // if (id) {
  221 + // url = ctx + "inventory/inventoryDetail?inventoryHeaderId=" + id;
  222 + // }
  223 + // $("#tabDetail").children().remove();
  224 + // $("#myTab li").removeClass("active");
  225 + // var height = $(document).height() - 100 + 'px';
  226 + // var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
  227 + // $("#tabDetail").empty();
  228 + // $("#tabDetail").append(str);
  229 + // $(".tab-pane").removeClass("in active");
  230 + // $("#myTab li:eq(1)").addClass("active");
  231 + // $("#tabDetail").addClass("in active");
  232 + // }
220 233  
221 234 function cyclecountPrint(id) {
222 235 var url = prefix + "/report/" + id;
... ... @@ -224,7 +237,16 @@
224 237 }
225 238  
226 239 $("#myTab li:eq(1)").click(function () {
227   - detail();
  240 + let url = ctx + "inventory/inventoryDetail"; //明细网页地址
  241 + $("#tabDetail").children().remove();
  242 + $("#myTab li").removeClass("active");
  243 + var height = $(document).height() - 100 + 'px';
  244 + var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
  245 + $("#tabDetail").empty();
  246 + $("#tabDetail").append(str);
  247 + $(".tab-pane").removeClass("in active");
  248 + $("#myTab li:eq(1)").addClass("active");
  249 + $("#tabDetail").addClass("in active");
228 250 });
229 251  
230 252 function checkOut() {
... ...
src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
... ... @@ -15,22 +15,12 @@
15 15 <li>
16 16 容器编码:<input type="text" name="containerCode"/>
17 17 </li>
18   - <li>
19   - u8仓库:<select name="uWarehouseCode" th:with="warehouse=${@warehouse.selectList()}">
20   - <option value="">所有</option>
21   - <option th:each="e : ${warehouse}" th:text="${e['uWarehouseName']}" th:value="${e['uWarehouseCode']}"></option></select>
22   - </li>
  18 +
  19 +
23 20 <li>
24 21 项 目 号:<input type="text" name="project"/>
25 22 </li>
26 23 <li>
27   - 货 主:
28   - <select name="companyCode" th:with="list=${@company.selectCompanyByCurrentUserId()}">
29   - <option value="">所有</option>
30   - <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}"></option>
31   - </select>
32   - </li>
33   - <li>
34 24 交易类型:<select name="type" th:with="type=${@dict.getType('inventoryTransactionType')}">
35 25 <option value="">所有</option>
36 26 <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
... ... @@ -77,7 +67,7 @@
77 67 var inventoryTransactionType = [[${@dict.getType('inventoryTransactionType')}]];
78 68 $(function() {
79 69 $("#bootstrap-table").bootstrapTable({
80   - url: prefix + "/list",
  70 + // url: prefix + "/inventoryTransactionList",
81 71 modalName: "库存交易",
82 72 method:"post",
83 73 contentType: "application/x-www-form-urlencoded",
... ... @@ -124,7 +114,13 @@
124 114 },
125 115 {
126 116 field : 'companyCode',
127   - title : '货主编码'
  117 + title : '货主编码',
  118 + visible:true
  119 + },
  120 + {
  121 + field : 'supplierCode',
  122 + title : '供应商',
  123 + visible:true
128 124 },
129 125 {
130 126 field : 'materialCode',
... ... @@ -148,19 +144,27 @@
148 144 },
149 145 {
150 146 field : 'billDetailId',
151   - title : '出入库明细ID'
  147 + title : '出入库明细ID',
  148 + visible:false
152 149 },
153 150 {
  151 + field : 'taskQty',
  152 + title : '任务数量'
  153 + },
  154 + {
154 155 field : 'batch',
155   - title : '批次'
  156 + title : '批次',
  157 + visible:false
156 158 },
157 159 {
158 160 field : 'lot',
159   - title : '批号'
  161 + title : '批号',
  162 + visible:false
160 163 },
161 164 {
162 165 field : 'projectNo',
163   - title : '项目号'
  166 + title : '项目号',
  167 + visible:true
164 168 },
165 169 {
166 170 field : 'referCode',
... ... @@ -173,7 +177,8 @@
173 177 },
174 178 {
175 179 field : 'qcCheck',
176   - title : '质检'
  180 + title : '质检',
  181 + visible:false
177 182 },
178 183 {
179 184 field : 'weight',
... ... @@ -198,14 +203,11 @@
198 203 return $.table.selectDictLabel(inventoryStatus, value);
199 204 }
200 205 },
201   - {
202   - field : 'taskQty',
203   - title : '执行数量'
204   - },
  206 +
205 207 {
206 208 field : 'created',
207 209 title : '交易时间',
208   - // sortable:true
  210 + sortable:true
209 211 },
210 212 {
211 213 field : 'createdBy',
... ... @@ -214,7 +216,7 @@
214 216 {
215 217 field : 'attributeId',
216 218 title : '属性',
217   - visible:false
  219 + visible:true
218 220 },
219 221 {
220 222 field : 'attribute1',
... ... @@ -252,202 +254,30 @@
252 254 },
253 255 // {
254 256 // field : 'userDef1',
255   - // title : '自定义字段1'
  257 + // title : '自定义字段1',
  258 + // visible:false
256 259 // },
257 260 // {
258 261 // field : 'userDef2',
259   - // title : '自定义字段2'
  262 + // title : '自定义字段2',
  263 + // visible:false
260 264 // },
261 265 // {
262 266 // field : 'userDef3',
263   - // title : '自定义字段3'
  267 + // title : '自定义字段3',
  268 + // visible:false
264 269 // },
265 270 ]
266 271 });
267 272  
268 273 $.ajax({
269   - url:prefix+'/list',
  274 + url:prefix+'/inventoryTransactionList',
270 275 type:"post",
271 276 success:function (value) {
272 277 $("#bootstrap-table").bootstrapTable('load',value.data);
273 278 }
274 279 })
275 280  
276   - // var options = {
277   - // url: prefix + "/list",
278   - // createUrl: prefix + "/add",
279   - // updateUrl: prefix + "/edit/{id}",
280   - // removeUrl: prefix + "/remove",
281   - // modalName: "库存交易",
282   - // search: false,
283   - // sortable: true, // 是否启用排序
284   - // sortStable: true, // 设置为 true 将获得稳定的排序
285   - // sortName: "id",
286   - // sortOrder: "desc",
287   - // showExport: true, //导出
288   - // exportDataType: "selected", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
289   - // columns: [{
290   - // checkbox: true
291   - // },
292   - // {
293   - // field : 'id',
294   - // title : '标识'
295   - // },
296   - // {
297   - // field : 'locationId',
298   - // title : '库位id',
299   - // visible:false
300   - // },
301   - // {
302   - // field : 'locationCode',
303   - // title : '库位编号'
304   - // },
305   - // {
306   - // field : 'sourceCode',
307   - // title : '上游系统单号'
308   - // },
309   - // {
310   - // field : 'sourceLine',
311   - // title : '上游系统行号'
312   - // },
313   - // {
314   - // field : 'type',
315   - // title : '交易类型',
316   - // formatter: function(value, row, index) {
317   - // return $.table.selectDictLabel(inventoryTransactionType, value);
318   - // }
319   - // },
320   - // {
321   - // field : 'companyId',
322   - // title : '货主id',
323   - // visible:false
324   - // },
325   - // {
326   - // field : 'companyCode',
327   - // title : '货主编码'
328   - // },
329   - // {
330   - // field : 'materialId',
331   - // title : '物料标识' ,
332   - // visible:false
333   - // },
334   - // {
335   - // field : 'materialCode',
336   - // title : '存货编码'
337   - // },
338   - // {
339   - // field : 'materialName',
340   - // title : '物料名称'
341   - // },
342   - // {
343   - // field : 'materialSpec',
344   - // title : '物料规格'
345   - // },
346   - // {
347   - // field : 'billId',
348   - // title : '单id'
349   - // },
350   - // {
351   - // field : 'billCode',
352   - // title : '出入库单号'
353   - // },
354   - // /* {
355   - // field : 'billDetailId',
356   - // title : '单明细id'
357   - // },*/
358   - // {
359   - // field : 'batch',
360   - // title : '批次'
361   - // },
362   - // {
363   - // field : 'lot',
364   - // title : '批号'
365   - // },
366   - // {
367   - // field : 'project',
368   - // title : '项目号'
369   - // },
370   - // {
371   - // field : 'manufactureDate',
372   - // title : '生产日期' ,
373   - // visible:false
374   - // },
375   - // {
376   - // field : 'expirationDate',
377   - // title : '失效日期' ,
378   - // visible:false
379   - // },
380   - // {
381   - // field : 'status',
382   - // title : '库存状态' ,
383   - // align: 'center',
384   - // formatter: function(value, row, index) {
385   - // return $.table.selectDictLabel(inventoryStatus, value);
386   - // }
387   - // },
388   - // {
389   - // field : 'qty',
390   - // title : '数量'
391   - // },
392   - // {
393   - // field : 'taskQty',
394   - // title : '执行预定数量'
395   - // },
396   - // {
397   - // field : 'costPrice',
398   - // title : '成本'
399   - // },
400   - // {
401   - // field : 'listPrice',
402   - // title : '标价' ,
403   - // visible:false
404   - // },
405   - // {
406   - // field : 'netPrice',
407   - // title : '净价' ,
408   - // visible:false
409   - // },
410   - // {
411   - // field : 'created',
412   - // title : '交易时间',
413   - // // sortable:true
414   - // },
415   - // {
416   - // field : 'createdBy',
417   - // title : '创建用户'
418   - // },
419   - // {
420   - // field : 'lastUpdated',
421   - // title : '最后修改时间'
422   - // },
423   - // {
424   - // field : 'lastUpdatedBy',
425   - // title : '更新用户'
426   - // },
427   - // // {
428   - // // field : 'userDef1',
429   - // // title : '自定义字段1'
430   - // // },
431   - // // {
432   - // // field : 'userDef2',
433   - // // title : '自定义字段2'
434   - // // },
435   - // // {
436   - // // field : 'userDef3',
437   - // // title : '自定义字段3'
438   - // // },
439   - // /*{
440   - // title: '操作',
441   - // align: 'center',
442   - // /*formatter: function(value, row, index) {
443   - // var actions = [];
444   - // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
445   - // return actions.join('');
446   - // }
447   - // }*/
448   - // ]
449   - // };
450   - // $.table.init(options);
451 281 });
452 282  
453 283 function report() {
... ...