From da1bd0aeadd28e66faec405cc438f0618a436aa7 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Fri, 16 Dec 2022 10:31:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=BB=84=E5=90=88=E7=9A=84?= =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- target/classes/.restartTriggerFile | 0 .../depository_manage (2).kotlin_module | Bin 0 -> 16 bytes .../spring-configuration-metadata.json | 17 + .../depository_manage/mapper/GroupMapper.xml | 378 ++++++ .../js/application-out/application-out.js | 1029 +++++++++++++++++ .../pages/application/application-in.html | 83 +- .../pages/group/applicationOutForGroup.html | 776 +++++++++++++ .../pages/group/application_multi.html | 260 +++++ .../templates/pages/group/group-add.html | 340 ++++++ .../templates/pages/group/group-out.html | 542 +++++++++ .../templates/pages/group/group_edit.html | 330 ++++++ .../pages/group/group_material_edit.html | 148 +++ .../templates/pages/group/selectGroup.html | 85 ++ 13 files changed, 3947 insertions(+), 41 deletions(-) create mode 100644 target/classes/.restartTriggerFile create mode 100644 target/classes/META-INF/depository_manage (2).kotlin_module create mode 100644 target/classes/META-INF/spring-configuration-metadata.json create mode 100644 target/classes/com/dreamchaser/depository_manage/mapper/GroupMapper.xml create mode 100644 target/classes/static/js/application-out/application-out.js create mode 100644 target/classes/templates/pages/group/applicationOutForGroup.html create mode 100644 target/classes/templates/pages/group/application_multi.html create mode 100644 target/classes/templates/pages/group/group-add.html create mode 100644 target/classes/templates/pages/group/group-out.html create mode 100644 target/classes/templates/pages/group/group_edit.html create mode 100644 target/classes/templates/pages/group/group_material_edit.html create mode 100644 target/classes/templates/pages/group/selectGroup.html diff --git a/target/classes/.restartTriggerFile b/target/classes/.restartTriggerFile new file mode 100644 index 00000000..e69de29b diff --git a/target/classes/META-INF/depository_manage (2).kotlin_module b/target/classes/META-INF/depository_manage (2).kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..a49347afef10a9b5f95305e1058ba36adec7d6dd GIT binary patch literal 16 RcmZQzU|?ooU|@t|0RRA102TlM literal 0 HcmV?d00001 diff --git a/target/classes/META-INF/spring-configuration-metadata.json b/target/classes/META-INF/spring-configuration-metadata.json new file mode 100644 index 00000000..8d229f5f --- /dev/null +++ b/target/classes/META-INF/spring-configuration-metadata.json @@ -0,0 +1,17 @@ +{ + "groups": [ + { + "name": "file", + "type": "com.dreamchaser.depository_manage.config.FileConfig", + "sourceType": "com.dreamchaser.depository_manage.config.FileConfig" + } + ], + "properties": [ + { + "name": "file.upload-path", + "type": "java.lang.String", + "sourceType": "com.dreamchaser.depository_manage.config.FileConfig" + } + ], + "hints": [] +} \ No newline at end of file diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/GroupMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/GroupMapper.xml new file mode 100644 index 00000000..4f77f691 --- /dev/null +++ b/target/classes/com/dreamchaser/depository_manage/mapper/GroupMapper.xml @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,mid,gid,quantity,mtid,shelfLife,gcode,mname,tname,mcode,version,unit,texture,productionPlace,brand,remark,createTime,gstate,gname + + + + + id,code,createTime,state,gname + + + + + id,mid,gid,quantity + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `group` ( + id, code, createTime, state + ) VALUES ( + #{id}, + #{code}, + #{createTime}, + #{state} + ) + + + + INSERT INTO groupformaterial ( + id, mid, gid, quantity + ) VALUES ( + #{id}, + #{mid}, + #{gid}, + #{quantity} + ) + + + + + + + + + + + + + + + update + groupformaterial + + + gid = #{gid}, + + + mid = #{mid}, + + + quantity = #{quantity} + + + where id = #{id} + + + + + + insert into gidandcode(id,gid,code) + values ( + #{id}, + #{gid}, + #{code} + ) + + + + + update + `group` + + + code = #{code}, + + + createTime = #{createTime}, + + + state = #{state}, + + + gname = #{gname} + + + where id = #{id} + + + + delete from groupformaterial where id = #{id} + + + + + delete from groupformaterial where id in + + #{id} + + + + + delete from `group` where id = #{id} + + + + + \ No newline at end of file diff --git a/target/classes/static/js/application-out/application-out.js b/target/classes/static/js/application-out/application-out.js new file mode 100644 index 00000000..93b46b89 --- /dev/null +++ b/target/classes/static/js/application-out/application-out.js @@ -0,0 +1,1029 @@ + +// 用于添加标签 +function addItem(obj) { +} + +// 用于删除标签 +function deleteItem(obj) { +} + +// 用于添加标签(用于组合) +function addItemForGroup(obj) { +} + +// 用于删除标签(用于组合) +function deleteItemForGroup(obj) { +} + +// 用于编码查询 +function selectCode(obj) { +} + +// 用于编码查询(用于组合) +function selectCodeForGroup(obj) { +} + +// 用于点击搜索按钮 +function selectMaterial(obj) { +} + +// 用于点击搜索按钮(组合) +function selectGroup(obj) { + +} + +// 用于物料名称查询 +function selectMaterialByName(obj) { +} + + +// 用于组合名称查询 +function selectGroupByName() { + +} + +// 用于判断当前物料数量是否合适 +function MaterialQuantityIsTrue() { +} + +// 用于扫描条形码 +function scanBarCode() { +} + +// 用于重新渲染页面(组合) +function CoverpageForGroup() { +} + + +// 用于扫码出库 +function scanCodeByOut(obj) { +} + +// 用于暂存卡片个数 +var params = []; + +// 用于暂存卡片个数(组合) +var params2 = []; +// 用于卡片编号 +var NewIdNumber = 1; +layui.use(['form', 'step', 'layer', 'jquery', 'element'], function () { + var $ = layui.$, + form = layui.form, + element = layui.element, + step = layui.step; + + + // 用于分步表单加载 + step.render({ + elem: '#stepForm', + filter: 'stepForm', + width: '100%', //设置容器宽度 + height: '600px', + stepItems: [{ + title: '填写信息' + }, { + title: '提交成功' + }] + }); + + step.render({ + elem: '#stepForm2', + filter: 'stepForm2', + width: '100%', //设置容器宽度 + height: '600px', + stepItems: [{ + title: '填写信息' + }, { + title: '提交成功' + }] + }); + + // 提交 + form.on('submit(formStep)', function (data) { + data = data.field; + data.params = params; + if (data.mid === undefined) { + // 如果没有初始项 + var dataKeys = Object.keys(data); + var dataKey; + for (let i = 0; i < dataKeys.length; i++) { + dataKey = dataKeys[i]; + if (dataKey.includes("mid")) { + break; + } + } + // 获取当前数字 + var keyNumber = dataKey.split("mid")[1]; + for (let index = 0; index < dataKeys.length; index++) { + var tempKey = dataKeys[index]; + if (tempKey.includes(keyNumber)) { + var key = tempKey.replace(keyNumber, ""); + data[key] = data[tempKey]; + delete data[tempKey]; + } + } + data.params = remove(data.params, Number(keyNumber)); + } + $.ajax({ + url: "/depositoryRecord/applicationOut", + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + beforeSend: function () { + this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); + }, + success: function (data) { + layer.close(this.layerIndex); + if (data.status >= 300) { + layer.msg(data.statusInfo.message);//失败的表情 + + } else { + layer.msg("申请提交成功", { + icon: 6,//成功的表情 + time: 500 //1秒关闭(如果不配置,默认是3秒) + }, function () { + step.next('#stepForm'); + }); + + + } + }, + complete: function () { + layer.close(this.layerIndex); + } + }); + return false; + }); + + + form.on('submit(formStep2)', function (data) { + + }); + + $('.pre').click(function () { + step.pre('#stepForm'); + step.pre('#stepForm2'); + }); + + $('.next').click(function () { + step.next('#stepForm'); + step.next('#stepForm2'); + }); + + // 实现卡片添加 + addItem = function (obj) { + // 获取父元素id + var parentId = obj.parentNode.id; + NewIdNumber = NewIdNumber + 1; + // 物料名称栏目 + var materialItem = ` +
+
+ +
+ +
+
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
`; + // 获取当前高度 + var height = parseInt(($("#stepForm").css('height')).split("px")[0]); + params.push(NewIdNumber); + $("#stepForm").css("height", height + 422 + 'px'); + $("#" + parentId).after(materialItem); + }; + + // 实现卡片添加(组合) + addItemForGroup = function (obj) { + var parentId = obj.parentNode.id; + NewIdNumber = NewIdNumber + 1; + var materialItem = ` +
+
+ +
+ +
+
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+ + +
+ `; + // 获取当前高度 + var height = parseInt(($("#stepForm2").css('height')).split("px")[0]); + params2.push(NewIdNumber); + $("#stepForm2").css("height", height + 236 + 'px'); + $("#" + parentId).after(materialItem); + }; + // 用于重新渲染页面(组合) + CoverpageForGroup = function (num, obj) { + // 获取待添加父类 + NewIdNumber = num; + if (num === 0) { // 如果是第一个 + NewIdNumber = ""; + } + var materialItem = ` +
+
+

${obj.mname}

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + `; // 最终 + + // 获取当前高度 + var height = parseInt(($("#stepForm2").css('height')).split("px")[0]); + if (NewIdNumber !== "") { + params.push(NewIdNumber) + } + $("#stepForm2").css("height", height + 183 + 'px'); + $("#" + "addItemForGroup" + NewIdNumber).before(materialItem); + + }; + + // 实现卡片删除 + deleteItem = function (obj) { + // 获取父节点 + var parent = obj.parentNode; + var parentId = parent.id; + parentId = parseInt(parentId.split("cardItem")[1]); + // 获取祖父节点 + var reparent = parent.parentNode; + var height = parseInt(($("#stepForm").css('height')).split("px")[0]); + $("#stepForm").css("height", height - 422 + 'px'); + params = remove(params, parentId); + reparent.removeChild(parent); + }; + + // 实现卡片删除 + deleteItemForGroup = function (obj) { + // 获取父节点 + var parent = obj.parentNode; + var parentId = parent.id; + parentId = parseInt(parentId.split("cardItemForGroup")[1]); + // 获取祖父节点 + var reparent = parent.parentNode; + var height = parseInt(($("#stepForm2").css('height')).split("px")[0]); + $("#stepForm2").css("height", height - 236 + 'px'); + params2 = remove(params, parentId); + reparent.removeChild(parent); + }; + + //删除数组中指定元素 + function remove(arr, item) { + var result = []; + for (let i = 0; i < arr.length; i++) { + if (arr[i] === item) { + continue; + } + result.push(arr[i]); + } + return result; + } + + // 用于实现通过编码查询物料 + selectCode = function (obj) { + // 输入code + var code = obj.value; + // 获取对应元素 + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var objId = parent.id.split("cardItem")[1]; + var children = parent.childNodes[5]; + var materialItem = children.childNodes[3].childNodes[1].childNodes; + var barCodeChildren = parent.childNodes[9]; + + var materialName = materialItem[1]; + var materialId = materialName.parentNode.parentNode.childNodes[3]; + // 条形码条码 + var barCodeItem = barCodeChildren.childNodes[3]; + var req = {}; + req.code = code; + req.type = "out"; + $.ajax({ + url: "/material/findMatrialByCode", + type: "get", + dataType: 'json', + data: (req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var d = d.data; + if (d == null) { + layer.msg("仓库中暂无该物料"); + materialName.value = ""; + materialId.value = ""; + obj.value = ""; + $('#place' + objId).empty(); + + } else { + materialName.value = d.mname; + materialId.value = d.id; + var idNumber = materialId.name.split("mid")[1]; + // 获取物料与条形码的对应关系 + var materialAndBarCodeList = d["materialAndBarCodeList"]; + if (materialAndBarCodeList.length > 0) { + // 如果有对应的条形码 + var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; + var barCodeImg = barCodeItem.childNodes[1].childNodes[3]; + var id = barCodeInput.id; + $("#" + id).remove(); + $("#barCode" + idNumber).empty(); + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } else { + var barCodeSelect = ` + `; + $("#" + barCodeImg.id).before(barCodeSelect); + } + form.render(); + $.each(materialAndBarCodeList, function (index, item) { + $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 + }); + form.render(); + } else { + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } + } + } + } + }); + }; + + + // 用于实现通过编码查询组合 + selectCodeForGroup = function (obj) { + // 输入code + var code = obj.value; + // 获取搜索的对应卡片 + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var pid = Number(parent.id.split("cardItemForGroup")[1]); + + // 获取当前卡片中的组合名称等 + let gnameParent = parent.childNodes[5].childNodes[3]; + + // gid + let gidItem = gnameParent.childNodes[3]; + // gname + let gnameItem = gnameParent.childNodes[1].childNodes[1]; + let req = {}; + req.code = code; + $.ajax({ + url: "/group/findGroupByCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg(d.statusInfo.detail, { + icon: 0, + time: 1500 + },function () { + obj.value = ''; + gidItem.value = ''; + gnameItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + }) + } else { + let childNodes = parent.childNodes; + if (childNodes.length > 9) { + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + } + // 赋值给gname + gnameItem.value = data[0].gname; + gidItem.value = data[0].gid; + for (let i = 0; i < data.length; i++) { + CoverpageForGroup(pid, data[i]); + } + element.init(); + + } + } + }); + }; + + // 用于实现点击搜索按钮 + selectMaterial = function (obj) { + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var parentId = parent.id; + var codeChildren = parent.childNodes[7]; + var materialChildren = parent.childNodes[5]; + var codeItem = codeChildren.childNodes[3].childNodes[1].childNodes; + var codeValue = codeItem[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 barCodeChildren = parent.childNodes[9]; + // 条形码条码 + var barCodeItem = barCodeChildren.childNodes[3]; + layer.open({ + type: 2, + title: '弹窗内容', + skin: 'layui-layer-rim', + maxmin: true, + shadeClose: true, //点击遮罩关闭层 + area: ['70%', '70%'], + // content: '/selectMaterialByCard?mname=' + mname + '&type=2&clickObj=' + parentId, + content: '/getMaterialAll?mname=' + mname + '&type=2&clickObj=' + parentId, + move: '.layui-layer-title', + fixed: false, + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + 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 = ""; + } + codeValue.value = code; + var materialAndBarCodeList = material["materialAndBarCodeList"]; + var idNumber = materialId.name.split("mid")[1]; + if (materialAndBarCodeList.length > 0) { + // 如果有对应的条形码 + var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; + var barCodeImg = barCodeItem.childNodes[1].childNodes[3]; + var id = barCodeInput.id; + $("#" + id).remove(); + $("#barCode" + idNumber).empty(); + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } else { + var barCodeSelect = ` + `; + $("#" + barCodeImg.id).before(barCodeSelect); + } + form.render(); + $.each(materialAndBarCodeList, function (index, item) { + $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 + }); + form.render(); + } else { + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } + } + form.render(); + } + }); + + } + }); + }; + + // 用于实现点击搜索按钮(组合) + selectGroup = function(obj){ + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var parentId = parent.id; + + // 获取对应元素 + var pid = Number(parent.id.split("cardItemForGroup")[1]); + + // 获取当前卡片中的组合名称等 + let gnameParent = parent.childNodes[5].childNodes[3]; + + // 组合编码 + let gcodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes[1]; + + + // gid + let gidItem = gnameParent.childNodes[3]; + + // gname + let gnameItem = gnameParent.childNodes[1].childNodes[1]; + + let gname = gnameItem.value; + layer.open({ + type: 2, + title: '弹窗内容', + skin: 'layui-layer-rim', + maxmin: true, + shadeClose: true, //点击遮罩关闭层 + area: ['70%', '70%'], + content: '/selectGroup?gname=' + gname + '&clickObj=' + parentId, + move: '.layui-layer-title', + fixed: false, + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); + }, + end:function () { + let gid = gidItem.value; + if(gid !== ''){ + let req = {}; + req.gid = gid; + $.ajax({ + url: "/group/findGroupInfoByGid", + data: JSON.stringify(req), + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg(d.statusInfo.detail, { + icon: 0, + time: 1500 + },function () { + obj.value = ''; + gidItem.value = ''; + gnameItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + }) + } else { + let childNodes = parent.childNodes; + if (childNodes.length > 9) { + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + } + // 赋值给gname + gcodeItem.value = data[0].gcode; + for (let i = 0; i < data.length; i++) { + CoverpageForGroup(pid, data[i]); + } + element.init(); + + } + } + }) + } + } + }) + }; + + // 用于实现组合名称搜索 + selectGroupByName = function(obj){ + let gname = obj.value; + var parent = obj.parentNode.parentNode.parentNode.parentNode; + // 获取对应元素 + var pid = Number(parent.id.split("cardItemForGroup")[1]); + + // 获取当前卡片中的组合名称等 + let gnameParent = parent.childNodes[5].childNodes[3]; + + // 组合编码 + let gcodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes[1]; + + + // gid + let gidItem = gnameParent.childNodes[3]; + + if(gname !== ''){ + + + var req = {}; + req.gname = gname; + $.ajax({ + url: "/group/findGroupByGname", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + if(d.count === -1){ + // 如果当前组合名称的数量不止一个 + layer.msg("请点击右侧搜索确定物品", { + icon: 0, + time: 1500 + },function () { + obj.value = ''; + gidItem.value = ''; + gcodeItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + }); + }else if(d.count === 0){ + // 如果当前组合名称不存在 + layer.msg("没有该组合,请确认输入是否正确", { + icon: 0, + time: 1500 + },function () { + obj.value = ''; + gidItem.value = ''; + gcodeItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + }); + }else{ + // 正常 + let data = d.data; + let childNodes = parent.childNodes; + if (childNodes.length > 9) { + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + } + // 赋值给gname + gidItem.value = data[0].gid; + gcodeItem.value = data[0].gcode; + for (let i = 0; i < data.length; i++) { + CoverpageForGroup(pid, data[i]); + } + element.init(); + + } + } + }) + } + else{ + gcodeItem.value = ''; + gidItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + } + + }; + + //用于实现物料名称搜索 + selectMaterialByName = function (obj) { + var data = obj.value; + // 获取对应元素 + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var materialChildren = parent.childNodes[5]; + var codeChildren = parent.childNodes[7]; + var codeItem = codeChildren.childNodes[3].childNodes[1].childNodes; + var codeValue = codeItem[1]; + var materialItem = materialChildren.childNodes[3].childNodes[1].childNodes; + var materialName = materialItem[1]; + var materialId = materialName.parentNode.parentNode.childNodes[3]; + var req = {}; + req.mname = data; + $.ajax({ + url: "/material/findInventoryByCondition", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + if (d.count > 1) { + layer.msg("请点击右侧搜索确定物品"); + materialId.value = ""; + codeValue.value = ""; + return false; + } else if (d.count === 0) { + layer.msg("没有该物品,请确认输入是否正确"); + materialId.value = ""; + codeValue.value = ""; + materialName.value = ""; + return false; + } else { + var material = d.data[0]; + materialName.value = material.mname; + materialId.value = material.id; + codeValue.value = material.code; + } + } + }); + }; + + // 扫描物料条码 + scanBarCode = function (obj) { + parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["barCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + $.ajax({ + url: "/material/qywxApplicationOutScanBarCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + // 获取对应元素 + var parent = obj.parentNode.parentNode.parentNode.parentNode; + + var MaterialChildren = parent.childNodes[5]; + var materialItem = MaterialChildren.childNodes[3].childNodes[1].childNodes; + + var barCodeChildren = parent.childNodes[9]; + + var materialName = materialItem[1]; + var materialId = materialName.parentNode.parentNode.childNodes[3]; + // 条形码条码 + var barCodeItem = barCodeChildren.childNodes[3]; + // 物料编码 + var materialCodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes; + + + var materialCode = materialCodeItem[1]; + + var data = d.data; + if (data !== null) { + materialName.value = data.mname; + materialId.value = data.id; + materialCode.value = data.mcode; + var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; + barCodeInput.value = result; + } else { + // 如果没有对应关系 + layer.msg("对于编码:" + result + ",并未发现对应的物料", { + icon: 0, + time: 1000 //0.5秒关闭(如果不配置,默认是3秒) + }, function () { + }) + } + + } + }) + } + }) + }; + + // 用于扫码功能 + scanCodeByOut = function (obj) { + parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + $.ajax({ + url: "/material/qywxApplicationOutScanQrCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + // 获取对应元素 + var parent = obj.parentNode.parentNode.parentNode.parentNode; + var MaterialChildren = parent.childNodes[5]; + var materialItem = MaterialChildren.childNodes[3].childNodes[1].childNodes; + + var barCodeChildren = parent.childNodes[9]; + + var materialName = materialItem[1]; + var materialId = materialName.parentNode.parentNode.childNodes[3]; + // 条形码条码 + var barCodeItem = barCodeChildren.childNodes[3]; + // 物料编码 + var materialCodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes; + + var materialCode = materialCodeItem[1]; + + var idNumber = materialId.name.split("mid")[1]; + // 获取物料与条形码的对应关系 + var materialAndBarCodeList = data["materialAndBarCodeList"]; + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } + if (materialAndBarCodeList.length > 0) { + // 如果有对应的条形码 + var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; + var barCodeImg = barCodeItem.childNodes[1].childNodes[3]; + var id = barCodeInput.id; + $("#" + id).remove(); + $("#barCode" + idNumber).empty(); + var barCode = $("#barCode" + idNumber); + if (barCode.length > 0) { + barCode.empty(); + } else { + var barCodeSelect = ` + `; + $("#" + barCodeImg.id).before(barCodeSelect); + } + form.render(); + + $.each(materialAndBarCodeList, function (index, item) { + $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 + }); + form.render(); + } + $('#place' + idNumber).empty(); + $.each(data.placePList, function (index, item) { + $('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素 + }); + form.render(); + materialName.value = data.mname; + materialId.value = data.id; + materialCode.value = data.code; + } + }) + } + }) + }; + //用于判断当前物料数量是否合适 + MaterialQuantityIsTrue = function (obj) { + var id = obj.id.split("quantity")[1]; + var mcode = $("#code" + id).val(); // 获取到当前输入的物料编码 + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { + $("#quantity" + id).val("") + }); + } else { + let val = $("#quantity" + id).val(); + if (val !== null && val !== undefined && val !== '') { + var req = {}; + req.mcode = mcode; + req.quantity = val; + $.ajax({ + url: "/material/MaterialQuantityIsTrue", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + var flag = res.data; + if (!flag) { // 如果当前数目不合适 + layer.msg("当前物料数量不足", {icon: 0, time: 500}, function () { + $("#quantity" + id).val(""); + }); + + } + } + }); + } + } + } + + +}); diff --git a/target/classes/templates/pages/application/application-in.html b/target/classes/templates/pages/application/application-in.html index 15cd6216..91ccd433 100644 --- a/target/classes/templates/pages/application/application-in.html +++ b/target/classes/templates/pages/application/application-in.html @@ -598,49 +598,52 @@ }, 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 = ""; - } - codeValue.value = code; - priceValue.value = material.price; - var materialAndBarCodeList = material["materialAndBarCodeList"]; - if (materialAndBarCodeList.length > 0) { - // 如果有对应的条形码 - var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; - var barCodeImg = barCodeItem.childNodes[1].childNodes[3]; - var id = barCodeInput.id; - $("#" + id).remove(); - // barCodeInput.style = "display:none"; - var idNumber = materialId.name.split("mid")[1]; - var barCodeSelect = ` + 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"]; + if (materialAndBarCodeList.length > 0) { + // 如果有对应的条形码 + var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; + var barCodeImg = barCodeItem.childNodes[1].childNodes[3]; + var id = barCodeInput.id; + $("#" + id).remove(); + // barCodeInput.style = "display:none"; + var idNumber = materialId.name.split("mid")[1]; + 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(); + $("#" + 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(); + } } - } - }); + }); + } + } }); @@ -895,8 +898,6 @@ } }); }; - - // 用于扫描入库位置 scanLocationByQrCode = function (obj) { parent.wx.scanQRCode({ diff --git a/target/classes/templates/pages/group/applicationOutForGroup.html b/target/classes/templates/pages/group/applicationOutForGroup.html new file mode 100644 index 00000000..e8912c64 --- /dev/null +++ b/target/classes/templates/pages/group/applicationOutForGroup.html @@ -0,0 +1,776 @@ + + + + + 分步表单 + + + + + + + + + + +
+
+
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/application_multi.html b/target/classes/templates/pages/group/application_multi.html new file mode 100644 index 00000000..f57df7df --- /dev/null +++ b/target/classes/templates/pages/group/application_multi.html @@ -0,0 +1,260 @@ + + + + + layui + + + + + + + + +
+
+ + + +
+ +
+
+ + + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/group-add.html b/target/classes/templates/pages/group/group-add.html new file mode 100644 index 00000000..c31a2ff4 --- /dev/null +++ b/target/classes/templates/pages/group/group-add.html @@ -0,0 +1,340 @@ + + + + + layui + + + + + + + +
+
+ + +
+ 搜索信息 +
+
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ + +
+
+
+ + + + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/group-out.html b/target/classes/templates/pages/group/group-out.html new file mode 100644 index 00000000..c3ece2a7 --- /dev/null +++ b/target/classes/templates/pages/group/group-out.html @@ -0,0 +1,542 @@ + + + + + layui + + + + + + + +
+
+ +
+ 搜索信息 +
+
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+ + + + + +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/group_edit.html b/target/classes/templates/pages/group/group_edit.html new file mode 100644 index 00000000..52c239f4 --- /dev/null +++ b/target/classes/templates/pages/group/group_edit.html @@ -0,0 +1,330 @@ + + + + + layui + + + + + + + +
+
+ + +
+ 基本信息 +
+
+
+ +
+ + +
+
+ +
+ +
+ +
+
+ + + + +
+
+
+ + +
+
+
+ + + + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/group_material_edit.html b/target/classes/templates/pages/group/group_material_edit.html new file mode 100644 index 00000000..e4e21f72 --- /dev/null +++ b/target/classes/templates/pages/group/group_material_edit.html @@ -0,0 +1,148 @@ + + + + + layui + + + + + + + +
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+ + + +
+ +
+ +
+
+ +
+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/target/classes/templates/pages/group/selectGroup.html b/target/classes/templates/pages/group/selectGroup.html new file mode 100644 index 00000000..32c1a3cc --- /dev/null +++ b/target/classes/templates/pages/group/selectGroup.html @@ -0,0 +1,85 @@ + + + + + layui + + + + + + + +
+ + + + + + \ No newline at end of file