Commit dd416141ea2c2cb2a2b16c836c04a38bd51808da

Authored by xqs
2 parents 46138120 e2fc43d7

Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop

# Conflicts:
#	.idea/workspace.xml
.idea/compiler.xml
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 <sourceOutputDir name="target/generated-sources/annotations" /> 6 <sourceOutputDir name="target/generated-sources/annotations" />
7 <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> 7 <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8 <outputRelativeToContentRoot value="true" /> 8 <outputRelativeToContentRoot value="true" />
9 - <module name="huaheng" />  
10 <module name="wms2" /> 9 <module name="wms2" />
  10 + <module name="huaheng" />
11 </profile> 11 </profile>
12 </annotationProcessing> 12 </annotationProcessing>
13 </component> 13 </component>
src/main/java/com/huaheng/pc/config/materialMultiple/controller/MaterialMultipleController.java
@@ -120,7 +120,7 @@ public class MaterialMultipleController extends BaseController { @@ -120,7 +120,7 @@ public class MaterialMultipleController extends BaseController {
120 * 修改保存单位转换 120 * 修改保存单位转换
121 */ 121 */
122 @ApiOperation(value="修改单位转换信息", notes="修改单位转换信息", httpMethod = "POST") 122 @ApiOperation(value="修改单位转换信息", notes="修改单位转换信息", httpMethod = "POST")
123 - @RequiresPermissions("config:warehouse:edit") 123 + @RequiresPermissions("config:materialMultiple:edit")
124 @Log(title = "配置-单位转换",operating = "修改单位转换", action = BusinessType.UPDATE) 124 @Log(title = "配置-单位转换",operating = "修改单位转换", action = BusinessType.UPDATE)
125 @PostMapping("/edit") 125 @PostMapping("/edit")
126 @ResponseBody 126 @ResponseBody
@@ -133,7 +133,7 @@ public class MaterialMultipleController extends BaseController { @@ -133,7 +133,7 @@ public class MaterialMultipleController extends BaseController {
133 * 删除单位转换 133 * 删除单位转换
134 */ 134 */
135 @ApiOperation(value="删除单位转换", notes="单条删除或批量删除单位转换,示例1或1,2,3", httpMethod = "POST") 135 @ApiOperation(value="删除单位转换", notes="单条删除或批量删除单位转换,示例1或1,2,3", httpMethod = "POST")
136 - @RequiresPermissions("config:receiptType:remove") 136 + @RequiresPermissions("config:materialMultiple:remove")
137 @Log(title = "配置-单位转换",operating = "删除单位转换", action = BusinessType.DELETE) 137 @Log(title = "配置-单位转换",operating = "删除单位转换", action = BusinessType.DELETE)
138 @PostMapping( "/remove") 138 @PostMapping( "/remove")
139 @ResponseBody 139 @ResponseBody
src/main/java/com/huaheng/pc/config/materialUnit/controller/MaterialUnitController.java
@@ -16,6 +16,8 @@ import com.huaheng.framework.web.page.TableDataInfo; @@ -16,6 +16,8 @@ import com.huaheng.framework.web.page.TableDataInfo;
16 import com.huaheng.framework.web.page.TableSupport; 16 import com.huaheng.framework.web.page.TableSupport;
17 import com.huaheng.pc.config.materialUnit.domain.MaterialUnit; 17 import com.huaheng.pc.config.materialUnit.domain.MaterialUnit;
18 import com.huaheng.pc.config.materialUnit.service.MaterialUnitService; 18 import com.huaheng.pc.config.materialUnit.service.MaterialUnitService;
  19 +import com.huaheng.pc.general.material.domain.Material;
  20 +import com.huaheng.pc.general.material.service.MaterialService;
19 import io.swagger.annotations.Api; 21 import io.swagger.annotations.Api;
20 import io.swagger.annotations.ApiOperation; 22 import io.swagger.annotations.ApiOperation;
21 import io.swagger.annotations.ApiParam; 23 import io.swagger.annotations.ApiParam;
@@ -28,13 +30,15 @@ import javax.annotation.Resource; @@ -28,13 +30,15 @@ import javax.annotation.Resource;
28 import java.util.ArrayList; 30 import java.util.ArrayList;
29 import java.util.List; 31 import java.util.List;
30 32
31 -@Api(tags = "单位转换") 33 +@Api(tags = "单位 ")
32 @Controller 34 @Controller
33 @RequestMapping("/config/materialUnit") 35 @RequestMapping("/config/materialUnit")
34 public class MaterialUnitController extends BaseController { 36 public class MaterialUnitController extends BaseController {
35 37
36 @Resource 38 @Resource
37 private MaterialUnitService materialUnitService; 39 private MaterialUnitService materialUnitService;
  40 + @Resource
  41 + private MaterialService materialService;
38 42
39 private String prefix = "config/materialUnit"; 43 private String prefix = "config/materialUnit";
40 44
@@ -45,11 +49,11 @@ public class MaterialUnitController extends BaseController { @@ -45,11 +49,11 @@ public class MaterialUnitController extends BaseController {
45 } 49 }
46 50
47 /** 51 /**
48 - * 查询单位转换列表 52 + * 查询单位 列表
49 */ 53 */
50 - @ApiOperation(value="查看单位转换列表", notes="根据物料编码、名称、单位、创建时间获取单位转换列表", httpMethod = "POST") 54 + @ApiOperation(value="查看单位 列表", notes="根据物料编码、名称、单位、创建时间获取单位 列表", httpMethod = "POST")
51 @RequiresPermissions("config:materialUnit:list") 55 @RequiresPermissions("config:materialUnit:list")
52 - @Log(title = "配置-单位转换",operating = "单位转换列表", action = BusinessType.GRANT) 56 + @Log(title = "配置-单位 ",operating = "单位 列表", action = BusinessType.GRANT)
53 @PostMapping("/list") 57 @PostMapping("/list")
54 @ResponseBody 58 @ResponseBody
55 public TableDataInfo list(@ApiParam(name="receiptType",value="料编码、名称、单位") MaterialUnit materialUnit, 59 public TableDataInfo list(@ApiParam(name="receiptType",value="料编码、名称、单位") MaterialUnit materialUnit,
@@ -79,7 +83,7 @@ public class MaterialUnitController extends BaseController { @@ -79,7 +83,7 @@ public class MaterialUnitController extends BaseController {
79 } 83 }
80 84
81 /** 85 /**
82 - * 新增单位转换 86 + * 新增单位
83 */ 87 */
84 @GetMapping("/add") 88 @GetMapping("/add")
85 public String add() { 89 public String add() {
@@ -87,14 +91,21 @@ public class MaterialUnitController extends BaseController { @@ -87,14 +91,21 @@ public class MaterialUnitController extends BaseController {
87 } 91 }
88 92
89 /** 93 /**
90 - * 新增保存单位转换 94 + * 新增保存单位
91 */ 95 */
92 - @ApiOperation(value="新增单位转换", notes="新增单位转换", httpMethod = "POST") 96 + @ApiOperation(value="新增单位 ", notes="新增单位 ", httpMethod = "POST")
93 @RequiresPermissions("config:materialUnit:add") 97 @RequiresPermissions("config:materialUnit:add")
94 - @Log(title = "配置-单位转换",operating = "新增单位转换", action = BusinessType.INSERT) 98 + @Log(title = "配置-单位 ",operating = "新增单位 ", action = BusinessType.INSERT)
95 @PostMapping("/add") 99 @PostMapping("/add")
96 @ResponseBody 100 @ResponseBody
97 public AjaxResult addSave(MaterialUnit materialUnit) { 101 public AjaxResult addSave(MaterialUnit materialUnit) {
  102 + LambdaQueryWrapper<Material> lambdaQueryWrapper = Wrappers.lambdaQuery();
  103 + lambdaQueryWrapper.eq(Material::getCode, materialUnit.getMaterialCode());
  104 + Material material = materialService.getOne(lambdaQueryWrapper);
  105 + if (material == null){
  106 + return AjaxResult.error(" 该物料编码不存在");
  107 + }
  108 +
98 LambdaQueryWrapper<MaterialUnit> lambda = Wrappers.lambdaQuery(); 109 LambdaQueryWrapper<MaterialUnit> lambda = Wrappers.lambdaQuery();
99 lambda.eq(MaterialUnit::getWarehouseCode, ShiroUtils.getWarehouseCode()) 110 lambda.eq(MaterialUnit::getWarehouseCode, ShiroUtils.getWarehouseCode())
100 .eq(MaterialUnit::getCompanyCode, materialUnit.getCompanyCode()) 111 .eq(MaterialUnit::getCompanyCode, materialUnit.getCompanyCode())
@@ -103,13 +114,16 @@ public class MaterialUnitController extends BaseController { @@ -103,13 +114,16 @@ public class MaterialUnitController extends BaseController {
103 if (materialUnitService.getOne(lambda) != null){ 114 if (materialUnitService.getOne(lambda) != null){
104 return AjaxResult.error("当前新增记录已存在"); 115 return AjaxResult.error("当前新增记录已存在");
105 } 116 }
  117 +
  118 + materialUnit.setMaterialName(material.getName());
  119 + materialUnit.setMaterialSpec(material.getSpec());
106 materialUnit.setCreatedBy(ShiroUtils.getLoginName()); 120 materialUnit.setCreatedBy(ShiroUtils.getLoginName());
107 materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName()); 121 materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName());
108 return toAjax(materialUnitService.save(materialUnit)); 122 return toAjax(materialUnitService.save(materialUnit));
109 } 123 }
110 124
111 /** 125 /**
112 - * 修改单位转换 126 + * 修改单位
113 */ 127 */
114 @GetMapping("/edit/{id}") 128 @GetMapping("/edit/{id}")
115 public String edit(@PathVariable("id") Integer id, ModelMap mmap) { 129 public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
@@ -119,24 +133,40 @@ public class MaterialUnitController extends BaseController { @@ -119,24 +133,40 @@ public class MaterialUnitController extends BaseController {
119 } 133 }
120 134
121 /** 135 /**
122 - * 修改保存单位转换 136 + * 修改保存单位
123 */ 137 */
124 - @ApiOperation(value="修改单位转换信息", notes="修改单位转换信息", httpMethod = "POST") 138 + @ApiOperation(value="修改单位信息", notes="修改单位信息", httpMethod = "POST")
125 @RequiresPermissions("config:warehouse:edit") 139 @RequiresPermissions("config:warehouse:edit")
126 - @Log(title = "配置-单位转换",operating = "修改单位转换", action = BusinessType.UPDATE) 140 + @Log(title = "配置-单位 ",operating = "修改单位 ", action = BusinessType.UPDATE)
127 @PostMapping("/edit") 141 @PostMapping("/edit")
128 @ResponseBody 142 @ResponseBody
129 public AjaxResult editSave(MaterialUnit materialUnit) { 143 public AjaxResult editSave(MaterialUnit materialUnit) {
  144 + LambdaQueryWrapper<Material> lambdaQueryWrapper = Wrappers.lambdaQuery();
  145 + lambdaQueryWrapper.eq(Material::getCode, materialUnit.getMaterialCode());
  146 + Material material = materialService.getOne(lambdaQueryWrapper);
  147 + if (material == null){
  148 + return AjaxResult.error(" 该物料编码不存在");
  149 + }
  150 +
  151 + LambdaQueryWrapper<MaterialUnit> lambda = Wrappers.lambdaQuery();
  152 + lambda.eq(MaterialUnit::getWarehouseCode, ShiroUtils.getWarehouseCode())
  153 + .eq(MaterialUnit::getCompanyCode, materialUnit.getCompanyCode())
  154 + .eq(MaterialUnit::getMaterialCode, materialUnit.getMaterialCode())
  155 + .eq(MaterialUnit::getUnit, materialUnit.getUnit());
  156 + if (materialUnitService.getOne(lambda) != null){
  157 + return AjaxResult.error("物料编码"+materialUnit.getMaterialCode()+",d 单位"+material.getUnit()+"已存在记录");
  158 + }
  159 +
130 materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName()); 160 materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName());
131 return toAjax(materialUnitService.updateById(materialUnit)); 161 return toAjax(materialUnitService.updateById(materialUnit));
132 } 162 }
133 163
134 /** 164 /**
135 - * 删除单位转换 165 + * 删除单位
136 */ 166 */
137 - @ApiOperation(value="删除单位转换", notes="单条删除或批量删除单位转换,示例1或1,2,3", httpMethod = "POST") 167 + @ApiOperation(value="删除单位 ", notes="单条删除或批量删除单位 ,示例1或1,2,3", httpMethod = "POST")
138 @RequiresPermissions("config:receiptType:remove") 168 @RequiresPermissions("config:receiptType:remove")
139 - @Log(title = "配置-单位转换",operating = "删除单位转换", action = BusinessType.DELETE) 169 + @Log(title = "配置-单位 ",operating = "删除单位 ", action = BusinessType.DELETE)
140 @PostMapping( "/remove") 170 @PostMapping( "/remove")
141 @ResponseBody 171 @ResponseBody
142 public AjaxResult remove(String ids) { 172 public AjaxResult remove(String ids) {
src/main/resources/templates/config/materialMultiple/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 + <form class="form-horizontal m" id="form-materialMultiple-add">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">物料编码:</label>
  10 + <div class="col-sm-8">
  11 + <input id="materialCode" name="materialCode" class="form-control" type="text">
  12 + </div>
  13 + </div>
  14 +
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">货主编码:</label>
  17 + <div class="col-sm-8">
  18 + <select id="companyCode" name="companyCode" class="form-control" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}">
  19 + <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
  20 + </select>
  21 + </div>
  22 + </div>
  23 + <div class="form-group">
  24 + <label class="col-sm-3 control-label">单位1:</label>
  25 + <div class="col-sm-8">
  26 + <input id="unit1" name="unit1" class="form-control" type="text">
  27 + </div>
  28 + </div>
  29 + <div class="form-group">
  30 + <label class="col-sm-3 control-label">单位2:</label>
  31 + <div class="col-sm-8">
  32 + <input id="unit2" name="unit2" class="form-control" type="text">
  33 + </div>
  34 + </div>
  35 + <div class="form-group">
  36 + <label class="col-sm-3 control-label">1->2转换倍数:</label>
  37 + <div class="col-sm-8">
  38 + <input id="multiple" name="multiple" class="form-control" type="text">
  39 + </div>
  40 + </div>
  41 + <div class="form-group">
  42 + <label class="col-sm-3 control-label">是否有效:</label>
  43 + <div class="col-sm-8">
  44 + <select id="enable" name="enable" class="form-control">
  45 + <option value="1">正常</option>
  46 + <option value="0">禁用</option>
  47 + </select>
  48 + </div>
  49 + </div>
  50 + <div class="form-group">
  51 + <div class="form-control-static col-sm-offset-9">
  52 + <button type="submit" class="btn btn-primary">提交</button>
  53 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  54 + </div>
  55 + </div>
  56 + </form>
  57 +</div>
  58 +<div th:include="include::footer"></div>
  59 +<script type="text/javascript">
  60 + var prefix = ctx + "config/materialMultiple";
  61 + $("#form-materialMultiple-add").validate({
  62 + rules:{
  63 + materialCode:{
  64 + required:true,
  65 + },
  66 + },
  67 + submitHandler: function(form) {
  68 +
  69 + var tableValue = $.common.getTableValue("#form-materialMultiple-add");
  70 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  71 + tableValue = formValueReplace(tableValue, "companyCode", $("#companyCode option:selected").val());
  72 + $.operate.save(prefix + "/add", tableValue);
  73 + }
  74 + });
  75 +</script>
  76 +</body>
  77 +</html>
src/main/resources/templates/config/materialMultiple/edit.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-materialMultiple-edit" th:object="${materialMultiple}">
  8 + <input name="id" type="hidden" th:field="*{id}">
  9 + <div class="form-group">
  10 + <label class="col-sm-3 control-label">物料编码:</label>
  11 + <div class="col-sm-8">
  12 + <input id="materialCode" name="materialCode" class="form-control" type="text" th:field="*{materialCode}">
  13 + </div>
  14 + </div>
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">货主编码:</label>
  17 + <div class="col-sm-8">
  18 + <select id="companyCode" name="companyCode" class="form-control"
  19 + th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}" th:field="*{companyCode}">
  20 + <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
  21 + </select>
  22 + </div>
  23 + </div>
  24 + <div class="form-group">
  25 + <label class="col-sm-3 control-label">单位1:</label>
  26 + <div class="col-sm-8">
  27 + <input id="unit1" name="unit1" class="form-control" type="text" th:field="*{unit1}">
  28 + </div>
  29 + </div>
  30 + <div class="form-group">
  31 + <label class="col-sm-3 control-label">单位2:</label>
  32 + <div class="col-sm-8">
  33 + <input id="unit2" name="unit2" class="form-control" type="text" th:field="*{unit2}">
  34 + </div>
  35 + </div>
  36 + <div class="form-group">
  37 + <label class="col-sm-3 control-label">1->2转换倍数:</label>
  38 + <div class="col-sm-8">
  39 + <input id="multiple" name="multiple" class="form-control" type="text" th:field="*{multiple}">
  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 + <select id="enable" name="enable" class="form-control" th:field="*{enable}">
  46 + <option value="1">正常</option>
  47 + <option value="0">禁用</option>
  48 + </select>
  49 + </div>
  50 + </div>
  51 + <div class="form-group">
  52 + <div class="form-control-static col-sm-offset-9">
  53 + <button type="submit" class="btn btn-primary">提交</button>
  54 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  55 + </div>
  56 + </div>
  57 + </form>
  58 +</div>
  59 +<div th:include="include::footer"></div>
  60 +<script type="text/javascript">
  61 + var prefix = ctx + "config/materialMultiple";
  62 + $("#form-materialMultiple-edit").validate({
  63 + rules:{
  64 + materialCode:{
  65 + required:true,
  66 + },
  67 + },
  68 + submitHandler: function(form) {
  69 +
  70 + var tableValue = $.common.getTableValue("#form-materialMultiple-edit");
  71 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  72 + tableValue = formValueReplace(tableValue, "companyCode", $("#companyCode option:selected").val());
  73 + $.operate.save(prefix + "/edit", tableValue);
  74 + }
  75 + });
  76 +</script>
  77 +</body>
  78 +</html>
src/main/resources/templates/config/materialMultiple/materialMultiple.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<div class="container-div">
  6 + <div class="row">
  7 + <div class="col-sm-12 select-info">
  8 + <form id="locationType-form">
  9 + <div class="select-list">
  10 + <ul>
  11 + <li>
  12 + 编码:<input type="text" name="materialCode"/>
  13 + </li>
  14 + <li>
  15 + 名称:<input type="text" name="materialName"/>
  16 + </li>
  17 + <li class="time">
  18 + <label>创建时间: </label>
  19 + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="createdBegin"/>
  20 + <span>-</span>
  21 + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="createdEnd"/>
  22 + </li>
  23 + <li>
  24 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  25 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
  26 + </li>
  27 + </ul>
  28 + </div>
  29 + </form>
  30 + </div>
  31 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  32 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:materialMultiple:add">
  33 + <i class="fa fa-plus"></i> 新增
  34 + </a>
  35 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:materialMultiple:remove">
  36 + <i class="fa fa-trash-o"></i> 删除
  37 + </a>
  38 + </div>
  39 +
  40 + <div class="col-sm-12 select-info">
  41 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  42 + </div>
  43 + <div>
  44 + </div>
  45 + <div th:include="include :: footer"></div>
  46 + <script th:inline="javascript">
  47 + var editFlag = [[${@permission.hasPermi('config:materialMultiple:edit')}]];
  48 + var removeFlag = [[${@permission.hasPermi('config:materialMultiple:remove')}]];
  49 + var prefix = ctx + "config/materialMultiple";
  50 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  51 + $(function() {
  52 + var options = {
  53 + url: prefix + "/list",
  54 + createUrl: prefix + "/add",
  55 + updateUrl: prefix + "/edit/{id}",
  56 + removeUrl: prefix + "/remove",
  57 + modalName: "wu",
  58 + search: false,
  59 + columns: [{
  60 + checkbox: true
  61 + },
  62 + {
  63 + field : 'id',
  64 + title : '编码'
  65 + },
  66 + {
  67 + field : 'materialCode',
  68 + title : '物料编码'
  69 + },
  70 + {
  71 + field : 'materialName',
  72 + title : '物料名称'
  73 + },
  74 + {
  75 + field : 'materialSpec',
  76 + title : '物料规格'
  77 + },
  78 + {
  79 + field : 'warehouseCode',
  80 + title : '仓库编码'
  81 + },
  82 + {
  83 + field : 'companyCode',
  84 + title : '货主编码'
  85 + },
  86 + {
  87 + field : 'unitld1',
  88 + title : '单位1'
  89 + },
  90 + {
  91 + field : 'unitld2',
  92 + title : '单位2'
  93 + },
  94 + {
  95 + field : 'multiple',
  96 + title : '1->2转换倍数'
  97 + },
  98 + {
  99 + field : 'created',
  100 + title : '创建时间'
  101 + },
  102 + {
  103 + field : 'createdBy',
  104 + title : '创建用户'
  105 + },
  106 + {
  107 + field : 'lastUpdated',
  108 + title : '更新时间'
  109 + },
  110 + {
  111 + field : 'lastUpdatedBy',
  112 + title : '更新用户'
  113 + },
  114 + {
  115 + field : 'enable',
  116 + title : '是否有效',
  117 + formatter: function(value, row, index) {
  118 + return $.table.selectDictLabel(datas, value);
  119 + },
  120 + align: 'center',
  121 + },
  122 +
  123 + {
  124 + field : 'userDef1',
  125 + title : '自定义字段1' ,
  126 + visible:false
  127 + },
  128 + {
  129 + field : 'userDef2',
  130 + title : '自定义字段2' ,
  131 + visible:false
  132 + },
  133 + {
  134 + field : 'userDef3',
  135 + title : '自定义字段3' ,
  136 + visible:false
  137 + },
  138 + {
  139 + field : 'userDef4',
  140 + title : '自定义字段4' ,
  141 + visible:false
  142 + },
  143 + {
  144 + field : 'userDef5',
  145 + title : '自定义字段5' ,
  146 + visible:false
  147 + },
  148 + {
  149 + title: '操作',
  150 + align: 'center',
  151 + formatter: function(value, row, index) {
  152 + var actions = [];
  153 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
  154 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>');
  155 + return actions.join('');
  156 + }
  157 + }]
  158 + };
  159 + $.table.init(options);
  160 + });
  161 + </script>
  162 + </div>
  163 +</div>
  164 +</html>
0 \ No newline at end of file 165 \ No newline at end of file
src/main/resources/templates/config/materialUnit/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 + <form class="form-horizontal m" id="form-materialUnit-add">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">物料编码:</label>
  10 + <div class="col-sm-8">
  11 + <input id="materialCode" name="materialCode" class="form-control" type="text">
  12 + </div>
  13 + </div>
  14 + <div class="form-group">
  15 + <label class="col-sm-3 control-label">货主编码:</label>
  16 + <div class="col-sm-8">
  17 + <select id="companyCode" name="companyCode" class="form-control" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}">
  18 + <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
  19 + </select>
  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="unit" name="unit" class="form-control" type="text">
  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="sequence" name="sequence" class="form-control" type="text">
  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="enable" name="enable" class="form-control" type="text">-->
  38 + <select id="enable" name="enable" class="form-control">
  39 + <option value="1">正常</option>
  40 + <option value="0">禁用</option>
  41 + </select>
  42 + </div>
  43 + </div>
  44 + <div class="form-group">
  45 + <div class="form-control-static col-sm-offset-9">
  46 + <button type="submit" class="btn btn-primary">提交</button>
  47 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  48 + </div>
  49 + </div>
  50 + </form>
  51 +</div>
  52 +<div th:include="include::footer"></div>
  53 +<script type="text/javascript">
  54 + var prefix = ctx + "config/materialUnit";
  55 + $("#form-materialUnit-add").validate({
  56 + rules:{
  57 + materialCode:{
  58 + required:true,
  59 + },
  60 + },
  61 + submitHandler: function(form) {
  62 + // $.operate.save(prefix + "/add", $('#form-locationType-add').serialize());
  63 + var tableValue = $.common.getTableValue("#form-materialUnit-add");
  64 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  65 + tableValue = formValueReplace(tableValue, "companyCode", $("#companyCode option:selected").val());
  66 + $.operate.save(prefix + "/add", tableValue);
  67 + }
  68 + });
  69 +</script>
  70 +</body>
  71 +</html>
src/main/resources/templates/config/materialUnit/edit.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-materialUnit-edit" th:object="${materialUnit}">
  8 + <input name="id" type="hidden" th:field="*{id}">
  9 + <div class="form-group">
  10 + <label class="col-sm-3 control-label">物料编码:</label>
  11 + <div class="col-sm-8">
  12 + <input id="materialCode" name="materialCode" class="form-control" type="text" th:field="*{materialCode}">
  13 + </div>
  14 + </div>
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">货主编码:</label>
  17 + <div class="col-sm-8">
  18 + <select id="companyCode" name="companyCode" class="form-control"
  19 + th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}" th:field="*{companyCode}">
  20 + <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
  21 + </select>
  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="unit" name="unit" class="form-control" type="text" th:field="*{unit}">
  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="sequence" name="sequence" class="form-control" type="text" th:field="*{sequence}">
  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="enable" name="enable" class="form-control" type="text">-->
  40 + <select id="enable" name="enable" class="form-control" th:field="*{enable}">
  41 + <option value="1">正常</option>
  42 + <option value="0">禁用</option>
  43 + </select>
  44 + </div>
  45 + </div>
  46 + <div class="form-group">
  47 + <div class="form-control-static col-sm-offset-9">
  48 + <button type="submit" class="btn btn-primary">提交</button>
  49 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  50 + </div>
  51 + </div>
  52 + </form>
  53 +</div>
  54 +<div th:include="include::footer"></div>
  55 +<script type="text/javascript">
  56 + var prefix = ctx + "config/materialUnit";
  57 + $("#form-materialUnit-edit").validate({
  58 + rules:{
  59 + materialCode:{
  60 + required:true,
  61 + },
  62 + },
  63 + submitHandler: function(form) {
  64 + // $.operate.save(prefix + "/add", $('#form-locationType-add').serialize());
  65 + var tableValue = $.common.getTableValue("#form-materialUnit-edit");
  66 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  67 + tableValue = formValueReplace(tableValue, "companyCode", $("#companyCode option:selected").val());
  68 + $.operate.save(prefix + "/edit", tableValue);
  69 + }
  70 + });
  71 +</script>
  72 +</body>
  73 +</html>
src/main/resources/templates/config/materialUnit/materialUnit.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="gray-bg">
  6 +<div class="container-div">
  7 + <div class="row">
  8 + <div class="col-sm-12 select-info">
  9 + <form id="locationType-form">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + 编码:<input type="text" name="materialCode"/>
  14 + </li>
  15 + <li>
  16 + 名称:<input type="text" name="materialName"/>
  17 + </li>
  18 + <li>
  19 + 单位:<input type="text" name="unit"/>
  20 + </li>
  21 +
  22 + <li class="time">
  23 + <label>创建时间: </label>
  24 + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="createdBegin"/>
  25 + <span>-</span>
  26 + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="createdEnd"/>
  27 + </li>
  28 + <li>
  29 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  30 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
  31 + </li>
  32 + </ul>
  33 + </div>
  34 + </form>
  35 + </div>
  36 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  37 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:materialUnit:add">
  38 + <i class="fa fa-plus"></i> 新增
  39 + </a>
  40 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:materialUnit:remove">
  41 + <i class="fa fa-trash-o"></i> 删除
  42 + </a>
  43 + </div>
  44 +
  45 + <div class="col-sm-12 select-info">
  46 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  47 + </div>
  48 + <div>
  49 + </div>
  50 + <div th:include="include :: footer"></div>
  51 + <script th:inline="javascript">
  52 + var editFlag = [[${@permission.hasPermi('config:materialUnit:edit')}]];
  53 + var removeFlag = [[${@permission.hasPermi('config:materialUnit:remove')}]];
  54 + var prefix = ctx + "config/materialUnit";
  55 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  56 + $(function() {
  57 + var options = {
  58 + url: prefix + "/list",
  59 + createUrl: prefix + "/add",
  60 + updateUrl: prefix + "/edit/{id}",
  61 + removeUrl: prefix + "/remove",
  62 + modalName: "wu",
  63 + search: false,
  64 + columns: [{
  65 + checkbox: true
  66 + },
  67 + {
  68 + field : 'id',
  69 + title : '编码'
  70 + },
  71 + {
  72 + field : 'materialCode',
  73 + title : '物料编码'
  74 + },
  75 + {
  76 + field : 'materialName',
  77 + title : '物料名称'
  78 + },
  79 + {
  80 + field : 'materialSpec',
  81 + title : '物料规格'
  82 + },
  83 + {
  84 + field : 'companyCode',
  85 + title : '货主编码'
  86 + },
  87 + {
  88 + field : 'warehouseCode',
  89 + title : '仓库编码'
  90 + },
  91 + {
  92 + field : 'unit',
  93 + title : '单位'
  94 + },
  95 + {
  96 + field : 'sequence',
  97 + title : '顺序'
  98 + },
  99 + {
  100 + field : 'created',
  101 + title : '创建时间'
  102 + },
  103 + {
  104 + field : 'createdBy',
  105 + title : '创建用户'
  106 + },
  107 + {
  108 + field : 'lastUpdated',
  109 + title : '更新时间'
  110 + },
  111 + {
  112 + field : 'lastUpdatedBy',
  113 + title : '更新用户'
  114 + },
  115 + {
  116 + field : 'enable',
  117 + title : '是否有效',
  118 + formatter: function(value, row, index) {
  119 + return $.table.selectDictLabel(datas, value);
  120 + },
  121 + align: 'center',
  122 + },
  123 + // {
  124 + // field : 'deleted',
  125 + // title : '是否删除'
  126 + // },
  127 + {
  128 + field : 'userDef1',
  129 + title : '自定义字段1' ,
  130 + visible:false
  131 + },
  132 + {
  133 + field : 'userDef2',
  134 + title : '自定义字段2' ,
  135 + visible:false
  136 + },
  137 + {
  138 + field : 'userDef3',
  139 + title : '自定义字段3' ,
  140 + visible:false
  141 + },
  142 + {
  143 + field : 'userDef4',
  144 + title : '自定义字段4' ,
  145 + visible:false
  146 + },
  147 + {
  148 + field : 'userDef5',
  149 + title : '自定义字段5' ,
  150 + visible:false
  151 + },
  152 + {
  153 + title: '操作',
  154 + align: 'center',
  155 + formatter: function(value, row, index) {
  156 + var actions = [];
  157 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
  158 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>');
  159 + return actions.join('');
  160 + }
  161 + }]
  162 + };
  163 + $.table.init(options);
  164 + });
  165 + </script>
  166 +</body>
  167 +</html>
0 \ No newline at end of file 168 \ No newline at end of file