Przeglądaj źródła

修改一些提示

sandm 2 lat temu
rodzic
commit
5966a759c9

+ 5 - 3
app/common/validate/Enterprise.php

@@ -26,8 +26,8 @@ class Enterprise extends Validate{
         'ephone' => 'require',
         'agentEmail' => 'require|email',
         'bankCard' => 'require',
-        'bank' => 'require',
-        'bankNetwork' => 'require'
+        'bank' => 'require|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u',
+        'bankNetwork' => 'require|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u'
     ];
 
     protected $message  =   [
@@ -63,7 +63,9 @@ class Enterprise extends Validate{
         'agentEmail.email'        => '邮箱格式错误',
         'bankCard.require' => '请输入企业银行账号',
         'bank.require' => '请输入企业开户银行',
-        'bankNetwork.require' => '请输入企业开户银行网点'
+        'bankNetwork.require' => '请输入企业开户银行网点',
+        'bank.regex' => '开户银行不正确,请检查',
+        'bankNetwork.regex' => '开户银行网点不正确,请检查'
 
     ];
 

+ 8 - 1
public/static/js/common/Feng.js

@@ -609,8 +609,15 @@ var Feng = {
             $("#"+target).val('');
         }
     },
-    chkFileInvalid:function(file,maxImageSize,maxFileSize){        
+    chkFileInvalid:function(file,maxImageSize,maxFileSize,fileType = null,msg = null){
         var size = 0;
+        if(fileType != null){
+            if(fileType.indexOf(file.type)<0){
+                Feng.error(msg)
+                return false;
+            }
+        }
+        console.log(file.type)
         switch(file.type){
             case "image/jpeg":
             case "image/gif":

+ 19 - 1
public/static/js/register.js

@@ -140,7 +140,10 @@ Register.enterpriseUserRegister = function() {
                     regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
                     message: "开户银行网点格式不正确"
                 }}});
-        $('#ep_form').bootstrapValidator("addField","bank",{validators: {notEmpty: {message: '开户银行不能为空'}}});
+        $('#ep_form').bootstrapValidator("addField","bank",{validators: {notEmpty: {message: '开户银行不能为空'},regexp: {
+                    regexp: /^[\u4e00-\u9fa5]*$/,
+                    message: "开户银行必须为中文"
+                }}});
         var prefix = '企业';
     }else{
         $("#tab-4 .form-control").removeAttr("disabled");
@@ -309,17 +312,26 @@ Register.enterpriseUserRegister = function() {
             Feng.info("请上传营业执照照片!");
             return;
         }
+        if(!Feng.chkFileInvalid(document.getElementById("imgurl").files[0],10,10,["image/jpeg","image/gif","image/png","image/jpg","application/pdf"],"营业执照只允许上传PDF或图片")){
+            return;
+        }
 
         var xx=document.getElementById("bankImg").value;
         if(xx==""){
             Feng.info("请上传开户银行许可证!");
             return;
         }
+        if(!Feng.chkFileInvalid(document.getElementById("bankImg").files[0],10,10,["image/jpeg","image/gif","image/png","image/jpg","application/pdf"],"开户银行许可证只允许上传PDF或图片")){
+            return;
+        }
         var xxx=document.getElementById("domainImg").value;
         if(xxx=="" && type == 1){
             Feng.info("请上传行业领域佐证材料!");
             return;
         }
+        if(!Feng.chkFileInvalid(document.getElementById("domainImg").files[0],10,10,["image/jpeg","image/gif","image/png","image/jpg","application/pdf"],"行业领域佐证材料只允许上传PDF或图片")){
+            return;
+        }
 
     }else{
         var x=document.getElementById("sy_imgurl").value;
@@ -327,6 +339,9 @@ Register.enterpriseUserRegister = function() {
             Feng.info("请上传法人证或批文!");
             return;
         }
+        if(!Feng.chkFileInvalid(document.getElementById("sy_imgurl").files[0],10,10,["image/jpeg","image/gif","image/png","image/jpg","application/pdf"],"法人证或批文只允许上传PDF或图片")){
+            return;
+        }
     }
 
 
@@ -359,6 +374,9 @@ Register.enterpriseUserRegister = function() {
         Feng.info("请上传人才联络员信息备案表!");
         return;
     }
+    if(!Feng.chkFileInvalid(document.getElementById("beian").files[0],10,10,["image/jpeg","image/gif","image/png","image/jpg","application/pdf"],"人才联络员信息备案表只允许上传PDF或图片")){
+        return;
+    }
     if(!/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/.test(ephone)){
         Feng.info(prefix+"电话格式不合法!");
         return;

+ 1 - 1
public/static/modular/gate/enterprise/enterprise_change_edit.js

@@ -54,7 +54,7 @@ var EpChangeEdit = {
                 notEmpty: {
                     message: '企业开户银行不能为空'
                 }
-            }
+            }, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/, message: "开户银行只允许中文"}
         },
         newBankNetwork: {
             validators: {notEmpty: {message: '开户银行网点不能为空'},