优化上游信息提示

master
chenzhi 5 years ago
parent a2ce005497
commit c3848e5b55

@ -436,6 +436,55 @@
});
//基础类
var PUBLIC = {
CompanyKeyName:{
id:"公司表id",
partner:"公司名称",
link_man:'联系人',
link_phone:"联系电话",
address:'邮寄地址',
company_tax_no:'公司税号',
payee_name:'名称',
bank_account:"银行账号",
opening_bank:"开户行"
},
checkCompanyKey(type,key){
//获取公司名
var company = '';
if(key == "payee_name" || key == "bank_account" || key == "opening_bank"){
if((DATAOBJ.statement_type == 0 && type == "first_party_info") || (DATAOBJ.statement_type == 1 && type == "second_party_info")){
company = "收款方";
}
if((DATAOBJ.statement_type == 0 && type == "second_party_info")|| (DATAOBJ.statement_type == 1 && type == "first_party_info")){
company = "付款方";
}
}else{
if(type == "first_party_info"){
company = "甲方";
}else{
company = "乙方";
}
}
//获取键名
try {
var keyname = company+PUBLIC.CompanyKeyName[key];
} catch (error) {
var keyname = false;
}
//验证
if(DATAOBJ[type][key] ===''){
layer.msg(keyname+"不能为空");
return false;
}
if(key == "link_phone" && !CHECK.mobile.test(DATAOBJ[type][key])){
layer.msg(keyname+"格式错误");
return false;
}
if(key == "bank_account" && !CHECK.BankNo.test(DATAOBJ[type][key])){
layer.msg(keyname+"格式错误");
return false;
}
return true;
},
postData(url,data,callback){
$.ajax({
url:url,
@ -546,33 +595,17 @@
//验证甲方信息
for (const key in DATAOBJ.first_party_info) {
var t = DATAOBJ.first_party_info;
if(t[key] ===''){
layer.msg('甲方信息不全,请先补全 code:'+key);
return false;
}
if(key == "link_phone" && !CHECK.mobile.test(t[key])){
layer.msg('甲方联系人手机号格式错误');
return false;
}
if(key == "bank_account" && !CHECK.BankNo.test(t[key])){
layer.msg('甲方银行卡号格式错误');
return false;
var flag = PUBLIC.checkCompanyKey("first_party_info",key);
if(!flag){
return flag;
}
}
//乙方
for (const key in DATAOBJ.second_party_info) {
var t = DATAOBJ.second_party_info;
if(!t[key] || t[key] ==''){
layer.msg('乙方信息不全,请先补全 code:'+key);
return false;
}
if(key == "link_phone" && !CHECK.mobile.test(t[key])){
layer.msg('乙方联系人手机号格式错误');
return false;
}
if(key == "bank_account" && !CHECK.BankNo.test(t[key])){
layer.msg('乙方银行卡号格式错误');
return false;
var flag = PUBLIC.checkCompanyKey("second_party_info",key);
if(!flag){
return flag;
}
}
layer.load(2);

Loading…
Cancel
Save