|
|
|
@ -13,22 +13,30 @@ |
|
|
|
<body> |
|
|
|
<style> |
|
|
|
.inputdiv { |
|
|
|
display:flex;background-color: #fff;height: 38px;line-height: 38px;border: 1px solid rgb(238, 238, 238); |
|
|
|
display: flex; |
|
|
|
background-color: #fff; |
|
|
|
height: 38px; |
|
|
|
line-height: 38px; |
|
|
|
border: 1px solid rgb(238, 238, 238); |
|
|
|
} |
|
|
|
|
|
|
|
.layui-form-label { |
|
|
|
padding: 9px 0px; |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
|
|
|
|
.layui-input-block { |
|
|
|
margin-left: 80px; |
|
|
|
} |
|
|
|
|
|
|
|
.layui-form-select { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.layui-card-body { |
|
|
|
padding: 10px 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.lay-step { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
@ -45,15 +53,18 @@ |
|
|
|
<div class="layui-card" id="cardParent"> |
|
|
|
<div class="layui-card-body" id="cardItem"> |
|
|
|
<hr> |
|
|
|
<i class="layui-icon layui-icon-subtraction" style="display: inline" onclick="deleteItem(this)"></i> |
|
|
|
<i class="layui-icon layui-icon-subtraction" style="display: inline" |
|
|
|
onclick="deleteItem(this)"></i> |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label" style="height: 40px;">物料名称:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<div class="inputdiv"> |
|
|
|
<input type="text" placeholder="请选择物料" class="layui-input" style="border-style: none" |
|
|
|
<input type="text" placeholder="请选择物料" class="layui-input" |
|
|
|
style="border-style: none" |
|
|
|
id="openSonByMaterial" onblur="selectMaterialByName(this)" |
|
|
|
lay-verify="required"/> |
|
|
|
<i class="layui-icon layui-icon-search" style="display: inline" id="selectMaterial" onclick="selectMaterial(this)"></i> |
|
|
|
<i class="layui-icon layui-icon-search" style="display: inline" |
|
|
|
id="selectMaterial" onclick="selectMaterial(this)"></i> |
|
|
|
</div> |
|
|
|
<input type="text" name="mid" class="layui-input" id="mid" |
|
|
|
style="display: none" lay-verify="required"/> |
|
|
|
@ -81,7 +92,8 @@ |
|
|
|
value="" |
|
|
|
class="layui-input" |
|
|
|
style="border-style: none"> |
|
|
|
<img src="/static/images/search.ico" height="16" width="16" id="barCodeImg" |
|
|
|
<img src="/static/images/search.ico" height="16" width="16" |
|
|
|
id="barCodeImg" |
|
|
|
style="margin-top: 10px" onclick="scanBarCode(this)"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -95,7 +107,9 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">物料数量:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input id="quantity" name="quantity" type="number" onblur="MaterialQuantityIsTrue(this)" placeholder="请填写入物料数量" value="" class="layui-input" lay-verify="number" required> |
|
|
|
<input id="quantity" name="quantity" type="number" |
|
|
|
onblur="MaterialQuantityIsTrue(this)" placeholder="请填写入物料数量" value="" |
|
|
|
class="layui-input" lay-verify="number" required> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
|
|
@ -110,10 +124,13 @@ |
|
|
|
<label class="layui-form-label" style="height: 40px;">仓库:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<div class="inputdiv"> |
|
|
|
<input type="text" placeholder="请选择仓库" class="layui-input" style="border-style: none" |
|
|
|
id="openSonByDepository" readonly onclick="openDepositoryTree(this)" |
|
|
|
<input type="text" placeholder="请选择仓库" class="layui-input" |
|
|
|
style="border-style: none" |
|
|
|
id="openSonByDepository" readonly |
|
|
|
onclick="openDepositoryTree(this)" |
|
|
|
lay-verify="required"/> |
|
|
|
<input type="text" name="depositoryId" class="layui-input" id="depositoryId" |
|
|
|
<input type="text" name="depositoryId" class="layui-input" |
|
|
|
id="depositoryId" |
|
|
|
style="display: none" lay-verify="required"/> |
|
|
|
<input type="text" name="placeId" class="layui-input" id="placeId" |
|
|
|
style="display: none" lay-verify="required"/> |
|
|
|
@ -126,15 +143,18 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">备注说明:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input name="applyRemark" placeholder="请填写相关原因及申请原因" value="" class="layui-input"/> |
|
|
|
<input name="applyRemark" placeholder="请填写相关原因及申请原因" value="" |
|
|
|
class="layui-input"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<i class="layui-icon layui-icon-addition" style="display: inline" onclick="addItem(this)"></i> |
|
|
|
<i class="layui-icon layui-icon-addition" style="display: inline" |
|
|
|
onclick="addItem(this)"></i> |
|
|
|
</div> |
|
|
|
<!-- 提交--> |
|
|
|
<div class="layui-form-item" id="btn_sub"> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<button class="layui-btn" lay-submit lay-filter="formStep" style="margin-bottom: 10px;margin-left: 15%"> |
|
|
|
<button class="layui-btn" lay-submit lay-filter="formStep" |
|
|
|
style="margin-bottom: 10px;margin-left: 15%"> |
|
|
|
 提交  |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
@ -167,17 +187,29 @@ |
|
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
|
<script> |
|
|
|
// 用于添加标签 |
|
|
|
function addItem(obj){} |
|
|
|
function addItem(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于删除标签 |
|
|
|
function deleteItem(obj){} |
|
|
|
function deleteItem(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于编码查询 |
|
|
|
function selectCode(obj){} |
|
|
|
function selectCode(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于点击搜索按钮 |
|
|
|
function selectMaterial(obj){} |
|
|
|
function selectMaterial(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于物料名称查询 |
|
|
|
function selectMaterialByName(obj){} |
|
|
|
function selectMaterialByName(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于加载仓库菜单 |
|
|
|
function openDepositoryTree(obj){} |
|
|
|
function openDepositoryTree(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于扫码转移 |
|
|
|
function scanCodeByTransfer(obj) { |
|
|
|
} |
|
|
|
@ -196,6 +228,7 @@ |
|
|
|
function scanLocationByQrCode() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 用于暂存卡片个数 |
|
|
|
var params = []; |
|
|
|
let scanValue = {}; |
|
|
|
@ -412,7 +445,6 @@ |
|
|
|
|
|
|
|
// 用于实现扫描条形码 |
|
|
|
scanBarCode = function (obj) { |
|
|
|
|
|
|
|
parent.wx.scanQRCode({ |
|
|
|
desc: 'scanQRCode desc', |
|
|
|
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, |
|
|
|
@ -423,6 +455,7 @@ |
|
|
|
var req = {}; |
|
|
|
req.qrCode = result; |
|
|
|
req.codeFlag = 1; |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/qywxApplicationOutScanBarCode", |
|
|
|
type: "post", |
|
|
|
@ -475,13 +508,14 @@ |
|
|
|
$('#place' + codeId).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素 |
|
|
|
}); |
|
|
|
form.render(); |
|
|
|
} |
|
|
|
else{ |
|
|
|
layer.close(loading2); |
|
|
|
} else { |
|
|
|
// 如果没有对应关系 |
|
|
|
layer.msg("对于编码:" + result + ",并未发现对应的物料", { |
|
|
|
icon: 0, |
|
|
|
time: 1000 //0.5秒关闭(如果不配置,默认是3秒) |
|
|
|
}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
@ -518,6 +552,7 @@ |
|
|
|
var req = {}; |
|
|
|
req.qrCode = result; |
|
|
|
req.codeFlag = 2; |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/qywxApplicationOutScanQrCode", |
|
|
|
type: "post", |
|
|
|
@ -532,6 +567,7 @@ |
|
|
|
icon: 0, |
|
|
|
time: 1000 //0.5秒关闭(如果不配置,默认是3秒) |
|
|
|
}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
@ -592,6 +628,7 @@ |
|
|
|
materialName.value = data.mname; |
|
|
|
materialId.value = data.id; |
|
|
|
materialCode.value = data.code; |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -617,6 +654,7 @@ |
|
|
|
req.code = code; |
|
|
|
req.type = "out"; |
|
|
|
if (code !== "") { |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findMatrialByCode", |
|
|
|
type: "get", |
|
|
|
@ -626,10 +664,13 @@ |
|
|
|
success: function (d) { |
|
|
|
var d = d.data; |
|
|
|
if (d == null) { |
|
|
|
layer.msg("没有该编码,请确认是否输入正确"); |
|
|
|
layer.msg("没有该编码,请确认是否输入正确", {icon: 5, time: 500}, function () { |
|
|
|
materialName.value = ""; |
|
|
|
materialId.value = ""; |
|
|
|
obj.value = ""; |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
req.mid = d.id; |
|
|
|
$.ajax({ |
|
|
|
@ -684,6 +725,7 @@ |
|
|
|
form.render(); |
|
|
|
materialName.value = d.mname; |
|
|
|
materialId.value = d.id; |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -707,7 +749,6 @@ |
|
|
|
var mname = materialName.value; |
|
|
|
var barCodeChildren = parent.childNodes[9]; |
|
|
|
var barCodeItem = barCodeChildren.childNodes[3]; |
|
|
|
|
|
|
|
mname = mname.split(",")[0]; |
|
|
|
layer.open({ |
|
|
|
type: 2, |
|
|
|
@ -729,6 +770,7 @@ |
|
|
|
}, |
|
|
|
end: function () { |
|
|
|
var mid = materialId.value; |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findMatrialById?mid=" + mid + "&type=out", |
|
|
|
type: "get", |
|
|
|
@ -781,14 +823,14 @@ |
|
|
|
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 |
|
|
|
}); |
|
|
|
form.render(); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
var barCode = $("#barCode" + idNumber); |
|
|
|
if (barCode.length > 0) { |
|
|
|
barCode.empty(); |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@ -816,6 +858,7 @@ |
|
|
|
data = data.split(",")[0]; |
|
|
|
if (data !== "") { |
|
|
|
req.mname = data; |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findInventoryByCondition", |
|
|
|
type: "post", |
|
|
|
@ -824,18 +867,22 @@ |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (d) { |
|
|
|
if (d.count > 1) { |
|
|
|
layer.msg("请点击右侧搜索确定物品"); |
|
|
|
layer.msg("请点击右侧搜索确定物品", {icon: 0, time: 500}, function () { |
|
|
|
materialId.value = ""; |
|
|
|
codeValue.value = ""; |
|
|
|
layer.close(loading2); |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} else if (d.count === 0) { |
|
|
|
layer.msg("没有该物品,请确认输入是否正确"); |
|
|
|
layer.msg("没有该物品,请确认输入是否正确", {icon: 0, time: 500}, function () { |
|
|
|
materialId.value = ""; |
|
|
|
codeValue.value = ""; |
|
|
|
materialName.value = ""; |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
var idNumber = materialId.name.split("mid")[1]; |
|
|
|
var material = d.data[0]; |
|
|
|
var unit = $("#unit" + idNumber); |
|
|
|
@ -886,6 +933,7 @@ |
|
|
|
materialName.value = material.mname; |
|
|
|
materialId.value = material.id; |
|
|
|
codeValue.value = material.code; |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -927,6 +975,7 @@ |
|
|
|
var result = res.resultStr;//当needResult为1时返回处理结果 |
|
|
|
var req = {}; |
|
|
|
req.qrCode = result; |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/place/qywxApplicationInScanQrCode", |
|
|
|
type: "post", |
|
|
|
@ -942,13 +991,16 @@ |
|
|
|
var placeId = parent.childNodes[5]; |
|
|
|
if (flag === 0) { |
|
|
|
// 如果没有获取到位置 |
|
|
|
layer.msg("当前二维码错误,请重新扫描"); |
|
|
|
layer.msg("当前二维码错误,请重新扫描",{icon:5,time:500},function () { |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
} else if (flag === 1) { |
|
|
|
// 如果获取到的是库位 |
|
|
|
var place = data["place"]; |
|
|
|
placeId.value = place.id; |
|
|
|
depositoryId.value = place.did; |
|
|
|
depositoryName.value = place.depositoryName; |
|
|
|
layer.close(loading2); |
|
|
|
|
|
|
|
} else if (flag === 2) { |
|
|
|
// 如果获取到的是仓库 |
|
|
|
@ -956,6 +1008,7 @@ |
|
|
|
placeId.value = 0; |
|
|
|
depositoryId.value = depository.id; |
|
|
|
depositoryName.value = depository.dname; |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -980,6 +1033,7 @@ |
|
|
|
req.quantity = val; |
|
|
|
req.unit = unit; |
|
|
|
req.placeId = $("#place" + id).val(); |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/MaterialQuantityIsTrue", |
|
|
|
type: "post", |
|
|
|
@ -991,6 +1045,7 @@ |
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
layer.msg("当前物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
$("#quantity" + id).val(""); |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|