Commit fba402ea3d21f6ee6295e7fe1f63b6faef69bef3
1 parent
aabe89f3
修改搜索栏日期时间选择器、修改更新入库单头表的方法
Showing
2 changed files
with
31 additions
and
14 deletions
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java
... | ... | @@ -334,22 +334,28 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
334 | 334 | LambdaQueryWrapper<ReceiptDetail> lambdaDetails = Wrappers.lambdaQuery(); |
335 | 335 | lambdaDetails.eq(ReceiptDetail::getReceiptId, id); |
336 | 336 | List<ReceiptDetail> receiptDetails = this.list(lambdaDetails); |
337 | - | |
338 | - // 判断入库明细是否为空 | |
339 | - if (receiptDetails.isEmpty()){ | |
340 | - throw new ServiceException("不存在入库明细"); | |
341 | - } | |
342 | 337 | //查询出头表信息 |
343 | 338 | ReceiptHeader receiptHeader = receiptHeaderService.getById(id); |
344 | - Integer minStatus = Integer.parseInt(receiptDetails.get(0).getProcessStamp()); | |
345 | - Integer maxStatus = Integer.parseInt(receiptDetails.get(0).getProcessStamp()); | |
346 | - //遍历明细状态得出最小状态值 | |
347 | - for (int i = 1; i<receiptDetails.size(); i++){ | |
348 | - if ( minStatus > Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
349 | - minStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); | |
350 | - } | |
351 | - if ( maxStatus < Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
352 | - maxStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); | |
339 | + | |
340 | + int minStatus; | |
341 | + int maxStatus; | |
342 | + // 判断入库明细是否为空, 为空时入库单头表状态为新建 | |
343 | + if (receiptDetails.isEmpty()){ | |
344 | + minStatus = 0; | |
345 | + maxStatus = 0; | |
346 | + } else { | |
347 | + minStatus = Integer.parseInt(receiptDetails.get(0).getProcessStamp()); | |
348 | + maxStatus = Integer.parseInt(receiptDetails.get(0).getProcessStamp()); | |
349 | + | |
350 | + | |
351 | + //遍历明细状态得出最小状态值 | |
352 | + for (int i = 1; i<receiptDetails.size(); i++){ | |
353 | + if ( minStatus > Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
354 | + minStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); | |
355 | + } | |
356 | + if ( maxStatus < Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
357 | + maxStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); | |
358 | + } | |
353 | 359 | } |
354 | 360 | } |
355 | 361 | |
... | ... |
src/main/resources/static/huaheng/js/common.js
... | ... | @@ -29,6 +29,17 @@ $(function(){ |
29 | 29 | laydate.render({ elem: '#endTime', theme: 'molv',value: new Date(endDay), isInitValue: true }); |
30 | 30 | }); |
31 | 31 | } |
32 | + if ($(".time2").length > 0) { | |
33 | + layui.use('laydate', function() { | |
34 | + var laydate = layui.laydate; | |
35 | + var day1 = new Date(); | |
36 | + day1.setTime(day1.getTime()-24*60*60*1000*7); | |
37 | + var endDay = new Date(); | |
38 | + endDay.setTime(endDay.getTime()+24*60*60*1000); | |
39 | + laydate.render({ elem: '#startTime', theme: 'molv'}); | |
40 | + laydate.render({ elem: '#endTime', theme: 'molv'}); | |
41 | + }); | |
42 | + } | |
32 | 43 | }); |
33 | 44 | |
34 | 45 | /** 创建选项卡 */ |
... | ... |