|
@@ -298,7 +298,7 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
var clientCompany = $("#cs_company").val();
|
|
|
var clientFrom = $("#cs_from").val();
|
|
|
var clientCountry = $("#cs_country").val();
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (clientCode == "" || clientCode == null) {
|
|
|
alert("客户代码不能为空!");
|
|
@@ -318,8 +318,16 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ var clientFromText = $("#cs_from option:selected").text();
|
|
|
+ var isAlibabaSource = clientFromText.indexOf("1688") >= 0 ||
|
|
|
+ clientFromText.indexOf("阿里") >= 0 ||
|
|
|
+ clientFromText.indexOf("alibaba") >= 0;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
var hasContactMethod = false;
|
|
|
+ var hasAlibabaContact = false;
|
|
|
var allContactsValid = true;
|
|
|
var phoneRegex = /^\+\d{1,4}\s\d{5,}$/;
|
|
|
var emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
@@ -337,6 +345,11 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
if (methodValue) {
|
|
|
hasMethodInThisContact = true;
|
|
|
hasContactMethod = true;
|
|
|
+
|
|
|
+
|
|
|
+ if (methodType === 'alibaba') {
|
|
|
+ hasAlibabaContact = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -391,6 +404,12 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if (isAlibabaSource && !hasAlibabaContact) {
|
|
|
+ alert("客户来源为1688或阿里国际站时,必须添加至少一个阿里巴巴联系方式!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$("input#mytag").val($(".taglist").html());
|
|
|
|
|
@@ -423,6 +442,7 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
|
|
|
function submitCustomerForm() {
|
|
|
if (validateMultipleContactsForm()) {
|
|
|
+
|
|
|
$("#form1").submit();
|
|
|
}
|
|
|
}
|