Browse Source

注销审核端

sugangqiang 1 year ago
parent
commit
7dc2d28470

+ 41 - 73
app/admin/controller/EnterpriseCloseAccount.php

@@ -2,7 +2,10 @@
 
 namespace app\admin\controller;
 
+use app\common\model\EnterpriseCloseAccount as EcaModel;
 use app\admin\common\AdminController;
+use think\facade\Db;
+use app\common\state\MainState;
 
 /**
  * Description of EnterpriseCloseAccount
@@ -20,29 +23,24 @@ class EnterpriseCloseAccount extends AdminController {
         $offset = $params["offset"] ?: 0;
         $order = $params["order"] ?: "desc";
         $limit = $params["limit"] ?: 10;
-        $where = $this->setTalentQuit($params);
+        $where = $this->setFilter($params);
         $where[] = ["type", "=", $this->user["type"]];
-        $where[] = ["delete", "=", 0];
-        //获取字典表人才层次
-        $levelMap = DictApi::selectByParentCode("talent_arrange");
-        $typeMap = DictApi::selectByParentCode("enterprise_tag");
-        $count = TqModel::where($where)->count();
-        $list = TqModel::where($where)->limit($offset, $limit)->order("createTime {$order}")->select()->toArray();
-        foreach ($list as $key => $item) {
-            $list[$key]["talentArrangeName"] = $levelMap[$item["talentArrange"]];
-            $list[$key]["talentTypeName"] = $typeMap[$item["talentType"]];
-        }
+        $count = EcaModel::where($where)->count();
+        $list = EcaModel::where($where)->limit($offset, $limit)->order("createTime {$order}")->select()->toArray();
 
         return json(["rows" => $list, "total" => $count]);
     }
 
     public function check() {
         $id = $this->request["id"];
-        $info = TqModel::where("id", $id)->find();
-        $info["talentArrangeName"] = DictApi::selectByParentCode("talent_arrange")[$info["talentArrange"]];
-        if (\StrUtil::isNotEmpAndNull($info["talentType"])) {
-            $info["talentTypeName"] = DictApi::selectByParentCode("enterprise_tag")[$info["talentType"]];
+        $info = EcaModel::where("id", $id)->find();
+        $files = json_decode($info["files"], true);
+        $fileTmp = [];
+        foreach ($files as $file) {
+            $ext = pathinfo($file)["extension"];
+            $fileTmp[] = ["ext" => $ext, "path" => $file];
         }
+        $info["files"] = $fileTmp;
         return view("check", ["type" => $this->user["type"], "row" => $info]);
     }
 
@@ -52,7 +50,7 @@ class EnterpriseCloseAccount extends AdminController {
         $id = $this->request["id"];
         $checkState = $this->request["checkState"];
         $checkMsg = $this->request["checkMsg"];
-        $info = TqModel::where("id", $id)->find();
+        $info = EcaModel::where("id", $id)->find();
         if (!$info) {
             $responseObj->msg = "系统错误,请联系管理员";
             return $responseObj;
@@ -66,38 +64,28 @@ class EnterpriseCloseAccount extends AdminController {
             //添加日志
             $user = $this->user;
             $log["id"] = getStringId();
+            $log["category"] = "enterprise_change";
             $log["active"] = 1;
             $log["state"] = $checkState;
-            $log["step"] = 11;
+            $log["step"] = 101;
             $log["stateChange"] = MainState::getStateName($info["checkState"]) . "->" . MainState::getStateName($checkState);
-            $log["type"] = ProjectState::QUIT;
+            $log["type"] = 10;
             $log["mainId"] = $id;
             $log["description"] = $checkMsg;
             $log["createUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
             $log["createTime"] = date("Y-m-d H:i:s");
-            $updTalentQuit["id"] = $id;
-            $updTalentQuit["checkState"] = $checkState;
-            $updTalentQuit["checkMsg"] = $checkMsg;
+            $updEca["id"] = $id;
+            $updEca["checkState"] = $checkState;
+            $updEca["checkMsg"] = $checkMsg;
             if ($checkState == 3) {
-                //修改人才库信息
-                $upd["id"] = $info["talentId"];
-                $upd["active"] = 2;
-                $upd["cur_quit_time"] = $info["quitTime"];
-                Db::table("new_talent_info")->save($upd);
-
-                $talentLog["id"] = getStringId();
-                $talentLog["active"] = 1;
-                $talentLog["step"] = 22;
-                $talentLog["type"] = ProjectState::TALENT;
-                $talentLog["mainId"] = $info["talentId"];
-                $talentLog["description"] = "离职变更通过,同步到人才库";
-                $talentLog["createUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
-                $talentLog["createTime"] = date("Y-m-d H:i:s");
-                Db::table("new_talent_checklog")->insert($talentLog);
-                $updTalentQuit["passTime"] = date("Y-m-d H:i:s");
+                $upd["id"] = $info["enterpriseId"];
+                $upd["delete"] = 1;
+                Db::table("un_enterprise")->save($upd);
+
+                $updEca["passTime"] = date("Y-m-d H:i:s");
             }
             Db::table("new_talent_checklog")->insert($log);
-            Db::table("un_talent_quit")->save($updTalentQuit);
+            Db::table("un_enterpriseclose_record")->save($updEca);
             $responseObj->code = 200;
             $responseObj->msg = "审核成功";
 
@@ -112,32 +100,18 @@ class EnterpriseCloseAccount extends AdminController {
 
     public function export() {
         $request = $this->request;
-        $data["talentName"] = \StrUtil::getRequestDecodeParam($request, "talentName");
+        $data["name"] = \StrUtil::getRequestDecodeParam($request, "name");
         $data["idCard"] = \StrUtil::getRequestDecodeParam($request, "idCard");
-        $data["enterpriseName"] = \StrUtil::getRequestDecodeParam($request, "enterpriseName");
-        $data["talentArrange"] = \StrUtil::getRequestDecodeParam($request, "talentArrange");
         $data["checkState"] = \StrUtil::getRequestDecodeParam($request, "checkState");
-        $where = $this->setTalentQuit($data);
+        $where = $this->setFilter($data);
         $where[] = ["type", "=", $this->user["type"]];
-        $where[] = ["delete", "=", 0];
-
-        $list = TqModel::where($where)->select()->toArray();
-        $levelMap = DictApi::selectByParentCode("talent_arrange");
-
-        if ($this->user["type"] == 1) {
-            $title = ["姓名", "证件号码", "工作单位", "人才层次", "认定时间", "合同开始时间", "合同截止时间", "入职时间", "离职时间", "离职申报原因",
-                "手机号码", "审核状态", "审核意见", "审核通过时间"];
-            $keys = ["talentName", "idCard", "enterpriseName", "talentArrangeName", "identifyTime", "starttime", "endtime", "entryTime", "quitTime", "quitReason",
-                "phone", "checkStateName", "checkMsg", "passTime"];
-        } else {
-            $title = ["姓名", "证件号码", "工作单位", "人才层次", "认定时间", "合同开始时间", "合同截止时间", "入职时间", "离职时间",
-                "手机号码", "审核状态", "审核意见", "审核通过时间"];
-            $keys = ["talentName", "idCard", "enterpriseName", "talentArrangeName", "identifyTime", "starttime", "endtime", "entryTime", "quitTime",
-                "phone", "checkStateName", "checkMsg", "passTime"];
-        }
+
+        $list = EcaModel::where($where)->select()->toArray();
+
+        $title = ["单位名称", "统一社会信用代码", "登录账号", "注销原因", "审核状态", "审核意见", "审核通过时间"];
+        $keys = ["name", "idCard", "username", "reason", "checkStateName", "checkMsg", "passTime"];
         $rows = [];
         foreach ($list as &$item) {
-            $item["talentArrangeName"] = $levelMap[$item["talentArrange"]];
             switch ($item["checkState"]) {
                 case -1:
                     $item["checkStateName"] = "待提交";
@@ -165,26 +139,20 @@ class EnterpriseCloseAccount extends AdminController {
         if (!$rows) {
             return json(["msg" => "没有可导出的内容"]);
         }
-        $fileName = "离职变更列表";
+        $fileName = "账户注销申请列表";
         export($title, $rows, $fileName);
     }
 
-    private function setTalentQuit($talentQuitInfo) {
+    private function setFilter($params) {
         $where = [];
-        if (\StrUtil::isNotEmpAndNull($talentQuitInfo["talentName"])) {
-            $where[] = ["talentName", "=", $talentQuitInfo["talentName"]];
-        }
-        if (\StrUtil::isNotEmpAndNull($talentQuitInfo["idCard"])) {
-            $where[] = ["idCard", "=", $talentQuitInfo["IdCard"]];
-        }
-        if (\StrUtil::isNotEmpAndNull($talentQuitInfo["enterpriseName"])) {
-            $where[] = ["enterpriseName", "=", $talentQuitInfo["enterpriseName"]];
+        if (\StrUtil::isNotEmpAndNull($params["idCard"])) {
+            $where[] = ["idCard", "=", $params["IdCard"]];
         }
-        if (\StrUtil::isNotEmpAndNull($talentQuitInfo["talentArrange"])) {
-            $where[] = ["talentArrange", "=", $talentQuitInfo["talentArrange"]];
+        if (\StrUtil::isNotEmpAndNull($params["name"])) {
+            $where[] = ["name", "=", $params["name"]];
         }
-        if ($talentQuitInfo["checkState"] != null) {
-            $where[] = ["checkState", "=", $talentQuitInfo["checkState"]];
+        if ($params["checkState"] != null) {
+            $where[] = ["checkState", "=", $params["checkState"]];
         }
         return $where;
     }

+ 139 - 0
app/admin/view/enterprise_close_account/check.html

@@ -0,0 +1,139 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+    .spacing {
+        margin-bottom: 10px;
+        padding-right:4px;
+        padding-left: 4px;
+    }
+    #talentInfoForm label {
+        font-size: xx-small;
+    }
+    .imgs li{
+        list-style: none;
+        float: left;
+        border: 1px solid #d8d1d1;
+        text-align: center;
+        height: 30px;
+    }
+    .layui-layer-btn .layui-layer-btn1 {
+        border-color: #009688;
+        background-color: #009688;
+        color: #fff;
+    }
+    #fileList li{width:80px;height:80px;float:left;margin:10px;overflow:hidden;}
+    #fileList li img{width:80px;}
+</style>
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <div class="form-horizontal">
+            <div class="row">
+                <div class="col-sm-12" >
+                    <div class="tabs-container" >
+                        <ul class="nav nav-tabs">
+                            <li  class="" style="float: right;">
+                                <button type="button" class="btn btn-sm btn-primary " onclick="TalentQuitInfoDlg.download()" >
+                                    <i class="fa fa-download"></i>&nbsp;打包下载
+                                </button>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="tab-content">
+                        <div id="tab-1" class="tab-pane active">
+                            <div class="panel-body" >
+                                <div class="panel panel-default">
+                                    <div class="panel-heading" onclick="$(this).next().toggle()">基础信息</div>
+                                    <div class="panel-body">
+                                        <form id="talentQuitForm">
+                                            <div class="col-sm-12 form-group-sm">
+                                                <input type="hidden" id="id" name="id" value="{$row.id}"/>
+                                                <input type="hidden" id="type" name="type" value="{$row.type}"/>
+                                                <input type="hidden" id="checkState" name="checkState" value="{$row.checkState}"/>
+                                                <input type="hidden" id="enterpriseId" name="enterpriseId" value="{$row.enterpriseId}"/>
+                                                <input type="hidden" id="talentId" name="talentId" value="{$row.talentId}"/>
+                                                <input type="hidden" id="year" name="year" value="{$row.year}">
+                                                <div class="rowGroup col-sm-12">
+                                                    <label class="col-sm-2 control-label spacing">
+                                                        {switch name="row.type"}
+                                                        {case value="5"}
+                                                        医院名称
+                                                        {/case}
+                                                        {case value="6"}
+                                                        学校名称
+                                                        {/case}
+                                                        {default/}
+                                                        企业/单位名称
+                                                        {/switch}
+                                                    </label>
+                                                    <div class="col-sm-6 spacing">
+                                                        <input class="form-control" id="name" name="name" readonly="readonly" value="{$row.name}">
+                                                    </div>
+                                                </div>
+                                                <div class="rowGroup col-sm-12">
+                                                    <label class="col-sm-2 control-label spacing">账号</label>
+                                                    <div class="col-sm-6 spacing">
+                                                        <input class="form-control" id="username" readonly="readonly" name="username" value="{$row.username}"/>
+                                                    </div>
+                                                </div>
+                                                <div class="rowGroup col-sm-12">
+                                                    <label class="col-sm-2 control-label spacing">证件号码</label>
+                                                    <div class="col-sm-6 spacing">
+                                                        <input class="form-control" id="idCard" readonly="readonly" name="idCard" value="{$row.idCard}"/>
+                                                    </div>
+                                                </div>
+                                                <div class="rowGroup col-sm-12">
+                                                    <label class="col-sm-2 control-label spacing">注销原因</label>
+                                                    <div class="col-sm-6 spacing">
+                                                        <textarea class="form-control" id="reason" readonly="readonly" name="reason" rows="5">{$row.reason}</textarea>
+                                                    </div>
+                                                </div>
+                                                <div class="rowGroup col-sm-12">
+                                                    <label class="col-sm-2 control-label spacing">附件</label>
+                                                    <div class="col-sm-6 spacing" id="fileList">
+                                                        <ul>
+                                                            {volist name="row.files" id="file"}
+                                                            <li>
+                                                                {if condition="strtoupper($file['ext']) eq 'PDF'"}
+                                                                <img src="/static/img/Pdf.png" onclick="Feng.showPdf('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                {if condition="in_array(strtoupper($file['ext']),['XLS','XLSX'])"}
+                                                                <img src="/static/img/File.png" onclick="Feng.showExcel('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                <img src="{$file.path|getStoragePath}" onclick="Feng.showImg(this);"/>
+                                                                {/if}
+                                                                {/if}
+                                                            </li>
+                                                            {/volist}
+                                                        </ul>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                                <div class="panel panel-default">
+                                    <div class="panel-heading" onclick="$(this).next().toggle()">日志</div>
+                                    <table id="logTable">
+                                    </table>
+                                </div>
+                            </div>
+                        </div>
+                        <div id="tab-2" class="tab-pane ">               
+                            <table id="fileTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                                <thead>
+                                    <tr>
+                                        <th data-field="selectItem" data-checkbox="true"></th>
+                                    </tr>
+                                </thead>
+                            </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/enterprise/closeAccountRecord/closeAccount_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 96 - 0
app/admin/view/enterprise_close_account/index.html

@@ -0,0 +1,96 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>账号注销审核</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+                            <input type="hidden" id="type" value="{$type}">
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">统一社会信用代码
+                                        </button>
+                                    </div>
+                                    <input type="text" class="form-control" id="idCard" placeholder="">
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">单位名称
+                                        </button>
+                                    </div>
+                                    <input type="text" class="form-control" id="name" placeholder="">
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                            审核状态
+                                        </button>
+                                    </div>
+                                    <select class="form-control" id="checkState">
+                                        <option value="">请选择</option>
+                                        <option value="-1">待提交</option>
+                                        <option value="1">待审核</option>
+                                        <option value="9">重新提交</option>
+                                        <option value="2">已驳回</option>
+                                        <option value="3">已通过</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentQuit.search()">
+                                    <i class="fa fa-search"></i>&nbsp;搜索
+                                </button>
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentQuit.reset()">
+                                    <i class="fa fa-trash"></i>&nbsp;重置
+                                </button>
+                            </div>
+                        </div>
+                        <div class="hidden-xs" id="TalentQuitTableToolbar" role="group">
+                            {if condition="chkCommission('/admin/enterpriseCloseAccount/check','/enterpriseCloseAccount/check')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentQuit.openTalentQuitCheck()">
+                                <i class="fa fa-check"></i>&nbsp;审核
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/enterpriseCloseAccount/export','/enterpriseCloseAccount/export')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentQuit.export()">
+                                <i class="fa fa-file-excel-o"></i>&nbsp;导出
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/enterpriseCloseAccount/download','/enterpriseCloseAccount/download')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentQuit.download()">
+                                <i class="fa fa-download"></i>&nbsp;下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/enterpriseCloseAccount/detail','/enterpriseCloseAccount/detail')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentQuit.openTalentQuitDetail()">
+                                <i class="fa fa-eye"></i>&nbsp;查看
+                            </button>
+                            {/if}
+                        </div>
+                        <table id="TalentQuitTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                            <thead>
+                                <tr>
+                                    <th data-field="selectItem" data-checkbox="true"></th>
+                                </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/enterprise/closeAccountRecord/closeAccount.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 16 - 0
app/common/model/EnterpriseCloseAccount.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace app\common\model;
+
+use think\model;
+
+/**
+ * Description of EnterpriseCloseAccount
+ *
+ * @author sgq
+ */
+class EnterpriseCloseAccount extends model {
+
+    protected $table = "un_enterpriseclose_record";
+
+}

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

