فهرست منبع

企业注册、企业信息变更增加独立驳回字段修改窗口

sugangqiang 2 سال پیش
والد
کامیت
544b3cc176

+ 64 - 0
app/admin/controller/Enterprise.php

@@ -408,4 +408,68 @@ class Enterprise extends AdminController {
         return json(["msg" => "没有可以导出的内容"]);
     }
 
+    public function findFieldsAndFiles() {
+        $id = $this->request->param("id");
+        $ep = EnterpriseApi::getOne($id);
+
+        if ($ep->special == 0) {
+            $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" => "人才联络员邮箱"];
+            if ($ep->special == 1) {
+                $fields["institutionTag"] = "单位标签";
+            }
+            if ($ep->special == 3) {
+                $fields["organizationTag"] = "机构标签";
+            }
+            $files = ["imgurl" => "法人证或批文", "bankImg" => "开户许可证/基本存款账户信息", "beian" => "人才联络员备案表"];
+        }
+
+        $modify_fields = [];
+        $modify_files = [];
+        $_modify_fields = explode(",", $ep["modify_fields"]);
+        foreach ($fields as $key => $value) {
+            $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 json(["code" => 200, "files" => $modify_files, "fields" => $modify_fields]);
+    }
+
+    public function updateFieldsAndFiles() {
+        try {
+            $params = $this->request->param();
+            $id = $params["id"];
+            $ep = EnterpriseApi::getOne($id);
+            if (!$ep) {
+                throw new \think\Exception("没有对应的企业信息");
+            }
+            if ($ep["checkState"] != 2) {
+                throw new \think\Exception("不是驳回状态,不能修改驳回字段!");
+            }
+            $fields = array_filter(explode(",", $params["fields"]));
+            $files = array_filter(explode(",", $params["files"]));
+            if (!$fields || !$files)
+                throw new \think\Exception("请选择要驳回的字段或附件!");
+            $data["id"] = $id;
+            $data["modify_fields"] = $fields ? implode(",", $fields) : null;
+            $data["modify_files"] = $files ? implode(",", $files) : null;
+            $data["updateTime"] = date("Y-m-d H:i:s");
+            $data["updateUser"] = session("user")["uid"];
+            if (EnterpriseApi::updateById($data)) {
+                return json(["code" => 200, "msg" => "修改成功!"]);
+            }
+        } catch (\think\Exception $e) {
+            return json(["msg" => $e->getMessage()]);
+        }
+    }
+
 }

+ 99 - 0
app/admin/controller/EnterpriseChangeRecord.php

@@ -587,4 +587,103 @@ class EnterpriseChangeRecord extends AdminController {
         return json(["msg" => "没有可以导出的内容"]);
     }
 
