...
|
...
|
@@ -2,6 +2,35 @@ var $=require('jquery'); |
|
|
var edit=require('../common/edit');
|
|
|
|
|
|
var e=new edit("#basicForm");
|
|
|
e.on("validate",function(){
|
|
|
var contactPhone=$.trim($("#contactPhone").val());
|
|
|
if(contactPhone){
|
|
|
if(!(/^1\d{10}$/.test(contactPhone))){
|
|
|
return "请输入正确的公司联系电话";
|
|
|
}
|
|
|
}
|
|
|
//phone
|
|
|
var phone=$.trim($("#phone").val());
|
|
|
if(phone){
|
|
|
if(!(/^1\d{10}$/.test(phone))){
|
|
|
return "请输入正确的联系人电话";
|
|
|
}
|
|
|
}
|
|
|
if(!phone&&!contactPhone){
|
|
|
return "请在公司联系电话,联系人电话至少填一个";
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
e.on("validate",function(){
|
|
|
var num=$.trim($("#phone").val());
|
|
|
if(num){
|
|
|
if(!(/^1\d{10}$/.test(num))){
|
|
|
return "请输入正确的联系人电话";
|
|
|
}
|
|
|
}
|
|
|
//phone
|
|
|
return true;
|
|
|
});
|
|
|
e.init();
|
|
|
var submit=function(callback,config){
|
|
|
e.submit($("#basicForm").attr("action"),function(option){
|
...
|
...
|
@@ -9,7 +38,8 @@ var edit=require('../common/edit'); |
|
|
res=res.data;
|
|
|
if(res.code=="200"){
|
|
|
e.$tip(config.msg||"提交成功",function(){
|
|
|
location.href="/supplier/supplier/index";
|
|
|
location.href=window.me.getUrl();
|
|
|
|
|
|
},'growl-success');
|
|
|
}else{
|
|
|
e.$tip(res.message);
|
...
|
...
|
@@ -27,15 +57,13 @@ var edit=require('../common/edit'); |
|
|
$("#btnTemporary").click(function(){
|
|
|
submit(function(data){
|
|
|
data.status=100;
|
|
|
},{msg:"添加成功"});
|
|
|
},{msg:"暂存成功"});
|
|
|
return false;
|
|
|
});
|
|
|
$("#btnReview").click(function(){
|
|
|
//到审核表
|
|
|
submit(function(data){
|
|
|
if(data.status==100){
|
|
|
data.operations=2;
|
|
|
}
|
|
|
data.operations?data.operations:data.operations=1;
|
|
|
data.status=200;
|
|
|
},{msg:"提交成功"});
|
|
|
return false;
|
...
|
...
|
|