@@ -1169,7 +1169,7 @@ class Api extends EnterpriseController {
                 'active' => 1,
                 'state' => 1,
                 'step' => 100,
-                'stateChange' => '',
+                'stateChange' => $record["checkState"] == 2 ? "<span class='label label-danger'>审核驳回</span>-><span class='label label-success'>待审核</span>" : "<span class='label label-success'>待审核</span>",
                 'description' => $record["checkState"] == 2 ? '用户重新提交账户注销申请' : '用户提交账户注销申请',
                 'createTime' => date("Y-m-d H:i:s"),
                 'createUser' => $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统"
@@ -1177,6 +1177,7 @@ class Api extends EnterpriseController {
 
             $res = Db::table("new_talent_checklog")->insert($newLog);
             $response->msg = "注销申请提交成功,请耐心等待审核";
+            $response->checkState = $data["checkState"];
             $response->code = 200;
             Db::commit();
             return \StrUtil::back($response, "EnterpriseCenter.callback");

+ 8 - 3
app/enterprise/controller/Index.php

@@ -157,12 +157,17 @@ class Index extends EnterpriseController {
         }
 
         $where = [];
-        $where[] = ["enterpriseId", "=", $this->user["id"]];
+        $where[] = ["enterpriseId", "=", $this->user["uid"]];
         $closeAccountRecord = \think\facade\Db::table("un_enterpriseclose_record")->where($where)->order("createTime desc")->find();
         if ($closeAccountRecord["files"]) {
-            $closeAccountRecord["files"] = json_decode($closeAccountRecord["files"], true);
+            $files = json_decode($closeAccountRecord["files"], true);
+            $fileTmp = [];
+            foreach ($files as $file) {
+                $ext = pathinfo($file)["extension"];
+                $fileTmp[] = ["ext" => $ext, "path" => $file];
+            }
+            $closeAccountRecord["files"] = $fileTmp;
         }
-
         return view($template, ['ep' => $ep, 'closeAccountRecord' => $closeAccountRecord]);
     }
 

+ 43 - 5
app/enterprise/view/index/center_page.html

@@ -387,7 +387,21 @@
                             <div id="tab-5" class="tab-pane">
                                 <div class="panel-body" style="width:900px;">
                                     <form id="EpCloseForm" autocomplete="off" action="/enterprise/api/closeAccount" method="post" enctype="multipart/form-data" target="hiddenIframe">
-                                        <br/>
+                                        <input type="hidden" id="closeAccountState" value="{$closeAccountRecord.checkState}"/>
+                                        {eq name="closeAccountRecord.checkState" value="2"}
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">驳回意见</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="color:#ff0000;">
+                                                            {$closeAccountRecord.checkMsg}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        {/eq}
                                         <div class="row m-b-sm">
                                             <div class="col-sm-12">
                                                 <div class="rowGroup">
@@ -431,7 +445,7 @@
                                                 <div class="rowGroup">
                                                     <label class="col-sm-2 control-label">注销原因</label>
                                                     <div class="col-sm-10">
-                                                        <textarea class="form-control" rows="5" id="reason" name="reason"></textarea>
+                                                        <textarea class="form-control" rows="5" id="reason" name="reason" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}readonly{/if}>{$closeAccountRecord.reason}</textarea>
                                                     </div>
                                                 </div>
                                             </div>
