diff --git a/src/main/java/com/huaheng/pc/config/cycleCountPreference/controller/cycleCountPreferenceController.java b/src/main/java/com/huaheng/pc/config/cycleCountPreference/controller/cycleCountPreferenceController.java index 1e981b5..0a34cf0 100644 --- a/src/main/java/com/huaheng/pc/config/cycleCountPreference/controller/cycleCountPreferenceController.java +++ b/src/main/java/com/huaheng/pc/config/cycleCountPreference/controller/cycleCountPreferenceController.java @@ -103,12 +103,10 @@ public class cycleCountPreferenceController extends BaseController { @PostMapping("/addSave") @ResponseBody public AjaxResult addSave(CycleCountPreference cycleCountPreference) { - cycleCountPreference.setWarehouseCode(ShiroUtils.getWarehouseCode()); - cycleCountPreference.setCreatedBy(ShiroUtils.getLoginName()); - cycleCountPreference.setCreated(new Date()); - cycleCountPreference.setLastUpdatedBy(ShiroUtils.getLoginName()); - - return toAjax(cycleCountPreferenceService.save(cycleCountPreference)); + if(cycleCountPreference == null){ + return AjaxResult.error("新增数据不能为空!"); + } + return cycleCountPreferenceService.addSave(cycleCountPreference); } /** diff --git a/src/main/java/com/huaheng/pc/config/cycleCountPreference/domain/CycleCountPreference.java b/src/main/java/com/huaheng/pc/config/cycleCountPreference/domain/CycleCountPreference.java index 1225c3c..35df40b 100644 --- a/src/main/java/com/huaheng/pc/config/cycleCountPreference/domain/CycleCountPreference.java +++ b/src/main/java/com/huaheng/pc/config/cycleCountPreference/domain/CycleCountPreference.java @@ -81,8 +81,8 @@ public class CycleCountPreference implements Serializable { /** * 有效 */ - @TableField(value = "Enable") - @ApiModelProperty(value="有效") + @TableField(value = "enable") + @ApiModelProperty(value="是否有效") private Boolean enable; /** diff --git a/src/main/java/com/huaheng/pc/config/cycleCountPreference/service/CycleCountPreferenceService.java b/src/main/java/com/huaheng/pc/config/cycleCountPreference/service/CycleCountPreferenceService.java index 3419a05..e471698 100644 --- a/src/main/java/com/huaheng/pc/config/cycleCountPreference/service/CycleCountPreferenceService.java +++ b/src/main/java/com/huaheng/pc/config/cycleCountPreference/service/CycleCountPreferenceService.java @@ -1,12 +1,84 @@ package com.huaheng.pc.config.cycleCountPreference.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; +import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; +import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huaheng.pc.config.cycleCountPreference.mapper.CycleCountPreferenceMapper; import com.huaheng.pc.config.cycleCountPreference.domain.CycleCountPreference; +import org.springframework.transaction.annotation.Transactional; + @Service public class CycleCountPreferenceService extends ServiceImpl<CycleCountPreferenceMapper, CycleCountPreference> { + + @Resource + private CycleCountDetailService cycleCountDetailService; + + + + + /** + *新增盘点首选项 + * @param cycleCountPreference + * @return + */ + @Transactional + public AjaxResult addSave (CycleCountPreference cycleCountPreference){ + + cycleCountPreference.setCode(newCode()); + cycleCountPreference.setWarehouseCode(ShiroUtils.getWarehouseCode()); + cycleCountPreference.setCreatedBy(ShiroUtils.getLoginName()); + cycleCountPreference.setCreated(new Date()); + cycleCountPreference.setLastUpdatedBy(ShiroUtils.getLoginName()); + this.save(cycleCountPreference); + return AjaxResult.success("新增完成!"); + } + + + /** + * 自动生成盘点首选项Code + * 使用特定字段和ID组合成Code + */ + public String newCode(){ + //先查询前一个ID生成当前的数字,再拼接 + String code = null; + Date now = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); + LambdaQueryWrapper<CycleCountPreference> lambda = Wrappers.lambdaQuery(); + lambda.select(CycleCountPreference::getCode) + .orderByDesc(CycleCountPreference::getId).last("Limit 1"); + // code = ccp + 日期 + (排序号 + 1) + String maxCode = null; + CycleCountPreference cycleCountPreference = this.getOne(lambda); + if ( cycleCountPreference != null){ + maxCode = this.getOne(lambda).getCode(); + } + if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) { + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5 )); + code = "ccp" + df.format(now) + String.format("%05d", Count + 1); + } else { + code = "ccp" + df.format(now) +"00001"; + } + return code; + } + + + + + + + + + + } diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java index f3cdad0..2990643 100644 --- a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java +++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java @@ -287,6 +287,12 @@ public class CycleCountDetail implements Serializable { @ApiModelProperty(value = "盘点主单号") private String cycleCountHeadCode; + /** + *盘点首选项编码 + */ + @TableField(value = "preferenceCode") + @ApiModelProperty(value = "盘点首选项编码") + private String preferenceCode; @@ -587,6 +593,14 @@ public class CycleCountDetail implements Serializable { this.gapQty = gapQty; } + public String getPreferenceCode() { + return preferenceCode; + } + + public void setPreferenceCode(String preferenceCode) { + this.preferenceCode = preferenceCode; + } + /** * 获取失败原因 * diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java index 488c5b5..a358d26 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java @@ -513,7 +513,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont Wave wave = waveService.getById(item.getWaveId()); wave.setStatus(999); waveService.updateById(wave); - return AjaxResult.error("主单为"+item.getShipmentCode()+"子单id为"+item.getId() + "的单据没有库存,波次失败"); + throw new ServiceException("主单为"+item.getShipmentCode()+"子单id为"+item.getId() + "的单据没有库存,波次失败"); } if (inventoryList.size() < 1) { num = num + 1; diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/mapper/ShipmentDetailMapper.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/mapper/ShipmentDetailMapper.java index 04e6f78..32faa97 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/mapper/ShipmentDetailMapper.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/mapper/ShipmentDetailMapper.java @@ -16,5 +16,7 @@ public interface ShipmentDetailMapper extends BaseMapper<ShipmentDetail> { Integer countUnCompleted(Integer shipmentId); + Map<String,Integer> selectStatus(Integer id); + } \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java index 1f4896f..0729161 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java @@ -3,6 +3,10 @@ package com.huaheng.pc.shipment.shipmentDetail.service; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + public interface ShipmentDetailService extends IService<ShipmentDetail>{ /** @@ -20,5 +24,7 @@ public interface ShipmentDetailService extends IService<ShipmentDetail>{ //选中的单据加入波次 void saveWave(String ids,String code); + Map<String,Integer> selectStatus(Integer id); + } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java index 3c08b85..a3f1192 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java @@ -236,6 +236,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, }else { //创建波次 + wave=new Wave(); wave.setWarehouseCode(ShiroUtils.getWarehouseCode()); wave.setMasterCode(code); wave.setWaveName(waveMaster.getName()); @@ -273,4 +274,11 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, } } + + + //查看最高状态和最低状态 + @Override + public Map<String,Integer> selectStatus(Integer id) { + return shipmentDetailMapper.selectStatus(id); + } } diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java index a4098b0..c9e61b3 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java @@ -426,7 +426,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea throw new ServiceException("任务(" + taskId + ")任务已经是完成的!"); } //如果没有库位不能完成 - if (StringUtils.isEmpty(task.getToLocation())) { + if (StringUtils.isEmpty(task.getFromLocation())) { throw new ServiceException("任务" + taskId + "没有库位,执行中止"); } this.completeTask(task); @@ -1276,13 +1276,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea task.setLastUpdated(new Date()); taskHeaderService.updateById(task); - //如果是临时容器出库完成后删除容器 - containerService.removeByCode(task.getContainerCode()); //将库位状态改为空闲,如果是整出的对应的容器也清空 LambdaQueryWrapper<Location> lam=Wrappers.lambdaQuery(); - lam.eq(Location::getCode,task.getToLocation()); + lam.eq(Location::getCode,task.getFromLocation()); Location locationRecord = locationService.getOne(lam); if(lam == null){ throw new ServiceException("系统没有"+task.getToLocation()+"库位"); @@ -1345,25 +1343,47 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea shipmentContainerHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); LambdaUpdateWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId,task.getAllocationHeadId()); - if (! shipmentContainerHeaderService.update(shipmentContainerHeader, shipmentContainerHeaderLambdaUpdateWrapper)) + if (! shipmentContainerHeaderService.update(shipmentContainerHeader, shipmentContainerHeaderLambdaUpdateWrapper)) { throw new ServiceException("更新组盘头状态失败"); - //修改出库单状态 - LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); - taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId()); - List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper); - - for (TaskDetail taskDeatails: taskDetailList) { - LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); - shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getId,taskDeatails.getBillDetailId()); - - ShipmentHeader shipmentHeader =new ShipmentHeader(); - shipmentHeader.setId(shipmentDetailService.getOne(shipmentDetailLambdaQueryWrapper).getShipmentId()); - shipmentHeader.setFirstStatus(300); - shipmentHeader.setLastStatus(300); - shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); - shipmentHeader.setLastUpdated(new Date()); - shipmentHeaderService.updateById(shipmentHeader); - } + } + //修改出库单状态 + LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); + taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId()); + List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper); + + HashSet<Integer> ids = new HashSet<>(); + for (TaskDetail taskDeatails: taskDetailList) { + LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); + shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getId, taskDeatails.getBillDetailId()); + ShipmentDetail shipmentDetail = shipmentDetailService.getOne(shipmentDetailLambdaQueryWrapper); + if (shipmentDetail == null) { + throw new ServiceException("查找出库单明细失败"); + } + if (shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()) == 0) { + shipmentDetail.setStatus(500); + shipmentDetailService.updateById(shipmentDetail); + } + ids.add(shipmentDetail.getShipmentId()); + } + + for(Integer id : ids) { + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); + if(shipmentHeader != null) { + Map<String,Integer> status = shipmentDetailService.selectStatus(shipmentHeader.getId()); + Integer maxStatus = status.get("maxStatus"); + Integer minStatus = status.get("minStatus"); + if(maxStatus == 500){ + shipmentHeader.setFirstStatus(500); + } + if(minStatus == 500) { + shipmentHeader.setLastStatus(500); + } + shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); + shipmentHeader.setLastUpdated(new Date()); + shipmentHeaderService.updateById(shipmentHeader); + } + } + } diff --git a/src/main/resources/mybatis/config/CycleCountPreferenceMapper.xml b/src/main/resources/mybatis/config/CycleCountPreferenceMapper.xml index ee9d6e7..aedf5f4 100644 --- a/src/main/resources/mybatis/config/CycleCountPreferenceMapper.xml +++ b/src/main/resources/mybatis/config/CycleCountPreferenceMapper.xml @@ -12,7 +12,7 @@ <result column="promptItem" jdbcType="BOOLEAN" property="promptItem" /> <result column="promptQuantity" jdbcType="BOOLEAN" property="promptQuantity" /> <result column="allowAddNewInventory" jdbcType="BOOLEAN" property="allowAddNewInventory" /> - <result column="Enable" jdbcType="BOOLEAN" property="enable" /> + <result column="enable" jdbcType="BOOLEAN" property="enable" /> <result column="created" jdbcType="TIMESTAMP" property="created" /> <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> @@ -27,7 +27,7 @@ <sql id="Base_Column_List"> <!--@mbg.generated--> id, code, `name`, warehouseCode, promptLocation, promptLpn, promptItem, promptQuantity, - allowAddNewInventory, `Enable`, created, createdBy, lastUpdated, lastUpdatedBy, version, + allowAddNewInventory, enable, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, processStamp, countByPiece </sql> </mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/inventory/CycleCountDetailMapper.xml b/src/main/resources/mybatis/inventory/CycleCountDetailMapper.xml index 9c2b00f..4cb3d48 100644 --- a/src/main/resources/mybatis/inventory/CycleCountDetailMapper.xml +++ b/src/main/resources/mybatis/inventory/CycleCountDetailMapper.xml @@ -42,6 +42,7 @@ <result column="batch" jdbcType="VARCHAR" property="batch" /> <result column="lot" jdbcType="VARCHAR" property="lot" /> <result column="projectNo" jdbcType="VARCHAR" property="projectNo" /> + <result column="preferenceCode" jdbcType="VARCHAR" property="preferenceCode" /> </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> @@ -50,6 +51,6 @@ companyCode, inventorySts, systemQty, countedQty, gapQty, rejectionNote, countedBy, countedAt, assignedTo, assignedAt, completedBy, completedAt, enableStatus, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, processStamp, - batch, lot, projectNo + batch, lot, projectNo, preferenceCode </sql> </mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml b/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml index 539503a..c6412a0 100644 --- a/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml +++ b/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml @@ -80,4 +80,9 @@ SELECT COUNT(*) FROM shipment_detail WHERE shipmentId=#{shipmentId} AND shipQty>requestQty </select> + <select id="selectStatus" resultType="java.util.Map"> + SELECT max(status) maxStatus,min(status) minStatus + FROM shipment_detail + WHERE shipmentId=#{id} + </select> </mapper> \ No newline at end of file diff --git a/src/main/resources/static/huaheng/js/common.js b/src/main/resources/static/huaheng/js/common.js index 6621886..d3238e9 100644 --- a/src/main/resources/static/huaheng/js/common.js +++ b/src/main/resources/static/huaheng/js/common.js @@ -23,8 +23,10 @@ $(function(){ var laydate = layui.laydate; var day1 = new Date(); day1.setTime(day1.getTime()-24*60*60*1000*7); + var endDay = new Date(); + endDay.setTime(endDay.getTime()+24*60*60*1000); laydate.render({ elem: '#startTime', theme: 'molv',value: new Date(day1), isInitValue: true}); - laydate.render({ elem: '#endTime', theme: 'molv',value: new Date(), isInitValue: true }); + laydate.render({ elem: '#endTime', theme: 'molv',value: new Date(endDay), isInitValue: true }); }); } }); diff --git a/src/main/resources/templates/config/cycleCountPreference/add.html b/src/main/resources/templates/config/cycleCountPreference/add.html index 1f5648b..7f44e6f 100644 --- a/src/main/resources/templates/config/cycleCountPreference/add.html +++ b/src/main/resources/templates/config/cycleCountPreference/add.html @@ -1,16 +1,16 @@ <!DOCTYPE HTML> -<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <meta charset="utf-8"> <head th:include="include :: header"></head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-cycleCountPreference-add"> - <div class="form-group"> + <!--<div class="form-group"> <label class="col-sm-3 control-label">盘点首选项编码:</label> <div class="col-sm-8"> <input id="code" name="code" class="form-control" type="text"> </div> - </div> + </div>--> <div class="form-group"> <label class="col-sm-3 control-label">盘点首选项名称:</label> <div class="col-sm-8"> @@ -22,7 +22,8 @@ <label class="col-sm-3 control-label">系统提示库位:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptLocation" name="promptLocation"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptLocation" + name="promptLocation"> <label class="onoffswitch-label" for="promptLocation"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> @@ -35,7 +36,8 @@ <label class="col-sm-3 control-label">系统提示容器:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptLpn" name="promptLpn"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptLpn" + name="promptLpn"> <label class="onoffswitch-label" for="promptLpn"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> @@ -48,8 +50,9 @@ <label class="col-sm-3 control-label">系统提示物料:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptItem" name="promptItem"> - <label class="onoffswitch-label" for="promptLpn"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptItem" + name="promptItem"> + <label class="onoffswitch-label" for="promptItem"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label> @@ -60,120 +63,29 @@ <div class="form-group"> <label class="col-sm-3 control-label">显示库存数量:</label> <div class="col-sm-8"> - <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptQuantity" name="promptQuantity"> - <label class="onoffswitch-label" for="promptQuantity"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> + <div class="onoffswitch"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptQuantity" + name="promptQuantity"> + <label class="onoffswitch-label" for="promptQuantity"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> </div> </div> - -<!-- <div class="form-group"> - <label class="col-sm-3 control-label">允许添加库存:</label> - <div class="col-sm-8"> - <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="allowAddNewInventory" name="allowAddNewInventory"> - <label class="onoffswitch-label" for="allowAddNewInventory"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> - </div> - </div>--> - -<!-- <div class="form-group"> - <label class="col-sm-3 control-label">RF逐件盘点:</label> + <div class="form-group"> + <label class="col-sm-3 control-label">是否有效:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="countByPiece" name="countByPiece"> - <label class="onoffswitch-label" for="countByPiece"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" + name="enable"> + <label class="onoffswitch-label" for="enable"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label> </div> </div> - </div>--> - - <!--<div class="form-group"> - <label class="col-sm-3 control-label">数据版本:</label> - <div class="col-sm-8"> - <input id="version" name="version" class="form-control" type="text"> - </div> - </div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="created" name="created" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建者:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新者:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <div class="form-group"> - <label class="col-sm-3 control-label">是否有效:</label> - <div class="col-sm-8"> - <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable"> - <label class="onoffswitch-label" for="enable"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> - </div> </div> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">是否删除:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="deleted" name="deleted" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段4:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef4" name="userDef4" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段5:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef5" name="userDef5" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> <div class="form-group"> <div class="form-control-static col-sm-offset-9"> <input type="submit" class="btn btn-primary" value="提交"> @@ -186,32 +98,22 @@ <script type="text/javascript"> var prefix = ctx + "config/cycleCountPreference"; $("#form-cycleCountPreference-add").validate({ - rules:{ - code:{ + rules: { + code: { required: true, }, - name:{ + name: { required: true, }, - promptLocation:{ - required: true, - }, - promptLpn:{ - required: true, - }, - promptItem:{ - required: true, - }, - promptQuantity: { - required: true, - }, - allowAddNewInventory: { - required: true, - } + }, - submitHandler: function(form) { + submitHandler: function (form) { var tableValue = $.common.getTableValue("#form-cycleCountPreference-add"); - //tableValue = formValueReplace(tableValue, "allowOverReceiving", $("input[name='allowOverReceiving']").is(':checked')); + tableValue = formValueReplace(tableValue, "promptLocation", $("input[name='promptLocation']").is(':checked')); + tableValue = formValueReplace(tableValue, "promptLpn", $("input[name='promptLpn']").is(':checked')); + tableValue = formValueReplace(tableValue, "promptItem", $("input[name='promptItem']").is(':checked')); + tableValue = formValueReplace(tableValue, "promptQuantity", $("input[name='promptQuantity']").is(':checked')); + tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); $.operate.save(prefix + "/addSave", tableValue); } }); diff --git a/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html b/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html index 146cf63..02023c3 100644 --- a/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html +++ b/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html @@ -90,29 +90,65 @@ { field : 'promptLocation', title : '系统提示库位', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } }, { field : 'promptLpn', - title : '系统提示容器' + title : '系统提示容器', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } }, { field : 'promptItem', - title : '系统提示物料' + title : '系统提示物料', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } }, { field : 'promptQuantity', - title : '显示库存数量' + title : '显示库存数量', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } }, { field : 'allowAddNewInventory', title : '允许添加库存', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + }, visible : false }, { - field : 'Enable', - title : '有效' - }, - { field : 'created', title : '创建时间', visible : true @@ -132,20 +168,40 @@ title : '更新用户', visible : false }, - { + /*{ field : 'version', title : '数据版本', visible : false - }, - { + },*/ + /*{ field : 'processStamp', title : '处理标记', visible : false - }, + },*/ { field : 'countByPiece', title : 'RF逐件盘点' , - visible : false + visible : false, + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } + }, + { + field : 'enable', + title : '有效', + formatter: function (value, item, index) { + if (value==true) { + return '<span class="badge" style="background-color: #00B83F;color: white;width: 36px;">' + ' 是 ' + '</span>'; + } + else if (value==false) { + return '<span class="badge" style="background-color: #ff0000;color: white;width: 36px;">' + ' 否 ' + '</span>'; + } + } }, /*{ field : 'userDef1', @@ -168,7 +224,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - //actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>修改</a> '); + actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>修改</a> '); actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); } diff --git a/src/main/resources/templates/config/cycleCountPreference/edit.html b/src/main/resources/templates/config/cycleCountPreference/edit.html index 18607bd..133a877 100644 --- a/src/main/resources/templates/config/cycleCountPreference/edit.html +++ b/src/main/resources/templates/config/cycleCountPreference/edit.html @@ -14,59 +14,74 @@ <div class="form-group"> <label class="col-sm-3 control-label">盘点首选项编码:</label> <div class="col-sm-8"> - <input id="code" name="code" class="form-control" type="text" th:field="*{code}"> + <input id="code" name="code" class="form-control" type="text" th:field="*{code}" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">盘点首选项名称:</label> <div class="col-sm-8"> - <input id="name" name="name" class="form-control" type="text" th:field="*{name}"> + <input id="name" name="name" class="form-control" type="text" th:field="*{name}" readonly="readonly"> </div> </div> - <div class="form-group"> + <!--<div class="form-group"> <label class="col-sm-3 control-label">仓库:</label> <div class="col-sm-8"> <input id="warehouseCode" name="warehouseCode" class="form-control" type="text" th:field="*{warehouseCode}" readonly="readonly"> </div> - </div> + </div>--> <div class="form-group"> <label class="col-sm-3 control-label">系统提示货位:</label> <div class="col-sm-8"> - <input id="promptLocation" name="promptLocation" class="form-control" type="text" th:field="*{promptLocation}"> + <div class="onoffswitch"> + <input type="checkbox" th:checked="*{promptLocation}" class="onoffswitch-checkbox" id="promptLocation" + name="promptLocation"> + <label class="onoffswitch-label" for="promptLocation"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">系统提示LPN:</label> - <div class="col-sm-8"> - <input id="promptLpn" name="promptLpn" class="form-control" type="text" th:field="*{promptLpn}"> - </div> - </div> - <!--<div class="form-group"> - <label class="col-sm-3 control-label">系统提示LPN:</label> + <label class="col-sm-3 control-label">系统提示容器:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="promptLpn" - name="promptLpn" th:field="*{promptLpn}"> + <input type="checkbox" th:checked="*{promptLpn}" class="onoffswitch-checkbox" id="promptLpn" + name="promptLpn" > <label class="onoffswitch-label" for="promptLpn"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label> </div> </div> - </div>--> + </div> <div class="form-group"> <label class="col-sm-3 control-label">系统提示物料:</label> <div class="col-sm-8"> - <input id="promptItem" name="promptItem" class="form-control" type="text" th:field="*{promptItem}"> + <div class="onoffswitch"> + <input type="checkbox" th:checked="*{promptItem}" class="onoffswitch-checkbox" id="promptItem" + name="promptItem"> + <label class="onoffswitch-label" for="promptItem"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">显示库存数量:</label> <div class="col-sm-8"> - <input id="promptQuantity" name="promptQuantity" class="form-control" type="text" th:field="*{promptQuantity}"> + <div class="onoffswitch"> + <input type="checkbox" th:checked="*{promptQuantity}" class="onoffswitch-checkbox" id="promptQuantity" + name="promptQuantity"> + <label class="onoffswitch-label" for="promptQuantity"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> </div> </div> - <div class="form-group"> + <!--<div class="form-group"> <label class="col-sm-3 control-label">允许添加库存:</label> <div class="col-sm-8"> <input id="allowAddNewInventory" name="allowAddNewInventory" class="form-control" type="text" th:field="*{allowAddNewInventory}"> @@ -83,7 +98,7 @@ <div class="col-sm-8"> <input id="version" name="version" class="form-control" type="text" th:field="*{version}"> </div> - </div> + </div>--> <div class="form-group"> <label class="col-sm-3 control-label">创建时间:</label> <div class="col-sm-8"> @@ -96,73 +111,25 @@ <input id="createdBy" name="createdBy" class="form-control" type="text" th:field="*{createdBy}" readonly="readonly"> </div> </div> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新者:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <div class="form-group"> + <!--<div class="form-group"> <label class="col-sm-3 control-label">处理标记:</label> <div class="col-sm-8"> <input id="processStamp" name="processStamp" class="form-control" type="text" th:field="*{processStamp}" /> </div> - </div> - <!--<div class="form-group"> - <label class="col-sm-3 control-label">是否有效:</label> - <div class="col-sm-8"> - <!–<input id="enable" name="enable" class="form-control" type="text">–> - <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable"> - <label class="onoffswitch-label" for="enable"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> - </div> </div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">是否删除:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="deleted" name="deleted" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段4:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef4" name="userDef4" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段5:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef5" name="userDef5" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> + <div class="form-group"> + <label class="col-sm-3 control-label">是否有效:</label> + <div class="col-sm-8"> + <div class="onoffswitch"> + <input type="checkbox" th:checked="*{enable}" class="onoffswitch-checkbox" id="enable" + name="enable" > + <label class="onoffswitch-label" for="enable"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </div> <div class="form-group"> <div class="form-control-static col-sm-offset-9"> <input type="submit" class="btn btn-primary" value="提交"> diff --git a/src/main/resources/templates/shipment/wave/wave.html b/src/main/resources/templates/shipment/wave/wave.html index 2b4a993..de6ebcc 100644 --- a/src/main/resources/templates/shipment/wave/wave.html +++ b/src/main/resources/templates/shipment/wave/wave.html @@ -229,7 +229,7 @@ return v.id; }).join(',') }; - localSubmit(url, "post", "json", data); + $.operate.submit(url, "post", "json", data); } @@ -246,7 +246,7 @@ return v.id; }).join(',') }; - localSubmit(url, "post", "json", data); + $.operate.submit(url, "post", "json", data); } </script> </body> diff --git a/src/main/resources/templates/task/task/task.html b/src/main/resources/templates/task/task/task.html index f7922a6..6c03c39 100644 --- a/src/main/resources/templates/task/task/task.html +++ b/src/main/resources/templates/task/task/task.html @@ -260,8 +260,7 @@ }, { field : 'userDef1', - title : '自定义字段1' , - visible:false + title : '处理' , }, { field : 'userDef2', diff --git a/src/main/resources/templates/task/taskHeader/taskHeader.html b/src/main/resources/templates/task/taskHeader/taskHeader.html index 4a393ae..b908105 100644 --- a/src/main/resources/templates/task/taskHeader/taskHeader.html +++ b/src/main/resources/templates/task/taskHeader/taskHeader.html @@ -30,9 +30,11 @@ <li> 容器编号:<input type="text" name="containerCode"/> </li> - + <li> + 源库位编号:<input type="text" name="fromLocation"/> + </li> <li> - 库位编号:<input type="text" name="toLocation"/> + 目的库位编号:<input type="text" name="toLocation"/> </li> <li class="time" style="height: 30px"> <label>创建时间: </label> @@ -170,9 +172,15 @@ } }, + { + field : 'fromLocation', + title : '源库位号', + visible:true + }, + { field : 'toLocation', - title : '库位号', + title : '目的库位号', visible:true }, { @@ -210,8 +218,7 @@ }, { field : 'userDef1', - title : '自定义字段1' , - visible:false + title : '处理' , }, { field : 'userDef2',