Commit d9b71aed34055953d97bc1bc6acd575fb73de318
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop
Showing
13 changed files
with
921 additions
and
139 deletions
src/main/java/com/huaheng/pc/check/checkingRegister/controller/CheckingRegisterController.java
... | ... | @@ -15,10 +15,16 @@ import com.huaheng.framework.web.domain.AjaxResult; |
15 | 15 | import com.huaheng.framework.web.page.PageDomain; |
16 | 16 | import com.huaheng.framework.web.page.TableDataInfo; |
17 | 17 | import com.huaheng.framework.web.page.TableSupport; |
18 | +import com.huaheng.pc.check.checkDetail.domain.CheckDetail; | |
19 | +import com.huaheng.pc.check.checkDetail.service.CheckDetailService; | |
18 | 20 | import com.huaheng.pc.check.checkHeader.domain.CheckHeader; |
21 | +import com.huaheng.pc.check.checkHeader.service.CheckHeaderService; | |
19 | 22 | import com.huaheng.pc.check.checkingRegister.domain.CheckingRegister; |
20 | 23 | import com.huaheng.pc.check.checkingRegister.service.CheckingRegisterService; |
21 | 24 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; |
25 | +import com.huaheng.pc.system.dict.domain.DictData; | |
26 | +import com.huaheng.pc.system.dict.service.DictDataServiceImpl; | |
27 | +import com.huaheng.pc.system.dict.service.IDictDataService; | |
22 | 28 | import io.swagger.annotations.Api; |
23 | 29 | import io.swagger.annotations.ApiOperation; |
24 | 30 | import io.swagger.annotations.ApiParam; |
... | ... | @@ -42,12 +48,23 @@ public class CheckingRegisterController extends BaseController { |
42 | 48 | |
43 | 49 | @Resource |
44 | 50 | private CheckingRegisterService checkingRegisterService; |
51 | + @Resource | |
52 | + private CheckHeaderService checkHeaderService; | |
53 | + @Resource | |
54 | + private CheckDetailService checkDetailService; | |
55 | + | |
45 | 56 | |
46 | 57 | private String prefix = "check/checkingRegister"; |
47 | 58 | |
48 | 59 | @RequiresPermissions("check:checkingRegister:view") |
49 | 60 | @GetMapping("/{checkId}") |
50 | 61 | public String checkingRegister(@PathVariable("checkId") Integer checkId, ModelMap modelMap) { |
62 | + if (checkId != 0){ | |
63 | + CheckHeader checkHeader = checkHeaderService.getById(checkId); | |
64 | + modelMap.put("checkHeaderId",checkHeader.getId()); | |
65 | + modelMap.put("checkCode",checkHeader.getCode()); | |
66 | + } | |
67 | + | |
51 | 68 | modelMap.put("checkId",checkId); |
52 | 69 | return prefix + "/checkingRegister"; |
53 | 70 | } |
... | ... | @@ -61,11 +78,22 @@ public class CheckingRegisterController extends BaseController { |
61 | 78 | @ResponseBody |
62 | 79 | public TableDataInfo list(@ApiParam(name="receiptDetail",value="质检头表") CheckingRegister checkingRegister, |
63 | 80 | @ApiParam(name = "createdBegin", value = "起止时间") String createdBegin, |
64 | - @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd) { | |
81 | + @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd, | |
82 | + Integer pageNumber) { | |
65 | 83 | LambdaQueryWrapper<CheckingRegister> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
66 | 84 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
67 | - Integer pageNum = pageDomain.getPageNum(); | |
85 | + Integer pageNum = pageNumber; | |
68 | 86 | Integer pageSize = pageDomain.getPageSize(); |
87 | + boolean isDetailNull; | |
88 | + if (StringUtils.isNotNull(checkingRegister.getCheckDetailId())){ | |
89 | + isDetailNull = true; | |
90 | + if (checkingRegister.getCheckDetailId() == 0){ | |
91 | + isDetailNull = false; | |
92 | + } | |
93 | + } else { | |
94 | + isDetailNull = false; | |
95 | + } | |
96 | + CheckDetail checkDetail = checkDetailService.getById(checkingRegister.getCheckDetailId()); | |
69 | 97 | |
70 | 98 | lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), CheckingRegister::getCreated, createdBegin) |
71 | 99 | .le(StringUtils.isNotEmpty(createdEnd), CheckingRegister::getCreated, createdEnd) |
... | ... | @@ -73,6 +101,8 @@ public class CheckingRegisterController extends BaseController { |
73 | 101 | .eq(CheckingRegister::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
74 | 102 | .eq(StringUtils.isNotNull(checkingRegister.getCheckHeaderId()), CheckingRegister::getCheckHeaderId, |
75 | 103 | checkingRegister.getCheckHeaderId()) |
104 | + .eq(isDetailNull, CheckingRegister::getCheckDetailId, | |
105 | + checkingRegister.getCheckDetailId()) | |
76 | 106 | .eq(StringUtils.isNotNull(checkingRegister.getReceiptDetailId()), |
77 | 107 | CheckingRegister::getReceiptDetailId, checkingRegister.getReceiptDetailId()) |
78 | 108 | .eq(StringUtils.isNotEmpty(checkingRegister.getReceiptCode()), |
... | ... | @@ -91,16 +121,34 @@ public class CheckingRegisterController extends BaseController { |
91 | 121 | CheckingRegister::getInventorySts, checkingRegister.getInventorySts()) |
92 | 122 | .eq(StringUtils.isNotEmpty(checkingRegister.getCheckBy()), |
93 | 123 | CheckingRegister::getCheckAt, checkingRegister.getCheckAt()); |
94 | -// .orderByDesc(CheckingRegister::getCheckAt) | |
95 | -// .orderByDesc(CheckingRegister::getReceiptDetailId); | |
96 | 124 | |
97 | 125 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
98 | 126 | // 使用分页查询 |
99 | 127 | Page<CheckingRegister> page = new Page<>(pageNum, pageSize); |
100 | 128 | IPage<CheckingRegister> iPage = checkingRegisterService.page(page, lambdaQueryWrapper); |
129 | + if (isDetailNull){ | |
130 | + if (iPage.getTotal() == 0){ | |
131 | + List emptyList = checkingRegisterService.emptyList(checkingRegister.getCheckDetailId()); | |
132 | + return getMpDataTable(emptyList, Long.valueOf(emptyList.size())); | |
133 | + } | |
134 | + if (!"20".equals(checkDetail.getStatus())){ | |
135 | + List notCompleteList = checkingRegisterService.notCompleteList(checkingRegister.getCheckDetailId()); | |
136 | + return getMpDataTable(notCompleteList, Long.valueOf(notCompleteList.size())); | |
137 | + } | |
138 | + } | |
101 | 139 | return getMpDataTable(iPage.getRecords(), iPage.getTotal()); |
102 | 140 | } else { |
103 | 141 | List<CheckingRegister> list = checkingRegisterService.list(lambdaQueryWrapper); |
142 | + if (isDetailNull){ | |
143 | + if (list.size() == 0){ | |
144 | + List emptyList = checkingRegisterService.emptyList(checkingRegister.getCheckDetailId()); | |
145 | + return getMpDataTable(emptyList, Long.valueOf(emptyList.size())); | |
146 | + } | |
147 | + if (!"20".equals(checkDetail.getStatus())){ | |
148 | + List notCompleteList = checkingRegisterService.notCompleteList(checkingRegister.getCheckDetailId()); | |
149 | + return getMpDataTable(notCompleteList, Long.valueOf(notCompleteList.size())); | |
150 | + } | |
151 | + } | |
104 | 152 | return getDataTable(list); |
105 | 153 | } |
106 | 154 | } |
... | ... | @@ -144,9 +192,7 @@ public class CheckingRegisterController extends BaseController { |
144 | 192 | @PostMapping("/edit") |
145 | 193 | @ResponseBody |
146 | 194 | public AjaxResult editSave(CheckingRegister checkingRegister) { |
147 | - checkingRegister.setCheckBy(ShiroUtils.getLoginName()); | |
148 | - checkingRegister.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
149 | - return toAjax(checkingRegisterService.updateById(checkingRegister)); | |
195 | + return checkingRegisterService.edit(checkingRegister); | |
150 | 196 | } |
151 | 197 | |
152 | 198 | /** |
... | ... |
src/main/java/com/huaheng/pc/check/checkingRegister/service/CheckingRegisterService.java
1 | 1 | package com.huaheng.pc.check.checkingRegister.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | + | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.huaheng.common.exception.service.ServiceException; | |
7 | +import com.huaheng.common.utils.StringUtils; | |
8 | +import com.huaheng.common.utils.security.ShiroUtils; | |
9 | +import com.huaheng.framework.web.domain.AjaxResult; | |
10 | +import com.huaheng.pc.check.checkDetail.domain.CheckDetail; | |
11 | +import com.huaheng.pc.check.checkDetail.service.CheckDetailService; | |
12 | +import com.huaheng.pc.check.checkHeader.domain.CheckHeader; | |
13 | +import com.huaheng.pc.check.checkHeader.service.CheckHeaderService; | |
14 | +import com.huaheng.pc.config.material.domain.Material; | |
15 | +import com.huaheng.pc.config.material.service.MaterialService; | |
16 | +import com.huaheng.pc.system.dict.domain.DictData; | |
17 | +import com.huaheng.pc.system.dict.service.IDictDataService; | |
3 | 18 | import org.springframework.stereotype.Service; |
4 | 19 | import javax.annotation.Resource; |
20 | +import java.util.ArrayList; | |
21 | +import java.util.Date; | |
5 | 22 | import java.util.List; |
6 | 23 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | 24 | import com.huaheng.pc.check.checkingRegister.domain.CheckingRegister; |
... | ... | @@ -9,4 +26,117 @@ import com.huaheng.pc.check.checkingRegister.mapper.CheckingRegisterMapper; |
9 | 26 | @Service |
10 | 27 | public class CheckingRegisterService extends ServiceImpl<CheckingRegisterMapper, CheckingRegister> { |
11 | 28 | |
29 | + @Resource | |
30 | + private CheckHeaderService checkHeaderService; | |
31 | + @Resource | |
32 | + private CheckDetailService checkDetailService; | |
33 | + @Resource | |
34 | + private MaterialService materialService; | |
35 | + @Resource | |
36 | + private IDictDataService dictDataService; | |
37 | + | |
38 | + /** | |
39 | + * 质检登记修改 | |
40 | + * @return | |
41 | + */ | |
42 | + public AjaxResult edit(CheckingRegister checkingRegister){ | |
43 | + | |
44 | + checkingRegister.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
45 | + checkingRegister.setCheckAt(new Date()); | |
46 | + checkingRegister.setCheckBy(ShiroUtils.getLoginName()); | |
47 | + if (StringUtils.isNull(checkingRegister.getId())){ | |
48 | + checkingRegister.setCreatedBy(ShiroUtils.getLoginName()); | |
49 | + if (!this.save(checkingRegister)){ | |
50 | + throw new ServiceException("添加质检登记失败"); | |
51 | + } | |
52 | + } else { | |
53 | + if (!this.updateById(checkingRegister)){ | |
54 | + throw new SecurityException("更新质检登记失败"); | |
55 | + } | |
56 | + } | |
57 | + return AjaxResult.success("保存成功"); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * 如果质检报告为空,返回所有库存状态记录 | |
62 | + * @param checkDetailId | |
63 | + * @return | |
64 | + */ | |
65 | + public List<CheckingRegister> emptyList(Integer checkDetailId){ | |
66 | + List<CheckingRegister> list = new ArrayList<>(); | |
67 | + List<DictData> dictDataList = dictDataService.selectDictDataByType("inventoryStatus"); | |
68 | + CheckDetail checkDetail = checkDetailService.getById(checkDetailId); | |
69 | + for (DictData dictData: dictDataList){ | |
70 | + CheckingRegister checkingRegister1 = new CheckingRegister(); | |
71 | + checkingRegister1.setCheckDetailId(checkDetailId); | |
72 | + checkingRegister1.setCheckHeaderId(checkDetail.getCheckHeaderId()); | |
73 | + checkingRegister1.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
74 | + checkingRegister1.setCheckCode(checkDetail.getCheckCode()); | |
75 | + checkingRegister1.setReceiptDetailId(checkDetail.getReceiptDetailId()); | |
76 | + checkingRegister1.setReceiptCode(checkDetail.getReceiptCode()); | |
77 | + checkingRegister1.setReferCode(checkDetail.getReferCode()); | |
78 | + checkingRegister1.setReferLineId(checkDetail.getReferLineId()); | |
79 | + checkingRegister1.setReferPlatform(checkDetail.getReferPlatform()); | |
80 | + checkingRegister1.setMaterialCode(checkDetail.getMaterialCode()); | |
81 | + checkingRegister1.setMaterialName(checkDetail.getMaterialName()); | |
82 | + checkingRegister1.setMaterialSpec(checkDetail.getMaterialSpec()); | |
83 | + checkingRegister1.setMaterialUnit(checkDetail.getMaterialUnit()); | |
84 | + checkingRegister1.setCompanyCode(checkDetail.getCompanyCode()); | |
85 | + checkingRegister1.setInventorySts(dictData.getDictValue()); | |
86 | + checkingRegister1.setCheckBy(ShiroUtils.getLoginName()); | |
87 | + checkingRegister1.setCreated(new Date()); | |
88 | + checkingRegister1.setCreatedBy(ShiroUtils.getLoginName()); | |
89 | + checkingRegister1.setLastUpdated(new Date()); | |
90 | + checkingRegister1.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
91 | + list.add(checkingRegister1); | |
92 | + } | |
93 | + return list; | |
94 | + } | |
95 | + | |
96 | + /** | |
97 | + * 如果质检未完成,返回 | |
98 | + * @param checkDetailId | |
99 | + * @return | |
100 | + */ | |
101 | + public List<CheckingRegister> notCompleteList(Integer checkDetailId){ | |
102 | + | |
103 | + LambdaQueryWrapper<CheckingRegister> lambda = Wrappers.lambdaQuery(); | |
104 | + lambda.eq(CheckingRegister::getCheckDetailId, checkDetailId); | |
105 | + List<CheckingRegister> list = this.list(lambda); | |
106 | + List<CheckingRegister> list1 = new ArrayList<>(); | |
107 | + List<DictData> dictDataList = dictDataService.selectDictDataByType("inventoryStatus"); | |
108 | + CheckDetail checkDetail = checkDetailService.getById(checkDetailId); | |
109 | + for (CheckingRegister checkingRegister: list){ | |
110 | + for (DictData dictData: dictDataList){ | |
111 | + if (!checkingRegister.getInventorySts().equals(dictData.getDictValue())) { | |
112 | + CheckingRegister checkingRegister1 = new CheckingRegister(); | |
113 | + checkingRegister1.setCheckDetailId(checkDetailId); | |
114 | + checkingRegister1.setCheckHeaderId(checkDetail.getCheckHeaderId()); | |
115 | + checkingRegister1.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
116 | + checkingRegister1.setCheckCode(checkDetail.getCheckCode()); | |
117 | + checkingRegister1.setReceiptDetailId(checkDetail.getReceiptDetailId()); | |
118 | + checkingRegister1.setReceiptCode(checkDetail.getReceiptCode()); | |
119 | + checkingRegister1.setReferCode(checkDetail.getReferCode()); | |
120 | + checkingRegister1.setReferLineId(checkDetail.getReferLineId()); | |
121 | + checkingRegister1.setReferPlatform(checkDetail.getReferPlatform()); | |
122 | + checkingRegister1.setMaterialCode(checkDetail.getMaterialCode()); | |
123 | + checkingRegister1.setMaterialName(checkDetail.getMaterialName()); | |
124 | + checkingRegister1.setMaterialSpec(checkDetail.getMaterialSpec()); | |
125 | + checkingRegister1.setMaterialUnit(checkDetail.getMaterialUnit()); | |
126 | + checkingRegister1.setCompanyCode(checkDetail.getCompanyCode()); | |
127 | + checkingRegister1.setInventorySts(dictData.getDictValue()); | |
128 | + checkingRegister1.setCheckBy(ShiroUtils.getLoginName()); | |
129 | + checkingRegister1.setCreated(new Date()); | |
130 | + checkingRegister1.setCreatedBy(ShiroUtils.getLoginName()); | |
131 | + checkingRegister1.setLastUpdated(new Date()); | |
132 | + checkingRegister1.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
133 | + list1.add(checkingRegister1); | |
134 | + } | |
135 | + } | |
136 | + } | |
137 | + for (CheckingRegister checkingRegister: list) { | |
138 | + list1.add(checkingRegister); | |
139 | + } | |
140 | + return list1; | |
141 | + } | |
12 | 142 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
34 | 34 | import org.springframework.web.bind.annotation.ResponseBody; |
35 | 35 | |
36 | 36 | import javax.annotation.Resource; |
37 | +import java.math.BigDecimal; | |
37 | 38 | import java.util.Collections; |
38 | 39 | import java.util.List; |
39 | 40 | |
... | ... | @@ -118,7 +119,6 @@ public class CycleCountDetailController extends BaseController { |
118 | 119 | |
119 | 120 | } |
120 | 121 | |
121 | - | |
122 | 122 | /** |
123 | 123 | * 新增盘点明细 |
124 | 124 | */ |
... | ... | @@ -215,10 +215,30 @@ public class CycleCountDetailController extends BaseController { |
215 | 215 | return cycleCountDetailService.createCycleCoutTaskByDetailId(cycleCoutdetailId); |
216 | 216 | } |
217 | 217 | |
218 | + /** | |
219 | + *实盘登记 | |
220 | + * @param detailId | |
221 | + * @param qty | |
222 | + * @return | |
223 | + */ | |
224 | + //@RequiresPermissions("inventory:cyclecountDetail:confirm") | |
225 | + @PostMapping("/confirmGapQty") | |
226 | + @ResponseBody | |
227 | + public AjaxResult confirmGapQty(Integer detailId, BigDecimal qty){ | |
228 | + return cycleCountDetailService.confirmGapQty(detailId,qty); | |
229 | + } | |
218 | 230 | |
219 | - | |
220 | - | |
221 | - | |
231 | + /** | |
232 | + * 差异复盘 | |
233 | + * @param cycleCountHeadCode | |
234 | + * @return | |
235 | + */ | |
236 | + //@RequiresPermissions("inventory:cyclecountDetail:cyclecountRepeat") | |
237 | + @PostMapping("/createCyclecountWithGapQty") | |
238 | + @ResponseBody | |
239 | + public AjaxResult createCyclecountWithGapQty(String cycleCountHeadCode){ | |
240 | + return cycleCountDetailService.createCyclecountWithGapQty(cycleCountHeadCode); | |
241 | + } | |
222 | 242 | |
223 | 243 | |
224 | 244 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | 5 | import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; |
6 | 6 | |
7 | +import java.math.BigDecimal; | |
7 | 8 | |
8 | 9 | |
9 | 10 | public interface CycleCountDetailService extends IService<CycleCountDetail> { |
... | ... | @@ -15,7 +16,11 @@ public interface CycleCountDetailService extends IService<CycleCountDetail> { |
15 | 16 | |
16 | 17 | AjaxResult createCycleCoutTaskByDetailId(Integer cycleCoutdetailId); |
17 | 18 | |
19 | + AjaxResult confirmGapQty(Integer detailId, BigDecimal qty); | |
18 | 20 | |
21 | + void updataDetailStatus(Integer detailid,Integer status); | |
22 | + | |
23 | + AjaxResult createCyclecountWithGapQty(String cycleCountHeadCode); | |
19 | 24 | |
20 | 25 | |
21 | 26 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... | ... | @@ -23,6 +23,7 @@ import org.springframework.stereotype.Service; |
23 | 23 | import org.springframework.transaction.annotation.Transactional; |
24 | 24 | |
25 | 25 | import javax.annotation.Resource; |
26 | +import java.math.BigDecimal; | |
26 | 27 | import java.util.ArrayList; |
27 | 28 | import java.util.Date; |
28 | 29 | import java.util.List; |
... | ... | @@ -46,6 +47,43 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
46 | 47 | |
47 | 48 | |
48 | 49 | |
50 | + | |
51 | + | |
52 | + | |
53 | + | |
54 | + | |
55 | + /** | |
56 | + * 执行任务修改状态为10 | |
57 | + * @param detailid | |
58 | + */ | |
59 | + @Transactional | |
60 | + @Override | |
61 | + public void updataDetailStatus(Integer detailid,Integer status) { | |
62 | + /*传入明细ID,状态,通过明细ID修改状态,并修改主单状态 */ | |
63 | + if(detailid == null || status == null){ | |
64 | + throw new ServiceException("明细ID或状态不能为空!"); | |
65 | + } | |
66 | + CycleCountDetail cycleCountDetail = this.getById(detailid) ;//盘点明细单 | |
67 | + cycleCountDetail.setEnableStatus(status); | |
68 | + cycleCountDetail.setLastUpdated(new Date()); | |
69 | + cycleCountDetail.setLastUpdatedBy(ShiroUtils.getLoginName());//更新用户 | |
70 | + //主单 | |
71 | + CycleCountHeader cycleCountHeader = new CycleCountHeader(); | |
72 | + cycleCountHeader.setCode(cycleCountDetail.getCycleCountHeadCode()); | |
73 | + cycleCountHeader.setWarehouseCode(cycleCountDetail.getWarehouseCode()); | |
74 | + cycleCountHeader.setCompanyCode(cycleCountDetail.getCompanyCode()); | |
75 | + LambdaQueryWrapper<CycleCountHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountHeader); | |
76 | + cycleCountHeader = cycleCountHeaderService.getOne(lambdaQueryWrapper); | |
77 | + if(cycleCountHeader.getStatusCyc() < 10 ){ | |
78 | + //主单状态小于10则修改 | |
79 | + cycleCountHeader.setStatusCyc(status); //主单状态 | |
80 | + cycleCountHeaderService.saveOrUpdate(cycleCountHeader); | |
81 | + } | |
82 | + if(!this.saveOrUpdate(cycleCountDetail)){ | |
83 | + throw new ServiceException("更新盘点执行状态失败!"); | |
84 | + } | |
85 | + } | |
86 | + | |
49 | 87 | /** |
50 | 88 | * 新增盘点明细 |
51 | 89 | * */ |
... | ... | @@ -118,7 +156,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
118 | 156 | return AjaxResult.success("生成盘点明细成功"); |
119 | 157 | } |
120 | 158 | |
121 | - | |
122 | 159 | /** |
123 | 160 | * 生成全部盘点任务 |
124 | 161 | * @param cycleCountHeadCode |
... | ... | @@ -196,7 +233,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
196 | 233 | } |
197 | 234 | |
198 | 235 | //查询任务头和明细有相同容器,没有就新增任务头和明细 |
199 | - | |
200 | 236 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
201 | 237 | taskHeaderLambdaQueryWrapper |
202 | 238 | .lt(TaskHeader::getStatus,100) |
... | ... | @@ -207,12 +243,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
207 | 243 | .eq(TaskHeader::getContainerCode,cycleCountDetail.getContainerCode());//容器 |
208 | 244 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
209 | 245 | |
210 | - | |
211 | 246 | TaskHeader task = new TaskHeader(); |
212 | 247 | TaskDetail taskDetail = new TaskDetail(); |
213 | - | |
214 | 248 | if(taskHeaderList.size() <= 0){ |
215 | - | |
216 | 249 | //存在相同容器的主任务直接加入该条主任务的明细 |
217 | 250 | task.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
218 | 251 | task.setCompanyCode(cycleCountDetail.getCompanyCode()); |
... | ... | @@ -242,7 +275,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
242 | 275 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
243 | 276 | cycleCountDetail.setTaskHeaderId(task.getId()); //盘点明细修改状态task数据源 |
244 | 277 | }else{ |
245 | - | |
246 | 278 | //取其中一条主单即可 |
247 | 279 | TaskHeader taskHeader = taskHeaderList.get(0); |
248 | 280 | taskDetail.setTaskId(taskHeader.getId());//主单ID |
... | ... | @@ -254,7 +286,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
254 | 286 | taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); |
255 | 287 | cycleCountDetail.setTaskHeaderId(taskHeader.getId());//盘点明细修改状态taskHeader数据源 |
256 | 288 | } |
257 | - | |
258 | 289 | taskDetail.setBillCode(cycleCountDetail.getCycleCountHeadCode()); |
259 | 290 | taskDetail.setBillDetailId(cycleCountDetail.getId()); |
260 | 291 | taskDetail.setMaterialCode(cycleCountDetail.getMaterialCode()); |
... | ... | @@ -273,7 +304,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
273 | 304 | if(taskDetailService.save(taskDetail) == false){ |
274 | 305 | throw new ServiceException("盘点任务明细生成失败!"); |
275 | 306 | } |
276 | - | |
277 | 307 | //修改细单状态 |
278 | 308 | cycleCountDetail.setTaskHeaderId(taskDetail.getId()); |
279 | 309 | //cycleCountDetail.setTaskHeaderId(task.getId()); |
... | ... | @@ -283,7 +313,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
283 | 313 | cycleCountDetail.setTaskHeaderId(task.getId()); |
284 | 314 | cycleCountDetail.setTaskDetailId(taskDetail.getId()); |
285 | 315 | this.saveOrUpdate(cycleCountDetail); |
286 | - | |
287 | 316 | //修改主单状态 |
288 | 317 | CycleCountHeader cycleCountHeader = new CycleCountHeader(); |
289 | 318 | cycleCountHeader.setCode(cycleCountDetail.getCycleCountHeadCode()); |
... | ... | @@ -296,6 +325,124 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
296 | 325 | return AjaxResult.success("盘点任务生成成功"); |
297 | 326 | } |
298 | 327 | |
328 | + /** | |
329 | + * 实盘登记 | |
330 | + * 登记完成后,修改状态为15 | |
331 | + * @param detailId | |
332 | + * @param qty | |
333 | + * @return | |
334 | + */ | |
335 | + @Transactional | |
336 | + @Override | |
337 | + public AjaxResult confirmGapQty(Integer detailId, BigDecimal qty) { | |
338 | + CycleCountDetail cyclecountDetail = this.getById(detailId); //明细单据 | |
339 | + CycleCountHeader cycleCountHeader =new CycleCountHeader(); | |
340 | + cycleCountHeader.setWarehouseCode(cyclecountDetail.getWarehouseCode()); | |
341 | + cycleCountHeader.setCompanyCode(cyclecountDetail.getCompanyCode()); | |
342 | + cycleCountHeader.setCode(cyclecountDetail.getCycleCountHeadCode()); | |
343 | + LambdaQueryWrapper<CycleCountHeader> cycleCountHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountHeader); | |
344 | + cycleCountHeader = cycleCountHeaderService.getOne(cycleCountHeaderLambdaQueryWrapper); //主单 | |
345 | + //任务执行后再实盘登记 | |
346 | + if(cyclecountDetail.getEnableStatus() < 10){ | |
347 | + return AjaxResult.error("盘点任务未执行不能登记数量!"); | |
348 | + } | |
349 | + if(cyclecountDetail.getEnableStatus() == 100){ | |
350 | + return AjaxResult.error("盘点任务完成后不能再登记数量!"); | |
351 | + } | |
352 | + if(cycleCountHeader==null){ | |
353 | + return AjaxResult.error("主单据不存在"); | |
354 | + } | |
355 | + /*if(cyclecountDetail.getEnableStatus() == 10){ | |
356 | + return AjaxResult.error("该条已调整,不能重复调整!"); | |
357 | + }*/ | |
358 | + if(qty.compareTo(new BigDecimal("0")) < 0){ | |
359 | + return AjaxResult.error("实盘登记数不能小于0"); | |
360 | + } | |
361 | + if(cyclecountDetail.getInventoryDetailId() != null){ | |
362 | + InventoryDetail inventoryDetail = inventoryDetailService.getById(cyclecountDetail.getInventoryDetailId()); | |
363 | + if (inventoryDetail == null) { | |
364 | + return AjaxResult.error("没有对应库存信息,请重建盘点单"); | |
365 | + } | |
366 | + if(qty.compareTo(inventoryDetail.getTaskQty()) < 0){ | |
367 | + return AjaxResult.error("登记数量不能小于任务分配数量"); | |
368 | + } | |
369 | + } | |
370 | + cyclecountDetail.setCountedQty(qty); | |
371 | + cyclecountDetail.setGapQty(qty.subtract(cyclecountDetail.getSystemQty())); | |
372 | + cyclecountDetail.setEnableStatus(15); | |
373 | + cyclecountDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
374 | + cyclecountDetail.setLastUpdated(new Date()); | |
375 | + this.saveOrUpdate(cyclecountDetail); | |
376 | + //修改主单状态 | |
377 | + cycleCountHeaderService.updataHeaderStatus(cycleCountHeader.getCode()); | |
378 | + | |
379 | + return AjaxResult.success("登记成功"); | |
380 | + } | |
381 | + | |
382 | + | |
383 | + /** | |
384 | + * 差异复盘 | |
385 | + * @param cycleCountHeaderCode | |
386 | + * @return | |
387 | + */ | |
388 | + @Transactional | |
389 | + @Override | |
390 | + public AjaxResult createCyclecountWithGapQty(String cycleCountHeaderCode) { | |
391 | + /*找出实盘登记中数量有差异的,重新生成盘点单*/ | |
392 | + | |
393 | + | |
394 | + CycleCountHeader cycleCountHeader = new CycleCountHeader(); | |
395 | + cycleCountHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
396 | + cycleCountHeader.setCode(cycleCountHeaderCode); | |
397 | + LambdaQueryWrapper<CycleCountHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountHeader); | |
398 | + cycleCountHeader = cycleCountHeaderService.getOne(lambdaQueryWrapper);//主单 | |
399 | + if(cycleCountHeader == null){ | |
400 | + return AjaxResult.error("盘点单不存在"); | |
401 | + } | |
402 | + //不能重复生成,使用盘点单编码查找sourceCode源盘点单号,已存在就是重复 | |
403 | + CycleCountHeader cy = new CycleCountHeader(); | |
404 | + cy.setSourceCode(cycleCountHeader.getCode()); | |
405 | + cy.setWarehouseCode(cycleCountHeader.getWarehouseCode()); | |
406 | + cy.setCompanyCode(cycleCountHeader.getCompanyCode()); | |
407 | + LambdaQueryWrapper<CycleCountHeader> lam = Wrappers.lambdaQuery(cy); | |
408 | + CycleCountHeader countHeader = cycleCountHeaderService.getOne(lam); | |
409 | + if(countHeader != null){ | |
410 | + return AjaxResult.error("该单据已生成复盘单,请勿重复生成!"); | |
411 | + } | |
412 | + CycleCountDetail cycleCountDetail = new CycleCountDetail(); | |
413 | + cycleCountDetail.setTaskHeaderId(cycleCountHeader.getId()); | |
414 | + cycleCountDetail.setWarehouseCode(cycleCountHeader.getWarehouseCode()); | |
415 | + cycleCountDetail.setCompanyCode(cycleCountHeader.getCompanyCode()); | |
416 | + LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
417 | + List<CycleCountDetail> cycleCountDetails = this.list(cycleCountDetailLambdaQueryWrapper);//明细 | |
418 | + //生成复盘盘点主单 | |
419 | + cycleCountHeader.setCode(cycleCountHeaderService.createCode()); | |
420 | + cycleCountHeader.setRound(cycleCountHeader.getRound() + 1);//盘点轮次+1 | |
421 | + cycleCountHeader.setCreated(new Date()); | |
422 | + cycleCountHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
423 | + cycleCountHeader.setSourceCode(cycleCountHeaderCode);//源盘点单号 | |
424 | + if(!cycleCountHeaderService.saveOrUpdate(cycleCountHeader)){ | |
425 | + throw new ServiceException("复盘主单生成失败!"); | |
426 | + } | |
427 | + //获取差异数量不为零的子单重新再生成盘点单 | |
428 | + List<CycleCountDetail> cycleCountDetailList = new ArrayList<>(); | |
429 | + for(CycleCountDetail item:cycleCountDetails){ | |
430 | + //getGapQty不能为null默认值为0 | |
431 | + int f = item.getGapQty().compareTo(BigDecimal.ZERO); | |
432 | + if(f > 0){ | |
433 | + item.setCountedQty(null); | |
434 | + item.setGapQty(BigDecimal.ZERO); | |
435 | + item.setCreatedBy(ShiroUtils.getLoginName()); | |
436 | + item.setCreated(new Date()); | |
437 | + cycleCountDetailList.add(item); | |
438 | + } | |
439 | + | |
440 | + } | |
441 | + if(!this.saveBatch(cycleCountDetailList)){ | |
442 | + throw new ServiceException("复盘明细子单生成失败"); | |
443 | + } | |
444 | + return AjaxResult.success("生成复盘单成功!"); | |
445 | + } | |
299 | 446 | |
300 | 447 | |
301 | 448 | |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -312,10 +312,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
315 | - * 下发WCS执行任务 | |
316 | - */ | |
317 | - /** | |
318 | - * | |
315 | + *下发WCS执行任务 | |
319 | 316 | * 执行任务 |
320 | 317 | * */ |
321 | 318 | @Override |
... | ... | @@ -324,6 +321,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
324 | 321 | TaskHeader task = null; |
325 | 322 | for (Integer taskId : taskIds) { |
326 | 323 | task = taskHeaderService.getById(taskId); |
324 | + | |
327 | 325 | if (task.getStatus() > 9) { |
328 | 326 | return AjaxResult.error("任务" + taskId + "已经下发,请不要重复下发,操作中止"); |
329 | 327 | } |
... | ... | @@ -335,17 +333,25 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
335 | 333 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
336 | 334 | taskHeaderService.saveOrUpdate(task); |
337 | 335 | //修改任务明细状态 |
338 | - TaskDetail record = new TaskDetail(); | |
339 | - record.setStatus(10); | |
340 | - record.setLastUpdated(new Date()); | |
341 | - record.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
342 | - record.setProcessStamp("100"); | |
343 | - taskDetailService.updateById(record); | |
344 | - LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
345 | - lambdaUpdateWrapper.eq(TaskDetail::getTaskId, task.getId()); | |
346 | - if (!taskDetailService.update(record, lambdaUpdateWrapper)){ | |
336 | + LambdaQueryWrapper<TaskDetail> lambdaWrapper = Wrappers.lambdaQuery(); | |
337 | + lambdaWrapper.eq(TaskDetail::getTaskId, task.getId()); | |
338 | + List<TaskDetail> taskDetailList = taskDetailService.list(lambdaWrapper); | |
339 | + List<TaskDetail> taskDetails = new ArrayList<>(); | |
340 | + for (TaskDetail item:taskDetailList){ | |
341 | + item.setStatus(10); | |
342 | + item.setLastUpdated(new Date()); | |
343 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
344 | + item.setProcessStamp("100"); | |
345 | + taskDetails.add(item); | |
346 | + //盘点执行修改盘点单据状态为10 | |
347 | + if(task.getTaskType() == 700){ | |
348 | + cycleCountDetailService.updataDetailStatus(item.getBillDetailId(),10); | |
349 | + } | |
350 | + } | |
351 | + if (!taskDetailService.saveOrUpdateBatch(taskDetails)){ | |
347 | 352 | throw new ServiceException("更新任务明细失败"); |
348 | 353 | } |
354 | + | |
349 | 355 | // //修改入库明细 |
350 | 356 | // if (task.getInternalTaskType()==100){ |
351 | 357 | // ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(record.getId())); |
... | ... | @@ -387,7 +393,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
387 | 393 | |
388 | 394 | |
389 | 395 | } |
390 | - return AjaxResult.success("下发任务成功", task); | |
396 | + return AjaxResult.success("执行下发任务成功", task); | |
391 | 397 | } |
392 | 398 | |
393 | 399 | @Override |
... | ... | @@ -416,7 +422,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
416 | 422 | * 完成任务 |
417 | 423 | * |
418 | 424 | * @param task |
419 | - * @throws Exception | |
420 | 425 | */ |
421 | 426 | @Transactional |
422 | 427 | public void completeTask(TaskHeader task) { |
... | ... | @@ -429,7 +434,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
429 | 434 | // 出库任务 |
430 | 435 | completeShipmentTask(task); |
431 | 436 | } |
432 | - // 900 出库查看,包过空托出库查看 | |
437 | + // 900 出库查看,空托出库查看 | |
433 | 438 | if ( task.getTaskType() == 900) { |
434 | 439 | completeSeeOutTask(task); |
435 | 440 | } |
... | ... | @@ -1004,10 +1009,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1004 | 1009 | @Transactional |
1005 | 1010 | public void completeEmptyIn(TaskHeader taskHeader) { |
1006 | 1011 | |
1007 | - //解锁容器,更新库位 | |
1008 | - containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(),taskHeader.getToLocation(),"empty"); | |
1009 | - //解锁库位,更新容器 | |
1010 | - locationService.updateContainerCodeAndStatus(taskHeader.getToLocation(),taskHeader.getContainerCode(),"empty"); | |
1011 | 1012 | //完成任务,修改主单和明细状态 |
1012 | 1013 | taskHeader.setStatus(100); |
1013 | 1014 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -1026,9 +1027,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1026 | 1027 | item.setLastUpdated(new Date()); //更新时间 |
1027 | 1028 | taskDetailList.add(item); |
1028 | 1029 | } |
1029 | - if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || taskHeaderService.saveOrUpdate(taskHeader) == false) { | |
1030 | + if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || | |
1031 | + taskHeaderService.saveOrUpdate(taskHeader) == false) { | |
1030 | 1032 | throw new ServiceException("任务单据状态更新失败!"); |
1031 | 1033 | } |
1034 | + //解锁容器,更新库位 | |
1035 | + containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(),taskHeader.getToLocation(),"empty"); | |
1036 | + //解锁库位,更新容器 | |
1037 | + locationService.updateContainerCodeAndStatus(taskHeader.getToLocation(),taskHeader.getContainerCode(),"empty"); | |
1032 | 1038 | |
1033 | 1039 | } |
1034 | 1040 | |
... | ... | @@ -1038,10 +1044,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1038 | 1044 | */ |
1039 | 1045 | @Transactional |
1040 | 1046 | public void completeEmptyOut(TaskHeader taskHeader) { |
1041 | - //更新货位 | |
1042 | - locationService.updateContainerCodeAndStatus(taskHeader.getFromLocation(), "", "empty"); | |
1043 | - //更新容器信息 | |
1044 | - containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(), "", "empty"); | |
1045 | 1047 | |
1046 | 1048 | taskHeader.setStatus(100); |
1047 | 1049 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -1063,6 +1065,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1063 | 1065 | if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || taskHeaderService.saveOrUpdate(taskHeader) == false) { |
1064 | 1066 | throw new ServiceException("任务单据状态更新失败!"); |
1065 | 1067 | } |
1068 | + //更新货位 | |
1069 | + locationService.updateContainerCodeAndStatus(taskHeader.getFromLocation(), "", "empty"); | |
1070 | + //更新容器信息 | |
1071 | + containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(), "", "empty"); | |
1072 | + | |
1066 | 1073 | } |
1067 | 1074 | |
1068 | 1075 | /** |
... | ... |
src/main/resources/application-druid.properties
... | ... | @@ -2,14 +2,14 @@ |
2 | 2 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
3 | 3 | spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver |
4 | 4 | # \u4E3B\u5E93 |
5 | -spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false | |
5 | +#spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false | |
6 | 6 | #spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/huahengExample?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false |
7 | -#spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8 | |
7 | +spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8 | |
8 | 8 | |
9 | -spring.datasource.druid.master.username=softhuaheng | |
10 | -spring.datasource.druid.master.password=HHrobot123. | |
11 | -#spring.datasource.druid.master.username=root | |
12 | -#spring.datasource.druid.master.password=123456 | |
9 | +#spring.datasource.druid.master.username=softhuaheng | |
10 | +#spring.datasource.druid.master.password=HHrobot123. | |
11 | +spring.datasource.druid.master.username=root | |
12 | +spring.datasource.druid.master.password=123456 | |
13 | 13 | # \u4ECE\u5E93 |
14 | 14 | #spring.datasource.druid.slave.open = true |
15 | 15 | #spring.datasource.druid.slave.url=jdbc:mysql://172.16.29.45:3306/huaheng?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false |
... | ... |
src/main/resources/static/huaheng/js/huahengUI.js
... | ... | @@ -317,6 +317,10 @@ |
317 | 317 | }, |
318 | 318 | // 表单封装处理 |
319 | 319 | form: { |
320 | + reset: function(formId) { | |
321 | + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; | |
322 | + $("#" + currentId)[0].reset(); | |
323 | + }, | |
320 | 324 | // 获取选中复选框项 |
321 | 325 | selectCheckeds: function(name) { |
322 | 326 | var checkeds = ""; |
... | ... |
src/main/resources/templates/check/checkDetail/checkDetail.html
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | var checkDetailStatus = [[${@dict.getType('checkDetailStatus')}]]; |
27 | 27 | var prefix = ctx + "check/checkDetail"; |
28 | 28 | var inventorySts = [[${@dict.getType('inventoryStatus')}]]; |
29 | + var prefix2 = ctx + "check/checkingRegister"; | |
29 | 30 | |
30 | 31 | $(function() { |
31 | 32 | var options = { |
... | ... | @@ -173,6 +174,25 @@ |
173 | 174 | checkHeaderId : [[${id}]] |
174 | 175 | }; |
175 | 176 | } |
177 | + | |
178 | + function detail(id, code) { | |
179 | + checkId = id; | |
180 | + var url = prefix2+"/" + id; | |
181 | + createtable(); | |
182 | + } | |
183 | + | |
184 | + function createtable() { | |
185 | + var url = prefix2+"/"+checkId; | |
186 | + $("#tabDetail").children().remove(); | |
187 | + $("#myTab li").removeClass("active"); | |
188 | + var height = $(document).height()-100 + 'px'; | |
189 | + var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>'; | |
190 | + $("#tabDetail").append(str); | |
191 | + $(".tab-pane").removeClass("in active"); | |
192 | + $("#myTab li:eq(1)").addClass("active"); | |
193 | + $("#tabDetail").addClass("in active"); | |
194 | + } | |
195 | + | |
176 | 196 | </script> |
177 | 197 | </body> |
178 | 198 | </html> |
179 | 199 | \ No newline at end of file |
... | ... |
src/main/resources/templates/check/checkHeader/checkHeader.html
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | <ul id="myTab" class="nav nav-tabs"> |
11 | 11 | <li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li> |
12 | 12 | <li><a href="#tabDetail" data-toggle="tab">明细</a></li> |
13 | - <li><a href="#registration" data-toggle="tab" onclick="createTableRegistration()">质检登记</a></li> | |
13 | + <li><a href="#registration" data-toggle="tab">质检登记</a></li> | |
14 | 14 | </ul> |
15 | 15 | <div id="myTabContent" class="tab-content"> |
16 | 16 | <div class="tab-pane fade in active" id="tabHeader"> |
... | ... | @@ -62,8 +62,57 @@ |
62 | 62 | </div> |
63 | 63 | |
64 | 64 | <div class="tab-pane fade" id="registration"> |
65 | - <table id="bootstrap-table2" data-mobile-responsive="true" | |
66 | - class="table table-bordered table-hover"></table> | |
65 | + <div class="col-sm-12 select-info"> | |
66 | + <form id="registration-form"> | |
67 | + <div class="select-list"> | |
68 | + <ul> | |
69 | + <li> | |
70 | + 质检单号:<input type="text" name="checkCode"/> | |
71 | + </li> | |
72 | + <li> | |
73 | + 入库单号:<input type="text" name="receiptCode"/> | |
74 | + </li> | |
75 | + <li> | |
76 | + 关联单号:<input type="text" name="referCode"/> | |
77 | + </li> | |
78 | + <li> | |
79 | + 关联行号:<input type="text" name="referLineId"/> | |
80 | + </li> | |
81 | + <li> | |
82 | + 物料编码:<input type="text" name="materialCode"/> | |
83 | + </li> | |
84 | + <li> | |
85 | + 物料名称:<input type="text" name="materialName"/> | |
86 | + </li> | |
87 | + <li> | |
88 | + 质检人:<input type="text" name="checkBy"/> | |
89 | + </li> | |
90 | + <li class="time"> | |
91 | + <label>创建时间: </label> | |
92 | + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/> | |
93 | + <span>-</span> | |
94 | + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/> | |
95 | + </li> | |
96 | + <li> | |
97 | + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> | |
98 | + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('registration-form')"><i class="fa fa-refresh"></i> 重置</a> | |
99 | + </li> | |
100 | + </ul> | |
101 | + </div> | |
102 | + </form> | |
103 | + </div> | |
104 | + | |
105 | + <div class="btn-group hidden-xs" id="toolbarReg" role="group"> | |
106 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="complete()" shiro:hasPermission="check:checkingRegister:remove"> | |
107 | + <i class="fa fa-trash-o"></i> 质检完成 | |
108 | + </a> | |
109 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="check:checkingRegister:remove"> | |
110 | + <i class="fa fa-trash-o"></i> 删除 | |
111 | + </a> | |
112 | + </div> | |
113 | + <div class="col-sm-12 select-info"> | |
114 | + <table id="bootstrap-table2" data-mobile-responsive="true" class="table table-bordered table-hover"></table> | |
115 | + </div> | |
67 | 116 | </div> |
68 | 117 | </div> |
69 | 118 | </div> |
... | ... | @@ -78,11 +127,16 @@ |
78 | 127 | var removeFlag = [[${@permission.hasPermi('check:checkHeader:remove')}]]; |
79 | 128 | var receiptTypes = [[${@receiptTypeService.getType()}]]; |
80 | 129 | var checkHeaderStatus = [[${@dict.getType('checkHeaderStatus')}]]; |
130 | + var checkDetailStatus = [[${@dict.getType('checkDetailStatus')}]]; | |
131 | + var inventorySts = [[${@dict.getType('inventoryStatus')}]]; | |
81 | 132 | var printFlag = [[${@permission.hasPermi('check:checkHeader:report')}]]; |
82 | 133 | var addFlag= [[${@permission.hasPermi('check:checkHeader:add')}]]; |
83 | 134 | var datas = [[${@dict.getType('sys_normal_disable')}]]; |
84 | 135 | var type = [[${@dict.getType('checkType')}]]; |
85 | 136 | var checkId = 0; |
137 | + var checkHeaderCode = 0; | |
138 | + var checkDetailId = 0; | |
139 | + | |
86 | 140 | $(function() { |
87 | 141 | var options = { |
88 | 142 | url: prefix + "/list", |
... | ... | @@ -94,6 +148,7 @@ |
94 | 148 | search: false, |
95 | 149 | sortName: "id", |
96 | 150 | sortOrder: "desc", |
151 | + | |
97 | 152 | columns: [{ |
98 | 153 | checkbox: true |
99 | 154 | }, |
... | ... | @@ -202,33 +257,381 @@ |
202 | 257 | $.table.init(options); |
203 | 258 | }); |
204 | 259 | |
260 | + //质检明细表格初始化 | |
261 | + $("#bootstrap-table1").bootstrapTable({ | |
262 | + url: prefix + "/list", | |
263 | + createUrl: prefix1 + "/add", | |
264 | + updateUrl: prefix1 + "/edit/{id}", | |
265 | + removeUrl: prefix1 + "/remove", | |
266 | + queryParams: queryParams, | |
267 | + modalName: "质检明细", | |
268 | + sortName: "lastUpdated", | |
269 | + sortOrder: "desc", | |
270 | + iconSize: "outline", | |
271 | + toolbar: "#toolbar1", | |
272 | + contentType: "application/x-www-form-urlencoded", | |
273 | + pagination: true, // 是否显示分页(*) | |
274 | + pageNumber: 1, // 初始化加载第一页,默认第一页 | |
275 | + pageSize: 50, // 每页的记录行数(*) | |
276 | + pageList: [10, 25, 50, 100], // 可供选择的每页的行数(*) | |
277 | + onRefresh: function(){ | |
278 | + loadDetail(); | |
279 | + }, | |
280 | + columns: [{ | |
281 | + checkbox: true | |
282 | + }, | |
283 | + { | |
284 | + field : 'id', | |
285 | + title : 'id' | |
286 | + }, | |
287 | + { | |
288 | + field : 'checkHeaderId', | |
289 | + title : '质检头id' | |
290 | + }, | |
291 | + { | |
292 | + field : 'warehouseCode', | |
293 | + title : '仓库编码', | |
294 | + visible : false | |
295 | + }, | |
296 | + { | |
297 | + field : 'checkCode', | |
298 | + title : '质检单编码' | |
299 | + }, | |
300 | + { | |
301 | + field : 'inventoryDetailId', | |
302 | + title : '库存明细标识' | |
303 | + }, | |
304 | + { | |
305 | + field : 'locationCode', | |
306 | + title : '库位编码' | |
307 | + }, | |
308 | + { | |
309 | + field : 'containerCode', | |
310 | + title : '容器编码' | |
311 | + }, | |
312 | + { | |
313 | + field : 'receiptDetailId', | |
314 | + title : '入库单明细标识' | |
315 | + }, | |
316 | + { | |
317 | + field : 'receiptCode', | |
318 | + title : '入库单号' | |
319 | + }, | |
320 | + { | |
321 | + field : 'referCode', | |
322 | + title : '关联单号' | |
323 | + }, | |
324 | + { | |
325 | + field : 'referLineId', | |
326 | + title : '关联行号' | |
327 | + }, | |
328 | + { | |
329 | + field : 'referPlatform', | |
330 | + title : '关联平台' | |
331 | + }, | |
332 | + { | |
333 | + field : 'materialCode', | |
334 | + title : '物料编码' | |
335 | + }, | |
336 | + { | |
337 | + field : 'materialName', | |
338 | + title : '物料名称' | |
339 | + }, | |
340 | + { | |
341 | + field : 'materialSpec', | |
342 | + title : '物料规格' | |
343 | + }, | |
344 | + { | |
345 | + field : 'materialUnit', | |
346 | + title : '物料单位' | |
347 | + }, | |
348 | + { | |
349 | + field : 'companyCode', | |
350 | + title : '货主代码' | |
351 | + }, | |
352 | + { | |
353 | + field : 'inventorySts', | |
354 | + title : '库存状态', | |
355 | + align: 'center', | |
356 | + formatter: function (value, row, index) { | |
357 | + return $.table.selectDictLabel(inventorySts, value); | |
358 | + } | |
359 | + }, | |
360 | + { | |
361 | + field : 'status', | |
362 | + title : '状态', | |
363 | + align: 'center', | |
364 | + formatter: function (value, row, index) { | |
365 | + return $.table.selectDictLabel(checkDetailStatus, value); | |
366 | + } | |
367 | + }, | |
368 | + { | |
369 | + field : 'qty', | |
370 | + title : '系统数量' | |
371 | + }, | |
372 | + { | |
373 | + field : 'checkBy', | |
374 | + title : '质检人' | |
375 | + }, | |
376 | + { | |
377 | + field : 'checkAt', | |
378 | + title : '质检时间' | |
379 | + }, | |
380 | + { | |
381 | + field : 'created', | |
382 | + title : '创建时间' | |
383 | + }, | |
384 | + { | |
385 | + field : 'createdBy', | |
386 | + title : '创建用户' | |
387 | + }, | |
388 | + { | |
389 | + title: '操作', | |
390 | + align: 'center', | |
391 | + formatter: function(value, row, index) { | |
392 | + var actions = []; | |
393 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); | |
394 | + return actions.join(''); | |
395 | + } | |
396 | + }], | |
397 | + onDblClickRow: function (row) { | |
398 | + if (typeof detail != 'undefined') { | |
399 | + detailReg(row.id) | |
400 | + } | |
401 | + } | |
402 | + }); | |
403 | + //质检登记表格初始化 | |
404 | + $("#bootstrap-table2").bootstrapTable({ | |
405 | + contentType: "application/x-www-form-urlencoded", | |
406 | + editable: true, | |
407 | + clickEdit: true, | |
408 | + clickToSelect: true, | |
409 | + cache: false, | |
410 | + showToggle:true, //显示切换按钮来切换表/卡片视图。 | |
411 | + showPaginationSwitch:false, //显示分页切换按钮 | |
412 | + pagination: true, | |
413 | + idePagination: "server", | |
414 | + queryParamsType: "params", | |
415 | + pageList: [10,25,50], | |
416 | + pageNumber: 1, | |
417 | + uniqueId: "id", | |
418 | + toolbar: "#toolbarReg", | |
419 | + iconSize: 'outline', | |
420 | + showRefresh: true, | |
421 | + showColumns: true, | |
422 | + showExport: true, | |
423 | + smartDisplay:true, | |
424 | + url: prefix2 + "/list", | |
425 | + modalName: "质检报告", | |
426 | + method: "post", | |
427 | + search: false, | |
428 | + sortName: "id", | |
429 | + sortOrder: "desc", | |
430 | + sortable: true, | |
431 | + onRefresh: function(){ | |
432 | + loadReg(); | |
433 | + }, | |
434 | + columns: [{ | |
435 | + checkbox: true | |
436 | + }, | |
437 | + { | |
438 | + field : 'id', | |
439 | + title : 'id' | |
440 | + }, | |
441 | + { | |
442 | + field : 'checkDetailId', | |
443 | + title : '质检明细标识', | |
444 | + visible : false | |
445 | + }, | |
446 | + { | |
447 | + field : 'checkHeaderId', | |
448 | + title : '头表标识', | |
449 | + visible : false | |
450 | + }, | |
451 | + { | |
452 | + field : 'warehouseCode', | |
453 | + title : '仓库代码', | |
454 | + visible : false | |
455 | + }, | |
456 | + { | |
457 | + field : 'checkCode', | |
458 | + title : '质检单号', | |
459 | + align:"center", | |
460 | + order:"asc", | |
461 | + sortable:"true" | |
462 | + }, | |
463 | + { | |
464 | + field : 'receiptDetailId', | |
465 | + title : '入库单明细标识' , | |
466 | + visible:false | |
467 | + }, | |
468 | + { | |
469 | + field : 'receiptCode', | |
470 | + title : '入库单号' | |
471 | + }, | |
472 | + { | |
473 | + field : 'referCode', | |
474 | + title : '关联单号' | |
475 | + }, | |
476 | + { | |
477 | + field : 'referLineId', | |
478 | + title : '关联行号' , | |
479 | + visible:false | |
480 | + }, | |
481 | + { | |
482 | + field : 'referPlatform', | |
483 | + title : '关联平台' , | |
484 | + visible:false | |
485 | + }, | |
486 | + { | |
487 | + field : 'materialCode', | |
488 | + title : '物料编码' | |
489 | + }, | |
490 | + { | |
491 | + field : 'materialName', | |
492 | + title : '物料名称' | |
493 | + }, | |
494 | + { | |
495 | + field : 'materialSpec', | |
496 | + title : '物料规格' | |
497 | + }, | |
498 | + { | |
499 | + field : 'materialUnit', | |
500 | + title : '物料单位' | |
501 | + }, | |
502 | + { | |
503 | + field : 'companyCode', | |
504 | + title : '货主编码' , | |
505 | + visible:false | |
506 | + }, | |
507 | + { | |
508 | + field : 'inventorySts', | |
509 | + title : '库存状态', | |
510 | + align: 'center', | |
511 | + formatter: function (value, row, index) { | |
512 | + return $.table.selectDictLabel(inventorySts, value); | |
513 | + } | |
514 | + }, | |
515 | + { | |
516 | + field : 'qty', | |
517 | + title : '数量', | |
518 | + editable: { | |
519 | + type: 'text', | |
520 | + title: '数量', | |
521 | + validate: function (v) { | |
522 | + if (isNaN(v)) return '数量必须是数字'; | |
523 | + var age = parseInt(v); | |
524 | + if (age < 0) return '数量必须是正整数'; | |
525 | + } | |
526 | + } | |
527 | + }, | |
528 | + { | |
529 | + field : 'checkBy', | |
530 | + title : '质检人' | |
531 | + }, | |
532 | + { | |
533 | + field : 'checkAt', | |
534 | + title : '质检时间' | |
535 | + }, | |
536 | + { | |
537 | + field : 'created', | |
538 | + title : '创建时间' | |
539 | + }, | |
540 | + { | |
541 | + field : 'createdBy', | |
542 | + title : '创建用户' | |
543 | + }, | |
544 | + { | |
545 | + field : 'lastUpdated', | |
546 | + title : '更新时间' | |
547 | + }, | |
548 | + { | |
549 | + field : 'lastUpdatedBy', | |
550 | + title : '更新用户' | |
551 | + }, | |
552 | + { | |
553 | + field : 'userDef1', | |
554 | + title : '自定义字段1' , | |
555 | + visible:false | |
556 | + }, | |
557 | + { | |
558 | + field : 'userDef2', | |
559 | + title : '自定义字段2' , | |
560 | + visible:false | |
561 | + }, | |
562 | + { | |
563 | + field : 'userDef3', | |
564 | + title : '自定义字段3' , | |
565 | + visible:false | |
566 | + }], | |
567 | + onClickRow: function (row, $element) { | |
568 | + curRow = row; | |
569 | + }, | |
570 | + onEditableSave: function (field, row, oldValue, $el) { | |
571 | + $.ajax({ | |
572 | + type: "post", | |
573 | + url: prefix2+"/edit", | |
574 | + data: row, | |
575 | + dataType: 'JSON', | |
576 | + success: function (data, status) { | |
577 | + if (status != "success") { | |
578 | + alert('提交数据失败'); | |
579 | + } | |
580 | + }, | |
581 | + error: function () { | |
582 | + alert('编辑失败'); | |
583 | + }, | |
584 | + complete: function () { | |
585 | + } | |
586 | + }); | |
587 | + } | |
588 | + }); | |
589 | + /* 质检单列表-详细 */ | |
205 | 590 | function detail(id, code) { |
206 | 591 | checkId = id; |
207 | - var url = prefix1+"/" + id; | |
208 | - createtable(url); | |
209 | - } | |
210 | - | |
211 | - function createtable(url) { | |
212 | - $("#tabDetail").children().remove(); | |
592 | + checkHeaderCode = code; | |
213 | 593 | $("#myTab li").removeClass("active"); |
214 | - var height = $(document).height()-100 + 'px'; | |
215 | - var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>'; | |
216 | - $("#tabDetail").append(str); | |
217 | - $(".tab-pane").removeClass("in active"); | |
594 | + $("#tabHeader").removeClass("in active"); | |
218 | 595 | $("#myTab li:eq(1)").addClass("active"); |
219 | 596 | $("#tabDetail").addClass("in active"); |
597 | + loadDetail(); | |
220 | 598 | } |
221 | 599 | |
222 | - function createTableRegistration() { | |
223 | - url = prefix2+"/"+checkId; | |
224 | - $("#registration").children().remove(); | |
225 | - $("#myTab li").removeClass("active"); | |
226 | - var height = $(document).height()-100 + 'px'; | |
227 | - var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>'; | |
228 | - $("#registration").append(str); | |
229 | - $(".tab-pane").removeClass("in active"); | |
230 | - $("#myTab li:eq(1)").addClass("active"); | |
600 | + function detailReg(id) { | |
601 | + checkDetailId = id; | |
602 | + $("#myTab li:eq(1)").removeClass("active"); | |
603 | + $("#tabDetail").removeClass("in active"); | |
604 | + $("#myTab li:eq(2)").addClass("active"); | |
231 | 605 | $("#registration").addClass("in active"); |
606 | + loadReg(); | |
607 | + } | |
608 | + | |
609 | + /* 质检单列表-详细 */ | |
610 | + function loadDetail() { | |
611 | + $.ajax({ | |
612 | + url:prefix1+'/list', | |
613 | + type:"post", | |
614 | + data:{ | |
615 | + checkHeaderId: checkId, | |
616 | + }, | |
617 | + success:function (value) { | |
618 | + $("#bootstrap-table1").bootstrapTable('load',value.data); | |
619 | + } | |
620 | + }); | |
621 | + } | |
622 | + | |
623 | + /* 质检登记*/ | |
624 | + function loadReg(params) { | |
625 | + $.ajax({ | |
626 | + url:prefix2+'/list', | |
627 | + type:"post", | |
628 | + data:{ | |
629 | + checkDetailId: checkDetailId | |
630 | + }, | |
631 | + success:function (value) { | |
632 | + $("#bootstrap-table2").bootstrapTable('load',value.data); | |
633 | + } | |
634 | + }); | |
232 | 635 | } |
233 | 636 | |
234 | 637 | function queryParams(params) { |
... | ... | @@ -242,8 +645,10 @@ |
242 | 645 | }; |
243 | 646 | }; |
244 | 647 | |
245 | - | |
246 | - | |
648 | + function complete() { | |
649 | + var url = prefix1+"/complete"; | |
650 | + $.operate.submit(url, "post", "json", data); | |
651 | + } | |
247 | 652 | </script> |
248 | 653 | </body> |
249 | 654 | </html> |
250 | 655 | \ No newline at end of file |
... | ... |
src/main/resources/templates/check/checkingRegister/checkingRegister.html
... | ... | @@ -60,6 +60,7 @@ |
60 | 60 | var editFlag = [[${@permission.hasPermi('check:checkingRegister:edit')}]]; |
61 | 61 | var removeFlag = [[${@permission.hasPermi('check:checkingRegister:remove')}]]; |
62 | 62 | var inventorySts = [[${@dict.getType('inventoryStatus')}]]; |
63 | + var curRow = {}; | |
63 | 64 | $(function() { |
64 | 65 | |
65 | 66 | $("#bootstrap-table").bootstrapTable({ |
... | ... | @@ -70,12 +71,14 @@ |
70 | 71 | cache: false, |
71 | 72 | showToggle:true, //显示切换按钮来切换表/卡片视图。 |
72 | 73 | showPaginationSwitch:true, //显示分页切换按钮 |
74 | + method: "post", | |
73 | 75 | queryParams: queryParams, |
74 | 76 | pagination: true, |
75 | 77 | pageList: [10,25,50,100], |
76 | 78 | pageSize:10, |
77 | 79 | pageNumber:1, |
78 | 80 | uniqueId: "id", |
81 | + toolbar: "#toolbar", | |
79 | 82 | showRefresh: true, |
80 | 83 | minimumCountColumns: 2, |
81 | 84 | smartDisplay:true, |
... | ... | @@ -97,7 +100,15 @@ |
97 | 100 | { |
98 | 101 | field : 'checkDetailId', |
99 | 102 | title : '质检明细标识', |
100 | - visible : false | |
103 | + editable: { | |
104 | + type: 'text', | |
105 | + title: '质检明细标识', | |
106 | + validate: function (v) { | |
107 | + if (isNaN(v)) return '必须是数字'; | |
108 | + var age = parseInt(v); | |
109 | + if (age < 0) return '必须是正整数'; | |
110 | + } | |
111 | + } | |
101 | 112 | }, |
102 | 113 | { |
103 | 114 | field : 'checkHeaderId', |
... | ... | @@ -114,15 +125,7 @@ |
114 | 125 | title : '质检单号', |
115 | 126 | align:"center", |
116 | 127 | order:"asc", |
117 | - sortable:"true", | |
118 | - editable: { | |
119 | - type: 'text', | |
120 | - title: '用户名', | |
121 | - validate: function (v) { | |
122 | - if (!v) return '用户名不能为空'; | |
123 | - | |
124 | - } | |
125 | - } | |
128 | + sortable:"true" | |
126 | 129 | }, |
127 | 130 | { |
128 | 131 | field : 'receiptDetailId', |
... | ... | @@ -131,16 +134,7 @@ |
131 | 134 | }, |
132 | 135 | { |
133 | 136 | field : 'receiptCode', |
134 | - title : '入库单号', | |
135 | - editable: { | |
136 | - type: 'text', | |
137 | - title: '入库单号', | |
138 | - validate: function (v) { | |
139 | - if (isNaN(v)) return '年龄必须是数字'; | |
140 | - var age = parseInt(v); | |
141 | - if (age <= 0) return '年龄必须是正整数'; | |
142 | - } | |
143 | - } | |
137 | + title : '入库单号' | |
144 | 138 | }, |
145 | 139 | { |
146 | 140 | field : 'referCode', |
... | ... | @@ -158,7 +152,11 @@ |
158 | 152 | }, |
159 | 153 | { |
160 | 154 | field : 'materialCode', |
161 | - title : '物料编码' | |
155 | + title : '物料编码', | |
156 | + editable: { | |
157 | + type: 'text', | |
158 | + title: '物料编码', | |
159 | + } | |
162 | 160 | }, |
163 | 161 | { |
164 | 162 | field : 'materialName', |
... | ... | @@ -181,13 +179,24 @@ |
181 | 179 | field : 'inventorySts', |
182 | 180 | title : '库存状态', |
183 | 181 | align: 'center', |
184 | - formatter: function (value, row, index) { | |
185 | - return $.table.selectDictLabel(inventorySts, value); | |
182 | + editable: { | |
183 | + type: 'select', | |
184 | + title: '库存状态', | |
185 | + source:[{value:"defective",text:"次品"},{value:"discussed",text:"待确认"},{value:"good",text:"良品"},{value:"scrap",text:"报废品"}] | |
186 | 186 | } |
187 | 187 | }, |
188 | 188 | { |
189 | 189 | field : 'qty', |
190 | - title : '数量' | |
190 | + title : '数量', | |
191 | + editable: { | |
192 | + type: 'text', | |
193 | + title: '数量', | |
194 | + validate: function (v) { | |
195 | + if (isNaN(v)) return '数量必须是数字'; | |
196 | + var age = parseInt(v); | |
197 | + if (age < 0) return '数量必须是正整数'; | |
198 | + } | |
199 | + } | |
191 | 200 | }, |
192 | 201 | { |
193 | 202 | field : 'checkBy', |
... | ... | @@ -231,25 +240,24 @@ |
231 | 240 | onClickRow: function (row, $element) { |
232 | 241 | curRow = row; |
233 | 242 | }, |
234 | - onLoadSuccess: function (aa, bb, cc) { | |
235 | - $("#tb_user a").editable({ | |
236 | - url: function (params) { | |
237 | - var sName = $(this).attr("name"); | |
238 | - curRow[sName] = params.value; | |
239 | - $.ajax({ | |
240 | - type: 'POST', | |
241 | - url: "/Editable/Edit", | |
242 | - data: curRow, | |
243 | - dataType: 'JSON', | |
244 | - success: function (data, textStatus, jqXHR) { | |
245 | - alert('保存成功!'); | |
246 | - }, | |
247 | - error: function () { alert("error");} | |
248 | - }); | |
243 | + onEditableSave: function (field, row, oldValue, $el) { | |
244 | + $.ajax({ | |
245 | + type: "post", | |
246 | + url: prefix+"/edit", | |
247 | + data: row, | |
248 | + dataType: 'JSON', | |
249 | + success: function (data, status) { | |
250 | + if (status == "success") { | |
251 | + alert('提交数据成功'); | |
252 | + } | |
253 | + }, | |
254 | + error: function () { | |
255 | + alert('编辑失败'); | |
249 | 256 | }, |
250 | - type: 'text' | |
257 | + complete: function () { | |
258 | + } | |
251 | 259 | }); |
252 | - }, | |
260 | + } | |
253 | 261 | // onClickCell: function(field, value, row, $element) { |
254 | 262 | // $element.attr('contenteditable', true); |
255 | 263 | // $element.attr('bgcolor', "#FFF"); |
... | ... | @@ -261,18 +269,7 @@ |
261 | 269 | // }) |
262 | 270 | // }, |
263 | 271 | }); |
264 | - // $('#bootstrap-table').editable({ | |
265 | - // type: "select", //编辑框的类型。支持text|textarea|select|date|checklist等 | |
266 | - // source: [{ value: 1, text: "开发部" }, { value: 2, text: "销售部" }, {value:3,text:"行政部"}], | |
267 | - // title: "选择部门", //编辑框的标题 | |
268 | - // disabled: false, //是否禁用编辑 | |
269 | - // mode: "popup", //编辑框的模式:支持popup和inline两种模式,默认是popup | |
270 | - // validate: function (value) { //字段验证 | |
271 | - // if (!$.trim(value)) { | |
272 | - // return '不能为空'; | |
273 | - // } | |
274 | - // } | |
275 | - // }); | |
272 | + | |
276 | 273 | // var options = { |
277 | 274 | // |
278 | 275 | // }; |
... | ... | @@ -282,6 +279,12 @@ |
282 | 279 | |
283 | 280 | var checkHeaderId; |
284 | 281 | |
282 | + function addButton() { | |
283 | + if (checkHeaderId != ""){ | |
284 | + $("#toolbar").append("<a class=\"btn btn-outline btn-success btn-rounded\" onclick=\"addRow()\" shiro:hasPermission=\"check:checkingRegister:add\"><i class=\"fa fa-plus\"></i>新增</a>"); | |
285 | + } | |
286 | + } | |
287 | + | |
285 | 288 | function queryParams(params) { |
286 | 289 | var checkId = [[${checkId}]]; |
287 | 290 | if (checkId == 0) { |
... | ... | @@ -289,19 +292,13 @@ |
289 | 292 | } else { |
290 | 293 | checkHeaderId = checkId; |
291 | 294 | } |
295 | + addButton(); | |
292 | 296 | return { |
293 | 297 | checkHeaderId :checkHeaderId, |
294 | 298 | pageSize: params.limit, |
295 | 299 | pageNum: params.offset / params.limit + 1, |
296 | 300 | searchValue: params.search, |
297 | 301 | }; |
298 | - addButton(); | |
299 | - } | |
300 | - | |
301 | - function addButton() { | |
302 | - if (checkHeaderId != ""){ | |
303 | - $("#toolbar").append("<a class=\"btn btn-outline btn-success btn-rounded\" onclick=\"addRow()\" shiro:hasPermission=\"check:checkingRegister:add\"><i class=\"fa fa-plus\"></i>新增</a>"); | |
304 | - } | |
305 | 302 | } |
306 | 303 | |
307 | 304 | function addRow() { |
... | ... | @@ -310,9 +307,9 @@ |
310 | 307 | row: { |
311 | 308 | id: '', |
312 | 309 | checkDetailId: '', |
313 | - checkHeaderId: '', | |
310 | + checkHeaderId: [[${checkHeaderId}]], | |
314 | 311 | warehouseCode: '', |
315 | - checkCode: '', | |
312 | + checkCode: [[${checkCode}]], | |
316 | 313 | receiptDetailId: '', |
317 | 314 | receiptCode: '', |
318 | 315 | referCode: '', |
... | ... |
src/main/resources/templates/include.html
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | <script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js}"></script> |
26 | 26 | <script th:src="@{/ajax/libs/bootstrap3-editable/js/bootstrap-editable.js}"></script> |
27 | 27 | <script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script> |
28 | + <script th:src="@{/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable.js}"></script> | |
28 | 29 | <script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js}"></script> |
29 | 30 | <script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script> |
30 | 31 | <!-- jquery-validate 表单验证插件 --> |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
... | ... | @@ -88,10 +88,10 @@ |
88 | 88 | shiro:hasPermission="inventory:cycleCountDetail:add"> |
89 | 89 | <i class="fa fa-plus"></i> 新增 |
90 | 90 | </a> |
91 | - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()" | |
91 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()" | |
92 | 92 | shiro:hasPermission="inventory:cyclecountDetail:cyclecountRepeat"> |
93 | 93 | <i class="fa fa-vcard"></i> 差异复盘 |
94 | - </a>--> | |
94 | + </a> | |
95 | 95 | <a class="btn btn-outline btn-danger btn-rounded" onclick="outcheckAll()" |
96 | 96 | shiro:hasPermission="inventory:cyclecountDetail:createTask"> |
97 | 97 | <i class="fa fa-vcard"></i> 生成全部盘点任务 |
... | ... |