@@ -441,12 +455,24 @@
                                                 <div class="rowGroup">
                                                     <label class="col-sm-2 control-label">附件</label>
                                                     <div class="col-sm-10">
-                                                        <button type="button" id="close-uploader-btn" class="btn" onclick="$('#close-uploader').click();">上传附件</button>
+                                                        <button type="button" id="close-uploader-btn" class="btn" onclick="$('#close-uploader').click();" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}disabled{/if}>上传附件</button>
                                                         <input type="file" multiple="" id="close-uploader" name="closeAccountFiles[]" class="btn" style="display:none;" />
                                                     </div>
                                                     <div id="fileList">
                                                         <ul>
-                                                            
+                                                            {volist name="closeAccountRecord.files" id="file"}
+                                                            <li>
+                                                                {if condition="strtoupper($file['ext']) eq 'PDF'"}
+                                                                <img src="/static/img/Pdf.png" onclick="Feng.showPdf('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                {if condition="in_array(strtoupper($file['ext']),['XLS','XLSX'])"}
+                                                                <img src="/static/img/File.png" onclick="Feng.showExcel('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                <img src="{$file.path|getStoragePath}" onclick="Feng.showImg(this);"/>
+                                                                {/if}
+                                                                {/if}
+                                                            </li>
+                                                            {/volist}
                                                         </ul>
                                                     </div>
                                                 </div>
