Commit 04766697c5813850b241250ce7acf508cd9d1ebb

Authored by mahuandong
2 parents 8d061b2c 89a662b6

Merge remote-tracking branch 'origin/develop' into develop

src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
... ... @@ -32,11 +32,11 @@ public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, Adj
32 32 if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now)))
33 33 {
34 34 Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length()));
35   - code = "CY" + df.format(now) + String.format("%05d", Count + 1);
  35 + code = "AD" + df.format(now) + String.format("%05d", Count + 1);
36 36 }
37 37 else
38 38 {
39   - code = "CY" + df.format(now) + "00001";
  39 + code = "AD" + df.format(now) + "00001";
40 40 }
41 41 return code;
42 42 }
... ...
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... ... @@ -349,7 +349,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap
349 349 if(cyclecountDetail.getEnableStatus() == 100){
350 350 return AjaxResult.error("盘点任务完成后不能再登记数量!");
351 351 }
352   - if(cycleCountHeader==null){
  352 + if(cycleCountHeader == null){
353 353 return AjaxResult.error("主单据不存在");
354 354 }
355 355 /*if(cyclecountDetail.getEnableStatus() == 10){
... ...
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
... ... @@ -178,7 +178,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap
178 178 AdjustHeader adjustHeader = new AdjustHeader();
179 179 adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());//仓库
180 180 adjustHeader.setCode(adjustHeaderService.createCode());//生成差异单号
181   - adjustHeader.setProblemType("盘点调整");
  181 + adjustHeader.setProblemType("cyclecountAdjust");
182 182 adjustHeader.setCycleCountCode(cyclecountHeader.getCode());
183 183 adjustHeader.setCompanyCode(cyclecountHeader.getCompanyCode());
184 184 adjustHeader.setCreated(new Date());
... ... @@ -199,6 +199,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap
199 199 AdjustDetail adjustDetail = new AdjustDetail();
200 200 for(CycleCountDetail item:cycleCountDetailList){
201 201 //BigDecimal的比较 .compareTo(BigDecimal.ZERO) != 0
  202 +
202 203 if(item.getGapQty().compareTo(BigDecimal.ZERO) != 0){
203 204 //比较差异数量不为0的就生成差异单
204 205 adjustDetail.setAdjustCode(adjustHeader.getCode());
... ... @@ -212,7 +213,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap
212 213 adjustDetail.setMaterialSpec(item.getMaterialSpec());
213 214 adjustDetail.setMaterialUnit(item.getMaterialUnit());
214 215 adjustDetail.setCycleDetailId(item.getId());
215   - adjustDetail.setProblemType("盘点调整");
  216 + adjustDetail.setProblemType("cyclecountAdjust");
216 217 adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性
217 218 adjustDetail.setFromInventorySts(item.getInventorySts());
218 219 adjustDetail.setFromQty(item.getSystemQty());//调整前数量
... ...
src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java
... ... @@ -164,12 +164,12 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper,
164 164 throw new ServiceException("系统没有此波次");
165 165 }
166 166  
167   - if(ids.length()>waveMaster.getMaxShipments()){
  167 + if(Convert.toIntArray(ids).length >waveMaster.getMaxShipments()){
168 168 throw new ServiceException("加入波次的单据数量超过波次的单据限制");
169 169 }
170 170  
171 171 List<ShipmentDetail> shipmentDetailList=new ArrayList<>();
172   - BigDecimal qty=null;
  172 + BigDecimal qty=new BigDecimal(0);
173 173 //检查出库子表是否有处于波次的
174 174 for (Integer id : Convert.toIntArray(ids))
175 175 {
... ... @@ -195,20 +195,37 @@ public class ShipmentDetailServiceImpl extends ServiceImpl&lt;ShipmentDetailMapper,
195 195 throw new ServiceException("加入波次的总行数超过波次的行数限制");
196 196 }
197 197  
198   - //创建波次
199   - Wave wave=new Wave();
200   - wave.setWarehouseCode(ShiroUtils.getWarehouseCode());
201   - wave.setMasterCode(code);
202   - wave.setWaveName(waveMaster.getName());
203   - wave.setStatus(0);
204   - wave.setCurrentWaveStep("0");
205   - wave.setTotalShipments(ids.length());
206   - wave.setTotalLines(shipmentDetailList.size());
207   - wave.setTotalQty(qty);
208   - wave.setCreatedBy(ShiroUtils.getLoginName());
209   - Boolean flag=waveService.save(wave);
210   - if(flag == false){
211   - throw new ServiceException("波次建立失败");
  198 + Boolean flag=false;
  199 +
  200 + //查看波次是否建成未执行
  201 + LambdaQueryWrapper<Wave> waveLam = Wrappers.lambdaQuery();
  202 + waveLam.eq(Wave::getStatus,0)
  203 + .eq(Wave::getWaveMode,code)
  204 + .eq(Wave::getWarehouseCode,ShiroUtils.getWarehouseCode());
  205 + Wave wave = waveService.getOne(waveLam);
  206 + if(wave != null && (wave.getTotalShipments()+Convert.toIntArray(ids).length)<= waveMaster.getMaxShipments()
  207 + && (wave.getTotalLines()+shipmentDetailList.size()<= waveMaster.getMaxLines())){
  208 + //修改波次
  209 + wave.setTotalShipments(Convert.toIntArray(ids).length + wave.getTotalShipments());
  210 + wave.setTotalLines(shipmentDetailList.size() + wave.getTotalLines());
  211 + wave.setTotalQty(qty.add(wave.getTotalQty()));
  212 + wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  213 +
  214 + }else {
  215 + //创建波次
  216 + wave.setWarehouseCode(ShiroUtils.getWarehouseCode());
  217 + wave.setMasterCode(code);
  218 + wave.setWaveName(waveMaster.getName());
  219 + wave.setStatus(0);
  220 + wave.setCurrentWaveStep("0");
  221 + wave.setTotalShipments(Convert.toIntArray(ids).length);
  222 + wave.setTotalLines(shipmentDetailList.size());
  223 + wave.setTotalQty(qty);
  224 + wave.setCreatedBy(ShiroUtils.getLoginName());
  225 + flag = waveService.save(wave);
  226 + if (flag == false) {
  227 + throw new ServiceException("波次建立失败");
  228 + }
212 229 }
213 230  
214 231 //修改出库子单
... ...
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -264,7 +264,7 @@ public class ShipmentHeaderController extends BaseController
264 264 @PostMapping( "/addWave")
265 265 @ResponseBody
266 266 @Transactional
267   - public void analysis(String ids,String code){
  267 + public AjaxResult analysis(String ids,String code){
268 268 if (StringUtils.isEmpty(ids))
269 269 throw new ServiceException("id不能为空");
270 270 if(StringUtils.isEmpty(code)){
... ... @@ -272,6 +272,7 @@ public class ShipmentHeaderController extends BaseController
272 272 }
273 273  
274 274 shipmentDetailService.saveWave(ids,code);
  275 + return AjaxResult.success("加入波次成功");
275 276 }
276 277  
277 278 }
... ...
src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java
... ... @@ -15,6 +15,8 @@ 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.shipment.shipmentDetail.domain.ShipmentDetail;
  19 +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
18 20 import com.huaheng.pc.shipment.wave.domain.Wave;
19 21 import com.huaheng.pc.shipment.wave.service.WaveService;
20 22 import io.swagger.annotations.Api;
... ... @@ -43,6 +45,8 @@ public class WaveController extends BaseController {
43 45  
44 46 @Autowired
45 47 private WaveService waveService;
  48 + @Autowired
  49 + private ShipmentDetailService shipmentDetailService;
46 50  
47 51 @RequiresPermissions("shipment:wave:view")
48 52 @GetMapping()
... ... @@ -86,48 +90,48 @@ public class WaveController extends BaseController {
86 90 }
87 91 }
88 92  
89   - /**
90   - * 新增波次
91   - */
92   - @GetMapping("/add")
93   - public String add() {
94   - return prefix + "/add";
95   - }
96   -
97   - /**
98   - * 新增波次
99   - */
100   - @RequiresPermissions("shipment:wave:add")
101   - @Log(title = "出库-波次", operating = "新增波次", action = BusinessType.INSERT)
102   - @PostMapping("/add")
103   - @ResponseBody
104   - public AjaxResult addSave(Wave wave){
105   - wave.setWarehouseCode(ShiroUtils.getWarehouseCode());
106   - wave.setCreatedBy(ShiroUtils.getLoginName());
107   - wave.setLastUpdatedBy(ShiroUtils.getLoginName());
108   - return toAjax(waveService.save(wave));
109   - }
110   -
111   - /**
112   - * 修改波次
113   - */
114   - @GetMapping("/edit/{id}")
115   - public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
116   - mmap.put("wave", waveService.getById(id));
117   - return prefix + "/edit";
118   - }
119   -
120   - /**
121   - * 修改波次
122   - */
123   - @RequiresPermissions("shipment:wave:edit")
124   - @Log(title = "出库-波次", operating = "修改波次", action = BusinessType.UPDATE)
125   - @PostMapping("/edit")
126   - @ResponseBody
127   - public AjaxResult editSave(Wave wave) {
128   - wave.setLastUpdatedBy(ShiroUtils.getLoginName());
129   - return toAjax(waveService.updateById(wave));
130   - }
  93 +// /**
  94 +// * 新增波次
  95 +// */
  96 +// @GetMapping("/add")
  97 +// public String add() {
  98 +// return prefix + "/add";
  99 +// }
  100 +//
  101 +// /**
  102 +// * 新增波次
  103 +// */
  104 +// @RequiresPermissions("shipment:wave:add")
  105 +// @Log(title = "出库-波次", operating = "新增波次", action = BusinessType.INSERT)
  106 +// @PostMapping("/add")
  107 +// @ResponseBody
  108 +// public AjaxResult addSave(Wave wave){
  109 +// wave.setWarehouseCode(ShiroUtils.getWarehouseCode());
  110 +// wave.setCreatedBy(ShiroUtils.getLoginName());
  111 +// wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  112 +// return toAjax(waveService.save(wave));
  113 +// }
  114 +
  115 +// /**
  116 +// * 修改波次
  117 +// */
  118 +// @GetMapping("/edit/{id}")
  119 +// public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  120 +// mmap.put("wave", waveService.getById(id));
  121 +// return prefix + "/edit";
  122 +// }
  123 +//
  124 +// /**
  125 +// * 修改波次
  126 +// */
  127 +// @RequiresPermissions("shipment:wave:edit")
  128 +// @Log(title = "出库-波次", operating = "修改波次", action = BusinessType.UPDATE)
  129 +// @PostMapping("/edit")
  130 +// @ResponseBody
  131 +// public AjaxResult editSave(Wave wave) {
  132 +// wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  133 +// return toAjax(waveService.updateById(wave));
  134 +// }
