Commit 8aa7fe616c67ba61c8e0e2de18eee7b3cd6f5622

Authored by tongzhonghao
2 parents 455051cd daed96b6

Merge remote-tracking branch 'origin/develop' into develop

src/main/java/com/huaheng/common/utils/DataUtils.java
... ... @@ -9,6 +9,7 @@ import java.math.BigDecimal;
9 9 import java.net.URLEncoder;
10 10 import java.text.ParseException;
11 11 import java.text.SimpleDateFormat;
  12 +import java.util.Calendar;
12 13 import java.util.Date;
13 14 import java.util.Map;
14 15  
... ... @@ -159,82 +160,6 @@ public class DataUtils {
159 160 return String.valueOf(reslut);
160 161 }
161 162  
162   -// /**
163   -// * 根据传过来实体类,自动拼接查询Condition,如果是字符类型就用LIKE查询,如果是日期类型就用>=或是<=,其他的用=
164   -// * @param entityClass
165   -// * @return
166   -// * @throws Exception
167   -// */
168   -// public static <T> Condition createCondition (T entityClass) throws Exception {
169   -// Condition condition = new Condition(entityClass.getClass());
170   -// Field[] fields = entityClass.getClass().getDeclaredFields();
171   -// Field.setAccessible(fields, true);
172   -// for (int i = 0; i < fields.length; i++) {
173   -// String filedName = fields[i].getName();
174   -// Object filedValue = fields[i].get(entityClass);
175   -// if (filedValue != null && filedValue.toString().length() > 0) {
176   -// if (filedValue.getClass() == String.class) {
177   -// condition.and().andLike(filedName, "%" + filedValue.toString() + "%");
178   -// } else if(filedValue.getClass() == Date.class){
179   -// if (filedName.startsWith("begin") || filedName.startsWith("create")) {
180   -// condition.and().andGreaterThanOrEqualTo(filedName, filedValue);
181   -// }else if (filedName.startsWith("end")|| filedName.startsWith("update")){
182   -// condition.and().andLessThanOrEqualTo(filedName, filedValue);
183   -// }
184   -// } else {
185   -// condition.and().andEqualTo(filedName, filedValue);
186   -// }
187   -// }
188   -// }
189   -// return condition;
190   -// }
191   -
192   -// /**
193   -// * 根据传过来实体类,自动拼接查询Example,如果是字符类型就用LIKE查询,如果是日期类型就用>=或是<=,其他的用=
194   -// * @param entity 实体
195   -// * @param example 需要生成的Example
196   -// * @param <T> 实体类型
197   -// * @param <V> Example类型
198   -// * @throws Exception
199   -// */
200   -// public static <T, V> void createCriteria (T entity, V example) throws Exception {
201   -// Field[] entityFields = entity.getClass().getDeclaredFields();
202   -// Field.setAccessible(entityFields, true);
203   -// Object criteria = example.getClass().getDeclaredMethod("createCriteria").invoke(example);
204   -// Method[] exampleMethod = criteria.getClass().getDeclaredMethods();
205   -// for (int i = 0; i < entityFields.length; i++) {
206   -// String filedName = entityFields[i].getName();
207   -// Object filedValue = entityFields[i].get(entity);
208   -// if (filedName.equals("deleted")) filedValue = false;
209   -// if (filedName.equals("warehouseCode")) filedValue = ShiroUtils.getWarehouseCode();
210   -// if (filedValue != null && filedValue.toString().length() > 0) {
211   -// String methodName = null;
212   -// if (filedValue.getClass() == Integer.class || filedValue.getClass() == Boolean.class || filedName.equals("warehouseCode"))
213   -// {
214   -// methodName = ConvertMethodName(filedName, "EqualTo");
215   -// }
216   -// else if (filedValue.getClass() == String.class)
217   -// {
218   -// methodName = ConvertMethodName(filedName, "Like");
219   -// filedValue = filedValue.toString() + "%";
220   -// }
221   -// else if(filedValue.getClass() == Date.class)
222   -// {
223   -// if (filedName.startsWith("begin") || filedName.startsWith("create")) {
224   -// methodName = ConvertMethodName(filedName, "GreaterThanOrEqualTo");
225   -// }else if (filedName.startsWith("end")|| filedName.startsWith("update")){
226   -// methodName = ConvertMethodName(filedName, "andAddress1LessThanOrEqualTo");
227   -// }
228   -// }
229   -// for (Method itemMethod : exampleMethod)
230   -// {
231   -// if (itemMethod.getName().equals(methodName)) {
232   -// itemMethod.invoke(criteria, filedValue);
233   -// }
234   -// }
235   -// }
236   -// }
237   -// }
238 163  
239 164 /**
240 165 *
... ... @@ -259,6 +184,29 @@ public class DataUtils {
259 184 return result;
260 185 }
261 186  
  187 + /**
  188 + *再生批号 addOne为0则是昨天得
  189 + * @param pre 前缀
  190 + * addOne 1自动加1,0不加
  191 + * @return
  192 + */
  193 + public static String createSerialNumberForRegenerationCode(String pre,int addOne){
  194 + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
  195 + String result=null;
  196 + Date date=new Date();
  197 + String datestr=format.format(date);
  198 + Calendar c = Calendar.getInstance();
  199 + c.add(Calendar.DATE, -1);
  200 + Date start = c.getTime();
  201 + String qyt= format.format(start);//前一天
  202 + if(addOne==1){
  203 + result=pre+datestr;
  204 + }else{
  205 + result=pre+qyt;
  206 + }
  207 + return result;
  208 + }
  209 +
