diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java index 100fb3e..3868091 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java @@ -6,7 +6,7 @@ import java.util.List; public interface LocationAllocationService { - String allocation(int locationRule, List<String> locationTypeCodeList, int high, String destination, String warehouseCode, String containerCode, Integer materialAreas); + String allocation(int locationRule, List<String> locationTypeCodeList, int high, String destination, String warehouseCode, String containerCode, String materialAreaCode); } diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java index 781a21b..9a49c99 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java @@ -39,7 +39,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService private TaskHeaderService taskHeaderService; @Override - public String allocation(int locationRule, List<String> locationTypeCodeList, int high, String area, String warehouseCode, String containerCode, Integer materialAreas) { + public String allocation(int locationRule, List<String> locationTypeCodeList, int high, String area, String warehouseCode, String containerCode, String materialAreaCode) { LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); containerLambdaQueryWrapper.eq(Container::getCode, containerCode) .eq(Container::getWarehouseCode, warehouseCode); @@ -71,9 +71,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService // } switch (locationRule) { case QuantityConstant.DOUBLE_FORK: - return doubleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreas); + return doubleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode); case QuantityConstant.SINGLE_FORK: - return singleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreas); + return singleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode); } return null; } @@ -81,25 +81,17 @@ public class LocationAllocationServiceImpl implements LocationAllocationService /* * 双伸位库位入库分配库位 */ - private String doubleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, Integer materialAreas) { + private String doubleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode) { LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getArea, area). eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) .eq(Location::getRowFlag, QuantityConstant.ROW_OUT) .eq(Location::getContainerCode, ""); List<Location> locationList = locationService.list(locationLambda); List<Location> removeLocaationList = new ArrayList<>(); - for (Location location1 : locationList) { - if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) { - removeLocaationList.add(location1); - } - Integer areas = location1.getMaterialAreas(); - if(areas.intValue() != materialAreas.intValue()) { - removeLocaationList.add(location1); - } - } locationList.removeAll(removeLocaationList); if (locationList == null || locationList.size() == 0) { locationLambda = Wrappers.lambdaQuery(); @@ -107,6 +99,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) .eq(Location::getRowFlag, QuantityConstant.ROW_IN) .eq(Location::getContainerCode, ""); locationList = locationService.list(locationLambda); @@ -125,25 +118,17 @@ public class LocationAllocationServiceImpl implements LocationAllocationService /* * 单伸位库位入库分配库位 */ - private String singleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, Integer materialAreas) { + private String singleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode) { LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getArea, area). eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) .in(Location::getLocationType, locationTypeCodeList) .eq(Location::getContainerCode, ""); List<Location> locationList = locationService.list(locationLambda); - List<Location> removeLocaationList = new ArrayList<>(); - if(!(materialAreas.intValue() == QuantityConstant.NOT_MATERIAL_AREAS)) { - for (Location location1 : locationList) { - Integer areas = location1.getMaterialAreas(); - if (areas.intValue() != materialAreas.intValue()) { - removeLocaationList.add(location1); - } - } - } - locationList.removeAll(removeLocaationList); + Location location = locationList.stream().findFirst().orElse(null); String locationCode = location.getCode(); return locationCode; diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java index 8b5a9a6..e229c09 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java @@ -173,7 +173,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService return AjaxResult.error("未绑定定位规则"); } int allocationRule = Integer.parseInt(value); - Integer materialAreas = 0; + String materialAreaCode = null; /* 循环查询入库组盘明细*/ List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); for (TaskDetail taskDetail : taskDetailList) { @@ -188,10 +188,10 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { String materialCode = receiptContainerDetailList.get(0).getMaterialCode(); Material material = materialService.findAllByCode(materialCode, warehouseCode); - materialAreas = material.getMaterialAreas(); + materialAreaCode = material.getMaterialAreaCode(); } locationCode = locationAllocationService.allocation(allocationRule, - locationTypeCodeList, high, destination, warehouseCode, containerCode, materialAreas); + locationTypeCodeList, high, destination, warehouseCode, containerCode, materialAreaCode); if (StringUtils.isEmpty(locationCode)) { return AjaxResult.error("没有库位可分配"); } diff --git a/src/main/java/com/huaheng/pc/config/location/domain/Location.java b/src/main/java/com/huaheng/pc/config/location/domain/Location.java index b73eacd..4847a03 100644 --- a/src/main/java/com/huaheng/pc/config/location/domain/Location.java +++ b/src/main/java/com/huaheng/pc/config/location/domain/Location.java @@ -99,8 +99,8 @@ public class Location implements Serializable { /** * 物料分区 */ - @TableField(value = "materialAreas") - private Integer materialAreas; + @TableField(value = "materialAreaCode") + private String materialAreaCode; /** * 名称 diff --git a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java index 6a74190..20cb96d 100644 --- a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java +++ b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java @@ -164,7 +164,7 @@ public class MaterialController extends BaseController { String[] idArray = Convert.toStrArray(ids); LambdaUpdateWrapper<Material> wrapper = Wrappers.lambdaUpdate(); wrapper.in(Material::getId, idArray) - .set(Material::getMaterialAreas, Integer.parseInt(area)); + .set(Material::getMaterialAreaCode, Integer.parseInt(area)); return toAjax(materialService.update(wrapper)); } diff --git a/src/main/java/com/huaheng/pc/config/material/domain/Material.java b/src/main/java/com/huaheng/pc/config/material/domain/Material.java index 651f663..eac75ca 100644 --- a/src/main/java/com/huaheng/pc/config/material/domain/Material.java +++ b/src/main/java/com/huaheng/pc/config/material/domain/Material.java @@ -315,7 +315,7 @@ public class Material implements Serializable { /** * 物料分区 */ - @TableField(value = "materialAreas") - private Integer materialAreas; + @TableField(value = "materialAreaCode") + private String materialAreaCode; } \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java b/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java new file mode 100644 index 0000000..12687f6 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java @@ -0,0 +1,133 @@ +package com.huaheng.pc.config.materialArea.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.support.Convert; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.framework.aspectj.lang.annotation.Log; +import com.huaheng.framework.aspectj.lang.constant.BusinessType; +import com.huaheng.framework.web.controller.BaseController; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.page.TableDataInfo; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationHigh.service.LocationHighService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.service.MaterialAreaService; +import io.swagger.annotations.Api; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 物料分区 + * + * @author youjie + * @date 2021-08-24 + */ +@Api(tags = "物料分区") +@Controller +@RequestMapping("/config/materialArea") +public class MaterialAreaController extends BaseController +{ + private String prefix = "config/materialArea"; + + @Autowired + private MaterialAreaService materialAreaService; + + @GetMapping() + public String materialArea() + { + return prefix + "/materialArea"; + } + + /** + * 查询物料分区列表 + */ + @Log(title = "基础数据-物料分区", operating = "物料分区", action = BusinessType.GRANT) + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(MaterialArea materialArea, String createdBegin, String createdEnd) + { + LambdaQueryWrapper<MaterialArea> lambdaQueryWrapper = Wrappers.lambdaQuery(); + startPage(); + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), MaterialArea::getCreated, createdBegin) + .le(StringUtils.isNotEmpty(createdEnd), MaterialArea::getCreated, createdEnd) + .eq(MaterialArea::getWarehouseCode, ShiroUtils.getWarehouseCode()) + .eq(StringUtils.isNotEmpty(materialArea.getCode()), MaterialArea::getCode, materialArea.getCode()) + .orderByAsc(MaterialArea::getId); + + List<MaterialArea> list = materialAreaService.list(lambdaQueryWrapper); + return getDataTable(list); + } + + /** + * 新增库位类型 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "新增物料分区", action = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(MaterialArea materialArea) + { + if(StringUtils.isEmpty(materialArea.getCode())) { + return AjaxResult.error("物料分区编码为空"); + } + materialArea.setWarehouseCode(ShiroUtils.getWarehouseCode()); + return toAjax(materialAreaService.save(materialArea)); + } + + /** + * 修改物料分区 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) + { + MaterialArea materialArea = materialAreaService.getById(id); + mmap.put("materialArea", materialArea); + return prefix + "/edit"; + } + + + /** + * 修改物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "修改物料分区", action = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(MaterialArea materialArea) + { + return toAjax(materialAreaService.saveOrUpdate(materialArea)); + } + + /** + * 删除物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "修改物料分区", action = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + if (StringUtils.isEmpty(ids)) { + return AjaxResult.error("id不能为空"); + } + for (Integer id : Convert.toIntArray(ids)) + { + materialAreaService.removeById(id); + } + return AjaxResult.success("删除成功!"); + } + +} diff --git a/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java b/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java new file mode 100644 index 0000000..f18cd04 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java @@ -0,0 +1,50 @@ +package com.huaheng.pc.config.materialArea.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName(value = "material_area") +public class MaterialArea implements Serializable { + + /** + * 内部号 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 仓库编码 + */ + @TableField(value = "warehouseCode") + private String warehouseCode; + + /** + * 编码 + */ + @TableField(value = "code") + private String code; + + + /** + * 名字 + */ + @TableField(value = "name") + private String name; + + /** + * 创建时间 + */ + @TableField(value = "created", fill = FieldFill.INSERT) + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy", fill = FieldFill.INSERT) + private String createdBy; + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java b/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java new file mode 100644 index 0000000..08afeee --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java @@ -0,0 +1,10 @@ +package com.huaheng.pc.config.materialArea.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationType.domain.LocationType; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; + +public interface MaterialAreaMapper extends BaseMapper<MaterialArea> { + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java new file mode 100644 index 0000000..b9590db --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java @@ -0,0 +1,14 @@ +package com.huaheng.pc.config.materialArea.service; + +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationType.domain.LocationType; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; + +import java.util.List; +import java.util.Map; + +public interface MaterialAreaService extends IService<MaterialArea>{ + + List<Map<String, Object>> getCode(); +} diff --git a/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java new file mode 100644 index 0000000..7be5832 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java @@ -0,0 +1,29 @@ +package com.huaheng.pc.config.materialArea.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationHigh.mapper.LocationHighMapper; +import com.huaheng.pc.config.locationHigh.service.LocationHighService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.mapper.MaterialAreaMapper; +import com.huaheng.pc.config.zone.domain.Zone; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service("MaterialArea") +public class MaterialAreaServiceImpl extends ServiceImpl<MaterialAreaMapper, MaterialArea> implements MaterialAreaService { + + + @Override + public List<Map<String, Object>> getCode() { + LambdaQueryWrapper<MaterialArea> lambda = Wrappers.lambdaQuery(); + lambda.select(MaterialArea::getCode, MaterialArea::getId, MaterialArea::getName) + .eq(MaterialArea::getWarehouseCode, ShiroUtils.getWarehouseCode()); + return this.listMaps(lambda); + } +} diff --git a/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java index 30ac59b..92ba774 100644 --- a/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java +++ b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java @@ -57,6 +57,12 @@ public class MaterialType implements Serializable { private String abcClass; /** + * 物料分区 + */ + @TableField(value = "materialAreaCode") + private String materialAreaCode; + + /** * 保质期(天) */ @TableField(value = "daysToExpire") diff --git a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java index 3d1bf43..7828936 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java +++ b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java @@ -159,8 +159,8 @@ public class ReceivingService { } int allocationRule = Integer.parseInt(value); Material material = materialService.findAllByCode(receiptContainerDetail.getMaterialCode()); - Integer materialAreas = material.getMaterialAreas(); - String locationCode = locationAllocationService.allocation(allocationRule, null, 0, area, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreas); + String materialAreaCode = material.getMaterialAreaCode(); + String locationCode = locationAllocationService.allocation(allocationRule, null, 0, area, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreaCode); if (StringUtils.isNotEmpty(locationCode)){ locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK); diff --git a/src/main/resources/templates/config/material/material.html b/src/main/resources/templates/config/material/material.html index 0f001b5..99e7874 100644 --- a/src/main/resources/templates/config/material/material.html +++ b/src/main/resources/templates/config/material/material.html @@ -70,6 +70,8 @@ var prefix = ctx + "config/material"; var datas = [[${@dict.getType('sys_normal_disable')}]]; var mType = [[${@materialType.queryType()}]]; + var materialArea =[[${@materialArea.getCode()}]]; + $(function() { var options = { url: prefix + "/list", @@ -134,6 +136,21 @@ title : '规格' }, { + field: 'materialAreaCode', + title: '物料分区', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + $.each(materialArea, function(index, dict) { + if (dict.code == value) { + actions.push("<span class='badge badge-info'>" + dict.name + "</span>"); + return false; + } + }); + return actions.join(''); + } + }, + { field : 'unit', title : '单位' , visible:false @@ -170,14 +187,17 @@ { field : 'attributeTemplateCode', title : '属性模板' , + visible:false, }, { field : 'trackSerialNum', title : '记录序列号' , + visible:false, }, { field : 'autoGenSerialNum', title : '自动生成序列号', + visible:false, align: 'center', formatter: function(value, row, index) { var actions = []; @@ -192,10 +212,12 @@ { field : 'autoGenSerialNumFormat', title : '自动生成序列号表达式' , + visible:false, }, { field : 'snTemplateCode', title : '序列号模板' , + visible:false, }, { field : 'expiringDays', @@ -238,6 +260,7 @@ { field: 'isMix', title: '是否允许混放', + visible:false, align: 'center', formatter: function (value, row, index) { return $.table.selectLogicLabel(value); diff --git a/src/main/resources/templates/config/materialArea/add.html b/src/main/resources/templates/config/materialArea/add.html new file mode 100644 index 0000000..401582a --- /dev/null +++ b/src/main/resources/templates/config/materialArea/add.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<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-material-area"> + + <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 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"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + + </form> + </div> + <div th:include="include::footer"></div> + <script type="text/javascript"> + var prefix = ctx + "config/materialArea"; + $("#form-material-area").validate({ + submitHandler: function(form) { + // $.operate.save(prefix + "/add", $('#form-locationType-add').serialize()); + var tableValue = $.common.getTableValue("#form-material-area"); + $.operate.save(prefix + "/add", tableValue); + } + }); + </script> +</body> +</html> diff --git a/src/main/resources/templates/config/materialArea/edit.html b/src/main/resources/templates/config/materialArea/edit.html new file mode 100644 index 0000000..94efd39 --- /dev/null +++ b/src/main/resources/templates/config/materialArea/edit.html @@ -0,0 +1,45 @@ +<!DOCTYPE HTML> +<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-materialArea-edit" th:object="${materialArea}"> + <input id="id" name="id" th:field="*{id}" type="hidden"> + + <div class="form-group"> + <label class="col-sm-3 control-label">编码:</label> + <div class="col-sm-8"> + <input id="code" name="code" th:field="*{code}" 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="name" name="name" th:field="*{name}" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + + </form> + </div> + <div th:include="include::footer"></div> + <script type="text/javascript"> + var prefix = ctx + "config/locationHigh"; + $("#form-materialArea-edit").validate({ + submitHandler: function(form) { + // $.operate.save(prefix + "/edit", $('#form-locationType-edit').serialize()); + var tableValue = $.common.getTableValue("#form-materialArea-edit"); + $.operate.save(prefix + "/edit", tableValue); + } + }); + </script> +</body> +</html> diff --git a/src/main/resources/templates/config/materialArea/materialArea.html b/src/main/resources/templates/config/materialArea/materialArea.html new file mode 100644 index 0000000..6950842 --- /dev/null +++ b/src/main/resources/templates/config/materialArea/materialArea.html @@ -0,0 +1,89 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="gray-bg"> + <div class="container-div"> + <div class="row"> + <div class="col-sm-12 select-info"> + <form id="materialArea-form"> + <div class="select-list"> + <li> + + <li> + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('alarmLevel-form')"><i class="fa fa-refresh"></i> 重置</a> + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> + </li> + </ul> + </div> + </form> + </div> + <div class="btn-group hidden-xs" id="toolbar" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"> + <i class="fa fa-plus"></i> 新增 + </a> + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"> + <i class="fa fa-trash-o"></i> 删除 + </a> + </div> + + <div class="col-sm-12 select-info"> + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> + </div> + <div> + </div> + <div th:include="include :: footer"></div> + <script th:inline="javascript"> + var editFlag = [[${@permission.hasPermi('config:locationType:edit')}]]; + var removeFlag = [[${@permission.hasPermi('config:locationType:remove')}]]; + var prefix = ctx + "config/materialArea" + var datas = [[${@dict.getType('sys_normal_disable')}]]; + var rowFlags = [[${@dict.getType('rowFlag')}]]; + $(function() { + var options = { + url: prefix + "/list", + createUrl: prefix + "/add", + updateUrl: prefix + "/edit/{id}", + removeUrl: prefix + "/remove", + modalName: "物料分区", + search: false, + columns: [{ + checkbox: true + }, + { + field : 'warehouseCode', + title : '仓库编码' + }, + { + field : 'code', + title : '编码' + }, + { + field : 'name', + title : '名称' + }, + { + field : 'created', + title : '创建时间' + }, + { + field : 'createdBy', + title : '创建用户' + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + </script> +</body> +</html> \ No newline at end of file