|
@@ -22,6 +22,9 @@
|
|
.cp-list{list-style-type: none;margin: 0;padding: 0;}
|
|
.cp-list{list-style-type: none;margin: 0;padding: 0;}
|
|
.cp-list>li{position: relative; cursor: pointer;clear: both;padding: 15px 0;}
|
|
.cp-list>li{position: relative; cursor: pointer;clear: both;padding: 15px 0;}
|
|
.my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(images/select-1.png) right center no-repeat;background-size:auto 100%;}
|
|
.my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(images/select-1.png) right center no-repeat;background-size:auto 100%;}
|
|
|
|
+
|
|
|
|
+ .pro-height{margin-top: 0px;}
|
|
|
|
+ .process-sp{margin-top: 0px; line-height: 30px;}
|
|
</style>
|
|
</style>
|
|
<title>添加生产产品- 生产产品管理 - RST</title>
|
|
<title>添加生产产品- 生产产品管理 - RST</title>
|
|
</head>
|
|
</head>
|
|
@@ -30,31 +33,36 @@
|
|
<form class="form form-horizontal" id="form-admin-addProduce">
|
|
<form class="form form-horizontal" id="form-admin-addProduce">
|
|
<div style="padding: 10px;width: 600px;margin: 0 auto;" class="">
|
|
<div style="padding: 10px;width: 600px;margin: 0 auto;" class="">
|
|
<div class="my-title">产品信息</div>
|
|
<div class="my-title">产品信息</div>
|
|
- <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" type="text" value="" placeholder="请输入产品名称" required maxlength="20" /> </div>
|
|
|
|
- <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" value="" placeholder="请输入产品描述" required maxlength="100"/> </div>
|
|
|
|
|
|
+ <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" id="produceName" type="text" value="" placeholder="请输入产品名称,2-20位中文、英文组合" required maxlength="20" /> </div>
|
|
|
|
+ <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" id="produceRemake" value="" placeholder="请输入产品描述,2-100位中文、英文组合" required maxlength="100"/> </div>
|
|
<div class="input-box"><span class="input-dic">产品类型</span>
|
|
<div class="input-box"><span class="input-dic">产品类型</span>
|
|
<label><input type="radio" name="produceType" value="1" checked>净水机</label>
|
|
<label><input type="radio" name="produceType" value="1" checked>净水机</label>
|
|
<label><input type="radio" name="produceType" value="2">冲奶机</label>
|
|
<label><input type="radio" name="produceType" value="2">冲奶机</label>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="input-box"><span class="input-dic">产品状态</span>
|
|
|
|
+ <label><input type="radio" name="produceStatus" value="1" checked>正在使用</label>
|
|
|
|
+ <label><input type="radio" name="produceStatus" value="0">停止使用</label>
|
|
|
|
+ </div>
|
|
<div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;"></div>
|
|
<div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;"></div>
|
|
<div class="my-title">节点信息</div>
|
|
<div class="my-title">节点信息</div>
|
|
|
|
|
|
<ul class="cp-list onrTheProcess" id="sortable">
|
|
<ul class="cp-list onrTheProcess" id="sortable">
|
|
<li id="1" class="processList">
|
|
<li id="1" class="processList">
|
|
<input type="hidden" class="processNumber" value="1">
|
|
<input type="hidden" class="processNumber" value="1">
|
|
- <div class="input-box"><span class="input-dic process-type">节点类型</span>
|
|
|
|
|
|
+ <div class="input-box pro-height">
|
|
|
|
+ <span class="input-dic process-type process-sp">节点类型</span>
|
|
<label><input type="radio" name="processType_p1" value="1" checked>生产工序</label>
|
|
<label><input type="radio" name="processType_p1" value="1" checked>生产工序</label>
|
|
<label><input type="radio" name="processType_p1" value="2">修理工序</label>
|
|
<label><input type="radio" name="processType_p1" value="2">修理工序</label>
|
|
<button type="button" class="my-btn-edit" onclick="delProcess(this)">删除节点</button>
|
|
<button type="button" class="my-btn-edit" onclick="delProcess(this)">删除节点</button>
|
|
</div>
|
|
</div>
|
|
- <div class="input-box"><span class="input-dic">节点名称</span><input class="my-input" name="processName" type="text" value="" placeholder="请输入节点名称" required maxlength="20"/> </div>
|
|
|
|
|
|
+ <div class="input-box"><span class="input-dic">节点名称</span><input class="my-input" name="processName" type="text" value="" placeholder="请输入节点名称,2-20位中文、英文组合" required maxlength="20"/> </div>
|
|
<div class="input-box"><span class="input-dic">节点操作</span>
|
|
<div class="input-box"><span class="input-dic">节点操作</span>
|
|
<ul class="add-list oneTheNode" >
|
|
<ul class="add-list oneTheNode" >
|
|
<li class="nodeList">
|
|
<li class="nodeList">
|
|
<#--<select class="my-select"><option>1</option></select>-->
|
|
<#--<select class="my-select"><option>1</option></select>-->
|
|
<label><input type="radio" name="nodeStatus_p1_n1" value="1" checked>正常</label>
|
|
<label><input type="radio" name="nodeStatus_p1_n1" value="1" checked>正常</label>
|
|
<label><input type="radio" name="nodeStatus_p1_n1" value="0">异常</label>
|
|
<label><input type="radio" name="nodeStatus_p1_n1" value="0">异常</label>
|
|
- <input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入节点操作描述,2-20位中文" required minlength="2" maxlength="20" />
|
|
|
|
|
|
+ <input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入操作描述,2-20位中文、英文组合" required minlength="2" maxlength="20" />
|
|
<i class="Hui-iconfont" onclick="delNode(this)"></i>
|
|
<i class="Hui-iconfont" onclick="delNode(this)"></i>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -79,53 +87,43 @@
|
|
<script type="text/javascript" src="${path}/common/lib/jquery.ui/jquery-ui.js"></script>
|
|
<script type="text/javascript" src="${path}/common/lib/jquery.ui/jquery-ui.js"></script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
|
|
-/*
|
|
|
|
- $(function(){
|
|
|
|
- $("#form-admin-addProduce").validate({
|
|
|
|
- rules:{
|
|
|
|
- produceName1:{
|
|
|
|
- required:true,
|
|
|
|
- minlength:2,
|
|
|
|
- maxlength:20
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- messages: {
|
|
|
|
- produceName1: {
|
|
|
|
- required: "*必填!",
|
|
|
|
- rangelength: "*长度为2到20位!",
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //是否在获取焦点时验证
|
|
|
|
- //onfocusout:false,
|
|
|
|
- //是否在敲击键盘时验证
|
|
|
|
- //onkeyup:false,
|
|
|
|
- //提交表单后,(第一个)未通过验证的表单获得焦点
|
|
|
|
- focusInvalid:true,
|
|
|
|
- //当未通过验证的元素获得焦点时,移除错误提示
|
|
|
|
- focusCleanup:true,
|
|
|
|
-
|
|
|
|
-// onkeyup:false,
|
|
|
|
-// focusCleanup:true,
|
|
|
|
-// success:"valid",
|
|
|
|
- submitHandler:function(form){
|
|
|
|
- $.post(root_path + "/admin/produce/save_produce", formatJSON(),function(result){
|
|
|
|
- if (result.returnCode != 200 || result.returnCode != 200) {
|
|
|
|
- layer.msg('录入失败,请重试!',{icon: 5,time:3000});
|
|
|
|
- } else {
|
|
|
|
- layer.msg('录入成功!!',{icon: 1,time:2000}, function () {
|
|
|
|
- // 关闭当前页面,并刷新父级页面
|
|
|
|
- window.location.href= '${path}/admin/produce/_produce_list';
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });*/
|
|
|
|
-
|
|
|
|
|
|
+ var check_name = /^[a-zA-Z\u4e00-\u9fa5]+$/;
|
|
|
|
|
|
$(function(){
|
|
$(function(){
|
|
//var validator = $("#form-admin-addProduce").validate();
|
|
//var validator = $("#form-admin-addProduce").validate();
|
|
$("#form-admin-addProduce").submit(function(){
|
|
$("#form-admin-addProduce").submit(function(){
|
|
|
|
+
|
|
|
|
+ var produceName = $("#produceName").val();
|
|
|
|
+ if(!(check_name.test(produceName))){
|
|
|
|
+ layer.msg('产品名称输入格式不正确', {icon: 5, time: 1000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var produceRemake = $("#produceRemake").val();
|
|
|
|
+ if(!(check_name.test(produceRemake))){
|
|
|
|
+ layer.msg('产品描述输入格式不正确', {icon: 5, time: 1000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var flag = true;
|
|
|
|
+ $("input[name='processName']").each(function () {
|
|
|
|
+ if( !(check_name.test($(this).val())) ){
|
|
|
|
+ layer.msg('节点名称输入格式不正确', {icon: 5, time: 1000});
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(!flag)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ $("input[name='nodeDes']").each(function () {
|
|
|
|
+ if( !(check_name.test($(this).val())) ){
|
|
|
|
+ layer.msg('节点操作描述输入格式不正确', {icon: 5, time: 1000});
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(!flag)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
ajaxReq();
|
|
ajaxReq();
|
|
return false;
|
|
return false;
|
|
})
|
|
})
|
|
@@ -179,7 +177,8 @@
|
|
produce.json = JSON.stringify(proessList); //将工序变成json存入到产品对象中
|
|
produce.json = JSON.stringify(proessList); //将工序变成json存入到产品对象中
|
|
produce.produceName = $("[name='produceName']").val();//获取产品名称
|
|
produce.produceName = $("[name='produceName']").val();//获取产品名称
|
|
produce.produceRemake = $("[name='produceRemake']").val();//获取产品描述
|
|
produce.produceRemake = $("[name='produceRemake']").val();//获取产品描述
|
|
- produce.produceType = $("[name='produceType']").val();//获取产品描述
|
|
|
|
|
|
+ produce.produceType = $("[name='produceType']:checked").val();//获取产品类型
|
|
|
|
+ produce.produceStatus = $("[name='produceStatus']:checked").val();//获取产品状态
|
|
return produce;
|
|
return produce;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -193,7 +192,7 @@
|
|
//+'<select class="my-select"><option>1</option></select> '
|
|
//+'<select class="my-select"><option>1</option></select> '
|
|
+'<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n'+ nodeNumber +'" value="1" checked>正常</label> '
|
|
+'<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n'+ nodeNumber +'" value="1" checked>正常</label> '
|
|
+'<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n'+ nodeNumber +'" value="0">异常</label> '
|
|
+'<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n'+ nodeNumber +'" value="0">异常</label> '
|
|
- +'<input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入节点操作描述,2-20位中文" required minlength="2" maxlength="20"/> '
|
|
|
|
|
|
+ +'<input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入操作描述,2-20位中文、英文组合" required minlength="2" maxlength="20"/> '
|
|
+'<i class="Hui-iconfont" onclick="delNode(this)"></i>'
|
|
+'<i class="Hui-iconfont" onclick="delNode(this)"></i>'
|
|
+'</li>';
|
|
+'</li>';
|
|
$(node).parent().before(nodeHtml);
|
|
$(node).parent().before(nodeHtml);
|
|
@@ -211,14 +210,14 @@
|
|
+ '<label><input type="radio" name="processType_p'+ processNumber +'" value="2">修理工序</label>'
|
|
+ '<label><input type="radio" name="processType_p'+ processNumber +'" value="2">修理工序</label>'
|
|
+ '<button type="button" class="my-btn-edit" onclick="delProcess(this)">删除节点</button>'
|
|
+ '<button type="button" class="my-btn-edit" onclick="delProcess(this)">删除节点</button>'
|
|
+ '</div>'
|
|
+ '</div>'
|
|
- + '<div class="input-box"><span class="input-dic">节点名称</span><input class="my-input" name="processName" type="text" value="" placeholder="请输入节点名称" required maxlength="20"/> </div>'
|
|
|
|
|
|
+ + '<div class="input-box"><span class="input-dic">节点名称</span><input class="my-input" name="processName" type="text" value="" placeholder="请输入节点名称,2-20位中文、英文组合" required maxlength="20"/> </div>'
|
|
+ '<div class="input-box"><span class="input-dic">节点操作</span>'
|
|
+ '<div class="input-box"><span class="input-dic">节点操作</span>'
|
|
+ '<ul class="add-list oneTheNode">'
|
|
+ '<ul class="add-list oneTheNode">'
|
|
+ '<li class="nodeList">'
|
|
+ '<li class="nodeList">'
|
|
// + '<select class="my-select"><option>1</option></select> '
|
|
// + '<select class="my-select"><option>1</option></select> '
|
|
+ '<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n1" value="1" checked>正常</label> '
|
|
+ '<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n1" value="1" checked>正常</label> '
|
|
+ '<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n1" value="0">异常</label> '
|
|
+ '<label><input type="radio" name="nodeStatus_p'+ processNumber +'_n1" value="0">异常</label> '
|
|
- + '<input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入节点操作描述,2-20位中文" required minlength="2" maxlength="20"/> '
|
|
|
|
|
|
+ + '<input class="my-input" name="nodeDes" type="text" value="" placeholder="请输入操作描述,2-20位中文、英文组合" required minlength="2" maxlength="20"/> '
|
|
+ '<i class="Hui-iconfont" onclick="delNode(this)"></i>'
|
|
+ '<i class="Hui-iconfont" onclick="delNode(this)"></i>'
|
|
+ '</li>'
|
|
+ '</li>'
|
|
+ '<li><button type="button" class="my-btn-edit" onclick="addProNode(this)">增加节点操作</button></li>'
|
|
+ '<li><button type="button" class="my-btn-edit" onclick="addProNode(this)">增加节点操作</button></li>'
|
|
@@ -238,7 +237,6 @@
|
|
layer.msg('至少要有一个节点!',{icon: 5,time:3000});
|
|
layer.msg('至少要有一个节点!',{icon: 5,time:3000});
|
|
}else{
|
|
}else{
|
|
$(node).parents(".processList").remove();
|
|
$(node).parents(".processList").remove();
|
|
- delProcessIds += delProcessIds;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|