Commit b9abda20c008bf181d67d1a7ef87f363b5b9d14d

Authored by mahuandong
1 parent 0f194409

添加商品、商品详情页面

.idea/workspace.xml
... ... @@ -2,10 +2,19 @@
2 2 <project version="4">
3 3 <component name="ChangeListManager">
4 4 <list default="true" id="9ff7b25e-dc1a-4859-8a0c-00039489e359" name="Default Changelist" comment="">
5   - <change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
  5 + <change afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomDetail/add.html" afterDir="false" />
  6 + <change afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomDetail/bomDetail.html" afterDir="false" />
  7 + <change afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomDetail/edit.html" afterDir="false" />
  8 + <change afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomHeader/add.html" afterDir="false" />
  9 + <change afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomHeader/edit.html" afterDir="false" />
6 10 <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
  11 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java" afterDir="false" />
  12 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java" afterDir="false" />
  13 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/bom/controller/BomDetailController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/bom/controller/BomDetailController.java" afterDir="false" />
  14 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/bom/controller/BomHeaderController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/bom/controller/BomHeaderController.java" afterDir="false" />
  15 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/location/service/LocationServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/location/service/LocationServiceImpl.java" afterDir="false" />
  16 + <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/material/controller/MaterialController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/material/controller/MaterialController.java" afterDir="false" />
7 17 <change beforePath="$PROJECT_DIR$/src/main/resources/templates/general/bomHeader/bomHeader.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/general/bomHeader/bomHeader.html" afterDir="false" />
8   - <change beforePath="$PROJECT_DIR$/src/main/resources/templates/general/material/add.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/general/material/add.html" afterDir="false" />
9 18 </list>
10 19 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
11 20 <option name="SHOW_DIALOG" value="false" />
... ... @@ -45,14 +54,14 @@
45 54 <item name="@172.16.29.45" type="feb32156:DbDataSourceImpl" />
46 55 <item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
47 56 <item name="wms_v2: schema" type="76f4a085:MysqlImplModel$Schema" />
48   - <item name="material_unit: table" type="285a2a93:MysqlImplModel$Table" />
  57 + <item name="bom_detail: table" type="285a2a93:MysqlImplModel$Table" />
49 58 </path>
50 59 <path>
51 60 <item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
52 61 <item name="@172.16.29.45" type="feb32156:DbDataSourceImpl" />
53 62 <item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
54 63 <item name="wms_v2: schema" type="76f4a085:MysqlImplModel$Schema" />
55   - <item name="sys_user_online: table" type="285a2a93:MysqlImplModel$Table" />
  64 + <item name="location_type: table" type="285a2a93:MysqlImplModel$Table" />
56 65 </path>
57 66 </expand>
58 67 <select />
... ... @@ -103,6 +112,7 @@
103 112 <property name="node.js.path.for.package.tslint" value="project" />
104 113 <property name="node.js.selected.package.eslint" value="(autodetect)" />
105 114 <property name="node.js.selected.package.tslint" value="(autodetect)" />
  115 + <property name="nodejs_package_manager_path" value="npm" />
106 116 <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
107 117 </component>
108 118 <component name="RecentsManager">
... ... @@ -158,15 +168,6 @@
158 168 <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
159 169 <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@6299c693" type="7427dc5b:ServiceModel$ServiceGroupNode" />
160 170 </path>
161   - <path>
162   - <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
163   - <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@5b30dbae" type="7427dc5b:ServiceModel$ServiceGroupNode" />
164   - </path>
165   - <path>
166   - <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
167   - <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@5b30dbae" type="7427dc5b:ServiceModel$ServiceGroupNode" />
168   - <item name="com.intellij.execution.services.ServiceModel$ServiceNode@f0ddaab" type="9fbbdea:ServiceModel$ServiceNode" />
169   - </path>
170 171 </expand>
171 172 <select />
172 173 </treeState>
... ... @@ -194,7 +195,7 @@
194 195 <workItem from="1565587737758" duration="12961000" />
195 196 <workItem from="1565657307503" duration="115000" />
196 197 <workItem from="1565657439247" duration="2447000" />
197   - <workItem from="1565662229227" duration="3215000" />
  198 + <workItem from="1565662229227" duration="19207000" />
198 199 </task>
199 200 <task id="LOCAL-00001" summary="添加库位、库位类型增删改查接口">
200 201 <created>1565226427512</created>
... ... @@ -259,7 +260,14 @@
259 260 <option name="project" value="LOCAL" />
260 261 <updated>1565659672152</updated>
261 262 </task>
262   - <option name="localTasksCounter" value="10" />
  263 + <task id="LOCAL-00010" summary="添加task实体类">
  264 + <created>1565665525508</created>
  265 + <option name="number" value="00010" />
  266 + <option name="presentableId" value="LOCAL-00010" />
  267 + <option name="project" value="LOCAL" />
  268 + <updated>1565665525508</updated>
  269 + </task>
  270 + <option name="localTasksCounter" value="11" />
