Browse Source

bug检测

lwx_dev
erdanergou 3 years ago
parent
commit
96725c84f4
  1. 2
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 10
      src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java
  3. 4
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java
  4. 8
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  5. 2
      src/main/java/com/dreamchaser/depository_manage/entity/Depository.java
  6. 5
      src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java
  7. 6
      src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingChildP.java
  8. 91
      src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java
  9. 18
      src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java
  10. 4
      src/main/resources/static/js/lay-config.js
  11. 28
      src/main/resources/templates/pages/application/application-in.html
  12. 177
      src/main/resources/templates/pages/application/application-in_scanQrCode.html
  13. 2
      src/main/resources/templates/pages/application/application-out_min-mobile.html
  14. 1
      src/main/resources/templates/pages/application/application-out_min.html
  15. 16
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  16. 2
      src/main/resources/templates/pages/stockTaking/stockTakingReview.html
  17. 2
      src/main/resources/templates/pages/stockTaking/stockTakingView.html
  18. 4
      target/classes/static/js/lay-config.js
  19. 2
      target/classes/templates/pages/application/application-out_min-mobile.html
  20. 1
      target/classes/templates/pages/application/application-out_min.html
  21. 16
      target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  22. 2
      target/classes/templates/pages/stockTaking/stockTakingReview.html
  23. 2
      target/classes/templates/pages/stockTaking/stockTakingView.html

2
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -582,7 +582,7 @@ public class DepositoryRecordController {
simpleApplicationOutMinRecordP.setPcode(sb.toString());
simpleApplicationOutMinRecordP.setPid(placeByDid.getId());
simpleApplicationOutMinRecordP.setState(state);
simpleApplicationOutMinRecordP.setVersion(materialById.getVersion());
applicationOutRecordMinList.add(simpleApplicationOutMinRecordP);
}

10
src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java

