sugangqiang 2 năm trước cách đây
mục cha
commit
99f857df49

+ 3 - 2
app/common/api/MenuApi.php

@@ -214,8 +214,9 @@ class MenuApi {
 
         if ($ep["type"] == \app\common\state\CommonConst::ENTERPRISE_WJ && $ep["isGeneral"] == 1) {
             //总院增加菜单,审核分院
-            $menus[] = ["type" => [5], "code" => "yyss", "pcode" => "0", "name" => "医院审核", "url" => "#", "icon" => "fa-pencil-square-o", "status" => 1];
-            $menus[] = ["type" => [5], "code" => "yyyhss", "pcode" => "yyss", "name" => "注册审核", "url" => "/enterprise/hospital/list", "icon" => "fa-pencil-square-o", "status" => 1];
+            $menus[] = ["type" => [5], "code" => "yysh", "pcode" => "0", "name" => "医院审核", "url" => "#", "icon" => "fa-pencil-square-o", "status" => 1];
+            $menus[] = ["type" => [5], "code" => "yyzhsh", "pcode" => "yysh", "name" => "注册审核", "url" => "/enterprise/hospital/list", "icon" => "fa-pencil-square-o", "status" => 1];
+            $menus[] = ["type" => [5], "code" => "yyrcrdsh", "pcode" => "yysh", "name" => "优秀人才审核", "url" => "/enterprise/talent/examineCenter", "icon" => "fa-pencil-square-o", "status" => 1];
         }
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "yhfk", "pcode" => "0", "name" => "用户反馈", "url" => "", "icon" => "fa-bug", "status" => 1];
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "rcrd", "pcode" => "0", "name" => "人才认定", "url" => "#", "icon" => "fa-pencil-square-o", "status" => 1];

+ 5 - 2
app/common/api/Nhc.php

@@ -35,8 +35,11 @@ class Nhc {
         $where = [];
         $where[] = ["type", "=", \app\common\state\CommonConst::ENTERPRISE_WJ];
         $where[] = ["medicalCommunityId", "=", $medicalCommunityId];
-        $where[] = ["status", "=", 1];
-        return \app\admin\model\Enterprise::where($where)->find();
+        $where[] = ["isGeneral", "=", 1];
+        $where[] = ["checkState", "=", 3];
+        $where[] = ["active", "=", 1];
+        $where[] = ["delete", "=", 0];
+        return \app\admin\model\Enterprise::where($where)->find()->toArray();
     }
 
 }

+ 2 - 1
app/common/api/UserApi.php

@@ -199,7 +199,8 @@ class UserApi {
                     "rolename" => "企业用户",
                     "usertype" => $this->usertype,
                     "type" => $user["type"],
-                    "isGeneral" => $user["isGeneral"]
+                    "isGeneral" => $user["isGeneral"],
+                    "medicalCommunityId" => $user["medicalCommunityId"]
                 ]);
                 break;
             case 3:

+ 2 - 2
app/common/controller/Auth.php

@@ -226,7 +226,7 @@ class Auth extends BaseController {
                             $response_object->msg = '请上传人才联络员备案表';
                             return \StrUtil::back($response_object, "Register.epCallBack");
                         }
