|
|
|
@ -13,12 +13,18 @@ |
|
|
|
<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; |
|
|
|
} |
|
|
|
@ -27,6 +33,7 @@ |
|
|
|
width: 100%; |
|
|
|
border-style: none; |
|
|
|
} |
|
|
|
|
|
|
|
.layui-card-body { |
|
|
|
padding: 10px 5px; |
|
|
|
} |
|
|
|
@ -43,15 +50,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">物料名称:</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"/> |
|
|
|
@ -60,7 +70,8 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">物料编码:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input id="code" name="code" type="text" placeholder="请填写入物料编码" value="" onblur="selectCode(this)" |
|
|
|
<input id="code" name="code" type="text" placeholder="请填写入物料编码" value="" |
|
|
|
onblur="selectCode(this)" |
|
|
|
class="layui-input" lay-verify="required"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -72,7 +83,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> |
|
|
|
@ -80,7 +92,8 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">物料数量:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input name="quantity" type="number" placeholder="请填写入物料数量" value="" onblur="MaterialQuantityIsTrue(this)" id="quantity" |
|
|
|
<input name="quantity" type="number" placeholder="请填写入物料数量" value="" |
|
|
|
onblur="MaterialQuantityIsTrue(this)" id="quantity" |
|
|
|
class="layui-input" lay-verify="number" required> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -91,13 +104,15 @@ |
|
|
|
class="layui-textarea"></textarea> |
|
|
|
</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: 30px;margin-left: 15%"> |
|
|
|
<button class="layui-btn" lay-submit lay-filter="formStep" |
|
|
|
style="margin-bottom: 30px;margin-left: 15%"> |
|
|
|
 提交申请  |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
@ -133,23 +148,40 @@ |
|
|
|
</div> |
|
|
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
|
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></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 MaterialQuantityIsTrue(){} |
|
|
|
function MaterialQuantityIsTrue() { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于扫描条形码 |
|
|
|
function scanBarCode() {} |
|
|
|
function scanBarCode() { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于重新渲染页面 |
|
|
|
function Coverpage() {} |
|
|
|
function Coverpage() { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于暂存卡片个数 |
|
|
|
var params = []; |
|
|
|
// 用于卡片编号 |
|
|
|
@ -210,18 +242,34 @@ |
|
|
|
layer.close(this.layerIndex); |
|
|
|
if (data.status >= 300) { |
|
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
|
return; |
|
|
|
|
|
|
|
} else { |
|
|
|
layer.msg("申请提交成功", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
}, function () { |
|
|
|
step.next('#stepForm'); |
|
|
|
}); |
|
|
|
/*let url = window.location.href.split("#")[0]; |
|
|
|
var req = {}; |
|
|
|
req.url = url; |
|
|
|
$.ajax({ |
|
|
|
url: "/QyWxSignature", |
|
|
|
type: "get", |
|
|
|
datatype: "json", |
|
|
|
data: (req), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (d) { |
|
|
|
var data = d.data; |
|
|
|
console.log(data) |
|
|
|
console.log(parent) |
|
|
|
parent.wx.agentConfig({ |
|
|
|
corpid: data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致 |
|
|
|
agentid: data.agentid, // 必填,企业微信的应用id (e.g. 1000247) |
|
|
|
timestamp: data.timestamp, // 必填,生成签名的时间戳 |
|
|
|
nonceStr: data.noncestr, // 必填,生成签名的随机串 |
|
|
|
signature: data.jsapi_ticket_app,// 必填,签名,见附录-JS-SDK使用权限签名算法 |
|
|
|
jsApiList: ['thirdPartyOpenPage'], //必填,传入需要使用的接口名称 |
|
|
|
success: function (res) { |
|
|
|
// 回调 |
|
|
|
parent.wx.invoke('thirdPartyOpenPage', { |
|
|
|
"oaType": "10001",// String |
|
|
|
"templateId": "3WKiKVCzyLv3Y1LaHZxp4DimQEpCdvYP52HsAUtF",// String |
|
|
|
"thirdNo": "123456123456",// String |
|
|
|
"thirdNo": "123456456",// String |
|
|
|
"extData": { |
|
|
|
'fieldList': [{ |
|
|
|
'title': '采购类型', |
|
|
|
@ -239,6 +287,24 @@ |
|
|
|
// 输出接口的回调信息 |
|
|
|
console.log(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
fail: function (res) { |
|
|
|
if (res.errMsg.indexOf('function not exist') > -1) { |
|
|
|
alert('版本过低请升级') |
|
|
|
} |
|
|
|
console.log(res) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
});*/ |
|
|
|
layer.msg("申请提交成功", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
}, function () { |
|
|
|
step.next('#stepForm'); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
complete: function () { |
|
|
|
@ -321,7 +387,7 @@ |
|
|
|
</div>`; |
|
|
|
// 获取当前高度 |
|
|
|
var height = parseInt(($("#stepForm").css('height')).split("px")[0]); |
|
|
|
params.push(NewIdNumber) |
|
|
|
params.push(NewIdNumber); |
|
|
|
$("#stepForm").css("height", height + 422 + 'px'); |
|
|
|
$("#" + parentId).after(materialItem); |
|
|
|
}; |
|
|
|
@ -412,6 +478,7 @@ |
|
|
|
params = remove(params, parentId); |
|
|
|
reparent.removeChild(parent); |
|
|
|
}; |
|
|
|
|
|
|
|
//删除数组中指定元素 |
|
|
|
function remove(arr, item) { |
|
|
|
var result = []; |
|
|
|
@ -457,8 +524,7 @@ |
|
|
|
obj.value = ""; |
|
|
|
$('#place' + objId).empty(); |
|
|
|
|
|
|
|
}else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
materialName.value = d.mname; |
|
|
|
materialId.value = d.id; |
|
|
|
var idNumber = materialId.name.split("mid")[1]; |
|
|
|
@ -567,8 +633,7 @@ |
|
|
|
codeValue.value = ""; |
|
|
|
materialName.value = ""; |
|
|
|
return false; |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
var material = d.data[0]; |
|
|
|
materialName.value = material.mname; |
|
|
|
materialId.value = material.id; |
|
|
|
|