@@ -454,7 +480,19 @@
                                         </div>
                                         <br/>
                                         <div style="width:100%; text-align: center;">
-                                            <button type="button" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">注销账号</button>
+                                            {switch name="closeAccountRecord.checkState"}
+                                            {case value="1"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="9"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="2"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">重新提交</button>
+                                            {/case}
+                                            {default/}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">注销账号</button>
+                                            {/switch}
                                         </div>
                                     </form>
                                     <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>

+ 115 - 0
app/enterprise/view/index/hospital/center_page.html

@@ -38,6 +38,7 @@
                             <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本信息</a></li>
                             <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">医院信息变更</a></li>
                             <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">修改密码</a></li>
+                            <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">账号注销</a></li>
                             <!--              <li class="" ><a data-toggle="tab" href="#tab-4" aria-expanded="false">绑定聚才网账号</a></li>-->
                         </ul>
                         <div class="tab-content">
@@ -308,6 +309,120 @@
                                     </div>
                                 </div>
                             </div>
+                            <div id="tab-5" class="tab-pane">
+                                <div class="panel-body" style="width:900px;">
+                                    <form id="EpCloseForm" autocomplete="off" action="/enterprise/api/closeAccount" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                                        <input type="hidden" id="closeAccountState" value="{$closeAccountRecord.checkState}"/>
+                                        {eq name="closeAccountRecord.checkState" value="2"}
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">驳回意见</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="color:#ff0000;">
+                                                            {$closeAccountRecord.checkMsg}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        {/eq}
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">账号</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.username}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">医院名称</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.name}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">登记号</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.idCard}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <br/>
+                                        <div class="hr-line-dashed"></div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">注销原因</label>
+                                                    <div class="col-sm-10">
+                                                        <textarea class="form-control" rows="5" id="reason" name="reason" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}readonly{/if}>{$closeAccountRecord.reason}</textarea>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">附件</label>
+                                                    <div class="col-sm-10">
+                                                        <button type="button" id="close-uploader-btn" class="btn" onclick="$('#close-uploader').click();" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}disabled{/if}>上传附件</button>
+                                                        <input type="file" multiple="" id="close-uploader" name="closeAccountFiles[]" class="btn" style="display:none;" />
+                                                    </div>
+                                                    <div id="fileList">
+                                                        <ul>
+                                                            {volist name="closeAccountRecord.files" id="file"}
+                                                            <li>
+                                                                {if condition="strtoupper($file['ext']) eq 'PDF'"}
+                                                                <img src="/static/img/Pdf.png" onclick="Feng.showPdf('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                {if condition="in_array(strtoupper($file['ext']),['XLS','XLSX'])"}
+                                                                <img src="/static/img/File.png" onclick="Feng.showExcel('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                <img src="{$file.path|getStoragePath}" onclick="Feng.showImg(this);"/>
+                                                                {/if}
+                                                                {/if}
+                                                            </li>
+                                                            {/volist}
+                                                        </ul>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <br/>
+                                        <div style="width:100%; text-align: center;">
+                                            {switch name="closeAccountRecord.checkState"}
+                                            {case value="1"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="9"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="2"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">重新提交</button>
+                                            {/case}
+                                            {default/}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">注销账号</button>
+                                            {/switch}
+                                        </div>
+                                    </form>
+                                    <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>

+ 115 - 0
app/enterprise/view/index/school/center_page.html

@@ -38,6 +38,7 @@
                             <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本信息</a></li>
                             <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">学校信息变更</a></li>
                             <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">修改密码</a></li>
+                            <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">账号注销</a></li>
                             <!--              <li class="" ><a data-toggle="tab" href="#tab-4" aria-expanded="false">绑定聚才网账号</a></li>-->
                         </ul>
                         <div class="tab-content">
@@ -268,6 +269,120 @@
                                     </div>
                                 </div>
                             </div>
+                            <div id="tab-5" class="tab-pane">
+                                <div class="panel-body" style="width:900px;">
+                                    <form id="EpCloseForm" autocomplete="off" action="/enterprise/api/closeAccount" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                                        <input type="hidden" id="closeAccountState" value="{$closeAccountRecord.checkState}"/>
+                                        {eq name="closeAccountRecord.checkState" value="2"}
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">驳回意见</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="color:#ff0000;">
+                                                            {$closeAccountRecord.checkMsg}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        {/eq}
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">账号</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.username}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">学校名称</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.name}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">统一社会信用代码</label>
+                                                    <div class="col-sm-10">
+                                                        <div class="form-control" style="background:#f2f2f2;">
+                                                            {$ep.idCard}
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <br/>
+                                        <div class="hr-line-dashed"></div>
+                                        <div class="row m-b-sm">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">注销原因</label>
+                                                    <div class="col-sm-10">
+                                                        <textarea class="form-control" rows="5" id="reason" name="reason" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}readonly{/if}>{$closeAccountRecord.reason}</textarea>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row">
+                                            <div class="col-sm-12">
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-2 control-label">附件</label>
+                                                    <div class="col-sm-10">
+                                                        <button type="button" id="close-uploader-btn" class="btn" onclick="$('#close-uploader').click();" {if condition="in_array($closeAccountRecord['checkState'],[1,9])"}disabled{/if}>上传附件</button>
+                                                        <input type="file" multiple="" id="close-uploader" name="closeAccountFiles[]" class="btn" style="display:none;" />
+                                                    </div>
+                                                    <div id="fileList">
+                                                        <ul>
+                                                            {volist name="closeAccountRecord.files" id="file"}
+                                                            <li>
+                                                                {if condition="strtoupper($file['ext']) eq 'PDF'"}
+                                                                <img src="/static/img/Pdf.png" onclick="Feng.showPdf('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                {if condition="in_array(strtoupper($file['ext']),['XLS','XLSX'])"}
+                                                                <img src="/static/img/File.png" onclick="Feng.showExcel('{$file.path|getStoragePath}');"/>
+                                                                {else/}
+                                                                <img src="{$file.path|getStoragePath}" onclick="Feng.showImg(this);"/>
+                                                                {/if}
+                                                                {/if}
+                                                            </li>
+                                                            {/volist}
+                                                        </ul>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <br/>
+                                        <div style="width:100%; text-align: center;">
+                                            {switch name="closeAccountRecord.checkState"}
+                                            {case value="1"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="9"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" disabled>审核中</button>
+                                            {/case}
+                                            {case value="2"}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">重新提交</button>
+                                            {/case}
+                                            {default/}
+                                            <button type="button" id="closeAccountBtn" class="btn btn-w-m btn-primary" style="width:200px;" onclick="EnterpriseCenter.closeAccount()">注销账号</button>
+                                            {/switch}
+                                        </div>
+                                    </form>
+                                    <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>

+ 2 - 1
app/index/controller/Auth.php

@@ -36,7 +36,8 @@ class Auth extends BaseController {
             $usertype = $this->request["usertype"];
             $captcha = $this->request["captcha"];
             $user = new UserApi($username, $pwd, $usertype);
-            if (!$userinfo = $user->getUserInfo()) {
+            $userinfo = $user->getUserInfo();
+            if (!$userinfo || $userinfo["delete"] == 1) {
                 $msg = "用户不存在";
             } else if (!$user->checkPwd()) {
                 $login_fail = session('login_fail');

+ 208 - 0
public/static/modular/enterprise/closeAccountRecord/closeAccount.js

@@ -0,0 +1,208 @@
+/**
+ * 离职管理管理初始化
+ */
+var TalentQuit = {
+    id: "TalentQuitTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+TalentQuit.initColumn = function () {
+    var type = $("#type").val();
+    var idCardTypeName = "统一社会信用代码";
+    var coTypeName = "企业/单位名称";
+    switch (type) {
+        case 5:
+            idCardTypeName = "登记号";
+            coTypeName = "医院名称";
+            break;
+        case 6:
+            coTypeName = "学校名称";
+            break;
+    }
+    if (type == 5) {
+        idCardTypeName = "登记号";
+    }
+    return [
+        {field: 'selectItem', radio: true},
+        {title: coTypeName, field: 'name', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'},
+        {title: idCardTypeName, field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
+        {title: '账号', field: 'username', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
+        {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
+        {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
+        {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "80px",
+            formatter: function (value, row, index) {
+                if (value == -1) {
+                    return '<span class=\'label\'>待提交</span>';
+                }
+                if (value == 1) {
+                    return '<span class=\'label label-success\'>待审核</span>';
+                }
+                if (value == 2) {
+                    return '<span class=\'label label-danger\'>已驳回</span>';
+                }
+                if (value == 3) {
+                    return '<span class=\'label label-primary\'>已通过</span>';
+                }
+                if (value == 9) {
+                    return '<span class=\'label label-success\'>重新提交</span>';
+                }
+            }
+        },
+        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
+            formatter: function (value, row, index) {
+                return "<span class='label label-success' onclick=\"TalentQuit.showLog('" + value + "')\" >" +
+                        "<i class=\"fa fa-book\"></i>日志" +
+                        "</span>";
+            }
+        },
+    ];
+};
+
+/**
+ * 检查是否选中
+ */
+TalentQuit.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length == 0) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    } else {
+        TalentQuit.seItem = selected[0];
+        return true;
+    }
+};
+
+
+/**
+ * 打开查看离职管理审核页面
+ */
+TalentQuit.openTalentQuitCheck = function () {
+    if (this.check()) {
+        if (TalentQuit.seItem.checkState != 1 && TalentQuit.seItem.checkState != 9) {
+            Feng.info("不在审核范围内");
+            return;
+        }
+        var index = layer.open({
+            type: 2,
+            title: '账号注销审核',
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.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) {
+                var obj = layero.find("iframe")[0].contentWindow;
+                obj.TalentQuitInfoDlg.submitCheck();
+            }
+
+        });
+        TalentQuit.layerIndex = index;
+        layer.full(index);
+    }
+};
+
+/**
+ * 打开查看离职管理页面
+ */
+TalentQuit.openTalentQuitDetail = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '账号注销详情',
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.seItem.id
+        });
+        TalentQuit.layerIndex = index;
+        layer.full(index);
+    }
+};
+
+
+/**
+ * 查询表单提交参数对象
+ * @returns {{}}
+ */
+TalentQuit.formParams = function () {
+    var queryData = {};
+    queryData['talentName'] = $("#talentName").val();
+    queryData['idCard'] = $("#idCard").val();
+    queryData['enterpriseName'] = $("#enterpriseName").val();
+    queryData['talentArrange'] = $("#talentArrange").val();
+    queryData['checkState'] = $("#checkState").val();
+    return queryData;
+}
+
+/**
+ * 重置
+ */
+TalentQuit.reset = function () {
+    $("#talentName").val("");
+    $("#idCard").val("");
+    $("#enterpriseName").val("");
+    $("#talentArrange").val("");
+    $("#checkState").val("");
+}
+
+
+/**
+ * 查询离职管理列表
+ */
+TalentQuit.search = function () {
+    TalentQuit.table.refresh({query: TalentQuit.formParams()});
+};
+
+/**
+ * 导出
+ */
+TalentQuit.export = function () {
+    var queryData = TalentQuit.formParams();
+    var url = Feng.ctxPath + "/admin/enterpriseCloseAccount/export?" +
+            "&talentName=" + queryData.talentName +
+            "&idCard=" + queryData.idCard +
+            "&enterpriseName=" + queryData.enterpriseName +
+            "&talentArrange=" + queryData.talentArrange +
+            "&checkState=" + queryData.checkState;
+    window.location.href = encodeURI(encodeURI(url));
+}
+
+
+/**
+ * 打包下载附件
+ */
+TalentQuit.download = function () {
+    if (this.check()) {
+        window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=3&id=" + TalentQuit.seItem.id));
+    }
+}
+
+
+/**
+ * 显示审核日志
+ */
+TalentQuit.showLog = function (id) {
+    layer.open({
+        type: 1,
+        title: "日志",
+        fixed: false,
+        content: '<table id="' + id + '"></table>',
+        area: ['80%', '80%'],
+        maxmin: true,
+        success: function (layero, index) {
+            Feng.getCheckLog(id, {"type": 10, "mainId": id, "typeFileId": "", "active": 1})
+        }
+    });
+
+}
+
+$(function () {
+    var defaultColunms = TalentQuit.initColumn();
+    var table = new BSTable(TalentQuit.id, "/admin/enterpriseCloseAccount/list", defaultColunms);
+    table.setPaginationType("server");
+    TalentQuit.table = table.init();
+});