-                        if ($data["isGeneral"] == 1 || ($data["isGeneral"] == 0 && Nhc::hasGeneralHospital($data["medicalCommunityId"]))) {
+                        if ($data["isGeneral"] == 1 || ($data["isGeneral"] == 2 && !Nhc::hasGeneralHospital($data["medicalCommunityId"]))) {
                             $data["step"] = 1; //直接进入卫健复审
                             $data["checkState"] = 6; //初审通过
                         } else {
@@ -506,7 +506,7 @@ class Auth extends BaseController {
                         }
                         $idCardName = "医疗机构执业许可证";
 
-                        if ($data["isGeneral"] == 1 || ($data["isGeneral"] == 0 && Nhc::hasGeneralHospital($data["medicalCommunityId"]))) {
+                        if ($data["isGeneral"] == 1 || ($data["isGeneral"] == 2 && !Nhc::hasGeneralHospital($data["medicalCommunityId"]))) {
                             $data["step"] = 1; //直接进入卫健复审
                             $data["checkState"] = 6; //初审通过
                         } else {

+ 51 - 0
app/enterprise/api/TalentApi.php

@@ -187,4 +187,55 @@ class TalentApi {
         return ["total" => $count, "rows" => $list];
     }
 
+    public static function getHospitalExamineList($request) {
+        $user = session("user");
+        if ($user["isGeneral"] == 1) {
+            $order = trim($request->param("order")) ?: "desc";
+            $offset = trim($request->param("offset")) ?: 0;
+            $limit = trim($request->param("limit")) ?: 10;
+            $name = trim($request->param("name"));
+            $idCard = trim($request->param("card_number"));
+            $sex = trim($request->param("sex"));
+            $nation = trim($request->param("nation"));
+            $talentArrange = trim($request->param("talent_arrange"));
+            $checkState = trim($request->param("checkState"));
+            $where = [];
+            $where[] = ["ti.delete", "=", 0];
+            $where[] = ["e.type", "=", $user["type"]];
+            $where[] = ["e.isGeneral", "=", 2];
+            $where[] = ["e.medicalCommunityId", "=", $user["medicalCommunityId"]];
+            $where[] = ["ti.checkState", ">", TalentState::FST_SAVE];
+            if ($name) {
+                $where[] = ["ti.name", "like", "%" . $name . "%"];
+            }
+            if ($idCard) {
+                $where[] = ["ti.card_number", "like", "%" . $idCard . "%"];
+            }
+            if ($sex) {
+                $where[] = ["ti.sex", "=", $sex];
+            }
+            if ($nation) {
+                $where[] = ["ti.nation", "=", $nation];
+            }
+            if ($talentArrange) {
+                $where[] = ["ti.talent_arrange", "=", $talentArrange];
+            }
+            $count = Talent::where($where)->alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->count();
+            $list = Talent::where($where)->alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                            ->field("ti.*,e.name as enterpriseName,e.type")
+                            ->limit($offset, $limit)->order("ti.createTime " . $order)->select()->toArray();
+            $talentArangeList = DictApi::selectByParentCode("talent_arrange"); //人才层次
+            foreach ($list as $key => $item) {
+                $condition = TalentConditionApi::getOne($item["talent_condition"]);
+                $list[$key]["talentArrangeName"] = isset($talentArangeList[$item["talent_arrange"]]) ? $talentArangeList[$item["talent_arrange"]] : "";
+                $list[$key]["talentConditionName"] = $condition["name"];
+                $last_log = TalentLogApi::getLastLog($item["id"], 1, 0, ["active", "=", 1]);
+                $list[$key]["real_state"] = $last_log["state"];
+                $list[$key]["last_state"] = $last_log["last_state"];
+            }
+            return ["total" => $count, "rows" => $list];
+        }
+        return [];
+    }
+
 }

+ 250 - 26
app/enterprise/controller/Talent.php

@@ -101,14 +101,16 @@ class Talent extends EnterpriseController {
                         exit();
                         break;
                     case CommonConst::ENTERPRISE_WJ:
-                        if ($ep->isGeneral == 1) {
+                        if ($ep->isGeneral == 1 || ($ep->isGeneral == 2 && !\app\common\api\Nhc::hasGeneralHospital($ep->medicalCommunityId))) {
                             $this->wjSave($info, $request, TalentState::SCND_SAVE);
                         } else {
                             $this->wjSave($info, $request, TalentState::FST_SAVE);
                         }
+                        exit();
                         break;
                     case CommonConst::ENTERPRISE_GJ:
                         $this->gjSave($info, $request, TalentState::SCND_SAVE);
+                        exit();
                         break;
                 }
             } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL])) {
@@ -542,7 +544,9 @@ class Talent extends EnterpriseController {
         $params = $this->request->param();
         $id = $params["id"];
         if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
-            return json(["msg" => "没有对应的人才认定申报信息"]);
+            $res = ["msg" => "没有对应的人才认定申报信息"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+            exit;
         }
         if ($info) {
             $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
@@ -559,12 +563,14 @@ class Talent extends EnterpriseController {
             $no_empty = array_filter($no_empty);
             $return = [];
             foreach ($no_empty as $key) {
-                if (!$info[$key]) {
+                if (!$params[$key]) {
                     $return[] = sprintf("请填写“%s”", $field_dict[$key]);
                 }
             }
             if (count($return) > 0) {
-                return json(["msg" => implode("<br>", $return)]);
+                $res = ["msg" => implode("<br>", $return)];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
             }
             $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
             if ($condition_info["bindFileTypes"]) {
@@ -591,7 +597,9 @@ class Talent extends EnterpriseController {
             $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select()->toArray();
             $upload_type_counts = count($distinct_filetypes);
             if ($upload_type_counts != count($ft_ids)) {
-                return json(["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"]);
+                $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
             }
             if ($checkState == TalentState::FST_SAVE) {
                 return $this->wjSave($info, $this->request, TalentState::FST_SUBMIT);
@@ -599,9 +607,13 @@ class Talent extends EnterpriseController {
                 return $this->wjSave($info, $this->request, TalentState::SCND_SUBMIT);
             }
         } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL])) {
-            return json(["msg" => "审核不通过,不能再提交审核", "code" => 500]);
+            $res = ["msg" => "审核不通过,不能再提交审核", "code" => 500];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+            exit;
         }
-        return json(["msg" => "已提交审核,请耐心等待", "code" => 500]);
+        $res = ["msg" => "已提交审核,请耐心等待", "code" => 500];
+        echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+        exit;
     }
 
     /**
@@ -1074,7 +1086,11 @@ class Talent extends EnterpriseController {
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
                 exit();
             } else if ($checkState == TalentState::SCND_SUBMIT) {
-                $data["new_submit_time"] = date("Y-m-d H:i:s");
+                if (!$info["first_submit_time"]) {
+                    $data["first_submit_time"] = date("Y-m-d H:i:s");
+                } else {
+                    $data["new_submit_time"] = date("Y-m-d H:i:s");
+                }
                 $data["updateTime"] = date("Y-m-d H:i:s");
                 TalentModel::update($data);
                 TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
@@ -1119,13 +1135,17 @@ class Talent extends EnterpriseController {
      * @throws ValidateException
      */
     private function wjSave($info, \think\Request $request, $checkState) {
+        $callback = "infoCallback";
+        if (in_array($checkState, [TalentState::FST_SUBMIT, TalentState::SCND_SUBMIT])) {
+            $callback = "submitCallback";
+        }
         try {
             $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"], "first_submit_time" => $info["first_submit_time"]], $this->user["type"]);
             if ($batch["code"] != 200) {
                 throw new ValidateException($batch["msg"]);
             }
             $param = $request->param();
-            validate(TalentInfo::class)->check($param);
+            $i = validate(TalentInfo::class)->check($param);
             $id = $param["id"];
             if ($id) {
                 if (!$info || $info["id"] != $id || $info["enterprise_id"] != $this->user["uid"]) {
@@ -1191,7 +1211,7 @@ class Talent extends EnterpriseController {
                     $data["updateTime"] = date("Y-m-d H:i:s");
                     TalentModel::update($data);
                     $last_log = TalentLogApi::getLastLog($data["id"], 1);
-                    if ($last_log["new_state"] != TalentState::SCND_SAVE || $last_log["new_state"] != TalentState::FST_SAVE) {
+                    if ($last_log["new_state"] != TalentState::SCND_SAVE && $last_log["new_state"] != TalentState::FST_SAVE) {
                         TalentLogApi::write(1, $data["id"], $checkState, "保存未提交", 1);
                     } else {
                         if (!$last_log["companyId"]) {
@@ -1210,25 +1230,27 @@ class Talent extends EnterpriseController {
                     Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
                 }
                 $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $id, "checkState" => $checkState]];
-                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+                echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
                 exit();
             } else if ($checkState == TalentState::SCND_SUBMIT || $checkState == TalentState::FST_SUBMIT) {
-                $data["new_submit_time"] = date("Y-m-d H:i:s");
+                if (!$info["first_submit_time"]) {
+                    $data["first_submit_time"] = date("Y-m-d H:i:s");
+                } else {
+                    $data["new_submit_time"] = date("Y-m-d H:i:s");
+                }
                 $data["updateTime"] = date("Y-m-d H:i:s");
                 TalentModel::update($data);
                 TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
-                return json(["msg" => $success_msg, "code" => 200]);
+                $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $id, "checkState" => $checkState]];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+                exit();
             } else {
                 throw new ValidateException($error_msg);
             }
         } catch (ValidateException $e) {
-            if ($checkState == TalentState::SCND_SAVE) {
-                $res = ["msg" => $e->getMessage()];
-                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
-                exit();
-            } else {
-                return json(["msg" => $e->getMessage()]);
-            }
+            $res = ["msg" => $e->getMessage()];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
         } catch (\think\Exception $e) {
             $res = ["msg" => "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()];
             $logInfo = [
@@ -1240,12 +1262,8 @@ class Talent extends EnterpriseController {
                 "errMsg" => $e->getMessage()
             ];
             Log::write($logInfo, "error");
-            if ($checkState == TalentState::SCND_SAVE || $checkState == TalentState::FST_SAVE) {
-                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
-                exit();
-            } else {
-                return json($res);
-            }
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
         }
     }
 
@@ -1318,6 +1336,212 @@ class Talent extends EnterpriseController {
         return TalentModel::where($where)->field("id,name")->select()->toArray();
     }
 
+    /**
+     * 审核列表页
+     */
+    public function examineCenter() {
+        $tpl = "";
+        switch ($this->user["type"]) {
+            case CommonConst::ENTERPRISE_WJ:
+                if ($this->user["isGeneral"] == 1) {
+                    $tpl = "/talent/hospital/examine_center"; //卫健医院
+                }
+                break;
+        }
+        return view($tpl);
+    }
+
+    /**
+     * 审核列表页
+     */
+    public function examineList() {
+        $res = TalentApi::getHospitalExamineList($this->request);
+        return json($res);
+    }
+
+    public function examinePage() {
+        $id = $this->request->param("id");
+        $info = \app\common\api\VerifyApi::getTalentInfoById($id);
+        return view("/talent/hospital/view", ["row" => $info]);
+    }
+
+    /**
+     * 医院人才申报审核保存
+     * @return type
+     */
+    public function check() {
+        $request = $this->request;
+        $params = $request->param();
+        $check = $params["checkState"];
+        $check_msg = trim($params["checkMsg"]);
+        $files = $params["files"];
+        $fields = $params["fields"];
+        $id = $params["id"];
+        $talent_info = \app\common\api\VerifyApi::getOne($id);
+        if (!$talent_info) {
+            return json(["msg" => "数据错误"]);
+        }
+        $enterprise = EnterpriseApi::getOne($talent_info["enterprise_id"]);
+        $checkState = $talent_info["checkState"];
+        if ($this->user["isGeneral"] != 1) {
+            return json(["msg" => "非总院账号,无法审核"]);
+        }
+        if ($this->user["medicalCommunityId"] != $enterprise["medicalCommunityId"]) {
+            return json(["msg" => "不能审核其它非本医共体医院"]);
+        }
+        if (!$check) {
+            return json(["msg" => "请选择审核状态"]);
+        }
+        if (!$check_msg) {
+            return json(["msg" => "请填写审核说明"]);
+        }
+        if ($checkState == TalentState::FST_SUBMIT) {
+            if ($params["checkState"] == 3) {
+//审核成功,并取消设置越过部门并审
+                $log_checkState = $checkState = TalentState::BASE_VERIFY_PASS; //初审成功
+            } else {
+//审核驳回并记录需要修改的字段和上传文件
+                $checkState = TalentState::FST_SAVE; //退回材料编辑状态
+                $log_checkState = TalentState::BASE_REJECT; //日志记录拒绝状态
+            }
+            $log = TalentLogApi::getLastLog($id, 1);
+            if (!$log && !$talent_info["oldId"])
+                return json(["msg" => "日志数据异常,保存失败"]);
+            if ($log["active"] === 0) {
+                TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
+            } else {
+                TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
+            }
+            $data["id"] = $talent_info["id"];
+            $data["modify_files"] = $params["files"];
+            $data["modify_fields"] = $params["fields"];
+            TalentModel::update($data);
+            return json(["code" => 200, "msg" => "保存成功"]);
+        } else {
+            return json(["msg" => "不在审核范围内,保存失败"]);
+        }
+    }
+
+    /**
+     * 医院人才申报审核
+     * @return type
+     */
+    public function submitCheck() {
+        $id = $this->request->param("id");
+        $talent_info = \app\common\api\VerifyApi::getOne($id);
+        if (!$talent_info) {
+            return json(["msg" => "数据错误"]);
+        }
+        $enterprise = EnterpriseApi::getOne($talent_info["enterprise_id"]);
+        $checkState = $talent_info["checkState"];
+        if ($this->user["isGeneral"] != 1) {
+            return json(["msg" => "非总院账号,无法审核"]);
+        }
+        if ($this->user["medicalCommunityId"] != $enterprise["medicalCommunityId"]) {
+            return json(["msg" => "不能审核其它非本医共体医院"]);
+        }
+        if ($checkState == TalentState::FST_SUBMIT) {
+            $nowProcess = 1;
+            $log = TalentLogApi::getLastLog($talent_info["id"], 1);
+            if (!$log || $log["active"] == 1)
+                return json(["msg" => "请先保存审核状态,再提交审核"]);
+            if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS])) {
+                $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
+            }
+            $data["id"] = $talent_info["id"];
+            $data["checkState"] = $log["new_state"];
+            TalentModel::update($data);
+            TalentLogApi::setActive($log["id"], 1);
+            if ($log["state"] == TalentState::BASE_REJECT) {
+                $this->sendMsg($enterprise["id"], $log["description"]);
+            }
+            return json(["code" => 200, "msg" => "审核成功"]);
+        } else {
+            return json(["msg" => "不在审核范围内,审核失败"]);
+        }
+    }
+
+    private function sendMsg($enterprise_id, $description = "") {
+        $ep = EnterpriseApi::getOne($enterprise_id);
+        if ($ep->agentPhone) {
+            $smsapi = new \app\common\api\ChuanglanSmsApi();
+            $result = $smsapi->sendSMS($phone, $template);
+            $result = json_decode($result, true);
+            $id = getStringId();
+            $record_data = [
+                'id' => $id,
+                'userId' => $ep->id,
+                'bizId' => $result["msgId"],
+                'type' => 2,
+                'smsType' => 2,
+                'name' => $ep->name,
+                'phone' => $ep->agentPhone,
+                'params' => "总院审核",
+                'templateCode' => "【晋江市人才服务平台】尊敬的用户,您提交的人才认定申报审核驳回,原因是:{$description},请及时登录申报系统修改并重新提交。",
+                'state' => $result['code'] == 0 ? 2 : 3,
+                'sendingDate' => date("Y-m-d H:i:s", time()),
+                'createTime' => date("Y-m-d H:i:s", time()),
+                'msg' => $result['errorMsg']
+            ];
+            \app\admin\model\MessageRecord::create($record_data);
+        }
+    }
+
+    public function validateIsCheck() {
+        $params = $this->request->param();
+        $id = $params["id"];
+        $talent_info = \app\common\api\VerifyApi::getTalentInfoById($id);
+        $enterprise = EnterpriseApi::getOne($talent_info["enterprise_id"]);
+        if ($talent_info) {
+            $checkState = $talent_info["checkState"];
+            if ($this->user["isGeneral"] != 1) {
+                return json(["msg" => "非总院账号,无法审核"]);
+            }
+            if ($this->user["medicalCommunityId"] != $enterprise["medicalCommunityId"]) {
+                return json(["msg" => "不能审核其它非本医共体医院"]);
+            }
+            if ($checkState != TalentState::FST_SUBMIT) {
+                return json(["msg" => "该申报不在审核范围内,无法审核"]);
+            }
+            $fields = DictApi::getTalentFields_WJ();
+            $field_tmp = [];
+            if ($fields) {
+                foreach ($fields as $key => $field) {
+                    $field_tmp[] = ["key" => $key, "value" => $field];
+                }
+            }
+            $condition = \app\common\api\TalentConditionApi::getOne($talent_info["talent_condition"]);
+            $where = [];
+            $whr = [];
+            $where[] = ["project", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["type", "=", $enterprise["type"]];
+            $where[] = ["isConditionFile", "<>", 1];
+            $where[] = ["delete", "=", 0];
+            if ($condition && $condition["bindFileTypes"]) {
+                $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
+                $files = \think\facade\Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select();
+            } else {
+                $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
+            }
+            $talent_info["files"] = array_filter(explode(",", $talent_info["modify_files"]));
+            $talent_info["fields"] = array_filter(explode(",", $talent_info["modify_fields"]));
+
+            /* 保存的审核内容start */
+            $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, 0, ["active", "=", 0]);
+            $check = ["msg" => $last_log["description"]];
+            if ($last_log["state"] == TalentState::BASE_VERIFY_PASS) {
+                $check["checkState"] = 3;
+            }
+            if ($last_log["new_state"] == TalentState::FST_SAVE && $last_log["state"] == TalentState::BASE_REJECT) {
+                $check["checkState"] = 2;
+            }
+
+            /* 保存的审核内容end */
+            return json(["code" => 200, "obj" => ["talentInfo" => $talent_info, "check" => $check, "fieldList" => $field_tmp, "fileList" => $files]]);
+        }
+    }
+
 //    public function mixDelete() {
 //        $id = $this->request->param("talentInfoId");
 //        $info = TalentApi::chkIsOwner($id, $this->user["uid"]);

+ 297 - 0
app/enterprise/view/talent/hospital/examine_center.html

@@ -0,0 +1,297 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+    .layui-layer-btn .layui-layer-btn1 {
+        border-color: #009688;
+        background-color: #009688;
+        color: #fff;
+    }
+    ul li{
+        list-style: none;
+        display:inline-block;
+        margin-bottom: 5px;
+    }
+    #field ul li input{
+        vertical-align:middle;
+        margin-top:1px;
+    }
+</style>
+<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">
+                            <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>
+                                    <input type="text" class="form-control" id="card_number" 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="sex">
+                                        <option value=""></option>
+                                        <option value="1">男</option>
+                                        <option value="2">女</option>
+                                    </select>
+                                </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="nation">
+                                    </select>
+                                </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="apply_year" 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="phone" 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="email" 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>
+                                    </select>
+                                </div>                            
+                            </div>
+                        </div>
+                        <div class="row highSearch" style="display: none">
+                            <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="politics">
+                                    </select>
+                                </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="enterprise_id">
+                                        {volist name="enterprises" id="item"}
+                                        <option value="{$item.id}">{$item.name}</option>
+                                        {/volist}
+                                    </select>
+                                </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="talent_type">
+                                    </select>
+                                </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="highest_degree">
+                                    </select>
+                                </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="study_abroad">
+                                        <option value="">---请选择---</option>
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
+                                    </select>
+                                </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="talent_arrange">
+                                    </select>
+                                </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="talent_condition">
+                                        <option value="">--请选择--</option>
+                                        {volist name="talent_conditions" id="condition"}
+                                        <option value="{$condition.id}">{$condition.name}</option>
+                                        {/volist}
+                                    </select>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="row">
+                            <div class="col-sm-12" style="text-align: center">
+                                <button type="button" style="cursor:pointer;" id="openSearch" onclick="$('.highSearch,#closeSearch').show();
+                                        $(this).hide();" class="btn btn-sm btn-primary glyphicon glyphicon-eye-open" id="open-but">打开高级搜索</button>
+                                <button type="button" style="cursor:pointer;display: none;" id="closeSearch" onclick="$('#openSearch').show();
+                                        $('.highSearch').hide();
+                                        $(this).hide();"  class="btn btn-sm btn-danger glyphicon glyphicon-eye-close" id="close-but">关闭高级搜索</button>
+                                <button type="button" style="cursor:pointer;"  class="btn btn-sm btn-info  glyphicon glyphicon-search" onclick="TalentInfo.search()">搜索</button>
+                                <button type="button" style="cursor:pointer;"  class="btn btn-sm btn-warning glyphicon glyphicon-repeat" onclick="TalentInfo.reset()">重置</button>
+                            </div>
+                        </div>
+                        <div class="hidden-xs" id="TalentInfoTableToolbar" role="group">
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.openCheckTalentInfo()">
+                                <i class="fa fa-check"></i>&nbsp;审核
+                            </button>
+                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.showExportModal(1)">
+                                <i class="fa fa-file-excel-o"></i>&nbsp;导出
+                            </button>
+                        </div>
+                        <table id="TalentInfoTable" 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 class="modal fade " id="commonExportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
+    <div class="modal-dialog modal-lg" role="document" style="min-width: 1000px">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="firstModalLabel">导出</h4>
+            </div>
+            <div class="modal-body">
+                <form id="exportForm" action="/talentInfoExport/publicExport" target="hiddenIframe" class="form-horizontal">
+                    <div class="form-group" id="field">
+                        <div id="field_info">
+                            <ul>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="name"><span>姓名</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="card_type"><span>证件类型</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="card_number"><span>证件号码</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="sex"><span>性别</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="birthday"><span>出生日期</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="nation"><span>民族</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="politics"><span>政治面貌</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="enterpriseName"><span>单位名称</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="talent_type"><span>人才类型</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="labor_contract_rangetime"><span>劳动合同起止时间</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="apply_year"><span>申报年度</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="phone"><span>手机号码</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="email"><span>电子邮箱</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="highest_degree"><span>最高学历</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="graduate_school"><span>毕业院校</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="major"><span>专业</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="study_abroad"><span>是否有留学经历</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="abroad_school"><span>留学毕业院校</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="abroad_major"><span>留学专业</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="cur_entry_time"><span>本单位入职时间</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="position"><span>本单位现任职务</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="talent_arrange"><span>人才层次</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="talent_arrange_category"><span>人才条款</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="talent_condition"><span>认定条件</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="bank"><span>开户银行</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="bank_number"><span>银行行号</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="bank_branch_name"><span>开户银行网点</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="bank_account"><span>银行账号</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="checkState"><span>审核状态</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="checkMsg"><span>审核意见</span></li>
+                            </ul>
+                        </div>
+                        <div class="form-group" style="text-align: center">
+                            <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>
+                            <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="TalentInfo.export(3)">导出查找内容</button>
+                <button type="button" class="btn btn-primary" onclick="TalentInfo.export(3, true)">导出全部</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/gate/enterprise/talentIdentify/examine_center.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/gate/enterprise/talentIdentify/examine_common.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 4 - 4
app/enterprise/view/talent/hospital/view.html

@@ -56,9 +56,9 @@
                                 <form id="talentInfoForm" class="form-horizontal" action="/enterprise/talent/apply" method="post" enctype="multipart/form-data" target="hiddenIframe">
                                     <input type="hidden" name="id" id="id" value="{$row.id}">
                                     <input type="hidden" name="year" id="year" value="{$year}">
-                                    <input type="hidden" name="enterprise_id" id="enterpriseId" value="{$row.enterprise.id}">
-                                    <input type="hidden" name="enterprise_type" id="type" value="{$row.enterprise.type}">
-                                    <input type="hidden" name="enterprise_tag" id="enterprise_tag" value="{$row.enterprise.enterpriseTag}">
+                                    <input type="hidden" name="enterprise_id" id="enterpriseId" value="{$row.enterpriseId}">
+                                    <input type="hidden" name="enterprise_type" id="type" value="{$row.enterpriseType}">
+                                    <input type="hidden" name="talent_condition" id="talent_condition" value="{$row.talent_condition}">
                                     <input type="file" name="photo" id="photo" style="display: none">
                                     <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
                                     <input type="hidden" name="realState" id="realState" value="{$row.real_state}">
@@ -178,7 +178,7 @@
                                         </div>
                                         <div class="col">
                                             <label class="col-label"><span style="color: red">*</span>认定条件</label>
-                                            <input type="text" class="form-control w490" id="talent_condition" name="talent_condition" value="{$row.talentConditionName}"/>
+                                            <input type="text" class="form-control w490" value="{$row.talentConditionName}"/>
                                         </div>
                                     </div>
                                     <div class="row">

+ 313 - 0
public/static/modular/gate/enterprise/talentIdentify/examine_center.js

@@ -0,0 +1,313 @@
+/**
+ * 人才认定申报管理初始化
+ */
+var TalentInfo = {
+    id: "TalentInfoTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+TalentInfo.initColumn = function () {
+    return [
+        {field: 'selectItem', checkbox: true},
+        {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
+        {title: '医院名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
+        {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            formatter: function (value, row, index) {
+                if (row.sex == 1) {
+                    return value + '<span style="color:#6495ED">【男】</span>';
+                }
+                if (row.sex == 2) {
+                    return value + '<span style="color:#FF82AB">【女】</span>';
+                }
+            }
+        },
+        {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
+        {title: '认定层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
+        {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px"},
+        {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
+        {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
+        {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            formatter: function (value, row, index) {
+                if (typeof row.deptCheckState != "undefined") {
+                    if ((row.deptActive == 0 && row.realState == 10) || !row.deptActive) {
+                        if (row.resubmit) {
+                            return "<span class='label label-success'>待部门并审(重新提交)</span>";
+                        } else {
+                            return "<span class='label label-success'>待部门并审(首次提交)</span>";
+                        }
+                    }
+                    if (row.deptActive == 1 && row.newState == 12) {
+                        return "<span class='label label-primary'>部门并审通过</span>";
+                    }
+                    if (row.deptActive == 1 && row.newState == 9) {
+                        return "<span class='label label-danger'>部门并审驳回</span>";
+                    }
+                } else {
+                    if (value == 2) {
+                        if (row.lastState == 4) {
+                            return "<span class='label label-success'>待审核(重新提交)</span>"
+                        }
+                        if (row.realState == 6) {
+                            return "<span class='label label-danger'>复审驳回</span>"
+                        }
+                        return "<span class='label label-success'>待审核</span>"
+                    }
+                    if (value == 3) {
+                        return "<span class='label label-success'>待复审</span>"
+                    }
+                    if (value == 5) {
+                        return "<span class='label label-success'>复审通过</span>"
+                    }
+                    if (value == 10) {
+                        if (process == 3) {
+                            if (row.pass_dept_check == 1) {
+                                return "<span class='label label-success'>初审通过(待复审)</span>"
+                            }
+                            return "<span class='label label-success'>初审通过(待部门并审)</span>"
+                        }
+                        if (process == 4) {
+                            if (row.resubmit) {
+                                return "<span class='label label-success'>待部门并审(重新提交)</span>";
+                            } else {
+                                return "<span class='label label-success'>待部门并审(首次提交)</span>";
+                            }
+                        }
+                        if (row.resubmit) {
+                            return "<span class='label label-success'>待复审(重新提交)</span>";
+                        } else {
+                            return "<span class='label label-success'>待复审(首次提交)</span>";
+                        }
+                    }
+                    if (value == 8) {
+                        if (row.realState == 11) {
+                            return "<span class='label label-danger'>初审驳回</span>"
+                        } else {
+                            return "<span class='label label-success'>保存未提交</span>"
+                        }
+                    }
+                    if (value == 9) {
+                        if (row.realState == 13) {
+                            if (process == 3) {
+                                return "<span class='label label-danger'>待初审(部门并审驳回)</span>";
+                            }
+                            return "<span class='label label-danger'>部门并审驳回</span>";
+                        } else if (row.realState == 15) {
+                            if (process == 3) {
+                                return "<span class='label label-danger'>待初审(复审驳回)</span>";
+                            }
+                            return "<span class='label label-danger'>复审驳回</span>";
+                        } else {
+                            if (row.lastState == 11) {
+                                return "<span class='label label-success'>待初审(重新提交)</span>"
+                            }
+                            return "<span class='label label-success'>待初审(首次提交)</span>"
+                        }
+                    }
+                    if (value == -2) {
+                        return "<span class='label label-danger'>初审不通过</span>"
+                    }
+                    if (value == 16) {
+                        return "<span class='label label-danger'>复审不通过</span>"
+                    }
+                    if (value == -1 || value == 7) {
+                        return "<span class='label label-danger'>审核不通过</span>"
+                    }
+                    if (value == 4) {
+                        if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 1) {
+                            return "<span class='label label-success'>上级驳回</span>"
+                        } else {
+                            return "<span class='label label-success'>待审核</span>"
+                        }
+                    }
+                    if (value == 11) {
+                        if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 3) {
+                            return "<span class='label label-success'>上级驳回</span>"
+                        } else {
+                            return "<span class='label label-success'>待审核</span>"
+                        }
+                    }
+                    if (value == 12) {
+                        if (process == 4) {
+                            return "<span class='label label-success'>部门并审通过</span>";
+                        }
+                        if (process == 3) {
+                            return "<span class='label label-success'>待复审(部门并审通过)</span>";
+                        }
+                        if (row.resubmit) {
+                            return "<span class='label label-success'>待复审(重新提交)</span>";
+                        } else {
+                            return "<span class='label label-success'>待复审(首次提交)</span>";
+                        }
+                    }
+                    if (value == 13) {
+                        if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 4) {
+                            return "<span class='label label-danger'>上级驳回</span>"
+                        } else {
+                            return "<span class='label label-success'>待审核</span>"
+                        }
+                    }
+                    if (value == 14) {
+                        return "<span class='label label-primary'>复审通过</span>"
+                    }
+                    if (value == 15) {
+                        if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 5) {
+                            return "<span class='label label-success'>上级驳回</span>"
+                        } else {
+                            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=\"TalentInfo.showLog('" + value + "')\" >" +
+                        "<i class=\"fa fa-book\"></i>日志" +
+                        "</span>";
+            }
+        }
+    ];
+};
+/**
+ * 检查是否选中
+ */
+TalentInfo.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length != 1) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    } else {
+        TalentInfo.seItem = selected[0];
+        return true;
+    }
+};
+
+
+TalentInfo.openCheckTalentInfo = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '优秀人才审核',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            shade: 0,
+            content: '/enterprise/talent/examinePage/id/' + TalentInfo.seItem.id,
+            btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+            btnAlign: 'c',
+            btn1: function (index, layero) {
+                var obj = layero.find("iframe")[0].contentWindow;
+                obj.TalentInfoInfoDlg.showFirstCheckModal();
+            }, btn2: function (index, layero) {
+                var obj = layero.find("iframe")[0].contentWindow;
+                obj.TalentInfoInfoDlg.submitCheck();
+                return false;
+            }
+        });
+        layer.full(index);
+        TalentInfo.layerIndex = index;
+    }
+}
+
+TalentInfo.creatFieldCheckModal = function () {
+    return '<form id="firstCheckForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <div >\n' +
+            '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
+            '                            <div id="field_info">\n' +
+            '                                <ul>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="nationality"><span>国籍/地区</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="provinceCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯省</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="cityCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯市</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="countyCode"><span>籍贯县</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="nation"><span>民族</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="politics"><span>政治面貌</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="cardType"><span>证件类型</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="idCard"><span>证件号码</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="firstInJJTime"><span>首次来晋工作时间</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="source" onchange="TalentInfo.sourceCheckd(this)"><span>申报来源</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="ourCitySource"><span>公布入选来源</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="fromCity"><span>入选来源县市</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="qzBatch"><span>入选名单的文件号及批次</span></li>\n' +
+            '                                    <li style="width:31%"><input type="checkbox" value="certificateStartTime"><span>泉州高层次人才证书发证日期</span></li>\n' +
+            '                                    <li style="width:31%"><input type="checkbox" value="qzgccrcActiveTime"><span>泉州高层次人才证书的有效期</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" id="talentArrangeCheckBox" value="talentArrange" onchange="TalentInfo.fieldCheckd(this)"><span>人才层次</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="identifyCondition"><span>认定条件</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="identifyConditionName"><span>认定条件名称</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="identifyGetTime"><span>认定条件证书取得时间</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="talentType"><span>人才标签</span></li>\n' +
+            '                                    <li style="width:31%"><input type="checkbox" value="letterTime"><span>首次来晋行政介绍信时间</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="introductionMode"><span>引进方式</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="entryTime"><span>本单位入职时间</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="post"><span>职务</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="startTime"><span>工作合同开始时间</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="endTime"><span>工作合同结束时间</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="lastYearWages"><span>上一年度年薪</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="highEducation"><span>最高学历</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="graduateSchool"><span>毕业院校</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="major"><span>专业</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="title"><span>职称</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="professionalQualifications"><span>国家职业资格</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="studyAbroad"><span>是否有留学经历</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="phone"><span>手机号码</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="email"><span>电子邮箱</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="bank"><span>开户银行</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="bankNetwork"><span>开户银行网点</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="bankNumber"><span>银行行号</span></li>\n' +
+            '                                    <li style="width:10%"><input type="checkbox" value="bankAccount"><span>银行账号</span></li>\n' +
+            '                                    <li style="width:31%"><input type="checkbox" value="breakFaith"><span>曾被相关主管部门列为失信个人</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="educationAndResume"><span>教育背景及工作简历</span></li>\n' +
+            '                                    <li style="width:20.5%"><input type="checkbox" value="mainHonours"><span>主要业绩及取得的荣誉</span></li>\n' +
+            '                                </ul>\n' +
+            '                            </div>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+            '                            <div id="field_file">\n' +
+            '                            </div>\n' +
+            '                            <div class="form-group" style="text-align: center">\n' +
+            '                                <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+}
+
+TalentInfo.fieldCheckd = function (context) {
+    if ($(context).get(0).checked) {
+        $(context).parent().next().children()[0].checked = true;
+        $(context).parent().next().children().eq(0).trigger("change");
+    }
+}
+
+TalentInfo.sourceCheckd = function (context) {
+    if ($(context).get(0).checked) {
+        $("#talentArrangeCheckBox").attr("checked", true);
+        $("#talentArrangeCheckBox").trigger("change");
+    }
+}
+
+$(function () {
+    var defaultColunms = TalentInfo.initColumn();
+    var process = $("#process").val();
+    var table = new BSTable(TalentInfo.id, "/enterprise/talent/examineList", defaultColunms);
+    table.setPaginationType("server");
+    table.setSingleSelect(false);
+    table.setOnDblClickRow(function () {
+        TalentInfo.openCheckTalentInfo();
+    });
+    TalentInfo.table = table.init();
+    TalentInfo.init();
+
+    // var defaultColunms = TalentInfo.initColumn();
+    // var table = new KDTable(TalentInfo.id, "/talentInfo/list/1", defaultColunms);
+    // table.setPaginationType("server");
+    // TalentInfo.table = table.init();
+});

+ 298 - 0
public/static/modular/gate/enterprise/talentIdentify/examine_common.js

@@ -0,0 +1,298 @@
+/**
+ * 显示审核日志
+ */
+TalentInfo.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": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
+        }
+    });
+}
+
+
+/**
+ * 查询表单提交参数对象
+ * @returns {{}}
+ */
+TalentInfo.formParams = function () {
+    var queryData = {};
+    queryData['name'] = $("#name").val();
+    queryData['card_number'] = $("#card_number").val();
+    queryData['sex'] = $("#sex").val();
+    queryData['nation'] = $("#nation").val();
+    queryData['nationality'] = $("#nationality").val();
+    queryData['province'] = $("#province").val();
+    queryData['politics'] = $("#politics").val();
+    queryData['enterprise_id'] = $("#enterprise_id").val();
+    if ($("#company_id").length > 0) {
+        queryData['company_id'] = $("#company_id").val();
+    }
+    queryData['industry_field'] = $("#industry_field").val();
+    queryData['industry_field_old'] = $("#industry_field_old").val();
+    queryData['enterprise_tag'] = $("#enterprise_tag").val();
+    queryData['source'] = $("#source").val();
+    queryData['city'] = $("#city").val();
+    queryData['import_way'] = $("#import_way").val();
+    queryData['highest_degree'] = $("#highest_degree").val();
+    queryData['major'] = $("#major").val();
+    queryData['study_abroad'] = $("#study_abroad").val();
+    queryData['phone'] = $("#phone").val();
+    queryData['email'] = $("#email").val();
+    queryData['breakFaith'] = $("#breakFaith").val();
+    queryData['talent_type'] = $("#talent_type").val();
+    queryData['isMatchZhiren'] = $("#isMatchZhiren").val();
+    queryData['talent_arrange'] = $("#talent_arrange").val();
+    queryData['street'] = $("#street").val();
+    if ($("#talent_condition").val() == null || $("#talent_condition").val() == '' || $("#talent_condition").val() == "null") {
+        queryData['talent_condition'] = "";
+    } else {
+        queryData['talent_condition'] = $("#talent_condition").val();
+    }
+    queryData['identifyMonth'] = $("#identifyMonth").val();
+    queryData['checkState'] = $("#checkState").val();
+    queryData['isPublic'] = $("#isPublic").val();
+    queryData['active'] = $("#active").val()
+    queryData['apply_year'] = $("#apply_year").val();
+    queryData['isEffect'] = $("#isEffect").val();
+    //queryData['offset'] = 0;
+    return queryData;
+}
+
+/**
+ * 查询人才认定申报列表
+ */
+TalentInfo.search = function () {
+    TalentInfo.table.refresh({query: TalentInfo.formParams()});
+};
+
+/**
+ * 重置
+ */
+TalentInfo.reset = function () {
+    $("#name").val("");
+    $("#card_number").val("");
+    $("#sex").val("");
+    $("#nation").val("");
+    $("#nationality").val("");
+    $("#province").val("");
+    $("#politics").val("");
+    $("#enterprise_id").val("").trigger("chosen:updated");
+    if ($("#company_id").length > 0) {
+        $("#company_id").val("").trigger("chosen:updated");
+    }
+    $("#industry_field").val("");
+    $("#industry_field_old").val("");
+    $("#enterprise_tag").val("");
+    $("#source").val("");
+    $("#fromCity").val("");
+    $("#import_way").val("");
+    $("#highest_degree").val("");
+    $("#major").val("");
+    $("#study_abroad").val("");
+    $("#phone").val("");
+    $("#email").val("");
+    $("#breakFaith").val("");
+    $("#talent_type").val("");
+    $("#isMatchZhiren").val("");
+    $("#talent_arrange").val("");
+    $("#street").val("");
+    $("#talent_condition").val("").trigger("chosen:updated");
+    $("#checkState").val("");
+    $("#identifyMonth").val("");
+    $("#isPublic").val("");
+    $("#active").val("")
+    $("#apply_year").val("");
+    $("#isEffect").val("");
+}
+
+
+
+/**
+ * 获取人才认定
+ */
+TalentInfo.getIdentifyCondition = function () {
+    var level = $("#talent_arrange").val();
+    if (level == null || level == '') {
+        $("#talent_condition").empty();
+        $("#talent_condition").trigger('chosen:updated');
+        return;
+    }
+    Feng.addAjaxSelect({
+        "id": "talent_condition",
+        "displayCode": "id",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level
+    });
+    $("#talent_condition").trigger('chosen:updated');
+}
+/**
+ * 获取人才认定
+ */
+TalentInfo.getProvince = function () {
+    Feng.addAjaxSelect({
+        "id": "province",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
+    });
+}
+
+/**
+ * 显示导出模态框
+ */
+TalentInfo.showExportModal = function () {
+    $("#exportForm")[0].reset();
+    $("#commonExportModal").modal("show");
+}
+
+/**
+ * 导出提交
+ */
+TalentInfo.export = function (process, exportAll) {
+    exportAll = typeof exportAll == "undefined" || exportAll == false ? 0 : 1;
+    var names = '';
+    var values = '';
+    var commonExport = "";
+    $("#field_info li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            values = values + $(this).val() + ",";
+            names = names + $(this).next().text() + ",";
+        }
+    });
+    var queryData = TalentInfo.formParams();
+    var process = parseInt($("#process").val());
+    switch (process) {
+        case 1:
+            commonExport = "baseVerifyListExport";
+            break;
+        case 2:
+            commonExport = "baseReverifyListExport";
+            break;
+        case 3:
+            commonExport = "fstVerifyListExport";
+            break;
+        case 4:
+            commonExport = "deptVerifyListExport";
+            break;
+        case 5:
+            commonExport = "reVerifyListExport";
+            break;
+        case 6:
+            commonExport = "preListExport";
+            break;
+        case 7:
+            commonExport = "libraryListExport";
+            break;
+    }
+    $("#commonExportModal").modal('hide');
+    var params = $("#exportForm").serialize();
+    var url = "/admin/talent/" + commonExport + "?" + params;
+    Object.keys(queryData).forEach(function (key, index) {
+        if (typeof queryData[key] != "undefined" && queryData[key]) {
+            url += "&" + key + "=" + queryData[key];
+        }
+    })
+    url += "&all=" + exportAll;
+    window.location.href = url;
+}
+
+/**
+ * 页面初始化
+ */
+TalentInfo.init = function () {
+    //批量加载字典表数据
+    var arr = [
+        {"name": "nation", "code": "nation"},
+        {"name": "nationality", "code": "nationality"},
+        {"name": "politics", "code": "politics"},
+        {"name": "industry_field", "code": "industry_field"},
+        {"name": "import_way", "code": "import_way"},
+        {"name": "highest_degree", "code": "highest_degree"},
+        {"name": "talent_type", "code": "talent_type"},
+        {"name": "talent_arrange", "code": "talent_arrange"},
+        {"name": "source", "code": "source"},
+        {"name": "street", "code": "street"},
+        {"name": "enterprise_tag", "code": "enterprise_tag"}, ];
+    Feng.findChildDictBatch(JSON.stringify(arr));
+    //TalentInfo.getIdentifyCondition();
+    TalentInfo.getProvince();
+    $("#talent_condition,#enterprise_id").on('chosen:ready', function (e, params) {
+        $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
+    });
+    $("#enterprise_id").val("");
+    $("#enterprise_id").trigger('chosen:updated');
+    $("#talent_condition,#enterprise_id").chosen({
+        search_contains: true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        disable_search: false,
+        width: "100%",
+        enable_split_word_search: true
+    });
+    if ($("#company_id").length > 0) {
+        $("#company_id").on('chosen:ready', function (e, params) {
+            $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
+        });
+        $("#company_id").val("");
+        $("#company_id").trigger('chosen:updated');
+        $("#company_id").chosen({
+            search_contains: true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+            disable_search: false,
+            width: "100%",
+            enable_split_word_search: true
+        });
+    }
+}
+
+/**
+ * 下载附件
+ */
+TalentInfo.download = function () {
+    if (this.check()) {
+        window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=1&id=" + TalentInfo.seItem.id));
+    }
+}
+
+/**
+ * 批量下载头像
+ */
+TalentInfo.downloadPhoto = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length == 0) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    }
+    var ids = "";
+    for (let i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=1&ids=" + ids));
+}
+
+/**
+ * 全选
+ */
+TalentInfo.checkAll = function () {
+    $("#field_info input").each(function () {
+        this.checked = true;
+    })
+}
+/**
+ * 反选
+ */
+TalentInfo.unCheckAll = function () {
+    $("#field_info input").each(function () {
+        if (this.checked) {
+            this.checked = false;
+        } else {
+            this.checked = true;
+        }
+    })
+}
+

