فهرست منبع

增加已通过注册企业再驳回操作

sugangqiang 2 سال پیش
والد
کامیت
3f249d0805

+ 145 - 6
app/admin/controller/Enterprise.php

@@ -33,11 +33,11 @@ class Enterprise extends AdminController {
     public function gotoEnterpriseDetailPage() {
         $id = trim($this->request['id']);
         $ep = EnterpriseApi::getOne($id);
-        $check_info = ApiData::where('action','=','register_check')->where('uid','=',$ep['idCard'])->where('status','=',1)->find();
-        $force = intval($this->request['force'],0);
-        if($force || !$check_info || !$check_info['status']){
+        $check_info = ApiData::where('action', '=', 'register_check')->where('uid', '=', $ep['idCard'])->where('status', '=', 1)->find();
+        $force = intval($this->request['force'], 0);
+        if ($force || !$check_info || !$check_info['status']) {
             $rsapi = new RsApi();
-            switch ($ep['special']){
+            switch ($ep['special']) {
                 case 0:
                     $ep['rs'] = $rsapi->I040102($ep['idCard']);
                     break;
@@ -49,7 +49,7 @@ class Enterprise extends AdminController {
                     break;
             }
 
-            ApiData::where('action','=','register_check')->where('uid','=',$ep['idCard'])->where('status','=',1)->update(['status' => 0,'updateTime' => time()]);
+            ApiData::where('action', '=', 'register_check')->where('uid', '=', $ep['idCard'])->where('status', '=', 1)->update(['status' => 0, 'updateTime' => time()]);
             $api_model_data = [
                 'uid' => $ep['idCard'],
                 'action' => 'register_check',
@@ -58,7 +58,7 @@ class Enterprise extends AdminController {
             ];
 
             ApiData::create($api_model_data);
-        }else{
+        } else {
             $ep['rs'] = unserialize($check_info['content']);
         }
 
@@ -402,6 +402,145 @@ class Enterprise extends AdminController {
         }
     }
 
+    public function gotoRejectPage() {
+        $id = trim($this->request['id']);
+        $ep = EnterpriseApi::getOne($id);
+        if (!$ep) {
+            return "无此企业";
+        }
+        if ($ep["checkState"] != 3) {
+            return "该操作只能对已通过企业进行驳回";
+        }
+        $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
+        if ($lastLog["active"] != 1 || $lastLog["state"] != $ep["checkState"]) {
+            return "日志状态与当前状态不一致,已中止操作";
+        }
+        $ep["passedUser"] = $lastLog["createUser"];
+        $ep["passedTime"] = $lastLog["createTime"];
+        //---------设置产业领域 --------------------------------------------------
+        if (\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])) {
+            $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field', $ep['industryFieldNew']);
+            if ($industryFieldNew != null) {
+                $ep['industryFieldNewName'] = $industryFieldNew['name'];
+            }
+        }
+
+
+        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) {
+            $modify_fields[$key] = ["field" => $key, "name" => $value];
+        }
+        $_modify_files = explode(",", $ep["modify_files"]);
+        foreach ($files as $key => $value) {
+            $modify_files[$key] = ["field" => $key, "name" => $value];
+        }
+
+        return view("", ['ep' => $ep, 'fields' => $modify_fields, "files" => $modify_files]);
+    }
+
+    public function doReject() {
+        $id = trim($this->request['id']);
+        if (!$id) {
+            return json(["msg" => 'ID不能为空!']);
+        }
+        $ep = EnterpriseApi::getOne($id);
+        if (!$ep) {
+            return json(["msg" => '无此企业!']);
+        }
+        if ($ep["checkState"] != 3) {
+            return json(["msg" => '该操作只能对已通过企业进行驳回!']);
+        }
+        $checkMsg = $this->request['checkMsg'];
+        $fields = $this->request['fields'];
+        $files = $this->request['files'];
+        if (\StrUtil::isEmpOrNull($checkMsg)) {
+            return json(["msg" => '请填写审核意见!']);
+        }
+        if (strlen($checkMsg) > 1000) {
+            return json(["msg" => '审核意见最多1000个字符!']);
+        }
+        if (!$fields && !$files) {
+            return json(["msg" => '请选择驳回修改的字段或者附件!']);
+        }
+        try {
+            $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
+            if ($lastLog["active"] != 1 || $lastLog["state"] != $ep["checkState"]) {
+                return json(["msg" => '日志状态与当前状态不一致,已中止操作']);
+            }
+            $companyName = session('user')["companyName"] ?: session('user')["rolename"];
+            $checkData = [
+                'id' => $id,
+                'checkState' => 2,
+                '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")
+            ];
+            $res = EnterpriseApi::updateById($checkData);
+
+            $tplContent = "【晋江市人才服务平台】您好!您提交的晋江市现代产业体系人才机构注册信息因信息填写错误或上传不完整已被退回,请及时登录“晋江市人才综合服务申报平台”根据审核意见修改并重新提交。退订回复TD。";
+            $smsapi = new ChuanglanSmsApi();
+            $result = $smsapi->sendSMS($ep['agentPhone'], $tplContent);
+
+            //短信入库数据
+            $record_data = [
+                'id' => getStringId(),
+                'bizId' => $result['msgId'],
+                'userId' => $id,
+                'type' => 2,
+                'smsType' => 2,
+                'name' => $ep['name'],
+                'phone' => $ep['agentPhone'],
+                'params' => '机构注册通过再驳回',
+                'state' => $result['code'] == 0 ? 2 : 3,
+                'sendingDate' => date("Y-m-d H:i:s", time()),
+                'createTime' => date("Y-m-d H:i:s", time()),
+                'templateCode' => $tplContent,
+                "msg" => $result['errorMsg']
+            ];
+
+            MessageRecord::create($record_data);
+            TalentChecklog::create([
+                'id' => getStringId(),
+                'mainId' => $id,
+                'type' => 10,
+                'typeField' => null,
+                'active' => 1,
+                'state' => 2,
+                'step' => 101,
+                'stateChange' => TalentState::stateEnum(2),
+                'description' => $checkMsg,
+                'createTime' => date("Y-m-d H:i:s", time()),
+                'createUser' => session('user')['name'] . "({$companyName})"
+            ]);
+
+            return json(["msg" => '操作成功!', "code" => 200]);
+        } catch (\Exception $e) {
+            return json(["msg" => $e->getMessage()]);
+        }
+    }
+
     public function delEnterprise() {
         if (!$id = trim($this->request['id'])) {
             return json(["msg" => 'ID不能为空!', "code" => 500]);

+ 5 - 0
app/admin/view/enterprise/goto_enterprise_page.html

@@ -208,6 +208,11 @@
                         <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                     </button>
                     {/if}
+                    {if condition="chkCommission('/admin/enterprise/forceReject','')"}
+                    <button type="button" class="btn btn-sm btn-primary " onclick="Enterprise.forceReject()" 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;设置冻结

+ 102 - 0
app/admin/view/enterprise/goto_reject_page.html

@@ -0,0 +1,102 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <form id="ep_active" class="form-horizontal">
+            <input type="text" id="id" value="{$ep.id}" style="display: none;" />
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label">单位名称</label>
+                        <div class="col-sm-10">
+                            <input type="text" class="form-control" readonly="readonly" id="name" name="name" value="{$ep.name}"  />
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="hr-line-dashed"></div>
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label">统一社会信用代码</label>
+                        <div class="col-sm-10">
+                            <input type="text" class="form-control" readonly="readonly" id="idCard" name="idCard" value="{$ep.idCard}"  />
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="hr-line-dashed"></div>
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label">通过时间</label>
+                        <div class="col-sm-10">
+                            <input type="text" class="form-control" readonly="readonly" id="passedTime" name="passedTime" value="{$ep.passedTime}"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="hr-line-dashed"></div>
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label">审核人(审核通过)</label>
+                        <div class="col-sm-10">
+                            <input type="text" class="form-control" readonly="readonly" id="passedUser" name="passedUser" value="{$ep.passedUser}"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="hr-line-dashed"></div>
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label"><span class="text-danger">*</span>审核状态</label>
+                        <div class="col-sm-10">
+                            <select class="form-control" id="checkState" name="checkState">
+                                <option selected>已通过再驳回</option>
+                            </select>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="hr-line-dashed"></div>
+            <div class="row">
+                <div class="col-sm-12">
+                    <div class="rowGroup"  style="margin-bottom: 0px;">
+                        <label class="col-sm-2 control-label">审核意见</label>
+                        <div class="col-sm-10">
+                            <textarea class="form-control" rows="3" id="checkMsg" name="checkMsg"></textarea>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div id="field" style="padding-top:5px;">
+                <label for="checkMsg" class="control-label">可修改字段</label>
+                <div id="field_info">
+                    <ul style="overflow:hidden;list-style:none;">
+                        {volist name="fields" id="field"}
+                        <li style="float:left;margin-right:10px;"><input type="checkbox" value="{$field.field}" {if condition="$field['checked']"}checked="true"{/if}><span>{$field.name}</span></li>
+                        {/volist}
+                    </ul>
+                </div>
+                <label for="checkMsg" class="control-label">可修改附件</label>
+                <div id="field_file">
+                    <ul style="overflow:hidden;list-style:none;">
+                        {volist name="files" id="file"}
+                        <li style="float:left;margin-right:10px;"><input type="checkbox" value="{$file.field}" {if condition="$file['checked']"}checked="true"{/if}><span>{$file.name}</span></li>
+                        {/volist}
+                    </ul>
+                </div>
+                <div class="form-group" style="text-align: center">
+                    <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>
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/enterprise/enterprise_examine.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 34 - 1
public/static/modular/enterprise/enterprise_examine.js

@@ -50,7 +50,40 @@ EpExam.addSubmit = function () {
 EpExam.submitToCheck = function () {
     EpExam.save(1);
 };
-
+EpExam.submitToReject = function () {
+    var id = $("#id").val();
+    var checkMsg = $("#checkMsg").val();
+    if (checkMsg == null || checkMsg == "") {
+        Feng.info("请填写审核意见");
+        return;
+    }
+    if ($("#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, "checkMsg": checkMsg, fields: fields, files: files};
+    var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doReject", function (data) {
+        if (data.code == 200) {
+            window.parent.Enterprise.table.refresh();
+            parent.layer.closeAll();
+        }
+        Feng.info(data.msg);
+    }, function (data) {
+        Feng.error("操作失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set(da);
+    ajax.start();
+}
 EpExam.checkAll = function () {
     $("#field input[type=checkbox]").prop("checked", true);
 }

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

@@ -296,6 +296,37 @@ Enterprise.updateFieldsAndFiles = function () {
     }
 };
 
+/**
+ * 已通过再驳回
+ */
+Enterprise.forceReject = function () {
+    if (this.check()) {
+        if (Enterprise.seItem.checkState != 3) {
+            Feng.info("该操作只能对已通过企业进行驳回!");
+            return;
+        }
+        var index = layer.open({
+            type: 2,
+            title: '驳回已通过企业',
+            area: ['830px', '500px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            shade: 0,
+            content: Feng.ctxPath + '/admin/enterprise/gotoRejectPage?id=' + Enterprise.seItem.id,
+            btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
+            btnAlign: 'c',
+            yes: function (index, layero) {
+                //按钮【按钮一】的回调
+                layer.confirm("确认驳回该企业?", function () {
+                    var iframeWin = window[layero.find('iframe')[0]['name']];
+                    iframeWin.EpExam.submitToReject();
+                })
+            }
+        });
+//    layer.full(index);
+    }
+}
+
 /**
  * 修改提交
  * @param index