131 135  
132 136 /**
133 137 * 删除波次
... ... @@ -142,10 +146,28 @@ public class WaveController extends BaseController {
142 146 }
143 147 List<Integer> list = new ArrayList<>();
144 148 for (Integer id : Convert.toIntArray(ids)) {
  149 + LambdaQueryWrapper<ShipmentDetail> lam=Wrappers.lambdaQuery();
  150 + lam.eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode())
  151 + .eq(ShipmentDetail::getWaveId,id);
  152 + List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lam);
  153 + if(shipmentDetails !=null || shipmentDetails.size()>0){
  154 + return AjaxResult.error("id为"+ id +"的波次不能删除,有单据处于此波次中");
  155 + }
145 156 list.add(id);
146 157 }
147 158 return toAjax(waveService.removeByIds(list));
148 159 }
149 160  
  161 + /**
  162 + * 开始波次
  163 + */
  164 + @RequiresPermissions("shipment:wave:startWave")
  165 + @Log(title = "出库-波次", operating = "开始波次", action = BusinessType.UPDATE)
  166 + @PostMapping("/startWave")
  167 + @ResponseBody
  168 + public AjaxResult editSave(Wave wave) {
  169 + wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  170 + return toAjax(waveService.updateById(wave));
  171 + }
150 172  
151 173 }
... ...
src/main/resources/templates/inventory/adjustHeader/addAdjust.html renamed to src/main/resources/templates/inventory/adjustDetail/add.html
src/main/resources/templates/inventory/adjustDetail/adjustDetail.html
... ... @@ -55,8 +55,8 @@
55 55 物料规格:<input id="materialSpec" type="text" name="materialSpec"/>
56 56 </li>
57 57 <li>
58   - 调整单类型:<select name="problemType"
59   - th:with="problemType=${@dict.getType('cyclecountStatus')}">
  58 + 调整类型:<select name="problemType"
  59 + th:with="problemType=${@dict.getType('adjustType')}">
