소스 검색

注册驳回

sugangqiang 2 년 전
부모
커밋
45576e5195

+ 27 - 33
app/admin/controller/Enterprise.php

@@ -167,48 +167,36 @@ class Enterprise extends AdminController {
 
 
         if ($ep->special == 0) {
-            if ($ep->type == 1) {
-                $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
-                    "AgencyType" => "机构类型", "IndustryFieldNew" => "产业领域", "IndustryFieldOld" => "行业领域", "EnterpriseTag" => "企业标签", "EnterpriseType" => "企业类型",
-                    "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
-                $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证/基本存款账户信息", "newDomainImg" => "行业领域佐证材料", "newBeian" => "人才联络员信息备案表", "newTypeImg" => "规上、高新技术、专精特新企业上传材料"];
-            } else {
-                $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
-                    "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
-                $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证/基本存款账户信息", "newBeian" => "人才联络员备案表"];
-            }
+            $fields = ["name" => "企业名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "企业地址", "street" => "所属街道", "ephone" => "企业电话", "bankCard" => "企业银行账号", "bank" => "企业开户银行", "bankNetwork" => "企业开户银行网点",
+                "agencyType" => "机构类型", "industryFieldNew" => "产业领域", "industryFieldOld" => "行业领域", "enterpriseTag" => "企业标签", "enterpriseType" => "企业类型",
+                "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
+            $files = ["imgurl" => "企业营业执照", "bankImg" => "开户许可证/基本存款账户信息", "domainImg" => "行业领域佐证材料", "beian" => "人才联络员信息备案表", "typeImg" => "规上、高新技术、专精特新企业上传材料"];
         } else {
-            $fields = ["Name" => "单位名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "单位地址", "Street" => "所属街道", "Ephone" => "单位电话", "BankCard" => "单位银行账号", "Bank" => "单位开户银行", "BankNetwork" => "单位开户银行网点",
-                "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+            $fields = ["name" => "单位名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "单位地址", "street" => "所属街道", "ephone" => "单位电话", "bankCard" => "单位银行账号", "bank" => "单位开户银行", "bankNetwork" => "单位开户银行网点",
+                "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
             if ($ep->special == 1) {
-                $fields["InstitutionTag"] = "单位标签";
+                $fields["institutionTag"] = "单位标签";
             }
             if ($ep->special == 3) {
-                $fields["OrganizationTag"] = "机构标签";
+                $fields["organizationTag"] = "机构标签";
             }
-            $files = ["newImgurl" => "法人证或批文", "newBankImg" => "开户许可证/基本存款账户信息", "newBeian" => "人才联络员备案表"];
+            $files = ["imgurl" => "法人证或批文", "bankImg" => "开户许可证/基本存款账户信息", "beian" => "人才联络员备案表"];
         }
+
         $modify_fields = [];
+        $modify_files = [];
+        $_modify_fields = explode(",", $ep["modify_fields"]);
         foreach ($fields as $key => $value) {
-            $oldFieldName = "old" . $key;
-            $newFieldName = "new" . $key;
-            //if ($ecr[$oldFieldName] != $ecr[$newFieldName]) {
-            $modify_fields[$newFieldName] = ["field" => $newFieldName, "name" => $value, "checked" => false];
-            //}
-        }
-        if ($ecr["modify_fields"]) {
-            $_modify_fields = explode(",", $ecr["modify_fields"]);
-            foreach ($_modify_fields as $_field) {
-                if ($modify_fields[$_field]) {
-                    $modify_fields[$_field]["checked"] = true;
-                } else {
-                    $modify_fields[$_field] = ["field" => $_field, "name" => $fields[substr($_field, 3)], "checked" => true];
-                }
-            }
+            $checked = in_array($key, $_modify_fields);
+            $modify_fields[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
+        }
+        $_modify_files = explode(",", $ep["modify_files"]);
+        foreach ($files as $key => $value) {
+            $checked = in_array($key, $_modify_files);
+            $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
         }
 
-
-        return view("", ['ep' => $ep, 'checkUser' => session('user')['name']]);
+        return view("", ['ep' => $ep, 'checkUser' => session('user')['name'], 'fields' => $modify_fields, "files" => $modify_files]);
     }
 
     public function doExamine() {
@@ -225,20 +213,26 @@ class Enterprise extends AdminController {
             return json(["msg" => '请选择审核状态!']);
         }
         $checkMsg = $this->request['checkMsg'];
+        $fields = $this->request['fields'];
+        $files = $this->request['files'];
         if ($checkState == 2) {
             if (\StrUtil::isEmpOrNull($checkMsg)) {
                 return json(["msg" => '请填写审核意见!']);
             }
-
             if (strlen($checkMsg) > 1000) {
                 return json(["msg" => '审核意见最多1000个字符!']);
             }
+            if (!$fields && !$files) {
+                return json(["msg" => '请选择驳回修改的字段或者附件!']);
+            }
         }
         try {
             $checkData = [
                 'id' => $id,
                 'checkState' => $checkState,
                 'checkMsg' => $checkMsg,
+                'modify_fields' => $fields ? implode(",", $fields) : null,
+                'modify_files' => $files ? implode(",", $files) : null,
                 'checkUser' => session('user')['name'],
                 'updateUser' => session('user')['uid'],
                 'updateTime' => date("Y-m-d H:i:s")

+ 5 - 5
app/admin/view/enterprise/goto_examine_page.html

@@ -55,8 +55,8 @@
                         <div class="col-sm-10">
                             <select class="form-control" id="checkState" name="checkState" onchange="EpExam.toggleField()">
                                 <option value="">--- 请选择 ---</option>
-                                <option value="2">审核驳回</option>
-                                <option value="3">审核通过</option>
+                                <option value="2" {eq name="ep.checkState" value="2"}selected{/eq}>审核驳回</option>
+                                <option value="3" {eq name="ep.checkState" value="3"}selected{/eq}>审核通过</option>
                             </select>
                         </div>
                     </div>
@@ -73,7 +73,7 @@
                     </div>
                 </div>
             </div>
-            <div id="field" style="padding-top:5px;display:none">
+            <div id="field" {neq name="ep.checkState" value="2"}style="padding-top:5px;display:none"{/neq}>
                 <label for="checkMsg" class="control-label">可修改字段</label>
                 <div id="field_info">
                     <ul style="overflow:hidden;list-style:none;">
@@ -91,8 +91,8 @@
                     </ul>
                 </div>
                 <div class="form-group" style="text-align: center">
-                    <button type="button" class="btn btn-primary" onclick="examine.checkAll()">全选</button>
-                    <button type="button" class="btn btn-success" onclick="examine.unCheckAll()">反选</button>
+                    <button type="button" class="btn btn-primary" onclick="EpExam.checkAll()">全选</button>
+                    <button type="button" class="btn btn-success" onclick="EpExam.unCheckAll()">反选</button>
                 </div>
             </div>
         </form>

+ 3 - 3
app/admin/view/enterprise_change_record/goto_enterprise_change_examine_page.html

@@ -12,8 +12,8 @@
                             <div class="col-sm-10">
                                 <select class="form-control" id="checkState" name="checkState" onchange="examine.toggleField()" >
                                     <option value="">--- 请选择 ---</option>
-                                    <option value="3">审核驳回</option>
-                                    <option value="4">审核通过</option>
+                                    <option value="3" {eq name="ep.checkState" value="3"}selected{/eq}>审核驳回</option>
+                                    <option value="4" {eq name="ep.checkState" value="4"}selected{/eq}>审核通过</option>
                                 </select>
                             </div>
                         </div>
@@ -30,7 +30,7 @@
                         </div>
                     </div>
                 </div>
-                <div id="field" style="padding-top:5px;display:none">
+                <div id="field" {neq name="ep.checkState" value="3"}style="padding-top:5px;display:none"{/neq}>
                     <label for="checkMsg" class="control-label">可修改字段</label>
                     <div id="field_info">
                         <ul style="overflow:hidden;list-style:none;">

+ 38 - 29
app/common/controller/Auth.php

@@ -245,32 +245,40 @@ class Auth extends BaseController {
         $ep = EnterpriseApi::getOne(session('temp')['uid']);
         if ($this->request->isPost()) {
             $response_object = new \StdClass();
-            $data = [
-                'name' => \StrUtil::getRequestDecodeParam($this->request, 'name'), //单位名称
-                'idCard' => \StrUtil::getRequestDecodeParam($this->request, 'idCard'), //统一社会信用代码
-                'agentName' => \StrUtil::getRequestDecodeParam($this->request, 'agentName'), //人才联络员
-                'legal' => \StrUtil::getRequestDecodeParam($this->request, 'legal'), //法人
-                'street' => \StrUtil::getRequestDecodeParam($this->request, 'street'), //镇街
-                'address' => \StrUtil::getRequestDecodeParam($this->request, 'address'), //地址
-                'type' => intval($this->request['type']),
-                'agencyType' => intval($this->request['agencyType']),
-                'enterpriseTag' => \StrUtil::getRequestDecodeParam($this->request, 'enterpriseTag'), //单位标签
-                'organizationTag' => \StrUtil::getRequestDecodeParam($this->request, 'organizationTag'), //机构标签
-                'institutionTag' => \StrUtil::getRequestDecodeParam($this->request, 'institutionTag'), //事业单位标签
-                'enterpriseType' => \StrUtil::getRequestDecodeParam($this->request, 'enterpriseType'), //单位类型
-                'agentPhone' => \StrUtil::getRequestDecodeParam($this->request, 'agentPhone'), //手机
-                'agentEmail' => \StrUtil::getRequestDecodeParam($this->request, 'agentEmail'), //邮箱
-                'ephone' => \StrUtil::getRequestDecodeParam($this->request, 'ephone'), //单位电话
-                'industryFieldNew' => \StrUtil::getRequestDecodeParam($this->request, 'industryFieldNew'), //产业领域
-                'industryFieldOld' => \StrUtil::getRequestDecodeParam($this->request, 'industryFieldOld'), //行业领域
-                'bankCard' => \StrUtil::getRequestDecodeParam($this->request, 'bankCard'), //银行
-                'bank' => \StrUtil::getRequestDecodeParam($this->request, 'bank'), //开户行
-                'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'bankNetwork')//网点
-            ];
+            $data = $ep->toArray();
+            /* $data = [
+              'name' => \StrUtil::getRequestDecodeParam($this->request, 'name'), //单位名称
+              'idCard' => \StrUtil::getRequestDecodeParam($this->request, 'idCard'), //统一社会信用代码
+              'agentName' => \StrUtil::getRequestDecodeParam($this->request, 'agentName'), //人才联络员
+              'legal' => \StrUtil::getRequestDecodeParam($this->request, 'legal'), //法人
+              'street' => \StrUtil::getRequestDecodeParam($this->request, 'street'), //镇街
+              'address' => \StrUtil::getRequestDecodeParam($this->request, 'address'), //地址
+              'type' => intval($this->request['type']),
+              'agencyType' => intval($this->request['agencyType']),
+              'enterpriseTag' => \StrUtil::getRequestDecodeParam($this->request, 'enterpriseTag'), //单位标签
+              'organizationTag' => \StrUtil::getRequestDecodeParam($this->request, 'organizationTag'), //机构标签
+              'institutionTag' => \StrUtil::getRequestDecodeParam($this->request, 'institutionTag'), //事业单位标签
+              'enterpriseType' => \StrUtil::getRequestDecodeParam($this->request, 'enterpriseType'), //单位类型
+              'agentPhone' => \StrUtil::getRequestDecodeParam($this->request, 'agentPhone'), //手机
+              'agentEmail' => \StrUtil::getRequestDecodeParam($this->request, 'agentEmail'), //邮箱
+              'ephone' => \StrUtil::getRequestDecodeParam($this->request, 'ephone'), //单位电话
+              'industryFieldNew' => \StrUtil::getRequestDecodeParam($this->request, 'industryFieldNew'), //产业领域
+              'industryFieldOld' => \StrUtil::getRequestDecodeParam($this->request, 'industryFieldOld'), //行业领域
+              'bankCard' => \StrUtil::getRequestDecodeParam($this->request, 'bankCard'), //银行
+              'bank' => \StrUtil::getRequestDecodeParam($this->request, 'bank'), //开户行
+              'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'bankNetwork')//网点
+              ]; */
+            if ($ep->modify_fields) {
+                $modify_fields = explode(",", $ep->modify_fields);
+                foreach ($modify_fields as $field) {
+                    $data[$field] = \StrUtil::getRequestDecodeParam($this->request, $field);
+                }
+            }
+            $modify_files = explode(",", $ep->modify_files);
             $files = $this->request->file();
             if ($files) {
                 $uploadapi = new UploadApi();
-                if (array_key_exists('imgurl', $files)) {
+                if (array_key_exists('imgurl', $files) && in_array('imgurl', $modify_files)) {
                     $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
                     if ($upload_result->code == 500) {
                         return \StrUtil::back($upload_result, "Register.epCallBack");
@@ -279,7 +287,7 @@ class Auth extends BaseController {
                 }
 
                 //检验附件 开户许可证
-                if (array_key_exists('bankImg', $files)) {
+                if (array_key_exists('bankImg', $files) && in_array('bankImg', $modify_files)) {
                     $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
                     if ($upload_result1->code == 500) {
                         return \StrUtil::back($upload_result1, "Register.epCallBack");
@@ -288,7 +296,7 @@ class Auth extends BaseController {
                 }
 
                 //检验附件 行业领域佐证材料
-                if (array_key_exists('domainImg', $files)) {
+                if (array_key_exists('domainImg', $files) && in_array('domainImg', $modify_files)) {
                     $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
                     if ($upload_result2->code == 500) {
                         return \StrUtil::back($upload_result2, "Register.epCallBack");
@@ -297,7 +305,7 @@ class Auth extends BaseController {
                 }
 
                 //检验附件 行业领域佐证材料
-                if (array_key_exists('typeImg', $files)) {
+                if (array_key_exists('typeImg', $files) && in_array('typeImg', $modify_files)) {
                     $upload_result4 = $uploadapi->uploadOne($this->request->file('typeImg'), 'system');
                     if ($upload_result4->code == 500) {
                         return \StrUtil::back($upload_result4, "Register.epCallBack");
@@ -306,7 +314,7 @@ class Auth extends BaseController {
                 }
 
                 //检验附件 人才联络员备案表
-                if (array_key_exists('beian', $files)) {
+                if (array_key_exists('beian', $files) && in_array('beian', $modify_files)) {
                     $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
                     if ($upload_result3->code == 500) {
                         return \StrUtil::back($upload_result3, "Register.epCallBack");
@@ -315,10 +323,10 @@ class Auth extends BaseController {
                 }
             }
             try {
-                if (stripos($data['name'], "(")) {
+                if ($data['name'] && stripos($data['name'], "(")) {
                     $data['name'] = str_replace('(', '(', $data['name']);
                 }
-                if (stripos($data['name'], ")")) {
+                if ($data['name'] && stripos($data['name'], ")")) {
                     $data['name'] = str_replace(')', ')', $data['name']);
                 }
                 $data['id'] = $ep->id;
@@ -368,6 +376,7 @@ class Auth extends BaseController {
                 }
                 unset($data["agentPhone"]);
                 $data['checkState'] = 1;
+                $data["updateTime"] = date("Y-m-d H:i:s");
                 $ep->update($data);
 
                 $response_object->code = 200;

+ 25 - 2
public/static/modular/enterprise/enterprise_examine.js

@@ -13,7 +13,21 @@ EpExam.addSubmit = function () {
         Feng.info("请填写审核意见");
         return;
     }
-    var da = {"id": id, "checkState": checkState, "checkMsg": checkMsg};
+    if (checkState == 2 && $("#field input[type=checkbox]:checked").length == 0) {
+        Feng.info("请选择驳回修改的字段或者附件");
+        return;
+    }
+    var fieldCount = $("#field_info input[type=checkbox]:checked").length;
+    var fields = new Array();
+    for (var i = 0; i < fieldCount; i++) {
+        fields.push($("#field_info input[type=checkbox]:checked").eq(i).val());
+    }
+    var fileCount = $("#field_file input[type=checkbox]:checked").length;
+    var files = new Array();
+    for (var i = 0; i < fileCount; i++) {
+        files.push($("#field_file input[type=checkbox]:checked").eq(i).val());
+    }
+    var da = {"id": id, "checkState": checkState, "checkMsg": checkMsg, fields: fields, files: files};
     var operation = function () {
         var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doExamine", function (data) {
             if (data.code == 200) {
@@ -30,6 +44,13 @@ EpExam.addSubmit = function () {
     Feng.confirm("确定提交吗?", operation);
 };
 
+EpExam.checkAll = function () {
+    $("#field input[type=checkbox]").prop("checked", true);
+}
+EpExam.unCheckAll = function () {
+    $("#field input[type=checkbox]").removeAttr("checked");
+}
+
 EpExam.toggleField = function () {
     var checkState = $("#checkState").val();
     var checkMsg = $("#checkMsg").val();
@@ -38,9 +59,11 @@ EpExam.toggleField = function () {
         if (checkMsg == null || checkMsg == '') {
             $("#checkMsg").val("机构账号注册审核通过。");
         }
-    } else {
+    } else if (checkState == 2) {
         $("#checkMsg").val("");
         $("#field").css("display", "block");
+    } else {
+        $("#field").css("display", "none");
     }
 }
 

+ 3 - 2
public/static/modular/enterprise/enterprisechangeRecord/ep_change_record_examine.js

@@ -61,9 +61,10 @@ examine.toggleField = function () {
         if (checkMsg == null || checkMsg == '') {
             $("#checkMsg").val("机构信息变更审核通过。");
         }
-    }
-    if (checkState == 3) {
+    } else if (checkState == 3) {
         $("#checkMsg").val("");
         $("#field").css("display", "block");
+    } else {
+        $("#field").css("display", "none");
     }
 }

+ 2 - 2
public/static/modular/gate/enterprise/enterprise_edit.js

@@ -249,8 +249,8 @@ Register.setFieldDisabled = function () {
                 break;
             case "domainImg":
                 $("#domainImg").removeAttr("disabled");
-                var html = $("#bankImg").parent().find("label").html() + "<br><span style=\"color:red;\">(可修改)</span>";
-                $("#bankImg").parent().find("label").html(html);
+                var html = $("#domainImg").parent().find("label").html() + "<br><span style=\"color:red;\">(可修改)</span>";
+                $("#domainImg").parent().find("label").html(html);
                 break;
             case "typeImg":
                 $("#typeImg").removeAttr("disabled");