263 271 <servers />
264 272 </component>
265 273 <component name="TypeScriptGeneratedFilesManager">
... ... @@ -302,7 +310,8 @@
302 310 <MESSAGE value="添加物料页面" />
303 311 <MESSAGE value="添加商品详情" />
304 312 <MESSAGE value="添加物料时判断单位是否存在,不存在则添加物料单位" />
305   - <option name="LAST_COMMIT_MESSAGE" value="添加物料时判断单位是否存在,不存在则添加物料单位" />
  313 + <MESSAGE value="添加task实体类" />
  314 + <option name="LAST_COMMIT_MESSAGE" value="添加task实体类" />
306 315 </component>
307 316 <component name="XDebuggerManager">
308 317 <breakpoint-manager>
... ... @@ -312,6 +321,16 @@
312 321 <line>88</line>
313 322 <option name="timeStamp" value="3" />
314 323 </line-breakpoint>
  324 + <line-breakpoint enabled="true" type="java-line">
  325 + <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/material/controller/MaterialController.java</url>
  326 + <line>69</line>
  327 + <option name="timeStamp" value="6" />
  328 + </line-breakpoint>
  329 + <line-breakpoint enabled="true" type="java-line">
  330 + <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/general/material/controller/MaterialController.java</url>
  331 + <line>123</line>
  332 + <option name="timeStamp" value="7" />
  333 + </line-breakpoint>
315 334 </breakpoints>
316 335 </breakpoint-manager>
317 336 </component>
... ...
src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java
... ... @@ -7,4 +7,6 @@ import java.util.List;
7 7 import java.util.Map;
8 8  
9 9 public interface LocationTypeService extends IService<LocationType>{
  10 +
  11 + public List<Map<String, Object>> getLocationPrefix();
10 12 }
... ...
src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java
... ... @@ -2,11 +2,11 @@ package com.huaheng.pc.config.locationType.service;
2 2  
3 3 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5   -import com.huaheng.common.utils.security.ShiroUtils;
6   -import org.springframework.stereotype.Service;
7 5 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8   -import com.huaheng.pc.config.locationType.mapper.LocationTypeMapper;
  6 +import com.huaheng.common.utils.security.ShiroUtils;
9 7 import com.huaheng.pc.config.locationType.domain.LocationType;
  8 +import com.huaheng.pc.config.locationType.mapper.LocationTypeMapper;
  9 +import org.springframework.stereotype.Service;
10 10  
11 11 import java.util.List;
12 12 import java.util.Map;
... ... @@ -14,4 +14,11 @@ import java.util.Map;
14 14 @Service("locationType")
15 15 public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements LocationTypeService{
16 16  
  17 + public List<Map<String, Object>> getLocationPrefix(){
  18 + LambdaQueryWrapper<LocationType> lambdaQueryWrapper = Wrappers.lambdaQuery();
  19 + lambdaQueryWrapper.eq(LocationType::getWarehouseCode, ShiroUtils.getWarehouseCode())
  20 + .eq(LocationType::getEnable, false)
  21 + .eq(LocationType::getEnable, true);
  22 + return this.listMaps(lambdaQueryWrapper);
  23 + }
17 24 }
... ...
src/main/java/com/huaheng/pc/general/bom/controller/BomDetailController.java
... ... @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7 import com.huaheng.common.support.Convert;
8 8 import com.huaheng.common.utils.StringUtils;
  9 +import com.huaheng.common.utils.security.ShiroUtils;
9 10 import com.huaheng.framework.aspectj.lang.annotation.Log;
10 11 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
11 12 import com.huaheng.framework.web.controller.BaseController;
... ... @@ -14,8 +15,9 @@ import com.huaheng.framework.web.page.PageDomain;
14 15 import com.huaheng.framework.web.page.TableDataInfo;
15 16 import com.huaheng.framework.web.page.TableSupport;
16 17 import com.huaheng.pc.general.bom.domain.BomDetail;
17   -import com.huaheng.pc.general.bom.domain.BomHeader;
18 18 import com.huaheng.pc.general.bom.service.BomDetailService;
  19 +import com.huaheng.pc.general.material.domain.Material;
  20 +import com.huaheng.pc.general.material.service.MaterialService;