60 60 <option value="">所有</option>
61 61 <option th:each="e : ${problemType}" th:text="${e['dictLabel']}"
62 62 th:value="${e['dictValue']}"></option>
... ... @@ -91,11 +91,13 @@
91 91 </div>
92 92 </div>
93 93 <div class="btn-group hidden-xs" id="toolbar" role="group">
94   -
95   - <a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/>
96   - <!--shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"-->
97   - <i class="fa fa-vcard"></i>差异调整
  94 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()">
  95 + <i class="fa fa-plus"></i> 新增
98 96 </a>
  97 + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/>
  98 + &lt;!&ndash;shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"&ndash;&gt;
  99 + <i class="fa fa-vcard"></i>调整
  100 + </a>-->
99 101 <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()"
100 102 shiro:hasPermission="inventoryHeader:cycleCountDetail:cyclecountRepeat">
101 103 <i class="fa fa-vcard"></i> 差异复盘
... ... @@ -104,9 +106,9 @@
104 106 shiro:hasPermission="inventoryHeader:cycleCountDetail:adjust">
105 107 <i class="fa fa-vcard"></i> 差异库存调整
106 108 </a>-->
107   - <a class="btn btn-outline btn-success btn-rounded" onclick="update()">
108   - <i class="fa fa-refresh"></i>&nbsp;&nbsp;刷&nbsp;&nbsp;&nbsp;&nbsp;新
109   - </a>
  109 + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()">
  110 + <i class="fa fa-refresh"></i> 刷新
  111 + </a>-->
