优化推广公司检验规则

master
chenzhi 5 years ago
parent c3f01ede43
commit 9f7e15caac

@ -19,7 +19,7 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=0527" type="text/javascript"></script>
<style>
.coin-detail{
display: block;
@ -288,14 +288,14 @@
"platform_name":["nocheck"],
"contact_begin":["nocheck","合同开始时间不能为空"],
"contact_end":["nocheck","合同结束时间不能为空"],
"fax_ratio":["number","开票税率必须是数字如果无此项请填0"],
"company_type":["required","公司性质不能为空","select"],
"fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"],
"company_type":["nocheck","公司性质不能为空","select"],
"is_sign_contact":["nocheck","是否签署合同项不能为空","select"],
"company_belong":["required","团体归属不能为空","select"],
"settlement_contact":["required","结算联系人不能为空"],
"contact_phone":["phone","联系人电话格式不对或不能为空"],
"company_belong":["nocheck","团体归属不能为空","select"],
"settlement_contact":["nocheck","结算联系人不能为空"],
"contact_phone":[["phone",true],"联系人电话格式不对"],
"address":["nocheck","联系人地址不能为空"],
"bank_card":["nocheck","银行卡格式错误或不能为空"],
"bank_card":[["bankid",true],"银行卡格式错误"],
"bank_name":["nocheck","银行名称不能为空"],
"bank_address":["nocheck","银行开户网点不能为空"],
"content":["nocheck"],

@ -357,14 +357,14 @@
"platform_name":["nocheck"],
"contact_begin":["nocheck","合同开始时间不能为空"],
"contact_end":["nocheck","合同结束时间不能为空"],
"fax_ratio":["number","开票税率必须是数字如果无此项请填0"],
"company_type":["required","公司性质不能为空","select"],
"is_sign_contact":["required","是否签署合同项不能为空","select"],
"company_belong":["required","团体归属不能为空","select"],
"settlement_contact":["required","结算联系人不能为空"],
"contact_phone":["phone","联系人电话格式不对或不能为空"],
"fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"],
"company_type":["nocheck","公司性质不能为空","select"],
"is_sign_contact":["nocheck","是否签署合同项不能为空","select"],
"company_belong":["nocheck","团体归属不能为空","select"],
"settlement_contact":["nocheck","结算联系人不能为空"],
"contact_phone":[["phone",true],"联系人电话格式不对"],
"address":["nocheck","联系人地址不能为空"],
"bank_card":["nocheck","银行卡格式错误或不能为空"],
"bank_card":[["bankid",true],"银行卡格式错误"],
"bank_name":["nocheck","银行名称不能为空"],
"bank_address":["nocheck","银行开户网点不能为空"],
"content":["nocheck"],

@ -31,32 +31,44 @@
cic.checkAddInput=function(arr){
var rearr = {};
for(var i in arr) {
var reg = cic.verify[arr[i][0]][0];
// var reg = cic.verify[arr[i][0]][0];
var name = "input";
var selecttypename='';
if(typeof arr[i][2] !== "undefined") name = arr[i][2];
if(name == "radio") {
name="input";
selecttypename=":checked";
}
if(!reg){
//nocheck时不验证
var val = $(name+"[name='"+i+"']"+selecttypename).val();
if(val != ''){
rearr[i]=val;
}
}else{
if(reg.test($(name+"[name='"+i+"']"+selecttypename).val())) {
rearr[i] = $(name+"[name='"+i+"']"+selecttypename).val();
}else {
layer.alert(arr[i][1], {
icon: 2,
skin: 'layer-ext-moon'
});
return false;
break;
}
}
}
var reg = arr[i][0];
if(!Array.isArray(reg)){
reg = [arr[i][0],false];//默认false
}
var val = $(name+"[name='"+i+"']"+selecttypename).val();
//为true不存在不报错
if(reg[1]){
if(val == ''){
continue;
}
}
var treg = cic.verify[reg[0]][0];
if(!treg){
if(val != ''){
rearr[i]=val;
}
}else{
if(treg.test(val)) {
rearr[i] =val;
}else {
layer.alert(arr[i][1], {
icon: 2,
skin: 'layer-ext-moon'
});
return false;
continue;
}
}
}
return rearr;
};

Loading…
Cancel
Save