19 21 import io.swagger.annotations.ApiOperation;
20 22 import io.swagger.annotations.ApiParam;
21 23 import org.apache.shiro.authz.annotation.RequiresPermissions;
... ... @@ -35,11 +37,15 @@ public class BomDetailController extends BaseController {
35 37  
36 38 @Resource
37 39 private BomDetailService bomDetailService;
  40 + @Resource
  41 + private MaterialService materialService;
38 42  
39   - @RequiresPermissions("general:bomDetail:view")
40   - @GetMapping()
41   - public String company() {
42   - return prefix + "/bomHeader";
  43 + @RequiresPermissions("general:bomHeader:view")
  44 + @Log(title = "管理-推送详情列表", operating = "推送详情列表", action = BusinessType.GRANT)
  45 + @GetMapping("/list/{id}")
  46 + public String list(@PathVariable("id")Integer id, ModelMap mmap) {
  47 + mmap.put("bomHeaderId",id);
  48 + return prefix+"/bomDetail";
43 49 }
44 50  
45 51 /**
... ... @@ -85,6 +91,20 @@ public class BomDetailController extends BaseController {
85 91 @ResponseBody
86 92 public AjaxResult addSave(@ApiParam(name = "containerType", value = "商品详情", required = true)
87 93 BomDetail bomDetail) {
  94 + LambdaQueryWrapper<Material> lamdba = Wrappers.lambdaQuery();
  95 + lamdba.eq(Material::getCode, bomDetail.getMaterialCode());
  96 + Material material = materialService.getOne(lamdba);
  97 + if ( material == null){
  98 + return AjaxResult.error("不存在物料编码"+bomDetail.getMaterialCode());
  99 + } else {
  100 + bomDetail.setCompanyCode(material.getCompanyCode());
  101 + bomDetail.setWarehouseCode(material.getWarehouseCode());
  102 + bomDetail.setMaterialCode(material.getCode());
  103 + bomDetail.setMaterialName(material.getName());
  104 + bomDetail.setMaterialUnit(material.getUnit());
  105 + bomDetail.setCreatedBy(ShiroUtils.getLoginName());
  106 + bomDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  107 + }
88 108 return toAjax(bomDetailService.save(bomDetail));
89 109 }
90 110  
... ...
src/main/java/com/huaheng/pc/general/bom/controller/BomHeaderController.java
... ... @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7 import com.huaheng.common.support.Convert;
8 8 import com.huaheng.common.utils.StringUtils;
  9 +import com.huaheng.common.utils.security.ShiroUtils;
9 10 import com.huaheng.framework.aspectj.lang.annotation.Log;
10 11 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
11 12 import com.huaheng.framework.web.controller.BaseController;
... ... @@ -17,6 +18,8 @@ import com.huaheng.pc.general.bom.domain.BomDetail;
17 18 import com.huaheng.pc.general.bom.domain.BomHeader;
18 19 import com.huaheng.pc.general.bom.service.BomDetailService;
19 20 import com.huaheng.pc.general.bom.service.BomHeaderService;
  21 +import com.huaheng.pc.general.material.domain.Material;
  22 +import com.huaheng.pc.general.material.service.MaterialService;
20 23 import io.swagger.annotations.ApiOperation;
21 24 import io.swagger.annotations.ApiParam;
22 25 import org.apache.shiro.authz.annotation.RequiresPermissions;
... ... @@ -40,9 +43,13 @@ public class BomHeaderController extends BaseController {
40 43 @Resource
41 44 private BomDetailService bomDetailService;
42 45  
  46 + @Resource
  47 + private MaterialService materialService;
  48 +
43 49 @RequiresPermissions("general:bomHeader:view")
44 50 @GetMapping()
45   - public String company() {
  51 + public String bomHeader() {
  52 + System.out.println("商品管理");
46 53 return prefix + "/bomHeader";
47 54 }
48 55  
... ... @@ -97,6 +104,22 @@ public class BomHeaderController extends BaseController {
97 104 @ResponseBody
98 105 public AjaxResult addSave(@ApiParam(name = "containerType", value = "商品类型", required = true)
99 106 BomHeader bomHeader) {
  107 +
  108 + LambdaQueryWrapper<Material> lamdba = Wrappers.lambdaQuery();
  109 + lamdba.eq(Material::getCode, bomHeader.getMaterialCode());
  110 + Material material = materialService.getOne(lamdba);
  111 + if ( material == null){
  112 + return AjaxResult.error("不存在物料编码"+bomHeader.getMaterialCode());
  113 + } else {
  114 + bomHeader.setCompanyCode(material.getCompanyCode());
  115 + bomHeader.setWarehouseCode(material.getWarehouseCode());
  116 + bomHeader.setMaterialCode(material.getCode());
  117 + bomHeader.setMaterialName(material.getName());
  118 + bomHeader.setMaterialSpec(material.getSpec());
  119 + bomHeader.setMaterialUnit(material.getUnit());
  120 + bomHeader.setCreatedBy(ShiroUtils.getLoginName());
  121 + bomHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  122 + }
100 123 return toAjax(bomHeaderService.save(bomHeader));
101 124 }
102 125  
... ...
src/main/java/com/huaheng/pc/general/location/service/LocationServiceImpl.java
... ... @@ -51,7 +51,7 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
51 51 throw new ServiceException("库区编码不存在");
52 52 }
53 53  
54   -
  54 + String prefix = location.getLocationType().substring(1);
55 55 List<Location> locations = new ArrayList<>();
56 56 for (int i=1; i<=location.getIRow().intValue(); i++) {
57 57 for (int j=1; j<=location.getIColumn().intValue(); j++) {
... ... @@ -70,7 +70,7 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
70 70 param.setCreatedBy(ShiroUtils.getLoginName());
71 71 param.setLastUpdatedBy(ShiroUtils.getLoginName());
72 72 String code = MessageFormat.format("{0}{1}-{2}-{3}-{4}",
73   - location.getLocationType(),
  73 + prefix,
74 74 String.format("%02d", i),
75 75 String.format("%02d", j),
76 76 String.format("%02d", k),
... ...
src/main/java/com/huaheng/pc/general/material/controller/MaterialController.java
... ... @@ -79,7 +79,7 @@ public class MaterialController extends BaseController {
79 79 .like(StringUtils.isNotEmpty(material.getSpec()), Material::getSpec, material.getSpec())
80 80 .eq(Material::getWarehouseCode, ShiroUtils.getWarehouseCode())
81 81 .in(Material::getCompanyCode, ShiroUtils.getCompanyCodeList())
82   - .ne(Material::getDeleted, false);
  82 + .eq(Material::getDeleted, false);
83 83  
84 84 if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
85 85 /*使用分页查询*/
... ...
src/main/resources/templates/general/bomDetail/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-bomDetail-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 + <input id="qty" name="qty" class="form-control" type="text">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <label class="col-sm-3 control-label">组套层次:</label>
  22 + <div class="col-sm-8">
  23 + <input id="buildLevel" name="buildLevel" class="form-control" type="text">
  24 + </div>
  25 + </div>
  26 + <div class="form-group">
  27 + <label class="col-sm-3 control-label">序号:</label>
  28 + <div class="col-sm-8">
  29 + <input id="buildSequence" name="buildSequence" class="form-control" type="text">
  30 + </div>
  31 + </div>
  32 + <div class="form-group">
  33 + <label class="col-sm-3 control-label">分配规则:</label>
  34 + <div class="col-sm-8">
  35 + <input id="allocationRule" name="allocationRule" class="form-control" type="text">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">从货位:</label>
  40 + <div class="col-sm-8">
  41 + <input id="fromLocation" name="fromLocation" class="form-control" type="text">
  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 + "general/bomDetail";
  55 + $("#form-bomDetail-add").validate({
  56 + rules:{
  57 + materialCode:{
  58 + required:true
  59 + },
  60 + },
  61 + submitHandler: function(form) {
  62 + var tableValue = $("#form-bomDetail-add").serialize();
  63 + $.operate.save(prefix + "/add", tableValue);
  64 + }
  65 + });
  66 +</script>
  67 +</body>
  68 +</html>
... ...
src/main/resources/templates/general/bomDetail/bomDetail.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>
  6 +
  7 +<div class="btn-group hidden-xs" id="toolbar" role="group">
  8 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="general:bomDetail:add">
  9 + <i class="fa fa-plus"></i> 新增
  10 + </a>
  11 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="general:bomDetail:remove">
  12 + <i class="fa fa-trash-o"></i> 删除
  13 + </a>
  14 +</div>
  15 +<div class="col-sm-12">
  16 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  17 +</div>
  18 +
  19 +
  20 +<div th:include="include :: footer"></div>
  21 +<script th:inline="javascript">
  22 + var prefix = ctx + "general/bomDetail";
  23 + var editFlag = [[${@permission.hasPermi('general:bomDetail:edit')}]];
  24 + var removeFlag = [[${@permission.hasPermi('general:bomDetail:remove')}]];
  25 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  26 + $(function() {
  27 + var options = {
  28 + url: prefix + "/list",
  29 + createUrl: prefix + "/add",
  30 + updateUrl: prefix + "/edit/{id}",
  31 + removeUrl: prefix + "/remove",
  32 + modalName: "商品详情",
  33 + queryParams:"bomId="+[[${bomHeaderId}]],
  34 + search: false,
  35 + sortName: "id",
  36 + sortOrder: "desc",
  37 + columns: [{
  38 + checkbox: true
  39 + },
  40 + {
  41 + field : 'id',
  42 + title : 'id'
  43 + },
  44 + {
  45 + field : 'warehouseCode',
  46 + title : '仓库代码'
  47 + },
  48 + {
  49 + field : 'companyCode',
  50 + title : '货主'
  51 + },
  52 + {
  53 + field : 'bomId',
  54 + title : '物料清单内部号' ,
  55 + visible:false
  56 + },
  57 + {
  58 + field : 'materialName',
  59 + title : '物料名称'
  60 + },
  61 + {
  62 + field : 'materialUnit',
  63 + title : '物料单位'
  64 + },
  65 + {
  66 + field : 'buildLevel',
  67 + title : '组套层次'
  68 + },
  69 + {
  70 + field : 'buildSequence',
  71 + title : '序号'
  72 + },
  73 + {
  74 + field : 'qty',
  75 + title : '数量'
  76 + },
  77 + {
  78 + field : 'allocationRule',
  79 + title : '分配规则'
  80 + },
  81 + {
  82 + field : 'fromLocation',
  83 + title : '分配规则'
  84 + },
  85 + {
  86 + field : 'enable',
  87 + title : '是否有效',
  88 + align: 'center',
  89 + formatter: function(value, row, index) {
  90 + return $.table.selectDictLabel(datas, value);
  91 + }
  92 + },
  93 + {
  94 + field : 'created',
  95 + title : '创建时间'
  96 + },
  97 + {
  98 + field : 'createdBy',
  99 + title : '创建用户'
  100 + },
  101 + {
  102 + field : 'lastUpdated',
  103 + title : '更新时间'
  104 + },
  105 + {
  106 + field : 'lastUpdatedBy',
  107 + title : '更新用户'
  108 + },
  109 + {
  110 + field : 'userDef1',
  111 + title : '自定义字段1' ,
  112 + visible:false
  113 + },
  114 + {
  115 + field : 'userDef2',
  116 + title : '自定义字段2' ,
  117 + visible:false
  118 + },
  119 + {
  120 + field : 'userDef3',
  121 + title : '自定义字段3' ,
  122 + visible:false
  123 + },
  124 + {
  125 + title: '操作',
  126 + align: 'center',
  127 + formatter: function(value, row, index) {
  128 + var actions = [];
  129 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  130 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
  131 + return actions.join('');
  132 + }
  133 + }]
  134 + };
  135 + $.table.init(options);
  136 + });
  137 +</script>
  138 +</body>
  139 +</html>
0 140 \ No newline at end of file
... ...
src/main/resources/templates/general/bomDetail/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-bomDetail-add" th:object="${bomDetail}">
  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" th:field="*{materialCode}">
  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 + <input id="qty" name="qty" class="form-control" type="text" th:field="*{qty}">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <label class="col-sm-3 control-label">组套层次:</label>
  22 + <div class="col-sm-8">
  23 + <input id="buildLevel" name="buildLevel" class="form-control" type="text" th:field="*{buildLevel}">
  24 + </div>
  25 + </div>
  26 + <div class="form-group">
  27 + <label class="col-sm-3 control-label">序号:</label>
  28 + <div class="col-sm-8">
  29 + <input id="buildSequence" name="buildSequence" class="form-control" type="text" th:field="*{buildSequence}">
  30 + </div>
  31 + </div>
  32 + <div class="form-group">
  33 + <label class="col-sm-3 control-label">分配规则:</label>
  34 + <div class="col-sm-8">
  35 + <input id="allocationRule" name="allocationRule" class="form-control" type="text" th:field="*{allocationRule}">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">从货位:</label>
  40 + <div class="col-sm-8">
  41 + <input id="fromLocation" name="fromLocation" class="form-control" type="text" th:field="*{fromLocation}" >
  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 + "general/bomDetail";
  55 + $("#form-bomDetail-add").validate({
  56 + rules:{
  57 + materialCode:{
  58 + required:true
  59 + },
  60 + },
  61 + submitHandler: function(form) {
  62 + var tableValue = $("#form-bomDetail-add").serialize();
  63 + $.operate.save(prefix + "/add", tableValue);
  64 + }
  65 + });
  66 +</script>
  67 +</body>
  68 +</html>
... ...
src/main/resources/templates/general/bomHeader/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-bomHeader-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 + <input id="qty" name="qty" class="form-control" type="text">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <label class="col-sm-3 control-label">修正号码:</label>
  22 + <div class="col-sm-8">
  23 + <input id="revisionNum" name="revisionNum" class="form-control" type="text">
  24 + </div>
  25 + </div>
  26 + <div class="form-group">
  27 + <label class="col-sm-3 control-label">加工说明:</label>
  28 + <div class="col-sm-8">
  29 + <input id="buildInstructions" name="buildInstructions" class="form-control" type="text">
  30 + </div>
  31 + </div>
  32 + <div class="form-group">
  33 + <label class="col-sm-3 control-label">加工货位:</label>
  34 + <div class="col-sm-8">
  35 + <input id="buildLoc" name="buildLoc" class="form-control" type="text">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">有效起始日期:</label>
  40 + <div class="col-sm-8">
  41 + <input id="validFromDate" name="validFromDate" class="form-control" type="text">
  42 + </div>
  43 + </div>
  44 + <div class="form-group">
  45 + <label class="col-sm-3 control-label">有效结束日期:</label>
  46 + <div class="col-sm-8">
  47 + <input id="validEndDate" name="validEndDate" class="form-control" type="text">
  48 + </div>
  49 + </div>
  50 + <div class="form-group">
  51 + <label class="col-sm-3 control-label">优先级:</label>
  52 + <div class="col-sm-8">
  53 + <input id="priority" name="priority" class="form-control" type="text">
  54 + </div>
  55 + </div>
  56 + <div class="form-group">
  57 + <label class="col-sm-3 control-label">是否有效:</label>
  58 + <div class="col-sm-8">
  59 + <select id="enable" name="enable" class="form-control" >
  60 + <option value="0">有效</option>
  61 + <option value="1">无效</option>
  62 + </select>
  63 + </div>
  64 + </div>
  65 + <div class="form-group">
  66 + <label class="col-sm-3 control-label">是否虚拟商品:</label>
  67 + <div class="col-sm-8">
  68 + <select id="isVirtualBom" name="isVirtualBom" class="form-control">
  69 + <option value="0">不是</option>
  70 + <option value="1">是</option>
  71 + </select>
  72 + </div>
  73 + </div>
  74 + <div class="form-group">
  75 + <div class="form-control-static col-sm-offset-9">
  76 + <button type="submit" class="btn btn-primary">提交</button>
  77 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  78 + </div>
  79 + </div>
  80 + </form>
  81 +</div>
  82 +<div th:include="include::footer"></div>
  83 +<script type="text/javascript">
  84 + var prefix = ctx + "general/bomHeader";
  85 + $("#form-bomHeader-add").validate({
  86 + rules:{
  87 + materialCode:{
  88 + required:true
  89 + },
  90 + },
  91 + submitHandler: function(form) {
  92 + var tableValue = $("#form-bomHeader-add").serialize();
  93 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  94 + tableValue = formValueReplace(tableValue, "isVirtualBom", $("#isVirtualBom option:selected").val());
  95 + $.operate.save(prefix + "/add", tableValue);
  96 + }
  97 + });
  98 + $(function () {
  99 + layui.use('laydate', function() {
  100 + var laydate = layui.laydate;
  101 + laydate.render({ elem: '#validFromDate', theme: 'molv', format: 'yyyy-MM-dd' });
  102 + laydate.render({ elem: '#validEndDate', theme: 'molv', format: 'yyyy-MM-dd' });
  103 + });
  104 + });
  105 +</script>
  106 +</body>
  107 +</html>
... ...
src/main/resources/templates/general/bomHeader/bomHeader.html
... ... @@ -3,63 +3,80 @@
3 3 <meta charset="utf-8">
4 4 <head th:include="include :: header"></head>
5 5 <body class="gray-bg">
  6 +
6 7 <div class="container-div">
7 8 <div class="row">
8 9 <div class="col-sm-12 select-info">
9   - <form id="company-form">
10   - <div class="select-list">
11   - <ul>
12   - <li>
13   - 物料编码:<input type="text" name="code"/>
14   - </li>
15   - <li>
16   - 物料名称:<input type="text" name="name"/>
17   - </li>
18   - <li>
19   - 库位状态:<select id="companyCode" name="companyCode" class="form-control" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}">
20   - <option>所有</option>
21   - <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
22   - </select>
23   - </li>
24   - <li class="time">
25   - <label>创建时间: </label>
26   - <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>
27   - <span>-</span>
28   - <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>
29   - </li>
30   - <li>
31   - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
32   - <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="general:company:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
33   - </li>
34   - </ul>
  10 + <ul id="myTab" class="nav nav-tabs">
  11 + <li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>
  12 + <li><a href="#tabDetail" data-toggle="tab">明细</a></li>
  13 + </ul>
  14 + <div id="myTabContent" class="tab-content">
  15 + <div class="tab-pane fade in active" id="tabHeader">
  16 + <div class="col-sm-12 select-info">
  17 + <form id="alarmFlow-form">
  18 + <div class="select-list">
  19 + <ul>
  20 + <li>
  21 + 物料名称:<input type="text" name="materialName"/>
  22 + </li>
  23 + <li>
  24 + 物料编码:<input type="text" name="materialCode"/>
  25 + </li>
  26 + <li class="time">
  27 + <label>创建时间: </label>
  28 + <input type="text" class="time-input" id="startTime" placeholder="开始时间"
  29 + name="params[createdBegin]"/>
  30 + <span>-</span>
  31 + <input type="text" class="time-input" id="endTime" placeholder="结束时间"
  32 + name="params[createdEnd]"/>
  33 + </li>
  34 + <li>
  35 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
  36 + class="fa fa-search"></i>&nbsp;搜索</a>
  37 + <!--<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>-->
  38 + </li>
  39 + </ul>
  40 + </div>
  41 + </form>
  42 + </div>
  43 +
  44 +
  45 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  46 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
  47 + shiro:hasPermission="general:bomHeader:add">
  48 + <i class="fa fa-plus"></i> 新增
  49 + </a>
  50 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
  51 + shiro:hasPermission="general:bomHeader:remove">
  52 + <i class="fa fa-trash-o"></i> 删除
  53 + </a>
  54 + </div>
  55 +
  56 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
35 57 </div>
36   - </form>
37   - </div>
38   - <div class="btn-group hidden-xs" id="toolbar" role="group">
39   - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="general:company:add">
40   - <i class="fa fa-plus"></i> 新增
41   - </a>
42   - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="general:company:remove">
43   - <i class="fa fa-trash-o"></i> 删除
44   - </a>
45   - </div>
46   - <div class="col-sm-12 select-info">
47   - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  58 +
  59 + <div class="tab-pane fade" id="tabDetail">
  60 + <table id="bootstrap-table1" data-mobile-responsive="true"
  61 + class="table table-bordered table-hover"></table>
  62 + </div>
  63 + </div>
48 64 </div>
49 65 </div>
50 66 </div>
51 67 <div th:include="include :: footer"></div>
52 68 <script th:inline="javascript">
53   - var prefix = ctx + "general/company";
54   - var editFlag = [[${@permission.hasPermi('general:company:edit')}]];
55   - var removeFlag = [[${@permission.hasPermi('general:company:remove')}]];
  69 + var prefix = ctx + "general/bomHeader";
  70 + var prefix1 = ctx + "general/bomDetail";
  71 + var editFlag = [[${@permission.hasPermi('general:bomHeader:edit')}]];
  72 + var removeFlag = [[${@permission.hasPermi('general:bomHeader:remove')}]];
56 73 $(function() {
57 74 var options = {
58 75 url: prefix + "/list",
59 76 createUrl: prefix + "/add",
60 77 updateUrl: prefix + "/edit/{id}",
61 78 removeUrl: prefix + "/remove",
62   - modalName: "货主",
  79 + modalName: "商品",
63 80 search: false,
64 81 sortName: "id",
65 82 sortOrder: "desc",
... ... @@ -71,81 +88,86 @@
71 88 title : 'id'
72 89 },
73 90 {
74   - field : 'code',
75   - title : '编码'
  91 + field : 'materialCode',
  92 + title : '物料编码'
76 93 },
77 94 {
78   - field : 'name',
79   - title : '名称'
  95 + field : 'materialName',
  96 + title : '物料名称'
80 97 },
81 98 {
82 99 field : 'warehouseCode',
83 100 title : '仓库代码'
84 101 },
85 102 {
86   - field : 'address1',
87   - title : '地址1'
  103 + field : 'companyCode',
  104 + title : '货主编码'
88 105 },
89 106 {
90   - field : 'address2',
91   - title : '地址2' ,
92   - visible:false
  107 + field : 'materialSpec',
  108 + title : '物料规格'
93 109 },
94 110 {
95   - field : 'district',
96   - title : '区县'
  111 + field : 'materialUnit',
  112 + title : ' 物料单位'
97 113 },
98 114 {
99   - field : 'city',
100   - title : '城市'
  115 + field : 'qty',
  116 + title : '数量'
101 117 },
102 118 {
103   - field : 'province',
104   - title : '省份' ,
105   - visible:false
  119 + field : 'revisionNum',
  120 + title : '修正号码'
106 121 },
107 122 {
108   - field : 'country',
109   - title : '国家' ,
110   - visible:false
  123 + field : 'buildInstructions',
  124 + title : '加工说明'
111 125 },
112 126 {
113   - field : 'postalCode',
114   - title : '邮编' ,
115   - visible:false
  127 + field : 'buildLoc',
  128 + title : '加工货位'
116 129 },
117 130 {
118   - field : 'attentionTo',
119   - title : '联系人'
  131 + field : 'validFromDate',
  132 + title : '有效起止日期'
120 133 },
121 134 {
122   - field : 'phoneNum',
123   - title : '电话'
  135 + field : 'validEndDate',
  136 + title : '有效结束日期'
124 137 },
125 138 {
126   - field : 'mobile',
127   - title : '手机'
  139 + field : 'priority',
  140 + title : '优先级'
128 141 },
129 142 {
130   - field : 'email',
131   - title : 'E-mail' ,
132   - visible:false
  143 + field : 'version',
  144 + title : '数据版本',
  145 + visible : false
  146 + },
  147 + {
  148 + field : 'isVirtualBom',
  149 + title : '是否为虚拟商品',
  150 + visible : false
133 151 },
134 152 {
135 153 field : 'created',
136   - title : '创建时间'
  154 + title : '创建时间',
  155 + visible : false
137 156 },
138 157 {
139 158 field : 'createdBy',
140   - title : '创建用户'
  159 + title : '创建用户',
  160 + visible : false
141 161 },
142 162 {
143 163 field : 'lastUpdated',
144   - title : '更新时间'
  164 + title : '更新时间',
  165 + visible : false
145 166 },
146 167 {
147 168 field : 'lastUpdatedBy',
148   - title : '更新用户'
  169 + title : '更新用户',
  170 + visible : false
149 171 },
150 172 {
151 173 field : 'userDef1',
... ... @@ -175,6 +197,24 @@
175 197 };
176 198 $.table.init(options);
177 199 });
  200 +
  201 + function detail(id, code) {
  202 + // console.log(id);
  203 + // dictid=id;
  204 + var url = prefix1+"/list/" + id;
  205 + createtable(url);
  206 + }
  207 +
  208 + function createtable(url) {
  209 + $("#tabDetail").children().remove();
  210 + $("#myTab li").removeClass("active");
  211 + var height = $(document).height()-100 + 'px';
  212 + var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
  213 + $("#tabDetail").append(str);
  214 + $(".tab-pane").removeClass("in active");
  215 + $("#myTab li:eq(1)").addClass("active");
  216 + $("#tabDetail").addClass("in active");
  217 + }
178 218 </script>
179 219 </body>
180 220 </html>
181 221 \ No newline at end of file
... ...
src/main/resources/templates/general/bomHeader/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-bomHeader-edit" th:object="${bomHeader}">
  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" th:field="*{materialCode}">
  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 + <input id="qty" name="qty" class="form-control" type="text" th:field="*{qty}">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <label class="col-sm-3 control-label">修正号码:</label>
  22 + <div class="col-sm-8">
  23 + <input id="revisionNum" name="revisionNum" class="form-control" type="text" th:field="*{revisionNum}">
  24 + </div>
  25 + </div>
  26 + <div class="form-group">
  27 + <label class="col-sm-3 control-label">加工说明:</label>
  28 + <div class="col-sm-8">
  29 + <input id="buildInstructions" name="buildInstructions" class="form-control" type="text" th:field="*{buildInstructions}">
  30 + </div>
  31 + </div>
  32 + <div class="form-group">
  33 + <label class="col-sm-3 control-label">加工货位:</label>
  34 + <div class="col-sm-8">
  35 + <input id="buildLoc" name="buildLoc" class="form-control" type="text" th:field="*{buildLoc}">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">有效起始日期:</label>
  40 + <div class="col-sm-8">
  41 + <input id="validFromDate" name="validFromDate" class="time-input" type="text" th:field="*{validFromDate}">
  42 + </div>
  43 + </div>
  44 + <div class="form-group">
  45 + <label class="col-sm-3 control-label">有效结束日期:</label>
  46 + <div class="col-sm-8">
  47 + <input id="validEndDate" name="validEndDate" class="time-input" type="text" th:field="*{validEndDate}">
  48 + </div>
  49 + </div>
  50 + <div class="form-group">
  51 + <label class="col-sm-3 control-label">优先级:</label>
  52 + <div class="col-sm-8">
  53 + <input id="priority" name="priority" class="form-control" type="text" th:field="*{priority}">
  54 + </div>
  55 + </div>
  56 + <div class="form-group">
  57 + <label class="col-sm-3 control-label">是否有效:</label>
  58 + <div class="col-sm-8">
  59 + <select id="enable" name="enable" class="form-control" th:field="*{enable}">
  60 + <option value="0">有效</option>
  61 + <option value="1">无效</option>
  62 + </select>
  63 + </div>
  64 + </div>
  65 + <div class="form-group">
  66 + <label class="col-sm-3 control-label">是否虚拟商品:</label>
  67 + <div class="col-sm-8">
  68 + <select id="isVirtualBom" name="isVirtualBom" class="form-control" th:field="*{isVirtualBom}" >
  69 + <option value="0">不是</option>
  70 + <option value="1">是</option>
  71 + </select>
  72 + </div>
  73 + </div>
  74 + <!--<div class="form-group"> -->
  75 + <!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
  76 + <!--<div class="col-sm-8">-->
  77 + <!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
  78 + <!--</div>-->
  79 + <!--</div>-->
  80 + <!--<div class="form-group"> -->
  81 + <!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
  82 + <!--<div class="col-sm-8">-->
  83 + <!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
  84 + <!--</div>-->
  85 + <!--</div>-->
  86 + <!--<div class="form-group"> -->
  87 + <!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
  88 + <!--<div class="col-sm-8">-->
  89 + <!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
  90 + <!--</div>-->
  91 + <!--</div>-->
  92 + <div class="form-group">
  93 + <div class="form-control-static col-sm-offset-9">
  94 + <button type="submit" class="btn btn-primary">提交</button>
  95 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  96 + </div>
  97 + </div>
  98 + </form>
  99 +</div>
  100 +<div th:include="include::footer"></div>
  101 +<script type="text/javascript">
  102 + var prefix = ctx + "general/bomHeader";
  103 + $("#form-bomHeader-add").validate({
  104 + rules:{
  105 + materialCode:{
  106 + required:true
  107 + },
  108 + },
  109 + submitHandler: function(form) {
  110 + var tableValue = $("#form-bomHeader-add").serialize();
  111 + tableValue = formValueReplace(tableValue, "enable", $("#enable option:selected").val());
  112 + tableValue = formValueReplace(tableValue, "isVirtualBom", $("#isVirtualBom option:selected").val());
  113 + $.operate.save(prefix + "/add", tableValue);
  114 + }
  115 + });
  116 +
  117 + $(function () {
  118 + layui.use('laydate', function() {
  119 + var laydate = layui.laydate;
  120 + laydate.render({ elem: '#validFromDate', theme: 'molv', format: 'yyyy-MM-dd' });
  121 + laydate.render({ elem: '#validEndDate', theme: 'molv', format: 'yyyy-MM-dd' });
  122 + });
  123 + });
  124 +</script>
  125 +</body>
  126 +</html>
... ...