|
@@ -756,6 +756,22 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function getByteLen(val) {
|
|
|
|
+ var len = 0;
|
|
|
|
+ for (var i = 0; i < val.length; i++) {
|
|
|
|
+ var length = val.charCodeAt(i);
|
|
|
|
+ if(length>=0&&length<=128)
|
|
|
|
+ {
|
|
|
|
+ len += 1;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ len += 2;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return len;
|
|
|
|
+ }
|
|
|
|
+
|
|
/*保存对接联系人信息到列表*/
|
|
/*保存对接联系人信息到列表*/
|
|
function toAddDockedContactInfo() {
|
|
function toAddDockedContactInfo() {
|
|
var contactName = document.getElementById("contactName").value;
|
|
var contactName = document.getElementById("contactName").value;
|
|
@@ -765,6 +781,9 @@
|
|
if(contactName == "" || contactName == null ){
|
|
if(contactName == "" || contactName == null ){
|
|
layer.msg("联系人姓名不能为空");
|
|
layer.msg("联系人姓名不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(contactName) > 10){
|
|
|
|
+ layer.msg("联系人姓名长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(contactPhone == "" || contactPhone == null ){
|
|
if(contactPhone == "" || contactPhone == null ){
|
|
layer.msg("电话不能为空");
|
|
layer.msg("电话不能为空");
|
|
@@ -780,6 +799,9 @@
|
|
if(contactType == "" || contactType == null ){
|
|
if(contactType == "" || contactType == null ){
|
|
layer.msg("职位/身份不能为空");
|
|
layer.msg("职位/身份不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(contactType) > 10){
|
|
|
|
+ layer.msg("职位/身份长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(contactEmail == "" || contactEmail == null ){
|
|
if(contactEmail == "" || contactEmail == null ){
|
|
layer.msg("联系邮箱不能为空");
|
|
layer.msg("联系邮箱不能为空");
|
|
@@ -789,6 +811,9 @@
|
|
if(!reg.test(contactEmail)){
|
|
if(!reg.test(contactEmail)){
|
|
layer.msg("请填写正确的邮箱!", {icon: 5, time: 3000});
|
|
layer.msg("请填写正确的邮箱!", {icon: 5, time: 3000});
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(contactEmail) > 30){
|
|
|
|
+ layer.msg("邮箱长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//var operation = "删除";
|
|
//var operation = "删除";
|
|
@@ -856,6 +881,9 @@
|
|
if(channelName == "" || channelName == null ){
|
|
if(channelName == "" || channelName == null ){
|
|
layer.msg("渠道平台/名称不能为空");
|
|
layer.msg("渠道平台/名称不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(channelName) > 30){
|
|
|
|
+ layer.msg("渠道平台/名称长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(promotingProducts == "" || promotingProducts == null ){
|
|
if(promotingProducts == "" || promotingProducts == null ){
|
|
layer.msg("销售产品不能为空");
|
|
layer.msg("销售产品不能为空");
|
|
@@ -864,6 +892,9 @@
|
|
if(supplyPrice == "" || supplyPrice == null ){
|
|
if(supplyPrice == "" || supplyPrice == null ){
|
|
layer.msg("供货价格不能为空");
|
|
layer.msg("供货价格不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(supplyPrice) > 9){
|
|
|
|
+ layer.msg("供货价格长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
var promotingProductsHtml = '<input type="hidden" value="'+promotingProducts+'">';
|
|
var promotingProductsHtml = '<input type="hidden" value="'+promotingProducts+'">';
|
|
|
|
|
|
@@ -912,6 +943,13 @@
|
|
if(customerBasicInfo.customerName == "" || customerBasicInfo.customerName == null ){
|
|
if(customerBasicInfo.customerName == "" || customerBasicInfo.customerName == null ){
|
|
layer.msg("客户名称不能为空");
|
|
layer.msg("客户名称不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(customerBasicInfo.customerName) > 20){
|
|
|
|
+ layer.msg("客户名称长度超限");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(getByteLen(customerBasicInfo.customerIndustry) > 20){
|
|
|
|
+ layer.msg("客户行业长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(customerBasicInfo.customerProvinceCode == "" || customerBasicInfo.customerProvinceCode == null ){
|
|
if(customerBasicInfo.customerProvinceCode == "" || customerBasicInfo.customerProvinceCode == null ){
|
|
layer.msg("客户省份不能为空");
|
|
layer.msg("客户省份不能为空");
|
|
@@ -921,6 +959,14 @@
|
|
layer.msg("客户城市不能为空");
|
|
layer.msg("客户城市不能为空");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if(getByteLen(customerBasicInfo.customerAddress) > 100){
|
|
|
|
+ layer.msg("客户详细地址长度超限");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(getByteLen(customerBasicInfo.customerRemarks) > 100){
|
|
|
|
+ layer.msg("备注信息长度超限");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//对接联系人信息
|
|
//对接联系人信息
|
|
var dockedContactInfoList = new Array();
|
|
var dockedContactInfoList = new Array();
|
|
$("#contactListId").find("tr").each(function (index,element){
|
|
$("#contactListId").find("tr").each(function (index,element){
|
|
@@ -1015,14 +1061,23 @@
|
|
if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
|
|
if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
|
|
layer.msg("开户支行不能为空");
|
|
layer.msg("开户支行不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(billingInfo.accountOpeningBranch) > 50){
|
|
|
|
+ layer.msg("开户支行长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(billingInfo.accountName == "" || billingInfo.accountName == null ){
|
|
if(billingInfo.accountName == "" || billingInfo.accountName == null ){
|
|
layer.msg("账号名称不能为空");
|
|
layer.msg("账号名称不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(billingInfo.accountName) > 30){
|
|
|
|
+ layer.msg("账号名称长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
|
|
if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
|
|
layer.msg("账号不能为空");
|
|
layer.msg("账号不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(billingInfo.accountNum) > 20){
|
|
|
|
+ layer.msg("账号长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
/*if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
|
|
/*if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
|
|
layer.msg("收款人姓名不能为空");
|
|
layer.msg("收款人姓名不能为空");
|
|
@@ -1052,18 +1107,30 @@
|
|
if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
|
|
if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
|
|
layer.msg("开户支行不能为空");
|
|
layer.msg("开户支行不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.accountOpeningBranch) > 50){
|
|
|
|
+ layer.msg("开户支行长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
|
|
if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
|
|
layer.msg("开票账户不能为空");
|
|
layer.msg("开票账户不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.ticketOpeningAccount) > 30){
|
|
|
|
+ layer.msg("开票账户长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
|
|
if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
|
|
layer.msg("企业名称不能为空");
|
|
layer.msg("企业名称不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
|
|
|
|
+ layer.msg("企业名称长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
|
|
if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
|
|
layer.msg("纳税人识别号不能为空");
|
|
layer.msg("纳税人识别号不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
|
|
|
|
+ layer.msg("纳税人识别号长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
|
|
if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
|
|
layer.msg("开票电话不能为空");
|
|
layer.msg("开票电话不能为空");
|
|
@@ -1077,15 +1144,24 @@
|
|
}if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
|
|
}if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
|
|
layer.msg("企业地址不能为空");
|
|
layer.msg("企业地址不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.enterpriseAddress) > 30){
|
|
|
|
+ layer.msg("企业地址长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
|
|
if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
|
|
layer.msg("企业名称不能为空");
|
|
layer.msg("企业名称不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
|
|
|
|
+ layer.msg("企业名称长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
|
|
if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
|
|
layer.msg("纳税人识别号不能为空");
|
|
layer.msg("纳税人识别号不能为空");
|
|
return;
|
|
return;
|
|
|
|
+ }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
|
|
|
|
+ layer.msg("纳税人识别号长度超限");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//发送保存请求
|
|
//发送保存请求
|