110 112 </div>
111 113 <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
112 114 </div>
... ... @@ -115,14 +117,14 @@
115 117 <script th:inline="javascript">
116 118 var prefix = ctx + "inventory/adjustDetail";
117 119 var prefix_head = ctx + "inventory/adjustHeader";
118   - var datas = [[${@dict.getType('adjustType')}]];
  120 + var type2 = [[${@dict.getType('adjustType')}]];
  121 + var adjustStatus = [[${@dict.getType('adjustStatus')}]];
119 122 var inventoryStatus = [[${@dict.getType('inventoryStatus')}]];
120 123 var created;
121 124  
122 125 $(function () {
123 126 update();
124 127 });
125   -
126 128 function update() {
127 129 let adjustCode=null;
128 130 let options = {
... ... @@ -130,13 +132,22 @@
130 132 modalName: "调整单明细",
131 133 sortName: "id",
132 134 sortOrder: "desc",
133   - showRefresh: false,
134 135 search: false,
  136 + showRefresh: true,
135 137 columns: [
136 138 {
137 139 radio: true
138 140 },
139 141 {
  142 + title: '调整操作',
  143 + align: 'center',
  144 + formatter: function (value, row, index) {
  145 + var actions = [];
  146 + actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="$.operate.addAdjust()"><i class="fa fa-trash-o"></i>调整</a> ');
  147 + return actions.join('');
  148 + }
  149 + },
  150 + {
140 151 field: 'id',
141 152 title: '明细id',
142 153 sortable: true
... ... @@ -201,7 +212,7 @@
201 212 {
202 213 field: 'checkDetailId',
203 214 title: '质检单明细行号',
204   - visible: false
  215 + visible: true
205 216 },
206 217 {
207 218 field: 'referCode',
... ... @@ -211,14 +222,18 @@
211 222 {
212 223 field: 'referDetailId',
213 224 title: '调整单关联明细ID',
214   - visible: false
  225 + visible: true
215 226 },
216 227  
217 228 {
218 229 field: 'problemType',
219 230 title: '调整类型',
220   - sortable: true,
221   - visible: true
  231 + align: 'center',
  232 + formatter: function (value, row, index) {
  233 + return $.table.selectDictLabel(type2, value);
  234 + },
  235 + visible: true,
  236 + //sortable: true
222 237 },
223 238 {
224 239 field: 'fromQty',
... ... @@ -278,9 +293,9 @@
278 293 },
279 294 {
280 295 field: 'status',
281   - title: '明细状态',
  296 + title: '调整状态',
282 297 formatter: function (value, row, index) {
283   - return $.table.selectDictLabel(datas, value);
  298 + return $.table.selectDictLabel(adjustStatus, value);
284 299 },
285 300 sortable: true
286 301 },
... ... @@ -299,7 +314,15 @@
299 314 title: '处理标记',
300 315 visible: false
301 316 },
302   -
  317 + {
  318 + title: '操作',
  319 + align: 'center',
  320 + formatter: function (value, row, index) {
  321 + var actions = [];
  322 + actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
  323 + return actions.join('');
  324 + }
  325 + }
303 326  
304 327 ]
305 328 };
... ...
src/main/resources/templates/inventory/adjustDetail/adjustEdit.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-cyclecountAdjustDetail-AdjustEdit" th:object="${cyclecountAdjustDetailEdit}" >
  8 + <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="*{cyclecountAdjustId}">
  9 +
  10 + <div class="form-group">
  11 + <label class="col-sm-3 control-label">明细id:</label>
  12 + <div class="col-sm-8">
  13 + <input id="id" name="id" th:value="*{id}" class="form-control" type="text"readonly="readonly">
  14 + </div>
  15 + </div>
  16 + <div class="form-group">
  17 + <label class="col-sm-3 control-label">调整单编号:</label>
  18 + <div class="col-sm-8">
  19 + <input id="cyclecountAdjustCode" name="cyclecountAdjustCode" th:value="*{cyclecountAdjustCode}" class="form-control" type="text" readonly="readonly">
  20 + </div>
  21 + </div>
  22 + <div class="form-group">
  23 + <label class="col-sm-3 control-label">货主编码:</label>
  24 + <div class="col-sm-8">
  25 + <input id="companyCode" name="companyCode" th:value="*{companyCode}" class="form-control" type="text" readonly="readonly">
  26 + </div>
  27 + </div>
  28 + <div class="form-group">
  29 + <label class="col-sm-3 control-label">盘点单编号:</label>
  30 + <div class="col-sm-8">
  31 + <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="*{cyclecountHeadCode}" class="form-control" type="text" readonly="readonly">
  32 + </div>
  33 + </div>
  34 + <div class="form-group">
  35 + <label class="col-sm-3 control-label">物料编码:</label>
  36 + <div class="col-sm-8">
  37 + <input id="materialCode" name="materialCode" th:value="*{materialCode}" class="form-control" type="text"readonly="readonly">
  38 + </div>
  39 + </div>
  40 +
  41 + <div class="form-group">
  42 + <label class="col-sm-3 control-label">库位编码:</label>
  43 + <div class="col-sm-8">
  44 + <input id="locationCode" name="locationCode" th:value="*{locationCode}" class="form-control" type="text" readonly="readonly">
  45 + </div>
  46 + </div>
  47 + <div class="form-group">
  48 + <label class="col-sm-3 control-label">容器编号:</label>
  49 + <div class="col-sm-8">
  50 + <input id="containerCode" name="containerCode" th:value="*{containerCode}" class="form-control" type="text" readonly="readonly">
  51 + </div>
  52 + </div>
  53 + <div class="form-group">
  54 + <label class="col-sm-3 control-label">入库单编码:</label>
  55 + <div class="col-sm-8">
  56 + <input id="receiptCode" name="receiptCode" th:value="*{receiptCode}" class="form-control" type="text"readonly="readonly">
  57 + </div>
  58 + </div>
  59 + <!--<div class="form-group">
  60 + <label class="col-sm-3 control-label">重量kg:</label>
  61 + <div class="col-sm-8">
  62 + <input id="weight" name="weight" th:value="*{weight}" class="form-control" type="text" readonly="readonly">
  63 + </div>
  64 + </div>-->
  65 + <div class="form-group">
  66 + <label class="col-sm-3 control-label">库存id:</label>
  67 + <div class="col-sm-8">
  68 + <input id="inventoryId" name="inventoryId" th:value="*{inventoryId}" class="form-control" type="text"readonly="readonly">
  69 + </div>
  70 + </div>
  71 + <div class="form-group">
  72 + <label class="col-sm-3 control-label">库存状态:</label>
  73 + <div class="col-sm-8">
  74 + <select id="inventoryStatus" name="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}" disabled="disabled">
  75 + <option th:each="dict : ${inventoryStatus}" th:field="*{inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  76 + </select>
  77 + </div>
  78 + </div>
  79 + <div class="form-group">
  80 + <label class="col-sm-3 control-label">系统数量:</label>
  81 + <div class="col-sm-8">
  82 + <input id="systemQty" name="systemQty" th:value="*{systemQty}" class="form-control" type="text"readonly="readonly">
  83 + </div>
  84 + </div>
  85 + <div class="form-group">
  86 + <label class="col-sm-3 control-label">实际数量:</label>
  87 + <div class="col-sm-8">
  88 + <input id="countedQty" name="countedQty" th:value="*{countedQty}" class="form-control" type="text" readonly="readonly">
  89 + </div>
  90 + </div>
  91 + <div class="form-group">
  92 + <label class="col-sm-3 control-label">差异数量:</label>
  93 + <div class="col-sm-8">
  94 + <input id="gapQty" name="gapQty" th:value="*{gapQty}" class="form-control" type="text" readonly="readonly">
  95 + </div>
  96 + </div>
  97 + <div class="form-group">
  98 + <label class="col-sm-3 control-label">调整数量:</label>
  99 + <div class="col-sm-8">
  100 + <input id="adjustQty" name="adjustQty" class="form-control" type="text" placeholder="填写物料的差异数值" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')">
  101 + </div>
  102 + </div>
  103 +
  104 + <div class="form-group">
  105 + <label class="col-sm-3 control-label">批次:</label>
  106 + <div class="col-sm-8">
  107 + <input id="batch" name="batch" th:value="*{batch}" class="form-control" type="text" readonly="readonly">
  108 + </div>
  109 + </div>
  110 + <div class="form-group">
  111 + <label class="col-sm-3 control-label">批号:</label>
  112 + <div class="col-sm-8">
  113 + <input id="lot" name="lot" th:value="*{lot}" class="form-control" type="text"readonly="readonly">
  114 + </div>
  115 + </div>
  116 + <div class="form-group">
  117 + <label class="col-sm-3 control-label">项目号:</label>
  118 + <div class="col-sm-8">
  119 + <input id="project" name="project" th:value="*{project}" class="form-control"readonly="readonly">
  120 + </div>
  121 + </div>
  122 + <!--<div class="form-group">
  123 + <label class="col-sm-3 control-label">生产日期:</label>
  124 + <div class="col-sm-8">
  125 + <input id="manufactureDate" name="manufactureDate" th:value="*{manufactureDate}" class="form-control" type="text" readonly="readonly">
  126 + </div>
  127 + </div>-->
  128 + <div class="form-group">
  129 + <label class="col-sm-3 control-label">失效日期:</label>
  130 + <div class="col-sm-8">
  131 + <input id="expirationDate" name="expirationDate" th:value="*{expirationDate}" class="form-control" type="text"readonly="readonly">
  132 + </div>
  133 + </div>
  134 +
  135 + <div class="form-group">
  136 + <div class="form-control-static col-sm-offset-9">
  137 + <button type="submit" class="btn btn-success">确认</button><!--只调整数量 adjustUpdate-->
  138 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  139 + </div>
  140 + </div>
  141 + </form>
  142 +</div>
  143 +<div th:include="include::footer"></div>
  144 +<script type="text/javascript">
  145 + var prefix = ctx + "inventory/cyclecountAdjustDetail"
  146 + $("#form-cyclecountAdjustDetail-AdjustEdit").validate({
  147 + rules:{
  148 + adjustQty:{
  149 + required:true,
  150 + },
  151 + //必填判定
  152 + },
  153 + submitHandler: function(form) {
  154 + $.operate.save(prefix + "/editAdjustSave", $('#form-cyclecountAdjustDetail-AdjustEdit').serialize());
  155 + }
  156 + });
  157 + /*时间弹框*/
  158 + $(function () {
  159 + layui.use('laydate', function() {
  160 + var laydate = layui.laydate;
  161 + laydate.render({ elem: '#manufactureDate',max: 0, theme: 'molv' ,type: 'datetime'});
  162 + laydate.render({ elem: '#expirationDate',min: 0, theme: 'molv' ,type: 'datetime'});
  163 + });
  164 + })
  165 +
  166 +</script>
  167 +</body>
  168 +</html>
... ...
src/main/resources/templates/inventory/adjustHeader/add.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 + <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 +
  8 + <form class="form-horizontal m" id="form-cyclecountAdjustDetail-addAdjust" >
  9 + <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="${cyclecountAdjustId}">
  10 +
  11 + <div class="form-group">
  12 + <label class="col-sm-3 control-label">调整单编号:</label>
  13 + <div class="col-sm-8">
  14 + <input id="code" name="code" th:value="${code}" class="form-control" type="text" readonly="readonly">
  15 + </div>
  16 + </div>
  17 + <div class="form-group">
  18 + <label class="col-sm-3 control-label">货主编码:</label>
  19 + <div class="col-sm-8">
  20 + <input id="companyId" name="companyId" type="hidden" th:value="*{companyId}">
  21 + <input id="companyCode" name="companyCode" th:value="${companyCode}" class="form-control" type="text" readonly="readonly">
  22 + </div>
  23 + </div>
  24 + <div class="form-group">
  25 + <label class="col-sm-3 control-label">盘点单编号:</label>
  26 + <div class="col-sm-8">
  27 + <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="${cyclecountHeadCode}" class="form-control" type="text" readonly="readonly">
  28 + </div>
  29 + </div>
  30 + <div class="form-group">
  31 + <label class="col-sm-3 control-label">物料编码:</label>
  32 + <div class="col-sm-8">
  33 + <input id="materialCode" name="materialCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  34 + </div>
  35 + </div>
  36 + <div class="form-group">
  37 + <label class="col-sm-3 control-label">库位编码:</label>
  38 + <div class="col-sm-8">
  39 + <input id="locationCode" name="locationCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  40 + </div>
  41 + </div>
  42 + <div class="form-group">
  43 + <label class="col-sm-3 control-label">容器编号:</label>
  44 + <div class="col-sm-8">
  45 + <input id="containerCode" name="containerCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  46 + </div>
  47 + </div>
  48 + <div class="form-group">
  49 + <label class="col-sm-3 control-label">库存状态:</label>
  50 + <div class="col-sm-8">
  51 + <select id="inventoryStatus" name="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}">
  52 + <option th:each="dict : ${inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  53 + </select>
  54 + </div>
  55 + </div>
  56 + <div class="form-group">
  57 + <label class="col-sm-3 control-label">系统数量:</label>
  58 + <div class="col-sm-8">
  59 + <input id="systemQty" name="systemQty" value="0" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" readonly="readonly">
  60 + </div>
  61 + </div>
  62 + <div class="form-group">
  63 + <label class="col-sm-3 control-label">实际数量:</label>
  64 + <div class="col-sm-8">
  65 + <input id="countedQty" name="countedQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" >
  66 + </div>
  67 + </div>
  68 + <div class="form-group">
  69 + <label class="col-sm-3 control-label">差异数量:</label>
  70 + <div class="col-sm-8">
  71 + <input id="gapQty" name="gapQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" >
  72 + </div>
  73 + </div>
  74 + <div class="form-group">
  75 + <label class="col-sm-3 control-label">调整数量:</label>
  76 + <div class="col-sm-8">
  77 + <input id="adjustQty" name="adjustQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')">
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group">
  82 + <label class="col-sm-3 control-label">批次:</label>
  83 + <div class="col-sm-8">
  84 + <input id="batch" name="batch" class="form-control" type="text" >
  85 + </div>
  86 + </div>
  87 + <div class="form-group">
  88 + <label class="col-sm-3 control-label">批号:</label>
  89 + <div class="col-sm-8">
  90 + <input id="lot" name="lot" class="form-control" type="text" >
  91 + </div>
  92 + </div>
  93 + <div class="form-group">
  94 + <label class="col-sm-3 control-label">项目号:</label>
  95 + <div class="col-sm-8">
  96 + <input id="project" name="project" class="form-control" type="text" >
  97 + </div>
  98 + </div>
  99 + <div class="form-group">
  100 + <label class="col-sm-3 control-label">生产日期:</label>
  101 + <div class="col-sm-8">
  102 + <input id="manufactureDate" name="manufactureDate" class="form-control" type="text" >
  103 + </div>
  104 + </div>
  105 + <div class="form-group">
  106 + <label class="col-sm-3 control-label">失效日期:</label>
  107 + <div class="col-sm-8">
  108 + <input id="expirationDate" name="expirationDate" class="form-control" type="text">
  109 + </div>
  110 + </div>
  111 +
  112 +
  113 + <div class="form-group">
  114 + <div class="form-control-static col-sm-offset-9">
  115 + <button type="submit" class="btn btn-primary">提交</button><!--盘有 adjustInsert-->
  116 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  117 + </div>
  118 + </div>
  119 + </form>
  120 + </div>
  121 + <div th:include="include::footer"></div>
  122 + <script type="text/javascript">
  123 + var prefix = ctx + "inventory/cyclecountAdjustDetail"
  124 +
  125 + $("#form-cyclecountAdjustDetail-addAdjust").validate({
  126 + rules:{
  127 + materialCode:{
  128 + required:true,
  129 + },
  130 + containerCode:{
  131 + required:true,
  132 + },
  133 + locationCode:{
  134 + required:true,
  135 + },
  136 + systemQty:{
  137 + required:true,
  138 + },
  139 + countedQty:{
  140 + required:true,
  141 + },
  142 + gapQty:{
  143 + required:true,
  144 + },
  145 + adjustQty:{
  146 + required:true,
  147 + },
  148 +
  149 + //必须填值判定
  150 + },
  151 + submitHandler: function(form) {
  152 + $.operate.save(prefix + "/addAdjust", $('#form-cyclecountAdjustDetail-addAdjust').serialize());
  153 + }
  154 + });
  155 +
  156 + /*时间弹框*/
  157 + $(function () {
  158 + layui.use('laydate', function() {
  159 + var laydate = layui.laydate;
  160 + laydate.render({ elem: '#manufactureDate',max: 0, theme: 'molv' ,type: 'datetime'});
  161 + laydate.render({ elem: '#expirationDate',min: 0, theme: 'molv' ,type: 'datetime'});
  162 + });
  163 + })
  164 +
  165 + </script>
  166 +</body>
  167 +</html>
... ...
src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
... ... @@ -67,6 +67,16 @@
67 67 </div>
68 68 </form>
69 69 </div>
  70 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  71 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
  72 + shiro:hasPermission="inventory:cycleCount:add">
  73 + <i class="fa fa-plus"></i> 新增
  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>-->
  79 + </div>
70 80 <table id="bootstrap-table" data-mobile-responsive="true"
71 81 class="table table-bordered table-hover"></table>
72 82 </div>
... ... @@ -82,7 +92,7 @@
82 92 var upload = [[${@permission.hasPermi('inventoryHeader:adjustHeader:upload')}]];
83 93 var report = [[${@permission.hasPermi('inventoryHeader:adjustHeader:report')}]];
84 94 var datas = [[${@dict.getType('sys_normal_disable')}]];
85   - var status2 = [[${@dict.getType('adjustType')}]];
  95 + var type2 = [[${@dict.getType('adjustType')}]];
86 96  
87 97 $(function () {
88 98 var options = {
... ... @@ -121,10 +131,10 @@
121 131 field: 'cycleCountCode',
122 132 title: '盘点单编码'
123 133 },
124   - {
  134 + /*{
125 135 field: 'problemType',
126 136 title: '调整类型'
127   - },
  137 + },*/
128 138 {
129 139 field: 'referCode',
130 140 title: '关联上游单编码'
... ... @@ -138,9 +148,10 @@
138 148 title: '调整类型',
139 149 align: 'center',
140 150 formatter: function (value, row, index) {
141   - return $.table.selectDictLabel(status2, value);
  151 + return $.table.selectDictLabel(type2, value);
142 152 },
143   - sortable: true
  153 + visible: true,
  154 + //sortable: true
144 155 },
145 156  
146 157 {
... ... @@ -170,7 +181,7 @@
170 181 var actions = [];
171 182 actions.push('<a class="btn btn-success btn-xs ' + report + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
172 183 actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> ');
173   - /* actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/
  184 + actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
174 185 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>');
175 186 return actions.join('');
176 187 }
... ...
src/main/resources/templates/shipment/wave/wave.html
... ... @@ -30,8 +30,14 @@
30 30 </form>
31 31 </div>
32 32 <div class="btn-group hidden-xs" id="toolbar" role="group">
33   - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="shipment:wave:add">
34   - <i class="fa fa-plus"></i> 新增
  33 + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="shipment:wave:add">-->
  34 + <!--<i class="fa fa-plus"></i> 新增-->
  35 + <!--</a>-->
  36 + <a class="btn btn-outline btn-success btn-rounded" onclick="startWave()" shiro:hasPermission="shipment:wave:startWave">
  37 + <i class="fa fa-plus"></i> 开始波次
  38 + </a>
  39 + <a class="btn btn-outline btn-success btn-rounded" onclick="freed()" shiro:hasPermission="shipment:wave:freed">
  40 + <i class="fa fa-plus"></i> 释放
35 41 </a>
36 42 <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="shipment:wave:remove">
37 43 <i class="fa fa-trash-o"></i> 删除
... ... @@ -200,7 +206,7 @@
200 206 align: 'center',
201 207 formatter: function(value, row, index) {
202 208 var actions = [];
203   - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
  209 + // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
204 210 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>');
205 211 return actions.join('');
206 212 }
... ... @@ -208,6 +214,23 @@
208 214 };
209 215 $.table.init(options);
210 216 });
  217 +
  218 +
  219 + //开始波次
  220 + function startWave() {
  221 + var rows = $("#bootstrap-table").bootstrapTable('getSelections');
  222 + if (rows.length == 0) {
  223 + $.modal.alertWarning("请至少选择一条记录");
  224 + return;
  225 + }
  226 + var url = prefix + "/startWave";
  227 + var data = {
  228 + "ids": rows.map(function (v) {
  229 + return v.id;
  230 + }).join(',')
  231 + };
  232 + localSubmit(url, "post", "json", data);
  233 + }
211 234 </script>
212 235 </body>
213 236 </html>
214 237 \ No newline at end of file
... ...