You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.6 KiB
60 lines
1.6 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
|
|
<div class="page-header">
|
|
<h3>Scan</h3>
|
|
</div>
|
|
|
|
<div class="row" id="app">
|
|
<div class="col-md-4">
|
|
<p><input name="rollNo" type="text" class="form-control" placeholder="Roll No" /></p>
|
|
<p><input name="firstSerialNo" type="text" class="form-control" placeholder="第一个序列号" /></p>
|
|
<p>
|
|
<button class="btn btn-primary" id="btnStart">OK</button>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
function postForm(formId, url, funcSuccess){
|
|
var postData = {};
|
|
$("#"+formId+" input").each(function(index){
|
|
var val = $(this).val();
|
|
postData[$(this).attr("name")] = val;
|
|
});
|
|
|
|
$.messager.confirm("Confirm","Submit", function(cr){
|
|
if (cr){
|
|
$.post(url, postData, function(ret){
|
|
if (ret.success){
|
|
funcSuccess(ret);
|
|
}else{
|
|
$.messager.alert("Error", ret.errorMsg, "error");
|
|
}
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
$("#btnStart").on("click", function(){
|
|
postForm("app", "/indigo/start/do", function(ret){
|
|
// $.messager.alert("info", "Successfully!", "info");
|
|
$("#app").html("<p>Successfully</p>");
|
|
});
|
|
});
|
|
|
|
|
|
$(".row").on("keydown", "input", function() {
|
|
if (event.keyCode == 13) {
|
|
event.keyCode = 9;
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
<style>
|
|
button {min-width: 100px;}
|
|
</style>
|
|
</@master.layout>
|
|
|