@ -75,6 +75,7 @@ public class GroupController {
/**
* 用于出库时查找对应编码的组合
*
* @param map 查询条件
* @param request
* @return
@ -94,7 +95,6 @@ public class GroupController {
if (groupByCode != null) {
List<GroupInfo> groupByGid = groupService.findGroupInfoByGid(groupByCode.getId());
// 用于标识当前组合是否可以正常出库
@ -349,8 +349,11 @@ public class GroupController {
// 定义错误信息
StringBuilder errMsg = new StringBuilder();
String type = (String) map.get("type");
// 用于标识当前组合是否可以正常出库
boolean flag = true;
if (!"in".equals(type)) {
for (GroupInfo groupInfo : groupByGid) {
// 获取详细信息
@ -360,7 +363,7 @@ public class GroupController {
boolean flagForQuantity = false;
for (Integer quantity : inventoryByMidAndDepository) {
// 如果库存符合要求
if (quantity > groupInfo.getQuantity()) {
if (quantity >= groupInfo.getQuantity()) {
flagForQuantity = true;
}
}
@ -372,6 +375,7 @@ public class GroupController {
}
}
}
if (flag) {
return new RestResponse(groupByGid);
} else {
@ -471,6 +475,7 @@ public class GroupController {
/**
* 用于构造组合入库单
*
* @param map 入库数据
* @param request
* @return
@ -509,6 +514,7 @@ public class GroupController {
/**
* 用于构造组合出库单
*
* @param map 出库数据
* @param request
* @return

4
src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

@ -389,8 +389,8 @@ public class MaterialController {
List<MaterialP> materialPByCondition = new ArrayList<>();
List<InventoryP> inventoryPByCondition = new ArrayList<>();
param.put("mcode", code);
for (int i = 0; i < depositoryByAdminorg.size(); i++) {
param.put("depositoryId", depositoryByAdminorg.get(i).getId());
for (Depository depository : depositoryByAdminorg) {
param.put("depositoryId", depository.getId());
// 查找当前用户部门仓库中是否存在该物料
inventoryPByCondition = materialService.findInventory(param);
if (inventoryPByCondition.size() > 0) {

8
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -1609,6 +1609,7 @@ public class PageController {
Integer departmentManagerState = stp.getDepartmentManagerState();
if (Integer.compare(departmentManagerState, 3) == 0) {
// 如果当前盘点记录未经过负责人处理
// 跳转到审核页面
mv.setViewName("pages/stockTaking/stockTakingReview");
} else {
@ -2099,10 +2100,11 @@ public class PageController {
JSONObject jsonObject = JSONObject.parseObject(scanQrCodeValue);
JSONArray mids = (JSONArray) jsonObject.get("mids");
List<Object> materialList = new ArrayList<>();
for (int i = 0; i < mids.size(); i++) {
for (Object mid : mids) {
Map<String, Object> param = new HashMap<>();
Integer o = ObjectFormatUtil.toInteger(mids.get(i));
Integer o = ObjectFormatUtil.toInteger(mid);
MaterialP mp = new MaterialP(materialService.findMaterialById(o));
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(mp.getId());
param.put("mid", mp.getId());
param.put("mname", mp.getMname());
param.put("code", mp.getCode());
@ -2110,6 +2112,8 @@ public class PageController {
param.put("version", mp.getVersion());
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
param.put("materialAndBarCodeList", materialByBarCodeByCondition);
param.put("splitList",splitInfoByMid);
param.put("unit",mp.getUnit());
String context = JSONObject.toJSONString(param);
materialList.add(context);
}

2
src/main/java/com/dreamchaser/depository_manage/entity/Depository.java

@ -16,6 +16,8 @@ public class Depository {
/** id */
private Integer id;
/** 仓库名称 */
private String dname;

5
src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java

@ -87,6 +87,11 @@ public class SimpleApplicationOutMinRecordP {
*/
private String showQuantity;
/**
* 物料规格型号
*/
private String version;
public SimpleApplicationOutMinRecordP(ApplicationOutRecordMin applicationOutRecordMin) {
this.id = applicationOutRecordMin.getId();
this.parentId = applicationOutRecordMin.getParentId();

6
src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingChildP.java

@ -101,6 +101,12 @@ public class StockTakingChildP {
*/
private String unit;
/**
* 用于展示当前盘点的计量单位
*/
private String showUnit;

91
src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java

@ -245,6 +245,7 @@ public class QyWxOperationService {
/**
* 用于向企业微信中该盘点记录的负责人发送盘点消息
*
* @param uid 接收人
* @param mainId 盘点记录编号
* @return
@ -404,8 +405,6 @@ public class QyWxOperationService {
horizontal_content_inventory.setValue(stockTakingInventory.toString());
// 二级标题+文本列表,用于设置申请查看明细
TemplateCard_horizontal_content horizontal_content_detail = new TemplateCard_horizontal_content();
// 链接类型 0代表不是链接
@ -491,6 +490,7 @@ public class QyWxOperationService {
/**
* 用于向企业微信盘点人员发送盘点消息
*
* @param uid 接收人
* @param mainId 盘点记录编号
* @return
@ -654,8 +654,6 @@ public class QyWxOperationService {
horizontal_content_inventory.setValue(stockTakingInventory.toString());
// 二级标题+文本列表,用于设置申请查看明细
TemplateCard_horizontal_content horizontal_content_detail = new TemplateCard_horizontal_content();
// 链接类型 0代表不是链接
@ -666,6 +664,13 @@ public class QyWxOperationService {
horizontal_content_detail.setUrl("https://jy.hxgk.group/StockTakingView?id=" + mainId);
// 卡片整体点击方法
TemplateCard_card_action card_action = new TemplateCard_card_action();
card_action.setType(1);
card_action.setUrl("https://jy.hxgk.group/StockTakingView?id=" + mainId);
templateCard_button_interaction.setCard_action(card_action);
List<TemplateCard_horizontal_content> horizontal_contentList = new ArrayList<>();
horizontal_contentList.add(horizontal_content_mname);
horizontal_contentList.add(horizontal_content_quantity);
@ -930,6 +935,7 @@ public class QyWxOperationService {
/**
* 用于向负责人发送盘点过程中的错误信息
*
* @param uid 接收人
* @param errIds 错误id
* @param mainRecord 主订单
@ -1025,6 +1031,7 @@ public class QyWxOperationService {
/**
* 将转移信息发送给盘点人员
*
* @param map
* @return
*/
@ -1125,7 +1132,6 @@ public class QyWxOperationService {
MaterialAndPlace newPlaceAndMaterial = placeMapper.findPlaceAndMaterialByMidAndPid(paramForMaterialAndPlace);
content.append(">- 物料名称:").append(material.getMname()).append("%n");
content.append(">- 盘点数量:").append(minRecord.getNewInventory()).append("%n");
content.append(">- 盘点位置:").append(fromLocation).append("%n");
@ -1237,16 +1243,28 @@ public class QyWxOperationService {
horizontal_content_mname.setType(0);
horizontal_content_mname.setKeyname("物料名称:");
horizontal_content_mname.setValue(materialById.getMname());
// 物料编码
TemplateCard_horizontal_content horizontal_content_mcode = new TemplateCard_horizontal_content();
horizontal_content_mcode.setType(0);
horizontal_content_mcode.setKeyname("物料编码:");
horizontal_content_mcode.setValue(materialById.getCode());
// 物料编码规格型号
TemplateCard_horizontal_content horizontal_content_version = new TemplateCard_horizontal_content();
horizontal_content_version.setType(0);
horizontal_content_version.setKeyname("物料型号:");
horizontal_content_version.setValue(materialById.getVersion());
// 申请数量
TemplateCard_horizontal_content horizontal_content_quantity = new TemplateCard_horizontal_content();
horizontal_content_quantity.setType(0);
horizontal_content_quantity.setKeyname("申请数量:");
horizontal_content_quantity.setValue(recordMin.getQuantity().toString());
// 申请单位
TemplateCard_horizontal_content horizontal_content_unit = new TemplateCard_horizontal_content();
horizontal_content_unit.setType(0);
horizontal_content_unit.setKeyname("申请单位:");
// 当前申请单位
String unit = recordMin.getUnit();
if ("-1".equals(unit)) {
// 如果是基础单位
unit = materialById.getUnit();
}
horizontal_content_unit.setValue(unit);
// 所在仓库
TemplateCard_horizontal_content horizontal_content_depository = new TemplateCard_horizontal_content();
horizontal_content_depository.setType(0);
@ -1260,8 +1278,9 @@ public class QyWxOperationService {
horizontal_content_applyRemark.setValue(outRecordP.getApplyRemark());
horizontalContentList.add(horizontal_content_mname);
horizontalContentList.add(horizontal_content_mcode);
horizontalContentList.add(horizontal_content_version);
horizontalContentList.add(horizontal_content_quantity);
horizontalContentList.add(horizontal_content_unit);
horizontalContentList.add(horizontal_content_depository);
horizontalContentList.add(horizontal_content_applyRemark);
@ -1349,6 +1368,7 @@ public class QyWxOperationService {
/**
* 获取审批模板详细
*
* @return
*/
public JSONObject getApprovalTemplateInfo(String userAgent, String template_id) {
@ -1364,6 +1384,7 @@ public class QyWxOperationService {
/**
* 用于发送物料出库审批
*
* @param userAgent 加密后的userAgent
* @param userToken 申请人
* @param mainId 出库的主订单
@ -1576,7 +1597,7 @@ public class QyWxOperationService {
detail_list_control_info_unit.put("value", detail_list_control_info_value_unit);
// 物料名称
// 仓库名称
Map<String, Object> detail_list_control_info_depositoryName = new HashMap<>();
detail_list_control_info_depositoryName.put("control", "Text");
detail_list_control_info_depositoryName.put("id", "Text-1668137728919");
@ -1592,12 +1613,29 @@ public class QyWxOperationService {
detail_list_control_info_value_dname.put("text", depositoryById.getDname());
detail_list_control_info_depositoryName.put("value", detail_list_control_info_value_dname);
// 物料规格型号
Map<String, Object> detail_list_control_info_version = new HashMap<>();
detail_list_control_info_version.put("control", "Text");
detail_list_control_info_version.put("id", "Text-1672879620723");
Map<String, String> detail_list_control_info_title_version = new HashMap<>();
detail_list_control_info_title_version.put("text", "规格型号");
detail_list_control_info_title_version.put("lang", "zh_CN");
List<Object> detail_list_control_info_title_list_version = new ArrayList<>();
detail_list_control_info_title_list_version.add(detail_list_control_info_title_version);
detail_list_control_info_version.put("title", detail_list_control_info_title_list_version);
Map<String, String> detail_list_control_info_value_version = new HashMap<>();
detail_list_control_info_value_version.put("text", materialById.getVersion() == null ? "" : materialById.getVersion());
detail_list_control_info_version.put("value", detail_list_control_info_value_version);
detail_list_control.add(detail_list_control_info_materialName);
detail_list_control.add(detail_list_control_info_materialCode);
detail_list_control.add(detail_list_control_info_outNumber);
detail_list_control.add(detail_list_control_info_depositoryName);
detail_list_control.add(detail_list_control_info_unit);
detail_list_control.add(detail_list_control_info_version);
detail_list.put("list", detail_list_control);
@ -1673,6 +1711,7 @@ public class QyWxOperationService {
/**
* 用于发送出库审批
*
* @param userAgent 加密后的userAgent
* @param userToken 审批人
* @param mainId 主订单
@ -1786,7 +1825,6 @@ public class QyWxOperationService {
approval_template_apply_data_contents_list.add(approval_template_apply_data_contents_department);
//定义模板控件——明细
Approval_template_apply_data_contents approval_template_apply_data_contents_info = new Approval_template_apply_data_contents();
approval_template_apply_data_contents_info.setControl("Table");
@ -1877,7 +1915,7 @@ public class QyWxOperationService {
detail_list_control_info_value_unit.put("text", unit);
detail_list_control_info_unit.put("value", detail_list_control_info_value_unit);
// 物料名称
// 仓库名称
Map<String, Object> detail_list_control_info_depositoryName = new HashMap<>();
detail_list_control_info_depositoryName.put("control", "Text");
detail_list_control_info_depositoryName.put("id", "Text-1668220760317");
@ -1894,10 +1932,28 @@ public class QyWxOperationService {
detail_list_control_info_depositoryName.put("value", detail_list_control_info_value_dname);
// 物料规格型号
Map<String, Object> detail_list_control_info_version = new HashMap<>();
detail_list_control_info_version.put("control", "Text");
detail_list_control_info_version.put("id", "Text-1672880000043");
Map<String, String> detail_list_control_info_title_version = new HashMap<>();
detail_list_control_info_title_version.put("text", "规格型号");
detail_list_control_info_title_version.put("lang", "zh_CN");
List<Object> detail_list_control_info_title_list_version = new ArrayList<>();
detail_list_control_info_title_list_version.add(detail_list_control_info_title_version);
detail_list_control_info_version.put("title", detail_list_control_info_title_list_version);
Map<String, String> detail_list_control_info_value_version = new HashMap<>();
detail_list_control_info_value_version.put("text", materialById.getVersion() == null ? "" : materialById.getVersion());
detail_list_control_info_version.put("value", detail_list_control_info_value_version);
detail_list_control.add(detail_list_control_info_materialName);
detail_list_control.add(detail_list_control_info_materialCode);
detail_list_control.add(detail_list_control_info_outNumber);
detail_list_control.add(detail_list_control_info_depositoryName);
detail_list_control.add(detail_list_control_info_version);
detail_list_control.add(detail_list_control_info_unit);
@ -1982,9 +2038,9 @@ public class QyWxOperationService {
}
/**
* 用于发送库存判断审批
*
* @param userAgent
* @param userToken
* @param mainId
@ -2236,7 +2292,6 @@ public class QyWxOperationService {
detail_list_control_info_materialTexture.put("value", detail_list_control_info_value_materialTexture);
// 物料规格型号
Map<String, Object> detail_list_control_info_materialVersion = new HashMap<>();
detail_list_control_info_materialVersion.put("control", "Text");
@ -2350,7 +2405,6 @@ public class QyWxOperationService {
detail_list_control_info_stockTakingInventory.put("value", detail_list_control_info_value_stockTakingInventory);
detail_list_control.add(detail_list_control_info_materialName);
detail_list_control.add(detail_list_control_info_materialCode);
detail_list_control.add(detail_list_control_info_materialType);
@ -2433,10 +2487,9 @@ public class QyWxOperationService {
}
/**
* 用于当在系统内进行审批后向其他所有用户发送消息
*
* @param mainId
* @param uid
* @param userAgent

18
src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java

@ -259,17 +259,21 @@ public class StockTakingServiceImpl implements StockTakingService {
@Override
public List<StockTakingChildP> findStockTakingChildPByMainId(Integer mainId) {
List<StockTakingChildP> stockTakingChildPS = stockTakingMapper.selectStockTakingChildByMainId(mainId);
for (int i = 0; i < stockTakingChildPS.size(); i++) {
StockTakingChildP stockTakingChildP = stockTakingChildPS.get(i);
for (StockTakingChildP stockTakingChildP : stockTakingChildPS) {
if ("Inventory_up".equals(stockTakingChildP.getTakingResult())) {
stockTakingChildPS.get(i).setTakingResultShow("盘盈");
stockTakingChildP.setTakingResultShow("盘盈");
} else if ("Inventory_down".equals(stockTakingChildP.getTakingResult())) {
stockTakingChildPS.get(i).setTakingResultShow("盘亏");
stockTakingChildP.setTakingResultShow("盘亏");
} else {
stockTakingChildPS.get(i).setTakingResultShow("正常");
stockTakingChildP.setTakingResultShow("正常");
}
stockTakingChildP.setShowUnit(stockTakingChildP.getUnit());
if("-1".equals(stockTakingChildP.getShowUnit())){
Inventory inventoryById = materialMapper.findInventoryById(stockTakingChildP.getMid());
stockTakingChildP.setShowUnit(inventoryById.getUnit());
}
List<MaterialAndBarCode> materialByBarCodeByMcode = materialMapper.findMaterialByBarCodeByMcode(stockTakingChildP.getMcode());
stockTakingChildPS.get(i).setMaterialAndBarCodeList(materialByBarCodeByMcode);
stockTakingChildP.setMaterialAndBarCodeList(materialByBarCodeByMcode);
}
return stockTakingChildPS;
}
@ -380,7 +384,7 @@ public class StockTakingServiceImpl implements StockTakingService {
Inventory inventoryById = materialMapper.findInventoryById(minRecord.getMid());
Map<String, Object> paramForMaterialAndPlace = new HashMap<>();
paramForMaterialAndPlace.put("mid", inventoryById.getMid());
paramForMaterialAndPlace.put("mid", inventoryById.getId());
paramForMaterialAndPlace.put("pid", placeById.getId());
// 获取物料与库位的对应关系
MaterialAndPlace placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForMaterialAndPlace);

4
src/main/resources/static/js/lay-config.js

@ -9,9 +9,9 @@ window.rootPath = (function (src) {
src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
// alert(rootPath)
layui.config({
base: rootPath + "lay-module/",
// base: rootPath + "lay-module/",
base: "https://jy.hxgk.group/static/js/" + "lay-module/",
version: true
}).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展

28
src/main/resources/templates/pages/application/application-in.html

@ -253,14 +253,16 @@
class="layui-input" lay-verify="required"
style="border-style: none">
<img src="/static/images/search.ico" height="16" width="16"
style="margin-top: 10px;display: none" onclick="scanCodeByOut(this)">
style="margin-top: 10px;display: none"
onclick="scanCodeByOut(this)">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">组合数量:</label>
<div class="layui-input-block">
<input type="number" name="quantity" class="layui-input" id="quantityForGroup"
<input type="number" name="quantity" class="layui-input"
id="quantityForGroup"
required lay-verify="number" placeholder="请填写组合数量"/>
</div>
</div>
@ -301,7 +303,8 @@
<!--提交按钮-->
<div class="layui-form-item" id="btn_sub2">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formStep2" type="button"
<button class="layui-btn" lay-submit lay-filter="formStep2"
type="button"
style="margin-bottom: 30px;margin-left: 15%">
&emsp;提交&emsp;
</button>
@ -364,6 +367,7 @@
function selectDepositroy(object) {
}
// 用于扫码入库
function scanCodeInStorage(obj) {
}
@ -405,6 +409,7 @@
function deleteItemForGroup() {
}
// 实现卡片添加(组合)
function addItemForGroup() {
@ -982,10 +987,6 @@
var priceValue = priceItem[1];
// 条形码条码
var barCodeItem = barCodeChildren.childNodes[3];
var code = data.code;
if (code === undefined) {
code = "";
}
if (data === null) {
// 如果没有对应关系
layer.msg("对于编码:" + result + ",并未发现对应的物料", {
@ -994,6 +995,10 @@
}, function () {
})
} else {
var code = data.code;
if (code === undefined) {
code = "";
}
materialName.value = data.mname;
materialId.value = data.mid;
codeValue.value = code;
@ -1033,7 +1038,7 @@
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(data.unit, "-1"));
unit.append(new Option(data.unit, "-1"));
var unitList = data["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
@ -1084,7 +1089,6 @@
var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
var mname = materialName.value;
// 单价条目
var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1];
@ -1186,8 +1190,6 @@
});
};
// 用于扫描入库位置
scanLocationByQrCode = function (obj) {
parent.wx.scanQRCode({
@ -1341,6 +1343,7 @@
if (gid !== '') {
let req = {};
req.gid = gid;
req.type = "in";
$.ajax({
url: "/group/findGroupInfoByGid",
data: JSON.stringify(req),
@ -1471,8 +1474,7 @@
}
}
})
}
else{
} else {
gcodeItem.value = '';
gidItem.value = '';
let childNodes = parent.childNodes;

177
src/main/resources/templates/pages/application/application-in_scanQrCode.html

@ -28,15 +28,15 @@
.layui-input-block {
margin-left: 80px;
}
.layui-form-select {
width: 100%;
}
.lay-step {
display: none;
}
.layui-form-select .layui-input{
border-style: none;
}
</style>
@ -51,7 +51,8 @@
<input th:value="${place}" style="display: none" id="scanValue_placeId">
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form layui-form-pane" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
<form class="layui-form layui-form-pane"
style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
<div class="layui-card" id="cardParent">
@ -117,6 +118,7 @@
function scanLocationByQrCode(obj) {
}
// 用于物料名称查询
function selectMaterialByName(obj) {
}
@ -251,6 +253,14 @@
</div>`;
}
var splitInfoList = obj.splitList;
let splitInfoItem = "";
if (splitInfoList !== undefined) {
for (let i = 0; i < splitInfoList.length; i++) {
let optinItem = "<option value=" + splitInfoList[i].newUnit + ">" + splitInfoList[i].newUnit + "</option>";
splitInfoItem += optinItem;
}
}
var firstItem =
// 前半部分
` <div class="layui-card-body" style="padding-right: 0px" id=` + "cardItem" + NewIdNumber + `>
@ -301,7 +311,17 @@
<input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value=""
class="layui-input" lay-verify="number">
</div>
</div>`;
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<select id=` + "unit" + NewIdNumber + ` name=` + "unit" + NewIdNumber + `>
<option value="-1">${obj.unit}</option>
` + splitInfoItem + `
</select>
</div>
</div>
`;
var lastItem = `<div class="layui-form-item">
@ -318,7 +338,7 @@
if (NewIdNumber !== "") {
params.push(NewIdNumber)
}
$("#stepForm").css("height", height + 475 + 'px');
$("#stepForm").css("height", height + 495 + 'px');
var materialItem = firstItem + depositoryItem + lastItem; // 最终
$("#btn_sub").prepend(materialItem)
};
@ -362,7 +382,7 @@
var success = d["success"];
var errMsg = "";
for (let i = 0; i < err.length; i++) {
errMsg += "物料编码: "
errMsg += "物料编码: ";
errMsg += err[i]["code"];
}
errMsg += "添加失败,请选择新仓库或库位";
@ -528,7 +548,16 @@
<input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value=""
class="layui-input" lay-verify="number">
</div>
</div>`;
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<select id=` + "unit" + NewIdNumber + ` name=` + "unit" + NewIdNumber + ` style="border-style: solid;border-radius: 0 2px 2px 0">
</select>
</div>
</div>
`;
var lastItem = `<div class="layui-form-item">
@ -542,8 +571,8 @@
</div>`;
// 获取当前高度
var height = parseInt(($("#stepForm").css('height')).split("px")[0]);
params.push(NewIdNumber)
$("#stepForm").css("height", height + 535 + 'px');
params.push(NewIdNumber);
$("#stepForm").css("height", height + 555 + 'px');
var materialItem = firstItem + depositoryItem + lastItem;
$("#" + parentId).after(materialItem);
};
@ -557,7 +586,7 @@
// 获取祖父节点
var reparent = parent.parentNode;
var height = parseInt(($("#stepForm").css('height')).split("px")[0]);
$("#stepForm").css("height", height - 535 + 'px');
$("#stepForm").css("height", height - 555 + 'px');
params = remove(params, parentId);
reparent.removeChild(parent);
};
@ -581,7 +610,7 @@
// 输入code
var code = obj.value;
// 获取对应元素
var parent = obj.parentNode.parentNode.parentNode;
var parent = obj.parentNode.parentNode.parentNode.parentNode;
var materialChildren = parent.childNodes[5];
var priceChildren = parent.childNodes[11];
var barCodeChildren = parent.childNodes[9];
@ -621,6 +650,14 @@
priceValue.value = d.price;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var splitInfoList = d["splitInfoList"];
let unit = $("#unit" + idNumber);
unit.empty();
unit.append(new Option(d.unit, "-1"));
$.each(splitInfoList, function (index, item) {
unit.append(new Option(item.newUnit, item.newUnit));//往下拉菜单里添加元素
});
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
@ -643,8 +680,7 @@
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
}
else{
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
@ -661,13 +697,22 @@
var parentId = parent.id;
var codeChildren = parent.childNodes[7];
var materialChildren = parent.childNodes[5];
var priceChildren = parent.childNodes[11];
var codeItem = codeChildren.childNodes[3].childNodes;
var codeValue = codeItem[1];
var codeValue = codeItem[1].childNodes[1];
var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
// 单价条目
var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1];
var mname = materialName.value;
mname = mname.split(",")[0];
// 条形码条码
// 条形码
var barCodeChildren = parent.childNodes[9];
var barCodeItem = barCodeChildren.childNodes[3];
var idNumber = materialId.id.split("mid")[1];
layer.open({
type: 2,
title: '弹窗内容',
@ -688,6 +733,7 @@
},
end: function () {
var mid = materialId.value;
if (mid !== '') {
$.ajax({
url: "/material/findMatrialById?mid=" + mid,
type: "get",
@ -700,8 +746,47 @@
code = "";
}
codeValue.value = code;
priceValue.value = material.price;
var materialAndBarCodeList = material["materialAndBarCodeList"];
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var idNumber = materialId.name.split("mid")[1];
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var id = barCodeInput.id;
$("#" + id).remove();
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
}
var shelfLife = material.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(material.unit, "-1"));
var unitList = material["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
}
});
}
}
});
@ -741,10 +826,28 @@
materialName.value = "";
return false;
} else {
var idNumber = materialId.name.split("mid")[1];
var material = d.data[0];
materialName.value = material.mname;
materialId.value = material.id;
materialId.value = material.mid;
codeValue.value = material.code;
var shelfLife = material.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(material.unit, "-1"));
var unitList = material["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
}
}
});
@ -773,20 +876,21 @@
var codeChildren = parent.childNodes[7];
var priceChildren = parent.childNodes[11];
var materialChildren = parent.childNodes[5];
// 条形码
var barCodeChildren = parent.childNodes[9];
var codeItem = codeChildren.childNodes[3].childNodes[1];
var codeValue = codeItem.childNodes[1];
var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
var mname = materialName.value;
// 单价条目
var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1];
// 条形码条码
// 条形码
var barCodeChildren = parent.childNodes[9];
var barCodeItem = barCodeChildren.childNodes[3];
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
if (material !== null) {
// 如果发现对应关系
// 条形码条码
var code = material.mcode;
if (code === undefined) {
code = "";
@ -795,10 +899,27 @@
materialId.value = material.mid;
codeValue.value = code;
priceValue.value = material.price;
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
barCodeInput.value = result;
var idNumber = materialId.name.split("mid")[1];
var shelfLife = material.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
form.render();
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(material.unit, "-1"));
var unitList = material["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
}
}
})
},
@ -810,7 +931,7 @@
}
});
}
};
// 用于打开仓库树形菜单
openDepositoryTree = function (obj) {
@ -834,7 +955,7 @@
iframeChildren.css('height', '100%');
}
});
}
};
// 用于扫码入库
scanCodeInStorage = function (obj) {
@ -906,6 +1027,14 @@
});
form.render();
}
var unit = $("#unit" + idNumber);
unit.empty();
unit.append(new Option(data.unit, "-1"));
var unitList = data["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
}
})
}

2
src/main/resources/templates/pages/application/application-out_min-mobile.html

@ -69,6 +69,7 @@
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' +
'<h4> 生产日期:' + producedDate + '</h4>' +
@ -90,6 +91,7 @@
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</h4>' +

1
src/main/resources/templates/pages/application/application-out_min.html

@ -70,6 +70,7 @@
{title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'},
{field: 'version', width: 120, title: '规格型号'},
{field: 'mcode', width: 120, title: '物料编码'},
{field: 'producedDate', width: 120, title: '生产日期'},
{field: 'depositoryName', width: 120, title: '仓库名称'},

16
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -164,7 +164,8 @@
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})
} else if (flag === 1) {
}
else if (flag === 1) {
// 如果是物料
material = data.material;
if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) {
@ -191,9 +192,10 @@
parent.layer.close(index);
})
} else {
}
else {
if (depository !== null) { // 如果已经扫描仓库
if (depositoryId !== depository.did && Number(depositoryId) !== depository.did && depositoryId !== depository.did.toString()) {
if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) {
// 如果扫描的仓库不是订单要求的仓库
layer.confirm("当前仓库不符合要求,请移步至正确仓库", {
btn: ["确定"]
@ -206,9 +208,9 @@
// 如果是出库位置为默认库位
var param = {};
param.id = id;
param.placeId = place.id;
param.qrCode = qrCode;
param.barCode = barCode;
// 弹出确定框
outQuantityCheck(param);
}
@ -278,7 +280,8 @@
}
}
} else if (flag === 2) {
}
else if (flag === 2) {
// 如果扫描的为库位
place = data.place;// 将扫描结果保存到vue中
if (material == null) {
@ -361,7 +364,8 @@
}
} else if (flag === 3) {
}
else if (flag === 3) {
// 如果是仓库
depository = data.depository;// 将扫描结果保存到vue中

2
src/main/resources/templates/pages/stockTaking/stockTakingReview.html

@ -169,7 +169,7 @@
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getUnit()}"
th:value="${recordMin.getShowUnit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>

2
src/main/resources/templates/pages/stockTaking/stockTakingView.html

@ -172,7 +172,7 @@
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getUnit()}"
th:value="${recordMin.getShowUnit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>

4
target/classes/static/js/lay-config.js

@ -9,9 +9,9 @@ window.rootPath = (function (src) {
src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
// alert(rootPath)
layui.config({
base: rootPath + "lay-module/",
// base: rootPath + "lay-module/",
base: "https://jy.hxgk.group/static/js/" + "lay-module/",
version: true
}).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展

2
target/classes/templates/pages/application/application-out_min-mobile.html

@ -69,6 +69,7 @@
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' +
'<h4> 生产日期:' + producedDate + '</h4>' +
@ -90,6 +91,7 @@
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</h4>' +

1
target/classes/templates/pages/application/application-out_min.html

@ -70,6 +70,7 @@
{title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'},
{field: 'version', width: 120, title: '规格型号'},
{field: 'mcode', width: 120, title: '物料编码'},
{field: 'producedDate', width: 120, title: '生产日期'},
{field: 'depositoryName', width: 120, title: '仓库名称'},

16
target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -164,7 +164,8 @@
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})
} else if (flag === 1) {
}
else if (flag === 1) {
// 如果是物料
material = data.material;
if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) {
@ -191,9 +192,10 @@
parent.layer.close(index);
})
} else {
}
else {
if (depository !== null) { // 如果已经扫描仓库
if (depositoryId !== depository.did && Number(depositoryId) !== depository.did && depositoryId !== depository.did.toString()) {
if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) {
// 如果扫描的仓库不是订单要求的仓库
layer.confirm("当前仓库不符合要求,请移步至正确仓库", {
btn: ["确定"]
@ -206,9 +208,9 @@
// 如果是出库位置为默认库位
var param = {};
param.id = id;
param.placeId = place.id;
param.qrCode = qrCode;
param.barCode = barCode;
// 弹出确定框
outQuantityCheck(param);
}
@ -278,7 +280,8 @@
}
}
} else if (flag === 2) {
}
else if (flag === 2) {
// 如果扫描的为库位
place = data.place;// 将扫描结果保存到vue中
if (material == null) {
@ -361,7 +364,8 @@
}
} else if (flag === 3) {
}
else if (flag === 3) {
// 如果是仓库
depository = data.depository;// 将扫描结果保存到vue中

2
target/classes/templates/pages/stockTaking/stockTakingReview.html

@ -169,7 +169,7 @@
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getUnit()}"
th:value="${recordMin.getShowUnit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>

2
target/classes/templates/pages/stockTaking/stockTakingView.html

@ -172,7 +172,7 @@
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getUnit()}"
th:value="${recordMin.getShowUnit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>

Loading…
Cancel
Save