+ 36 - 4
public/static/modular/gate/talentInfo/talentInfo_wj_info.js

@@ -238,6 +238,19 @@ TalentInfoInfoDlg.infoCallback = function (data) {
         $("#checkState").val(data.obj.checkState);
     }
 }
+//回调
+TalentInfoInfoDlg.submitCallback = function (data) {
+    locked = false;
+    TalentInfoInfoDlg.setNoChangeField();
+    if (data.code == 200) {
+        Feng.success(data.msg);
+        // $("#checkState").val(data.obj);
+        window.parent.TalentInfo.table.refresh();
+        TalentInfoInfoDlg.close();
+    } else {
+        Feng.error(data.msg);
+    }
+}
 
 
 /**
@@ -355,7 +368,7 @@ TalentInfoInfoDlg.initFileTable = function () {
                 var realState = $("#realState").val();
                 for (var key in data) {
                     var btn = "";
-                    if (Feng.isEmptyStr(checkState) || (checkState == 8 && (realState == 8 || Feng.isEmptyStr(realState))) || (checkState == 11 && realState != 14) || (realState == 11 && files.indexOf(row.id) != -1)) {
+                    if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && (Feng.isEmptyStr(realState) || realState == 1)) || (checkState == 8 && (realState == 8 || Feng.isEmptyStr(realState))) || (checkState == 11 && realState != 14) || ((realState == 11 || realState == 4) && files.indexOf(row.id) != -1)) {
                         btn = "<button type=\'button\' onclick=\"TalentInfoInfoDlg.checkFile(this,'" + row.fState + "','" + row.id + "','" + data[key].id + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
                                 "<i class=\"fa fa-paste\"></i>修改" +
                                 "</button>" +
@@ -472,7 +485,27 @@ TalentInfoInfoDlg.submitToCheck = function () {
     }
     if (!TalentInfoInfoDlg.validateIsEdit())
         return;
+
     var operation = function () {
+        TalentInfoInfoDlg.clearData();
+        TalentInfoInfoDlg.collectData();
+        var id = $('#id').val();
+        if (id != null && id != '') {
+            if (!TalentInfoInfoDlg.validateIsEdit())
+                return;
+        }
+        $("select,input[type=radio]").each(function () {
+            $(this).removeAttr("disabled");
+        });
+        if (locked) {
+            return;
+        }
+        locked = true;
+        $("#talentInfoForm").attr("action", "/enterprise/talent/submitToCheck");
+        $("#talentInfoForm")[0].submit();
+
+
+        return;
         var ajax = new $ax(Feng.ctxPath + "/enterprise/talent/submitToCheck", function (data) {
             if (data.code == 200) {
                 Feng.success(data.msg);
@@ -549,8 +582,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 var files = $("#files").val();
                 var checkState = $("#checkState").val();
                 var realState = $("#realState").val();
-                //if (checkState == 8 || (checkState == 11 && realState != 14) || (realState == 11 && files.indexOf(value) != -1)) {
-                if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && realState == "") || (checkState == 1 && realState == 1) || (checkState == 8 && (realState == 8 || Feng.isEmptyStr(realState))) || (checkState == 11 && realState != 14) || (realState == 11 && files.indexOf(value) != -1)) {
+                if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && (Feng.isEmptyStr(realState) || realState == 1)) || (checkState == 8 && (realState == 8 || Feng.isEmptyStr(realState))) || (checkState == 11 && realState != 14) || ((realState == 11 || realState == 4) && files.indexOf(value) != -1)) {
                     return "<button type='button' onclick=\"TalentInfoInfoDlg.checkFile(this,'" + row.fState + "','" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
                             "<i class=\"fa fa-upload\"></i>上传" +
                             "</button>";
@@ -579,7 +611,7 @@ TalentInfoInfoDlg.setNoChangeField = function () {
     var checkState = $("#checkState").val();
     var fields = $("#fields").val();
     var realState = $("#realState").val();
-    if (realState == 11) {
+    if (realState == 11 || realState == 4) {
         $("#photoImg").removeAttr("onclick");
         $("input,textarea").each(function () {
             $(this).attr("readonly", "readonly").css("pointer-events", "none");

+ 258 - 46
public/static/modular/gate/talentInfo/talentInfo_wj_select.js

@@ -3,38 +3,39 @@
  */
 var locked = false;
 var TalentInfoInfoDlg = {
-    talentInfoInfoData : {},
+    talentInfoInfoData: {},
 };
 
 //初始化附件类别表单
