Commit dbf1b17faf2e38fe0dadd94f949d46a3883b4da2

Authored by xqs
1 parent b5756b87

当前仓库只能新增和修改当前仓库货主

src/main/java/com/huaheng/pc/config/company/controller/CompanyController.java
... ... @@ -84,13 +84,13 @@ public class CompanyController extends BaseController {
84 84 */
85 85 @GetMapping("/add")
86 86 public String add(ModelMap modelMap) {
87   - LambdaQueryWrapper<Warehouse> lambdaQueryWrapper = Wrappers.lambdaQuery();
  87 + /*LambdaQueryWrapper<Warehouse> lambdaQueryWrapper = Wrappers.lambdaQuery();
88 88 lambdaQueryWrapper.select(Warehouse::getCode,Warehouse::getName,Warehouse::getEnable);
89 89 List<Map<String, Object>> warehouseList = warehouseService.listMaps(lambdaQueryWrapper);
90 90 for (Map<String, Object> item : warehouseList){
91 91 item.put("value",item.get("code").toString());
92 92 }
93   - modelMap.put("warehouseList",warehouseList);
  93 + modelMap.put("warehouseList",warehouseList);*/
94 94 return prefix + "/add";
95 95 }
96 96  
... ... @@ -105,6 +105,7 @@ public class CompanyController extends BaseController {
105 105 if(StringUtils.isEmpty(company.getCode()) && StringUtils.isEmpty(company.getName())){
106 106 return AjaxResult.error("货主编码和名称不能为空!");
107 107 }
  108 + company.setWarehouseCode(ShiroUtils.getWarehouseCode());
108 109 company.setCreated(new Date());
109 110 company.setCreatedBy(ShiroUtils.getLoginName());
110 111 company.setLastUpdated(new Date());
... ... @@ -131,6 +132,7 @@ public class CompanyController extends BaseController {
131 132 @PostMapping("/edit")
132 133 @ResponseBody
133 134 public AjaxResult editSave(Company company) {
  135 + company.setLastUpdated(new Date());
134 136 company.setLastUpdatedBy(ShiroUtils.getLoginName());
135 137 return companyService.updateCompany(company);
136 138 }
... ...
src/main/java/com/huaheng/pc/config/company/service/CompanyServiceImpl.java
... ... @@ -73,58 +73,44 @@ public class CompanyServiceImpl extends ServiceImpl&lt;CompanyMapper, Company&gt; impl
73 73 @Override
74 74 @Transactional(rollbackFor = Exception.class)
75 75 public AjaxResult addCompany(Company company) {
76   -
77   - String[] warehouse = company.getWarehouseCode().split(",");
  76 + /*货主新增时只针对当前登录仓库*/
78 77 company.setDeleted(false);
79 78 //添加货主及仓库关联
80 79 WarehouseCompany record = new WarehouseCompany();
81   - for (int i=0; i < warehouse.length; i++){
82   - String warehouseCode = warehouse[i];
83   - company.setWarehouseCode(warehouseCode);
84   - //校验同仓库有无重复code
85   - LambdaQueryWrapper<Company> companyLambdaQueryWrapper = Wrappers.lambdaQuery();
86   - companyLambdaQueryWrapper.eq(Company::getCode,company.getCode());
87   - companyLambdaQueryWrapper.eq(Company::getWarehouseCode,warehouseCode);
88   - Company tmp = this.getOne(companyLambdaQueryWrapper);
89   - if(!StringUtils.isNull(tmp)){
90   - return AjaxResult.error("货主编码重复,请重新输入编码!");
91   - }
92   - int c = companyMapper.insertReturnId(company);
93   - if(c < 1){
94   - throw new ServiceException("插入货主失败!");
95   - }
96   - record.setCompanyId(company.getId());
97   - record.setCompanyCode(company.getCode());
98   - record.setWarehouseCode(warehouseCode);
99   - Boolean w = warehouseCompanyService.save(record);
100   - if(!w){
101   - throw new ServiceException("插入货主仓库关联失败!");
102   - }
  80 + LambdaQueryWrapper<Company> companyLambdaQueryWrapper = Wrappers.lambdaQuery();
  81 + companyLambdaQueryWrapper.eq(Company::getCode,company.getCode());
  82 + companyLambdaQueryWrapper.eq(Company::getWarehouseCode,company.getWarehouseCode());
  83 + Company tmp = this.getOne(companyLambdaQueryWrapper);
  84 + if(!StringUtils.isNull(tmp)){
  85 + return AjaxResult.error("货主编码重复,请重新输入编码!");
  86 + }
  87 + int c = companyMapper.insertReturnId(company);
  88 + if(c < 1){
  89 + throw new ServiceException("插入货主失败!");
  90 + }
  91 + record.setCompanyId(company.getId());
  92 + record.setCompanyCode(company.getCode());
  93 + record.setWarehouseCode(company.getWarehouseCode());
  94 + Boolean w = warehouseCompanyService.save(record);
  95 + if(!w){
  96 + throw new ServiceException("插入货主仓库关联失败!");
103 97 }
104 98 return AjaxResult.success("新增货主成功!");
105 99 }
106 100  
  101 + /**
  102 + * 修改货主
  103 + * */
107 104 @Override
108 105 public AjaxResult updateCompany(Company company) {
  106 + //无法修改货主仓库,当前货主新增仓库时,新增该仓库的货主
109 107 if (company.getId() == null) {
110   - return AjaxResult.error("id为空!");
111   - }
112   - String[] warehouse = company.getWarehouseCode().split(",");
113   - LambdaQueryWrapper<WarehouseCompany> lambdaQueryWrapper = Wrappers.lambdaQuery();
114   - warehouseCompanyService.remove(lambdaQueryWrapper.eq(WarehouseCompany::getCompanyId, company.getId()));
115   - //添加货主仓库关联
116   - WarehouseCompany record = new WarehouseCompany();
117   - for (int i=0; i<warehouse.length; i++)
118   - {
119   - record.setCompanyId(company.getId());
120   - record.setCompanyCode(company.getCode());
121   - record.setWarehouseCode(warehouse[i]);
122   - warehouseCompanyService.save(record);
  108 + return AjaxResult.error("货主ID为空!");
123 109 }
124 110 //更新货主
125 111 company.setLastUpdatedBy(ShiroUtils.getLoginName());
126 112 this.updateById(company);
127   - return AjaxResult.success("更新成功!");
  113 + return AjaxResult.success("修改成功!");
128 114 }
129 115  
130 116 @Override
... ...
src/main/java/com/huaheng/pc/system/user/controller/UserController.java
... ... @@ -97,11 +97,12 @@ public class UserController extends BaseController
97 97 @GetMapping("/add")
98 98 public String add(ModelMap mmap)
99 99 {
100   - Company company = new Company();
101   - company.setWarehouseCode(ShiroUtils.getWarehouseCode());
102 100 mmap.put("roles", roleService.selectRoleAll());
103   - LambdaQueryWrapper<Company> lambdaQueryWrapper = Wrappers.lambdaQuery(company);
104   - mmap.put("companys", companyService.list(lambdaQueryWrapper));
  101 + //只能看到当前仓库的货主
  102 + LambdaQueryWrapper<Company> lambdaQueryWrapper = Wrappers.lambdaQuery();
  103 + lambdaQueryWrapper.eq(Company::getWarehouseCode,ShiroUtils.getWarehouseCode());
  104 + List<Company> companys = companyService.list(lambdaQueryWrapper);
  105 + mmap.put("companys", companys);
105 106 LambdaQueryWrapper<Warehouse> warehouse = Wrappers.lambdaQuery();
106 107 warehouse.select(Warehouse::getCode,Warehouse::getName,Warehouse::getEnable);
107 108 List<Map<String, Object>> warehouseList = warehouseService.listMaps(warehouse);
... ...
src/main/resources/templates/config/company/add.html
... ... @@ -18,14 +18,14 @@
18 18 <input id="name" name="name" class="form-control" type="text">
19 19 </div>
20 20 </div>
21   - <div class="form-group">
  21 + <!--<div class="form-group">
22 22 <label class="col-sm-3 control-label">仓库:</label>
23 23 <div class="col-sm-8">
24 24 <label th:each="warehouse:${warehouseList}" class="checkbox-inline i-checks">
25 25 <input name="warehouseCode" type="checkbox" th:value="${warehouse.value}" th:text=" ${warehouse.name}" th:disabled="${warehouse.enable == false} ">
26 26 </label>
27 27 </div>
28   - </div>
  28 + </div>-->
29 29 <div class="form-group">
30 30 <label class="col-sm-3 control-label">地址1:</label>
31 31 <div class="col-sm-8">
... ...
src/main/resources/templates/config/company/edit.html
... ... @@ -10,23 +10,25 @@
10 10 <div class="form-group">
11 11 <label class="col-sm-3 control-label">编码:</label>
12 12 <div class="col-sm-8">
13   - <input id="code" name="code" th:field="*{code}" class="form-control" type="text">
  13 + <input id="code" name="code" th:field="*{code}" class="form-control" type="text" readonly="readonly">
14 14 </div>
15 15 </div>
16 16 <div class="form-group">
17 17 <label class="col-sm-3 control-label">名称:</label>
18 18 <div class="col-sm-8">
19   - <input id="name" name="name" th:field="*{name}" class="form-control" type="text">
  19 + <input id="name" name="name" th:field="*{name}" class="form-control" type="text" readonly="readonly">
  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 + <label th:each="warehouse:${warehouseList}" class="checkbox-inline i-checks ">
  26 + <input class="layui" name="warehouseCode" type="checkbox" th:checked="${warehouse.flag}" th:value="${warehouse.value}"
  27 + th:text=" ${warehouse.name}"
  28 + disabled="disabled" >
  29 + </label>
20 30 </div>
21 31 </div>
22   - <!--<div class="form-group">-->
23   - <!--<label class="col-sm-3 control-label">仓库:</label>-->
24   - <!--<div class="col-sm-8">-->
25   - <!--<select id="warehouseCode" name="warehouseCode" class="form-control" >-->
26   - <!--<option th:each="item : ${warehouseList}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['name']}"></option>-->
27   - <!--</select>-->
28   - <!--</div>-->
29   - <!--</div>-->
30 32 <div class="form-group">
31 33 <label class="col-sm-3 control-label">地址1:</label>
32 34 <div class="col-sm-8">
... ... @@ -117,14 +119,6 @@
117 119 <!--<input id="lastUpdatedBy" name="lastUpdatedBy" th:field="*{lastUpdatedBy}" class="form-control" type="text">-->
118 120 <!--</div>-->
119 121 <!--</div>-->
120   - <div class="form-group">
121   - <label class="col-sm-3 control-label">仓库:</label>
122   - <div class="col-sm-8">
123   - <label th:each="warehouse:${warehouseList}" class="checkbox-inline i-checks">
124   - <input name="warehouseCode" type="checkbox" th:checked="${warehouse.flag}" th:value="${warehouse.value}" th:text=" ${warehouse.name}" th:disabled="${warehouse.enable == false}">
125   - </label>
126   - </div>
127   - </div>
128 122 <!--<div class="form-group"> -->
129 123 <!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
130 124 <!--<div class="col-sm-8">-->
... ...
src/main/resources/templates/inventory/cycleCountDetail/add.html
... ... @@ -4,47 +4,92 @@
4 4 <head th:include="include :: header"></head>
5 5 <body class="white-bg">
6 6 <div class="container-div">
  7 + <!--<input type="hidden" id="cycleCountHeadId" name="cycleCountHeadId" th:value="${cycleCountHeadId}">-->
7 8 <div class="row">
8 9 <div class="col-sm-12 select-info">
9 10 <form id="inventory-form">
10   - <!--th:value="${cycleCountHeadCode}"-->
11   - <!--<input type="hidden" id="cycleCountHeadCode" name="cycleCountHeadCode" >-->
  11 + <input type="hidden" id="cycleCountHeadCode" name="cycleCountHeadCode" th:value="${cycleCountHeadCode}">
12 12 <div class="select-list">
13   - <ul>
14   - <li>
15   - <input type="hidden" id="cycleCountHeadCode" name="cycleCountHeadCode" th:value="${cycleCountHeadCode}" readonly="readonly"/>
16   - </li>
  13 + <ul>
17 14 <li>
18   - 仓库:<input id="warehouseCode" type="text" name="warehouseCode" th:value="${warehouseCode}" readonly="readonly" />
19   - </li>
20   - <li>
21   - 库位:<input id="locationCode" type="text" name="locationCode" />
22   - </li>
23   - <li>
24   - 容器:<input id="containerCode" type="text" name="containerCode" />
  15 + 货主编码:<input type="text" id="companyCode" name="companyCode" th:value="${companyCode}" readonly="readonly" />
25 16 </li>
  17 + <li>
  18 + 库存头ID:<input id="inventoryHeaderId" type="text" name="inventoryHeaderId"/>
  19 + </li>
  20 + <li>
  21 + 库位编号:<input id="locationCode" type="text" name="locationCode"/>
  22 + </li>
  23 + <li>
  24 + 容器编号:<input id="containerCode" type="text" name="containerCode"/>
  25 + </li>
  26 + <li>
  27 + 物料编码:<input type="text" name="materialCode"/>
  28 + </li>
  29 + <li>
  30 + 物料名称:<input type="text" name="materialName"/>
  31 + </li>
  32 + <li>
  33 + 物料规格:<input type="text" name="materialSpec"/>
  34 + </li>
  35 + <li>
  36 + 库存状态:
  37 + <select name="inventorySts" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}">
  38 + <option value="">所有</option>
  39 + <option th:each="e : ${inventoryStatus}" th:text="${e['dictLabel']}"
  40 + th:value="${e['dictValue']}"></option>
  41 + </select>
  42 + </li>
  43 + <li>
  44 + 供应商编码:<input type="text" name="supplierCode"/>
  45 + </li>
  46 + <li>
  47 + 上游单号:<input type="text" name="referCode"/>
  48 + </li>
  49 + <li>
  50 + 上游行号:<input type="text" name="referDetailId"/>
  51 + </li>
  52 + <li>
  53 + 入库编码:<input type="text" name="receiptCode"/>
  54 + </li>
  55 + <li>
  56 + 入库明细ID:<input type="text" name="receiptDetailId"/>
  57 + </li>
  58 +
  59 + <li>
  60 + 项 目 号:<input type="text" name="projectNo"/>
  61 + </li>
  62 + <li>
  63 + 批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;次:<input type="text" name="batch"/>
  64 + </li>
  65 + <li>
  66 + 批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:<input type="text" name="lot"/>
  67 + </li>
  68 +
26 69 <li class="time" style="height:30px">
27   - <label>入库时间: </label>
  70 + <label>创建时间: </label>
28 71 <input type="text" class="time-input" id="startTime" placeholder="开始时间"
29   - name="createdBegin"/>
  72 + name="params[createdBegin]"/>
30 73 <span>-</span>
31 74 <input type="text" class="time-input" id="endTime" placeholder="结束时间"
32   - name="createdEnd"/>
  75 + name="params[createdEnd]"/>
33 76 </li>
34 77 <li>
35 78 <a id="search" class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  79 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="general:inventoryHeader:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
36 80 </li>
37 81 </ul>
38 82 </div>
39   - </form>
  83 + </form>
40 84 </div>
41 85 <div class="col-sm-12 select-info">
42 86 <a class="btn btn-success btn-sm" onclick="addDetails()" style="float: left; margin-top: 12px"
43 87 shiro:hasPermission="inventory:cyclecountDetail:add">
44   - <i class="fa fa-edit" ></i>&nbsp;添加盘点库存</a>
45   - <table id="bootstrap-table" class ="table table-bordered table-hover"></table>
  88 + <i class="fa fa-edit" ></i>&nbsp;添加盘点明细</a>
  89 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
46 90 </div>
47 91 </div>
  92 +
48 93 <!--</div>-->
49 94 </div>
50 95 <div th:include="include::footer"></div>
... ... @@ -52,247 +97,117 @@
52 97 <script th:inline="javascript">
53 98 var addFlag = [[${@permission.hasPermi('inventory:cyclecountDetail:add')}]];
54 99 // var removeFlag = [[${@permission.hasPermi('inventoryHeader:inventoryHeader:remove')}]];
55   - var prefixDetail = ctx + "inventory/inventoryDetail";
  100 + var prefix = ctx + "inventory/inventoryDetail";
56 101 var prefix_cycleDetails = ctx + "inventory/cycleCountDetail";
57   - var prefix = ctx + "inventory/inventoryHeader";
58   - var report = [[${@permission.hasPermi('inventoryHeader:adjustHeader:report')}]];
59   - var datas = [[${@dict.getType('sys_normal_disable')}]];
60   - var inventoryStatus = [[${@dict.getType('inventorySts')}]];
61   - /*var status2 = [[${@dict.getType('adjustType')}]];*/
62   -
63   - $(function () {
64   - var options = {
65   - url: prefix + "/cycleCountInventoryHeader",
66   - createUrl: prefix + "/add",
67   - updateUrl: prefix + "/edit/{id}",
68   - modalName: "库存头",
  102 + var inventoryStatus=[[${@dict.getType('inventoryStatus')}]];
  103 + $(function() {
  104 + $("#bootstrap-table").bootstrapTable({
  105 + url: prefix + "/inventoryCycleCountLook",
  106 + method:"post",
  107 + contentType: "application/x-www-form-urlencoded",
  108 + cache: false, // 是否使用缓存
  109 + sortable: true, // 是否启用排序
  110 + sortStable: true, // 设置为 true 将获得稳定的排序
  111 + pagination: true, // 是否显示分页(*)
  112 + pageNumber: 1, // 初始化加载第一页,默认第一页
  113 + pageSize: 10, // 每页的记录行数(*)
  114 + pageList: [10, 25, 50], // 可供选择的每页的行数(*)
  115 + showColumns:true,
  116 + iconSize: 'outline', // 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮
  117 + toolbar: '#toolbar', // 指定工作栏
  118 + // sidePagination:"server",
  119 + showRefresh: true, // 是否显示刷新按钮
  120 + showToggle: true, // 是否显示详细视图和列表视图的切换按钮
  121 + showExport: true, // 是否支持导出文件
  122 + queryParamsType:"undefined",
  123 + queryParams: function(params){
  124 + return {
  125 + companyCode: $("#companyCode").val(),
  126 + };
  127 + },
  128 + modalName: "库存",
  129 + search: false,
69 130 sortName: "id",
70 131 sortOrder: "desc",
71   - pagination: false, //取消分页
72   - search: false,
73   - showSearch: false,
74   - showRefresh: false,
75   - showToggle: false,
76   - showColumns: false,
77   - detailView: true,
78   - onExpandRow : function(index, row, $detail) {
79   - initChildTable(index, row, $detail);
80   - },
81 132 columns: [
82 133 {
83 134 checkbox: true
84 135 },
85   - {
86   - field: 'id',
87   - title: '库存头ID',
88   - sortable: true
89   - },
90   - {
91   - field: 'warehouseCode',
92   - title: '仓库 ',
93   - visible: true
94   - },
95   - {
96   - field: 'companyCode',
97   - title: ' 货主',
98   - visible: true
99   - },
100   - {
101   - field: 'locationCode',
102   - title: '库位 '
103   - },
104   - {
105   - field: 'containerCode',
106   - title: ' 容器'
107   - },
108   - {
109   - field: 'containerStatus',
110   - title: ' 容器状态',
111   - visible: false
112   - },
113   - {
114   - field: 'totalWeight',
115   - title: ' 总重量'
116   - },
117   - {
118   - field: 'materialSkuQty',
119   - title: ' 商品种类数',
120   - visible: false
121   - },
122   - {
123   - field: 'totalQty',
124   - title: ' 总数'
125   - },
126   - {
127   - field: 'totalLines',
128   - title: '总行',
129   - visible: false
130   - },
131 136 /*{
132   - field: 'projectNos',
133   - title: ' 项目号列表',
134   - visible: false
135   - },
136   - {
137   - field: 'batchs',
138   - title: ' 批次列表'
139   - },
140   - {
141   - field: 'lots',
142   - title: ' 批号列表',
143   - visible: false
144   - },*/
145   - {
146   - field: 'locking',
147   - title: ' 锁定',
148   - visible: true
149   - },
150   - {
151   - field: 'lockRemark',
152   - title: ' 锁定备注',
153   - visible: false
154   - },
155   - {
156   - field: 'created',
157   - title: ' 创建时间'
158   - },
159   - {
160   - field: 'createdBy',
161   - title: ' 创建用户'
162   - },
163   - {
164   - field: 'lastUpdated',
165   - title: ' 更新时间',
166   - visible: false
167   - },
168   - {
169   - field: 'lastUpdatedBy',
170   - title: ' 更新用户',
171   - visible: false
172   - },
173   - {
174   - field: 'userDef1',
175   - title: ' 自定义字段1',
176   - visible: false
177   - },
178   - {
179   - field: 'userDef2',
180   - title: ' 自定义字段2',
181   - visible: false
182   - },
183   -
184   - /*{
185   - field: 'enable',
186   - title: '状态',
  137 + title: '操作',
187 138 align: 'center',
188   - formatter: function (value, row, index) {
189   - return $.table.selectDictLabel(datas, value);
  139 + formatter: function(value, row, index) {
  140 + var actions = [];
  141 + actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="#" onclick="addDetail(\'' + row.id + '\')"><i class="fa fa-edit"></i>添加盘点明细</a> ');
  142 + // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
  143 + return actions.join('');
190 144 }
191 145 },*/
192   - ]
193   - };
194   - $.table.init(options);
195   - });
196   -
197   - //子表
198   - initChildTable = function(index, row, $detail) {
199   - let childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
200   - $(childTable).bootstrapTable({
201   - url: prefixDetail + "/inventoryCycleCountLook",
202   - method: 'post',
203   - sortName: "id",
204   - sortOrder: "desc",
205   - sidePagination: "server",
206   - contentType: "application/x-www-form-urlencoded",
207   - //页面渲染
208   - responseHandler: responseHandler,
209   - queryParams : {
210   - //传值
211   - inventoryHeaderId: row.id,
212   - warehouseCode: row.warehouseCode,
213   - },
214   -
215   - columns: [
216 146 {
217 147 field: 'id',
218   - title: '明细ID',
219   - sortable: true,
220   - width: 80
  148 + title: '库存明细ID',
  149 + sortable: true
221 150 },
222 151 {
223 152 field: 'inventoryHeaderId',
224   - title: '库存头ID',
225   - visible: false
  153 + title: '库存头ID'
226 154 },
227 155 {
228 156 field: 'locationCode',
229   - title: '库位编号',
230   - visible: false
  157 + title: '库位编号'
231 158 },
232 159 {
233 160 field: 'containerCode',
234   - title: '容器编号',
235   - visible: false
  161 + title: '容器编号'
236 162 },
237 163  
238 164 {
239 165 field: 'materialCode',
240   - title: '物料编码'
  166 + title: '存货编码'
241 167 },
242 168  
243 169 {
244 170 field: 'materialName',
245   - title: '物料名称',
246   - width: 150
  171 + title: '物料名称'
247 172 },
248 173 {
249 174 field: 'materialSpec',
250   - title: '物料规格',
251   - visible: false
  175 + title: '物料规格'
252 176 },
253 177 {
254 178 field: 'materialUnit',
255   - title: '物料单位',
256   - visible: true,
257   - width: 80
  179 + title: '物料单位'
258 180 },
259 181 {
260 182 field: 'qty',
261   - title: '数量',
262   - width: 90
  183 + title: '数量'
263 184 },
264 185 {
265 186 field: 'taskQty',
266   - title: '预定执行数量',
267   - visible: false,
268   - width: 90
  187 + title: '预定执行数量'
269 188 },
270 189 {
271 190 field: 'lockedQty',
272   - title: '冻结数量',
273   - visible: false
  191 + title: '冻结数量'
274 192 },
275 193 {
276   - field: 'receiptCode',
277   - title: '入库单编码',
278   - visible: true,
279   - width: 150
  194 + field: 'companyCode',
  195 + title: '货主编码'
280 196 },
281 197 {
282   - field: 'companyCode',
283   - title: '货主编码',
284   - width: 80
  198 + field: 'receiptCode',
  199 + title: '入库单编码'
285 200 },
286 201 {
287 202 field: 'receiptDetailId',
288 203 title: '入库单明细ID',
289   - visible: false
  204 + visible: true
290 205 },
291 206 {
292 207 field: 'batch',
293 208 title: '批次',
294 209 sortable: false,
295   - visible: true
  210 + visible: false
296 211 },
297 212 {
298 213 field: 'lot',
... ... @@ -303,13 +218,12 @@
303 218 {
304 219 field: 'projectNo',
305 220 title: '项目号',
306   - visible: false,
307 221 sortable: true
308 222 },
309 223 {
310 224 field: 'supplierCode',
311 225 title: '供应商编码',
312   - visible: false
  226 + visible: true
313 227 },
314 228 {
315 229 field: 'manufactureDate',
... ... @@ -329,29 +243,24 @@
329 243 align: 'center',
330 244 formatter: function (value, row, index) {
331 245 return $.table.selectDictLabel(inventoryStatus, value);
332   - },
333   - visible: false
  246 + }
334 247 },
335 248  
336 249 {
337 250 field: 'referCode',
338   - title: '上游单号',
339   - visible: false
  251 + title: '上游单号'
340 252 },
341 253 {
342 254 field: 'referDetailId',
343   - title: '上游单号行号',
344   - visible: false
  255 + title: '上游单号行号'
345 256 },
346 257 {
347 258 field: 'qcCheck',
348   - title: '质检',
349   - visible: false
  259 + title: '质检'
350 260 },
351 261 {
352 262 field: 'weight',
353   - title: '重量',
354   - visible: false
  263 + title: '重量'
355 264 },
356 265 {
357 266 field: 'attributeId',
... ... @@ -376,8 +285,6 @@
376 285 {
377 286 field: 'lockCode',
378 287 title: '锁',
379   - visible: false,
380   - width: 110
381 288 },
382 289 {
383 290 field: 'lastCycleCountDate',
... ... @@ -388,30 +295,34 @@
388 295 {
389 296 field: 'created',
390 297 title: '入库日期',
391   - sortable: true,
392   - visible: true,
393   - width: 150
  298 + sortable: true
394 299 },
395 300 {
396 301 field: 'createdBy',
397 302 title: '创建用户',
398   - visible: true,
399   - width: 120
  303 + visible: false
400 304 },
401 305 {
402 306 field: 'lastUpdated',
403 307 title: '最后修改时间',
404   - sortable: true,
405   - visible: false
  308 + sortable: true
406 309 },
407 310 {
408 311 field: 'lastUpdatedBy',
409   - title: '更新用户',
410   - visible: false
  312 + title: '更新用户'
411 313 },
412 314 ]
413 315 });
414   - };
  316 +
  317 + });
  318 +
  319 + function addDetail(id) {
  320 + /*var ids =[];
  321 + rows.forEach(function (item) {
  322 + ids.push(item.id);
  323 + });*/
  324 + addInner($('#cycleCountHeadCode').val(),id);
  325 + }
415 326  
416 327 function addDetails() {
417 328 var rows=$("#bootstrap-table").bootstrapTable('getSelections');
... ... @@ -419,13 +330,13 @@
419 330 $.modal.alertWarning("请选择库存明细!");
420 331 return;
421 332 }
422   - $.modal.loading("正在处理,请稍后...");
423 333 var ids =[];
424 334 rows.forEach(function (item) {
425 335 ids.push(item.id);
426 336 });
427 337 addInner($('#cycleCountHeadCode').val(),ids.join(','));
428 338 }
  339 +
429 340 function addInner(cycleCountHeadCode,ids) {
430 341 $.ajax({
431 342 cache : true,
... ... @@ -433,23 +344,19 @@
433 344 url : prefix_cycleDetails + "/add",
434 345 data:{
435 346 cycleCountHeadCode:cycleCountHeadCode,
436   - inventoryHeaderIds:ids
  347 + inventoryDetailIds:ids
437 348 },
438   - async : true,
  349 + async : false,
439 350 error : function(request) {
440 351 $.modal.alertError("请求失败!");
441 352 },
442 353 success : function(data) {
443 354 if(data.code=="200"){
444   - $.modal.closeLoading();
445   - $.modal.alertSuccess("添加盤點成功");
446   - $.table.refresh();
  355 + $.modal.alertSuccess("成功");
  356 + parent.$.table.refresh();
447 357 }else{
448   - $.modal.closeLoading();
449   - $.modal.alertError(data.msg);
450   - $.table.refresh();
  358 + $.modal.alertError(data.msg)
451 359 }
452   - parent.$.table.refresh();
453 360 }
454 361 })
455 362 }
... ... @@ -462,16 +369,6 @@
462 369 }
463 370 return true;
464 371 }
465   -
466   - function responseHandler(res) {
467   - if (res.code == 200) {
468   - return { rows: res.data, total: res.total, code: 0};
469   - } else {
470   - $.modal.alertWarning(res.msg);
471   - return { rows: [], total: 0 };
472   - }
473   - }
474   -
475 372 </script>
476 373  
477 374 </body>
... ...
src/main/resources/templates/inventory/cycleCountHeader/add.html
... ... @@ -14,37 +14,32 @@
14 14 </select>
15 15 </div>
16 16 </div>
17   - <div class="form-group">
18   - <label class="col-sm-3 control-label">盘点方式:</label>
19   - <div class="col-sm-8">
20   - <select id = "preferenceCode" name="preferenceCode" class="form-control" th:with="modes=${@cycleCountPreferenceService.selectCycleCountPreferenceList()}">
21   - <option th:each="item : ${modes}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option>
22   - </select>
23   - </div>
24   - </div>
25   -
26   - <!-- <div class="form-group">
27   - <label class="col-sm-3 control-label">货主:</label>
28   - <div class="col-sm-8">
29   - <select id = "companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.selectCompanyByCurrentUserId()}">
30   - <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option>
31   - </select>
32   - </div>
33   - </div>-->
34   -
35 17 <div class="form-group">
36 18 <label class="col-sm-3 control-label">原始盘点内部号:</label>
37 19 <div class="col-sm-8">
38 20 <input id="countOrderId" name="countOrderId" class="form-control" type="text">
39 21 </div>
40 22 </div>
41   - <!--<div class="form-group">
  23 + <div class="form-group">
42 24 <label class="col-sm-3 control-label">盘点轮次:</label>
43 25 <div class="col-sm-8">
44 26 <input id="round" name="round" class="form-control" type="text">
45 27 </div>
46   - </div>-->
47   - <!--<div class="form-group">
  28 + <!--th:checked="true" 状态按钮默认为启用 $("input[name='enable']").is(':checked')-->
  29 + <!--<div>-->
  30 + <!--<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">-->
  31 + <!--</div>-->
  32 + </div>
  33 + <div class="form-group">
  34 + <label class="col-sm-3 control-label">货主:</label>
  35 + <div class="col-sm-8">
  36 + <select id = "companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.selectCompanyByCurrentUserId()}">
  37 + <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option>
  38 + </select>
  39 + </div>
  40 + </div>
  41 +
  42 + <div class="form-group">
48 43 <label class="col-sm-3 control-label">总货位数:</label>
49 44 <div class="col-sm-8">
50 45 <input id="totalLocs" name="totalLocs" class="form-control" type="text">
... ... @@ -55,10 +50,8 @@
55 50 <div class="col-sm-8">
56 51 <input id="totalItems" name="totalItems" class="form-control" type="text">
57 52 </div>
58   - </div>-->
59   -
60   -
61   - <!--<div class="form-group">
  53 + </div>
  54 + <div class="form-group">
62 55 <label class="col-sm-3 control-label">指定区域:</label>
63 56 <div class="col-sm-8">
64 57 <input id="zoneCode" name="zoneCode" class="form-control" type="text">
... ... @@ -69,7 +62,7 @@
69 62 <div class="col-sm-8">
70 63 <input id="locationFilter" name="locationFilter" class="form-control" type="text">
71 64 </div>
72   - </div>-->
  65 + </div>
73 66 <div class="form-group">
74 67 <label class="col-sm-3 control-label">源盘点单号:</label>
75 68 <div class="col-sm-8">
... ... @@ -77,41 +70,18 @@
77 70 </div>
78 71 </div>
79 72  
80   - <div class="form-group">
81   - <label class="col-sm-3 control-label">备注:</label>
82   - <div class="col-sm-8">
83   - <input id="remark" name="remark" class="form-control" type="text">
84   - </div>
85   - </div>
86   -
87   - <div class="form-group">
88   - <label class="col-sm-3 control-label">抽盘范围(单位 %):</label>
89   - <div class="col-sm-8">
90   - <input id="range" name="range" class="form-control" type="text" placeholder="选择抽盘时,请输入1-100内整数数字"
91   - onkeyup="this.value= this.value.replace(/[^0-9]/g,'')">
92   - </div>
93   - </div>
94   - <!--th:checked="true" 状态按钮默认为启用 $("input[name='enable']").is(':checked')-->
95   - <!--<div class="form-group">
96   - <label class="col-sm-3 control-label">是否明盘:</label>
97   - <div class="col-sm-8">
98   - <div class="onoffswitch">
99   - <input type="checkbox" th:checked="false" class="onoffswitch-checkbox" id="types"
100   - name="types">
101   - <label class="onoffswitch-label" for="types">
102   - <span class="onoffswitch-inner"></span>
103   - <span class="onoffswitch-switch"></span>
104   - </label>
105   - </div>
106   - </div>
107   - </div>-->
108   -
109 73 <!--<div class="form-group">
110 74 <label class="col-sm-3 control-label">原始盘点内部号:</label>
111 75 <div class="col-sm-8">
112 76 <input id="countOrderId" name="remark" class="form-control" type="text">
113 77 </div>
114 78 </div>-->
  79 + <div class="form-group">
  80 + <label class="col-sm-3 control-label">备注:</label>
  81 + <div class="col-sm-8">
  82 + <input id="remark" name="remark" class="form-control" type="text">
  83 + </div>
  84 + </div>
115 85  
116 86 <div class="form-group">
117 87 <div class="form-control-static col-sm-offset-9">
... ... @@ -146,13 +116,10 @@
146 116 },
147 117 submitHandler: function(form) {
148 118 var tableValue = $("#form-cycleCountHeader-add").serialize();
149   - //var tableValue = $.common.getTableValue("#form-cycleCountHeader-add");
150   - //tableValue = formValueReplace(tableValue, "types", $("input[name='types']").is(':checked'));
151   - /* tableValue = formValueReplace(tableValue, "enable", true);
152   - tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val());
153   - tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code"));
154   - */
155   - $.operate.save(prefix + "/add", tableValue);
  119 + // tableValue = formValueReplace(tableValue, "enable", true);
  120 + // tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val());
  121 + // tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code"));
  122 + $.operate.save(prefix + "/add", tableValue);
156 123 }
157 124 });
158 125 </script>
... ...