From bfcf74118d4dccfcb264df2c98841a6225a73e0f Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 5 Jan 2023 15:48:16 +0800 Subject: [PATCH] =?UTF-8?q?bug=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QyWxOperationController.java | 25 +- .../service/DepositoryRecordService.java | 3 +- .../impl/DepositoryRecordServiceImpl.java | 18 +- src/main/resources/static/js/lay-config.js | 12 +- .../application-out_min-mobile.html | 6 +- target/classes/static/js/lay-config.js | 12 +- .../pages/application/application-in.html | 88 +++--- .../application-in_scanQrCode.html | 253 +++++++++++++----- .../application-out_min-mobile.html | 6 +- 9 files changed, 285 insertions(+), 138 deletions(-) diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java index 33877cd5..c449db48 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java @@ -532,13 +532,17 @@ public class QyWxOperationController { ApprovalInfo_Details approvalInfo_details = null; // 定义当前流程审批时间 String as_SpTime = ""; + // 定义当前审批流程是是否为第一个节点 + boolean flagForFirst = true; // 默认是第一个 // 获取审批申请状态变化类型:1-提单;2-同意;3-驳回;4-转审;5-催办;6-撤销;8-通过后撤销;10-添加备注 String spStatus = approvalInfo.getStatuChangeEvent(); - for (int j = 0; j < spRecord_list.size(); j++) { - ApprovalInfo_SpRecord approvalInfo_SpRecord = spRecord_list.get(j); + for (ApprovalInfo_SpRecord approvalInfo_SpRecord : spRecord_list) { + + + // 获取当前审批节点详情。当节点为标签或上级时,一个节点可能有多个分支 List details = approvalInfo_SpRecord.getDetails(); // 定义审批操作时间 @@ -547,22 +551,22 @@ public class QyWxOperationController { String ad_SpStatus = ""; // 定义审批详情 ApprovalInfo_Details ap_detail = null; + + for (ApprovalInfo_Details ad : details) { // 获取节点分支审批人审批操作时间,0为尚未操作 spTime = ad.getSpTime(); // 如果当前审批人暂未处理 if (!("0".equals(spTime))) { + // 设置当前处理的详情 ap_detail = ad; // 设置当前审批的状态 ad_SpStatus = ad.getSpStatus(); - continue; + break; } } - if ("0".equals(spTime)) { - // 如果当前审批节点未操作 - continue; - } else { + if (!"0".equals(spTime)) { // 如果已经操作 // 盘点当前审批状态是否为回调时操作状态 @@ -578,6 +582,7 @@ public class QyWxOperationController { // 获取当前审批节点处理时间 long aLong = Long.parseLong(spTime); + // 获取之前节点的审批时间 long aLong1 = Long.parseLong(as_SpTime); @@ -588,10 +593,9 @@ public class QyWxOperationController { as = approvalInfo_SpRecord; as_SpTime = spTime; approvalInfo_details = ap_detail; + flagForFirst = false; } } - } else { - continue; } } @@ -606,10 +610,11 @@ public class QyWxOperationController { // 开启一个线程用于进行处理 ApprovalInfo_Details finalApprovalInfo_details = approvalInfo_details; + boolean finalFlagForFirst = flagForFirst; new Thread(new Runnable() { @Override public void run() { - depositoryRecordService.reviewByQyWxApproval(mainId, finalApprovalInfo_details, crypt, spStatus, approvalInfo.getSpNo()); + depositoryRecordService.reviewByQyWxApproval(mainId, finalApprovalInfo_details, crypt, spStatus, approvalInfo.getSpNo(), finalFlagForFirst); } }).start(); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java b/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java index 1cbd7051..88b7d24d 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java @@ -392,7 +392,8 @@ public interface DepositoryRecordService { * @param mainId 主表id * @param userAgent 加密后的user-agent * @param approvalInfo_details 审批详情 + * @param flagForFirst 用于标志是否为第一次审批 * @return */ - Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent,String spStatus,String spNo); + Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent,String spStatus,String spNo,boolean flagForFirst); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index 4ce83e75..e7fda9e4 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -1636,7 +1636,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @return */ @Override - public Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo) { + public Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo,boolean flagForFirst) { // 用于更新订单 Map map = new HashMap<>(); @@ -1656,8 +1656,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { ApplicationOutRecordP recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); // 获取当前审批所在部门 - Integer maindeparment = userByPort.getMaindeparment(); - if (Integer.compare(361, maindeparment) == 0) { +// Integer maindeparment = userByPort.getMaindeparment(); + + if(!flagForFirst){ +// if (Integer.compare(361, maindeparment) == 0) { // 如果是仓储中心负责人 String depositoryManagerTime = recordP.getDepositoryManagerTime(); @@ -1750,14 +1752,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { }).start(); } - for (int i = 0; i < depositoryIdList.size(); i++) { - Object o = minIdByDepository.get("depository" + depositoryIdList.get(i)); + for (Integer integer : depositoryIdList) { + Object o = minIdByDepository.get("depository" + integer); if (o != null) { List minIdList = (List) o; - List userIdByDid = roleService.findUserIdByDid(depositoryIdList.get(i)); + List userIdByDid = roleService.findUserIdByDid(integer); StringBuilder QyWxUid = new StringBuilder(); - for (int j = 0; j < userIdByDid.size(); j++) { - UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userByPort); + for (Integer value : userIdByDid) { + UserByPort manager = LinkInterfaceUtil.FindUserById(value, userByPort); // QyWxUid.append(manager.getWorkwechat()+","); } QyWxUid.append("PangFuZhen,"); diff --git a/src/main/resources/static/js/lay-config.js b/src/main/resources/static/js/lay-config.js index d8cd5f65..269e8606 100644 --- a/src/main/resources/static/js/lay-config.js +++ b/src/main/resources/static/js/lay-config.js @@ -9,11 +9,12 @@ window.rootPath = (function (src) { src = document.scripts[document.scripts.length - 1].src; return src.substring(0, src.lastIndexOf("/") + 1); })(); -layui.config({ - // base: rootPath + "lay-module/", - base: "https://jy.hxgk.group/static/js/" + "lay-module/", +let r = layui.config({ + base: rootPath + "lay-module/", + // base: "https://jy.hxgk.group/static/js/" + "lay-module/", version: true -}).extend({ +}); +r.extend({ miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展 miniMenu: "layuimini/miniMenu", // layuimini菜单扩展 miniTab: "layuimini/miniTab", // layuimini tab扩展 @@ -28,4 +29,5 @@ layui.config({ wangEditor: 'wangEditor/wangEditor', // wangEditor富文本扩展 layarea: 'layarea/layarea', // 省市县区三级联动下拉选择器 cardTable: 'cardTable/cardTable' //卡片表格拓展 -}); +}) +; diff --git a/src/main/resources/templates/pages/application/application-out_min-mobile.html b/src/main/resources/templates/pages/application/application-out_min-mobile.html index e49128f5..9a7db4a6 100644 --- a/src/main/resources/templates/pages/application/application-out_min-mobile.html +++ b/src/main/resources/templates/pages/application/application-out_min-mobile.html @@ -60,6 +60,7 @@ if(state === "0") { for (let i = 0; i < data.length; i++) { let producedDate = data[i].producedDate === null?"":data[i].producedDate; + let materialVersion = data[i].version === null ?"":data[i].version; // 头部信息 lis.push('
  • ' + '
    ' + '

    物料名称:' + data[i].mname + '

    ' + - '

    规格型号:' + data[i].version + '

    ' + + '

    规格型号:' + materialVersion + '

    ' + '

    物料编码:' + data[i].mcode + '

    ' + '

    出库数量:' + data[i].showQuantity + '

    ' + '

    生产日期:' + producedDate + '

    ' + @@ -83,6 +84,7 @@ }else{ for (let i = 0; i < data.length; i++) { let producedDate = data[i].producedDate === null?"":data[i].producedDate; + let materialVersion = data[i].version === null ?"":data[i].version; // 头部信息 lis.push('
  • ' + '

    ' @@ -91,7 +93,7 @@ // 申请信息 lis.push('
    ' + '

    物料名称:' + data[i].mname + '

    ' + - '

    规格型号:' + data[i].version + '

    ' + + '

    规格型号:' + materialVersion + '

    ' + '

    物料编码:' + data[i].mcode + '

    ' + '

    出库数量:' + data[i].quantity + '

    ' + '

    处理人:' + data[i].checkerName + '

    ' + diff --git a/target/classes/static/js/lay-config.js b/target/classes/static/js/lay-config.js index d8cd5f65..269e8606 100644 --- a/target/classes/static/js/lay-config.js +++ b/target/classes/static/js/lay-config.js @@ -9,11 +9,12 @@ window.rootPath = (function (src) { src = document.scripts[document.scripts.length - 1].src; return src.substring(0, src.lastIndexOf("/") + 1); })(); -layui.config({ - // base: rootPath + "lay-module/", - base: "https://jy.hxgk.group/static/js/" + "lay-module/", +let r = layui.config({ + base: rootPath + "lay-module/", + // base: "https://jy.hxgk.group/static/js/" + "lay-module/", version: true -}).extend({ +}); +r.extend({ miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展 miniMenu: "layuimini/miniMenu", // layuimini菜单扩展 miniTab: "layuimini/miniTab", // layuimini tab扩展 @@ -28,4 +29,5 @@ layui.config({ wangEditor: 'wangEditor/wangEditor', // wangEditor富文本扩展 layarea: 'layarea/layarea', // 省市县区三级联动下拉选择器 cardTable: 'cardTable/cardTable' //卡片表格拓展 -}); +}) +; diff --git a/target/classes/templates/pages/application/application-in.html b/target/classes/templates/pages/application/application-in.html index ec8e45e3..3a1a5ed3 100644 --- a/target/classes/templates/pages/application/application-in.html +++ b/target/classes/templates/pages/application/application-in.html @@ -253,14 +253,16 @@ class="layui-input" lay-verify="required" style="border-style: none"> + style="margin-top: 10px;display: none" + onclick="scanCodeByOut(this)">

    -
    @@ -301,7 +303,8 @@
    - @@ -364,6 +367,7 @@ function selectDepositroy(object) { } + // 用于扫码入库 function scanCodeInStorage(obj) { } @@ -402,11 +406,12 @@ } // 实现卡片删除(组合) - function deleteItemForGroup(){ + function deleteItemForGroup() { } + // 实现卡片添加(组合) - function addItemForGroup(){ + function addItemForGroup() { } @@ -419,7 +424,7 @@ // 用于暂存卡片个数(组合) var params2 = []; - layui.use(['form', 'step', 'flow', 'laydate','element'], function () { + layui.use(['form', 'step', 'flow', 'laydate', 'element'], function () { var $ = layui.$, form = layui.form, laydate = layui.laydate, @@ -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({ @@ -1264,7 +1266,7 @@ layer.msg(d.statusInfo.detail, { icon: 0, time: 1500 - },function () { + }, function () { obj.value = ''; gidItem.value = ''; gnameItem.value = ''; @@ -1298,7 +1300,7 @@ }; // 用于实现点击搜索按钮(组合) - selectGroup = function(obj){ + selectGroup = function (obj) { var parent = obj.parentNode.parentNode.parentNode.parentNode; var parentId = parent.id; @@ -1336,11 +1338,12 @@ content.css('height', '100%'); iframeChildren.css('height', '100%'); }, - end:function () { + end: function () { let gid = gidItem.value; - if(gid !== ''){ + if (gid !== '') { let req = {}; req.gid = gid; + req.type = "in"; $.ajax({ url: "/group/findGroupInfoByGid", data: JSON.stringify(req), @@ -1353,7 +1356,7 @@ layer.msg(d.statusInfo.detail, { icon: 0, time: 1500 - },function () { + }, function () { obj.value = ''; gidItem.value = ''; gnameItem.value = ''; @@ -1389,7 +1392,7 @@ }; // 用于实现组合名称搜索 - selectGroupByName = function(obj){ + selectGroupByName = function (obj) { let gname = obj.value; var parent = obj.parentNode.parentNode.parentNode.parentNode; // 获取对应元素 @@ -1405,7 +1408,7 @@ // gid let gidItem = gnameParent.childNodes[3]; - if(gname !== ''){ + if (gname !== '') { var req = {}; @@ -1417,12 +1420,12 @@ data: JSON.stringify(req), contentType: "application/json;charset=utf-8", success: function (d) { - if(d.count === -1){ + if (d.count === -1) { // 如果当前组合名称的数量不止一个 layer.msg("请点击右侧搜索确定物品", { icon: 0, time: 1500 - },function () { + }, function () { obj.value = ''; gidItem.value = ''; gcodeItem.value = ''; @@ -1433,12 +1436,12 @@ } } }); - }else if(d.count === 0){ + } else if (d.count === 0) { // 如果当前组合名称不存在 layer.msg("没有该组合,请确认输入是否正确", { icon: 0, time: 1500 - },function () { + }, function () { obj.value = ''; gidItem.value = ''; gcodeItem.value = ''; @@ -1449,7 +1452,7 @@ } } }); - }else{ + } else { // 正常 let data = d.data; let childNodes = parent.childNodes; @@ -1471,8 +1474,7 @@ } } }) - } - else{ + } else { gcodeItem.value = ''; gidItem.value = ''; let childNodes = parent.childNodes; @@ -1555,10 +1557,10 @@ $.each(data.placePList, function (index, item) { $('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素 }); - $("#unit"+idNumber).empty(); - $("#unit"+idNumber).append(new Option(data.unit,"-1")); - $.each(data.splitInfoList,function (index,item) { - $("#unit"+idNumber).append(new Option(item.newUnit,item.newUnit)); + $("#unit" + idNumber).empty(); + $("#unit" + idNumber).append(new Option(data.unit, "-1")); + $.each(data.splitInfoList, function (index, item) { + $("#unit" + idNumber).append(new Option(item.newUnit, item.newUnit)); }); form.render(); materialName.value = data.mname; @@ -1599,13 +1601,13 @@
    + id=` + "selectGroup" + NewIdNumber + ` onclick="selectGroup(this)">
    -
    @@ -1625,7 +1627,7 @@
    -
    @@ -1635,17 +1637,17 @@
    - -
    @@ -1654,7 +1656,7 @@
    -
    diff --git a/target/classes/templates/pages/application/application-in_scanQrCode.html b/target/classes/templates/pages/application/application-in_scanQrCode.html index 3d9cc589..9b25cc1b 100644 --- a/target/classes/templates/pages/application/application-in_scanQrCode.html +++ b/target/classes/templates/pages/application/application-in_scanQrCode.html @@ -28,15 +28,15 @@ .layui-input-block { margin-left: 80px; } - .layui-form-select{ + + .layui-form-select { width: 100%; } - .lay-step{ + + .lay-step { display: none; } - .layui-form-select .layui-input{ - border-style: none; - } + @@ -51,7 +51,8 @@
    -
    +
    @@ -117,6 +118,7 @@ function scanLocationByQrCode(obj) { } + // 用于物料名称查询 function selectMaterialByName(obj) { } @@ -161,11 +163,11 @@ form.render(); var materialAndBarCodeList = materialList[i]["materialAndBarCodeList"]; var num = i; - if(num === 0){ + if (num === 0) { num = ""; } $.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() } @@ -251,6 +253,14 @@
    `; } + var splitInfoList = obj.splitList; + let splitInfoItem = ""; + if (splitInfoList !== undefined) { + for (let i = 0; i < splitInfoList.length; i++) { + let optinItem = ""; + splitInfoItem += optinItem; + } + } var firstItem = // 前半部分 `
    @@ -283,8 +293,8 @@
    - - + +
    @@ -301,7 +311,17 @@
    -
    `; + +
    + +
    + +
    +
    + `; var lastItem = `
    @@ -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 += "添加失败,请选择新仓库或库位"; @@ -510,7 +530,7 @@
    @@ -528,7 +548,16 @@ - `; + +
    + +
    + +
    +
    + `; var lastItem = `
    @@ -542,8 +571,8 @@
    `; // 获取当前高度 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: '弹窗内容', @@ -679,29 +724,69 @@ content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, - success: function(layero, index){ + success: function (layero, index) { var children = layero.children(); var content = $(children[1]); var iframeChildren = $(content.children()); - content.css('height','100%'); - iframeChildren.css('height','100%'); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); }, end: function () { var mid = materialId.value; - $.ajax({ - url: "/material/findMatrialById?mid=" + mid, - type: "get", - dataType: 'json', - contentType: "application/json;charset=utf-8", - success: function (d) { - var material = d.data.materialById; - var code = material.code; - if (code === undefined) { - code = ""; + if (mid !== '') { + $.ajax({ + url: "/material/findMatrialById?mid=" + mid, + type: "get", + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (d) { + var material = d.data.materialById; + var code = material.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 = ` + `; + + $("#" + 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 = ""; 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,31 +876,49 @@ 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 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]; - barCodeInput.value = result; - form.render(); + if (material !== null) { + // 如果发现对应关系 + // 条形码条码 + 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) { @@ -826,15 +947,15 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, - success: function(layero, index){ + success: function (layero, index) { var children = layero.children(); var content = $(children[1]); var iframeChildren = $(content.children()); - content.css('height','100%'); - iframeChildren.css('height','100%'); + content.css('height', '100%'); + 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(); } }) } @@ -936,17 +1065,17 @@ var depositoryName = parent.childNodes[1]; var depositoryId = parent.childNodes[3]; var placeId = parent.childNodes[5]; - if(flag === 0){ + if (flag === 0) { // 如果没有获取到位置 layer.msg("当前二维码错误,请重新扫描"); - }else if(flag === 1){ + } else if (flag === 1) { // 如果获取到的是库位 var place = data["place"]; placeId.value = place.id; depositoryId.value = place.did; depositoryName.value = place.depositoryName; - }else if(flag === 2){ + } else if (flag === 2) { // 如果获取到的是仓库 var depository = data["depository"]; placeId.value = "0"; diff --git a/target/classes/templates/pages/application/application-out_min-mobile.html b/target/classes/templates/pages/application/application-out_min-mobile.html index e49128f5..9a7db4a6 100644 --- a/target/classes/templates/pages/application/application-out_min-mobile.html +++ b/target/classes/templates/pages/application/application-out_min-mobile.html @@ -60,6 +60,7 @@ if(state === "0") { for (let i = 0; i < data.length; i++) { let producedDate = data[i].producedDate === null?"":data[i].producedDate; + let materialVersion = data[i].version === null ?"":data[i].version; // 头部信息 lis.push('
  • ' + '
    ' + '

    物料名称:' + data[i].mname + '

    ' + - '

    规格型号:' + data[i].version + '

    ' + + '

    规格型号:' + materialVersion + '

    ' + '

    物料编码:' + data[i].mcode + '

    ' + '

    出库数量:' + data[i].showQuantity + '

    ' + '

    生产日期:' + producedDate + '

    ' + @@ -83,6 +84,7 @@ }else{ for (let i = 0; i < data.length; i++) { let producedDate = data[i].producedDate === null?"":data[i].producedDate; + let materialVersion = data[i].version === null ?"":data[i].version; // 头部信息 lis.push('
  • ' + '

    ' @@ -91,7 +93,7 @@ // 申请信息 lis.push('
    ' + '

    物料名称:' + data[i].mname + '

    ' + - '

    规格型号:' + data[i].version + '

    ' + + '

    规格型号:' + materialVersion + '

    ' + '

    物料编码:' + data[i].mcode + '

    ' + '

    出库数量:' + data[i].quantity + '

    ' + '

    处理人:' + data[i].checkerName + '

    ' +