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. 56
      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. 647
      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. 88
      src/main/resources/templates/pages/application/application-in.html
  12. 253
      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.setPcode(sb.toString());
simpleApplicationOutMinRecordP.setPid(placeByDid.getId()); simpleApplicationOutMinRecordP.setPid(placeByDid.getId());
simpleApplicationOutMinRecordP.setState(state); simpleApplicationOutMinRecordP.setState(state);
simpleApplicationOutMinRecordP.setVersion(materialById.getVersion());
applicationOutRecordMinList.add(simpleApplicationOutMinRecordP); applicationOutRecordMinList.add(simpleApplicationOutMinRecordP);
} }

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

@ -59,7 +59,7 @@ public class GroupController {
} }
@PostMapping("/findGroupByCodeForIn") @PostMapping("/findGroupByCodeForIn")
public RestResponse findGroupByCodeForIn (@RequestBody Map<String, Object> map, HttpServletRequest request) { public RestResponse findGroupByCodeForIn(@RequestBody Map<String, Object> map, HttpServletRequest request) {
String code = map.get("code").toString(); String code = map.get("code").toString();
// 获取组合编码 // 获取组合编码
@ -67,7 +67,7 @@ public class GroupController {
if (groupByCode != null) { if (groupByCode != null) {
List<GroupInfo> groupByGid = groupService.findGroupInfoByGid(groupByCode.getId()); List<GroupInfo> groupByGid = groupService.findGroupInfoByGid(groupByCode.getId());
return new RestResponse(groupByGid); return new RestResponse(groupByGid);
}else{ } else {
return new RestResponse(null, 666, new StatusInfo("失败", "暂无该组合,请确认是否正确")); return new RestResponse(null, 666, new StatusInfo("失败", "暂无该组合,请确认是否正确"));
} }
} }
@ -75,7 +75,8 @@ public class GroupController {
/** /**
* 用于出库时查找对应编码的组合 * 用于出库时查找对应编码的组合
* @param map 查询条件 *
* @param map 查询条件
* @param request * @param request
* @return * @return
*/ */
@ -94,7 +95,6 @@ public class GroupController {
if (groupByCode != null) { if (groupByCode != null) {
List<GroupInfo> groupByGid = groupService.findGroupInfoByGid(groupByCode.getId()); List<GroupInfo> groupByGid = groupService.findGroupInfoByGid(groupByCode.getId());
// 用于标识当前组合是否可以正常出库 // 用于标识当前组合是否可以正常出库
@ -123,7 +123,7 @@ public class GroupController {
if (flag) { if (flag) {
return new RestResponse(groupByGid); return new RestResponse(groupByGid);
} else { } else {
return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中的 "+errMsg.toString()+"库存不足")); return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中的 " + errMsg.toString() + "库存不足"));
} }
} else { } else {
return new RestResponse(null, 666, new StatusInfo("失败", "暂无该组合,请确认是否正确")); return new RestResponse(null, 666, new StatusInfo("失败", "暂无该组合,请确认是否正确"));
@ -349,33 +349,37 @@ public class GroupController {
// 定义错误信息 // 定义错误信息
StringBuilder errMsg = new StringBuilder(); StringBuilder errMsg = new StringBuilder();
String type = (String) map.get("type");
// 用于标识当前组合是否可以正常出库 // 用于标识当前组合是否可以正常出库
boolean flag = true; boolean flag = true;
for (GroupInfo groupInfo : groupByGid) {
if (!"in".equals(type)) {
// 获取详细信息 for (GroupInfo groupInfo : groupByGid) {
// 获取该物料的库存
List<Integer> inventoryByMidAndDepository = materialService.findInventoryByMidAndDepository(groupInfo, depositoryByAdminorg); // 获取详细信息
// 用于标志当前物料库存是否符合要求 // 获取该物料的库存
boolean flagForQuantity = false; List<Integer> inventoryByMidAndDepository = materialService.findInventoryByMidAndDepository(groupInfo, depositoryByAdminorg);
for (Integer quantity : inventoryByMidAndDepository) { // 用于标志当前物料库存是否符合要求
// 如果库存符合要求 boolean flagForQuantity = false;
if (quantity > groupInfo.getQuantity()) { for (Integer quantity : inventoryByMidAndDepository) {
flagForQuantity = true; // 如果库存符合要求
if (quantity >= groupInfo.getQuantity()) {
flagForQuantity = true;
}
}
if (!flagForQuantity) {
// 如果当前不符合
flag = false;
errMsg.append(" ").append(groupInfo.getMname()).append(" ");
break;
} }
}
if (!flagForQuantity) {
// 如果当前不符合
flag = false;
errMsg.append(" ").append(groupInfo.getMname()).append(" ");
break;
}
}
} }
if (flag) { if (flag) {
return new RestResponse(groupByGid); return new RestResponse(groupByGid);
} else { } else {
return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中的"+errMsg+"在仓库中库存不足")); return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中的" + errMsg + "在仓库中库存不足"));
} }
} }
@ -471,6 +475,7 @@ public class GroupController {
/** /**
* 用于构造组合入库单 * 用于构造组合入库单
*
* @param map 入库数据 * @param map 入库数据
* @param request * @param request
* @return * @return
@ -503,12 +508,13 @@ public class GroupController {
} catch (Exception e) { } catch (Exception e) {
return new RestResponse("", 666, new StatusInfo("出库失败", e.getMessage())); return new RestResponse("", 666, new StatusInfo("出库失败", e.getMessage()));
} }
return CrudUtil.putHandle(result,integer); return CrudUtil.putHandle(result, integer);
} }
/** /**
* 用于构造组合出库单 * 用于构造组合出库单
*
* @param map 出库数据 * @param map 出库数据
* @param request * @param request
* @return * @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<MaterialP> materialPByCondition = new ArrayList<>();
List<InventoryP> inventoryPByCondition = new ArrayList<>(); List<InventoryP> inventoryPByCondition = new ArrayList<>();
param.put("mcode", code); param.put("mcode", code);
for (int i = 0; i < depositoryByAdminorg.size(); i++) { for (Depository depository : depositoryByAdminorg) {
param.put("depositoryId", depositoryByAdminorg.get(i).getId()); param.put("depositoryId", depository.getId());
// 查找当前用户部门仓库中是否存在该物料 // 查找当前用户部门仓库中是否存在该物料
inventoryPByCondition = materialService.findInventory(param); inventoryPByCondition = materialService.findInventory(param);
if (inventoryPByCondition.size() > 0) { 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(); Integer departmentManagerState = stp.getDepartmentManagerState();
if (Integer.compare(departmentManagerState, 3) == 0) { if (Integer.compare(departmentManagerState, 3) == 0) {
// 如果当前盘点记录未经过负责人处理 // 如果当前盘点记录未经过负责人处理
// 跳转到审核页面 // 跳转到审核页面
mv.setViewName("pages/stockTaking/stockTakingReview"); mv.setViewName("pages/stockTaking/stockTakingReview");
} else { } else {
@ -2099,10 +2100,11 @@ public class PageController {
JSONObject jsonObject = JSONObject.parseObject(scanQrCodeValue); JSONObject jsonObject = JSONObject.parseObject(scanQrCodeValue);
JSONArray mids = (JSONArray) jsonObject.get("mids"); JSONArray mids = (JSONArray) jsonObject.get("mids");
List<Object> materialList = new ArrayList<>(); List<Object> materialList = new ArrayList<>();
for (int i = 0; i < mids.size(); i++) { for (Object mid : mids) {
Map<String, Object> param = new HashMap<>(); 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)); MaterialP mp = new MaterialP(materialService.findMaterialById(o));
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(mp.getId());
param.put("mid", mp.getId()); param.put("mid", mp.getId());
param.put("mname", mp.getMname()); param.put("mname", mp.getMname());
param.put("code", mp.getCode()); param.put("code", mp.getCode());
@ -2110,6 +2112,8 @@ public class PageController {
param.put("version", mp.getVersion()); param.put("version", mp.getVersion());
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
param.put("materialAndBarCodeList", materialByBarCodeByCondition); param.put("materialAndBarCodeList", materialByBarCodeByCondition);
param.put("splitList",splitInfoByMid);
param.put("unit",mp.getUnit());
String context = JSONObject.toJSONString(param); String context = JSONObject.toJSONString(param);
materialList.add(context); materialList.add(context);
} }

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

@ -16,6 +16,8 @@ public class Depository {
/** id */ /** id */
private Integer id; private Integer id;
/** 仓库名称 */ /** 仓库名称 */
private String dname; 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 showQuantity;
/**
* 物料规格型号
*/
private String version;
public SimpleApplicationOutMinRecordP(ApplicationOutRecordMin applicationOutRecordMin) { public SimpleApplicationOutMinRecordP(ApplicationOutRecordMin applicationOutRecordMin) {
this.id = applicationOutRecordMin.getId(); this.id = applicationOutRecordMin.getId();
this.parentId = applicationOutRecordMin.getParentId(); 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 unit;
/**
* 用于展示当前盘点的计量单位
*/
private String showUnit;

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

File diff suppressed because it is too large

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

@ -259,17 +259,21 @@ public class StockTakingServiceImpl implements StockTakingService {
@Override @Override
public List<StockTakingChildP> findStockTakingChildPByMainId(Integer mainId) { public List<StockTakingChildP> findStockTakingChildPByMainId(Integer mainId) {
List<StockTakingChildP> stockTakingChildPS = stockTakingMapper.selectStockTakingChildByMainId(mainId); List<StockTakingChildP> stockTakingChildPS = stockTakingMapper.selectStockTakingChildByMainId(mainId);
for (int i = 0; i < stockTakingChildPS.size(); i++) { for (StockTakingChildP stockTakingChildP : stockTakingChildPS) {
StockTakingChildP stockTakingChildP = stockTakingChildPS.get(i);
if ("Inventory_up".equals(stockTakingChildP.getTakingResult())) { if ("Inventory_up".equals(stockTakingChildP.getTakingResult())) {
stockTakingChildPS.get(i).setTakingResultShow("盘盈"); stockTakingChildP.setTakingResultShow("盘盈");
} else if ("Inventory_down".equals(stockTakingChildP.getTakingResult())) { } else if ("Inventory_down".equals(stockTakingChildP.getTakingResult())) {
stockTakingChildPS.get(i).setTakingResultShow("盘亏"); stockTakingChildP.setTakingResultShow("盘亏");
} else { } 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()); List<MaterialAndBarCode> materialByBarCodeByMcode = materialMapper.findMaterialByBarCodeByMcode(stockTakingChildP.getMcode());
stockTakingChildPS.get(i).setMaterialAndBarCodeList(materialByBarCodeByMcode); stockTakingChildP.setMaterialAndBarCodeList(materialByBarCodeByMcode);
} }
return stockTakingChildPS; return stockTakingChildPS;
} }
@ -380,7 +384,7 @@ public class StockTakingServiceImpl implements StockTakingService {
Inventory inventoryById = materialMapper.findInventoryById(minRecord.getMid()); Inventory inventoryById = materialMapper.findInventoryById(minRecord.getMid());
Map<String, Object> paramForMaterialAndPlace = new HashMap<>(); Map<String, Object> paramForMaterialAndPlace = new HashMap<>();
paramForMaterialAndPlace.put("mid", inventoryById.getMid()); paramForMaterialAndPlace.put("mid", inventoryById.getId());
paramForMaterialAndPlace.put("pid", placeById.getId()); paramForMaterialAndPlace.put("pid", placeById.getId());
// 获取物料与库位的对应关系 // 获取物料与库位的对应关系
MaterialAndPlace placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForMaterialAndPlace); 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; src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1); return src.substring(0, src.lastIndexOf("/") + 1);
})(); })();
// alert(rootPath)
layui.config({ layui.config({
base: rootPath + "lay-module/", // base: rootPath + "lay-module/",
base: "https://jy.hxgk.group/static/js/" + "lay-module/",
version: true version: true
}).extend({ }).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展 miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展

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

@ -253,14 +253,16 @@
class="layui-input" lay-verify="required" class="layui-input" lay-verify="required"
style="border-style: none"> style="border-style: none">
<img src="/static/images/search.ico" height="16" width="16" <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>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">组合数量:</label> <label class="layui-form-label">组合数量:</label>
<div class="layui-input-block"> <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="请填写组合数量"/> required lay-verify="number" placeholder="请填写组合数量"/>
</div> </div>
</div> </div>
@ -301,7 +303,8 @@
<!--提交按钮--> <!--提交按钮-->
<div class="layui-form-item" id="btn_sub2"> <div class="layui-form-item" id="btn_sub2">
<div class="layui-input-block"> <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%"> style="margin-bottom: 30px;margin-left: 15%">
&emsp;提交&emsp; &emsp;提交&emsp;
</button> </button>
@ -364,6 +367,7 @@
function selectDepositroy(object) { function selectDepositroy(object) {
} }
// 用于扫码入库 // 用于扫码入库
function scanCodeInStorage(obj) { function scanCodeInStorage(obj) {
} }
@ -402,11 +406,12 @@
} }
// 实现卡片删除(组合) // 实现卡片删除(组合)
function deleteItemForGroup(){ function deleteItemForGroup() {
} }
// 实现卡片添加(组合) // 实现卡片添加(组合)
function addItemForGroup(){ function addItemForGroup() {
} }
@ -419,7 +424,7 @@
// 用于暂存卡片个数(组合) // 用于暂存卡片个数(组合)
var params2 = []; var params2 = [];
layui.use(['form', 'step', 'flow', 'laydate','element'], function () { layui.use(['form', 'step', 'flow', 'laydate', 'element'], function () {
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
laydate = layui.laydate, laydate = layui.laydate,
@ -982,10 +987,6 @@
var priceValue = priceItem[1]; var priceValue = priceItem[1];
// 条形码条码 // 条形码条码
var barCodeItem = barCodeChildren.childNodes[3]; var barCodeItem = barCodeChildren.childNodes[3];
var code = data.code;
if (code === undefined) {
code = "";
}
if (data === null) { if (data === null) {
// 如果没有对应关系 // 如果没有对应关系
layer.msg("对于编码:" + result + ",并未发现对应的物料", { layer.msg("对于编码:" + result + ",并未发现对应的物料", {
@ -994,6 +995,10 @@
}, function () { }, function () {
}) })
} else { } else {
var code = data.code;
if (code === undefined) {
code = "";
}
materialName.value = data.mname; materialName.value = data.mname;
materialId.value = data.mid; materialId.value = data.mid;
codeValue.value = code; codeValue.value = code;
@ -1033,7 +1038,7 @@
} }
var unit = $("#unit" + idNumber); var unit = $("#unit" + idNumber);
unit.empty(); unit.empty();
$("#unit" + idNumber).append(new Option(data.unit, "-1")); unit.append(new Option(data.unit, "-1"));
var unitList = data["splitInfoList"]; var unitList = data["splitInfoList"];
for (let i = 0; i < unitList.length; i++) { for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
@ -1084,7 +1089,6 @@
var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes; var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1]; var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3]; var materialId = materialName.parentNode.parentNode.childNodes[3];
var mname = materialName.value;
// 单价条目 // 单价条目
var priceItem = priceChildren.childNodes[3].childNodes; var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1]; var priceValue = priceItem[1];
@ -1186,8 +1190,6 @@
}); });
}; };
// 用于扫描入库位置 // 用于扫描入库位置
scanLocationByQrCode = function (obj) { scanLocationByQrCode = function (obj) {
parent.wx.scanQRCode({ parent.wx.scanQRCode({
@ -1264,7 +1266,7 @@
layer.msg(d.statusInfo.detail, { layer.msg(d.statusInfo.detail, {
icon: 0, icon: 0,
time: 1500 time: 1500
},function () { }, function () {
obj.value = ''; obj.value = '';
gidItem.value = ''; gidItem.value = '';
gnameItem.value = ''; gnameItem.value = '';
@ -1298,7 +1300,7 @@
}; };
// 用于实现点击搜索按钮(组合) // 用于实现点击搜索按钮(组合)
selectGroup = function(obj){ selectGroup = function (obj) {
var parent = obj.parentNode.parentNode.parentNode.parentNode; var parent = obj.parentNode.parentNode.parentNode.parentNode;
var parentId = parent.id; var parentId = parent.id;
@ -1336,11 +1338,12 @@
content.css('height', '100%'); content.css('height', '100%');
iframeChildren.css('height', '100%'); iframeChildren.css('height', '100%');
}, },
end:function () { end: function () {
let gid = gidItem.value; let gid = gidItem.value;
if(gid !== ''){ if (gid !== '') {
let req = {}; let req = {};
req.gid = gid; req.gid = gid;
req.type = "in";
$.ajax({ $.ajax({
url: "/group/findGroupInfoByGid", url: "/group/findGroupInfoByGid",
data: JSON.stringify(req), data: JSON.stringify(req),
@ -1353,7 +1356,7 @@
layer.msg(d.statusInfo.detail, { layer.msg(d.statusInfo.detail, {
icon: 0, icon: 0,
time: 1500 time: 1500
},function () { }, function () {
obj.value = ''; obj.value = '';
gidItem.value = ''; gidItem.value = '';
gnameItem.value = ''; gnameItem.value = '';
@ -1389,7 +1392,7 @@
}; };
// 用于实现组合名称搜索 // 用于实现组合名称搜索
selectGroupByName = function(obj){ selectGroupByName = function (obj) {
let gname = obj.value; let gname = obj.value;
var parent = obj.parentNode.parentNode.parentNode.parentNode; var parent = obj.parentNode.parentNode.parentNode.parentNode;
// 获取对应元素 // 获取对应元素
@ -1405,7 +1408,7 @@
// gid // gid
let gidItem = gnameParent.childNodes[3]; let gidItem = gnameParent.childNodes[3];
if(gname !== ''){ if (gname !== '') {
var req = {}; var req = {};
@ -1417,12 +1420,12 @@
data: JSON.stringify(req), data: JSON.stringify(req),
contentType: "application/json;charset=utf-8", contentType: "application/json;charset=utf-8",
success: function (d) { success: function (d) {
if(d.count === -1){ if (d.count === -1) {
// 如果当前组合名称的数量不止一个 // 如果当前组合名称的数量不止一个
layer.msg("请点击右侧搜索确定物品", { layer.msg("请点击右侧搜索确定物品", {
icon: 0, icon: 0,
time: 1500 time: 1500
},function () { }, function () {
obj.value = ''; obj.value = '';
gidItem.value = ''; gidItem.value = '';
gcodeItem.value = ''; gcodeItem.value = '';
@ -1433,12 +1436,12 @@
} }
} }
}); });
}else if(d.count === 0){ } else if (d.count === 0) {
// 如果当前组合名称不存在 // 如果当前组合名称不存在
layer.msg("没有该组合,请确认输入是否正确", { layer.msg("没有该组合,请确认输入是否正确", {
icon: 0, icon: 0,
time: 1500 time: 1500
},function () { }, function () {
obj.value = ''; obj.value = '';
gidItem.value = ''; gidItem.value = '';
gcodeItem.value = ''; gcodeItem.value = '';
@ -1449,7 +1452,7 @@
} }
} }
}); });
}else{ } else {
// 正常 // 正常
let data = d.data; let data = d.data;
let childNodes = parent.childNodes; let childNodes = parent.childNodes;
@ -1471,8 +1474,7 @@
} }
} }
}) })
} } else {
else{
gcodeItem.value = ''; gcodeItem.value = '';
gidItem.value = ''; gidItem.value = '';
let childNodes = parent.childNodes; let childNodes = parent.childNodes;
@ -1555,10 +1557,10 @@
$.each(data.placePList, function (index, item) { $.each(data.placePList, function (index, item) {
$('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素 $('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
}); });
$("#unit"+idNumber).empty(); $("#unit" + idNumber).empty();
$("#unit"+idNumber).append(new Option(data.unit,"-1")); $("#unit" + idNumber).append(new Option(data.unit, "-1"));
$.each(data.splitInfoList,function (index,item) { $.each(data.splitInfoList, function (index, item) {
$("#unit"+idNumber).append(new Option(item.newUnit,item.newUnit)); $("#unit" + idNumber).append(new Option(item.newUnit, item.newUnit));
}); });
form.render(); form.render();
materialName.value = data.mname; materialName.value = data.mname;
@ -1599,13 +1601,13 @@
<div class="inputdiv"> <div class="inputdiv">
<input type="text" placeholder="请选择组合" class="layui-input" <input type="text" placeholder="请选择组合" class="layui-input"
style="border-style: none" style="border-style: none"
id=`+"openGroupList"+NewIdNumber+` onblur="selectGroupByName(this)" id=` + "openGroupList" + NewIdNumber + ` onblur="selectGroupByName(this)"
lay-verify="required"/> lay-verify="required"/>
<i class="layui-icon layui-icon-search" <i class="layui-icon layui-icon-search"
style="display: inline" style="display: inline"
id=`+"selectGroup"+NewIdNumber+` onclick="selectGroup(this)"></i> id=` + "selectGroup" + NewIdNumber + ` onclick="selectGroup(this)"></i>
</div> </div>
<input type="text" name=`+"gid"+NewIdNumber+` class="layui-input" id=`+"gid"+NewIdNumber+` <input type="text" name=` + "gid" + NewIdNumber + ` class="layui-input" id=` + "gid" + NewIdNumber + `
style="display: none" lay-verify="required"/> style="display: none" lay-verify="required"/>
</div> </div>
</div> </div>
@ -1625,7 +1627,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">组合数量:</label> <label class="layui-form-label">组合数量:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="number" name=`+"quantity"+NewIdNumber+` class="layui-input" id=`+"quantityForGroup"+NewIdNumber+` <input type="number" name=` + "quantity" + NewIdNumber + ` class="layui-input" id=` + "quantityForGroup" + NewIdNumber + `
required lay-verify="number" placeholder="请填写组合数量"/> required lay-verify="number" placeholder="请填写组合数量"/>
</div> </div>
</div> </div>
@ -1635,17 +1637,17 @@
<div class="inputdiv"> <div class="inputdiv">
<input type="text" placeholder="请选择仓库" class="layui-input" <input type="text" placeholder="请选择仓库" class="layui-input"
style="border-style: none" style="border-style: none"
id=`+"selectDepository"+NewIdNumber+` readonly id=` + "selectDepository" + NewIdNumber + ` readonly
onclick="selectDepositroy(this)" onclick="selectDepositroy(this)"
lay-verify="required"/> lay-verify="required"/>
<input type="text" name=`+"depositoryId"+NewIdNumber+` class="layui-input" <input type="text" name=` + "depositoryId" + NewIdNumber + ` class="layui-input"
id=`+"did"+NewIdNumber+` id=` + "did" + NewIdNumber + `
style="display: none" lay-verify="required"/> style="display: none" lay-verify="required"/>
<input type="text" name=`+"placeId"+NewIdNumber+` class="layui-input" <input type="text" name=` + "placeId" + NewIdNumber + ` class="layui-input"
id=`+"pid"+` id=` + "pid" + `
style="display: none" lay-verify="required"/> style="display: none" lay-verify="required"/>
<img src="/static/images/search.ico" height="16" width="16" <img src="/static/images/search.ico" height="16" width="16"
id=`+"scanQrCodeForLocation"+NewIdNumber+` id=` + "scanQrCodeForLocation" + NewIdNumber + `
style="margin-top: 10px" style="margin-top: 10px"
onclick="scanLocationByQrCode(this)"> onclick="scanLocationByQrCode(this)">
</div> </div>
@ -1654,7 +1656,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">备注说明:</label> <label class="layui-form-label">备注说明:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name=`+"applyRemark"+NewIdNumber+` placeholder="请填写相关原因及申请原因" value="" <input name=` + "applyRemark" + NewIdNumber + ` placeholder="请填写相关原因及申请原因" value=""
class="layui-input"/> class="layui-input"/>
</div> </div>
</div> </div>

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

@ -28,15 +28,15 @@
.layui-input-block { .layui-input-block {
margin-left: 80px; margin-left: 80px;
} }
.layui-form-select{
.layui-form-select {
width: 100%; width: 100%;
} }
.lay-step{
.lay-step {
display: none; display: none;
} }
.layui-form-select .layui-input{
border-style: none;
}
</style> </style>
@ -51,7 +51,8 @@
<input th:value="${place}" style="display: none" id="scanValue_placeId"> <input th:value="${place}" style="display: none" id="scanValue_placeId">
<div carousel-item style="overflow: inherit"> <div carousel-item style="overflow: inherit">
<div> <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"> <div class="layui-card" id="cardParent">
@ -117,6 +118,7 @@
function scanLocationByQrCode(obj) { function scanLocationByQrCode(obj) {
} }
// 用于物料名称查询 // 用于物料名称查询
function selectMaterialByName(obj) { function selectMaterialByName(obj) {
} }
@ -161,11 +163,11 @@
form.render(); form.render();
var materialAndBarCodeList = materialList[i]["materialAndBarCodeList"]; var materialAndBarCodeList = materialList[i]["materialAndBarCodeList"];
var num = i; var num = i;
if(num === 0){ if (num === 0) {
num = ""; num = "";
} }
$.each(materialAndBarCodeList, function (index, item) { $.each(materialAndBarCodeList, function (index, item) {
$("#barCode"+num).append(new Option(item.bmcode, item.bmcode));//往下拉菜单里添加元素 $("#barCode" + num).append(new Option(item.bmcode, item.bmcode));//往下拉菜单里添加元素
}); });
form.render() form.render()
} }
@ -251,6 +253,14 @@
</div>`; </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 = var firstItem =
// 前半部分 // 前半部分
` <div class="layui-card-body" style="padding-right: 0px" id=` + "cardItem" + NewIdNumber + `> ` <div class="layui-card-body" style="padding-right: 0px" id=` + "cardItem" + NewIdNumber + `>
@ -283,8 +293,8 @@
<label class="layui-form-label">条形编码:</label> <label class="layui-form-label">条形编码:</label>
<div class="layui-input-block" style="margin: 0px;"> <div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv"> <div class="inputdiv">
<select id=`+"barCode"+NewIdNumber+` name=`+"barCode"+NewIdNumber+`></select> <select id=` + "barCode" + NewIdNumber + ` name=` + "barCode" + NewIdNumber + `></select>
<img id= `+"barCodeImg"+NewIdNumber+` name=`+"barCodeImg"+NewIdNumber+` src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanBarCode(this)" > <img id= ` + "barCodeImg" + NewIdNumber + ` name=` + "barCodeImg" + NewIdNumber + ` src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanBarCode(this)" >
</div> </div>
</div> </div>
</div> </div>
@ -301,7 +311,17 @@
<input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value="" <input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value=""
class="layui-input" lay-verify="number"> class="layui-input" lay-verify="number">
</div> </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"> var lastItem = `<div class="layui-form-item">
@ -318,7 +338,7 @@
if (NewIdNumber !== "") { if (NewIdNumber !== "") {
params.push(NewIdNumber) params.push(NewIdNumber)
} }
$("#stepForm").css("height", height + 475 + 'px'); $("#stepForm").css("height", height + 495 + 'px');
var materialItem = firstItem + depositoryItem + lastItem; // 最终 var materialItem = firstItem + depositoryItem + lastItem; // 最终
$("#btn_sub").prepend(materialItem) $("#btn_sub").prepend(materialItem)
}; };
@ -362,7 +382,7 @@
var success = d["success"]; var success = d["success"];
var errMsg = ""; var errMsg = "";
for (let i = 0; i < err.length; i++) { for (let i = 0; i < err.length; i++) {
errMsg += "物料编码: " errMsg += "物料编码: ";
errMsg += err[i]["code"]; errMsg += err[i]["code"];
} }
errMsg += "添加失败,请选择新仓库或库位"; errMsg += "添加失败,请选择新仓库或库位";
@ -510,7 +530,7 @@
<input id="barcode" name=` + "barCode" + NewIdNumber + ` type="text" placeholder="请填写入条形编码" value="" <input id="barcode" name=` + "barCode" + NewIdNumber + ` type="text" placeholder="请填写入条形编码" value=""
class="layui-input" style="border-style: none"> class="layui-input" style="border-style: none">
<img src="/static/images/search.ico" height="16" <img src="/static/images/search.ico" height="16"
id = `+"barCodeImg"+NewIdNumber+` id = ` + "barCodeImg" + NewIdNumber + `
width="16" style="margin-top: 10px" onclick="scanBarCode(this)" > width="16" style="margin-top: 10px" onclick="scanBarCode(this)" >
</div> </div>
</div> </div>
@ -528,7 +548,16 @@
<input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value="" <input name=` + "quantity" + NewIdNumber + ` type="number" placeholder="请填写入物料数量" value=""
class="layui-input" lay-verify="number"> class="layui-input" lay-verify="number">
</div> </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"> var lastItem = `<div class="layui-form-item">
@ -542,8 +571,8 @@
</div>`; </div>`;
// 获取当前高度 // 获取当前高度
var height = parseInt(($("#stepForm").css('height')).split("px")[0]); var height = parseInt(($("#stepForm").css('height')).split("px")[0]);
params.push(NewIdNumber) params.push(NewIdNumber);
$("#stepForm").css("height", height + 535 + 'px'); $("#stepForm").css("height", height + 555 + 'px');
var materialItem = firstItem + depositoryItem + lastItem; var materialItem = firstItem + depositoryItem + lastItem;
$("#" + parentId).after(materialItem); $("#" + parentId).after(materialItem);
}; };
@ -557,7 +586,7 @@
// 获取祖父节点 // 获取祖父节点
var reparent = parent.parentNode; var reparent = parent.parentNode;
var height = parseInt(($("#stepForm").css('height')).split("px")[0]); 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); params = remove(params, parentId);
reparent.removeChild(parent); reparent.removeChild(parent);
}; };
@ -581,7 +610,7 @@
// 输入code // 输入code
var code = obj.value; var code = obj.value;
// 获取对应元素 // 获取对应元素
var parent = obj.parentNode.parentNode.parentNode; var parent = obj.parentNode.parentNode.parentNode.parentNode;
var materialChildren = parent.childNodes[5]; var materialChildren = parent.childNodes[5];
var priceChildren = parent.childNodes[11]; var priceChildren = parent.childNodes[11];
var barCodeChildren = parent.childNodes[9]; var barCodeChildren = parent.childNodes[9];
@ -621,6 +650,14 @@
priceValue.value = d.price; priceValue.value = d.price;
// 获取物料与条形码的对应关系 // 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"]; 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) { if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码 // 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
@ -643,8 +680,7 @@
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
}); });
form.render(); form.render();
} } else {
else{
var barCode = $("#barCode" + idNumber); var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) { if (barCode.length > 0) {
barCode.empty(); barCode.empty();
@ -661,13 +697,22 @@
var parentId = parent.id; var parentId = parent.id;
var codeChildren = parent.childNodes[7]; var codeChildren = parent.childNodes[7];
var materialChildren = parent.childNodes[5]; var materialChildren = parent.childNodes[5];
var priceChildren = parent.childNodes[11];
var codeItem = codeChildren.childNodes[3].childNodes; 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 materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1]; var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3]; var materialId = materialName.parentNode.parentNode.childNodes[3];
// 单价条目
var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1];
var mname = materialName.value; var mname = materialName.value;
mname = mname.split(",")[0]; mname = mname.split(",")[0];
// 条形码条码
// 条形码
var barCodeChildren = parent.childNodes[9];
var barCodeItem = barCodeChildren.childNodes[3];
var idNumber = materialId.id.split("mid")[1];
layer.open({ layer.open({
type: 2, type: 2,
title: '弹窗内容', title: '弹窗内容',
@ -679,29 +724,69 @@
content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId,
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
success: function(layero, index){ success: function (layero, index) {
var children = layero.children(); var children = layero.children();
var content = $(children[1]); var content = $(children[1]);
var iframeChildren = $(content.children()); var iframeChildren = $(content.children());
content.css('height','100%'); content.css('height', '100%');
iframeChildren.css('height','100%'); iframeChildren.css('height', '100%');
}, },
end: function () { end: function () {
var mid = materialId.value; var mid = materialId.value;
$.ajax({ if (mid !== '') {
url: "/material/findMatrialById?mid=" + mid, $.ajax({
type: "get", url: "/material/findMatrialById?mid=" + mid,
dataType: 'json', type: "get",
contentType: "application/json;charset=utf-8", dataType: 'json',
success: function (d) { contentType: "application/json;charset=utf-8",
var material = d.data.materialById; success: function (d) {
var code = material.code; var material = d.data.materialById;
if (code === undefined) { var code = material.code;
code = ""; if (code === undefined) {
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();
} }
codeValue.value = code; });
} }
});
} }
}); });
@ -741,10 +826,28 @@
materialName.value = ""; materialName.value = "";
return false; return false;
} else { } else {
var idNumber = materialId.name.split("mid")[1];
var material = d.data[0]; var material = d.data[0];
materialName.value = material.mname; materialName.value = material.mname;
materialId.value = material.id; materialId.value = material.mid;
codeValue.value = material.code; 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,31 +876,49 @@
var codeChildren = parent.childNodes[7]; var codeChildren = parent.childNodes[7];
var priceChildren = parent.childNodes[11]; var priceChildren = parent.childNodes[11];
var materialChildren = parent.childNodes[5]; var materialChildren = parent.childNodes[5];
// 条形码
var barCodeChildren = parent.childNodes[9];
var codeItem = codeChildren.childNodes[3].childNodes[1]; var codeItem = codeChildren.childNodes[3].childNodes[1];
var codeValue = codeItem.childNodes[1]; var codeValue = codeItem.childNodes[1];
var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes; var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1]; var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3]; var materialId = materialName.parentNode.parentNode.childNodes[3];
var mname = materialName.value;
// 单价条目 // 单价条目
var priceItem = priceChildren.childNodes[3].childNodes; var priceItem = priceChildren.childNodes[3].childNodes;
var priceValue = priceItem[1]; var priceValue = priceItem[1];
// 条形码条码 // 条形码
var barCodeChildren = parent.childNodes[9];
var barCodeItem = barCodeChildren.childNodes[3]; var barCodeItem = barCodeChildren.childNodes[3];
var code = material.mcode;
if (code === undefined) {
code = "";
}
materialName.value = material.mname;
materialId.value = material.mid;
codeValue.value = code;
priceValue.value = material.price;
var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
barCodeInput.value = result; if (material !== null) {
form.render(); // 如果发现对应关系
// 条形码条码
var code = material.mcode;
if (code === undefined) {
code = "";
}
materialName.value = material.mname;
materialId.value = material.mid;
codeValue.value = code;
priceValue.value = material.price;
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) { openDepositoryTree = function (obj) {
@ -826,15 +947,15 @@
move: '.layui-layer-title', move: '.layui-layer-title',
fixed: false, fixed: false,
content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId,
success: function(layero, index){ success: function (layero, index) {
var children = layero.children(); var children = layero.children();
var content = $(children[1]); var content = $(children[1]);
var iframeChildren = $(content.children()); var iframeChildren = $(content.children());
content.css('height','100%'); content.css('height', '100%');
iframeChildren.css('height','100%'); iframeChildren.css('height', '100%');
} }
}); });
} };
// 用于扫码入库 // 用于扫码入库
scanCodeInStorage = function (obj) { scanCodeInStorage = function (obj) {
@ -906,6 +1027,14 @@
}); });
form.render(); 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();
} }
}) })
} }
@ -936,17 +1065,17 @@
var depositoryName = parent.childNodes[1]; var depositoryName = parent.childNodes[1];
var depositoryId = parent.childNodes[3]; var depositoryId = parent.childNodes[3];
var placeId = parent.childNodes[5]; var placeId = parent.childNodes[5];
if(flag === 0){ if (flag === 0) {
// 如果没有获取到位置 // 如果没有获取到位置
layer.msg("当前二维码错误,请重新扫描"); layer.msg("当前二维码错误,请重新扫描");
}else if(flag === 1){ } else if (flag === 1) {
// 如果获取到的是库位 // 如果获取到的是库位
var place = data["place"]; var place = data["place"];
placeId.value = place.id; placeId.value = place.id;
depositoryId.value = place.did; depositoryId.value = place.did;
depositoryName.value = place.depositoryName; depositoryName.value = place.depositoryName;
}else if(flag === 2){ } else if (flag === 2) {
// 如果获取到的是仓库 // 如果获取到的是仓库
var depository = data["depository"]; var depository = data["depository"];
placeId.value = "0"; placeId.value = "0";

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">' + lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' + '<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' + '<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' + '<h4> 出库数量:' + data[i].showQuantity + '</h4>' +
'<h4> 生产日期:' + producedDate + '</h4>' + '<h4> 生产日期:' + producedDate + '</h4>' +
@ -90,6 +91,7 @@
// 申请信息 // 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' + lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' + '<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' + '<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].quantity + '</h4>' + '<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</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"}, {title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'code', width: 200, title: '提交编码', sort: true}, {field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'}, {field: 'mname', width: 120, title: '物料名称'},
{field: 'version', width: 120, title: '规格型号'},
{field: 'mcode', width: 120, title: '物料编码'}, {field: 'mcode', width: 120, title: '物料编码'},
{field: 'producedDate', width: 120, title: '生产日期'}, {field: 'producedDate', width: 120, title: '生产日期'},
{field: 'depositoryName', 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); var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index); parent.layer.close(index);
}) })
} else if (flag === 1) { }
else if (flag === 1) {
// 如果是物料 // 如果是物料
material = data.material; material = data.material;
if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) {
@ -191,9 +192,10 @@
parent.layer.close(index); parent.layer.close(index);
}) })
} else { }
else {
if (depository !== null) { // 如果已经扫描仓库 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("当前仓库不符合要求,请移步至正确仓库", { layer.confirm("当前仓库不符合要求,请移步至正确仓库", {
btn: ["确定"] btn: ["确定"]
@ -206,9 +208,9 @@
// 如果是出库位置为默认库位 // 如果是出库位置为默认库位
var param = {}; var param = {};
param.id = id; param.id = id;
param.placeId = place.id;
param.qrCode = qrCode; param.qrCode = qrCode;
param.barCode = barCode; param.barCode = barCode;
// 弹出确定框 // 弹出确定框
outQuantityCheck(param); outQuantityCheck(param);
} }
@ -278,7 +280,8 @@
} }
} }
} else if (flag === 2) { }
else if (flag === 2) {
// 如果扫描的为库位 // 如果扫描的为库位
place = data.place;// 将扫描结果保存到vue中 place = data.place;// 将扫描结果保存到vue中
if (material == null) { if (material == null) {
@ -361,7 +364,8 @@
} }
} else if (flag === 3) { }
else if (flag === 3) {
// 如果是仓库 // 如果是仓库
depository = data.depository;// 将扫描结果保存到vue中 depository = data.depository;// 将扫描结果保存到vue中

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

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

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

@ -172,7 +172,7 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" placeholder="请填写计量单位" <input type="text" placeholder="请填写计量单位"
class="layui-input" class="layui-input"
th:value="${recordMin.getUnit()}" th:value="${recordMin.getShowUnit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}" th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/> />
</div> </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; src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1); return src.substring(0, src.lastIndexOf("/") + 1);
})(); })();
// alert(rootPath)
layui.config({ layui.config({
base: rootPath + "lay-module/", // base: rootPath + "lay-module/",
base: "https://jy.hxgk.group/static/js/" + "lay-module/",
version: true version: true
}).extend({ }).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展 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">' + lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' + '<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' + '<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' + '<h4> 出库数量:' + data[i].showQuantity + '</h4>' +
'<h4> 生产日期:' + producedDate + '</h4>' + '<h4> 生产日期:' + producedDate + '</h4>' +
@ -90,6 +91,7 @@
// 申请信息 // 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' + lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' + '<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + data[i].version + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' + '<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].quantity + '</h4>' + '<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</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"}, {title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'code', width: 200, title: '提交编码', sort: true}, {field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'}, {field: 'mname', width: 120, title: '物料名称'},
{field: 'version', width: 120, title: '规格型号'},
{field: 'mcode', width: 120, title: '物料编码'}, {field: 'mcode', width: 120, title: '物料编码'},
{field: 'producedDate', width: 120, title: '生产日期'}, {field: 'producedDate', width: 120, title: '生产日期'},
{field: 'depositoryName', 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); var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index); parent.layer.close(index);
}) })
} else if (flag === 1) { }
else if (flag === 1) {
// 如果是物料 // 如果是物料
material = data.material; material = data.material;
if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) {
@ -191,9 +192,10 @@
parent.layer.close(index); parent.layer.close(index);
}) })
} else { }
else {
if (depository !== null) { // 如果已经扫描仓库 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("当前仓库不符合要求,请移步至正确仓库", { layer.confirm("当前仓库不符合要求,请移步至正确仓库", {
btn: ["确定"] btn: ["确定"]
@ -206,9 +208,9 @@
// 如果是出库位置为默认库位 // 如果是出库位置为默认库位
var param = {}; var param = {};
param.id = id; param.id = id;
param.placeId = place.id;
param.qrCode = qrCode; param.qrCode = qrCode;
param.barCode = barCode; param.barCode = barCode;
// 弹出确定框 // 弹出确定框
outQuantityCheck(param); outQuantityCheck(param);
} }
@ -278,7 +280,8 @@
} }
} }
} else if (flag === 2) { }
else if (flag === 2) {
// 如果扫描的为库位 // 如果扫描的为库位
place = data.place;// 将扫描结果保存到vue中 place = data.place;// 将扫描结果保存到vue中
if (material == null) { if (material == null) {
@ -361,7 +364,8 @@
} }
} else if (flag === 3) { }
else if (flag === 3) {
// 如果是仓库 // 如果是仓库
depository = data.depository;// 将扫描结果保存到vue中 depository = data.depository;// 将扫描结果保存到vue中

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

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

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

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

Loading…
Cancel
Save