Commit 0095a64c4b9bfbed6c5933cab712eac467c78861
Merge remote-tracking branch 'origin/develop' into develop
Showing
14 changed files
with
95 additions
and
75 deletions
src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
... | ... | @@ -38,8 +38,6 @@ public class adjustDetailController extends BaseController { |
38 | 38 | |
39 | 39 | |
40 | 40 | @Resource |
41 | - private AdjustHeaderService adjustHeaderService; | |
42 | - @Resource | |
43 | 41 | private AdjustHeaderMapper adjustHeaderMapper; |
44 | 42 | @Resource |
45 | 43 | private AdjustDetailService adjustDetailService; |
... | ... | @@ -49,7 +47,7 @@ public class adjustDetailController extends BaseController { |
49 | 47 | private String prefix = "inventory/adjustDetail"; |
50 | 48 | |
51 | 49 | |
52 | - //@RequiresPermissions("inventory:cycleCount:view") | |
50 | + @RequiresPermissions("inventory:adjustDetail:view") | |
53 | 51 | @GetMapping() |
54 | 52 | public String adjustHeader() |
55 | 53 | { |
... | ... | @@ -60,7 +58,7 @@ public class adjustDetailController extends BaseController { |
60 | 58 | /** |
61 | 59 | * 查询调整单主列表 |
62 | 60 | */ |
63 | - //@RequiresPermissions("inventory:cycleCount:list") | |
61 | + @RequiresPermissions("inventory:adjustDetail:list") | |
64 | 62 | @PostMapping("/list") |
65 | 63 | @Log(title = "库存-调整",operating = "查看调整明细单", action = BusinessType.GRANT) |
66 | 64 | @ResponseBody |
... | ... | @@ -121,7 +119,7 @@ public class adjustDetailController extends BaseController { |
121 | 119 | /** |
122 | 120 | * 保存新增调整明细 |
123 | 121 | */ |
124 | - //@RequiresPermissions("inventory:cyclecountDetail:add") | |
122 | + @RequiresPermissions("inventory:adjustDetail:add") | |
125 | 123 | @Log(title = "库存-盘点", operating = "新增盘点补货明细", action = BusinessType.INSERT) |
126 | 124 | @PostMapping("/addAdjust") |
127 | 125 | @ResponseBody |
... | ... | @@ -150,7 +148,7 @@ public class adjustDetailController extends BaseController { |
150 | 148 | * 调整数量,调整库存状态 |
151 | 149 | * 调整插入库存 |
152 | 150 | */ |
153 | - //@RequiresPermissions("inventory:cyclecountAdjustDetail:addAdjust") | |
151 | + @RequiresPermissions("inventory:adjustDetail:addAdjust") | |
154 | 152 | @Log(title = "库存-调整单", operating = "调整单调整库存差异,调整数量", action = BusinessType.UPDATE) |
155 | 153 | @PostMapping("/adjustEdit") |
156 | 154 | @ResponseBody |
... | ... | @@ -177,6 +175,7 @@ public class adjustDetailController extends BaseController { |
177 | 175 | * @param ids |
178 | 176 | * @return |
179 | 177 | */ |
178 | + @RequiresPermissions("inventory:adjustDetail:adjustAgree") | |
180 | 179 | @Log(title = "库存-调整单", operating = "调整审批", action = BusinessType.OTHER) |
181 | 180 | @PostMapping("/adjustAgree") |
182 | 181 | @ResponseBody |
... | ... | @@ -199,7 +198,7 @@ public class adjustDetailController extends BaseController { |
199 | 198 | /** |
200 | 199 | * 删除调整单明细 |
201 | 200 | */ |
202 | - //@RequiresPermissions("inventory:cyclecountDetail:remove") | |
201 | + @RequiresPermissions("inventory:adjustDetail:remove") | |
203 | 202 | @Log(title = "库存-调整", operating = "删除调整单明细", action = BusinessType.DELETE) |
204 | 203 | @PostMapping( "/remove") |
205 | 204 | @ResponseBody |
... | ... | @@ -212,7 +211,6 @@ public class adjustDetailController extends BaseController { |
212 | 211 | return AjaxResult.error("单据状态不允许删除"); |
213 | 212 | } |
214 | 213 | adjustDetailService.removeById(id); |
215 | - | |
216 | 214 | return AjaxResult.success("删除成功!"); |
217 | 215 | } |
218 | 216 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... | ... | @@ -157,7 +157,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
157 | 157 | AjaxResult.error("该单据已调整,不允许再次调整!" ); |
158 | 158 | } |
159 | 159 | //查询调整的库存明细 |
160 | - InventoryDetail inventoryDetail = new InventoryDetail(); | |
160 | + InventoryDetail inventoryDetail ; | |
161 | 161 | //调整单中不带库存明细时不查询 |
162 | 162 | if(adjustDetail.getInventoryDetailId() != null) { |
163 | 163 | inventoryDetail = inventoryDetailService.getById(adjustDetail.getInventoryDetailId()); |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
... | ... | @@ -44,7 +44,7 @@ public class adjustHeaderController extends BaseController { |
44 | 44 | private String prefix = "inventory/adjustHeader"; |
45 | 45 | |
46 | 46 | |
47 | - //@RequiresPermissions("inventory:cycleCount:view") | |
47 | + @RequiresPermissions("inventory:adjustHeader:view") | |
48 | 48 | @GetMapping() |
49 | 49 | public String adjustHeader() |
50 | 50 | { |
... | ... | @@ -55,7 +55,7 @@ public class adjustHeaderController extends BaseController { |
55 | 55 | /** |
56 | 56 | * 查询调整单主列表 |
57 | 57 | */ |
58 | - //@RequiresPermissions("inventory:cycleCount:list") | |
58 | + @RequiresPermissions("inventory:adjustHeader:list") | |
59 | 59 | @PostMapping("/list") |
60 | 60 | @Log(title = "库存-调整",operating = "查看调整主单", action = BusinessType.GRANT) |
61 | 61 | @ResponseBody |
... | ... | @@ -101,7 +101,7 @@ public class adjustHeaderController extends BaseController { |
101 | 101 | /** |
102 | 102 | * 新增保存调整单主 |
103 | 103 | */ |
104 | - //@RequiresPermissions("inventory:cycleCount:add") | |
104 | + @RequiresPermissions("inventory:adjustHeader:add") | |
105 | 105 | @Log(title = "库存-调整",operating = "新增调整主单", action = BusinessType.INSERT) |
106 | 106 | @PostMapping("/addsave") |
107 | 107 | @ResponseBody |
... | ... | @@ -114,7 +114,7 @@ public class adjustHeaderController extends BaseController { |
114 | 114 | /** |
115 | 115 | * 删除调整单主 |
116 | 116 | */ |
117 | - //@RequiresPermissions("inventory:cycleCount:remove") | |
117 | + @RequiresPermissions("inventory:adjustHeader:remove") | |
118 | 118 | @Log(title = "库存-调整",operating = "删除调整主单", action = BusinessType.DELETE) |
119 | 119 | @PostMapping( "/remove") |
120 | 120 | @ResponseBody |
... | ... | @@ -124,7 +124,7 @@ public class adjustHeaderController extends BaseController { |
124 | 124 | return AjaxResult.error("id不能为空"); |
125 | 125 | for (Integer id : Convert.toIntArray(ids)) |
126 | 126 | { |
127 | - AjaxResult result = adjustHeaderService.delete(id); | |
127 | + AjaxResult result = adjustHeaderService.deleteHeader(id); | |
128 | 128 | if(result.code!=200){ |
129 | 129 | return result; |
130 | 130 | } |
... | ... | @@ -136,7 +136,7 @@ public class adjustHeaderController extends BaseController { |
136 | 136 | * 调整单打印 |
137 | 137 | * @return |
138 | 138 | */ |
139 | - //@RequiresPermissions("inventory:cyclecountAdjust:report") | |
139 | + @RequiresPermissions("inventory:adjustHeader:report") | |
140 | 140 | @GetMapping("/report/{id}") |
141 | 141 | public String report(@PathVariable("id") Integer id, ModelMap mmap) |
142 | 142 | { |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
1 | 1 | package com.huaheng.pc.inventory.adjustHeader.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
3 | 5 | import com.huaheng.common.utils.StringUtils; |
4 | 6 | import com.huaheng.common.utils.security.ShiroUtils; |
5 | 7 | import com.huaheng.framework.web.domain.AjaxResult; |
8 | +import com.huaheng.pc.config.warehouse.domain.Warehouse; | |
6 | 9 | import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; |
10 | +import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService; | |
7 | 11 | import org.springframework.stereotype.Service; |
8 | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 13 | import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; |
... | ... | @@ -13,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional; |
13 | 17 | import javax.annotation.Resource; |
14 | 18 | import java.text.SimpleDateFormat; |
15 | 19 | import java.util.Date; |
20 | +import java.util.List; | |
16 | 21 | |
17 | 22 | @Service |
18 | 23 | public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, AdjustHeader> implements AdjustHeaderService { |
... | ... | @@ -20,7 +25,8 @@ public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, Adj |
20 | 25 | |
21 | 26 | @Resource |
22 | 27 | private AdjustHeaderMapper adjustHeaderMapper; |
23 | - | |
28 | + @Resource | |
29 | + private AdjustDetailService adjustDetailService; | |
24 | 30 | |
25 | 31 | |
26 | 32 | |
... | ... | @@ -48,22 +54,29 @@ public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, Adj |
48 | 54 | } |
49 | 55 | |
50 | 56 | /** |
51 | - * 删除 | |
52 | - * 空缺 | |
57 | + * 调整主单删除 | |
53 | 58 | * @param id |
54 | 59 | * @return |
55 | 60 | */ |
61 | + @Transactional | |
56 | 62 | @Override |
57 | - public AjaxResult delete(Integer id) { | |
63 | + public AjaxResult deleteHeader(Integer id) { | |
58 | 64 | AdjustHeader adjustHeader = this.getById(id); |
59 | 65 | if(adjustHeader == null){ |
60 | 66 | return AjaxResult.error("id为"+id.toString()+"的调整单不存在出,操作中止"); |
61 | 67 | } |
62 | - | |
63 | - //批量删除子单据 | |
68 | + //判断该主单下有没又存在子单,没有直接删除主单,有则不能删除 | |
64 | 69 | AdjustDetail temp = new AdjustDetail(); |
65 | 70 | temp.setAdjustCode(adjustHeader.getCode()); |
71 | + temp.setCompanyCode(adjustHeader.getCompanyCode()); | |
72 | + temp.setWarehouseCode(adjustHeader.getWarehouseCode()); | |
73 | + LambdaQueryWrapper<AdjustDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(temp); | |
74 | + List<AdjustDetail> adjustDetails = adjustDetailService.list(lambdaQueryWrapper); | |
75 | + if(adjustDetails.size() > 0){ | |
76 | + throw new SecurityException("该主单存在明细,无法删除,操作失败!"); | |
77 | + } | |
66 | 78 | |
79 | + adjustHeaderMapper.deleteById(id); //直接删主单 | |
67 | 80 | return AjaxResult.success("删除成功"); |
68 | 81 | } |
69 | 82 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -150,6 +150,9 @@ public class CycleCountDetailController extends BaseController { |
150 | 150 | @ResponseBody |
151 | 151 | public AjaxResult addSave(String cycleCountHeadCode, Integer[] inventoryDetailIdIds) |
152 | 152 | { |
153 | + if(inventoryDetailIdIds == null){ | |
154 | + return AjaxResult.error("盘点的库存ID不能为空!"); | |
155 | + } | |
153 | 156 | return cycleCountDetailService.addDetails(cycleCountHeadCode,inventoryDetailIdIds); |
154 | 157 | } |
155 | 158 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... | ... | @@ -48,10 +48,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | - | |
52 | - | |
53 | - | |
54 | - | |
55 | 51 | /** |
56 | 52 | * 执行任务修改状态为10 |
57 | 53 | * @param detailid |
... | ... | @@ -131,7 +127,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
131 | 127 | ccd.setCompanyCode(inventoryDetail.getCompanyCode()); |
132 | 128 | ccd.setInventorySts(inventoryDetail.getInventorySts()); |
133 | 129 | ccd.setCountId(inventoryDetail.getId()); |
134 | - ccd.setEnableStatus(5); | |
130 | + //ccd.setEnableStatus(1); | |
135 | 131 | ccd.setLocationCode(inventoryDetail.getLocationCode()); |
136 | 132 | ccd.setContainerCode(inventoryDetail.getContainerCode()); |
137 | 133 | ccd.setMaterialCode(inventoryDetail.getMaterialCode()); |
... | ... | @@ -226,10 +222,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
226 | 222 | LambdaQueryWrapper<Location> lambdaQueryWrapper = Wrappers.lambdaQuery(temp); |
227 | 223 | Location loc = locationService.getOne(lambdaQueryWrapper); |
228 | 224 | if(!loc.getStatus().equals("empty")){ |
229 | - return AjaxResult.error(cycleCountDetail.getLocationCode()+"状态非空闲,操作失败"); | |
225 | + return AjaxResult.error(cycleCountDetail.getLocationCode()+"库位不在空闲状态,请先完成其他任务,操作失败!"); | |
230 | 226 | } |
231 | 227 | if(StringUtils.isEmpty(loc.getContainerCode())){ |
232 | - return AjaxResult.error(cycleCountDetail.getLocationCode()+"没有托盘,操作失败"); | |
228 | + return AjaxResult.error(cycleCountDetail.getLocationCode()+"库位中没有容器,操作失败!"); | |
233 | 229 | } |
234 | 230 | |
235 | 231 | //查询任务头和明细有相同容器,没有就新增任务头和明细 |
... | ... | @@ -363,9 +359,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
363 | 359 | if (inventoryDetail == null) { |
364 | 360 | return AjaxResult.error("没有对应库存信息,请重建盘点单"); |
365 | 361 | } |
366 | - if(qty.compareTo(inventoryDetail.getTaskQty()) < 0){ | |
362 | + /*if(qty.compareTo(inventoryDetail.getTaskQty()) < 0){ | |
367 | 363 | return AjaxResult.error("登记数量不能小于任务分配数量"); |
368 | - } | |
364 | + }*/ | |
369 | 365 | } |
370 | 366 | cyclecountDetail.setCountedQty(qty); |
371 | 367 | cyclecountDetail.setGapQty(qty.subtract(cyclecountDetail.getSystemQty())); |
... | ... | @@ -390,7 +386,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
390 | 386 | public AjaxResult createCyclecountWithGapQty(String cycleCountHeaderCode) { |
391 | 387 | /*找出实盘登记中数量有差异的,重新生成盘点单*/ |
392 | 388 | |
393 | - | |
394 | 389 | CycleCountHeader cycleCountHeader = new CycleCountHeader(); |
395 | 390 | cycleCountHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
396 | 391 | cycleCountHeader.setCode(cycleCountHeaderCode); |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
... | ... | @@ -169,12 +169,10 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
169 | 169 | |
170 | 170 | //查询该条盘点单头 id |
171 | 171 | CycleCountHeader cyclecountHeader = cycleCountHeaderMapper.selectById(id); |
172 | - | |
173 | - if(cyclecountHeader.getStatusCyc() >= 35){ | |
172 | + if(cyclecountHeader.getStatusCyc() < 100){ | |
174 | 173 | //查询是否已生成差异单 |
175 | - throw new ServiceException("该条盘点单无法生成调整单,请检查状态!"); | |
174 | + throw new ServiceException("该条盘点单无法生成调整单,必须为盘点任务完成,请检查状态!"); | |
176 | 175 | } |
177 | - | |
178 | 176 | AdjustHeader adjustHeader = new AdjustHeader(); |
179 | 177 | adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());//仓库 |
180 | 178 | adjustHeader.setCode(adjustHeaderService.createCode());//生成差异单号 |
... | ... | @@ -197,6 +195,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
197 | 195 | //AdjustHeader adjust = adjustHeaderService.getById(adjustHeader.getId()); |
198 | 196 | //循环明细条目,查找符合条件的数据写入调整单明细 |
199 | 197 | AdjustDetail adjustDetail = new AdjustDetail(); |
198 | + List<AdjustDetail> adjustDetails = new ArrayList<>(); | |
200 | 199 | for(CycleCountDetail item:cycleCountDetailList){ |
201 | 200 | //BigDecimal的比较 .compareTo(BigDecimal.ZERO) != 0 |
202 | 201 | |
... | ... | @@ -224,14 +223,16 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
224 | 223 | adjustDetail.setCreated(new Date()); |
225 | 224 | adjustDetail.setCreatedBy(ShiroUtils.getLoginName()); |
226 | 225 | //adjustDetail.setStatus(0);//状态 |
227 | - | |
228 | - adjustDetailService.save(adjustDetail); | |
226 | + adjustDetails.add(adjustDetail); | |
227 | + //adjustDetailService.save(adjustDetail); | |
229 | 228 | } |
230 | - | |
231 | 229 | } |
232 | - | |
230 | + if(adjustDetails.size() == 0 ){ | |
231 | + throw new SecurityException("该盘点单没有差异数据条目,无法生成调整单!"); | |
232 | + } | |
233 | + adjustDetailService.saveBatch(adjustDetails); | |
233 | 234 | //修改盘点主单状态为已生成差异单 |
234 | - cyclecountHeader.setStatusCyc(35); | |
235 | + cyclecountHeader.setStatusCyc(101); | |
235 | 236 | this.saveOrUpdate(cyclecountHeader); |
236 | 237 | |
237 | 238 | return AjaxResult.success("差异调整及明细单生成完毕!"); |
... | ... |
src/main/resources/templates/inventory/adjustDetail/adjustDetail.html
... | ... | @@ -91,14 +91,16 @@ |
91 | 91 | </div> |
92 | 92 | </div> |
93 | 93 | <div class="btn-group hidden-xs" id="toolbar" role="group"> |
94 | - <a class="btn btn-outline btn-success btn-rounded" onclick="add()"> | |
94 | + <a class="btn btn-outline btn-success btn-rounded" onclick="add()" | |
95 | + shiro:hasPermission="inventory:adjustDetail:add" > | |
95 | 96 | <i class="fa fa-plus"></i> 新增 |
96 | 97 | </a> |
97 | - <a class="btn btn-outline btn-primary btn-rounded" onclick="agree()"> | |
98 | + <a class="btn btn-outline btn-primary btn-rounded" onclick="agree()" | |
99 | + shiro:hasPermission="inventory:adjustDetail:adjustAgree" > | |
98 | 100 | <i class="fa fa-edit"></i> 审批 |
99 | 101 | </a> |
100 | - <a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/> | |
101 | - <!--shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"--> | |
102 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()" | |
103 | + shiro:hasPermission="inventory:adjustDetail:addAdjust"> | |
102 | 104 | <i class="fa fa-vcard"></i>调整 |
103 | 105 | </a> |
104 | 106 | <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()"> |
... | ... | @@ -112,6 +114,7 @@ |
112 | 114 | <script th:inline="javascript"> |
113 | 115 | var prefix = ctx + "inventory/adjustDetail"; |
114 | 116 | var prefix_head = ctx + "inventory/adjustHeader"; |
117 | + var removes= [[${@permission.hasPermi('inventory:adjustDetail:remove')}]]; | |
115 | 118 | var type2 = [[${@dict.getType('adjustType')}]]; |
116 | 119 | var adjustStatus = [[${@dict.getType('adjustStatus')}]]; |
117 | 120 | var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; |
... | ... | @@ -353,7 +356,7 @@ |
353 | 356 | align: 'center', |
354 | 357 | formatter: function (value, row, index) { |
355 | 358 | var actions = []; |
356 | - actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); | |
359 | + actions.push('<a class="btn btn-danger btn-xs ' + removes + ' " href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); | |
357 | 360 | return actions.join(''); |
358 | 361 | } |
359 | 362 | } |
... | ... |
src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
... | ... | @@ -69,13 +69,13 @@ |
69 | 69 | </div> |
70 | 70 | <div class="btn-group hidden-xs" id="toolbar" role="group"> |
71 | 71 | <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" |
72 | - shiro:hasPermission="inventory:cycleCount:add"> | |
72 | + shiro:hasPermission="inventory:adjustHeader:add"> | |
73 | 73 | <i class="fa fa-plus"></i> 新增 |
74 | 74 | </a> |
75 | - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" | |
76 | - shiro:hasPermission="inventory:cycleCount:remove"> | |
77 | - <i class="fa fa-trash-o"></i> 删除 | |
78 | - </a>--> | |
75 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" | |
76 | + shiro:hasPermission="inventory:adjustHeader:remove"> | |
77 | + <i class="fa fa-trash-o"></i> 删除 | |
78 | + </a> | |
79 | 79 | </div> |
80 | 80 | <table id="bootstrap-table" data-mobile-responsive="true" |
81 | 81 | class="table table-bordered table-hover"></table> |
... | ... | @@ -90,7 +90,7 @@ |
90 | 90 | <script th:inline="javascript"> |
91 | 91 | var prefix = ctx + "inventory/adjustHeader"; |
92 | 92 | var upload = [[${@permission.hasPermi('inventoryHeader:adjustHeader:upload')}]]; |
93 | - var report = [[${@permission.hasPermi('inventoryHeader:adjustHeader:report')}]]; | |
93 | + var report = [[${@permission.hasPermi('inventory:adjustHeader:report')}]]; | |
94 | 94 | var datas = [[${@dict.getType('sys_normal_disable')}]]; |
95 | 95 | var type2 = [[${@dict.getType('adjustType')}]]; |
96 | 96 | |
... | ... | @@ -180,8 +180,8 @@ |
180 | 180 | align: 'center', |
181 | 181 | formatter: function (value, row, index) { |
182 | 182 | var actions = []; |
183 | - /* actions.push('<a class="btn btn-success btn-xs " href="#" onclick="adjustPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); | |
184 | - actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> '); | |
183 | + actions.push('<a class="btn btn-success btn-xs " href="#" onclick="adjustPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); | |
184 | + /* actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> '); | |
185 | 185 | actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/ |
186 | 186 | actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.id + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>'); |
187 | 187 | return actions.join(''); |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/add.html
... | ... | @@ -11,7 +11,6 @@ |
11 | 11 | <input type="hidden" id="cycleCountHeadCode" name="cycleCountHeadCode" th:value="${cycleCountHeadCode}"> |
12 | 12 | <div class="select-list"> |
13 | 13 | <ul> |
14 | - <ul> | |
15 | 14 | <li> |
16 | 15 | 库存头ID:<input id="inventoryHeaderId" type="text" name="inventoryHeaderId"/> |
17 | 16 | </li> |
... | ... | @@ -79,12 +78,14 @@ |
79 | 78 | <a id="search" class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
80 | 79 | <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="general:inventoryHeader:export"><i class="fa fa-download"></i> 导出</a>--> |
81 | 80 | </li> |
82 | - </ul> | |
81 | + </ul> | |
83 | 82 | </div> |
84 | 83 | </form> |
85 | 84 | </div> |
86 | 85 | <div class="col-sm-12 select-info"> |
87 | - <a class="btn btn-success btn-sm" onclick="addDetails()" style="float: left; margin-top: 12px" shiro:hasPermission="inventory:cyclecountDetail:add"><i class="fa fa-edit" ></i> 批量添加盘点明细</a> | |
86 | + <a class="btn btn-success btn-sm" onclick="addDetails()" style="float: left; margin-top: 12px" | |
87 | + shiro:hasPermission="inventory:cyclecountDetail:add"> | |
88 | + <i class="fa fa-edit" ></i> 添加盘点明细</a> | |
88 | 89 | <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> |
89 | 90 | </div> |
90 | 91 | </div> |
... | ... | @@ -94,7 +95,7 @@ |
94 | 95 | <div th:include="include::footer"></div> |
95 | 96 | |
96 | 97 | <script th:inline="javascript"> |
97 | - var addFlag = [[${@permission.hasPermi('inventoryHeader:cycleCountDetail:add')}]]; | |
98 | + var addFlag = [[${@permission.hasPermi('inventory:cyclecountDetail:add')}]]; | |
98 | 99 | // var removeFlag = [[${@permission.hasPermi('inventoryHeader:inventoryHeader:remove')}]]; |
99 | 100 | var prefix = ctx + "inventory/inventoryDetail"; |
100 | 101 | var prefix_cycleDetails = ctx + "inventory/cycleCountDetail"; |
... | ... | @@ -132,7 +133,7 @@ |
132 | 133 | { |
133 | 134 | checkbox: true |
134 | 135 | }, |
135 | - { | |
136 | + /*{ | |
136 | 137 | title: '操作', |
137 | 138 | align: 'center', |
138 | 139 | formatter: function(value, row, index) { |
... | ... | @@ -141,10 +142,10 @@ |
141 | 142 | // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); |
142 | 143 | return actions.join(''); |
143 | 144 | } |
144 | - }, | |
145 | + },*/ | |
145 | 146 | { |
146 | 147 | field: 'id', |
147 | - title: '明细ID', | |
148 | + title: '库存明细ID', | |
148 | 149 | sortable: true |
149 | 150 | }, |
150 | 151 | { |
... | ... | @@ -315,9 +316,13 @@ |
315 | 316 | |
316 | 317 | }); |
317 | 318 | |
318 | - /*function addDetail(cycleCountHeadId) { | |
319 | - addInner($('cycleCountHeadId').val(),cycleCountHeadId); | |
320 | - }*/ | |
319 | + function addDetail(id) { | |
320 | + /*var ids =[]; | |
321 | + rows.forEach(function (item) { | |
322 | + ids.push(item.id); | |
323 | + });*/ | |
324 | + addInner($('#cycleCountHeadCode').val(),id); | |
325 | + } | |
321 | 326 | |
322 | 327 | function addDetails() { |
323 | 328 | var rows=$("#bootstrap-table").bootstrapTable('getSelections'); |
... | ... | @@ -339,7 +344,7 @@ |
339 | 344 | url : prefix_cycleDetails + "/add", |
340 | 345 | data:{ |
341 | 346 | cycleCountHeadCode:cycleCountHeadCode, |
342 | - inventoryDetailIdIds:ids | |
347 | + inventoryDetailIds:ids | |
343 | 348 | }, |
344 | 349 | async : false, |
345 | 350 | error : function(request) { |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
... | ... | @@ -318,13 +318,13 @@ |
318 | 318 | align: 'center', |
319 | 319 | formatter: function (value, row, index) { |
320 | 320 | var actions = []; |
321 | - | |
322 | - actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> '); | |
323 | - | |
324 | - actions.push('<a class="btn btn-primary btn-xs ' + createTaskFalg + '" href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> '); | |
325 | - | |
321 | + if(row.enableStatus >= 10 && row.enableStatus < 100){ | |
322 | + actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> '); | |
323 | + } | |
324 | + if(row.enableStatus === 1 ){ | |
325 | + actions.push('<a class="btn btn-primary btn-xs ' + createTaskFalg + '" href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> '); | |
326 | + } | |
326 | 327 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); |
327 | - | |
328 | 328 | return actions.join(''); |
329 | 329 | } |
330 | 330 | }] |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
... | ... | @@ -275,9 +275,9 @@ |
275 | 275 | formatter: function (value, row, index) { |
276 | 276 | var actions = []; |
277 | 277 | actions.push('<a class="btn btn-success btn-xs ' + reportFlag + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); |
278 | - | |
279 | - actions.push('<a class="btn btn-warning btn-xs ' + addAdjust + '" href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成调整单</a> '); | |
280 | - | |
278 | + if(row.statusCyc === 100){ | |
279 | + actions.push('<a class="btn btn-warning btn-xs ' + addAdjust + '" href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成调整单</a> '); | |
280 | + } | |
281 | 281 | //actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
282 | 282 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); |
283 | 283 | return actions.join(''); |
... | ... |
src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html