<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<title></title>
|
<script src="../../js/mui.min.js"></script>
|
<script src="../../js/api.js"></script>
|
<script src="../../js/common.js"></script>
|
<script src="../../js/template-web.js"></script>
|
<link href="../../css/mui.min.css" rel="stylesheet" />
|
<link href="../../css/mui.picker.min.css" rel="stylesheet" />
|
<link rel="stylesheet" type="text/css" href="../../css/iconfont.css" />
|
<script src="../../js/mui.picker.min.js"></script>
|
<style type="text/css">
|
.mui-content {
|
margin-top: 2px;
|
}
|
.mui-content input{
|
text-align:left
|
}
|
|
/*标题中图标居右侧的css样式*/
|
.title-right {
|
float: right;
|
line-height: 44px !important;
|
position: absolute;
|
display: block;
|
width: 100%;
|
margin: 0 0px !important;
|
padding: 0 !important;
|
text-align: center;
|
white-space: nowrap;
|
color: #000;
|
display: inline-block;
|
overflow: hidden;
|
width: auto;
|
margin: 0;
|
text-overflow: ellipsis;
|
--color: #de1312;
|
}
|
|
</style>
|
</head>
|
<body class="mui-fullscreen">
|
<header class="mui-bar mui-bar-nav">
|
<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
|
<span class="mui-icon mui-icon-left-nav"></span>
|
</button>
|
<h1 class="mui-title">分切投料</h1>
|
<!-- <span class="title-right mui-icon mui-icon-camera" style="color:#0062CC" id="cameraId"></span> -->
|
</header>
|
<div class="mui-content">
|
<div class="mui-input-group">
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-shebei" style="color: #FF8C00;"></span>设备</label>
|
<input id="device" type="search" style="text-align:left " class="mui-input-clear" placeholder="请输入设备" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-gongwei" style="color: #FF8C00;"></span>工位</label>
|
<input id="station" type="text" disabled="disabled" style="background-color: #F5F5F5;" class="mui-input-clear" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-gonghao" style="color: #FF8C00;"></span>工号</label>
|
<input id="usercode" type="text" class="mui-input-clear" placeholder="请输入工号" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-banci" style="color: #FF8C00;"></span>班次</label>
|
<input id="classes" type="text" disabled="disabled" style="background-color: #F5F5F5;" class="mui-input-clear" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-gongdanxinxi" style="color:#FF8C00"></span>工单</label>
|
<select id="order" class="mui-h5" style="margin:auto; color:#000;" onchange="afterOrder(this.options[this.options.selectedIndex].value)" >
|
<option value="">请点击选择工单</option>
|
</select>
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-piliang" style="color: #FF8C00;" ></span>批量</label>
|
<input id="tqty" onkeyUp="checkSymbol(this)" type="search" style="text-align:left " class="mui-input-clear" placeholder="请输入批量" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-navicon-jhslsz" style="color: #FF8C00;"></span>计划</label>
|
<input id="pqty" type="text" disabled="disabled" style="background-color: #F5F5F5;" class="mui-input-clear" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-tiaoma" style="color: #FF8C00;"></span>物料</label>
|
<input id="barcode" type="search" style="text-align:left " class="mui-input-clear" placeholder="请输入物料" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-miaoshu" style="color: #FF8C00;"></span>描述</label>
|
<input id="note" type="text" disabled="disabled" style="background-color: #F5F5F5;" class="mui-input-clear" >
|
</div>
|
<div class="mui-input-row">
|
<label ><span class="mui-icon iconfont icon-shuliang" style="color: #FF8C00;"></span>数量</label>
|
<input id="qty" type="search" onkeyUp="checkSymbol(this)" style="text-align:left " class="mui-input-clear" placeholder="请输入数量" οninput="value=value.replace(/[^\d]/g,'')" >
|
</div>
|
<div class="mui-input-row" style="height: 6.25rem;">
|
<label ><span class="mui-icon iconfont icon-beizhu" style="color: #FF8C00;"></span>备注</label>
|
<textarea id="remark" class="form" rows="5" disabled="disabled" style="background-color: #F5F5F5;"></textarea>
|
</div>
|
|
<!-- <div class="mui-input-row" align="center">
|
<ul class="mui-table-view" id="submitBtn">
|
<li class="mui-table-view-cell" style="background-color: rgb(153,204,153)">
|
<a >提交</a>
|
</li>
|
</ul>
|
</div> -->
|
<ul class="mui-table-view" id="list">
|
</ul>
|
|
</div>
|
<script id='select-template' type="text/template">
|
<option value="">请点击选择工单</option>
|
<% for(var i in record){ var item=record[i]; %>
|
<option value='<%=(item)%>'><%=(item)%></option>
|
<% } %>
|
</script>
|
<script id='list-template' type="text/template">
|
<% for(var i in record){ var item=record[i]; %>
|
<li class="mui-table-view-cell mui-media">
|
<a href="javascript:;">
|
<div class="mui-media-body">
|
<%=(item.order)%>
|
<p class="mui-ellipsis">计划:<%=(item.qty)%> 批量:<%=(item.pqty)%></p>
|
</div>
|
</a>
|
</li>
|
<% } %>
|
</script>
|
<script id='record-template' type="text/template">
|
<option value="">请点击选择工单</option>
|
<% for(var i in record){ var item=record[i]; %>
|
<option value='<%=(item)%>'><%=(item)%></option>
|
<% } %>
|
</script>
|
</div>
|
|
<script type="text/javascript" charset="utf-8">
|
mui.init();
|
mui.plusReady(function() {
|
onListen();//输入法软键盘的搜索
|
mui.focus(document.getElementById('device'));
|
})
|
function onListen(){
|
document.getElementById("device").addEventListener("keydown", function(e) {
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
afterDevice()
|
}
|
}, false);
|
document.getElementById("station").addEventListener("keydown", function(e) {
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
afterStation();
|
}
|
}, false);
|
document.getElementById("usercode").addEventListener("keydown", function(e) {
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
afterUsercode()
|
}
|
}, false);
|
document.getElementById("barcode").addEventListener("keydown", function(e) {
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
afterBarcode()
|
}
|
}, false);
|
document.getElementById("tqty").addEventListener("keydown", function(e) {
|
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
document.getElementById('barcode').value = "";
|
mui.focus(document.getElementById('barcode'))
|
}
|
}, false);
|
document.getElementById("qty").addEventListener("keydown", function(e) {
|
|
if (13 == e.keyCode) { //
|
document.activeElement.blur(); //隐藏软键盘
|
afterQty()
|
}
|
}, false);
|
/* mui("#submitBtn").on("tap", "a", function(event) {
|
doSubmit();
|
}) */
|
}
|
function afterDevice(){
|
aj.post("/out/afterDevice", {
|
device: getParem('device')
|
}, function (data) {
|
console.log(JSON.stringify(data));
|
if (data.result) {
|
/* document.getElementById('station').value=""
|
mui.focus(document.getElementById('station')) */
|
setDou('usercode',data.data.code);
|
setDou('classes',data.data.classes);
|
setDou('station',data.data.station);
|
setDou('tqty',data.data.tqry);
|
setDou('pqty',data.data.pqry);
|
|
document.getElementById('order').innerHTML = template('select-template', {
|
"record": data.data.list
|
});
|
if(data.data.code){
|
document.getElementById('barcode').value=""
|
mui.focus(document.getElementById('barcode'))
|
}else{
|
document.getElementById('usercode').value=""
|
mui.focus(document.getElementById('usercode'))
|
}
|
} else {
|
mui.alert(data.msg, '错误', function() {
|
//关闭回调函数
|
document.getElementById('device').value=""
|
mui.focus(document.getElementById('device'))
|
});
|
}
|
});
|
}
|
function afterStation() {
|
aj.post("/create/afterStation", {
|
station: getStationParam('device','station')
|
}, function(data) {
|
if (data.result) {
|
//var html = document.getElementById("order").innerHTML;
|
document.getElementById('order').innerHTML = template('record-template', {
|
"record": data.data.list
|
});
|
document.getElementById('usercode').value = "";
|
//document.getElementById('userCode').focus();
|
mui.focus(document.getElementById('usercode'))
|
} else {
|
mui.alert(data.msg, '系统提示', function() {
|
document.getElementById('station').value = "";
|
mui.focus(document.getElementById('station'));
|
});
|
}
|
});
|
}
|
function afterUsercode(){
|
aj.post("/out/afterCode", {
|
param: getParem('usercode')
|
}, function (data) {
|
if (data.result) {
|
console.log(JSON.stringify(data.data));
|
document.getElementById("classes").value=data.data
|
document.getElementById('order').value=""
|
mui.focus(document.getElementById('order'));
|
} else {
|
//plus.ui.toast(data.msg);
|
mui.alert(data.msg, '错误', function() {
|
//关闭回调函数
|
});
|
}
|
});
|
}
|
function afterOrder(value){
|
aj.post("/out/afterOrder", {
|
param: api_localStorageGet("functionName")+'[file1['+api_localStorageGet("code")+'['+value+'['+getDou('station')
|
}, function (data) {
|
if (data.result) {
|
console.log(JSON.stringify(data.data));
|
document.getElementById("pqty").value=data.data[0]
|
document.getElementById('tqty').value=""
|
mui.focus(document.getElementById('tqty'));
|
} else {
|
mui.alert(data.msg, '错误', function() {
|
//关闭回调函数
|
});
|
}
|
});
|
}
|
function afterBarcode(){
|
aj.post("/out/afterBarcoe", {
|
barcode: getParem('barcode')
|
}, function (data) {
|
if (data.result) {
|
console.log(JSON.stringify(data.data));
|
document.getElementById("note").value=data.data[0]
|
document.getElementById("qty").value=data.data[1]
|
document.getElementById('qty').value=""
|
mui.focus(document.getElementById('qty'));
|
} else {
|
mui.alert(data.msg, '错误', function() {
|
//关闭回调函数
|
});
|
}
|
});
|
}
|
function afterQty(){
|
if (document.getElementById("qty").value.length == 0) {
|
plus.ui.toast("用量不能为空");
|
return;
|
}
|
doSubmit();
|
}
|
function doSubmit(){
|
aj.post("/out/afterQty", {
|
param: getSubmitParam()
|
}, function (data) {
|
console.log(JSON.stringify(data.data));
|
document.getElementById('barcode').focus(); //获取焦点
|
if (data.result) {
|
document.getElementById("remark").value=data.data
|
clear()
|
} else {
|
//plus.ui.toast(data.msg);
|
mui.alert(data.msg, '错误', function() {
|
//关闭回调函数
|
document.getElementById("barcode").value=''
|
});
|
|
}
|
});
|
}
|
function clear(){
|
setDou("barcode",'')
|
setDou("note",'')
|
setDou("qty",'')
|
}
|
function getParem(param){
|
return api_localStorageGet("functionName")+'[file1['+api_localStorageGet("code")+'['+getDou(param)
|
}
|
function getSubmitParam(){
|
//模块名称[字段名[登录帐号[工位[工号[班次[工单号[[批量[设备号[批次条码[用量
|
var obj = document.getElementById('order'); //定位id
|
var index = obj.selectedIndex; // 选中索引
|
var value = obj.options[index].value; // 选中值
|
return api_localStorageGet("functionName")+'[file1['+ api_localStorageGet("code")+'['+
|
getDou('station')+'['+getDou('usercode')+'['+getDou('classes')+'['+value+'[['+getDou('tqty')+'['+
|
getDou('device')+'['+getDou('barcode')+'['+getDou('qty');
|
}
|
function getDou(p) {
|
return document.getElementById(p).value;
|
}
|
function setDou(p,v){
|
document.getElementById(p).value = v;
|
}
|
function getStationParam(param, param1) {
|
return api_localStorageGet("functionName") + '[field1[' + api_localStorageGet("code")
|
+ '[' + document.getElementById(param).value
|
+ '[' + document.getElementById(param1).value
|
}
|
</script>
|
</body>
|
</html>
|