262 210 public static void main(String[] args) {
263 211 System.out.println(createSerialNumber("P1","CGRKD2022042700001",1));
264 212 }
... ...
src/main/java/com/huaheng/pc/barcode/barcodeDetail/service/BarCodeDetailService.java
... ... @@ -172,17 +172,8 @@ public class BarCodeDetailService extends ServiceImpl&lt;BarCodeDetailMapper, BarCo
172 172 * @return
173 173 */
174 174 public AjaxResult createRegenerationCode(int status){
175   - LambdaQueryWrapper<BarCodeDetail> receiptDetailWrapper = Wrappers.lambdaQuery();
176   - receiptDetailWrapper.select(BarCodeDetail::getRegenerationCode);
177   - receiptDetailWrapper.orderByDesc(BarCodeDetail::getRegenerationCode).last("Limit 1");
178   - BarCodeDetail detail=this.getOne(receiptDetailWrapper);
179   - String maxCode="0";
180   - if(null!=detail){
181   - maxCode=detail.getRegenerationCode();
182   - }
183   - String result= DataUtils.createSerialNumber("P1",maxCode,status);
184   -
185   - return AjaxResult.success(result);
  175 + String result= DataUtils.createSerialNumberForRegenerationCode("P1",status);
  176 + return AjaxResult.success("操作成功",result);
186 177 }
187 178  
188 179 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... ... @@ -534,6 +534,7 @@ public class ReceiptTaskService {
534 534 .eq(InventoryDetail::getLocationCode, inventoryHeader.getLocationCode())
535 535 .eq(InventoryDetail::getMaterialCode, taskDetail.getMaterialCode())
536 536 .eq(InventoryDetail::getContainerCode, inventoryHeader.getContainerCode())
  537 + .eq(InventoryDetail::getBatteryPackTwoCode, taskDetail.getBatteryPackTwoCode())
537 538 .eq(InventoryDetail::getCompanyCode, taskDetail.getCompanyCode())
538 539 .eq(InventoryDetail::getBatch,taskDetail.getBatch());
539 540 InventoryDetail inventoryDetail = inventoryDetailService.getOne(inventory);
... ... @@ -563,7 +564,7 @@ public class ReceiptTaskService {
563 564 inventoryDetail.setZoneCode(inventoryHeader.getZoneCode());
564 565 inventoryDetail.setCompanyCode(taskDetail.getCompanyCode());
565 566 inventoryDetail.setLocationCode(task.getToLocation());
566   - inventoryDetail.setContainerCode(taskDetail.getContainerCode());
  567 + inventoryDetail.setContainerCode(task.getContainerCode());
567 568 inventoryDetail.setMaterialCode(taskDetail.getMaterialCode());
568 569 inventoryDetail.setMaterialName(taskDetail.getMaterialName());
569 570 inventoryDetail.setMaterialSpec(taskDetail.getMaterialSpec());
... ... @@ -655,6 +656,7 @@ public class ReceiptTaskService {
655 656 .eq(InventoryDetail::getMaterialCode, taskDetail.getMaterialCode())
656 657 .eq(InventoryDetail::getContainerCode, inventoryHeader.getContainerCode())
657 658 .eq(InventoryDetail::getCompanyCode, taskDetail.getCompanyCode())
  659 + .eq(InventoryDetail::getBatteryPackTwoCode,taskDetail.getBatteryPackTwoCode())
658 660 .eq(InventoryDetail::getBatch,taskDetail.getBatch())
659 661 .eq(InventoryDetail::getReceiptDetailId, taskDetail.getBillDetailId());
660 662 InventoryDetail inventoryDetail = inventoryDetailService.getOne(inventory);
... ... @@ -693,7 +695,7 @@ public class ReceiptTaskService {
693 695 inventoryDetail.setZoneCode(inventoryHeader.getZoneCode());
694 696 inventoryDetail.setCompanyCode(taskDetail.getCompanyCode());
695 697 inventoryDetail.setLocationCode(task.getToLocation());
696   - inventoryDetail.setContainerCode(taskDetail.getContainerCode());
  698 + inventoryDetail.setContainerCode(task.getContainerCode());
697 699 inventoryDetail.setMaterialCode(taskDetail.getMaterialCode());
698 700 inventoryDetail.setMaterialName(taskDetail.getMaterialName());
699 701 inventoryDetail.setMaterialSpec(taskDetail.getMaterialSpec());
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -379,7 +379,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
379 379 return AjaxResult.error("库位非空闲状态");
380 380 }
381 381 if(StringUtils.isNotEmpty(location.getContainerCode())){
382   - return AjaxResult.error("库位已有货物");
  382 + //补充入库
  383 + task.setContainerCode(location.getContainerCode());
  384 + task.setTaskType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT);
  385 + //修改组盘表容器
  386 + ReceiptContainerHeader receiptContainerHeader=receiptContainerHeaderService.getById(task.getAllocationHeadId());
  387 + receiptContainerHeader.setContainerCode(location.getContainerCode());
  388 + receiptContainerHeaderService.updateById(receiptContainerHeader);
  389 + //return AjaxResult.error("库位已有货物");
383 390 }
384 391 }else{
385 392 return AjaxResult.error("库位不存在");
... ... @@ -430,13 +437,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
430 437 case QuantityConstant.TASK_TYPE_WHOLERECEIPT:
431 438 case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT:
432 439 ajaxResult = receiptTaskService.completeReceiptTask(task);
433   - //combineInventory(task);
  440 + combineInventory(task);
434 441 break;
435 442 //整盘出库、分拣出库
436 443 case QuantityConstant.TASK_TYPE_WHOLESHIPMENT:
437 444 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT:
438 445 ajaxResult = shipmentTaskService.completeShipmentTask(task);
439   - //combineInventory(task);
  446 + combineInventory(task);
440 447 break;
441 448 //空托入库
442 449 case QuantityConstant.TASK_TYPE_EMPTYRECEIPT:
... ... @@ -639,6 +646,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
639 646 && inventoryDetail.getBatch().equals(inventoryDetail2.getBatch())
640 647 && inventoryDetail.getLot().equals(inventoryDetail2.getLot())
641 648 && inventoryDetail.getProjectNo().equals(inventoryDetail2.getProjectNo())) {
  649 + //避免equals左右两边都为空报错,有一方不为空,两边不相等则continue
  650 + if(StringUtils.isNotEmpty(inventoryDetail.getBatteryPackTwoCode())
  651 + ||StringUtils.isNotEmpty(inventoryDetail2.getBatteryPackTwoCode())){
  652 + if(!inventoryDetail.getBatteryPackTwoCode().equals(inventoryDetail2.getBatteryPackTwoCode())){
  653 + continue;
  654 + }
  655 + }
642 656 BigDecimal totalQty = inventoryDetailList.get(i).getQty().add(inventoryDetailList.get(j).getQty());
643 657 inventoryDetailList.get(i).setQty(totalQty);
644 658 LambdaQueryWrapper<InventoryDetail> wrapper = Wrappers.lambdaQuery();
... ...
src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml
... ... @@ -69,6 +69,7 @@
69 69 <result column="storageType" jdbcType="VARCHAR" property="storageType" />
70 70 <result column="type" jdbcType="VARCHAR" property="type" />
71 71 <result column="batteryPath" jdbcType="VARCHAR" property="batteryPath" />
  72 + <result column="poundCode" jdbcType="VARCHAR" property="poundCode" />
72 73  
73 74 </resultMap>
74 75 <sql id="Base_Column_List">
... ...
src/main/resources/static/js/websocket.js
... ... @@ -17,7 +17,7 @@ function connect() {
17 17 stompClient = Stomp.over(socket);
18 18 stompClient.connect({}, function (frame) {
19 19 setConnected(true);
20   - console.log('Connected: ' + frame);
  20 + //console.log('Connected: ' + frame);
21 21 stompClient.subscribe('/topic/message', function (greeting) {
22 22 // showGreeting(JSON.parse(greeting.body).content);
23 23 showGreeting(greeting.body);
... ... @@ -34,7 +34,7 @@ function disconnect() {
34 34 stompClient.disconnect();
35 35 }
36 36 setConnected(false);
37   - console.log("Disconnected");
  37 + //console.log("Disconnected");
38 38 }
39 39  
40 40 function sendName() {
... ...
src/main/resources/templates/barcode/barCodeDetail/edit.html
... ... @@ -172,7 +172,7 @@
172 172 },
173 173 success : function(result) {
174 174 if (result.code == web_status.SUCCESS) {
175   - $("#regenerationCode").val(result.msg);
  175 + $("#regenerationCode").val(result.data);
176 176 }
177 177 }
178 178 });
... ...
src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
... ... @@ -113,6 +113,8 @@
113 113 var batteryPackType = [[${@dict.getType('batteryPackType')}]];
114 114 var batteryTypes = [[${@dict.getType('batteryTypes')}]];
115 115 var supplier =[[${@SupplierService.getCode()}]];
  116 + var completeness = [[${@dict.getType('completeness')}]];
  117 +
116 118 $(function () {
117 119 update();
118 120 });
... ... @@ -184,7 +186,25 @@
184 186 field: 'materialCode',
185 187 title: '物料编码'
186 188 },
187   -
  189 + {
  190 + field : 'batteryPackTwoCode',
  191 + title : '电池包二维码'
  192 + },
  193 + {
  194 + field : 'supplierCode',
  195 + title : '供应商',
  196 + align: 'center',
  197 + formatter: function(value, row, index) {
  198 + var actions = [];
  199 + $.each(supplier, function(index, dict) {
  200 + if (dict.code == value) {
  201 + actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
  202 + return false;
  203 + }
  204 + });
  205 + return actions.join('');
  206 + }
  207 + },
188 208 {
189 209 field: 'materialName',
190 210 title: '物料名称'
... ... @@ -284,8 +304,11 @@
284 304 visible: false
285 305 },
286 306 {
287   - field : 'batteryPackTwoCode',
288   - title : '电池包二维码'
  307 + field : 'completeness',
  308 + title : '完整程度',
  309 + formatter: function(value, row, index) {
  310 + return $.table.selectDictLabel(completeness, value);
  311 + }
289 312 },
290 313 {
291 314 field : 'batteryTypes',
... ... @@ -318,21 +341,7 @@
318 341 // field: 'supplierCode',
319 342 // title: '供应商编码',
320 343 // },
321   - {
322   - field : 'supplierCode',
323   - title : '供应商',
324   - align: 'center',
325   - formatter: function(value, row, index) {
326   - var actions = [];
327   - $.each(supplier, function(index, dict) {
328   - if (dict.code == value) {
329   - actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
330   - return false;
331   - }
332   - });
333   - return actions.join('');
334   - }
335   - },
  344 +
336 345 {
337 346 field: 'manufactureDate',
338 347 title: '生产日期',
... ...
src/main/resources/templates/receipt/receiving/receiving-.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 +<style>
  6 + .table-striped-left{
  7 + width: 41%;
  8 + /*margin-right: 4px;*/
  9 + }
  10 + .table-striped-right{
  11 + /*right: -10px;*/
  12 + width: 58%;
  13 + float: right;
  14 + }
  15 + .info_text{
  16 + float: right;
  17 + }
  18 + .info_text li{
  19 + font-size: 16px;
  20 + }
  21 + .info_text li span{
  22 + font-size: 20px;
  23 + font-weight: bold;
  24 + color: rgb(28,132,198);
  25 + }
  26 + /* 缩略图 */
  27 + #my_thumbnail{
  28 + height: 85px;
  29 + overflow-x: auto;
  30 + border: 1px solid blue;
  31 + }
  32 + #my_thumbnail img{
  33 + margin: 0 5px;
  34 + }
  35 +
  36 + element.style {
  37 + width: 50%;
  38 + }
  39 + .table-striped-right .select-list li{
  40 + width:47%;
  41 + float:left;
  42 + }
  43 +
  44 + .select-list li select {
  45 + border: 1px solid #ddd;
  46 + border-radius: 4px;
  47 + background: transparent;
  48 + outline: none;
  49 + font-size:13px;
  50 + height: 30px;
  51 + width: 200px;
  52 + /*margin-left:4px;
  53 + margin-top:6px;*/
  54 + display:inline-block;
  55 + vertical-align:middle;
  56 + }
  57 + .selectClass{
  58 + margin-top:0px;
  59 + display:inline-block;
  60 +
  61 + vertical-align:middle;
  62 + }
  63 +</style>
  64 +<body class="gray-bg">
  65 +<div class="container-div">
  66 +
  67 + <div class="row">
  68 + <div class="col-sm-12 select-info">
  69 + <form id="dept-form">
  70 + <div class="select-list">
  71 + <div id="divhtml">
  72 + </div>
  73 + <ul>
  74 + <li>
  75 + 收货单号:<input type="text" id="code" name="deptName"/>
  76 + </li>
  77 + <li>
  78 + <a class="btn btn-primary btn-rounded btn-sm" id="list-btn"><i class="fa fa-search"></i>&nbsp;搜索</a>
  79 + </li>
  80 + </ul>
  81 + <ul class="info_text">
  82 + <li>物料总数:<span id="material_length"></span></li>
  83 + <li>总单据数量:<span id="qty_length"></span></li>
  84 + <li>已收货数量:<span id="qtyCompleted_length"></span></li>
  85 + </ul>
  86 + </div>
  87 + </form>
  88 + </div>
  89 +
  90 + <div class="col-sm-12 select-info table-striped-left" style="padding-top: 20px;">
  91 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
  92 + </div>
  93 + <div class="col-sm-12 select-info table-striped-right">
  94 + <div>
  95 + <button class="btn btn-danger" onclick="receipt()">组&nbsp&nbsp&nbsp盘</button>
  96 +
  97 + </div>
  98 + <ul class="select-list">
  99 + <input type="text" id="materialCode" hidden/>
  100 + <li style="display: none">id:<input type="text" id="detailId"/></li>
  101 + <!--<select id="area" name="batteryType" class="form-control" type="text">
  102 + <option value="1">库区A</option>
  103 + <option value="2">库区B</option>
  104 + <option value="3">库区C</option>
  105 + <option value="4">库区D</option>
  106 + <option value="5">库区E</option>
  107 + </select>-->
  108 + <li >收货数量:<input type="text" id="receiveNum"/></li>
  109 + <!-- <li>收货重量:<input type="text" id="receiveWeight"/></li>-->
  110 + <li hidden>容器编号:<input type="text" id="containerCode"/></li>
  111 + <li hidden>库位编码:<input type="text" id="locationCoder"/></li>
  112 + <li id="barhidden">&nbsp;&nbsp;成品托盘号:<input type="text" id="barCodeHeaderCode" readonly style="width: 50%"/>
  113 + <input type="hidden" id="barCodeHeaderId" />
  114 + <button class="btn btn-sm btn-success" onclick="selectCode()">请选择</button>
  115 + </li>
  116 +
  117 + <div id="batteryHidden" hidden>
  118 + <li ><span class="selectClass">电池包类型:</span>
  119 + <select id="batteryPackType" name="batteryPackType" class="form-control" th:with="batteryPackType=${@dict.getType('batteryPackType')}" placeholder="电池类必填">
  120 + <option value="">--请选择--</option>
  121 + <option th:each="dict : ${batteryPackType}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  122 + </select>
  123 + <!--电池包类型:<input type="text" id="batteryPackType" placeholder="电池类必填"/></li>-->
  124 + </li>
  125 + <li >
  126 + <span class="selectClass">电池类型:</span>
  127 + <select id="batteryTypes" name="batteryTypes" class="form-control" placeholder="电池类必填">
  128 + <option value="">--请选择--</option>
  129 + <option value="1">电池包</option>
  130 + <option value="2">电池模块</option>
  131 + <option value="3">电池单体</option>
  132 + </select>
  133 + </li>
  134 + <li >
  135 + <span class="selectClass">完整程度:</span>
  136 + <select id="completeness" name="completeness" class="form-control" th:with="completeness=${@dict.getType('completeness')}">
  137 + <option value="">--请选择--</option>
  138 + <option th:each="dict : ${completeness}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  139 + </select>
  140 + </li>
  141 + <li >
  142 + <span class="selectClass">利用类型:</span>
  143 + <select id="storageType" name="storageType" class="form-control" placeholder="电池类必填">
  144 + <option value="">--请选择--</option>
  145 + <option value="0">再生利用</option>
  146 + <option value="1">梯次利用</option>
  147 + </select>
  148 + </li>
  149 + <li >
  150 + <span class="selectClass">再生利用类型:</span>
  151 + <select id="type" name="type" class="form-control" placeholder="电池类必填">
  152 + <option value="">--请选择--</option>
  153 + <option value="1">废旧动力蓄电池</option>
  154 + <option value="2">次品动力蓄电池</option>
  155 + <option value="3">其他领域废旧电池</option>
  156 + </select>
  157 + </li>
  158 + <li>回收人:<select type="text" id="recycler" th:with="completeness=${@UserServiceImpl.getRecover()}">
  159 + <option th:each="dict : ${completeness}" th:text="${dict.userName}" th:value="${dict.userName}"></option>
  160 + </select></li>
  161 + <li>电量:<input type="text" id="electricQuantity" placeholder="电池类必填"/></li>
  162 + <li>皮重:<input type="text" id="materialTareWeight"/><button class="btn btn-sm btn-success" onclick="getWeight()">取重</button></li>
  163 + <li>毛重:<input type="text" id="materialGrossWeight"/><button class="btn btn-sm btn-success" onclick="getWeight()">取重</button></li>
  164 + <li>净重:<input type="text" id="materialNetWeight"/></li>
  165 + <!--<li>回收人:<input type="text" id="recycler"/></li>-->
  166 + <li>国家编码:<input type="text" id="countryCode" placeholder="国家编码"/></li>
  167 + <li>备注:<input type="text" id="remark" placeholder="备注"/></li>
  168 + <li style="width:20%" hidden>
  169 + <button id="plc" name="plc" class="btn btn-danger btn-sm" type="button">电池拍照</button>
  170 + </li>
  171 + <!--<div class="form-group" style="width:300px;white-space: nowrap">
  172 + <img id="camera" name="camera" src="" width="300px" height="200px"/>
  173 + </div>
  174 + <div class="form-group" style="width:150px;margin: 0 auto;">
  175 + <button id="plc" name="plc" class="btn btn-danger" type="button">电池拍照</button>
  176 + </div>-->
  177 + <!--<li>
  178 + <img id="camera" name="camera" src="" width="300px" height="200px"/>
  179 + </li>
  180 +
  181 + <li>
  182 + <div id="my_thumbnail" style="width:150px;height:150px;margin-left: 10px;margin-top:5px;">
  183 + </div>
  184 + </li>-->
  185 +
  186 +
  187 + <!--完整程度:<input type="text" id="completeness" placeholder="电池类必填"/></li>-->
  188 + <!--<li>电池个数:<input type="text" id="batteryQty"/></li>-->
  189 +
  190 + </div>
  191 +
  192 + </ul>
  193 + <div class="btn-group hidden-xs" id="toolbar1" role="group">
  194 + <!-- <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()"-->
  195 + <!-- shiro:hasPermission="receipt:receiptDetail:add">-->
  196 + <!-- <i class="fa fa-map-pin"></i> 定位-->
  197 + <!-- </a>-->
  198 + <!-- <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()"-->
  199 + <!-- shiro:hasPermission="receipt:receiptDetail:remove">-->
  200 + <!-- <i class="fa fa-times"></i> 取消定位-->
  201 + <!-- </a>-->
  202 + <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"
  203 + shiro:hasPermission="receipt:receiptDetail:remove">
  204 + <i class="fa fa-trash-o"></i> 取消收货
  205 + </a>
  206 + <a class="btn btn-outline btn-warning btn-rounded" onclick="createTask()"
  207 + shiro:hasPermission="receipt:receiptContainer:add">
  208 + <i class="fa fa-edit"></i> 生成任务
  209 + </a>
  210 + <a class="btn btn-outline btn-primary btn-rounded" href="/wms/task/taskHeader?InternalTaskType=100">
  211 + <i class="fa fa-edit"></i> 跳转任务
  212 + </a>
  213 + <a class="btn btn-outline btn-primary btn-rounded" onclick="batteryPackagePrints()">
  214 + <i class="fa fa-edit"></i> 电池包打印
  215 + </a>
  216 + </div>
  217 +
  218 + <table id="bootstrap-table1" data-mobile-responsive="true"
  219 + class="table table-bordered table-hover text-nowrap"></table>
  220 + <ul class="select-list top_text">
  221 + <li><span class="table-title">本物料库存</span></li>
  222 + </ul>
  223 + <table id="bootstrap-table2" data-mobile-responsive="true"
  224 + class="table table-bordered table-hover text-nowrap"></table>
  225 +
  226 + <ul class="select-list top_text">
  227 + <li>空容器类型:<select name="type" id="containerType" th:with="typeList=${@containerType.getCode()}">
  228 + <option value="">所有</option>
  229 + <option th:each="c:${typeList}" th:text="${c['name']}" th:value="${c['code']}"></option>
  230 + </select></li>
  231 + <li>
  232 + <button class="btn btn-sm btn-success" onclick="containerTypeSearch()">搜索</button>
  233 + </li>
  234 + </ul>
  235 + <table id="bootstrap-table3" data-mobile-responsive="true"
  236 + class="table table-bordered table-hover text-nowrap"></table>
  237 + </div>
  238 + </div>
  239 +
  240 +</div>
  241 +<div th:include="include :: footer"></div>
  242 +<script th:src="@{/webjars/sockjs-client/1.0.2/sockjs.min.js}"></script>
  243 +<script th:src="@{/webjars/stomp-websocket/2.3.3/stomp.min.js}"></script>
  244 +<script th:src="@{/js/websocket.js}"></script>
  245 +<th:block th:include="include :: thumbnail_customized-js" />
  246 +<script th:inline="javascript">
  247 + var addFlag = [[${@permission.hasPermi('receipt:receiving:add')}]];
  248 + var removeFlag = [[${@permission.hasPermi('receipt:receiving:remove')}]];
  249 + var prefix = ctx + "receipt/receiving";
  250 + var Types = [[${@dict.getType('taskType')}]];
  251 + var Status=[[${@dict.getType('receiptContainerHeaderStatus')}]];
  252 + var inventoryStatus =[[${@dict.getType('inventoryStatus')}]];
  253 +
  254 + connect();
  255 + $(function () {
  256 + $("#bootstrap-table3").bootstrapTable({
  257 + url: ctx+'config/container/emptyContainer',
  258 + iconSize: "outline",
  259 + modalName: "空盒",
  260 + pagination: true, // 是否显示分页(*)
  261 + pageNumber: 1,// 初始化加载第一页,默认第一页
  262 + method: 'post',
  263 + pageSize: 5, // 每页的记录行数(*)
  264 + showRefresh: true,
  265 + pageList: [10, 25, 50],
  266 + contentType: "application/x-www-form-urlencoded",
  267 + columns: [{
  268 + field : 'code',
  269 + title : '容器编号'
  270 + },{
  271 + field : 'locationCode',
  272 + title : '库位编号'
  273 + }]
  274 + });
  275 + });
  276 + /*function showGreeting(message) {
  277 + $("#greetings").append("<tr><td>" + message + "</td></tr>");
  278 + }*/
  279 + // 收货显示的数据
  280 + function list_select(code) {
  281 + $.ajax({
  282 + url: prefix + "/scanBill",
  283 + type: 'post',
  284 + datatype: 'json',
  285 + data: {
  286 + code: code
  287 + },
  288 + error:function (response) {
  289 + //console.log(response);
  290 + },
  291 + success: function (value) {
  292 + var qty_show=0;
  293 + var qtyCompleted_show=0;
  294 + $("#bootstrap-table").bootstrapTable('removeAll');
  295 + if(value.data){
  296 + for (var i = 0; i < value.data.length; i++) {
  297 + if (value.data[i].totalQty > value.data[i].openQty || value.data[i].totalWeight > value.data[i].openWeight) {
  298 + $("#bootstrap-table").bootstrapTable('insertRow', {
  299 + index: 0, row: {
  300 + projectNo:value.data[i].project,
  301 + id: value.data[i].id,
  302 + materialName: value.data[i].materialName,
  303 + receiptId: value.data[i].receiptId,
  304 + receiptCode: value.data[i].receiptCode,
  305 + materialCode: value.data[i].materialCode,
  306 + totalQty: value.data[i].totalQty,
  307 + openQty: value.data[i].openQty,
  308 + totalWeight: value.data[i].totalWeight,
  309 + openWeight: value.data[i].openWeight,
  310 + inventorySts: value.data[i].inventorySts,
  311 + materialUnit: value.data[i].materialUnit,
  312 + electricQuantity: value.data[i].electricQuantity,
  313 + batteryPackageWeight: value.data[i].batteryPackageWeight
  314 +
  315 + }
  316 + });
  317 + }
  318 + qty_show=value.data[i].totalQty + qty_show;
  319 + qtyCompleted_show=value.data[i].openQty + qtyCompleted_show;
  320 + }
  321 + $("#material_length").text(value.data.length);
  322 + $("#qty_length").text(qty_show);
  323 + $("#qtyCompleted_length").text(qtyCompleted_show);
  324 + }
  325 + else {
  326 + $.modal.alertError(value.msg)
  327 + }
  328 + }
  329 + })
  330 + }
  331 +
  332 + function list_receiptInfo(code) {
  333 + $.ajax({
  334 + url: prefix + "/getReceiptInfoByBill",
  335 + type: 'post',
  336 + datatype: 'json',
  337 + data: {
  338 + code: code
  339 + },
  340 + error:function (response) {
  341 + console.log(response);
  342 + },
  343 + success: function (value) {
  344 + $("#bootstrap-table1").bootstrapTable('removeAll');
  345 + if(value.data){
  346 + for (var i = 0; i < value.data.length; i++) {
  347 + $("#bootstrap-table1").bootstrapTable('insertRow', {
  348 + index: 0, row: {
  349 + projectNo :value.data[i].projectNo,
  350 + id: value.data[i].id,
  351 + receiptContainerId:value.data[i].receiptContainerId,
  352 + receiptDetailId:value.data[i].receiptDetailId,
  353 + containerCode: value.data[i].containerCode,
  354 + locationCode: value.data[i].locationCode,
  355 + materialCode: value.data[i].materialCode,
  356 + materialName: value.data[i].materialName,
  357 + materialSpec: value.data[i].materialSpec,
  358 + sn:value.data[i].sn,
  359 + taskType:value.data[i].taskType,
  360 + qty: value.data[i].qty,
  361 + weights: value.data[i].weights,
  362 + status: value.data[i].status,
  363 + created: value.data[i].created,
  364 + createdBy: value.data[i].createdBy,
  365 + electricQuantity: value.data[i].electricQuantity,
  366 + batteryPackTwoCode: value.data[i].batteryPackTwoCode,
  367 + materialIsBattery: value.data[i].materialIsBattery,
  368 + batteryPackageWeight: value.data[i].batteryPackageWeight
  369 + }
  370 + });
  371 + }
  372 + }
  373 + else {
  374 + console.log("没有查找到入库容器!")
  375 + }
  376 + }
  377 + })
  378 + }
  379 +
  380 + $("#list-btn").click(initTable);
  381 +
  382 + $("body").bind("keypress",function(e){
  383 + // 兼容FF和IE和Opera
  384 + var theEvent = e || window.event;
  385 + var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  386 + if (code == 13) {
  387 + e.preventDefault();
  388 + //回车执行查询
  389 + initTable();
  390 + // list_select($("#code").val());
  391 + }
  392 + });
  393 +
  394 + function initTable(){
  395 + var receiptCode=$("#code").val();
  396 + list_select(receiptCode);
  397 + list_receiptInfo(receiptCode);
  398 + $("#bootstrap-table1").bootstrapTable('removeAll');
  399 + $("#bootstrap-table2").bootstrapTable('removeAll');
  400 + }
  401 +
  402 + //点击将值赋值到文本框
  403 + $("#bootstrap-table").bootstrapTable({
  404 + // url: prefix + "/list",
  405 + createUrl: prefix + "/add",
  406 + updateUrl: prefix + "/edit/{id}",
  407 + removeUrl: prefix + "/remove",
  408 + contentType: "application/x-www-form-urlencoded",
  409 + clickToSelect: true,
  410 + modalName: "收货",
  411 + pagination: true, // 是否显示分页(*)
  412 + pageNumber: 1, // 初始化加载第一页,默认第一页
  413 + pageSize: 10, // 每页的记录行数(*)
  414 + pageList: [10, 25, 50, 100], // 可供选择的每页的行数(*)
  415 + onRefresh: function(){
  416 +
  417 + },
  418 + onClickRow:function(row,ele,field){
  419 + let code=$("#code").val();
  420 + $("#detailId").val(row.id);
  421 + $("#receiveNum").val(row.totalQty-row.openQty);
  422 + $("#receiveWeight").val(row.totalWeight-row.openWeight)
  423 + $("#materialCode").val(row.materialCode);
  424 + //console.log(row)
  425 + if(row.materialCode.startsWith("196")){
  426 + $("#batteryHidden").show();
  427 + $("#receiveNum").val(1);
  428 + $("#barhidden").hide();
  429 + }else{
  430 + $("#batteryHidden").hide();
  431 + $("#barhidden").show();
  432 + }
  433 + $.ajax({
  434 + url:prefix+'/getInventoryInfo',
  435 + type:'post',
  436 + data:{
  437 + code:code,
  438 + id:row.id
  439 + },
  440 + success:res=>{
  441 + // $("#bootstrap-table1").bootstrapTable('load',res.data.list);
  442 + $("#bootstrap-table2").bootstrapTable('load',res.data.inventoryList);
  443 + $("#storageType").val(res.data.curBill.storageType)
  444 + $("#type").val(res.data.curBill.type)
  445 + $("#batteryTypes").val(res.data.curBill.batteryTypes)
  446 + $("#completeness").val(res.data.curBill.completeness)
  447 + // $("#bootstrap-table3").bootstrapTable('load',res.data.containerList);
  448 + }
  449 + })
  450 + },
  451 + columns: [
  452 + // {
  453 + // field : 'id',
  454 + // title : 'id号'
  455 + // },
  456 + // {
  457 + // field : 'receiptCode',
  458 + // title : '收货单编码'
  459 + // },
  460 + {
  461 + field : 'materialIsBattery',
  462 + title : '是否电池',
  463 + visible: false
  464 + },
  465 + {
  466 + field : 'id',
  467 + title : '明细id'
  468 + },
  469 + {
  470 + field : 'materialCode',
  471 + title : '物料编码'
  472 + },
  473 + {
  474 + field: "materialName",
  475 + title: "名称"
  476 + },
  477 + {
  478 + field : 'totalQty',
  479 + title : '单据数量'
  480 + },
  481 + {
  482 + field : 'openQty',
  483 + title : '已入数量'
  484 + },
  485 + // {
  486 + // field : 'totalWeight',
  487 + // title : '单据重量'
  488 + // },
  489 + /* {
  490 + field : 'batteryPackageWeight',
  491 + title : '电池包重量'
  492 + },*/
  493 + {
  494 + field : 'electricQuantity',
  495 + title : '电池包电量'
  496 + },
  497 + // {
  498 + // field : 'openWeight',
  499 + // title : '已入重量'
  500 + // },
  501 + {
  502 + field : 'inventorySts',
  503 + title : '库存状态'
  504 + },
  505 + {
  506 + field : 'projectNo',
  507 + title : '项目号'
  508 + },
  509 + {
  510 + field : 'materialUnit',
  511 + title : '单位'
  512 + },
  513 +
  514 + ]
  515 + });
  516 +
  517 + $("#bootstrap-table1").bootstrapTable({
  518 + removeUrl: ctx + "receipt/receiptContainerDetail/remove",
  519 + // search: true, //搜索
  520 + showRefresh: true, //刷新
  521 + showToggle:true, //视图切换
  522 + clickToSelect: true,
  523 + showColumns:true, //列选择
  524 + // detailView:true,
  525 + toolbar: "#toolbar1",
  526 + showExport: true, //导出
  527 + exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
  528 + modalName: "入库组盘",
  529 + iconSize: "outline",
  530 + toolbar: "#toolbar1",
  531 + contentType: "application/x-www-form-urlencoded",
  532 + onRefresh: function(){
  533 + list_receiptInfo($("#code").val());
  534 + },
  535 + columns: [
  536 + {
  537 + checkbox: true,
  538 + },
  539 + {
  540 + title: '操作',
  541 + align: 'center',
  542 + events:'operateEvents',
  543 + formatter: function(value, row, index) {
  544 + var actions = [];
  545 + if (row.status == 0) {
  546 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a>');
  547 + }
  548 + //console.log(row )
  549 + if (row.batteryPackTwoCode !=''&&row.batteryPackTwoCode !=undefined) {
  550 + actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="batteryPackagePrint(\'' + row.id + '\')"><i class="fa fa-edit"></i>打印</a>');
  551 + }
  552 + return actions.join('');
  553 + }
  554 + },
  555 + {
  556 + field : 'batteryPackTwoCode',
  557 + title : '电池包二维码'
  558 + },
  559 + /*{
  560 + field : 'locationCode',
  561 + title : '库位编号'
  562 + },*/
  563 + {
  564 + field : 'containerCode',
  565 + title : '容器编号'
  566 + },
  567 + {
  568 + field : 'id',
  569 + title : '组盘明细id',
  570 + visible: false
  571 + },
  572 + {
  573 + field : 'receiptContainerId',
  574 + title : '组盘头id',
  575 + visible: false
  576 + },
  577 + {
  578 + field : 'materialCode',
  579 + title : '物料编码'
  580 + },
  581 + {
  582 + field:"materialName",
  583 + title:"物料名称"
  584 + },
  585 +
  586 + // {
  587 + // field:"materialSpec",
  588 + // title:"物料规格"
  589 + // },
  590 + {
  591 + field : 'qty',
  592 + title : '数量'
  593 + },
  594 +
  595 + {
  596 + field : 'electricQuantity',
  597 + title : '电池包电量'
  598 + },
  599 + // {
  600 + // field : 'batteryPackageWeight',
  601 + // title : '电池包重量'
  602 + // },
  603 + // {
  604 + // field : 'weights',
  605 + // title : '重量'
  606 + // },
  607 + // {
  608 + // field : 'sn',
  609 + // title : '序列号'
  610 + // },
  611 + // {
  612 + // field : 'project',
  613 + // title : '项目号',
  614 + // visible: false
  615 + // },
  616 + {
  617 + field : 'status',
  618 + title : '组盘状态',
  619 + align: 'center',
  620 + formatter: function(value, row, index) {
  621 + return $.table.selectDictLabel(Status, value);
  622 + }
  623 + },
  624 + {
  625 + field : 'receiptDetailId',
  626 + title : '入库单明细id'
  627 + },
  628 + {
  629 + field : 'created',
  630 + title : '创建时间'
  631 + },
  632 + {
  633 + field : 'createdBy',
  634 + title : '创建人'
  635 + }]
  636 + });
  637 +
  638 + $("#bootstrap-table2").bootstrapTable({
  639 + removeUrl: ctx + "receipt/receiptContainerDetail/remove",
  640 + clickToSelect: true,
  641 + showColumns:true, //列选择
  642 + showExport: true, //导出
  643 + iconSize: "outline",
  644 + toolbar: "#toolbar",
  645 + exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
  646 + modalName: "入库组盘",
  647 + pagination: true, // 是否显示分页(*)
  648 + pageNumber: 1, // 初始化加载第一页,默认第一页
  649 + pageSize: 5, // 每页的记录行数(*)
  650 + pageList: [10, 25, 50],
  651 + contentType: "application/x-www-form-urlencoded",
  652 + columns: [
  653 + {
  654 + field : 'containerCode',
  655 + title : '容器编号'
  656 + },
  657 + // {
  658 + // field : 'batteryPackageWeight',
  659 + // title : '电池包重量'
  660 + // },
  661 + {
  662 + field : 'electricQuantity',
  663 + title : '电池包电量'
  664 + },
  665 + {
  666 + field : 'materialCode',
  667 + title : '存货编码'
  668 + },
  669 + {
  670 + field : 'materialName',
  671 + title : '物料名称'
  672 + },
  673 + {
  674 + field : 'materialSpec',
  675 + title : '物料规格'
  676 + },
  677 + {
  678 + field : 'qty',
  679 + title : '数量'
  680 + },
  681 + // {
  682 + // field : 'sn',
  683 + // title : '序列号'
  684 + // },
  685 + {
  686 + field : 'companyName',
  687 + title : '货主'
  688 + },
  689 + {
  690 + field : 'locationCode',
  691 + title : '库位编号'
  692 + },
  693 + {
  694 + field : 'status',
  695 + title : '库存状态' ,
  696 + align: 'center',
  697 + formatter: function(value, row, index) {
  698 + return $.table.selectDictLabel(inventoryStatus, value);
  699 + }
  700 + },
  701 + ]
  702 + });
  703 + window.operateEvents = {
  704 + 'click #qty': function (e, value, row, index) {
  705 + var url = prefix + '/add?';
  706 + jQuery.each(row, function(key, val) {
  707 + url = url + key + "=" + encodeURI(val) + "&";
  708 + });
  709 + var modalName="入库组盘";
  710 + $.modal.open("添加"+modalName,url);
  711 + }
  712 + };
  713 +
  714 + function receiving_refresh() {
  715 + var receiving_code = localStorage.getItem("receiving_code");
  716 + $("#code").val(receiving_code);
  717 + if (receiving_code) {
  718 + initTable();
  719 + }
  720 + localStorage.removeItem("receiving_code");
  721 + }
  722 +
  723 + receiving_refresh();
  724 +
  725 + function remove(id) {
  726 + $.modal.confirm("确定删除该组盘?", function() {
  727 + var url = ctx + "receipt/receiptContainerDetail/remove";
  728 + var data = { "ids": id };
  729 + $.operate.submitAndCallback(url, "post", "json", data, initTable);
  730 + });
  731 + }
  732 +
  733 + function positioning() {
  734 + let rows = $("#bootstrap-table1").bootstrapTable('getSelections');
  735 + if (rows.length == 0) {
  736 + $.modal.alertWarning("请至少选择一条记录");
  737 + return;
  738 + }
  739 + var url = ctx+"receipt/receiptContainerHeader/position";
  740 + var ids = "";
  741 + for (var i = 0; i<rows.length; i++){
  742 + ids += rows[i].receiptContainerId;
  743 + ids += ",";
  744 + }
  745 + var data = { "ids": ids };
  746 + $.modal.loading("正在处理中,请稍后...");
  747 + var config = {
  748 + url: url,
  749 + type: "post",
  750 + dataType: "json",
  751 + data: data,
  752 + success: function(result) {
  753 + $.operate.ajaxSuccess(result);
  754 + list_receiptInfo($("#code").val());
  755 + }
  756 + };
  757 + $.ajax(config)
  758 + $.table.refresh("bootstrap-table1");
  759 + }
  760 +
  761 + function refresh() {
  762 + var receiptCode=$("#code").val();
  763 + list_select(receiptCode);
  764 + list_receiptInfo(receiptCode);
  765 + $("#bootstrap-table1").bootstrapTable('removeAll');
  766 + $("#bootstrap-table2").bootstrapTable('removeAll');
  767 + }
  768 +
  769 + function cancelPositioning() {
  770 + let rows = $("#bootstrap-table1").bootstrapTable('getSelections');
  771 + if (rows.length == 0) {
  772 + $.modal.alertWarning("请至少选择一条记录");
  773 + return;
  774 + }
  775 + var url = ctx+"receipt/receiptContainerHeader/cancelPosition";
  776 + var ids = "";
  777 + for (var i = 0; i<rows.length; i++){
  778 + ids += rows[i].receiptContainerId;
  779 + ids += ",";
  780 + }
  781 + var data = { "ids": ids };
  782 +
  783 + $.modal.loading("正在处理中,请稍后...");
  784 + var config = {
  785 + url: url,
  786 + type: "post",
  787 + dataType: "json",
  788 + data: data,
  789 + success: function(result) {
  790 + $.operate.ajaxSuccess(result);
  791 + list_receiptInfo($("#code").val());
  792 + }
  793 + };
  794 + $.ajax(config)
  795 + $.table.refresh("bootstrap-table1");
  796 + }
  797 +
  798 + function batRemove() {
  799 + let rows = $("#bootstrap-table1").bootstrapTable('getSelections');
  800 + if (rows.length == 0) {
  801 + $.modal.alertWarning("请至少选择一条记录");
  802 + return;
  803 + }
  804 + var url = ctx+"receipt/receiptContainerDetail/remove";
  805 + var ids = "";
  806 + for (var i = 0; i<rows.length; i++){
  807 + ids += rows[i].id;
  808 + ids += ",";
  809 + }
  810 + var data = { "ids": ids };
  811 + var config = {
  812 + url: url,
  813 + type: "post",
  814 + dataType: "json",
  815 + data: data,
  816 + success: function(result) {
  817 + $.operate.ajaxSuccess(result);
  818 + list_receiptInfo($("#code").val());
  819 + list_select($("#code").val());
  820 + }
  821 + };
  822 + $.ajax(config);
  823 + $.table.refresh("bootstrap-table1");
  824 + }
  825 +
  826 + function receipt() {
  827 + let containerCode = $("#containerCode").val();
  828 + let locationCode = $("#locationCoder").val();
  829 + }
  830 + /**
  831 + * 取重接口
  832 + * 调用连接称重电脑的接口
  833 + */
  834 + function getWeight(){
  835 + let url='http://10.34.101.77:8888/wms/API/WMS/v2/getWeightForSerial';
  836 + let type = "POST";
  837 + let dataType = "json";
  838 + let data = {};
  839 + let config = {
  840 + url: url,
  841 + type: type,
  842 + dataType: dataType,
  843 + data: data,
  844 + beforeSend: function () {
  845 + $.modal.loading("正在处理中,请稍后...");
  846 + },
  847 + success: function (result) {
  848 + $("#materialGrossWeight").val(result.data)
  849 + $.operate.ajaxSuccess(result);
  850 + }
  851 + };
  852 + $.ajax(config)
  853 + }
  854 +
  855 + /*document.getElementById("plc")
  856 + .addEventListener("click", function() {
  857 + $.ajax({
  858 + cache : false,
  859 + type : "POST",
  860 + url : ctx + "API/WMS/v2/cameraLogin",
  861 + dataType: 'json',
  862 + data : {
  863 + "cameraId": "3"
  864 + },
  865 + async : false,
  866 + error : function(request) {
  867 + $.modal.alertError("请求失败!");
  868 + },
  869 + success : function(result) {
  870 + if (result.code == web_status.SUCCESS) {
  871 + getData();
  872 + $.modal.msgSuccess(result.msg);
  873 + }else{
  874 + $.modal.alertError(result.data);
  875 + }
  876 + }
  877 + });
  878 + });*/
  879 + function getData(){
  880 + let url = "/wms/img/Capture/material.jpg?" + Date.parse(new Date());
  881 + $("#camera").attr('src',url);
  882 + // setTimeout(getData,5000)
  883 + }
  884 +
  885 + /**
  886 + * 组盘
  887 + */
  888 + function receipt() {
  889 + let containerCode = $("#containerCode").val();
  890 + let locationCode = $("#locationCoder").val();
  891 + let barCodeHeaderCode = $("#barCodeHeaderCode").val();
  892 + Receiving(locationCode, containerCode,barCodeHeaderCode);
  893 + }
  894 +
  895 + /**
  896 + * 组盘
  897 + * @param locationCode
  898 + * @param containerCode
  899 + */
  900 + function Receiving(locationCode,containerCode,barCodeHeaderCode) {
  901 + let receiptCode=$("#code").val();
  902 + let num=$("#receiveNum").val();
  903 + let receiptDetailId=$("#detailId").val();
  904 + let weights = $("#receiveWeight").val();
  905 + let locationCoder = $("#locationCoder").val();
  906 + let barCodeHeaderId = $("#barCodeHeaderId").val();
  907 + let batteryPackType = $("#batteryPackType").val();
  908 + let batteryTypes = $("#batteryTypes").val();
  909 + let completeness = $("#completeness").val();
  910 + let electricQuantity = $("#electricQuantity").val();
  911 + let storageType = $("#storageType").val();
  912 + let type = $("#type").val();
  913 + let countryCode = $("#countryCode").val();
  914 + let remark = $("#remark").val();
  915 + let area = $("#area").val();
  916 +
  917 + let materialTareWeight = $("#materialTareWeight").val();
  918 + let materialGrossWeight = $("#materialGrossWeight").val();
  919 + let materialNetWeight = $("#materialNetWeight").val();
  920 + let recycler = $("#recycler").val();
  921 + /*let materialCode = $("#materialCode").val();
  922 + if(materialCode.startsWith("196")&&barCodeHeaderId==''){
  923 + if(num)
  924 + }*/
  925 + //console.log(materialCode)
  926 + $.ajax({
  927 + url:ctx + "receipt/receiving/save",
  928 + type:'post',
  929 + data:{
  930 + receiptCode:receiptCode,
  931 + qty: num,
  932 + receiptDetailId:receiptDetailId,
  933 + locationCode:locationCoder,
  934 + // locationCoder:locationCoder,
  935 + containerCode:containerCode,
  936 + barCodeHeaderCode:barCodeHeaderCode,
  937 + barCodeHeaderId:barCodeHeaderId,
  938 + batteryPackType:batteryPackType,
  939 + batteryTypes:batteryTypes,
  940 + completeness:completeness,
  941 + electricQuantity:electricQuantity,
  942 + batteryQty:num,
  943 + weights:weights,
  944 + materialTareWeight:materialTareWeight,
  945 + materialGrossWeight:materialGrossWeight,
  946 + materialNetWeight:materialNetWeight,
  947 + recycler:recycler,
  948 + storageType:storageType,
  949 + type:type,
  950 + countryCode:countryCode,
  951 + remark:remark,
  952 + area:area
  953 + },
  954 + success:function (data) {
  955 + if(data.code===200){
  956 + $.modal.msgSuccess('成功');
  957 + initTable();
  958 + }
  959 + else{
  960 + $.modal.msg(data.msg);
  961 + }
  962 + }
  963 + })
  964 + }
  965 +
  966 + function chooseStation(id) {
  967 + var url = ctx + "receipt/receiptContainerHeader/chooseStation" + "/" + id;
  968 + $.modal.open("选择站台", url);
  969 + }
  970 +
  971 + function createTask() {
  972 + let rows=$("#bootstrap-table1").bootstrapTable('getSelections');
  973 + if (rows.length == 0) {
  974 + $.modal.alertWarning("请至少选择一条记录");
  975 + return;
  976 + }
  977 + if(rows[0].taskType == 200) {
  978 + let ids = "";
  979 + for(let i=0; i<rows.length; i++) {
  980 + if(ids == "") {
  981 + ids = rows[i].receiptContainerId;
  982 + } else {
  983 + ids = ids + "," + rows[i].receiptContainerId
  984 + }
  985 + }
  986 + chooseStation(ids);
  987 + } else {
  988 + let url = ctx + "receipt/receiptContainerHeader/createTask";
  989 + let ids = "";
  990 + for(let i=0; i<rows.length; i++) {
  991 + ids = ids + rows[i].receiptContainerId + ","
  992 + }
  993 + let data = { "ids": ids.substring(0, ids.length-1) };
  994 + $.modal.loading("正在处理中,请稍后...");
  995 + var config = {
  996 + url: url,
  997 + type: "post",
  998 + dataType: "json",
  999 + data: data,
  1000 + success: function(result) {
  1001 + if (result.code == web_status.SUCCESS) {
  1002 + $.modal.msgSuccess(result.msg);
  1003 + $.table.refresh("bootstrap-table1");
  1004 + } else {
  1005 + $.modal.alertError(result.msg);
  1006 + }
  1007 + $.modal.closeLoading();
  1008 + }
  1009 + };
  1010 + $.ajax(config)
  1011 + }
  1012 + }
  1013 +
  1014 + function containerTypeSearch() {
  1015 + var params = {
  1016 + query:{containerType:$("#containerType").val()}
  1017 + }
  1018 + $("#bootstrap-table3").bootstrapTable('refresh',params);
  1019 + }
  1020 + //选择主条码
  1021 + function selectCode(){
  1022 + var url = ctx + "receipt/receiving/listBarCodeHeaderCode";
  1023 + $.modal.open("选择托盘号", url);
  1024 + }
  1025 + function batteryPackagePrint(id){
  1026 + var url = ctx + "receipt/receiptContainerDetail/reportBatteryPackage/" + id;
  1027 + $.modal.open("入库电池包打印" , url);
  1028 + }
  1029 + function batteryPackagePrints(){
  1030 + var rows=$("#bootstrap-table1").bootstrapTable('getSelections');
  1031 + if (rows.length == 0) {
  1032 + $.modal.alertWarning("请至少选择一条记录");
  1033 + return;
  1034 + }
  1035 + var ids = "";
  1036 + for(var i=0; i<rows.length; i++) {
  1037 + ids = ids + rows[i].id + ","
  1038 + }
  1039 + var url = ctx + "receipt/receiptContainerDetail/reportBatteryPackage/" + ids;
  1040 + $.modal.open("入库电池包打印" , url);
  1041 + }
  1042 +</script>
  1043 +</body>
  1044 +</html>
... ...
src/main/resources/templates/receipt/receiving/receiving.html
... ... @@ -4,14 +4,18 @@
4 4 <head th:include="include :: header"></head>
5 5 <style>
6 6 .table-striped-left{
7   - width: 41%;
  7 + width: 58%;
8 8 /*margin-right: 4px;*/
9 9 }
10 10 .table-striped-right{
11 11 /*right: -10px;*/
12   - width: 58%;
  12 + width: 41.9%;
13 13 float: right;
14 14 }
  15 + .table-striped-bottom{
  16 + width: 100%;
  17 + padding-top:0px;
  18 + }
15 19 .info_text{
16 20 float: right;
17 21 }
... ... @@ -36,6 +40,12 @@
36 40 element.style {
37 41 width: 50%;
38 42 }
  43 + .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
  44 + position: relative;
  45 + margin-top: 40px;
  46 + margin-bottom: 0px;
  47 + line-height: 34px;
  48 + }
39 49 .table-striped-right .select-list li{
40 50 width:47%;
41 51 float:left;
... ... @@ -60,6 +70,14 @@
60 70  
61 71 vertical-align:middle;
62 72 }
  73 + /*.select-info {
  74 + width: 100%;
  75 + background: #fff;
  76 + border-radius: 6px;
  77 + margin-top: 1px;
  78 + padding: 10px 1px;
  79 + box-shadow: 1px 1px 3px rgb(0 0 0 / 20%);
  80 + }*/
63 81 </style>
64 82 <body class="gray-bg">
65 83 <div class="container-div">
... ... @@ -88,9 +106,7 @@
88 106 </div>
89 107  
90 108 <div class="col-sm-12 select-info table-striped-left" style="padding-top: 20px;">
91   - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
92   - </div>
93   - <div class="col-sm-12 select-info table-striped-right">
  109 + <!--组盘输入区 -->
94 110 <div>
95 111 <button class="btn btn-danger" onclick="receipt()">组&nbsp&nbsp&nbsp盘</button>
96 112  
... ... @@ -163,7 +179,7 @@
163 179 <li>毛重:<input type="text" id="materialGrossWeight"/><button class="btn btn-sm btn-success" onclick="getWeight()">取重</button></li>
164 180 <li>净重:<input type="text" id="materialNetWeight"/></li>
165 181 <!--<li>回收人:<input type="text" id="recycler"/></li>-->
166   - <li>国家编码:<input type="text" id="countryCode" placeholder="国家编码"/></li>
  182 + <li>国家编码:<input type="text" id="countryCode" placeholder="请用pda扫码获取"/></li>
167 183 <li>备注:<input type="text" id="remark" placeholder="备注"/></li>
168 184 <li>
169 185 <button id="plc" name="plc" class="btn btn-danger btn-sm" type="button">电池拍照</button>
... ... @@ -194,15 +210,17 @@
194 210 </div>
195 211  
196 212 </ul>
  213 +
  214 + </div>
  215 + <div class="col-sm-12 table-striped-right" style="padding-top: 13px;">
  216 + <!--需要组盘入库明细 -->
  217 + <table id="bootstrap-table" style="background: rgb(255, 255, 255);" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
  218 +
  219 +
  220 + </div>
  221 + <div class="col-sm-12 select-info table-striped-bottom">
  222 +
197 223 <div class="btn-group hidden-xs" id="toolbar1" role="group">
198   - <!-- <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()"-->
199   - <!-- shiro:hasPermission="receipt:receiptDetail:add">-->
200   - <!-- <i class="fa fa-map-pin"></i> 定位-->
201   - <!-- </a>-->
202   - <!-- <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()"-->
203   - <!-- shiro:hasPermission="receipt:receiptDetail:remove">-->
204   - <!-- <i class="fa fa-times"></i> 取消定位-->
205   - <!-- </a>-->
206 224 <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"
207 225 shiro:hasPermission="receipt:receiptDetail:remove">
208 226 <i class="fa fa-trash-o"></i> 取消收货
... ... @@ -254,6 +272,9 @@
254 272 var Types = [[${@dict.getType('taskType')}]];
255 273 var Status=[[${@dict.getType('receiptContainerHeaderStatus')}]];
256 274 var inventoryStatus =[[${@dict.getType('inventoryStatus')}]];
  275 + var batteryPackType =[[${@dict.getType('batteryPackType')}]];
  276 + var supplier =[[${@SupplierService.getCode()}]];
  277 + //var batteryTypes =[[${@dict.getType('batteryTypes')}]];
257 278  
258 279 connect();
259 280 $(function () {
... ... @@ -347,7 +368,8 @@
347 368 success: function (value) {
348 369 $("#bootstrap-table1").bootstrapTable('removeAll');
349 370 if(value.data){
350   - for (var i = 0; i < value.data.length; i++) {
  371 + $("#bootstrap-table1").bootstrapTable('load',value.data);
  372 + /*for (var i = 0; i < value.data.length; i++) {
351 373 $("#bootstrap-table1").bootstrapTable('insertRow', {
352 374 index: 0, row: {
353 375 projectNo :value.data[i].projectNo,
... ... @@ -372,7 +394,7 @@
372 394 batteryPackageWeight: value.data[i].batteryPackageWeight
373 395 }
374 396 });
375   - }
  397 + }*/
376 398 }
377 399 else {
378 400 console.log("没有查找到入库容器!")
... ... @@ -557,13 +579,91 @@
557 579 }
558 580 },
559 581 {
  582 + field : 'materialCode',
  583 + title : '物料编码'
  584 + },
  585 + {
  586 + field:"materialName",
  587 + title:"物料名称"
  588 + },
  589 +
  590 + // {
  591 + // field:"materialSpec",
  592 + // title:"物料规格"
  593 + // },
  594 + {
  595 + field : 'qty',
  596 + title : '数量'
  597 + },
  598 + {
560 599 field : 'batteryPackTwoCode',
561   - title : '电池包二维码'
  600 + title : '电池二维码'
  601 + },
  602 + {
  603 + field : 'poundCode',
  604 + title : '磅单编号'
  605 + },
  606 + {
  607 + field : 'batteryTypes',
  608 + title : '电池类型',
  609 + formatter: function(value, row, index) {
  610 + var showhtml='';
  611 + if(value!=''&&value!=undefined&&value!=null){
  612 + if(value==1){
  613 + showhtml='电池包';
  614 + }else if (value ==2){
  615 + showhtml='电池模块';
  616 + }else if(value==3){
  617 + showhtml='电池单体';
  618 + }
  619 + }
  620 + return showhtml;
  621 +
  622 + }
  623 + },
  624 + {
  625 + field : 'batteryPackType',
  626 + title : '电池种类',
  627 + formatter: function(value, row, index) {
  628 + console.log(value)
  629 + var actions = [];
  630 + $.each(batteryPackType, function(index, dict) {
  631 + console.log(dict.dictValue)
  632 + if (dict.dictValue == value) {
  633 + actions.push("<span class='badge badge-info'>" + dict.dictLabel + "</span>");
  634 + return false;
  635 + }
  636 + });
  637 + return actions.join('');
  638 + }
  639 + },
  640 + {
  641 + field : 'materialBatch',
  642 + title : '原料批号'
  643 + },
  644 + {
  645 + field : 'batteryPackTwoCode',
  646 + title : '供应商',
  647 + formatter: function(value, row, index) {
  648 + var actions = [];
  649 + $.each(supplier, function(index, dict) {
  650 + if (dict.code == value) {
  651 + actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
  652 + return false;
  653 + }
  654 + });
  655 + return actions.join('');
  656 + }
  657 +
  658 + },
  659 + {
  660 + field : 'countryCode',
  661 + title : '国家编码'
  662 + },
  663 + {
  664 + field : 'recycler',
  665 + title : '回收人'
562 666 },
563   - /*{
564   - field : 'locationCode',
565   - title : '库位编号'
566   - },*/
567 667 {
568 668 field : 'containerCode',
569 669 title : '容器编号'
... ... @@ -578,23 +678,7 @@
578 678 title : '组盘头id',
579 679 visible: false
580 680 },
581   - {
582   - field : 'materialCode',
583   - title : '物料编码'
584   - },
585   - {
586   - field:"materialName",
587   - title:"物料名称"
588   - },
589 681  
590   - // {
591   - // field:"materialSpec",
592   - // title:"物料规格"
593   - // },
594   - {
595   - field : 'qty',
596   - title : '数量'
597   - },
598 682  
599 683 {
600 684 field : 'electricQuantity',
... ...
src/main/resources/templates/task/taskHeader/taskHeader.html
... ... @@ -121,6 +121,7 @@
121 121 var batteryTypes = [[${@dict.getType('batteryTypes')}]];
122 122 var batteryPackType = [[${@dict.getType('batteryPackType')}]];
123 123 var supplier =[[${@SupplierService.getCode()}]];
  124 + var completeness = [[${@dict.getType('completeness')}]];
124 125  
125 126 $(function() {
126 127 var options = {
... ... @@ -351,21 +352,7 @@
351 352 field : 'id',
352 353 title : '明细ID'
353 354 },
354   - {
355   - field : 'taskId',
356   - title : '任务头ID',
357   - sortable: true
358   - },
359   - {
360   - field : 'billCode',
361   - title : '单据编码',
362   - },
363   - {
364   - field : 'billDetailId',
365   - title : '单据明细ID',
366   - sortable: true,
367   - visible:true,
368   - },
  355 +
369 356 {
370 357 field : 'materialCode',
371 358 title : '物料编码',
... ... @@ -376,6 +363,25 @@
376 363 title : '物料名称',
377 364  
378 365 },
  366 + {
  367 + field : 'batteryPackTwoCode',
  368 + title : '电池包二维码'
  369 + },
  370 + {
  371 + field : 'supplierCode',
  372 + title : '供应商',
  373 + align: 'center',
  374 + formatter: function(value, row, index) {
  375 + var actions = [];
  376 + $.each(supplier, function(index, dict) {
  377 + if (dict.code == value) {
  378 + actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
  379 + return false;
  380 + }
  381 + });
  382 + return actions.join('');
  383 + }
  384 + },
379 385 // {
380 386 // field : 'projectNo',
381 387 // title : '项目号',
... ... @@ -404,6 +410,29 @@
404 410 title : '原料批号',
405 411 },
406 412 {
  413 + field : 'completeness',
  414 + title : '完整程度',
  415 + formatter: function(value, row, index) {
  416 + return $.table.selectDictLabel(completeness, value);
  417 + }
  418 + },
  419 + {
  420 + field : 'batteryTypes',
  421 + title : '电池产品类型',
  422 + formatter: function(value, row, index) {
  423 + return $.table.selectDictLabel(batteryTypes, value);
  424 + }
  425 + },
  426 + {
  427 + field : 'batteryPackType',
  428 + title : '电池包种类',
  429 + align: 'center',
  430 + visible:true,
  431 + formatter: function(value, row, index) {
  432 + return $.table.selectDictLabel(batteryPackType, value);
  433 + }
  434 + },
  435 + {
407 436 field : 'fromLocation',
408 437 title : '源库位',
409 438 sortable:true
... ... @@ -441,41 +470,9 @@
441 470 field : 'remark',
442 471 title : '电池包入库备注' ,
443 472 },
444   - {
445   - field : 'batteryPackTwoCode',
446   - title : '电池包二维码'
447   - },
448   - {
449   - field : 'batteryTypes',
450   - title : '电池产品类型',
451   - formatter: function(value, row, index) {
452   - return $.table.selectDictLabel(batteryTypes, value);
453   - }
454   - },
455   - {
456   - field : 'batteryPackType',
457   - title : '电池包种类',
458   - align: 'center',
459   - visible:true,
460   - formatter: function(value, row, index) {
461   - return $.table.selectDictLabel(batteryPackType, value);
462   - }
463   - },
464   - {
465   - field : 'supplierCode',
466   - title : '供应商',
467   - align: 'center',
468   - formatter: function(value, row, index) {
469   - var actions = [];
470   - $.each(supplier, function(index, dict) {
471   - if (dict.code == value) {
472   - actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
473   - return false;
474   - }
475   - });
476   - return actions.join('');
477   - }
478   - },
  473 +
  474 +
  475 +
479 476 // {
480 477 // field : 'weights',
481 478 // title : '重量'
... ... @@ -486,14 +483,29 @@
486 483 // title : '序列号'
487 484 // },
488 485 {
489   - field : 'status',
490   - title : '子任务状态',
491   - align: 'center',
492   - formatter: function(value, row, index) {
493   - return $.table.selectDictLabel(taskDetailStatus, value);
494   - }
  486 + field : 'taskId',
  487 + title : '任务头ID',
  488 + sortable: true
495 489 },
496 490 {
  491 + field : 'billCode',
  492 + title : '单据编码',
  493 + },
  494 + {
  495 + field : 'billDetailId',
  496 + title : '单据明细ID',
  497 + sortable: true,
  498 + visible:true,
  499 + },
  500 + // {
  501 + // field : 'status',
  502 + // title : '子任务状态',
  503 + // align: 'center',
  504 + // formatter: function(value, row, index) {
  505 + // return $.table.selectDictLabel(taskDetailStatus, value);
  506 + // }
  507 + // },
  508 + {
497 509 field : 'created',
498 510 title : '创建时间' ,
499 511 visible:false,
... ...
src/main/resources/templates/vehicle/vehicleReceipt/lookPicture.html
... ... @@ -2,24 +2,47 @@
2 2 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
3 3 <meta charset="utf-8">
4 4 <head th:include="include :: header"></head>
  5 +<style>
  6 + .picdiv{
  7 + width:45%;
  8 + height:200px;
  9 + margin: 15px;
  10 + border: 1px solid #ddd;
  11 + white-space: nowrap;
  12 + float: left;
  13 +
  14 + }
  15 +</style>
5 16 <body class="white-bg">
6 17 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
7 18 <form class="form-horizontal m" id="form-camera-cameraReset">
8 19 <input name="id" type="hidden" />
9   -
10   - <div class="form-group" style="width:600px;margin: 0 auto;white-space: nowrap">
11   - <div class="col-sm-6">
12   - <img id="view1" src="" width="300px" height="200px" alt="主摄像头画面">
  20 + <div class="form-group">
  21 + <div class=" picdiv">
  22 + <div class="col-sm-6">
  23 + <img id="view1" src="" width="300px" height="200px" alt="主摄像头画面">
  24 + </div>
13 25 </div>
14   - </div>
15   - <div class="form-group" style="width:600px;margin: 0 auto;white-space: nowrap">
16   - <div class="col-sm-6">
17   - <img id="view2" src="" width="300px" height="200px" alt="主摄像头画面">
  26 + <div class=" picdiv" >
  27 + <div class="col-sm-6">
  28 + <img id="view2" src="" width="300px" height="200px" alt="主摄像头画面">
  29 + </div>
  30 + </div>
  31 + <div class=" picdiv" >
  32 + <div class="col-sm-6">
  33 + <img id="view3" src="" width="300px" height="200px" alt="主摄像头画面">
  34 + </div>
  35 + </div>
  36 + <div class=" picdiv" >
  37 + <div class="col-sm-6">
  38 + <img id="view4" src="" width="300px" height="200px" alt="主摄像头画面">
  39 + </div>
18 40 </div>
19 41 </div>
  42 +
20 43 <div class="form-group">
21 44 <div class="form-control-static col-sm-offset-9">
22   - <button type="submit" class="btn btn-primary">提交</button>
  45 + <button type="submit" class="btn btn-primary">提交2</button>
23 46 <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
24 47 </div>
25 48 </div>
... ...