Commit 667223274bc8ef0e20e1ba511a98679bf7efb166
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop
Showing
7 changed files
with
345 additions
and
177 deletions
src/main/java/com/huaheng/pc/general/company/domain/Company.java
@@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.annotation.IdType; | @@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | +import lombok.Data; | ||
8 | + | ||
7 | import java.io.Serializable; | 9 | import java.io.Serializable; |
8 | import java.util.Date; | 10 | import java.util.Date; |
9 | 11 | ||
10 | -import com.huaheng.framework.web.domain.BaseEntity; | ||
11 | -import lombok.Data; | ||
12 | - | ||
13 | @Data | 12 | @Data |
14 | @TableName(value = "company") | 13 | @TableName(value = "company") |
15 | public class Company implements Serializable { | 14 | public class Company implements Serializable { |
@@ -214,6 +213,7 @@ public class Company implements Serializable { | @@ -214,6 +213,7 @@ public class Company implements Serializable { | ||
214 | @TableField(value = "processStamp") | 213 | @TableField(value = "processStamp") |
215 | private String processStamp; | 214 | private String processStamp; |
216 | 215 | ||
216 | + @TableField(exist = false) | ||
217 | private boolean flag = false; | 217 | private boolean flag = false; |
218 | 218 | ||
219 | private static final long serialVersionUID = 1L; | 219 | private static final long serialVersionUID = 1L; |
src/main/java/com/huaheng/pc/general/warehouse/controller/WareHouseController.java
0 → 100644
1 | +package com.huaheng.pc.general.warehouse.controller; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | +import com.huaheng.common.support.Convert; | ||
8 | +import com.huaheng.common.utils.StringUtils; | ||
9 | +import com.huaheng.common.utils.security.ShiroUtils; | ||
10 | +import com.huaheng.framework.aspectj.lang.annotation.Log; | ||
11 | +import com.huaheng.framework.aspectj.lang.constant.BusinessType; | ||
12 | +import com.huaheng.framework.web.controller.BaseController; | ||
13 | +import com.huaheng.framework.web.domain.AjaxResult; | ||
14 | +import com.huaheng.framework.web.page.PageDomain; | ||
15 | +import com.huaheng.framework.web.page.TableDataInfo; | ||
16 | +import com.huaheng.framework.web.page.TableSupport; | ||
17 | +import com.huaheng.pc.general.company.service.CompanyService; | ||
18 | +import com.huaheng.pc.general.company.service.WarehouseService; | ||
19 | +import com.huaheng.pc.general.warehouse.domain.Warehouse; | ||
20 | +import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; | ||
21 | +import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; | ||
22 | +import com.huaheng.pc.system.dict.service.IDictDataService; | ||
23 | +import com.huaheng.pc.system.dict.service.IDictTypeService; | ||
24 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
25 | +import org.springframework.stereotype.Controller; | ||
26 | +import org.springframework.ui.ModelMap; | ||
27 | +import org.springframework.web.bind.annotation.*; | ||
28 | + | ||
29 | +import javax.annotation.Resource; | ||
30 | +import java.util.List; | ||
31 | + | ||
32 | +@Controller | ||
33 | +@RequestMapping("/general/warehouse") | ||
34 | +public class WareHouseController extends BaseController { | ||
35 | + | ||
36 | + @Resource | ||
37 | + private WarehouseService warehouseService; | ||
38 | + @Resource | ||
39 | + private InventoryHeaderService inventoryHeaderService; | ||
40 | + @Resource | ||
41 | + private IDictDataService dictDataService; | ||
42 | + @Resource | ||
43 | + private IDictTypeService dictTypeService; | ||
44 | + @Resource | ||
45 | + private CompanyService companyService; | ||
46 | + | ||
47 | + private String prefix = "general/warehouse"; | ||
48 | + | ||
49 | + @RequiresPermissions("general:warehouse:view") | ||
50 | + @GetMapping() | ||
51 | + public String warehouse() { | ||
52 | + return prefix + "/warehouse"; | ||
53 | + } | ||
54 | + | ||
55 | + /** | ||
56 | + * 查询仓库列表 | ||
57 | + */ | ||
58 | + @RequiresPermissions("general:warehouse:list") | ||
59 | + @Log(title = "通用-仓库管理", operating = "查看仓库列表", action = BusinessType.GRANT) | ||
60 | + @PostMapping("/list") | ||
61 | + @ResponseBody | ||
62 | + public TableDataInfo list(Warehouse warehouse, String createdBegin, String createdEnd) { | ||
63 | + LambdaQueryWrapper<Warehouse> lambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
64 | + PageDomain pageDomain = TableSupport.buildPageRequest(); | ||
65 | + Integer pageNum = pageDomain.getPageNum(); | ||
66 | + Integer pageSize = pageDomain.getPageSize()/2; | ||
67 | + lambdaQueryWrapper.gt(StringUtils.isNotEmpty(createdBegin),Warehouse::getCreated, createdBegin) | ||
68 | + .lt(StringUtils.isNotEmpty(createdEnd),Warehouse::getCreated, createdEnd) | ||
69 | + .eq(StringUtils.isNotEmpty(warehouse.getCode()),Warehouse::getCode, warehouse.getCode()) | ||
70 | + .eq(StringUtils.isNotEmpty(warehouse.getName()),Warehouse::getName,warehouse.getName()) | ||
71 | + .orderByDesc(Warehouse::getCreated); | ||
72 | + /** | ||
73 | + * 使用分页查询 | ||
74 | + */ | ||
75 | + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ | ||
76 | + Page<Warehouse> page = new Page<>(pageNum, pageSize); | ||
77 | + IPage<Warehouse> iPage = warehouseService.page(page, lambdaQueryWrapper); | ||
78 | + return getDataTable(iPage.getRecords()); | ||
79 | + } else { | ||
80 | + List<Warehouse> list = warehouseService.list(lambdaQueryWrapper); | ||
81 | + return getDataTable(list); | ||
82 | + } | ||
83 | + } | ||
84 | + | ||
85 | + /** | ||
86 | + * 新增仓库 | ||
87 | + */ | ||
88 | + @GetMapping("/add") | ||
89 | + public String add(ModelMap modelMap) { | ||
90 | + modelMap.put("list",companyService.list()); | ||
91 | + return prefix + "/add"; | ||
92 | + } | ||
93 | + | ||
94 | + /** | ||
95 | + * 新增保存仓库 | ||
96 | + */ | ||
97 | + @RequiresPermissions("general:warehouse:add") | ||
98 | + @Log(title = "通用-仓库管理", operating = "新增仓库", action = BusinessType.INSERT) | ||
99 | + @PostMapping("/add") | ||
100 | + @ResponseBody | ||
101 | + public AjaxResult addSave(Warehouse warehouse) { | ||
102 | + warehouse.setCreatedBy(ShiroUtils.getLoginName()); | ||
103 | + warehouse.setLastUpdatedBy(ShiroUtils.getLoginName()); | ||
104 | + return toAjax(warehouseService.save(warehouse)); | ||
105 | + } | ||
106 | + | ||
107 | + /** | ||
108 | + * 修改仓库 | ||
109 | + */ | ||
110 | + @GetMapping("/edit/{code}") | ||
111 | + public String edit(@PathVariable("code") String code, ModelMap mmap) { | ||
112 | + Warehouse warehouse = warehouseService.getById(code); | ||
113 | + mmap.put("warehouse", warehouse); | ||
114 | + mmap.put("list",companyService.list()); | ||
115 | + return prefix + "/edit"; | ||
116 | + } | ||
117 | + | ||
118 | + /** | ||
119 | + * 修改保存仓库 | ||
120 | + */ | ||
121 | + @RequiresPermissions("general:warehouse:edit") | ||
122 | + @Log(title = "通用-仓库管理", operating = "修改仓库", action = BusinessType.UPDATE) | ||
123 | + @PostMapping("/edit") | ||
124 | + @ResponseBody | ||
125 | + public AjaxResult editSave(Warehouse warehouse) { | ||
126 | + warehouse.setLastUpdatedBy(ShiroUtils.getLoginName()); | ||
127 | + return toAjax(warehouseService.updateById(warehouse)); | ||
128 | + } | ||
129 | + | ||
130 | + /** | ||
131 | + * 删除仓库 | ||
132 | + */ | ||
133 | + @RequiresPermissions("general:warehouse:remove") | ||
134 | + @Log(title = "通用-仓库管理", operating = "删除仓库", action = BusinessType.DELETE) | ||
135 | + @PostMapping( "/remove") | ||
136 | + @ResponseBody | ||
137 | + public AjaxResult remove(String Codes) { | ||
138 | + if (StringUtils.isEmpty(Codes)) | ||
139 | + return AjaxResult.error("id不能为空"); | ||
140 | + for (String code : Convert.toStrArray(Codes)) | ||
141 | + { | ||
142 | + Warehouse warehouse = new Warehouse(); | ||
143 | + InventoryHeader inventory = new InventoryHeader(); | ||
144 | + inventory.setWarehouseCode(code); | ||
145 | + inventory.setCompanyCode(warehouse.getCode()); | ||
146 | + LambdaQueryWrapper<InventoryHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
147 | + lambdaQueryWrapper.eq(InventoryHeader::getWarehouseCode,code); | ||
148 | + int count = inventoryHeaderService.count(lambdaQueryWrapper); | ||
149 | + if (count == 0) { | ||
150 | + return AjaxResult.error("仓库编码(" + warehouse.getCode() +")还有库存,不能删除!"); | ||
151 | + } | ||
152 | + warehouse.setLastUpdatedBy(ShiroUtils.getLoginName()); | ||
153 | + warehouse.setDeleted(true); | ||
154 | + warehouseService.updateById(warehouse); | ||
155 | + dictDataService.deleteDictDataByWarehouseCode(code); | ||
156 | + dictTypeService.deleteDictTypeByWarehouseCode(code); | ||
157 | + } | ||
158 | + return AjaxResult.success("删除成功!"); | ||
159 | + } | ||
160 | +} |
src/main/java/com/huaheng/pc/general/warehouse/domain/Warehouse.java
@@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType; | @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | +import lombok.Data; | ||
8 | + | ||
7 | import java.io.Serializable; | 9 | import java.io.Serializable; |
8 | import java.util.Date; | 10 | import java.util.Date; |
9 | -import lombok.Data; | ||
10 | 11 | ||
11 | @Data | 12 | @Data |
12 | @TableName(value = "warehouse") | 13 | @TableName(value = "warehouse") |
@@ -14,7 +15,7 @@ public class Warehouse implements Serializable { | @@ -14,7 +15,7 @@ public class Warehouse implements Serializable { | ||
14 | /** | 15 | /** |
15 | * 仓库编码 | 16 | * 仓库编码 |
16 | */ | 17 | */ |
17 | - @TableId(value = "code", type = IdType.INPUT) | 18 | + @TableId(value = "code", type = IdType.INPUT) |
18 | private String code; | 19 | private String code; |
19 | 20 | ||
20 | /** | 21 | /** |
@@ -185,6 +186,9 @@ public class Warehouse implements Serializable { | @@ -185,6 +186,9 @@ public class Warehouse implements Serializable { | ||
185 | @TableField(value = "userDef8") | 186 | @TableField(value = "userDef8") |
186 | private String userDef8; | 187 | private String userDef8; |
187 | 188 | ||
189 | + @TableField(value = "deleted") | ||
190 | + private Boolean deleted; | ||
191 | + | ||
188 | private static final long serialVersionUID = 1L; | 192 | private static final long serialVersionUID = 1L; |
189 | 193 | ||
190 | public static final String COL_ADDRESS1 = "address1"; | 194 | public static final String COL_ADDRESS1 = "address1"; |
@@ -242,4 +246,6 @@ public class Warehouse implements Serializable { | @@ -242,4 +246,6 @@ public class Warehouse implements Serializable { | ||
242 | public static final String COL_USERDEF7 = "userDef7"; | 246 | public static final String COL_USERDEF7 = "userDef7"; |
243 | 247 | ||
244 | public static final String COL_USERDEF8 = "userDef8"; | 248 | public static final String COL_USERDEF8 = "userDef8"; |
249 | + | ||
250 | + public static final String COL_DELETED = "deleted"; | ||
245 | } | 251 | } |
246 | \ No newline at end of file | 252 | \ No newline at end of file |
src/main/resources/mybatis/general/WarehouseMapper.xml
@@ -32,12 +32,13 @@ | @@ -32,12 +32,13 @@ | ||
32 | <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> | 32 | <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> |
33 | <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> | 33 | <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> |
34 | <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> | 34 | <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> |
35 | + <result column="deleted" jdbcType="BIT" property="deleted" /> | ||
35 | </resultMap> | 36 | </resultMap> |
36 | <sql id="Base_Column_List"> | 37 | <sql id="Base_Column_List"> |
37 | <!--@mbg.generated--> | 38 | <!--@mbg.generated--> |
38 | code, address1, address2, city, `state`, district, country, postalCode, attentionTo, | 39 | code, address1, address2, city, `state`, district, country, postalCode, attentionTo, |
39 | phoneNum, faxNum, email, hostCode, `name`, `enable`, orgCode, created, createdBy, | 40 | phoneNum, faxNum, email, hostCode, `name`, `enable`, orgCode, created, createdBy, |
40 | lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, | 41 | lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, |
41 | - userDef6, userDef7, userDef8 | 42 | + userDef6, userDef7, userDef8, delete |
42 | </sql> | 43 | </sql> |
43 | </mapper> | 44 | </mapper> |
44 | \ No newline at end of file | 45 | \ No newline at end of file |
src/main/resources/templates/general/warehouse/add.html
@@ -18,9 +18,9 @@ | @@ -18,9 +18,9 @@ | ||
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | <div class="form-group"> | 20 | <div class="form-group"> |
21 | - <label class="col-sm-3 control-label">货主:</label> | 21 | + <label class="col-sm-3 control-label">公司:</label> |
22 | <div class="col-sm-8"> | 22 | <div class="col-sm-8"> |
23 | - <select id="company" name="company" class="form-control" th:with="list=${@company.selectCompanyByCurrentUserId()}"> | 23 | + <select id="orgCode" name="orgCode" class="form-control"> |
24 | <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option> | 24 | <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option> |
25 | </select> | 25 | </select> |
26 | </div> | 26 | </div> |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | <div class="form-group"> | 46 | <div class="form-group"> |
47 | <label class="col-sm-3 control-label">省份:</label> | 47 | <label class="col-sm-3 control-label">省份:</label> |
48 | <div class="col-sm-8"> | 48 | <div class="col-sm-8"> |
49 | - <input id="province" name="province" class="form-control" type="text"> | 49 | + <input id="state" name="state" class="form-control" type="text"> |
50 | </div> | 50 | </div> |
51 | </div> | 51 | </div> |
52 | <div class="form-group"> | 52 | <div class="form-group"> |
@@ -74,13 +74,13 @@ | @@ -74,13 +74,13 @@ | ||
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | <div class="form-group"> | 76 | <div class="form-group"> |
77 | - <label class="col-sm-3 control-label">手机:</label> | 77 | + <label class="col-sm-3 control-label">联系电话:</label> |
78 | <div class="col-sm-8"> | 78 | <div class="col-sm-8"> |
79 | <input id="phoneNum" name="phoneNum" class="form-control" type="text"> | 79 | <input id="phoneNum" name="phoneNum" class="form-control" type="text"> |
80 | </div> | 80 | </div> |
81 | </div> | 81 | </div> |
82 | <div class="form-group"> | 82 | <div class="form-group"> |
83 | - <label class="col-sm-3 control-label">电话号码:</label> | 83 | + <label class="col-sm-3 control-label">传真:</label> |
84 | <div class="col-sm-8"> | 84 | <div class="col-sm-8"> |
85 | <input id="faxNum" name="faxNum" class="form-control" type="text"> | 85 | <input id="faxNum" name="faxNum" class="form-control" type="text"> |
86 | </div> | 86 | </div> |
@@ -97,42 +97,7 @@ | @@ -97,42 +97,7 @@ | ||
97 | <input id="hostCode" name="hostCode" class="form-control" type="text"> | 97 | <input id="hostCode" name="hostCode" class="form-control" type="text"> |
98 | </div> | 98 | </div> |
99 | </div> | 99 | </div> |
100 | - <div class="form-group"> | ||
101 | - <label class="col-sm-3 control-label">创建时间:</label> | ||
102 | - <div class="col-sm-8"> | ||
103 | - <input id="created" name="created" class="form-control" type="text"> | ||
104 | - </div> | ||
105 | - </div> | ||
106 | - <div class="form-group"> | ||
107 | - <label class="col-sm-3 control-label">是否有效:</label> | ||
108 | - <div class="col-sm-8"> | ||
109 | - <div class="onoffswitch"> | ||
110 | - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable"> | ||
111 | - <label class="onoffswitch-label" for="enable"> | ||
112 | - <span class="onoffswitch-inner"></span> | ||
113 | - <span class="onoffswitch-switch"></span> | ||
114 | - </label> | ||
115 | - </div> | ||
116 | - </div> | ||
117 | - </div> | ||
118 | - <!--<div class="form-group"> --> | ||
119 | - <!--<label class="col-sm-3 control-label">创建用户:</label>--> | ||
120 | - <!--<div class="col-sm-8">--> | ||
121 | - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">--> | ||
122 | - <!--</div>--> | ||
123 | - <!--</div>--> | ||
124 | - <!--<div class="form-group"> --> | ||
125 | - <!--<label class="col-sm-3 control-label">创建时间:</label>--> | ||
126 | - <!--<div class="col-sm-8">--> | ||
127 | - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">--> | ||
128 | - <!--</div>--> | ||
129 | - <!--</div>--> | ||
130 | - <!--<div class="form-group"> --> | ||
131 | - <!--<label class="col-sm-3 control-label">更新用户:</label>--> | ||
132 | - <!--<div class="col-sm-8">--> | ||
133 | - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">--> | ||
134 | - <!--</div>--> | ||
135 | - <!--</div>--> | 100 | + |
136 | <!--<div class="form-group"> --> | 101 | <!--<div class="form-group"> --> |
137 | <!--<label class="col-sm-3 control-label">是否有效:</label>--> | 102 | <!--<label class="col-sm-3 control-label">是否有效:</label>--> |
138 | <!--<div class="col-sm-8">--> | 103 | <!--<div class="col-sm-8">--> |
@@ -164,6 +129,20 @@ | @@ -164,6 +129,20 @@ | ||
164 | <!--</div>--> | 129 | <!--</div>--> |
165 | <!--</div>--> | 130 | <!--</div>--> |
166 | <div class="form-group"> | 131 | <div class="form-group"> |
132 | + <label class="col-sm-3 control-label">是否有效:</label> | ||
133 | + <div class="col-sm-8"> | ||
134 | + <!--<input id="enable" name="enable" th:field="*{enable}" class="form-control" type="text">--> | ||
135 | + <div class="onoffswitch"> | ||
136 | + <!--<input type="checkbox" th:checked="*{enable}" class="onoffswitch-checkbox" id="enable" name="enable">--> | ||
137 | + <input type="checkbox" class="onoffswitch-checkbox" id="enable" name="enable" readonly="true"> | ||
138 | + <label class="onoffswitch-label" for="enable"> | ||
139 | + <span class="onoffswitch-inner"></span> | ||
140 | + <span class="onoffswitch-switch"></span> | ||
141 | + </label> | ||
142 | + </div> | ||
143 | + </div> | ||
144 | + </div> | ||
145 | + <div class="form-group"> | ||
167 | <div class="form-control-static col-sm-offset-9"> | 146 | <div class="form-control-static col-sm-offset-9"> |
168 | <button type="submit" class="btn btn-primary">提交</button> | 147 | <button type="submit" class="btn btn-primary">提交</button> |
169 | <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> | 148 | <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> |
@@ -182,7 +161,7 @@ | @@ -182,7 +161,7 @@ | ||
182 | name:{ | 161 | name:{ |
183 | required:true | 162 | required:true |
184 | }, | 163 | }, |
185 | - companyId:{ | 164 | + orgCode:{ |
186 | required:true, | 165 | required:true, |
187 | digits:true | 166 | digits:true |
188 | }, | 167 | }, |
@@ -203,8 +182,8 @@ | @@ -203,8 +182,8 @@ | ||
203 | // $.operate.save(prefix + "/add", $('#form-warehouse-add').serialize()); | 182 | // $.operate.save(prefix + "/add", $('#form-warehouse-add').serialize()); |
204 | var tableValue = $("#form-warehouse-add").serialize(); | 183 | var tableValue = $("#form-warehouse-add").serialize(); |
205 | tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); | 184 | tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); |
206 | - tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val()); | ||
207 | - tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code")); | 185 | + tableValue = formValueReplace(tableValue, "orgCode", $("#company option:selected").val()); |
186 | + | ||
208 | $.operate.save(prefix + "/add", tableValue); | 187 | $.operate.save(prefix + "/add", tableValue); |
209 | } | 188 | } |
210 | }); | 189 | }); |
src/main/resources/templates/general/warehouse/edit.html
@@ -4,100 +4,99 @@ | @@ -4,100 +4,99 @@ | ||
4 | <head th:include="include :: header"></head> | 4 | <head th:include="include :: header"></head> |
5 | <body class="white-bg"> | 5 | <body class="white-bg"> |
6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | - <form class="form-horizontal m" id="form-warehouse-edit" th:object="${warehouse}"> | ||
8 | - <input id="id" name="id" th:field="*{id}" type="hidden"> | ||
9 | - <div class="form-group"> | ||
10 | - <label class="col-sm-3 control-label">编码:</label> | ||
11 | - <div class="col-sm-8"> | ||
12 | - <input id="code" name="code" th:field="*{code}" class="form-control" type="text" readonly="true"> | ||
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 | - <input id="name" name="name" th:field="*{name}" class="form-control" type="text" readonly="true"> | ||
19 | - </div> | ||
20 | - </div> | 7 | + <form class="form-horizontal m" id="form-warehouse-edit" > |
21 | <div class="form-group"> | 8 | <div class="form-group"> |
22 | - <label class="col-sm-3 control-label">货主:</label> | ||
23 | - <div class="col-sm-8"> | ||
24 | - <select id="company" name="company" class="form-control" th:with="list=${@company.selectCompanyByCurrentUserId()}" th:field="*{companyId}"> | ||
25 | - <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option> | ||
26 | - </select> | ||
27 | - </div> | ||
28 | - </div> | ||
29 | - <div class="form-group"> | ||
30 | - <label class="col-sm-3 control-label">地址1:</label> | ||
31 | - <div class="col-sm-8"> | ||
32 | - <input id="address1" name="address1" th:field="*{address1}" class="form-control" type="text"> | ||
33 | - </div> | ||
34 | - </div> | ||
35 | - <div class="form-group"> | ||
36 | - <label class="col-sm-3 control-label">地址2:</label> | ||
37 | - <div class="col-sm-8"> | ||
38 | - <input id="address2" name="address2" th:field="*{address2}" 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 | - <input id="city" name="city" th:field="*{city}" class="form-control" type="text"> | ||
45 | - </div> | ||
46 | - </div> | ||
47 | - <div class="form-group"> | ||
48 | - <label class="col-sm-3 control-label">省份:</label> | ||
49 | - <div class="col-sm-8"> | ||
50 | - <input id="province" name="province" th:field="*{province}" class="form-control" type="text"> | ||
51 | - </div> | ||
52 | - </div> | ||
53 | - <div class="form-group"> | ||
54 | - <label class="col-sm-3 control-label">区/县:</label> | ||
55 | - <div class="col-sm-8"> | ||
56 | - <input id="district" name="district" th:field="*{district}" class="form-control" type="text"> | ||
57 | - </div> | ||
58 | - </div> | ||
59 | - <div class="form-group"> | ||
60 | - <label class="col-sm-3 control-label">国家:</label> | ||
61 | - <div class="col-sm-8"> | ||
62 | - <input id="country" name="country" th:field="*{country}" class="form-control" type="text"> | ||
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 | - <input id="postalCode" name="postalCode" th:field="*{postalCode}" class="form-control" type="text"> | ||
69 | - </div> | ||
70 | - </div> | ||
71 | - <div class="form-group"> | ||
72 | - <label class="col-sm-3 control-label">联系人:</label> | ||
73 | - <div class="col-sm-8"> | ||
74 | - <input id="attentionTo" name="attentionTo" th:field="*{attentionTo}" class="form-control" type="text"> | ||
75 | - </div> | ||
76 | - </div> | ||
77 | - <div class="form-group"> | ||
78 | - <label class="col-sm-3 control-label">手机:</label> | ||
79 | - <div class="col-sm-8"> | ||
80 | - <input id="phoneNum" name="phoneNum" th:field="*{phoneNum}" class="form-control" type="text"> | ||
81 | - </div> | ||
82 | - </div> | ||
83 | - <div class="form-group"> | ||
84 | - <label class="col-sm-3 control-label">电话号码:</label> | ||
85 | - <div class="col-sm-8"> | ||
86 | - <input id="faxNum" name="faxNum" th:field="*{faxNum}" class="form-control" type="text"> | ||
87 | - </div> | ||
88 | - </div> | ||
89 | - <div class="form-group"> | ||
90 | - <label class="col-sm-3 control-label">邮件地址:</label> | ||
91 | - <div class="col-sm-8"> | ||
92 | - <input id="email" name="email" th:field="*{email}" class="form-control" type="text"> | ||
93 | - </div> | ||
94 | - </div> | ||
95 | - <div class="form-group"> | ||
96 | - <label class="col-sm-3 control-label">上位系统url地址:</label> | ||
97 | - <div class="col-sm-8"> | ||
98 | - <input id="hostCode" name="hostCode" th:field="*{hostCode}" class="form-control" type="text"> | ||
99 | - </div> | ||
100 | - </div> | 9 | + <label class="col-sm-3 control-label">仓库编码:</label> |
10 | + <div class="col-sm-8"> | ||
11 | + <input id="code" name="code" th:value="${warehouse.code}" class="form-control" type="text" readonly="true"> | ||
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="name" name="name" th:field="*{name}" class="form-control" type="text" readonly="true">--> | ||
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 | +<!-- <select id="orgCode" name="orgCode" class="form-control" th:field="*{orgCode}">--> | ||
24 | +<!-- <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option>--> | ||
25 | +<!-- </select>--> | ||
26 | +<!-- </div>--> | ||
27 | +<!-- </div>--> | ||
28 | +<!-- <div class="form-group"> --> | ||
29 | +<!-- <label class="col-sm-3 control-label">地址1:</label>--> | ||
30 | +<!-- <div class="col-sm-8">--> | ||
31 | +<!-- <input id="address1" name="address1" th:field="*{address1}" class="form-control" type="text">--> | ||
32 | +<!-- </div>--> | ||
33 | +<!-- </div>--> | ||
34 | +<!-- <div class="form-group"> --> | ||
35 | +<!-- <label class="col-sm-3 control-label">地址2:</label>--> | ||
36 | +<!-- <div class="col-sm-8">--> | ||
37 | +<!-- <input id="address2" name="address2" th:field="*{address2}" class="form-control" type="text">--> | ||
38 | +<!-- </div>--> | ||
39 | +<!-- </div>--> | ||
40 | +<!-- <div class="form-group"> --> | ||
41 | +<!-- <label class="col-sm-3 control-label">城市:</label>--> | ||
42 | +<!-- <div class="col-sm-8">--> | ||
43 | +<!-- <input id="city" name="city" th:field="*{city}" class="form-control" type="text">--> | ||
44 | +<!-- </div>--> | ||
45 | +<!-- </div>--> | ||
46 | +<!-- <div class="form-group"> --> | ||
47 | +<!-- <label class="col-sm-3 control-label">省份:</label>--> | ||
48 | +<!-- <div class="col-sm-8">--> | ||
49 | +<!-- <input id="state" name="state" th:field="*{province}" class="form-control" type="text">--> | ||
50 | +<!-- </div>--> | ||
51 | +<!-- </div>--> | ||
52 | +<!-- <div class="form-group"> --> | ||
53 | +<!-- <label class="col-sm-3 control-label">区/县:</label>--> | ||
54 | +<!-- <div class="col-sm-8">--> | ||
55 | +<!-- <input id="district" name="district" th:field="*{district}" class="form-control" type="text">--> | ||
56 | +<!-- </div>--> | ||
57 | +<!-- </div>--> | ||
58 | +<!-- <div class="form-group"> --> | ||
59 | +<!-- <label class="col-sm-3 control-label">国家:</label>--> | ||
60 | +<!-- <div class="col-sm-8">--> | ||
61 | +<!-- <input id="country" name="country" th:field="*{country}" class="form-control" type="text">--> | ||
62 | +<!-- </div>--> | ||
63 | +<!-- </div>--> | ||
64 | +<!-- <div class="form-group"> --> | ||
65 | +<!-- <label class="col-sm-3 control-label">邮编:</label>--> | ||
66 | +<!-- <div class="col-sm-8">--> | ||
67 | +<!-- <input id="postalCode" name="postalCode" th:field="*{postalCode}" class="form-control" type="text">--> | ||
68 | +<!-- </div>--> | ||
69 | +<!-- </div>--> | ||
70 | +<!-- <div class="form-group"> --> | ||
71 | +<!-- <label class="col-sm-3 control-label">联系人:</label>--> | ||
72 | +<!-- <div class="col-sm-8">--> | ||
73 | +<!-- <input id="attentionTo" name="attentionTo" th:field="*{attentionTo}" class="form-control" type="text">--> | ||
74 | +<!-- </div>--> | ||
75 | +<!-- </div>--> | ||
76 | +<!-- <div class="form-group"> --> | ||
77 | +<!-- <label class="col-sm-3 control-label">联系电话:</label>--> | ||
78 | +<!-- <div class="col-sm-8">--> | ||
79 | +<!-- <input id="phoneNum" name="phoneNum" th:field="*{phoneNum}" class="form-control" type="text">--> | ||
80 | +<!-- </div>--> | ||
81 | +<!-- </div>--> | ||
82 | +<!-- <div class="form-group"> --> | ||
83 | +<!-- <label class="col-sm-3 control-label">传真:</label>--> | ||
84 | +<!-- <div class="col-sm-8">--> | ||
85 | +<!-- <input id="faxNum" name="faxNum" th:field="*{faxNum}" class="form-control" type="text">--> | ||
86 | +<!-- </div>--> | ||
87 | +<!-- </div>--> | ||
88 | +<!-- <div class="form-group"> --> | ||
89 | +<!-- <label class="col-sm-3 control-label">邮件地址:</label>--> | ||
90 | +<!-- <div class="col-sm-8">--> | ||
91 | +<!-- <input id="email" name="email" th:field="*{email}" class="form-control" type="text">--> | ||
92 | +<!-- </div>--> | ||
93 | +<!-- </div>--> | ||
94 | +<!-- <div class="form-group"> --> | ||
95 | +<!-- <label class="col-sm-3 control-label">上位系统url地址:</label>--> | ||
96 | +<!-- <div class="col-sm-8">--> | ||
97 | +<!-- <input id="hostCode" name="hostCode" th:field="*{hostCode}" class="form-control" type="text">--> | ||
98 | +<!-- </div>--> | ||
99 | +<!-- </div>--> | ||
101 | <!--<div class="form-group"> --> | 100 | <!--<div class="form-group"> --> |
102 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> | 101 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> |
103 | <!--<div class="col-sm-8">--> | 102 | <!--<div class="col-sm-8">--> |
@@ -122,20 +121,20 @@ | @@ -122,20 +121,20 @@ | ||
122 | <!--<input id="lastUpdatedBy" name="lastUpdatedBy" th:field="*{lastUpdatedBy}" class="form-control" type="text">--> | 121 | <!--<input id="lastUpdatedBy" name="lastUpdatedBy" th:field="*{lastUpdatedBy}" class="form-control" type="text">--> |
123 | <!--</div>--> | 122 | <!--</div>--> |
124 | <!--</div>--> | 123 | <!--</div>--> |
125 | - <div class="form-group"> | ||
126 | - <label class="col-sm-3 control-label">是否有效:</label> | ||
127 | - <div class="col-sm-8"> | ||
128 | - <!--<input id="enable" name="enable" th:field="*{enable}" class="form-control" type="text">--> | ||
129 | - <div class="onoffswitch"> | ||
130 | - <!--<input type="checkbox" th:checked="*{enable}" class="onoffswitch-checkbox" id="enable" name="enable">--> | ||
131 | - <input type="checkbox" th:checked="${warehouse.enable}" class="onoffswitch-checkbox" id="enable" name="enable" readonly="true"> | ||
132 | - <label class="onoffswitch-label" for="enable"> | ||
133 | - <span class="onoffswitch-inner"></span> | ||
134 | - <span class="onoffswitch-switch"></span> | ||
135 | - </label> | ||
136 | - </div> | ||
137 | - </div> | ||
138 | - </div> | 124 | +<!-- <div class="form-group"> --> |
125 | +<!-- <label class="col-sm-3 control-label">是否有效:</label>--> | ||
126 | +<!-- <div class="col-sm-8">--> | ||
127 | +<!-- <!–<input id="enable" name="enable" th:field="*{enable}" class="form-control" type="text">–>--> | ||
128 | +<!-- <div class="onoffswitch">--> | ||
129 | +<!-- <!–<input type="checkbox" th:checked="*{enable}" class="onoffswitch-checkbox" id="enable" name="enable">–>--> | ||
130 | +<!-- <input type="checkbox" th:checked="${enable}" class="onoffswitch-checkbox" id="enable" name="enable" readonly="true">--> | ||
131 | +<!-- <label class="onoffswitch-label" for="enable">--> | ||
132 | +<!-- <span class="onoffswitch-inner"></span>--> | ||
133 | +<!-- <span class="onoffswitch-switch"></span>--> | ||
134 | +<!-- </label>--> | ||
135 | +<!-- </div>--> | ||
136 | +<!-- </div>--> | ||
137 | +<!-- </div>--> | ||
139 | <!--<div class="form-group"> --> | 138 | <!--<div class="form-group"> --> |
140 | <!--<label class="col-sm-3 control-label">是否删除:</label>--> | 139 | <!--<label class="col-sm-3 control-label">是否删除:</label>--> |
141 | <!--<div class="col-sm-8">--> | 140 | <!--<div class="col-sm-8">--> |
@@ -179,7 +178,7 @@ | @@ -179,7 +178,7 @@ | ||
179 | name:{ | 178 | name:{ |
180 | required:true | 179 | required:true |
181 | }, | 180 | }, |
182 | - companyId:{ | 181 | + orgCode:{ |
183 | required:true, | 182 | required:true, |
184 | digits:true | 183 | digits:true |
185 | }, | 184 | }, |
@@ -200,8 +199,7 @@ | @@ -200,8 +199,7 @@ | ||
200 | // var tableValue = $.common.getTableValue("#form-warehouse-edit"); | 199 | // var tableValue = $.common.getTableValue("#form-warehouse-edit"); |
201 | var tableValue = $("#form-warehouse-edit").serialize(); | 200 | var tableValue = $("#form-warehouse-edit").serialize(); |
202 | tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); | 201 | tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); |
203 | - tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val()); | ||
204 | - tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code")); | 202 | + tableValue = formValueReplace(tableValue, "orgCode", $("#company option:selected").val()); |
205 | $.operate.save(prefix + "/edit", tableValue); | 203 | $.operate.save(prefix + "/edit", tableValue); |
206 | } | 204 | } |
207 | }); | 205 | }); |
src/main/resources/templates/general/warehouse/warehouse.html
@@ -23,9 +23,9 @@ | @@ -23,9 +23,9 @@ | ||
23 | <!--</li>--> | 23 | <!--</li>--> |
24 | <li class="time"> | 24 | <li class="time"> |
25 | <label>创建时间: </label> | 25 | <label>创建时间: </label> |
26 | - <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/> | 26 | + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="createdBegin"/> |
27 | <span>-</span> | 27 | <span>-</span> |
28 | - <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/> | 28 | + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="createdEnd"/> |
29 | </li> | 29 | </li> |
30 | <li> | 30 | <li> |
31 | <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> | 31 | <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
@@ -40,9 +40,9 @@ | @@ -40,9 +40,9 @@ | ||
40 | <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="general:warehouse:add"> | 40 | <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="general:warehouse:add"> |
41 | <i class="fa fa-plus"></i> 新增 | 41 | <i class="fa fa-plus"></i> 新增 |
42 | </a> | 42 | </a> |
43 | - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="general:warehouse:remove"> | 43 | + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="general:warehouse:remove"> |
44 | <i class="fa fa-trash-o"></i> 删除 | 44 | <i class="fa fa-trash-o"></i> 删除 |
45 | - </a> | 45 | + </a>--> |
46 | </div> | 46 | </div> |
47 | 47 | ||
48 | <div class="col-sm-12 select-info"> | 48 | <div class="col-sm-12 select-info"> |
@@ -54,26 +54,20 @@ | @@ -54,26 +54,20 @@ | ||
54 | <script th:inline="javascript"> | 54 | <script th:inline="javascript"> |
55 | var editFlag = [[${@permission.hasPermi('general:warehouse:edit')}]]; | 55 | var editFlag = [[${@permission.hasPermi('general:warehouse:edit')}]]; |
56 | var removeFlag = [[${@permission.hasPermi('general:warehouse:remove')}]]; | 56 | var removeFlag = [[${@permission.hasPermi('general:warehouse:remove')}]]; |
57 | - var prefix = ctx + "general/warehouse" | 57 | + var prefix = ctx + "general/warehouse"; |
58 | var datas = [[${@dict.getType('sys_normal_disable')}]]; | 58 | var datas = [[${@dict.getType('sys_normal_disable')}]]; |
59 | $(function() { | 59 | $(function() { |
60 | var options = { | 60 | var options = { |
61 | url: prefix + "/list", | 61 | url: prefix + "/list", |
62 | createUrl: prefix + "/add", | 62 | createUrl: prefix + "/add", |
63 | - updateUrl: prefix + "/edit/{id}", | 63 | + updateUrl: prefix + "/edit/{code}", |
64 | removeUrl: prefix + "/remove", | 64 | removeUrl: prefix + "/remove", |
65 | modalName: "仓库", | 65 | modalName: "仓库", |
66 | search: false, | 66 | search: false, |
67 | - sortName: "id", | ||
68 | - sortOrder: "desc", | ||
69 | columns: [{ | 67 | columns: [{ |
70 | checkbox: true | 68 | checkbox: true |
71 | }, | 69 | }, |
72 | { | 70 | { |
73 | - field : 'id', | ||
74 | - title : '仓库id' | ||
75 | - }, | ||
76 | - { | ||
77 | field : 'code', | 71 | field : 'code', |
78 | title : '仓库编码' | 72 | title : '仓库编码' |
79 | }, | 73 | }, |
@@ -82,8 +76,8 @@ | @@ -82,8 +76,8 @@ | ||
82 | title : '名称' | 76 | title : '名称' |
83 | }, | 77 | }, |
84 | { | 78 | { |
85 | - field : 'companyId', | ||
86 | - title : '公司id' | 79 | + field : 'orgCode', |
80 | + title : '公司编码' | ||
87 | }, | 81 | }, |
88 | { | 82 | { |
89 | field : 'address1', | 83 | field : 'address1', |
@@ -99,7 +93,7 @@ | @@ -99,7 +93,7 @@ | ||
99 | title : '城市' | 93 | title : '城市' |
100 | }, | 94 | }, |
101 | { | 95 | { |
102 | - field : 'province', | 96 | + field : 'state', |
103 | title : '省份' , | 97 | title : '省份' , |
104 | visible:false | 98 | visible:false |
105 | }, | 99 | }, |
@@ -184,13 +178,43 @@ | @@ -184,13 +178,43 @@ | ||
184 | title : '自定义字段3', | 178 | title : '自定义字段3', |
185 | visible:false | 179 | visible:false |
186 | }, | 180 | }, |
181 | + { | ||
182 | + field : 'userDef4', | ||
183 | + title : '自定义字段4', | ||
184 | + visible:false | ||
185 | + }, | ||
186 | + { | ||
187 | + field : 'userDef5', | ||
188 | + title : '自定义字段5', | ||
189 | + visible:false | ||
190 | + }, | ||
191 | + { | ||
192 | + field : 'userDef6', | ||
193 | + title : '自定义字段7', | ||
194 | + visible:false | ||
195 | + }, | ||
196 | + { | ||
197 | + field : 'userDef7', | ||
198 | + title : '自定义字段7', | ||
199 | + visible:false | ||
200 | + }, | ||
201 | + { | ||
202 | + field : 'userDef8', | ||
203 | + title : '自定义字段8', | ||
204 | + visible:false | ||
205 | + }, | ||
206 | + { | ||
207 | + field : 'version', | ||
208 | + title : '数据版本', | ||
209 | + visible:false | ||
210 | + }, | ||
187 | { | 211 | { |
188 | title: '操作', | 212 | title: '操作', |
189 | align: 'center', | 213 | align: 'center', |
190 | formatter: function(value, row, index) { | 214 | formatter: function(value, row, index) { |
191 | var actions = []; | 215 | var actions = []; |
192 | - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | ||
193 | - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); | 216 | + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.code + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
217 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.code + '\')"><i class="fa fa-trash-o"></i>删除</a>'); | ||
194 | return actions.join(''); | 218 | return actions.join(''); |
195 | } | 219 | } |
196 | }] | 220 | }] |