فهرست منبع

电路银行信息改为非必填

sugangqiang 1 سال پیش
والد
کامیت
3a5f23e83d

+ 1 - 1
app/common.php

@@ -383,7 +383,7 @@ function chkEnterpriseFull($ep) {
                     $checkEnterpriseFullFields[] = "typeImg";
                 }
             } else {
-                $checkEnterpriseFullFields = ["bankCard", "bankNetwork", "bank", "imgurl", "bankImg", "beian"];
+                $checkEnterpriseFullFields = ["imgurl", "beian"];
             }
             break;
         case 1:

+ 16 - 22
app/common/controller/Auth.php

@@ -141,6 +141,11 @@ class Auth extends BaseController {
                                 $response_object->msg = '规上、高新技术、专精特新企业需要上传佐证材料';
                                 return \StrUtil::back($response_object, "Register.epCallBack");
                             }
+                            if (!array_key_exists('bankImg', $files) || $files['bankImg'] == '') {
+                                $response_object->code = 500;
+                                $response_object->msg = '开户许可证/基本存款账户信息不能为空';
+                                return \StrUtil::back($response_object, "Register.epCallBack");
+                            }
                         } else {
                             validate(Enterprise::class)->batch(true)->scene('jc_add')->check($data); //集成电路
                             $registerTimeLimitReturnObj = $this->checkRegisterTime(0, $data['type']);
@@ -152,11 +157,6 @@ class Auth extends BaseController {
                             $response_object->msg = '营业执照不能为空';
                             return \StrUtil::back($response_object, "Register.epCallBack");
                         }
-                        if (!array_key_exists('bankImg', $files) || $files['bankImg'] == '') {
-                            $response_object->code = 500;
-                            $response_object->msg = '开户许可证/基本存款账户信息不能为空';
-                            return \StrUtil::back($response_object, "Register.epCallBack");
-                        }
                         if (!array_key_exists('beian', $files) || $files['beian'] == '') {
                             $response_object->code = 500;
                             $response_object->msg = '人才联络员备案表不能为空';
@@ -424,6 +424,11 @@ class Auth extends BaseController {
                             $response_object->msg = '规上、高新技术、专精特新企业需要上传佐证材料';
                             return \StrUtil::back($response_object, "Register.epCallBack");
                         }
+                        if (!$data["bankImg"] && !$ep->bankImg) {
+                            $response_object->code = 500;
+                            $response_object->msg = '开户许可证/基本存款账户信息不能为空';
+                            return \StrUtil::back($response_object, "Register.epCallBack");
+                        }
                     } else {
                         validate(\app\common\validate\Enterprise::class)->batch(true)->scene('jc_change')->check($data);
                     }
@@ -432,11 +437,6 @@ class Auth extends BaseController {
                         $response_object->msg = '营业执照不能为空';
                         return \StrUtil::back($response_object, "Register.epCallBack");
                     }
-                    if (!$data["bankImg"] && !$ep->bankImg) {
-                        $response_object->code = 500;
-                        $response_object->msg = '开户许可证/基本存款账户信息不能为空';
-                        return \StrUtil::back($response_object, "Register.epCallBack");
-                    }
                     if (!$data["beian"] && !$ep->beian) {
                         $response_object->code = 500;
                         $response_object->msg = '人才联络员备案表不能为空';
@@ -636,7 +636,7 @@ class Auth extends BaseController {
         }
     }
 
-    public function person_register(){
+    public function person_register() {
         $source = intval($this->request['source']);
         $response_object = new \StdClass();
         $data = [
@@ -653,23 +653,17 @@ class Auth extends BaseController {
             //检验验证码
             $codeResult = MessageRecord::where('smsType', 1)->where('phone', $data['phone'])->order('createTime', 'desc')->find();
             if (!$codeResult) {
-                return json(['msg'=>'请先发送验证码']);
+                return json(['msg' => '请先发送验证码']);
             }
 
-            $info = Talent::where('idCard',$data['idCard'])->where('checkState',TalentState::CERTIFICATED)->findOrEmpty();
-            if(!$info){
-                return json(['msg'=>'人才库中不存在该证件号码,注册失败']);
+            $info = Talent::where('idCard', $data['idCard'])->where('checkState', TalentState::CERTIFICATED)->findOrEmpty();
+            if (!$info) {
+                return json(['msg' => '人才库中不存在该证件号码,注册失败']);
             }
-
-
-
-
         } catch (ValidateException $e) {
             $error = $e->getError();
-            return json(['msg'=>array_pop($error)]);
+            return json(['msg' => array_pop($error)]);
         }
-
-
     }
 
 }

+ 10 - 10
app/common/validate/Enterprise.php

@@ -76,29 +76,29 @@ class Enterprise extends Validate {
         'change2' => ['name', 'idCard', 'enterpriseTag', 'enterpriseType', 'agentName', 'agentPhone', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
         'changePwd' => ['password'],
         'check_common' => ['name', 'idCard', 'industryFieldNew', 'enterpriseTag', 'enterpriseType', 'agentName', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
-        'jc_add' => ['username', 'password', 're_password', 'name', 'idCard', 'type', 'agentName', 'agentPhone', 'verificationCode', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
+        'jc_add' => ['username', 'password', 're_password', 'name', 'idCard', 'type', 'agentName', 'agentPhone', 'verificationCode', 'legal', 'street', 'address', 'ephone', 'agentEmail'],
         'sy_add' => ['username', 'password', 're_password', 'name', 'verificationCode', 'street', 'address', 'ephone', 'agentEmail'],
         'sy_change' => ['name', 'agentName', 'agentPhone', 'street', 'address', 'ephone', 'agentEmail'],
-        'jc_change' => ['name', 'idCard', 'agentName', 'agentPhone', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork']
+        'jc_change' => ['name', 'idCard', 'agentName', 'agentPhone', 'legal', 'street', 'address', 'ephone', 'agentEmail']
     ];
 
-    protected function checkName($value,$rule,$data=[]){
-        $info = EnterpriseModel::where('name',$value)->where('active',1)->where('delete',0)->where('id','<>',$data['id'])->find();
-        if($info){
+    protected function checkName($value, $rule, $data = []) {
+        $info = EnterpriseModel::where('name', $value)->where('active', 1)->where('delete', 0)->where('id', '<>', $data['id'])->find();
+        if ($info) {
             return "机构名称已存在";
-        }else{
+        } else {
             return true;
         }
     }
 
-    protected function checkID($value,$rule,$data=[]){
+    protected function checkID($value, $rule, $data = []) {
         if (!preg_match("/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/", $value)) {
             return "统一社会信用代码不正确";
         }
-        $info = EnterpriseModel::where('idCard',$value)->where('delete',0)->where('id','<>',$data['id'])->find();
-        if($info){
+        $info = EnterpriseModel::where('idCard', $value)->where('delete', 0)->where('id', '<>', $data['id'])->find();
+        if ($info) {
             return "该统一社会信用代码已存在";
-        }else{
+        } else {
             return true;
         }
     }

+ 2 - 2
app/enterprise/controller/Api.php

@@ -313,7 +313,7 @@ class Api extends EnterpriseController {
                     throw new ValidateException("请上传营业执照");
                 }
                 if ($ep->special == 0) {
-                    if (!$record_data["newBankImg"]) {
+                    if (!$record_data["newBankImg"] && $ep->type == 1) {
                         throw new ValidateException("请上传开户许可证/基本存款账户信息");
                     }
                     if ($ep->type == 1 && $data['agencyType'] == 1 && !$record_data["newDomainImg"]) {
@@ -523,7 +523,7 @@ class Api extends EnterpriseController {
                     throw new ValidateException("请上传营业执照");
                 }
                 if ($ep->special == 0) {
-                    if (!$record["newBankImg"]) {
+                    if (!$record["newBankImg"] && $ep->type == 1) {
                         throw new ValidateException("请上传开户许可证/基本存款账户信息");
                     }
                     if ($ep->type == 1 && $data["agencyType"] == 1 && !$record["newDomainImg"]) {

+ 28 - 26
public/static/js/register.js

@@ -116,6 +116,7 @@ Register.validate = function () {
 var isDis = false;
 Register.enterpriseUserRegister = function () {
 
+    var type = $("#type").val();
     var special = $("#ep_form .active").attr("special");
     $("#special").val(special)
     $('#ep_form').bootstrapValidator({
@@ -136,7 +137,7 @@ Register.enterpriseUserRegister = function () {
             $("#tab-5 .form-control").attr("disabled", "disabled");
             $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
             $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});//, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}
-            if ($("#type").val() == 1) {
+            if (type == 1) {
                 $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '开户银行账号不能为空'}}});
                 $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
                         regexp: {
@@ -236,7 +237,6 @@ Register.enterpriseUserRegister = function () {
     if (isDis) {
         $("#type").removeAttr("disabled");
     }
-    var type = $("#type").val();
     var agencyType = $("#agencyType").val();
     var agentEmail = $("#agentEmail").val();
     var enterpriseTag = $("#enterpriseTag").val();
@@ -311,21 +311,28 @@ Register.enterpriseUserRegister = function () {
                 Feng.info("请填写法人代表!");
                 return;
             }
+
+            if (type == null || type == '') {
+                Feng.info("请选择申报类型!");
+                return;
+            }
             /*if (!/^[\u4e00-\u9fa5]{1,50}$/.test(legal)) {
              Feng.info("法人代表只能输入中文 !");
              return;
              }*/
-            if (bankCard == null || bankCard == '') {
-                Feng.info("请填写企业银行账号!");
-                return;
-            }
-            if (bank == null || bank == '') {
-                Feng.info("请填写企业开户银行!");
-                return;
-            }
-            if (bankNetwork == null || bankNetwork == '') {
-                Feng.info("请填写企业开户银行网点");
-                return;
+            if (type == 1) {
+                if (bankCard == null || bankCard == '') {
+                    Feng.info("请填写企业银行账号!");
+                    return;
+                }
+                if (bank == null || bank == '') {
+                    Feng.info("请填写企业开户银行!");
+                    return;
+                }
+                if (bankNetwork == null || bankNetwork == '') {
+                    Feng.info("请填写企业开户银行网点");
+                    return;
+                }
             }
             var x = document.getElementById("imgurl").value;
             if (x == "") {
@@ -335,20 +342,15 @@ Register.enterpriseUserRegister = function () {
             if (!Feng.chkFileInvalid(document.getElementById("imgurl").files[0], 5, 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], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
-                return;
-            }
-
-            if (type == null || type == '') {
-                Feng.info("请选择申报类型!");
-                return;
-            }
             if (type == 1) {
+                var xx = document.getElementById("bankImg").value;
+                if (xx == "") {
+                    Feng.info("请上传开户银行许可证!");
+                    return;
+                }
+                if (!Feng.chkFileInvalid(document.getElementById("bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
+                    return;
+                }
                 if (agencyType == null || agencyType == '') {
                     Feng.info("请选择机构类型");
                     return;

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

@@ -594,6 +594,7 @@ EpChangeEdit.agencyTypeChange = function () {
 
 $(function () {
     EpChangeEdit.setFieldDisabled();
+    var type = $("#type").val();
     var special = parseInt($("#special").val());
     $('#ecr_form').bootstrapValidator({
         feedbackIcons: {
@@ -621,7 +622,7 @@ $(function () {
     $("select").each(function () {
         $(this).val($(this).attr("value"));
     })
-    if ($("#type").val() == 1) {
+    if (type == 1) {
         $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:cell");
         $("#newEnterpriseTag").val($("#newEnterpriseTag").attr("value"));
         $("#newIndustryFieldNew").val($("#newIndustryFieldNew").attr("value"));
@@ -630,6 +631,13 @@ $(function () {
         $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:none");
         $("#newEnterpriseTag").val("");
         $("#newIndustryFieldNew").val("");
+        $("#newBankCard").parent().find("span").css("display", "none");
+        $("#newBankNetwork").parent().find("span").css("display", "none");
+        $("#newBank").parent().find("span").css("display", "none");
+        $("#bankImg").parent().find("span").css("display", "none");
+        $('#ecr_form').bootstrapValidator("removeField", "newBankCard");
+        $('#ecr_form').bootstrapValidator("removeField", "newBankNetwork");
+        $('#ecr_form').bootstrapValidator("removeField", "newBank");
     }
     var id = $("#id").val();
     if (id != null && id != '') {

+ 40 - 38
public/static/modular/gate/enterprise/enterprise_edit.js

@@ -40,38 +40,22 @@ Register.enterpriseUserRegister = function () {
         Feng.info("单位名称最多100个字符!");
         return;
     }
-    if (idCard == null || idCard == '') {
+    if ((idCard == null || idCard == '') && special != "1") {
         Feng.info("请填写统一社会信用代码!");
         return;
     }
-    if (type == null || type == '') {
-        Feng.info("请选择申报类型!");
-        return;
-    }
     if (idCard.length > 40) {
         Feng.info("统一社会信用代码最多40个字符!");
         return;
     }
-    if (agentName == null || agentName == '') {
-        Feng.info("请填写人才联络员!");
-        return;
-    }
-    if (agentName.length > 30) {
-        Feng.info("人才联络员最多30个字符!");
-        return;
-    }
-    if (agentPhone == null || agentPhone == '') {
-        Feng.info("请填写人才联络员电话!");
+    if ((legal == null || legal == '') && special != "1") {
+        Feng.info("请填写法人代表!");
         return;
     }
     if (ephone == null || ephone == '') {
         Feng.info("请填写单位电话");
         return;
     }
-    if (legal == null || legal == '') {
-        Feng.info("请填写法人代表!");
-        return;
-    }
     if (street == null || street == '') {
         Feng.info("请选择所属街道!");
         return;
@@ -80,28 +64,25 @@ Register.enterpriseUserRegister = function () {
         Feng.info("请填写单位地址!");
         return;
     }
-    if (bankCard == null || bankCard == '') {
-        Feng.info("请填写企业银行账号!");
-        return;
-    }
-    if (bank == null || bank == '') {
-        Feng.info("请填写企业开户银行!");
-        return;
-    }
-    if (bankNetwork == null || bankNetwork == '') {
-        Feng.info("请填写企业开户银行网点!");
-        return;
-    }
-
-    if (type == null || type == '') {
-        Feng.info("请选择企业类别");
-        return;
+    if (special != "1" && type != 2) {
+        if (bankCard == null || bankCard == '') {
+            Feng.info("请填写企业银行账号!");
+            return;
+        }
+        if (bank == null || bank == '') {
+            Feng.info("请填写企业开户银行!");
+            return;
+        }
+        if (bankNetwork == null || bankNetwork == '') {
+            Feng.info("请填写企业开户银行网点!");
+            return;
+        }
     }
-    if (agentEmail == null || agentEmail == '') {
-        Feng.info("请填写电子邮箱!");
+    if ((type == null || type == '') && special == "0") {
+        Feng.info("请选择申报类型!");
         return;
     }
-    if (special == 0 && type == 1) {
+    if (special == "0" && type == 1) {
         if (agencyType == null || agencyType == '') {
             Feng.info("请选择机构类型");
             return;
@@ -134,6 +115,23 @@ Register.enterpriseUserRegister = function () {
             return;
         }
     }
+    if (agentName == null || agentName == '') {
+        Feng.info("请填写人才联络员!");
+        return;
+    }
+    if (agentName.length > 30) {
+        Feng.info("人才联络员最多30个字符!");
+        return;
+    }
+    if (agentPhone == null || agentPhone == '') {
+        Feng.info("请填写人才联络员电话!");
+        return;
+    }
+
+    if (agentEmail == null || agentEmail == '') {
+        Feng.info("请填写电子邮箱!");
+        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("单位电话格式不合法!");
         return;
@@ -183,6 +181,10 @@ Register.typeChange = function () {
         $(".agencyType").attr("style", "display:none");
         $("#typeGroup").attr("style", "display:none");
         $("#enterpriseTag,#industryFieldNew,#industryFieldOld,#enterpriseType").val("");
+        $("#bankCard").parent().find("span").css("display", "none");
+        $("#bankNetwork").parent().find("span").css("display", "none");
+        $("#bank").parent().find("span").css("display", "none");
+        $("#bankImg").parent().find("span").css("display", "none");
     }
 }
 Register.agencyTypeChange = function () {