+    public function findFieldsAndFiles() {
+        $id = trim($this->request['id']);
+        $ecr = EnterpriseApi::getOneRecord($id);
+        $ep = EnterpriseApi::getOne($ecr['mainId']);
+        if (!$ecr || !$ep || !$id) {
+            return json(["msg" => '没有对应的企业变更信息!']);
+        }
+
+        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" => "人才联络员备案表"];
+            }
+        } else {
+            $fields = ["Name" => "单位名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "单位地址", "Street" => "所属街道", "Ephone" => "单位电话", "BankCard" => "单位银行账号", "Bank" => "单位开户银行", "BankNetwork" => "单位开户银行网点",
+                "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+            if ($ep->special == 1) {
+                $fields["InstitutionTag"] = "单位标签";
+            }
+            if ($ep->special == 3) {
+                $fields["OrganizationTag"] = "机构标签";
+            }
+            $files = ["newImgurl" => "法人证或批文", "newBankImg" => "开户许可证/基本存款账户信息", "newBeian" => "人才联络员备案表"];
+        }
+        $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];
+                }
+            }
+        }
+        $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
+            "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
+        $modify_files = [];
+        foreach ($files as $key => $value) {
+            $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => false];
+        }
+        if ($ecr["modify_files"]) {
+            $_modify_files = explode(",", $ecr["modify_files"]);
+            foreach ($_modify_files as $_file) {
+                if ($modify_files[$_file]) {
+                    $modify_files[$_file]["checked"] = true;
+                } else {
+                    if (strtotime($ecr["createTime"]) < strtotime($this->compatible_time)) {
+                        //兼容旧的typeid
+                        $_file = $oldtypes[$_file];
+                    }
+                    $modify_files[$_file] = ["field" => $_file, "name" => $files[$_file], "checked" => true];
+                }
+            }
+        }
+        return json(["code" => 200, "files" => $modify_files, "fields" => $modify_fields]);
+    }
+
+    public function updateFieldsAndFiles() {
+        try {
+            $params = $this->request->param();
+            $id = $params["id"];
+            $ecr = EnterpriseApi::getOneRecord($id);
+            if (!$ecr) {
+                throw new \think\Exception("没有对应的企业变更信息");
+            }
+            if ($ecr["checkState"] != 3) {
+                throw new \think\Exception("不是驳回状态,不能修改驳回字段!");
+            }
+            $fields = array_filter(explode(",", $params["fields"]));
+            $files = array_filter(explode(",", $params["files"]));
+            if (!$fields || !$files)
+                throw new \think\Exception("请选择要驳回的字段或附件!");
+            $data["id"] = $id;
+            $data["modify_fields"] = $fields ? implode(",", $fields) : null;
+            $data["modify_files"] = $files ? implode(",", $files) : null;
+            $data["updateTime"] = date("Y-m-d H:i:s");
+            $data["updateUser"] = session("user")["uid"];
+            if (EnterpriseApi::updateById($data)) {
+                return json(["code" => 200, "msg" => "修改成功!"]);
+            }
+        } catch (\think\Exception $e) {
+            return json(["msg" => $e->getMessage()]);
+        }
+    }
+
 }

+ 10 - 2
app/admin/view/enterprise/goto_enterprise_page.html

@@ -1,5 +1,9 @@
 {extend name="layout/content"}
 {block name="content"}
+<style>
+    #field_info{overflow:hidden;}
+    #field_info li{list-style:none;float:left;margin:2px 5px;}
+</style>
 <div class="row">
     <div class="col-sm-12">
         <div class="ibox float-e-margins">
@@ -193,11 +197,15 @@
                 </div>
                 <div class="hidden-xs" id="tableToolbar" role="group">
                     {if condition="chkCommission('/admin/enterprise/doExamine','/enterprise/doExamine')"}
-                    <button type="button" class="btn btn-sm btn-primary "
-                            onclick="Enterprise.gotoEnterpriseDetailPage()">
+                    <button type="button" class="btn btn-sm btn-primary " onclick="Enterprise.gotoEnterpriseDetailPage()">
                         <i class="fa fa-edit"></i>&nbsp;审核
                     </button>
                     {/if}
+                    {if condition="chkCommission('/admin/enterprise/updateFieldsAndFiles','')"}
+                    <button type="button" class="btn btn-sm btn-primary " onclick="Enterprise.updateFieldsAndFiles()" id="">
+                        <i class="fa fa-edit"></i>&nbsp;修改驳回字段
+                    </button>
+                    {/if}
                     {if condition="chkCommission('/admin/enterprise/setActive','/enterprise/setActive')"}
                     <button type="button" class="btn btn-sm btn-primary " onclick="Enterprise.setActive()">
                         <i class="fa fa-edit"></i>&nbsp;设置冻结

+ 9 - 0
app/admin/view/enterprise_change_record/goto_enterprise_change_record_page.html

@@ -1,5 +1,9 @@
 {extend name="layout/content"}
 {block name="content"}
+<style>
+    #field_info{overflow:hidden;}
+    #field_info li{list-style:none;float:left;margin:2px 5px;}
+</style>
 <div class="row">
     <div class="col-sm-12">
         <div class="ibox float-e-margins">
@@ -192,6 +196,11 @@
                         <i class="fa fa-edit"></i>&nbsp;审核
                     </button>
                     {/if}
