|
@@ -0,0 +1,103 @@
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+<meta charset="utf-8">
|
|
|
+<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
|
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
+<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
|
|
+<meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
|
+<title>添加机器</title>
|
|
|
+<#include "/base/list_base.ftl">
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="pd-20">
|
|
|
+ <form class="form form-horizontal" id="form-admin-add">
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-3"><span class="c-red">*</span>产品:</label>
|
|
|
+ <div class="formControls col-5">
|
|
|
+ <select class="my-select" name="machineType">
|
|
|
+ <option value ="1">净水机</option>
|
|
|
+ <option value ="2">冲奶机</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col-4"> </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-3"><span class="c-red">*</span>软件版本:</label>
|
|
|
+ <div class="formControls col-5">
|
|
|
+ <input id="machineSoftwareVersion" type="text" name="machineSoftwareVersion" value="" class="input-text" datatype="*6-20" nullmsg="描述不能为空,可以为:xx月二次生成">
|
|
|
+ </div>
|
|
|
+ <div class="col-4"> </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-3"><span class="c-red">*</span>数量:</label>
|
|
|
+ <div class="formControls col-5">
|
|
|
+ <input id="number" type="text" name="number" value="" class="input-text" datatype="*6-20" nullmsg="每次最少生成一个机器">
|
|
|
+ </div>
|
|
|
+ <div class="col-4"> </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <div class="col-9 col-offset-3">
|
|
|
+ <input id="sumbit" class="btn btn-primary radius" type="button" value=" 提交 " onclick="admin_add()">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
+<script type="text/javascript"
|
|
|
+ src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
|
|
|
+<script type="text/javascript">
|
|
|
+ function dataCharm() {
|
|
|
+ var machineSoftwareVersion = $("#machineSoftwareVersion").val();
|
|
|
+ if(machineSoftwareVersion == null){
|
|
|
+ layer.msg("软件版本不能为空",{icon: 5,time:3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(1 > machineSoftwareVersion.length > 11){
|
|
|
+ layer.msg("软件版本长度为2-10位",{icon: 5,time:3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var number = $("#number").val();
|
|
|
+ if(number == null){
|
|
|
+ layer.msg("数量不能为空",{icon: 5,time:3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(1 > number.length > 5){
|
|
|
+ layer.msg("数量长度为2-10位",{icon: 5,time:3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+/*管理员-添加*/
|
|
|
+function admin_add(){
|
|
|
+ var msg = dataCharm();
|
|
|
+ if(msg){
|
|
|
+ $.ajax({
|
|
|
+ url: '${pageContext.request.contextPath }/admin/machine/_add_machine_batch',
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ data: $("#form-admin-add").serialize(),
|
|
|
+ beforeSubmit: function (data) {
|
|
|
+ $("#submit").attr("disabled","disabled");
|
|
|
+ },
|
|
|
+ success: function(data){
|
|
|
+ if(data.returnCode){
|
|
|
+ layer.msg("添加成功",{icon: 1,time:3000});
|
|
|
+ /* window.parent.location.reload();
|
|
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
+ parent.layer.close(index);*/
|
|
|
+
|
|
|
+ }else{
|
|
|
+ layer.msg("添加失败",{icon: 5,time:3000});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error:function(data){
|
|
|
+ layer.msg("添加失败",{icon: 5,time:3000});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|