-TalentInfoInfoDlg.initFileTable = function (){
+TalentInfoInfoDlg.initFileTable = function () {
     var queryData = {};
     queryData['project'] = CONFIG.project_rcrd;
     queryData['type'] = $("#type").val();
+    queryData["talent_condition"] = $("#talent_condition").val();
     queryData['checkState'] = $("#checkState").val();
     queryData['isMix'] = 1;
     $("#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,  				// 是否显示行间隔色
+        search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false, // 是否显示刷新按钮
+        clickToSelect: true, // 是否启用点击选中行
+        singleSelect: true, // 设置True 将禁止多选
+        striped: true, // 是否显示行间隔色
         escape: true,
-        pagination: false,   			// 设置为 true 会在表格底部显示分页条
+        pagination: false, // 设置为 true 会在表格底部显示分页条
         paginationHAlign: "left",
         paginationDetailHAlign: "right",
-        sidePagination: "server",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
         showColumns: false,
-        detailView: true,               //是否显示父子表
+        detailView: true, //是否显示父子表
         pageList: [10, 30, 50],
         queryParams: function (params) {
-            return $.extend(queryData,params)
+            return $.extend(queryData, params)
         },
         rowStyle: function (row, index) {
-            return {classes:"info"};
+            return {classes: "info"};
         },
         columns: TalentInfoInfoDlg.initFileTypeColumn(),
         onPostBody: function () {
@@ -48,30 +49,43 @@ TalentInfoInfoDlg.initFileTable = function (){
         },
         onExpandRow: function (index, row, $detail) {
             var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
-                if(data==null||data.length==0){
+                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>';
+                var html = '<ul class="imgs"><li style="width: 75%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width:15%;font-weight: bold;padding-top: 5px;">操作</li>';
                 var files = $("#files").val();
                 var checkState = $("#checkState").val();
-                for(var key in data){
+                var realState = $("#realState").val();
+                for (var key in data) {
+                    var btn = "";
+                    if (Feng.isEmptyStr(checkState) || (checkState == 8 && (realState == 8 || Feng.isEmptyStr(realState))) || (checkState == 11 && realState != 14) || (realState == 11 && files.indexOf(row.id) != -1)) {
+                        btn = "<button type=\'button\' onclick=\"TalentInfoInfoDlg.checkFile(this,'" + row.fState + "','" + row.id + "','" + data[key].id + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
+                                "<i class=\"fa fa-paste\"></i>修改" +
+                                "</button>" +
+                                "<button type='button' onclick=\"TalentInfoInfoDlg.deleteFile('" + data[key].id + "','" + row.fState + "')\" class=\"btn btn-xs btn-danger\">" +
+                                "<i class=\"fa fa-times\"></i>删除" +
+                                "</button>";
+                    } else {
+                        btn = "";
+                    }
                     var sn = data[key].url.lastIndexOf(".");
-                    var suffix = data[key].url.substring(sn+1,data[key].url.length);
+                    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;\">';
+                    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';
+                    html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
+                            '<li style="width: 75%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
+                            '<li style="width: 10%;">' + imgStr + '</li>\n' +
+                            '<li style="width: 15%;padding-top: 2px;">' + btn + '</li>';
                 }
                 html = html + '</ul>';
                 $detail.html(html);
-                $(".imgs").viewer({ fullscreen:false});
+                $(".imgs").viewer({fullscreen: false});
             }, function (data) {
                 Feng.error("查询失败!" + data.responseJSON.message + "!");
             });
@@ -91,41 +105,239 @@ TalentInfoInfoDlg.initFileTable = function (){
  */
 TalentInfoInfoDlg.initFileTypeColumn = function () {
     return [
-        {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;
+        {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'){
+        {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=\"TalentInfoInfoDlg.downloadFile('"+row.id+"',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
-                    "<i class=\"fa fa-download\"></i>下载" +
-                    "</button>";
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                        "<i class=\"fa fa-download\"></i>下载" +
+                        "</button>";
             }
         },
-        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"52%",'class': 'uitd_showTip'},
+        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip'},
     ]
 };
 
-TalentInfoInfoDlg.downloadFile = function (id,type){
-    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type="+type;
+
+/**
+ * 显示初审审核模态框
+ */
+TalentInfoInfoDlg.showFirstCheckModal = function () {
+    var ajax = new $ax("/enterprise/talent/validateIsCheck", function (data) {
+        if (data.code == 200) {
+            layer.open({
+                type: 1,
+                id: "neewFieldFormModel",
+                title: '审核',
+                area: ['800px', '450px'], //宽高
+                fix: false, //不固定
+                shade: 0,
+                maxmin: true,
+                content: TalentInfoInfoDlg.creatFieldCheckModal(),
+                btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+                btnAlign: 'c',
+                zIndex: layer.zIndex,
+                success: function (layero, index) {
+                    layer.setTop(layero);
+                    var obj = data.obj.talentInfo;
+                    var fileList = data.obj.fileList;
+                    if (typeof data.obj.fieldList != "undefined" && data.obj.fieldList.length > 0) {
+                        var fieldList = data.obj.fieldList;
+                        var html1 = '';
+                        for (var key in fieldList) {
+                            html1 = html1 + '<li style="float:left;margin:0 10px 10px 0;"><input type="checkbox" value="' + fieldList[key]["key"] + '"><span>' + fieldList[key]["value"] + '</span></li>';
+                        }
+                    }
+                    var html2 = '';
+                    for (var key in fileList) {
+                        html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
+                    }
+                    $("#field_info ul").css("overflow", "hidden").empty().append(html1);
+                    $("#field_file").css("overflow", "hidden").empty().append(html2);
+                    $("#firstCheckForm")[0].reset();
+                    $("#checkStateFirstModal").val(data.obj.check.checkState);
+                    $("#checkStateFirstModal").trigger("change");
+                    $("#checkMsgFirst").val(data.obj.check.msg);
+                    if (obj.fields != null && obj.fields != '') {
+                        $("#field_info input").each(function () {
+                            for (var key in obj.fields) {
+                                if ($(this).val() == obj.fields[key]) {
+                                    this.checked = true;
+                                }
+                            }
+                        });
+                    }
+                    if (obj.files != null && obj.files != '') {
+                        $("#field_file input").each(function () {
+                            for (var key in obj.files) {
+                                if ($(this).val() == obj.files[key]) {
+                                    this.checked = true;
+                                }
+                            }
+                        });
+                    }
+                },
+                yes: function (index, layero) {
+                    TalentInfoInfoDlg.firstCheck(index);
+                }
+            });
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("校验失败!" + data.responseJSON.message + "!");
+    });
+    ajax.setData({"id": $("#id").val()})
+    ajax.start();
+}
+
+
+/**
+ * 初审提交
+ */
+TalentInfoInfoDlg.firstCheck = function (i) {
+    var checkState = $("#checkStateFirstModal").val();
+    var checkMsg = $("#checkMsgFirst").val();
+    if (checkState == null || checkState == '') {
+        Feng.info("请选择审核状态");
+        return;
+    }
+    if (checkMsg == null || checkMsg == '') {
+        Feng.info("请填写审核意见");
+        return;
+    }
+    var fields = '';
+    var files = '';
+    $("#field_info li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            fields = fields + $(this).val() + ",";
+        }
+    });
+    $("#field_file li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            files = files + $(this).val() + ",";
+        }
+    });
+    if (checkState == 2 && fields == '' && files == '') {
+        Feng.info("请选择可修改的字段或附件!");
+        return;
+    }
+    if (locked)
+        return;
+    locked = true;
+    var ajax = new $ax("/enterprise/talent/check", function (data) {
+        if (data.code == 200) {
+            // $("#firstModal").modal("hide");
+            layer.close(i);
+            Feng.success(data.msg);
+        } else {
+            Feng.error(data.msg);
+        }
+        locked = false;
+    }, function (data) {
+        Feng.error("提交审核失败!" + data.responseJSON.message + "!");
+        locked = false;
+    });
+    ajax.setData({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg,
+        "fields": fields, "files": files})
+    ajax.start();
+}
+
+
+TalentInfoInfoDlg.submitCheck = function () {
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/enterprise/talent/submitCheck", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                window.parent.TalentInfo.table.refresh();
+                TalentInfoInfoDlg.close();
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("提交审核失败!" + data.responseJSON.message + "!");
+        });
+        ajax.setData({"id": $("#id").val()});
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
+}
+
+TalentInfoInfoDlg.creatFieldCheckModal = function () {
+    return '<form id="firstCheckForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <label for="checkState" class="control-label">审核状态</label>\n' +
+            '                        <select class="form-control" id="checkStateFirstModal" onchange="TalentInfoInfoDlg.toggleField()">\n' +
+            '                            <option value="">请选择</option>\n' +
+            '                            <option value="3">审核通过</option>\n' +
+            '                            <option value="2">审核驳回</option>\n' +
+            '                        </select>\n' +
+            '                    </div>\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <label for="checkMsg" class="control-label" >审核意见</label>\n' +
+            '                        <textarea class="form-control" id="checkMsgFirst" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
+            '                        <div id="field" style="padding-top: 5px;display: none">\n' +
+            '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
+            '                            <div id="field_info">\n' +
+            '                                <ul style="overflow:hidden;list-style:none;">\n' +
+            '                                </ul>\n' +
+            '                            </div>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+            '                            <div id="field_file">\n' +
+            '                            </div>\n' +
+            '                            <div class="form-group" style="text-align: center">\n' +
+            '                                <button type="button" class="btn btn-primary" onclick="TalentInfoInfoDlg.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="TalentInfoInfoDlg.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+
 }
 
-$(function() {
+/**
+ * 显示字段或者隐藏字段选择
+ */
+TalentInfoInfoDlg.toggleField = function () {
+    var checkState = $("#checkStateFirstModal").val();
+    var checkMsgFirst = $("#checkMsgFirst").val();
+    if (checkState == 2) {
+        $("#field").show();
+        $("#checkMsgFirst").val("");
+    } else if (checkState == 3) {
+        $("#field").hide();
+        $("#field").find("input[type=checkbox]").removeAttr("checked");
+        if (checkMsgFirst == null || checkMsgFirst == '') {
+            $("#checkMsgFirst").val("审核通过");
+        }
+    }
+}
+
+TalentInfoInfoDlg.downloadFile = function (id, type) {
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type=" + type;
+}
+
+$(function () {
     var id = $("#id").val();
-    if(id!=null && id!=''){
-        Feng.getCheckLog("logTable",{"type":CONFIG.project_rcrd,"mainId":id,"typeFileId":"","active":1})
+    if (id != null && id != '') {
+        Feng.getCheckLog("logTable", {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
     }
+
+    $("input,select,textarea").not("input[type='hidden']").not("input[type='file']").attr("style", "pointer-events: none;background-color: #e2ecf2;;");
     
-    $("input,select,textarea").not("input[type='hidden']").not("input[type='file']").attr("style","pointer-events: none;background-color: #eee;");
+    TalentInfoInfoDlg.initFileTable();
 });