+                    {if condition="chkCommission('/admin/enterpriseChangeRecord/updateFieldsAndFiles','')"}
+                    <button type="button" class="btn btn-sm btn-primary " onclick="EpChange.updateFieldsAndFiles()" id="">
+                        <i class="fa fa-edit"></i>&nbsp;修改驳回字段
+                    </button>
+                    {/if}
                     {if
                     condition="chkCommission('/admin/enterpriseChangeRecord/export','/enterprisechangeRecord/excelExport')"}
                     <button type="button" class="btn btn-sm btn-primary " onclick="EpChange.export()">

+ 109 - 0
public/static/modular/enterprise/enterprise_list.js

@@ -204,6 +204,115 @@ Enterprise.doExamine = function () {
 //    layer.full(index);
 };
 
+
+/**
+ * 修改驳回的字段及附件
+ */
+Enterprise.updateFieldsAndFiles = function () {
+    if (this.check()) {
+        var id = Enterprise.seItem.id;
+        var ajax = new $ax("/admin/enterprise/findFieldsAndFiles?id=" + id, function (data) {
+            if (data.code == 200) {
+                layer.open({
+                    type: 1,
+                    id: "fieldCheckModalForm",
+                    title: '修改',
+                    area: ['800px', '450px'], //宽高
+                    fix: false, //不固定
+                    shade: 0,
+                    maxmin: true,
+                    content: Enterprise.creatFieldCheckModal(),
+                    btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+                    btnAlign: 'c',
+                    zIndex: layer.zIndex,
+                    success: function (layero, index) {
+                        var fileList = data.files;
+                        var fieldList = data.fields;
+                        var html_field = '';
+                        var html_file = '';
+                        for (var key in fieldList) {
+                            html_field = html_field + '<li><input type="checkbox" ' + (fieldList[key].checked ? "checked" : "") + ' value="' + fieldList[key].field + '"><span>' + fieldList[key].name + '</span></li>';
+                        }
+                        for (var key in fileList) {
+                            html_file = html_file + '<li style="width: 100%"><input type="checkbox" ' + (fileList[key].checked ? "checked" : "") + ' value="' + fileList[key].field + '"><span>' + fileList[key].name + '</span></li>';
+                        }
+                        $("#field_info").empty().append("<ul>" + html_field + "</ul>");
+                        $("#field_file").empty().append("<ul>" + html_file + "</ul>");
+                    },
+                    yes: function (index, layero) {
+                        Enterprise.submitFieldsAndFiles(index, id);
+                    }
+                });
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("查询失败!" + data.responseJSON.message + "!");
+        });
+        ajax.start();
+    }
+};
+
+/**
+ * 修改提交
+ * @param index
+ * @param id
+ */
+Enterprise.submitFieldsAndFiles = function (index, id) {
+    var fields = '';
+    var files = '';
+    $("#field_info li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            fields = fields + $(this).val() + ",";
+        }
+    });
+    $("#field_file li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            files = files + $(this).val() + ",";
+        }
+    });
+    if (fields == '' && files == '') {
+        Feng.info("请选择可修改的字段或附件!");
+        return;
+    }
+    var ajax = new $ax("/admin/enterprise/updateFieldsAndFiles", function (data) {
+        if (data.code == 200) {
+            layer.close(index);
+            Feng.success(data.msg);
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("修改失败!" + data.responseJSON.message + "!");
+    });
+    ajax.setData({"id": id, "fields": fields, "files": files})
+    ajax.start();
+};
+Enterprise.creatFieldCheckModal = function () {
+    return '<form id="fieldCheckModalForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <div >\n' +
+            '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
+            '                            <div id="field_info">\n' +
+            '                            </div>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+            '                            <div id="field_file">\n' +
+            '                            </div>\n' +
+            '                            <div class="form-group" style="text-align: center">\n' +
+            '                                <button type="button" class="btn btn-primary" onclick="Enterprise.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="Enterprise.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+};
+Enterprise.checkAll = function () {
+    $("#fieldCheckModalForm input[type=checkbox]").prop("checked", true);
+};
+Enterprise.unCheckAll = function () {
+    $("#fieldCheckModalForm input[type=checkbox]").removeAttr("checked");
+};
+
 Enterprise.delEnterprise = function () {
     if (!Enterprise.check()) {
         return;

+ 0 - 2
public/static/modular/enterprise/enterprisechangeRecord/ep_change_record_detail.js

@@ -25,8 +25,6 @@ ecre.doExamine = function () {
     ecre.layerIndex = index;
 };
 
-
-
 ecre.initFileTable = function () {
     $("#fileTable").bootstrapTable({
         url: Feng.ctxPath + "/common/api/listCurrencyFileType",

+ 107 - 0
public/static/modular/enterprise/enterprisechangeRecord/ep_change_record_list.js

@@ -146,6 +146,113 @@ EpChange.gotoEnterpriseChangeDetailPage = function() {
 };
 
 
+/**
+ * 修改驳回的字段及附件
+ */
+EpChange.updateFieldsAndFiles = function () {
+    if (this.check()) {
+        var id = EpChange.seItem.id;
+        var ajax = new $ax("/admin/enterpriseChangeRecord/findFieldsAndFiles?id=" + id, function (data) {
+            if (data.code == 200) {
+                layer.open({
+                    type: 1,
+                    id: "fieldCheckModalForm",
+                    title: '修改',
+                    area: ['800px', '450px'], //宽高
+                    fix: false, //不固定
+                    shade: 0,
+                    maxmin: true,
+                    content: EpChange.creatFieldCheckModal(),
+                    btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+                    btnAlign: 'c',
+                    zIndex: layer.zIndex,
+                    success: function (layero, index) {
+                        var fileList = data.files;
+                        var fieldList = data.fields;
+                        var html_field = '';
+                        var html_file = '';
+                        for (var key in fieldList) {
+                            html_field = html_field + '<li><input type="checkbox" ' + (fieldList[key].checked ? "checked" : "") + ' value="' + fieldList[key].field + '"><span>' + fieldList[key].name + '</span></li>';
+                        }
+                        for (var key in fileList) {
+                            html_file = html_file + '<li style="width: 100%"><input type="checkbox" ' + (fileList[key].checked ? "checked" : "") + ' value="' + fileList[key].field + '"><span>' + fileList[key].name + '</span></li>';
+                        }
+                        $("#field_info").empty().append("<ul>" + html_field + "</ul>");
+                        $("#field_file").empty().append("<ul>" + html_file + "</ul>");
+                    },
+                    yes: function (index, layero) {
+                        EpChange.submitFieldsAndFiles(index, id);
+                    }
+                });
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("查询失败!" + data.responseJSON.message + "!");
+        });
+        ajax.start();
+    }
+};
+
+/**
+ * 修改提交
+ * @param index
+ * @param id
+ */
+EpChange.submitFieldsAndFiles = function (index, id) {
+    var fields = '';
+    var files = '';
+    $("#field_info li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            fields = fields + $(this).val() + ",";
+        }
+    });
+    $("#field_file li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            files = files + $(this).val() + ",";
+        }
+    });
+    if (fields == '' && files == '') {
+        Feng.info("请选择可修改的字段或附件!");
+        return;
+    }
+    var ajax = new $ax("/admin/enterpriseChangeRecord/updateFieldsAndFiles", function (data) {
+        if (data.code == 200) {
+            layer.close(index);
+            Feng.success(data.msg);
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("修改失败!" + data.responseJSON.message + "!");
+    });
+    ajax.setData({"id": id, "fields": fields, "files": files})
+    ajax.start();
+};
+EpChange.creatFieldCheckModal = function () {
+    return '<form id="fieldCheckModalForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <div >\n' +
+            '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
+            '                            <div id="field_info">\n' +
+            '                            </div>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+            '                            <div id="field_file">\n' +
+            '                            </div>\n' +
+            '                            <div class="form-group" style="text-align: center">\n' +
+            '                                <button type="button" class="btn btn-primary" onclick="EpChange.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="EpChange.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+};
+EpChange.checkAll = function () {
+    $("#fieldCheckModalForm input[type=checkbox]").prop("checked", true);
+};
+EpChange.unCheckAll = function () {
+    $("#fieldCheckModalForm input[type=checkbox]").removeAttr("checked");
+};
 
 EpChange.export = function(){
     var queryData = {};