+ 214 - 0
public/static/modular/enterprise/closeAccountRecord/closeAccount_info.js

@@ -0,0 +1,214 @@
+/**
+ * 初始化离职管理详情对话框
+ */
+var TalentQuitInfoDlg = {
+    talentQuitInfoData: {}
+};
+
+
+/**
+ * 关闭此对话框
+ */
+TalentQuitInfoDlg.close = function () {
+    parent.layer.close(window.parent.TalentQuit.layerIndex);
+}
+
+//附件初始化
+TalentQuitInfoDlg.initFileTable = function () {
+    var queryData = {};
+    queryData['project'] = CONFIG.project_quit;
+    queryData['type'] = $("#type").val();
+    $("#fileTable").bootstrapTable({
+        url: Feng.ctxPath + "/common/api/findCommonFileType",
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false, // 是否显示刷新按钮
+        clickToSelect: true, // 是否启用点击选中行
+        singleSelect: true, // 设置True 将禁止多选
+        striped: true, // 是否显示行间隔色
+        escape: true,
+        pagination: false, // 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        showColumns: false,
+        detailView: true, //是否显示父子表
+        pageList: [10, 30, 50],
+        queryParams: function (params) {
+            return $.extend(queryData, params)
+        },
+        rowStyle: function (row, index) {
+            return {classes: "info"};
+        },
+        columns:
+                [
+                    {field: 'selectItem', checkbox: false, visible: false},
+                    {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%", 'class': 'uitd_showTip',
+                        formatter: function (value, row, index) {
+                            if (row.must == 1) {
+                                return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
+                            }
+                            if (row.must == 2) {
+                                return '<i class="fa fa-paste"></i>' + value;
+                            }
+                        }
+                    },
+                    {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
+                        formatter: function (value, row, index) {
+                            if (value == null || value == '' || value == 'null') {
+                                return '无';
+                            }
+                            return "<button type='button' onclick=\"TalentQuitInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                                    "<i class=\"fa fa-download\"></i>下载" +
+                                    "</button>";
+                        }
+                    },
+                ]
+        ,
+        onPostBody: function () {
+            $("td.uitd_showTip").bind("mouseover", function () {
+                var htm = $(this).html();
+                $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+            });
+        },
+        onLoadSuccess: function (data) {
+            $("#fileTable").bootstrapTable('expandAllRows');
+        },
+        onExpandRow: function (index, row, $detail) {
+            var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentCommonFile", function (data) {
+                if (data == null || data.length == 0) {
+                    return;
+                }
+                var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
+                for (var key in data) {
+                    var sn = data[key].url.lastIndexOf(".");
+                    var suffix = data[key].url.substring(sn + 1, data[key].url.length);
+                    var imgStr = "";
+                    if (suffix == "pdf" || suffix == "PDF") {
+                        imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
+                        imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else {
+                        imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
+                    }
+                    html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
+                            '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
+                            '<li style="width: 10%;">' + imgStr + '</li>\n' +
+                            "<li style='width: 10%;padding-top: 2px;'><button type='button' onclick=\"TalentQuitInfoDlg.downloadFile('" + data[key].id + "',2)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
+                }
+                html = html + '</ul>';
+                $detail.html(html);
+                $(".imgs").viewer({
+                    // toolbar:false,
+                    fullscreen: false
+                });
+            }, function (data) {
+                Feng.error("查询失败!" + data.responseJSON.message + "!");
+            });
+            var queryData = {};
+            queryData["mainId"] = $("#id").val();
+            queryData["typeId"] = row.id;
+            ajax.set(queryData);
+            ajax.start();
+        }
+    });
+}
+
+//下载
+TalentQuitInfoDlg.downloadFile = function (id, type) {
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type=" + type;
+}
+
+
+//提交审核
+TalentQuitInfoDlg.submitCheck = function () {
+    layer.open({
+        type: 1,
+        id: "checkModel",
+        title: '审核',
+        area: ['800px', '450px'], //宽高
+        fix: false, //不固定
+        shade: 0,
+        maxmin: true,
+        content: " <form id=\"checkForm\" style='margin: 5px'>\n" +
+                "                    <div class=\"form-group\">\n" +
+                "                        <label for=\"checkState\" class=\"control-label\">审核状态</label>\n" +
+                "                        <select class=\"form-control\" id=\"checkStateNow\" onchange=\"TalentQuitInfoDlg.toggleField()\">\n" +
+                "                            <option value=\"\"></option>\n" +
+                "                            <option value=\"3\">审核通过</option>\n" +
+                "                            <option value=\"2\">审核驳回</option>\n" +
+                "                        </select>\n" +
+                "                    </div>\n" +
+                "                    <div class=\"form-group\">\n" +
+                "                        <label for=\"msg\" class=\"control-label\">审核意见</label>\n" +
+                "                        <textarea class=\"form-control\" id=\"msg\" rows='6'></textarea>\n" +
+                "                    </div>\n" +
+                "                </form>",
+        btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+        btnAlign: 'c',
+        zIndex: layer.zIndex,
+        success: function () {
+            $("#checkForm")[0].reset();
+        },
+        yes: function (index, layero) {
+            var id = $("#id").val();
+            var checkState = $("#checkStateNow").val();
+            var msg = $("#msg").val();
+            if (checkState == null || checkState == '') {
+                Feng.error("请选择审核状态");
+                return;
+            }
+            if (msg == null || msg == '') {
+                Feng.error("请填写审核意见");
+                return;
+            }
+            var operation = function () {
+                var ajax = new $ax(Feng.ctxPath + "/admin/enterpriseCloseAccount/submitToCheck", function (data) {
+                    if (data.code == "200") {
+                        Feng.success(data.msg);
+                        window.parent.TalentQuit.table.refresh();
+                        layer.close(index);
+                        TalentQuitInfoDlg.close();
+                    } else {
+                        Feng.error(data.msg);
+                    }
+                }, function (data) {
+                    Feng.error("提交失败!" + data.responseJSON.message + "!");
+                });
+                ajax.setData({"id": id, "checkState": checkState, "checkMsg": msg});
+                ajax.start();
+            }
+            Feng.confirm("一旦提交,无法修改,确认提交审核吗?", operation);
+        }
+    });
+}
+
+
+TalentQuitInfoDlg.toggleField = function () {
+    var checkState = $("#checkStateNow").val();
+    if (checkState == 3) {
+        $("#msg").val("账户注销审核通过。");
+    } else if (checkState == 2) {
+        $("#msg").val("");
+    }
+}
+
+/**
+ * 打包下载
+ */
+TalentQuitInfoDlg.download = function () {
+    window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=3&id=" + $("#id").val()));
+}
+
+$(function () {
+    if (id != null && id != '') {
+        $("#fileLi").removeAttr("style");
+    } else {
+        $("#fileLi").attr("style", "pointer-events: none");
+    }
+    Feng.getCheckLog("logTable", {"type": 10, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
+    $("select").each(function () {
+        $(this).val($(this).attr("value"));
+    });
+});

+ 15 - 4
public/static/modular/gate/enterprise/enterprise_center.js

@@ -303,12 +303,12 @@ EnterpriseCenter.closeAccount = function () {
             Feng.info("注销原因不能为空");
             return;
         }
-        if ($("#fileList ul li").length() == 0 && document.getElementById("close-uploader").files.length == 0) {
+        if (typeof $("#fileList ul li") == "undefined" && document.getElementById("close-uploader").files.length == 0) {
             Feng.info("请上传附件");
             return;
         }
         if (!lock) {
-            //lock = true;
+            lock = true;
             $("#close-uploader-btn").prop("disabled", true);
         } else {
             Feng.info("不能重复点击");
@@ -317,11 +317,22 @@ EnterpriseCenter.closeAccount = function () {
         $("#EpCloseForm")[0].submit();
     })
 }
+EnterpriseCenter.setDisabled = function () {
+    $("#reason").prop("readonly", true);
+    $("#close-uploader-btn").prop("disabled", true);
+    $("#closeAccountBtn").prop("disabled", true).text("审核中");
+}
 
 EnterpriseCenter.callback = function (data) {
     lock = false;
-    $("#close-uploader-btn").removeAttr("disabled");
-    Feng.info(data.msg);
+    if (data.code == 200) {
+        Feng.success(data.msg);
+        EnterpriseCenter.setDisabled();
+        $("#closeAccountState").val(data.checkState);
+    } else {
+        Feng.error(data.msg);
+        $("#close-uploader-btn").removeAttr("disabled");
+    }
 }
 
 $("#close-uploader").change(function (e) {

+ 74 - 0
public/static/modular/gate/enterprise/hospital/enterprise_center.js

@@ -301,6 +301,80 @@ EnterpriseCenter.bindJcAccount = function () {
     ajax.start();
 }
 
+var lock = false;
+EnterpriseCenter.closeAccount = function () {
+    Feng.confirm("是否确定提交注销申请?", function () {
+        var reason = $("#reason").val().trim();
+        if (reason == "") {
+            Feng.info("注销原因不能为空");
+            return;
+        }
+        if (typeof $("#fileList ul li") == "undefined" && document.getElementById("close-uploader").files.length == 0) {
+            Feng.info("请上传附件");
+            return;
+        }
+        if (!lock) {
+            lock = true;
+            $("#close-uploader-btn").prop("disabled", true);
+        } else {
+            Feng.info("不能重复点击");
+            return;
+        }
+        $("#EpCloseForm")[0].submit();
+    })
+}
+EnterpriseCenter.setDisabled = function () {
+    $("#reason").prop("readonly", true);
+    $("#close-uploader-btn").prop("disabled", true);
+    $("#closeAccountBtn").prop("disabled", true).text("审核中");
+}
+
+EnterpriseCenter.callback = function (data) {
+    lock = false;
+    if (data.code == 200) {
+        Feng.success(data.msg);
+        EnterpriseCenter.setDisabled();
+        $("#closeAccountState").val(data.checkState);
+    } else {
+        Feng.error(data.msg);
+        $("#close-uploader-btn").removeAttr("disabled");
+    }
+}
+
+$("#close-uploader").change(function (e) {
+    var that = this;
+    var files = that.files;
+    var totalSize = 0;
+    for (var i = 0; i < files.length; i++) {
+        if (!Feng.chkFileInvalid(files[i], 5, 10)) {
+            return;
+        }
+        totalSize += files[i].size;
+    }
+    if (totalSize > 10 * 1024 * 1024) {
+        Feng.error("所有附件大小不能超过10MB");
+        return;
+    }
+    $("#fileList ul").html("");
+    for (var i = 0; i < files.length; i++) {
+        var file = files[i];
+        var imgSrc;
+        var reader = new FileReader();
+        reader.readAsDataURL(file);
+        reader.onload = function () {
+            if (Feng.isImg(file.type)) {
+                imgSrc = this.result;
+                var li = '<li><img src="' + imgSrc + '"/></li>';
+                $("#fileList ul").append(li);
+            } else {
+                var li = '<li><img src="/static/img/Pdf.png"/></li>';
+                $("#fileList ul").append(li);
+            }
+        };
+    }
+
+});
+
 $(function () {
     var defaultColunms = EnterpriseCenter.initColumn();
     var table = new BSTable(EnterpriseCenter.id, "/enterprise/api/findEnterpriseChangeByPage", defaultColunms);

+ 74 - 0
public/static/modular/gate/enterprise/school/enterprise_center.js

@@ -296,6 +296,80 @@ EnterpriseCenter.bindJcAccount = function () {
     ajax.start();
 }
 
+var lock = false;
+EnterpriseCenter.closeAccount = function () {
+    Feng.confirm("是否确定提交注销申请?", function () {
+        var reason = $("#reason").val().trim();
+        if (reason == "") {
+            Feng.info("注销原因不能为空");
+            return;
+        }
+        if (typeof $("#fileList ul li") == "undefined" && document.getElementById("close-uploader").files.length == 0) {
+            Feng.info("请上传附件");
+            return;
+        }
+        if (!lock) {
+            lock = true;
+            $("#close-uploader-btn").prop("disabled", true);
+        } else {
+            Feng.info("不能重复点击");
+            return;
+        }
+        $("#EpCloseForm")[0].submit();
+    })
+}
+EnterpriseCenter.setDisabled = function () {
+    $("#reason").prop("readonly", true);
+    $("#close-uploader-btn").prop("disabled", true);
+    $("#closeAccountBtn").prop("disabled", true).text("审核中");
+}
+
+EnterpriseCenter.callback = function (data) {
+    lock = false;
+    if (data.code == 200) {
+        Feng.success(data.msg);
+        EnterpriseCenter.setDisabled();
+        $("#closeAccountState").val(data.checkState);
+    } else {
+        Feng.error(data.msg);
+        $("#close-uploader-btn").removeAttr("disabled");
+    }
+}
+
+$("#close-uploader").change(function (e) {
+    var that = this;
+    var files = that.files;
+    var totalSize = 0;
+    for (var i = 0; i < files.length; i++) {
+        if (!Feng.chkFileInvalid(files[i], 5, 10)) {
+            return;
+        }
+        totalSize += files[i].size;
+    }
+    if (totalSize > 10 * 1024 * 1024) {
+        Feng.error("所有附件大小不能超过10MB");
+        return;
+    }
+    $("#fileList ul").html("");
+    for (var i = 0; i < files.length; i++) {
+        var file = files[i];
+        var imgSrc;
+        var reader = new FileReader();
+        reader.readAsDataURL(file);
+        reader.onload = function () {
+            if (Feng.isImg(file.type)) {
+                imgSrc = this.result;
+                var li = '<li><img src="' + imgSrc + '"/></li>';
+                $("#fileList ul").append(li);
+            } else {
+                var li = '<li><img src="/static/img/Pdf.png"/></li>';
+                $("#fileList ul").append(li);
+            }
+        };
+    }
+
+});
+
 $(function () {
     var defaultColunms = EnterpriseCenter.initColumn();
     var table = new BSTable(EnterpriseCenter.id, "/enterprise/api/findEnterpriseChangeByPage", defaultColunms);