Browse Source

生活补贴相关文件

sugangqiang 1 năm trước cách đây
mục cha
commit
91acc748fc

+ 22 - 0
app/common/api/LivingAllowanceApi.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace app\common\api;
+
+use app\common\model\LivingAllowance as laModel;
+
+/**
+ * Description of LivingAllowanceApi
+ *
+ * @author sgq
+ */
+class LivingAllowanceApi {
+
+    public static function getList() {
+        
+    }
+
+    public static function getInfoById($id) {
+        return laModel::where("id", $id)->find();
+    }
+
+}

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

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

+ 1 - 0
app/common/state/ProjectState.php

@@ -5,6 +5,7 @@ namespace app\common\state;
 class ProjectState {
 
     public const TALENT = 1; //人才认定
+    public const LIVINGALLOWANCE = 19; //生活补贴
     public const INTEGRAL = 20; //积分申报
 
 }

+ 1016 - 0
app/enterprise/controller/LivingAllowance.php

@@ -0,0 +1,1016 @@
+<?php
+
+namespace app\enterprise\controller;
+
+use app\enterprise\common\EnterpriseController;
+use think\facade\Db;
+use think\facade\Log;
+use app\common\api\EnterpriseApi;
+use app\common\api\DictApi;
+use app\common\api\TalentLogApi;
+use think\exception\ValidateException;
+use app\enterprise\validate\LivingAllowance as LivingAllowanceValidator;
+use app\common\state\ProjectState;
+use app\common\api\BatchApi;
+
+/**
+ * Description of LivingAllowance
+ *
+ * @author sgq
+ */
+class LivingAllowance extends EnterpriseController {
+
+    public function index() {
+        return view("", ['type' => session("user")['type']]);
+    }
+
+    public function list() {
+        $res = LivingAllowanceApi::getList($this->request, $step);
+        return json($res);
+    }
+
+    /**
+     * 新人才申报企业端统一申报入口,混合基础信息及人才信息
+     */
+    public function apply(\think\Request $request) {
+        $type = $this->user["type"];
+        $param = $request->param();
+        $id = isset($param["id"]) ? $param["id"] : 0;
+        $info = \app\common\api\LivingAllowanceApi::getInfoById($id);
+        $ep = EnterpriseApi::getOne($this->user["uid"]);
+        if (!chkEnterpriseFull($ep))
+            return;
+        $tagList = DictApi::selectByParentCode('enterprise_tag');
+        $streetList = DictApi::selectByParentCode('street');
+        $industryFieldNew = DictApi::selectByParentCode('industry_field');
+        $ep->enterpristTagName = $tagList[$ep->enterpriseTag];
+        $ep->streetName = $streetList[$ep->street];
+        $ep->industryFieldNewName = $industryFieldNew[$ep->industryFieldNew];
+        if ($info) {
+            $info["real_state"] = TalentLogApi::getLastLog($id, ProjectState::LIVINGALLOWANCE)["state"];
+        }
+        if ($info && in_array($info["checkState"], [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::REVERIFY_PASS, TalentState::REVERIFY_FAIL])) {
+            return $this->view($request);
+            exit();
+        }
+        if ($request->isPost()) {
+            $checkState = $info["checkState"] ?: 0;
+            if ($checkState == TalentState::SCND_SAVE || $checkState == 0) {
+                switch ($type) {
+                    case 1:
+                        $this->mixSave($info, $request, TalentState::SCND_SAVE);
+                        exit();
+                        break;
+                    case 2:
+                        $this->icSave($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])) {
+                $res = ["msg" => "审核不通过,不能再保存"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+            $res = ["msg" => "已提交审核,请耐心等待"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        $checkState = $info["checkState"] ?: 0;
+
+        $batch = $info["apply_year"] ?: BatchApi::getValidBatch(ProjectState::TALENT, $this->user["type"])["batch"];
+        $info["enterprise"] = $ep;
+        $info["talent_type_list"] = DictApi::findChildDictByCode("talent_type");
+        if ($info["talent_condition"]) {
+            $info["isSalary"] = \app\common\api\TalentConditionApi::getOne($info["talent_condition"])["isSalary"] ?: 0;
+        }
+        return view("", ["year" => $batch, "checkState" => $checkState, "row" => $info]);
+    }
+
+    /**
+     * 旧第二步
+     * @param \think\Request $request
+     * @return type
+     */
+    public function second(\think\Request $request) {
+        if ($this->user["type"] != 1)
+            return "此入口仅供晋江市人才申报,晋江集成电路人才请使用新统一申报入口";
+        $params = $request->param();
+        $id = $params["id"];
+        $info = \app\common\api\VerifyApi::getTalentInfoById($id);
+        $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
+        if ($request->isPost()) {
+            if (!$info || $info["enterprise_id"] != $this->user["uid"]) {
+                $res = ["msg" => "没有对应的人才认定申报信息"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+            $checkState = $info["checkState"];
+            if ($checkState == TalentState::SCND_SAVE || $checkState == TalentState::BASE_REVERIFY_PASS) {
+                $this->save($info, $request, TalentState::SCND_SAVE);
+                exit();
+            } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL])) {
+                $res = ["msg" => "审核不通过,不能再保存"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+            $res = ["msg" => "已提交审核,请耐心等待"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        $enterprise_info = \app\common\model\Enterprise::find($this->user["uid"]);
+        $info["enterprise"] = $enterprise_info;
+        $batch = $info["apply_year"] ?: BatchApi::getValidBatch(ProjectState::TALENT, $enterprise_info["type"])["batch"];
+        return view("second", ["year" => $batch, "row" => $info]);
+    }
+
+    public function view(\think\Request $request) {
+        switch ($this->user["type"]) {
+            case 1:
+                $tpl = "view"; //晋江人才
+                break;
+            case 2:
+                $tpl = "ic_view"; //集成电路
+                break;
+        }
+        $id = $request->param("id");
+        $info = \app\common\api\VerifyApi::getTalentInfoById($id);
+        if ($info["isImport"]) {
+            //$tpl = "no_file_view";
+        }
+        return view($tpl, ["row" => $info]);
+    }
+
+    /**
+     * 提交表单(旧第二步)
+     */
+    public function submit() {
+        $params = $this->request->param();
+        $id = $params["id"];
+        if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
+            $res = ["msg" => "没有对应的人才认定申报信息"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        if ($info) {
+            $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
+        }
+        $checkState = $info["checkState"];
+        if ($checkState == TalentState::SCND_SAVE || $checkState == TalentState::BASE_REVERIFY_PASS) {
+            $field_dict = \app\common\api\DictApi::getTalentFields(2);
+
+            $no_empty = ["talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "bank", "bank_number", "bank_branch_name",
+                "bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"];
+
+            $where = [];
+            $where[] = ["rel", "=", "study_abroad"];
+            $where[] = ["step", "=", 2];
+            $where[] = ["project", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["isConditionFile", "<>", 1];
+            $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
+            $abroad_file_ids = null;
+            if ($abroad_files)
+                $abroad_file_ids = array_column($abroad_files, "id");
+
+            if ($params["study_abroad"] == 1) {
+                $no_empty[] = "abroad_school";
+                $no_empty[] = "abroad_major";
+            }
+            if (in_array($params["source"], [1, 3])) {
+                $no_empty[] = "source_batch";
+                $no_empty[] = "fujian_highcert_pubtime";
+                $no_empty[] = "fujian_highcert_exptime";
+                if ($params["source"] == 3) {
+                    $no_empty[] = "source_city";
+                }
+            }
+            if (in_array($params["source"], [2, 4])) {
+                $no_empty[] = "source_batch";
+                $no_empty[] = "quanzhou_highcert_pubtime";
+                $no_empty[] = "quanzhou_highcert_exptime";
+                if ($params["source"] == 4) {
+                    $no_empty[] = "source_county";
+                }
+            }
+
+            $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
+
+            if ($condition_info["isSalary"] == 1) {
+                $no_empty[] = "annual_salary";
+            }
+            $no_empty = array_filter($no_empty);
+            $return = [];
+            foreach ($no_empty as $key) {
+                if (!$params[$key]) {
+                    $return[] = sprintf("请填写“%s”", $field_dict[$key]);
+                }
+            }
+            if (count($return) > 0) {
+                $res = ["msg" => implode("<br>", $return)];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+
+            if ($condition_info["bindFileTypes"] && in_array($info["source"], [3, 4, 5])) {
+                $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
+                $whr[] = ["must", "=", 1];
+            }
+            $where = [];
+            $where[] = ["step", "=", 2];
+            $where[] = ["project", "=", 1];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["isConditionFile", "<>", 1];
+            if ($whr) {
+                $filetypes = Db::table("new_common_filetype")->whereOr([$where, $whr])->select()->toArray();
+            } else {
+                $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
+            }
+            $ft_ids = array_column($filetypes, "id");
+            if ($params["study_abroad"] == 1) {
+                //选中留学,如果存在留学附件变成必传
+                $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
+            } else {
+                //没选中,留学附件就算设成必传也不用验证
+                $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
+            }
+            $whr = [];
+            $whr[] = ["typeId", "in", $ft_ids];
+            $whr[] = ["mainId", "=", $id];
+            $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
+            $upload_type_counts = count($distinct_filetypes);
+            if ($upload_type_counts != count($ft_ids)) {
+                $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+
+            $this->save($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])) {
+            $res = ["msg" => "审核不通过,不能再提交审核"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        $res = ["msg" => "已提交审核,请耐心等待"];
+        echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+        exit;
+    }
+
+    public function submitToCheck() {
+        switch ($this->user["type"]) {
+            case 1:
+                return $this->submitToCheck_JJRC();
+            case 2:
+                return $this->submitToCheck_IC();
+        }
+    }
+
+    /**
+     * 提交表单(新:混合基础信息人才申报信息)晋江人才
+     */
+    private function submitToCheck_JJRC() {
+        $params = $this->request->param();
+        $id = $params["id"];
+        $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
+        if ($info) {
+            $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
+        }
+        $checkState = $info["checkState"];
+        if ($checkState == TalentState::SCND_SAVE || !$id) {
+            $field_dict = \app\common\api\DictApi::getTalentFields(4, $info["isImport"]);
+
+            $no_empty = ["name", "nation", "card_type", "card_number", "sex", "birthday", "politics", "nationality", "province", "city", "talent_type", "experience", "education",
+                "talent_arrange", "talent_condition", "identifyGetTime", "bank", "bank_number", "bank_branch_name",
+                "bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"]; //"highest_degree", "graduate_school", "major",
+
+            $where = [];
+            $where[] = ["rel", "=", "study_abroad"];
+            $where[] = ["project", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["isConditionFile", "<>", 1];
+            $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
+            $abroad_file_ids = null;
+            if ($abroad_files)
+                $abroad_file_ids = array_column($abroad_files, "id");
+
+            if (in_array($params["talent_type"], [1, 2])) {
+                $no_empty[] = "tax_insurance_month";
+                $no_empty[] = "labor_contract_rangetime";
+            }
+            if ($params["talent_type"] == 3) {
+                $no_empty[] = "pre_import_type";
+            }
+            if ($params["study_abroad"] == 1) {
+                $no_empty[] = "abroad_school";
+                $no_empty[] = "abroad_major";
+            }
+            if (in_array($params["source"], [1, 3])) {
+                //$no_empty[] = "source_batch";
+                //$no_empty[] = "fujian_highcert_pubtime";
+                //$no_empty[] = "fujian_highcert_exptime";
+                if ($params["source"] == 3) {
+                    $no_empty[] = "source_city";
+                }
+            }
+            if (in_array($params["source"], [2, 4])) {
+                //$no_empty[] = "source_batch";
+                //$no_empty[] = "quanzhou_highcert_pubtime";
+                //$no_empty[] = "quanzhou_highcert_exptime";
+                if ($params["source"] == 4) {
+                    $no_empty[] = "source_county";
+                }
+            }
+
+            $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
+
+            if ($condition_info["isSalary"] == 1) {
+                $no_empty[] = "annual_salary";
+            }
+            $no_empty = array_filter($no_empty);
+            $return = [];
+            foreach ($no_empty as $key) {
+                if (!$params[$key]) {
+                    $return[] = sprintf("请填写“%s”", $field_dict[$key]);
+                }
+            }
+            if (count($return) > 0) {
+                $res = ["msg" => implode("<br>", $return)];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+            $isMatchZhiren = $info["isImport"] && $params["isMatchZhiren"] == 1 ? true : false;
+            if ($condition_info["bindFileTypes"] && in_array($info["source"], [3, 4, 5]) && !$isMatchZhiren) {
+                $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
+                $whr[] = ["must", "=", 1];
+            }
+            $where = [];
+            $where[] = ["project", "=", 1];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["isConditionFile", "<>", 1];
+            if ($whr) {
+                $filetypes = Db::table("new_common_filetype")->whereOr([$where, $whr])->select()->toArray();
+            } else {
+                $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
+            }
+            $age = 0;
+            if ($params["birthday"]) {
+                $birthtime = strtotime($params["birthday"]);
+                $currentYear = date("Y");
+                $currentMonth = date("n");
+                $birthdayYear = date("Y", $birthtime);
+                $birthdayMonth = date("n", $birthtime);
+                $age = ($currentYear * 12 + $currentMonth - $birthdayYear * 12 - $birthdayMonth) / 12;
+            }
+            $ft_ids = [];
+            $deletes = [];
+            foreach ($filetypes as $ft) {
+                if ($ft["option"]) {
+                    if ($ft["rel"] == "birthday") {
+                        if ($age < $ft["option"]) {
+                            $deletes[] = $ft["id"];
+                            continue;
+                        }
+                    } else {
+                        $selectVal = $params[$ft["rel"]];
+                        $conditions = array_filter(explode(",", $ft["option"]));
+                        if (!in_array($selectVal, $conditions)) {
+                            $deletes[] = $ft["id"];
+                            continue;
+                        }
+                    }
+                }
+                $ft_ids[] = $ft["id"];
+            }
+            if ($params["study_abroad"] == 1) {
+                //选中留学,如果存在留学附件变成必传
+                $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
+            } else {
+                //没选中,留学附件就算设成必传也不用验证
+                $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
+            }
+            $whr = [];
+            if ($id) {
+                $whr[] = ["mainId", "=", $id];
+            } else {
+                if ($params["uploadFiles"])
+                    $whr[] = ["id", "in", $params["uploadFiles"]];
+            }
+            $whr[] = ["typeId", "in", $ft_ids];
+            $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
+            $upload_type_counts = count($distinct_filetypes);
+            if ($upload_type_counts != count($ft_ids)) {
+                $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
+                echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+                exit;
+            }
+
+            return $this->mixSave($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])) {
+            $res = ["msg" => "审核不通过,不能再提交审核"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        $res = ["msg" => "已提交审核,请耐心等待"];
+        echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
+        exit;
+    }
+
+    /**
+     * 提交表单(新:混合基础信息人才申报信息)晋江电路
+     */
+    private function submitToCheck_IC() {
+        $params = $this->request->param();
+        $id = $params["id"];
+        if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
+            return json(["msg" => "没有对应的人才认定申报信息"]);
+        }
+        if ($info) {
+            $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
+        }
+        $checkState = $info["checkState"];
+        if ($checkState == TalentState::SCND_SAVE) {
+            $field_dict = \app\common\api\DictApi::getTalentFields_IC();
+
+            $no_empty = ["name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "nation", "politics", "break_faith",
+                "phone", "email", "highest_degree", "graduate_school", "major", "study_abroad", "position", "cur_entry_time", "labor_contract_rangetime",
+                "talent_arrange", "talent_condition", "identifyConditionName", "identifyGetTime",
+                "bank", "bank_branch_name", "bank_account", "experience", "education"];
+
+            $no_empty = array_filter($no_empty);
+            $return = [];
+            foreach ($no_empty as $key) {
+                if (!$info[$key]) {
+                    $return[] = sprintf("请填写“%s”", $field_dict[$key]);
+                }
+            }
+            if (count($return) > 0) {
+                return json(["msg" => implode("<br>", $return)]);
+            }
+
+            $where = [];
+            $where[] = ["project", "=", 1];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
+            $ft_ids = array_column($filetypes, "id");
+            $whr = [];
+            $whr[] = ["typeId", "in", $ft_ids];
+            $whr[] = ["mainId", "=", $id];
+            $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
+            $upload_type_counts = count($distinct_filetypes);
+            if ($upload_type_counts != count($ft_ids)) {
+                return json(["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"]);
+            }
+
+            return $this->icSave($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]);
+        }
+        return json(["msg" => "已提交审核,请耐心等待", "code" => 500]);
+    }
+
+    /**
+     * 保存表单(旧第二步)
+     * @param type $info talent_info
+     * @param type $param request->param();
+     */
+    private function save($info, \think\Request $request, $checkState) {
+        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);
+            $data["apply_year"] = $batch["batch"];
+
+            $all_valid_keys = ["applay_year", "import_way", "cur_entry_time", "position",
+                "source", "source_batch", "fujian_highcert_pubtime", "fujian_highcert_exptime", "quanzhou_highcert_pubtime", "quanzhou_highcert_exptime", "source_city", "source_county",
+                "talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "professional", "bank", "bank_number", "bank_branch_name", "bank_account",
+                "study_abroad", "abroad_school", "abroad_major", "phone", "email", "annual_salary", "pro_qua"];
+            foreach ($all_valid_keys as $key) {
+                $data[$key] = trim($param[$key]);
+            }
+
+            if ($data["study_abroad"] == 1) {
+                $data["abroad_school"] = $param["abroad_school"];
+                $data["abroad_major"] = $param["abroad_major"];
+            } else {
+                $data["abroad_school"] = null;
+                $data["abroad_major"] = null;
+            }
+            switch ($data["source"]) {
+                case 1:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
+                    $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
+                    $data["source_city"] = null;
+                    break;
+                case 2:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
+                    $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
+                    $data["source_county"] = null;
+                    break;
+                case 3:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
+                    $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
+                    $data["source_city"] = $param["source_city"];
+                    break;
+                case 4:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
+                    $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
+                    $data["source_county"] = $param["source_county"];
+                    break;
+            }
+
+            $condition_info = Db::table("new_talent_condition")->findOrEmpty($param["talent_condition"]);
+            if ($condition_info["isSalary"] == 1) {
+                $data["annual_salary"] = $param["annual_salary"];
+            } else {
+                $data["annual_salary"] = null;
+            }
+
+            if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
+                //真实状态8是驳回,需要判断什么字段可以提交                
+                $modify_fields = array_filter(explode(",", $info["modify_fields"]));
+                $tmp_data = $data;
+                $data = [];
+                foreach ($modify_fields as $field) {
+                    $data[$field] = $tmp_data[$field];
+                }
+            }
+            $data["checkState"] = $checkState;
+            $data["id"] = $info["id"];
+            $success_msg = "提交成功";
+            $error_msg = "提交失败";
+            if ($checkState == TalentState::SCND_SAVE) {
+                $last_log = TalentLogApi::getLastLog($data["id"], 1);
+                if ($last_log["new_state"] != TalentState::SCND_SAVE) {
+                    TalentLogApi::write(1, $data["id"], $checkState, "保存认定材料未提交", 1);
+                }
+                TalentModel::update($data);
+            } else if ($checkState == TalentState::SCND_SUBMIT) {
+                $success_msg = "提交成功";
+                $error_msg = "提交失败";
+                $data["new_submit_time"] = date("Y-m-d H:i:s");
+                TalentModel::update($data);
+                TalentLogApi::write(1, $info["id"], $checkState, "确认提交审核", 1);
+            } else {
+                throw new ValidateException($error_msg);
+            }
+            $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $info["id"], "checkState" => $checkState]];
+            $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
+        } catch (ValidateException $e) {
+            $res = ["msg" => $e->getMessage()];
+            $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
+        }
+    }
+
+    /**
+     * 保存表单(新:混合基础信息人才申报信息)
+     * @param type $info talent_info
+     * @param type $param request->param();
+     */
+    private function mixSave($info, \think\Request $request, $checkState) {
+        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);
+            $id = $param["id"];
+            if ($id) {
+                if (!$info || $info["id"] != $id || $info["enterprise_id"] != $this->user["uid"]) {
+                    throw new ValidateException("没有对应的人才认定申报信息");
+                }
+            }
+            $files = $param["uploadFiles"];
+            $data["headimgurl"] = $info["headimgurl"];
+            if ($request->file()) {
+                $headimg = $request->file("photo");
+                $upload = new \app\common\api\UploadApi();
+                $result = $upload->uploadOne($headimg, "image", "talent/photo");
+                if ($result->code != 200) {
+                    throw new ValidateException($result->msg);
+                }
+                $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
+                $width = imagesx($file);
+                $height = imagesy($file);
+                //免冠二寸照长宽413:579
+                if ($width * 579 != $height * 413) {
+                    @unlink("storage/" . $result->filepath); //像素不符合,删除上传文件                    
+                    throw new ValidateException("近期免冠半身彩照(二寸)不符合二寸像素标准。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
+                }
+                if ($info && $info["headimgurl"]) {
+                    //如果新照片符合像素要求,则删除旧照片
+                    $old_head_url = "storage/" . $info["headimgurl"];
+                    if (file_exists($old_head_url))
+                        @unlink($old_head_url);
+                }
+                $data["headimgurl"] = $result->filepath;
+            }
+            if (!$data["headimgurl"] && $checkState == TalentState::SCND_SUBMIT)
+                throw new ValidateException("请上传头像。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
+
+            $where = [];
+            $where[] = ["project", "=", 1];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
+
+            $age = 0;
+            if ($param["birthday"]) {
+                $birthday = $param["birthday"];
+                $birthdayYear = substr($birthday, 0, 4);
+                $currentYear = date("Y");
+                $age = $currentYear - $birthdayYear;
+            }
+            $ft_ids = [];
+            $deletes = [];
+            foreach ($filetypes as $ft) {
+                if ($ft["option"]) {
+                    if ($ft["rel"] == "birthday") {
+                        if ($age < $ft["option"]) {
+                            $deletes[] = $ft["id"];
+                            continue;
+                        }
+                    } else {
+                        $selectVal = $param[$ft["rel"]];
+                        $conditions = array_filter(explode(",", $ft["option"]));
+                        if (!in_array($selectVal, $conditions)) {
+                            $deletes[] = $ft["id"];
+                            continue;
+                        }
+                    }
+                }
+                $ft_ids[] = $ft["id"];
+            }
+
+            $data["apply_year"] = $batch["batch"];
+            $data["isMatchZhiren"] = $param["isMatchZhiren"] ?: 0;
+            $all_valid_keys = ["talent_type", "name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "experience", "education",
+                "import_way", "cur_entry_time", "position",
+                "source", "source_batch", "fujian_highcert_pubtime", "fujian_highcert_exptime", "quanzhou_highcert_pubtime", "quanzhou_highcert_exptime", "source_city", "source_county",
+                "talent_arrange", "talent_condition", "identifyGetTime", "highest_degree", "graduate_school", "major", "professional", "bank", "bank_number", "bank_branch_name", "bank_account",
+                "study_abroad", "abroad_school", "abroad_major", "phone", "email", "annual_salary", "pro_qua"];
+            foreach ($all_valid_keys as $key) {
+                $data[$key] = trim($param[$key]);
+            }
+            $data["return"] = 0; //流出晋江满3年后又返回晋江的,只有talent_type=2时可以填写且非必填
+            if (in_array($data["talent_type"], [1, 2])) {
+                $data["tax_insurance_month"] = $param["tax_insurance_month"];
+                $data["labor_contract_rangetime"] = $param["labor_contract_rangetime"];
+                $data["salary_pay_way"] = $param["salary_pay_way"];
+                $data["salary_pay_month"] = $param["salary_pay_month"];
+                $data["fst_work_time"] = $param["fst_work_time"];
+                $data['pre_import_type'] = null;
+                if ($data["talent_type"] == 2) {
+                    $data["return"] = $param["return"];
+                }
+            } else {
+                $data["tax_insurance_month"] = null;
+                $data["labor_contract_rangetime"] = null;
+                $data["salary_pay_way"] = null;
+                $data["salary_pay_month"] = null;
+                $data["fst_work_time"] = null;
+                $data['pre_import_type'] = $param["pre_import_type"];
+            }
+
+            if ($data["study_abroad"] == 1) {
+                $data["abroad_school"] = $param["abroad_school"];
+                $data["abroad_major"] = $param["abroad_major"];
+            } else {
+                $data["abroad_school"] = null;
+                $data["abroad_major"] = null;
+            }
+            switch ($data["source"]) {
+                case 1:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
+                    $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
+                    $data["source_city"] = null;
+                    break;
+                case 2:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
+                    $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
+                    $data["source_county"] = null;
+                    break;
+                case 3:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
+                    $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
+                    $data["source_city"] = $param["source_city"];
+                    break;
+                case 4:
+                    $data["source_batch"] = $param["source_batch"];
+                    $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
+                    $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
+                    $data["source_county"] = $param["source_county"];
+                    break;
+            }
+
+            $condition_info = Db::table("new_talent_condition")->findOrEmpty($param["talent_condition"]);
+            if ($condition_info["isSalary"] == 1) {
+                $data["annual_salary"] = $param["annual_salary"];
+            } else {
+                $data["annual_salary"] = null;
+            }
+            if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
+                //真实状态11是驳回,需要判断什么字段可以提交                
+                $modify_fields = array_filter(explode(",", $info["modify_fields"]));
+                $tmp_data = $data;
+                $data = [];
+                foreach ($modify_fields as $field) {
+                    $data[$field] = $tmp_data[$field];
+                }
+            }
+            $data["checkState"] = $checkState;
+            $data["id"] = $id;
+            $success_msg = "提交成功";
+            $error_msg = "提交失败";
+            if ($checkState == TalentState::SCND_SAVE) {
+                $success_msg = "保存成功";
+                if ($data["id"]) {
+                    //编辑
+                    TalentModel::update($data);
+                    $last_log = TalentLogApi::getLastLog($data["id"], 1);
+                    if ($last_log["new_state"] != TalentState::SCND_SAVE) {
+                        TalentLogApi::write(1, $data["id"], $checkState, "保存未提交", 1);
+                    } else {
+                        if (!$last_log["companyId"]) {
+                            TalentLogApi::setActive($last_log["id"], 1); //更新修改时间
+                        }
+                    }
+                } else {
+                    //新增
+                    $data["enterprise_id"] = $this->user["uid"];
+                    $id = TalentModel::insertGetId($data);
+                    TalentLogApi::write(1, $id, $checkState, "保存未提交", 1);
+                    $whr = [];
+                    $whr[] = ["fileId", "in", $files];
+                    $upd_checklog["mainId"] = $id;
+                    Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
+                }
+            } else if ($checkState == TalentState::SCND_SUBMIT) {
+                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");
+                }
+                if ($data["id"]) {
+                    TalentModel::update($data);
+                } else {
+                    //新增
+                    $data["enterprise_id"] = $this->user["uid"];
+                    $id = TalentModel::insertGetId($data);
+                    $whr = [];
+                    $whr[] = ["fileId", "in", $files];
+                    $upd_checklog["mainId"] = $id;
+                    Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
+                }
+                TalentLogApi::write(1, $id, $checkState, "确认提交审核", 1);
+            } else {
+                throw new ValidateException($error_msg);
+            }
+
+            if ($id) {
+                if ($deletes) {
+                    //删除多余的附件,一般是选择人才类型留下来的
+                    $whr = [];
+                    $whr[] = ["typeId", "in", $deletes];
+                    $whr[] = ["id", "in", $files];
+                    $_wait_del_files = Db::table("new_talent_file")->where($whr)->select()->toArray();
+                    $_logfileIds[] = [];
+                    foreach ($_wait_del_files as $_del_file) {
+                        $_logfileIds[] = $_del_file["id"];
+                        @unlink("storage/" . $_del_file["url"]);
+                    }
+                    Db::table("new_talent_file")->where($whr)->delete();
+                    if ($_logfileIds) {
+                        $whr = [];
+                        $whr[] = ["fileId", "in", $_logfileIds];
+                        $_upd_checklog["description"] = "删除附件";
+                        $_upd_checklog["updateUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"]);
+                        $_upd_checklog["updateTime"] = date("Y-m-d H:i:s");
+                        Db::table("new_talent_checklog")->where($whr)->save($_upd_checklog);
+                    }
+                }
+
+                $whr = [];
+                $whr[] = ["id", "in", $files];
+                Db::table("new_talent_file")->where($whr)->save(["mainId" => $id]);
+                $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $id, "checkState" => $checkState]];
+                $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
+                echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+                exit();
+            } else {
+                throw new ValidateException($error_msg);
+            }
+        } catch (ValidateException $e) {
+            $res = ["msg" => $e->getMessage()];
+            $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
+        } catch (\think\Exception $e) {
+            $res = ["msg" => "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()];
+            $logInfo = [
+                "enterprise_id" => $this->user["uid"],
+                "data" => $data,
+                "controller" => $this->request->controller(),
+                "action" => $this->request->action(),
+                "errCode" => $e->getCode(),
+                "errMsg" => $e->getMessage()
+            ];
+            Log::write($logInfo, "error");
+            $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
+            echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
+            exit();
+        }
+    }
+
+    private function icSave($info, \think\Request $request, $checkState) {
+        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);
+            $id = $param["id"];
+            if ($id) {
+                if (!$info || $info["id"] != $id || $info["enterprise_id"] != $this->user["uid"]) {
+                    throw new ValidateException("没有对应的人才认定申报信息");
+                }
+            }
+            $files = $param["uploadFiles"];
+            $data["headimgurl"] = $info["headimgurl"];
+            if ($request->file()) {
+                $headimg = $request->file("photo");
+                $upload = new \app\common\api\UploadApi();
+                $result = $upload->uploadOne($headimg, "image", "talent/photo");
+                $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
+                $width = imagesx($file);
+                $height = imagesy($file);
+                //免冠二寸照长宽413:579
+                if ($width * 579 != $height * 413) {
+                    @unlink("storage/" . $result->filepath); //像素不符合,删除上传文件                    
+                    throw new ValidateException("近期免冠半身彩照(二寸)不符合二寸像素标准。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
+                }
+                if ($info && $info["headimgurl"]) {
+                    //如果新照片符合像素要求,则删除旧照片
+                    $old_head_url = "storage/" . $info["headimgurl"];
+                    if (file_exists($old_head_url))
+                        @unlink($old_head_url);
+                }
+                $data["headimgurl"] = $result->filepath;
+            }
+            if (!$data["headimgurl"] && $checkState == TalentState::SCND_SUBMIT)
+                throw new ValidateException("请上传头像。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
+
+            $data["apply_year"] = $batch["batch"];
+
+            $all_valid_keys = ["name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "experience", "education", "break_faith",
+                "phone", "email", "highest_degree", "graduate_school", "major", "study_abroad",
+                "position", "cur_entry_time", "labor_contract_rangetime",
+                "talent_arrange", "talent_condition", "identifyConditionName", "identifyGetTime", "title", "pro_qua",
+                "bank", "bank_branch_name", "bank_account", "description"];
+            foreach ($all_valid_keys as $key) {
+                $value = trim($param[$key]);
+                if ($value) {
+                    $data[$key] = $value;
+                }
+            }
+
+            if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
+                //真实状态11是驳回,需要判断什么字段可以提交                
+                $modify_fields = array_filter(explode(",", $info["modify_fields"]));
+                $tmp_data = $data;
+                $data = [];
+                foreach ($modify_fields as $field) {
+                    $data[$field] = $tmp_data[$field];
+                }
+            }
+            $data["checkState"] = $checkState;
+            $data["id"] = $id;
+            $success_msg = "提交成功";
+            $error_msg = "提交失败";
+            if ($checkState == TalentState::SCND_SAVE) {
+                $success_msg = "保存成功";
+                if ($data["id"]) {
+                    //编辑
+                    TalentModel::update($data);
+                    $last_log = TalentLogApi::getLastLog($data["id"], 1);
+                    if ($last_log["new_state"] != TalentState::SCND_SAVE) {
+                        TalentLogApi::write(1, $data["id"], $checkState, "保存未提交", 1);
+                    } else {
+                        if (!$last_log["companyId"]) {
+                            TalentLogApi::setActive($last_log["id"], 1); //更新修改时间
+                        }
+                    }
+                } else {
+                    //新增
+                    $data["enterprise_id"] = $this->user["uid"];
+                    $id = TalentModel::insertGetId($data);
+                    TalentLogApi::write(1, $id, $checkState, "保存未提交", 1);
+                    $whr = [];
+                    $whr[] = ["fileId", "in", $files];
+                    $upd_checklog["mainId"] = $id;
+                    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));
+                exit();
+            } else if ($checkState == TalentState::SCND_SUBMIT) {
+                $data["new_submit_time"] = date("Y-m-d H:i:s");
+                TalentModel::update($data);
+                TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
+                return json(["msg" => $success_msg, "code" => 200]);
+            } 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()]);
+            }
+        } catch (\think\Exception $e) {
+            $res = ["msg" => "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()];
+            $logInfo = [
+                "enterprise_id" => $this->user["uid"],
+                "data" => $data,
+                "controller" => $this->request->controller(),
+                "action" => $this->request->action(),
+                "errCode" => $e->getCode(),
+                "errMsg" => $e->getMessage()
+            ];
+            Log::write($logInfo, "error");
+            if ($checkState == TalentState::SCND_SAVE) {
+                echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+                exit();
+            } else {
+                return json($res);
+            }
+        }
+    }
+
+    public function delete() {
+        $id = $this->request->param("talentInfoId");
+        $info = Talent::chkIsOwner($id, $this->user["uid"]);
+        if (!$info) {
+            return json(["msg" => "操作失败"]);
+        }
+        $checkState = $info["checkState"];
+        if (in_array($checkState, [0, 1])) {
+            $log = TalentLogApi::getLastLog($id, 1);
+            if ($log["state"] > 1) {
+                //有提交审核记录
+                return json(["msg" => "该申报已提交审核,无法删除"]);
+            }
+        }
+        $data["id"] = $id;
+        $data["delete"] = 1;
+        TalentModel::update($data);
+        return json(["msg" => "删除成功"]);
+    }
+
+//    public function mixDelete() {
+//        $id = $this->request->param("talentInfoId");
+//        $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
+//        if (!$info) {
+//            return json(["msg" => "操作失败"]);
+//        }
+//        $checkState = $info["checkState"];
+//        if (in_array($checkState, [0, TalentState::SCND_SAVE])) {
+//            $data["id"] = $id;
+//            $data["delete"] = 1;
+//            TalentModel::update($data);
+//            return json(["msg" => "删除成功"]);
+//        }
+//        return json(["msg" => "该申报已提交审核,无法删除"]);
+//    }
+}

+ 190 - 0
app/enterprise/validate/LivingAllowance.php

@@ -0,0 +1,190 @@
+<?php
+
+namespace app\enterprise\validate;
+
+use think\Validate;
+
+/**
+ * Description of LivingAllowance
+ * @author sgq
+ */
+class LivingAllowance extends Validate {
+
+    protected $rule = [
+        //"name" => "regex:/^[\x{4e00}-\x{9fa5}A-Za-z ]+$/u",
+        "nation" => "checkInSelect:nation,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57",
+        "card_type" => "between:1,3",
+        "card_number" => "checkCardNumber|checkUnique:new_talent_info",
+        "sex" => "between:1,2",
+        "politics" => "checkInSelect:politics,01,02,03,04,05,06,07,08,09,10,11,12,13,14",
+        "birthday" => "dateFormat:Y-m-d",
+        "nationality" => "checkInSelect:nationality,cn,cn_hk,cn_mc,cn_tw,us,en,jp,co,nl,sg,other",
+        "talent_type" => "between:1,3",
+        "tax_insurance_month" => "checkRangeDate:tax_insurance_month",
+        "labor_contract_rangetime" => "checkRangeDate:labor_contract_rangetime",
+        "fst_work_time" => "dateFormat:Y-m-d",
+        "pre_import_type" => "between:1,2",
+        "return" => "between:0,2",
+        "salary_pay_way" => "between:1,2",
+        "salary_pay_month" => "checkRangeDate:salary_pay_month",
+        "experience" => "max:1000",
+        "education" => "max:1000",
+        "phone" => "mobile",
+        "email" => "email",
+        "highest_degree" => "checkInSelect:highest_degree,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21",
+        "study_abroad" => "between:1,2",
+        "import_way" => "between:1,3",
+        "cur_entry_time" => "dateFormat:Y-m-d",
+        "source" => "between:1,5",
+        "fujian_highcert_pubtime" => "dateFormat:Y-m-d",
+        "fujian_highcert_exptime" => "dateFormat:Y-m-d",
+        "quanzhou_highcert_pubtime" => "dateFormat:Y-m-d",
+        "quanzhou_highcert_exptime" => "dateFormat:Y-m-d",
+        "talent_arrange" => "between:1,7",
+        "bank" => "regex:/^[\x{4e00}-\x{9fa5}]+银行$/u",
+        "bank_number" => "regex:/^\d+$/",
+        "bank_branch_name" => "regex:/^[\x{4e00}-\x{9fa5}]+银行[\x{4e00}-\x{9fa5}]+省?[\x{4e00}-\x{9fa5}]+市[\x{4e00}-\x{9fa5}]+$/u",
+        "bank_account" => "regex:/^\d+$/",
+        "break_faith" => "between:1,2",
+        "identifyGetTime" => "dateFormat:Y-m-d"
+    ];
+    protected $message = [
+        //"name.regex" => "姓名允许中文、英文、或者空格,不能含有其它字符",
+        "card_type.between" => "不存在的证件类型,请在列表中选择",
+        "card_number.checkUnique" => "身份证已经存在",
+        "sex.between" => "性别只能在预设列表中选择",
+        "politics.between" => "政治面貌只能在预设列表中选择",
+        "birthday.dateFormat" => "生日必需是有效日期格式[yyyy-MM-dd]",
+        "talent_type.between" => "不存在的人才类型,请在列表中选择",
+        "fst_work_time.dateFormat" => "来晋工作时间必需是有效的日期格式[yyyy-MM-dd]",
+        "pre_import_type.between" => "预引进类型只能在预设列表中选择",
+        "return.between" => "是否流出晋江满3年后又返回晋江的选项只能在预设列表中选择",
+        "salary_pay_way.between" => "工资发放渠道只能在预设列表中选择",
+        "experience.max" => "工作经历不能超过200个字符,请简明扼要的描述您的工作经历",
+        "education.max" => "教育背景不能超过200个字符,请简明扼要的描述您的教育背景",
+        "phone.mobile" => "请填写正确的手机号",
+        "email.email" => "电子邮箱格式错误",
+        "highest_degree.between" => "最高学历只能在预设列表中选择",
+        "study_abroad.between" => "留学经历只能选择是与否",
+        "import_way.between" => "不存在的引进方式,请在列表中选择",
+        "cur_entry_time.dateFormat" => "本单位入职时间必需是有效的日期格式[yyyy-MM-dd]",
+        "source.between" => "不存在的申报来源,请在列表中选择",
+        "fujian_highcert_pubtime.dateFormat" => "福建省高层次人才证书发证日期必需是有效的日期格式[yyyy-MM-dd]",
+        "fujian_highcert_exptime.dateFormat" => "福建省高层次人才证书有效期必需是有效的日期格式[yyyy-MM-dd]",
+        "quanzhou_highcert_pubtime.dateFormat" => "泉州高层次人才证书发证日期必需是有效的日期格式[yyyy-MM-dd]",
+        "quanzhou_highcert_exptime.dateFormat" => "泉州高层次人才证书有效期必需是有效的日期格式[yyyy-MM-dd]",
+        "talent_arrange" => "不存在的人才层次,请在列表中选择",
+        "bank.regex" => "开户银行格式应为[XX银行]",
+        "bank_number.regex" => "银行行号只能是数字",
+        "bank_branch_name.regex" => "开户银行网点格式应为[XX银行XX省XX市XX行/处]",
+        "bank_account.regex" => "银行账号只能是数字",
+        "break_faith.between" => "是否曾被相关主管部门列为失信个人只能在预设列表中选择",
+        "identifyGetTime.dateFormat" => "认定条件取得时间必需是有效的日期格式[yyyy-MM-dd]",
+    ];
+
+    protected function checkUnique($value, $rule, $data = [], $field) {
+        $db = $this->db->name($rule);
+        $pk = $db->getPk();
+        $map = [];
+        $map[] = [$field, "=", $data[$field]];
+        $map[] = ["delete", "=", 0];
+        $map[] = ["checkState", "not in", [TalentState::SCND_SAVE, 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]];
+        if ($data[$pk]) {
+            $info = $db->where("id", $data[$pk])->field($pk)->find();
+            $map[] = [$pk, "<>", $data[$pk]];
+            $map[] = ["apply_year", "=", $info["apply_year"]];
+        } else {
+            $batch = \app\common\api\BatchApi::getValidBatch(\app\common\state\ProjectState::TALENT, session("user")["type"])["batch"];
+            $map[] = ["apply_year", "=", $batch];
+        }
+        if ($db->where($map)->field($pk)->find()) {
+            return false;
+        }
+        return true;
+    }
+
+    protected function checkInSelect($value, $rule, $data = []) {
+        $title = "";
+        $select = explode(",", $rule);
+        $type = array_shift($select);
+        switch ($type) {
+            case "nation":
+                $title = "民族";
+                break;
+            case "politics":
+                $title = "政治面貌";
+                break;
+            case "nationality":
+                $title = "国籍/地区";
+                break;
+            case "highest_degree":
+                $title = "最高学历";
+                break;
+        }
+        return in_array($value, $select) ?: "{$title}只能在预设列表中选择";
+    }
+
+    protected function checkCardNumber($value, $rule, $data = []) {
+        if (!$data["card_type"]) {
+            return "填写证件号码前请先选择证件类型";
+        }
+        if ($data["card_type"] == 1) {
+            $num = strlen($value);
+            switch ($num) {
+                case 15:
+                case 18:
+                    return \app\common\api\IdCardApi::isValid($value) ?: "身份证号码不合法";
+                    break;
+                default:
+                    //return \app\common\api\IdCardApi::isValidExceptMainland($value) ?: "身份证号码不合法";
+                    break;
+            }
+            return "身份证号码不合法";
+        } else if ($data["card_type"] == 2) {
+            if (preg_match("/^[a-zA-Z0-9]{6,10}$/", $value) || preg_match("/^([0-9]{8}|[0-9]{10})$/", $value)) {
+                return true;
+            }
+            return "通行证号码不合法";
+        } else {
+            if (preg_match("/^([a-zA-z]|[0-9]){5,17}$/", $value)) {
+                return true;
+            }
+            return "护照号码不合法";
+        }
+    }
+
+    protected function checkRangeDate($value, $rule, $data = []) {
+        $title = "";
+        $format = "[yyyy-MM-dd - yyyy-MM-dd]";
+        $str = "日期";
+        switch ($rule) {
+            case "tax_insurance_month":
+                $format = "[yyyy-MM - yyyy-MM]";
+                $str = "月份";
+                if ($data["talent_type"] == 1) {
+                    $title = "缴交社会保险或个人所得税月份";
+                }
+                if ($data["talent_type"] == 2) {
+                    $title = "首次在我市缴交社会保险或个人所得税月份";
+                }
+                break;
+            case "labor_contract_rangetime":
+                $title = "劳动合同起止时间";
+                break;
+            case "salary_pay_month":
+                $format = "[yyyy-MM - yyyy-MM]";
+                $str = "月份";
+                $title = "工资发放月份";
+                break;
+        }
+        $arr = explode(" - ", $value);
+        $chk1 = strtotime($arr[0]);
+        $chk2 = strtotime($arr[1]);
+        if (!$chk1 || !$chk2)
+            return "{$title}日期范围格式应为{$format}";
+        if ($chk1 > $chk2)
+            return "{$title}起始{$str}不能大于结束{$str}";
+        return true;
+    }
+
+}

+ 1 - 1
app/enterprise/view/living_allowance/add.html

@@ -268,7 +268,7 @@
                                 </thead>
                             </table>
                             <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>
-                            <form id="uploadForm" action="${ctxPath}/api/talentInfo/addTalentFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
+                            <form id="uploadForm" action="/common/api/addTalentFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
                                 <input type='hidden' id="fileId" name="fileId" >
                                 <input type='file' id="upload_file" name="fileUrl" style='display: none'>
                                 <input type='hidden' id="mainId" name="mainId" >

+ 54 - 54
app/enterprise/view/living_allowance/edit.html → app/enterprise/view/living_allowance/apply.html

@@ -34,7 +34,7 @@
                     <div class="tabs-container" >
                         <ul class="nav nav-tabs">
                             <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">1.基础信息</a></li>
-                            <li id="fileLi" class=""><a data-toggle="tab" href="#tab-2" onclick="initFileTable(CONFIG.project_master_living_allowance,'fileTable')"  aria-expanded="false">2.附件上传</a></li>
+                            <li id="fileLi" class=""><a data-toggle="tab" href="#tab-2" onclick="initFileTable(CONFIG.project_master_living_allowance, 'fileTable')"  aria-expanded="false">2.附件上传</a></li>
                         </ul>
                     </div>
                     <div class="tab-content">
@@ -45,28 +45,28 @@
                                     <div class="panel-body">
                                         <form id="talentInfoForm" class="form-horizontal"  target="hiddenIframe">
                                             <div class="col-sm-12 form-group-sm">
-                                                <input type="hidden" name="id" id="id" value="${item.id}">
-                                                <input type="hidden" name="enterpriseId" id="enterpriseId" value="${item.id}">
-                                                <input type="hidden" name="type" id="type" value="${item.type}">
-                                                <input type="hidden" name="checkState" id="checkState" value="${item.checkState}">
+                                                <input type="hidden" name="id" id="id" value="{$row.id}">
+                                                <input type="hidden" name="enterpriseId" id="enterpriseId" value="{$enterprise.id}">
+                                                <input type="hidden" name="type" id="type" value="{$enterprise.type}">
+                                                <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
                                                 <input type="file" name="photo" id="photo" style="display: none">
-                                                <input type="hidden" name="provinceName" id="provinceName" value="${item.provinceName}">
-                                                <input type="hidden" name="cityName" id="cityName" value="${item.cityName}">
-                                                <input type="hidden" name="countyName" id="countyName" value="${item.countyName}">
-                                                <input type="hidden" name="hand" id="hand" value="${hand}">
+                                                <input type="hidden" name="provinceName" id="provinceName" value="{$row.provinceName}">
+                                                <input type="hidden" name="cityName" id="cityName" value="{$row.cityName}">
+                                                <input type="hidden" name="countyName" id="countyName" value="{$row.countyName}">
+                                                <input type="hidden" name="hand" id="hand" value="{$hand}">
                                                 <div class="row">
                                                     <div class="col-sm-11">
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>申报年度</label>
-                                                            <input type="text" readonly="readonly" class="form-control" id="year" name="year" value="${item.year}"/>
+                                                            <input type="text" readonly="readonly" class="form-control" id="year" name="year" value="{$row.year}"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>姓名</label>
-                                                            <input type="text" class="form-control" id="name" name="name" value="${item.name}"/>
+                                                            <input type="text" class="form-control" id="name" name="name" value="{$row.name}"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>性别</label>
-                                                            <select class="form-control" id="sex" name="sex" value="${item.sex}">
+                                                            <select class="form-control" id="sex" name="sex" value="{$row.sex}">
                                                                 <option value="">请选择</option>
                                                                 <option value="1">男</option>
                                                                 <option value="2">女</option>
@@ -74,39 +74,39 @@
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>出生日期</label>
-                                                            <input type="text" class="form-control date" id="birthday" name="birthday" value="${item.birthday}"/>
+                                                            <input type="text" class="form-control date" id="birthday" name="birthday" value="{$row.birthday}"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>国籍/地区</label>
-                                                            <select class="form-control" id="nationality" name="nationality" value="${item.nationality}">
+                                                            <select class="form-control" id="nationality" name="nationality" value="{$row.nationality}">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>籍贯省</label>
-                                                            <select class="form-control " value="${item.provinceCode}" onchange="LivingAllowanceInfoInfoDlg.afterSelectProvince()" id="provinceCode" name="provinceCode">
+                                                            <select class="form-control " value="{$row.provinceCode}" onchange="LivingAllowanceInfoInfoDlg.afterSelectProvince()" id="provinceCode" name="provinceCode">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>籍贯市</label>
-                                                            <select class="form-control" value="${item.cityCode}" onchange="LivingAllowanceInfoInfoDlg.afterSelectCity()" id="cityCode" name="cityCode"></select>
+                                                            <select class="form-control" value="{$row.cityCode}" onchange="LivingAllowanceInfoInfoDlg.afterSelectCity()" id="cityCode" name="cityCode"></select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>籍贯县</label>
-                                                            <select class="form-control" value="${item.countyCode}" id="countyCode" name="countyCode"></select>
+                                                            <select class="form-control" value="{$row.countyCode}" id="countyCode" name="countyCode"></select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>民族</label>
-                                                            <select class="form-control" value="${item.nation}" id="nation" name="nation">
+                                                            <select class="form-control" value="{$row.nation}" id="nation" name="nation">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>政治面貌</label>
-                                                            <select class="form-control" value="${item.politics}" id="politics" name="politics">
+                                                            <select class="form-control" value="{$row.politics}" id="politics" name="politics">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>证件类型</label>
-                                                            <select class="form-control" value="${item.cardType}" id="cardType" name="cardType">
+                                                            <select class="form-control" value="{$row.cardType}" id="cardType" name="cardType">
                                                                 <option value="">请选择</option>
                                                                 <option value="1">身份证</option>
                                                                 <option value="2">通行证</option>
@@ -115,136 +115,136 @@
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>证件号码</label>
-                                                            <input class="form-control" value="${item.idCard}" id="idCard" name="idCard">
+                                                            <input class="form-control" value="{$row.idCard}" id="idCard" name="idCard">
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>首次来晋工作时间</label>
-                                                            <input type="text" class="form-control date" value="${item.firstInJJTime}" id="firstInJJTime" name="firstInJJTime"/>
+                                                            <input type="text" class="form-control date" value="{$row.firstInJJTime}" id="firstInJJTime" name="firstInJJTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>单位名称</label>
-                                                            <input type="text" class="form-control" value="${item.enterpriseName}" id="enterpriseName"  name="enterpriseName" readonly="readonly" value="${enterprise.name}" />
+                                                            <input type="text" class="form-control" value="{$row.enterpriseName}" id="enterpriseName"  name="enterpriseName" readonly="readonly" value="{$enterprise.name}" />
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>行业领域</label>
-                                                            <select type="text" class="form-control" value="${item.industryField}" id="industryField" value="${enterprise.industryField}" name="industryField" disabled="disabled">
+                                                            <select type="text" class="form-control" value="{$row.industryField}" id="industryField" value="{$enterprise.industryField}" name="industryField" disabled="disabled">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>人才标签</label>
-                                                            <select class="form-control" id="talentType" value="${item.talentType}" name="talentType"  ></select>
+                                                            <select class="form-control" id="talentType" value="{$row.talentType}" name="talentType"  ></select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>所属镇街</label>
-                                                            <select class="form-control" id="address" value="${item.address}" name="address" disabled="disabled"></select>
+                                                            <select class="form-control" id="address" value="{$row.address}" name="address" disabled="disabled"></select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3" style="display: none">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>首次来晋行政介绍信时间</label>
-                                                            <input type="text" class="form-control date" value="${item.letterTime}" id="letterTime" name="letterTime"/>
+                                                            <input type="text" class="form-control date" value="{$row.letterTime}" id="letterTime" name="letterTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>引进方式</label>
-                                                            <select class="form-control" id="introductionMode" value="${item.introductionMode}" name="introductionMode" data-placeholder="引进方式">
+                                                            <select class="form-control" id="introductionMode" value="{$row.introductionMode}" name="introductionMode" data-placeholder="引进方式">
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>本单位入职时间</label>
-                                                            <input type="text" class="form-control date" value="${item.entryTime}" id="entryTime" name="entryTime"/>
+                                                            <input type="text" class="form-control date" value="{$row.entryTime}" id="entryTime" name="entryTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>职务</label>
-                                                            <input type="text" class="form-control" value="${item.post}" id="post" name="post"/>
+                                                            <input type="text" class="form-control" value="{$row.post}" id="post" name="post"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>工作合同开始时间</label>
-                                                            <input type="text" class="form-control date" value="${item.startTime}" id="startTime" name="startTime"/>
+                                                            <input type="text" class="form-control date" value="{$row.startTime}" id="startTime" name="startTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>工作合同结束时间</label>
-                                                            <input type="text" class="form-control date" value="${item.endTime}" id="endTime" name="endTime"/>
+                                                            <input type="text" class="form-control date" value="{$row.endTime}" id="endTime" name="endTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>最高学历</label>
-                                                            <select class="form-control" id="highEducation" value="${item.highEducation}" name="highEducation"></select>
+                                                            <select class="form-control" id="highEducation" value="{$row.highEducation}" name="highEducation"></select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class=" control-label spacing"><span style="color: red">*</span>学位证书取得时间</label>
-                                                            <input type="text" class="form-control date" id="studyAbroadTime" value="${item.studyAbroadTime}" name="studyAbroadTime"/>
+                                                            <input type="text" class="form-control date" id="studyAbroadTime" value="{$row.studyAbroadTime}" name="studyAbroadTime"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>毕业院校</label>
-                                                            <input type="text" class="form-control" value="${item.graduateSchool}" id="graduateSchool" name="graduateSchool">
+                                                            <input type="text" class="form-control" value="{$row.graduateSchool}" id="graduateSchool" name="graduateSchool">
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>专业</label>
-                                                            <input type="text" class="form-control" value="${item.major}" id="major" name="major"/>
+                                                            <input type="text" class="form-control" value="{$row.major}" id="major" name="major"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing">职称</label>
-                                                            <input type="text" class="form-control" value="${item.title}" id="title" name="title"/>
+                                                            <input type="text" class="form-control" value="{$row.title}" id="title" name="title"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing">国家职业资格</label>
-                                                            <input type="text" class="form-control" value="${item.professionalQualifications}" id="professionalQualifications" name="professionalQualifications"/>
+                                                            <input type="text" class="form-control" value="{$row.professionalQualifications}" id="professionalQualifications" name="professionalQualifications"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing">是否有留学经历</label>
-                                                            <select class="form-control" id="studyAbroad" value="${item.studyAbroad}" name="studyAbroad">
+                                                            <select class="form-control" id="studyAbroad" value="{$row.studyAbroad}" name="studyAbroad">
                                                                 <option value="2">否</option>
                                                                 <option value="1">是</option>
                                                             </select>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>手机号码</label>
-                                                            <input type="text" class="form-control" value="${item.phone}" id="phone" name="phone" maxlength="11"/>
+                                                            <input type="text" class="form-control" value="{$row.phone}" id="phone" name="phone" maxlength="11"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>电子邮箱</label>
-                                                            <input type="text" class="form-control" value="${item.email}" id="email" name="email"/>
+                                                            <input type="text" class="form-control" value="{$row.email}" id="email" name="email"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>开户银行</label>
-                                                            <input type="text" class="form-control" value="${item.bank}" onchange="Feng.bankChange('bank','bankNumber')" id="bank" name="bank" placeholder="XX银行"/>
+                                                            <input type="text" class="form-control" value="{$row.bank}" onchange="Feng.bankChange('bank', 'bankNumber')" id="bank" name="bank" placeholder="XX银行"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>银行行号</label>
-                                                            <input type="text" class="form-control" value="${item.bankNumber}" id="bankNumber" name="bankNumber"/>
+                                                            <input type="text" class="form-control" value="{$row.bankNumber}" id="bankNumber" name="bankNumber"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>开户银行网点</label>
-                                                            <input type="text" class="form-control" value="${item.bankNetwork}" id="bankNetwork" name="bankNetwork" placeholder="XX银行XX省XX市XX支行/分行/分理处"/>
+                                                            <input type="text" class="form-control" value="{$row.bankNetwork}" id="bankNetwork" name="bankNetwork" placeholder="XX银行XX省XX市XX支行/分行/分理处"/>
                                                         </div>
                                                         <div class="rowGroup col-sm-3">
                                                             <label class="control-label spacing"><span style="color: red">*</span>银行账号</label>
-                                                            <input type="text" class="form-control" value="${item.bankAccount}" id="bankAccount" name="bankAccount" />
+                                                            <input type="text" class="form-control" value="{$row.bankAccount}" id="bankAccount" name="bankAccount" />
                                                         </div>
                                                     </div>
                                                     <div class="col-sm-1">
-                                                        <img id="photoImg" src="${item.photo}" onclick="$('#photo').click()" style="height: 110px;width: 76px;padding-bottom: 5px;">
+                                                        <img id="photoImg" src="{$row.photo}" onclick="$('#photo').click()" style="height: 110px;width: 76px;padding-bottom: 5px;">
                                                     </div>
                                                 </div>
                                                 <div class="row">
                                                     <div class="rowGroup col-sm-12">
                                                         <label class=" control-label spacing"><span style="color: red">*</span>教育背景及工作简历</label>
-                                                        <textarea style="overflow: auto;word-break: break-all; " class="form-control" id="educationAndResume" name="educationAndResume" rows="2">${item.educationAndResume}</textarea>
+                                                        <textarea style="overflow: auto;word-break: break-all; " class="form-control" id="educationAndResume" name="educationAndResume" rows="2">{$row.educationAndResume}</textarea>
                                                     </div>
                                                 </div>
                                                 <div class="row">
                                                     <div class="rowGroup col-sm-12">
                                                         <label class=" control-label spacing"><span style="color: red">*</span>主要业绩及取得的荣誉</label>
-                                                        <textarea style="overflow: auto;word-break: break-all; "  class="form-control" id="mainHonours" name="mainHonours" rows="2">${item.mainHonours}</textarea>
+                                                        <textarea style="overflow: auto;word-break: break-all; "  class="form-control" id="mainHonours" name="mainHonours" rows="2">{$row.mainHonours}</textarea>
                                                     </div>
                                                 </div>
                                                 <div class="row"  id="personalTaxDiv">
                                                     <div class="rowGroup col-sm-12">
                                                         <label class=" control-label spacing"><span style="color: red">*</span>个税缴交情况</label>
-                                                        <div id="personalTax" class="xm-select-demo" value="${item.personalTax}"></div>
+                                                        <div id="personalTax" class="xm-select-demo" value="{$row.personalTax}"></div>
                                                     </div>
                                                 </div>
                                                 <div class="row"  id="socialSecurityDiv">
                                                     <div class="rowGroup col-sm-12">
                                                         <label class=" control-label spacing"><span style="color: red">*</span>社保缴交情况</label>
-                                                        <div id="socialSecurity" class="xm-select-demo" value="${item.socialSecurity}"></div>
+                                                        <div id="socialSecurity" class="xm-select-demo" value="{$row.socialSecurity}"></div>
                                                     </div>
                                                 </div>
                                                 <div class="row">
@@ -268,7 +268,7 @@
                                 </thead>
                             </table>
                             <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>
-                            <form id="uploadForm" action="${ctxPath}/api/talentInfo/addTalentFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
+                            <form id="uploadForm" action="/common/api/addTalentFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
                                 <input type='hidden' id="fileId" name="fileId" >
                                 <input type='file' id="upload_file" name="fileUrl" style='display: none'>
                                 <input type='hidden' id="mainId" name="mainId" >
@@ -286,8 +286,8 @@
 </div>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
 <script type="text/javascript">
-    document.write('<script src="/static/js/plugins/xmSelect/xm-select.js?v='+(new Date()).getTime()+'"><\/script>');
-    document.write('<script src="/static/modular/gate/master/livingAllowanceInfo/livingAllowanceInfo_info.js?v='+(new Date()).getTime()+'"><\/script>');
-    document.write('<script src="/static/modular/common/upload.js?v='+(new Date()).getTime()+'"><\/script>');
+    document.write('<script src="/static/js/plugins/xmSelect/xm-select.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/gate/master/livingAllowanceInfo/livingAllowanceInfo_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/common/upload.js?v=' + (new Date()).getTime() + '"><\/script>');
 </script>
 {/block}

+ 0 - 293
public/static/modular/gate/master/livingAllowanceInfo/livingAllowanceInfo.js

@@ -1,293 +0,0 @@
-/**
- * 硕博人才生活补贴申报管理初始化
- */
-var LivingAllowanceInfo = {
-    id: "LivingAllowanceInfoTable",	//表格id
-    seItem: null,		//选中的条目
-    table: null,
-    layerIndex: -1
-};
-
-/**
- * 初始化表格的列
- */
-LivingAllowanceInfo.initColumn = function () {
-    return [
-        {field: 'selectItem', radio: true},
-        {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: '80px'},
-        {
-            title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
-            formatter: function (value, row, index) {
-                return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
-            }
-        },
-        // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
-        //     formatter : function (value,row,index){
-        //         return value == 1?"晋江市现代产业体系人才":"集成电路优秀人才";
-        //     }
-        // },
-        {
-            title: '人才标签',
-            field: 'talentTypeName',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '证件号码',
-            field: 'idCard',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "150px"
-        },
-        {
-            title: '企业名称',
-            field: 'enterpriseName',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '最高学历',
-            field: 'highEducation',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '毕业学校',
-            field: 'graduateSchool',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '手机号码',
-            field: 'phone',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '本单位入职时间',
-            field: 'entryTime',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '首次来晋工作时间',
-            field: 'firstInJJTime',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '申请次数',
-            field: 'applyCount',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '审核状态',
-            field: 'checkStateName',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-        {
-            title: '公示状态',
-            field: 'isPublicName',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
-    ];
-};
-
-/**
- * 检查是否选中
- */
-LivingAllowanceInfo.check = function () {
-    var selected = $('#' + this.id).bootstrapTable('getSelections');
-    if (selected.length == 0) {
-        Feng.info("请先选中表格中的某一记录!");
-        return false;
-    } else {
-        LivingAllowanceInfo.seItem = selected[0];
-        return true;
-    }
-};
-
-/**
- * 点击添加硕博人才生活补贴申报
- */
-LivingAllowanceInfo.openAddLivingAllowanceInfo = function () {
-    var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsAdd", function (data) {
-        if (data.code == 200) {
-            var index = layer.open({
-                type: 2,
-                title: '添加人才生活补贴申报',
-                fix: false, //不固定
-                maxmin: true,
-                content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_add?year=' + data.obj,
-                btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check layui-bg-green"></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.LivingAllowanceInfoInfoDlg.addSubmit();
-                }, btn2: function (index, layero) {
-                    var obj = layero.find("iframe")[0].contentWindow;
-                    obj.LivingAllowanceInfoInfoDlg.submitToCheck();
-                    return false;
-                },
-                success: function (layero, index) {
-                    layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
-                },
-                end: function () {
-                    layer.closeAll('tips');
-                }
-            });
-            layer.full(index);
-            LivingAllowanceInfo.layerIndex = index;
-        } else {
-            Feng.info(data.msg);
-        }
-    }, function (data) {
-        Feng.error("校验失败!" + data.responseJSON.message + "!");
-    });
-    ajax.set("type", CONFIG.project_master_living_allowance);
-    ajax.start();
-};
-
-/**
- * 打开查看硕博人才生活补贴申报详情
- */
-LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
-    if (this.check()) {
-        var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsEditOrSubmit", function (data) {
-            if (data.code == 200) {
-                var index = layer.open({
-                    type: 2,
-                    title: '硕博人才生活补贴修改',
-                    area: ['800px', '420px'], //宽高
-                    fix: false, //不固定
-                    maxmin: true,
-                    content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/update",
-                    btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check layui-bg-green"></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.LivingAllowanceInfoInfoDlg.addSubmit();
-                    }, btn2: function (index, layero) {
-                        var obj = layero.find("iframe")[0].contentWindow;
-                        obj.LivingAllowanceInfoInfoDlg.submitToCheck();
-                        return false;
-                    },
-                    success: function (layero, index) {
-                        layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
-                    },
-                    end: function () {
-                        layer.closeAll('tips');
-                    }
-                });
-                layer.full(index);
-                LivingAllowanceInfo.layerIndex = index;
-            } else {
-                Feng.info(data.msg);
-            }
-        }, function (data) {
-            Feng.error("校验失败!" + data.responseJSON.message + "!");
-        });
-        ajax.set("type", CONFIG.project_master_living_allowance);
-        ajax.set("year", LivingAllowanceInfo.seItem.year);
-        ajax.start();
-    }
-};
-
-/**
- * 打开查看窗口
- */
-LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () {
-    if (this.check()) {
-        var index = layer.open({
-            type: 2,
-            title: '硕博人才生活补贴详情',
-            area: ['800px', '420px'], //宽高
-            fix: false, //不固定
-            maxmin: true,
-            content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/select",
-            btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
-            btnAlign: 'c',
-        });
-        layer.full(index);
-        LivingAllowanceInfo.layerIndex = index;
-    }
-}
-
-
-/**
- * 删除硕博人才生活补贴申报
- */
-LivingAllowanceInfo.delete = function () {
-    if (this.check()) {
-        if (LivingAllowanceInfo.seItem.checkState != 0) {
-            Feng.error("该申报已提交审核,无法删除");
-            return;
-        }
-        var operation = function () {
-            var ajax = new $ax(Feng.ctxPath + "/api/livingAllowanceInfo/delete", function (data) {
-                Feng.success("删除成功!");
-                LivingAllowanceInfo.table.refresh();
-            }, function (data) {
-                Feng.error("删除失败!" + data.responseJSON.message + "!");
-            });
-            ajax.set("livingAllowanceInfoId", LivingAllowanceInfo.seItem.id);
-            ajax.start();
-        }
-        Feng.confirm("删除后无法恢复,确认删除吗?", operation);
-    }
-};
-
-/**
- * 查询硕博人才生活补贴申报列表
- */
-LivingAllowanceInfo.search = function () {
-    var queryData = {};
-    queryData['name'] = $("#name").val();
-    queryData['idCard'] = $("#idCard").val();
-    LivingAllowanceInfo.table.refresh({query: queryData});
-};
-
-$(function () {
-    var defaultColunms = LivingAllowanceInfo.initColumn();
-    var table = new BSTable(LivingAllowanceInfo.id, "/api/livingAllowanceInfo/list", defaultColunms);
-    table.setOnDblClickRow(function () {
-        LivingAllowanceInfo.openLivingAllowanceInfoSelect();
-    });
-    table.setPaginationType("server");
-    LivingAllowanceInfo.table = table.init();
-});

+ 69 - 66
public/static/modular/gate/master/livingAllowanceInfo/livingAllowanceInfo_info.js

@@ -149,53 +149,53 @@ LivingAllowanceInfoInfoDlg.close = function () {
  */
 LivingAllowanceInfoInfoDlg.collectData = function () {
     this
-        .set('id')
-        .set('year')
-        .set('enterpriseId')
-        .set('enterpriseName')
-        .set('type')
-        .set('talentType')
-        .set('cardType')
-        .set('idCard')
-        .set('name')
-        .set('photo')
-        .set('sex')
-        .set('nation')
-        .set('nationality')
-        .set('provinceCode')
-        .set('cityCode')
-        .set('countyCode')
-        .set('birthday')
-        .set('address')
-        .set('politics')
-        .set('highEducation')
-        .set('graduateSchool')
-        .set('major')
-        .set('post')
-        .set('phone')
-        .set('email')
-        .set('bank')
-        .set('bankNetwork')
-        .set('bankAccount')
-        .set('bankNumber')
-        .set('entryTime')
-        // .set('quitTime')
-        .set('startTime')
-        .set('endTime')
-        .set('educationAndResume')
-        .set('mainHonours')
-        .set('firstInJJTime')
-        // .set('isIntroduction')
-        .set('industryField')
-        .set('title')
-        .set('professionalQualifications')
-        .set('studyAbroad')
-        // .set('studyAbroadCountry')
-        .set('studyAbroadTime')
-        .set('introductionMode')
-        .set('letterTime')
-    // .set('applyCount')
-    ;
+            .set('id')
+            .set('year')
+            .set('enterpriseId')
+            .set('enterpriseName')
+            .set('type')
+            .set('talentType')
+            .set('cardType')
+            .set('idCard')
+            .set('name')
+            .set('photo')
+            .set('sex')
+            .set('nation')
+            .set('nationality')
+            .set('provinceCode')
+            .set('cityCode')
+            .set('countyCode')
+            .set('birthday')
+            .set('address')
+            .set('politics')
+            .set('highEducation')
+            .set('graduateSchool')
+            .set('major')
+            .set('post')
+            .set('phone')
+            .set('email')
+            .set('bank')
+            .set('bankNetwork')
+            .set('bankAccount')
+            .set('bankNumber')
+            .set('entryTime')
+            // .set('quitTime')
+            .set('startTime')
+            .set('endTime')
+            .set('educationAndResume')
+            .set('mainHonours')
+            .set('firstInJJTime')
+            // .set('isIntroduction')
+            .set('industryField')
+            .set('title')
+            .set('professionalQualifications')
+            .set('studyAbroad')
+            // .set('studyAbroadCountry')
+            .set('studyAbroadTime')
+            .set('introductionMode')
+            .set('letterTime')
+            // .set('applyCount')
+            ;
     if ($("#provinceCode").val() != null && $("#provinceCode").val() != '') {
         this.livingAllowanceInfoInfoData["provinceName"] = $("#provinceCode").find("option:selected").text();
     }
@@ -280,9 +280,10 @@ LivingAllowanceInfoInfoDlg.submitToCheck = function () {
         Feng.info("请先填写基础信息并上传附件");
         return;
     }
-    if (!validateIsEdit()) return;
+    if (!validateIsEdit())
+        return;
     var operation = function () {
-        var ajax = new $ax(Feng.ctxPath + "/api/livingAllowanceInfo/submitToCheck", function (data) {
+        var ajax = new $ax(Feng.ctxPath + "/enterprise/living_allowance/submitToCheck", function (data) {
             if (data.code == 200) {
                 Feng.success(data.msg);
                 // $("#checkState").val(data.obj);
@@ -347,7 +348,7 @@ LivingAllowanceInfoInfoDlg.afterSelectProvince = function () {
         "displayCode": "code",
         "displayName": "name",
         "type": "GET",
-        "url": Feng.ctxPath + "/api/commonLocation/findCityByProvinceSelect/" + province
+        "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
     });
 }
 /**
@@ -364,7 +365,7 @@ LivingAllowanceInfoInfoDlg.afterSelectCity = function () {
         "displayCode": "code",
         "displayName": "name",
         "type": "GET",
-        "url": Feng.ctxPath + "/api/commonLocation/findCountyByCitySelect/" + city
+        "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
     });
 }
 
@@ -401,16 +402,16 @@ function validUploadButton(type, row, fileId) {
     var checkState = $("#checkState").val();
     if ((Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 2 && files.indexOf(row.id) != -1)) && $("#hand").val() != "select") {
         return type == 1 ?
-            "<button type='button' onclick=\"checkFile(this,'" + row.id + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
-            "<i class=\"fa fa-upload\"></i>上传" +
-            "</button>"
-            :
-            "<button type=\'button\' onclick=\"checkFile(this,'" + row.id + "','" + fileId + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
-            "<i class=\"fa fa-paste\"></i>修改" +
-            "</button>" +
-            "<button type='button' onclick=\"deleteFile('" + fileId + "','" + CONFIG.project_master_living_allowance + "')\" class=\"btn btn-xs btn-danger\">" +
-            "<i class=\"fa fa-times\"></i>删除" +
-            "</button>";
+                "<button type='button' onclick=\"checkFile(this,'" + row.id + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
+                "<i class=\"fa fa-upload\"></i>上传" +
+                "</button>"
+                :
+                "<button type=\'button\' onclick=\"checkFile(this,'" + row.id + "','" + fileId + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
+                "<i class=\"fa fa-paste\"></i>修改" +
+                "</button>" +
+                "<button type='button' onclick=\"deleteFile('" + fileId + "','" + CONFIG.project_master_living_allowance + "')\" class=\"btn btn-xs btn-danger\">" +
+                "<i class=\"fa fa-times\"></i>删除" +
+                "</button>";
     } else {
         return type == 1 ? "" : "";
     }
@@ -442,11 +443,13 @@ $(function () {
         {"name": "introductionMode", "code": "un_introduction_mode"},
         {"name": "industryField", "code": "un_industryField"},
         {"name": "address", "code": "un_street"}];
-    if (hand == "select") arr.push({"name": "talentType", "code": "un_jbt_talentType"});
-    if (hand == "update" && checkState != 0 && checkState != 2) arr.push({
-        "name": "talentType",
-        "code": "un_jbt_talentType"
-    });
+    if (hand == "select")
+        arr.push({"name": "talentType", "code": "un_jbt_talentType"});
+    if (hand == "update" && checkState != 0 && checkState != 2)
+        arr.push({
+            "name": "talentType",
+            "code": "un_jbt_talentType"
+        });
     Feng.findChildDictBatch(JSON.stringify(arr))
     //加载省份
     Feng.addAjaxSelect({

+ 1167 - 34
public/static/modular/master/livingAllowanceInfo/livingAllowanceInfo.js

@@ -15,26 +15,41 @@ LivingAllowanceInfo.initColumn = function () {
     return [
         {field: 'selectItem', radio: true},
         {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: '80px'},
+        {title: '申报补贴年次', field: 'applyCount', visible: true, align: 'center', valign: 'middle', width: '100px',
+            formatter: function (value, row, index) {
+                if(value == 1){
+                    return "首年";
+                }
+                if(value == 2){
+                    return "第二年";
+                }
+                if(value == 3){
+                    return "第三年";
+                }
+            }
+        },
+        {title: '申报类型', field: 'declareTypeName', visible: true, align: 'center', valign: 'middle', width: '80px'},
+        {title: '引进方式', field: 'introductionMethod', visible: true, align: 'center', valign: 'middle', width: '80px',
+            formatter: function (value, row, index) {
+                if(value == 1){
+                    return "新引进";
+                }
+                if(value == 2){
+                    return "其他";
+                }
+            }
+        },
         {
-            title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
+            title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",'class': 'uitd_showTip',
             formatter: function (value, row, index) {
                 return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
             }
         },
         // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
         //     formatter : function (value,row,index){
-        //         return value == 1?"晋江市现代产业体系人才":"集成电路优秀人才";
+        //         return value == 1?"晋江市优秀人才":"集成电路优秀人才";
         //     }
         // },
-        {
-            title: '人才标签',
-            field: 'talentTypeName',
-            visible: true,
-            align: 'center',
-            valign: 'middle',
-            'class': 'uitd_showTip',
-            width: "100px"
-        },
         {
             title: '证件号码',
             field: 'idCard',
@@ -99,32 +114,248 @@ LivingAllowanceInfo.initColumn = function () {
             width: "100px"
         },
         {
-            title: '申请次数',
-            field: 'applyCount',
-            visible: true,
+            title: '推荐兑现状态',
+            field: 'recommendIsPay',
+            visible: $("#process").val() == 4,
             align: 'center',
             valign: 'middle',
             'class': 'uitd_showTip',
-            width: "100px"
+            width: "100px",
+            formatter : function (value,row,index) {
+                if(value == -1){
+                    return "<span style='color: red'>不予兑现</span>"
+                }
+                if(value == 0){
+                    return "<span style='color: #2401fd'>未知</span>"
+                }
+                if(value == 1){
+                    return "<span style='color: green'>待兑现</span>"
+                }
+                if(value == 2){
+                    return "<span style='color: #6d008b'>已兑现</span>"
+                }
+            }
         },
         {
-            title: '审核状态',
-            field: 'checkStateName',
-            visible: true,
+            title: '推荐兑现金额', field: 'recommendAmount', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+        },
+        {
+            title: '推荐判定描述', field: 'recommendJudgmentDetails', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            // formatter: function (value,row,index) {
+            //     if(Feng.isNotEmptyStr(value)){
+            //         var arr = value.split(";");
+            //         var str = "";
+            //         for(var i=0;i<arr.length;i++){
+            //             if(Feng.isNotEmptyStr($.trim(arr[i]))){
+            //                 str = str + (i+1) + "." + arr[i]
+            //             }
+            //         }
+            //         return str
+            //     }
+            //     return value;
+            // }
+        },
+        {
+            title: '推荐计算描述', field: 'recommendAmountDesc', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            // formatter: function (value,row,index) {
+            //     if(Feng.isNotEmptyStr(value)){
+            //         var arr = value.split(";");
+            //         var str = "";
+            //         for(var i=0;i<arr.length;i++){
+            //             if(Feng.isNotEmptyStr($.trim(arr[i]))) {
+            //                 str = str + (i + 1) + "." + arr[i] +
+            //             }
+            //         }
+            //         return str
+            //     }
+            //     return value;
+            // }
+        },
+        {
+            title: '实际兑现状态',
+            field: 'isPay',
+            visible: $("#process").val() == 4,
             align: 'center',
             valign: 'middle',
             'class': 'uitd_showTip',
-            width: "100px"
+            width: "100px",
+            formatter : function (value,row,index) {
+                if(value == -1){
+                    return "<span style='color: red'>不予兑现</span>"
+                }
+                if(value == 0){
+                    return "<span style='color: #2401fd'>未知</span>"
+                }
+                if(value == 1){
+                    return "<span style='color: green'>待兑现</span>"
+                }
+                if(value == 2){
+                    return "<span style='color: #6d008b'>已兑现</span>"
+                }
+            }
+        },
+        {
+            title: '实际兑现金额', field: 'amount', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+        },
+        {
+            title: '实际判定描述', field: 'judgmentDetails', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            formatter: function (value,row,index) {
+                if(Feng.isNotEmptyStr(value)){
+                    var arr = value.split(";");
+                    return arr.join("</br>")
+                }
+                return value;
+            }
+        },
+        {
+            title: '实际计算描述', field: 'amountDesc', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
+            formatter: function (value,row,index) {
+                if(Feng.isNotEmptyStr(value)){
+                    var arr = value.split(";");
+                    return arr.join("</br>")
+                }
+                return value;
+            }
+        },
+        {
+            title: '审核状态',
+            field: 'checkState',
+            visible: $("#process").val() == 1,
+            align: 'center',
+            valign: 'middle',
+            width: "100px",
+            formatter: function (value, row, index) {
+                if (value == -1) {
+                    return "<span class='label label-danger'>审核不通过</span>"
+                }
+                if (value == 1) {
+                    return "<span class='label'>待提交</span>"
+                }
+                if (value == 7) {
+                    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 == 20) {
+                    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 == 10) {
+                    return "<span class='label label-danger'>已驳回</span>"
+                }
+                if (value == 15 || value >= 25) {
+                    return "<span class='label label-primary'>已通过</span>"
+                }
+            }
+        },
+        {
+            title: '审核状态',
+            field: 'checkState',
+            visible: $("#process").val() == 2,
+            align: 'center',
+            valign: 'middle',
+            width: "100px",
+            formatter: function (value, row, index) {
+                if (value == -1) {
+                    return "<span class='label label-danger'>审核不通过</span>"
+                } else if (value <= 10 || value == 20) {
+                    return "<span class='label label-danger'>已驳回</span>"
+                } else if(value == 15){
+                    if(row.highProcess != null && row.highProcess != '' && row.highProcess >= 2){
+                        return "<span class='label label-success'>重新提交</span>"
+                    }else {
+                        return "<span class='label label-success'>待审核</span>"
+                    }
+                }else if(value >= 25){
+                    return "<span class='label label-primary'>已通过</span>"
+                }
+
+            }
+        },
+        {
+            title: '审核状态',
+            field: 'checkState',
+            visible: $("#process").val() == 3,
+            align: 'center',
+            valign: 'middle',
+            width: "120px",
+            formatter: function (value, row, index) {
+                if (value == -1) {
+                    return "<span class='label label-danger'>审核不通过</span>"
+                }
+                if (value == 25) {
+                    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 == 30 || value <= 20) {
+                    return "<span class='label label-danger'>已驳回</span>"
+                }
+                if (value >= 35) {
+                    return "<span class='label label-primary'>已通过</span>"
+                }
+            }
+        },
+        {
+            title: '审核状态',
+            field: 'checkState',
+            visible: $("#process").val() == 4,
+            align: 'center',
+            valign: 'middle',
+            width: "120px",
+            formatter: function (value, row, index) {
+                if (value == -1) {
+                    return "<span class='label label-danger'>审核不通过</span>"
+                }
+                if (value == 35) {
+                    return "<span class='label label-primary'>已通过</span>"
+                }
+            }
         },
         {
             title: '公示状态',
-            field: 'isPublicName',
+            field: 'isPublic',
             visible: true,
             align: 'center',
             valign: 'middle',
             'class': 'uitd_showTip',
-            width: "100px"
+            width: "100px",
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return "<span class='label label-info'>待核查征信</span>"
+                }
+                if (value == 2) {
+                    return "<span class='label label-success'>待公示</span>"
+                }
+                if (value == 3) {
+                    return "<span class='label label-danger'>公示中</span>"
+                }
+                if (value == 4) {
+                    if (row.checkState == -1) {
+                        return "<span class='label label-danger'>审核不通过</span>"
+                    }
+                    return "<span class='label label-primary'>待兑现</span>"
+                }
+                if (value == 5) {
+                    return "<span class='label label-primary'>已兑现</span>"
+                }
+            }
         },
+        {
+            title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
+            formatter: function (value, row, index) {
+                return "<span class='label label-success' onclick=\"LivingAllowanceInfo.showLog('" + value + "')\" >" +
+                    "<i class=\"fa fa-book\"></i>日志" +
+                    "</span>";
+            }
+        }
     ];
 };
 
@@ -133,19 +364,20 @@ LivingAllowanceInfo.initColumn = function () {
  */
 LivingAllowanceInfo.check = function () {
     var selected = $('#' + this.id).bootstrapTable('getSelections');
-    if(selected.length == 0){
+    if (selected.length == 0) {
         Feng.info("请先选中表格中的某一记录!");
         return false;
-    }else{
+    } else {
         LivingAllowanceInfo.seItem = selected[0];
         return true;
     }
 };
 
 /**
- * 点击添加硕博人才生活补贴申报
+ * 点击审核硕博人才生活补贴申报
+ * @param process
  */
-LivingAllowanceInfo.openCheckLivingAllowanceInfo = function () {
+LivingAllowanceInfo.openCheckLivingAllowanceInfo = function (process) {
     if (this.check()) {
         var index = layer.open({
             type: 2,
@@ -153,15 +385,15 @@ LivingAllowanceInfo.openCheckLivingAllowanceInfo = function () {
             area: ['800px', '420px'], //宽高
             fix: false, //不固定
             maxmin: true,
-            content: Feng.ctxPath + '/livingAllowanceInfo/livingAllowanceInfo_check/' + LivingAllowanceInfo.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;关闭'],
+            content: Feng.ctxPath + '/livingAllowanceInfo/livingAllowanceInfo_check?id=' + LivingAllowanceInfo.seItem.id+"&process="+process,
+            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){
+                obj.LivingAllowanceInfoInfoDlg.showCheckModal(process);
+            }, btn2: function (index, layero) {
                 var obj = layero.find("iframe")[0].contentWindow;
-                obj.TalentInfoInfoDlg.submitCheck();
+                obj.LivingAllowanceInfoInfoDlg.submitCheck(process);
                 return false;
             }
         });
@@ -187,20 +419,921 @@ LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
     }
 };
 
+/**
+ * 显示核查征信驳回模态框
+ */
+LivingAllowanceInfo.showHczxRejectModal = function () {
+    if (this.check()) {
+        if (LivingAllowanceInfo.seItem.isPublic != 1) {
+            Feng.info("当前记录不是待核查征信状态,无法核查");
+            return;
+        }
+        $("#hczxId").val(LivingAllowanceInfo.seItem.id);
+        $("#hczxMsg").val("");
+        $("#hczxRejectModal").modal("show");
+    }
+}
+
+/**
+ * 核查征信驳回提交
+ */
+LivingAllowanceInfo.hczxReject = function () {
+    var id = $("#hczxId").val();
+    var msg = $("#hczxMsg").val();
+    if (msg == null || msg == '') {
+        Feng.info("请填写失信原因");
+        return;
+    }
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/hczxReject", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                LivingAllowanceInfo.table.refresh();
+                $("#hczxRejectModal").modal("hide");
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("核查征信失败!" + data.responseJSON.message + "!");
+        });
+        ajax.setData({"id": id, "outMsg": msg, "creditStatus": 3});
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
+}
+
+LivingAllowanceInfo.showDataCheckModal = function (type) {
+    $("#hczxForm").css("display", "none");
+    switch (type) {
+        case 1:                     //待核查征信名单-导出
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.checkExport()").text("导出");
+            $("#exportCommonModalLabel").text("待核查征信名单");
+            break;
+        case 2:                     //待核查征信名单-核查征信通过
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.hczxPass()").text("提交");
+            $("#exportCommonModalLabel").text("待核查征信名单");
+            break;
+        case 3:                     //公示(批量)
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.public()").text("公示");
+            $("#exportCommonModalLabel").text("待公示名单");
+            $("#hczxForm").css("display", "block");
+            $(".time").each(function () {
+                laydate.render({
+                    elem: "#" + $(this).attr("id")
+                    , type: 'date'
+                    , format: 'yyyy年MM月dd日'
+                });
+            });
+            break;
+        case 4:                     //公示通过(批量)
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.publicPass()").text("提交");
+            $("#exportCommonModalLabel").text("公示通过名单");
+            break;
+        case 5:                     //待公布名单
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.publish()").text("公布");
+            $("#exportCommonModalLabel").text("待公布名单");
+            break;
+        case 6:                     //待发证名单
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.issue()").text("提交");
+            $("#exportCommonModalLabel").text("待发证名单");
+            break;
+        case 7:                     //公示名单预览
+            $("#hczxButton").attr("onclick", "LivingAllowanceInfo.needPublicExport()").text("导出");
+            $("#exportCommonModalLabel").text("待公示名单");
+            break;
+    }
+    $('#dataTable').bootstrapTable('destroy');
+    $('#dataTable').bootstrapTable({
+        url: Feng.ctxPath + "/livingAllowanceInfo/selectNeedCheckData?type=" + type,
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false,				// 是否显示刷新按钮
+        clickToSelect: true,			// 是否启用点击选中行
+        singleSelect: false,				// 设置True 将禁止多选
+        striped: true,  				// 是否显示行间隔色
+        pagination: true,   			// 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "client",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 25, 50, 100, 500, 1000, 1500],        //可供选择的每页的行数(*)
+        maintainSelected: true,              //全表全选需要开启
+        showColumns: false,
+        responseHandler: function (res) {
+            $("#exportCommonModal").modal("show");
+            return res.obj.rows;
+        },
+        columns:
+            [
+                {field: "selectItem", checkbox: true},
+                {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%"},
+                {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "30%"},
+                {
+                    title: '企业名称',
+                    field: 'enterpriseName',
+                    visible: true,
+                    align: 'center',
+                    valign: 'middle',
+                    width: "40%"
+                },
+                {
+                    title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%",
+                    formatter: function (value, row, index) {
+                        if (value == -1) {
+                            return "<span style='color: #ed5565;'>审核不通过</span>";
+                        }
+                        if (value == 35) {
+                            return "<span style='color: #1ab394;'>审核通过</span>";
+                        }
+                    }
+                },
+            ]
+
+    });
+}
+
+
+/**
+ * 选择导出提交
+ */
+LivingAllowanceInfo.checkExport = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    window.location.href = Feng.ctxPath + "/livingAllowanceInfoExport/exportHczx?ids=" + ids;
+}
+
+LivingAllowanceInfo.actalUpload = function (){
+    $("#file,#fileName").val("");
+    $("#importModal").modal("show");
+}
+
+
+/**
+ *
+ */
+LivingAllowanceInfo.importSubmit = function (){
+    $("#import-form")[0].submit();
+    // layer.confirm('您需要导入数据并提交吗?', {
+    //     btn: ['仅导入','导入并提交','取消'] //按钮
+    // }, function(index){
+    //     $("#importType").val(1);
+    //     $("#import-form")[0].submit();
+    //     layer.close(index);
+    // }, function(index){
+    //     $("#importType").val(2);
+    //     $("#import-form")[0].submit();
+    //     layer.close(index);
+    // }, function(index){
+    //     layer.close(index);
+    // });
+}
+
+
+LivingAllowanceInfo.importCallBack = function (data) {
+    if (data.code == 200) {
+        $("#importModal").modal("hide");
+        LivingAllowanceInfo.table.refresh();
+        Feng.success(data.msg);
+    } else {
+        Feng.error(data.msg);
+    }
+}
+
+LivingAllowanceInfo.initCheckFileTable = function (){
+    $('#checkFileTable').bootstrapTable('destroy');
+    $('#checkFileTable').bootstrapTable({
+        url: Feng.ctxPath + "/talentCommonFile/listTalentFile",
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false,				// 是否显示刷新按钮
+        clickToSelect: true,			// 是否启用点击选中行
+        singleSelect: true,				// 设置True 将禁止多选
+        striped: true,  				// 是否显示行间隔色
+        pagination: false,   			// 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "server",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        showColumns: false,
+        queryParams: function (params) {
+            return {"mainId":$("#batch").val(),"fileTypeId":"master_living_allowance"};
+        },
+        rowStyle : function(row,index){
+            return {css: {"word-break": "break-word", "white-space": "inherit"}}
+        },
+        columns:
+        [
+            {title: '附件原名', field: 'orignName', visible: true, align: 'center', valign: 'middle',width:'120px'},
+            {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
+                formatter:function (value,row ,index){
+                    var sn = value.lastIndexOf(".");
+                    var suffix = value.substring(sn+1,value.length);
+                    var imgStr = "";
+                    if(suffix=="pdf"||suffix=="PDF"){
+                        imgStr = "<button type='button'  onclick=\"Feng.showPdf('"+value+"','"+row.id+"','"+row.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('"+value+"','"+row.id+"','"+row.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=\"'+value+'\" style=\"width:25px;height:25px;\">';
+                    }
+                    return imgStr;
+                }
+            },
+            {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle',width:'80px',
+                formatter:function (value,row ,index){
+                    return "<button type='button' onclick=\"downloadFile('"+row.id+"',1)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>"+
+                        "<button type='button' onclick=\"LivingAllowanceInfo.deleteCheckFile('"+row.id+"','"+CONFIG.project_master_living_allowance+"')\" class=\"btn btn-xs btn-danger\">" +
+                        "<i class=\"fa fa-times\"></i>删除" +
+                        "</button>";
+                }
+            },
+        ],
+        onPostBody: function () {
+            $('#checkFileTable'+"td.uitd_showTip").bind("mouseover", function () {
+                var htm = $(this).html();
+                $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+            });
+            $(".imgUrl").viewer({ fullscreen:false});
+        },
+    });
+}
+
+
+/**
+ * 核查材料留存上传
+ */
+LivingAllowanceInfo.showCheckFileModal = function (){
+    Feng.addAjaxSelect({
+        "id": "batch",
+        "displayCode": "id",
+        "displayName": "batch",
+        "type": "GET",
+        "url": Feng.ctxPath + "/batch/listBatchByType?type=" + CONFIG.project_master_living_allowance
+    });
+    $("#upload_file").val("");
+    $("#checkFileModal").modal("show");
+}
+
+LivingAllowanceInfo.checkFileUpload = function (){
+    var batch = $("#batch").val();
+    if(Feng.isEmptyStr(batch)){
+        Feng.info("请选择申报批次后再上传!");return;
+    }
+    $("#upload_file ").unbind("change");
+    $("#upload_file ").change(function () {
+        var formData = new FormData();
+        formData.append("fileTypeId","master_living_allowance");
+        formData.append("mainId",batch);
+        formData.append("fileId","");
+        for(var i=0; i<$('#upload_file')[0].files.length;i++){
+            formData.append('file', $('#upload_file')[0].files[i]);
+        }
+        $.ajax({
+            url: Feng.ctxPath + "/talentCommonFile/uploadBatch",
+            type: "POST",
+            processData: false,
+            contentType: false,
+            data: formData,
+            success: function(data){
+                $("#checkFileTable").bootstrapTable("refresh", {});
+                Feng.info(data.msg);
+            },error: function(data) {
+                Feng.error("上传失败!" + data.responseJSON.message + "!");
+            }
+        });
+    });
+    $('#upload_file').val("");
+    $('#upload_file').click();
+}
+
+LivingAllowanceInfo.deleteCheckFile = function (id,type){
+    var operation = function() {
+        var ajax = new $ax(Feng.ctxPath + "/talentCommonFile/deleteFile", function (data) {
+            if(data.code=200){
+                Feng.success(data.msg);
+                $("#checkFileTable").bootstrapTable("refresh", {});
+            }else{
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("删除失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("id", id);
+        ajax.set("type",type);
+        ajax.start();
+    }
+    Feng.confirm("删除后无法恢复,确认删除吗?", operation);
+}
+
+
+/**
+ * 审核不通过
+ */
+LivingAllowanceInfo.setNotPass = function(){
+    var selecteds = $('#' + this.id).bootstrapTable('getSelections');
+    if(selecteds.length == 0){
+        Feng.info("请选择需要设置审核不通过的行");
+        return ;
+    }
+    var ids = "";
+    for(var key in selecteds){
+        ids = ids + selecteds[key].id + ",";
+    }
+    ids = ids.substring(0,ids.length-1);
+    layer.open({
+        type: 1,
+        id: "notPassModal",
+        title: '修改',
+        area: ['800px', '450px'], //宽高
+        fix: false, //不固定
+        shade: 0,
+        maxmin: true,
+        content: '<form id="checkNotPass">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
+            '                        <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据"  rows="6"></textarea>\n' +
+            '                    </div>\n' +
+            '                </form>',
+
+        btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+        btnAlign: 'c',
+        zIndex: layer.zIndex,
+        yes: function (index, layero) {
+            var checkMsg = $("#checkMsgNotPass").val();
+            if(Feng.isEmptyStr(checkMsg)){
+                Feng.info("请填写审核不通过原因");
+                return ;
+            }
+            var operation = function(){
+                var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/setNotPass", function (data) {
+                    if(data.code==200){
+                        Feng.success(data.msg);
+                        LivingAllowanceInfo.table.refresh();
+                        layer.close(index);
+                    }else{
+                        Feng.error(data.msg);
+                    }
+                }, function (data) {
+                    Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
+                });
+                ajax.set("ids",ids);
+                ajax.set("msg",checkMsg);
+                ajax.start();
+            }
+            Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
+        }
+    });
+
+}
+
+
+/**
+ * 批量征信通过
+ */
+LivingAllowanceInfo.hczxPass = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/hczxPass", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                LivingAllowanceInfo.table.refresh();
+                $("#exportCommonModal").modal("hide");
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("核查征信失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("ids", ids);
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
+}
+
+/**
+ * 公示预览
+ */
+LivingAllowanceInfo.needPublicExport = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    var operation = function () {
+        $("#exportCommonModal").modal("hide");
+        window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/livingAllowanceInfoExport/exportPublic?ids=" + ids));
+    }
+    Feng.confirm("确定要公示预览吗?", operation);
+}
+
+
+/**
+ * 公示
+ */
+LivingAllowanceInfo.public = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    var isMessage = $("input[name='isSend']:checked").val();
+    var typeName = $("#typeName").val();
+    var address = $("#web").val();
+    var publicStartTime = $("#publicStartTime").val();
+    var publicEndTime = $("#publicEndTime").val();
+    var dep = $("#dep").val();
+    var phone = $("#fyphone").val();
+    var email = $("#fyemail").val();
+    if (isMessage == 1) {
+        if (typeName == null || typeName == '') {
+            Feng.info("请填写公示类型");
+            return;
+        }
+        if (address == null || address == '') {
+            Feng.info("请填写公示平台");
+            return;
+        }
+        if (publicStartTime == null || publicStartTime == '') {
+            Feng.info("请填写公示开始时间");
+            return;
+        }
+        if (publicEndTime == null || publicEndTime == '') {
+            Feng.info("请填写公示截止时间");
+            return;
+        }
+        if (dep == null || dep == '') {
+            Feng.info("请填写反映单位");
+            return;
+        }
+        if (phone == null || phone == '') {
+            Feng.info("请填写联系电话");
+            return;
+        }
+        if (email == null || email == '') {
+            Feng.info("请填写联系邮箱");
+            return;
+        }
+    }
+    var operation = function () {
+        var index = layer.open({
+            type: 1,
+            title: '公示',
+            area: ['300px', '220px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
+            btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+            btnAlign: 'c',
+            success: function () {
+                laydate.render({elem: "#publicBatchId", type: 'month', trigger: 'click', format: "yyyyMM"});
+            },
+            yes: function (index, layero) {
+                var month = $("#publicBatchId").val();
+                if (Feng.isEmptyStr(month)) {
+                    Feng.info("请填写公示批次");
+                    return;
+                }
+                layer.close(index);
+                var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/publicBatch", function (data) {
+                    if (data.code == 200) {
+                        Feng.success(data.msg);
+                        LivingAllowanceInfo.table.refresh();
+                        $("#exportCommonModal").modal("hide");
+                    } else {
+                        Feng.error(data.msg);
+                    }
+                }, function (data) {
+                    Feng.error("公示失败!" + data.responseJSON.message + "!");
+                });
+                ajax.set("ids", ids);
+                ajax.set("typeName", typeName);
+                ajax.set("address", address);
+                ajax.set("publicStartTime", publicStartTime);
+                ajax.set("publicEndTime", publicEndTime);
+                ajax.set("dep", dep);
+                ajax.set("phone", phone);
+                ajax.set("email", email);
+                ajax.set("isMessage", isMessage);
+                ajax.set("batch", month);
+                ajax.start();
+            }
+        });
+    }
+    Feng.confirm("确定要公示吗?", operation);
+}
+
+//已公示的数据根据公示批次公示导出
+LivingAllowanceInfo.publicExport = function (type) {
+    var url = "", dateType = '', format = '';
+    if (type == 1) {         //公示导出
+        url = Feng.ctxPath + "/livingAllowanceInfoExport/publicExport";
+        dateType = 'month';
+        format = "yyyyMM";
+    } else if (type == 2) {     //公布导出
+        url = Feng.ctxPath + "/livingAllowanceInfoExport/publishExport";
+        dateType = 'date';
+        format = "yyyy-MM-dd";
+    }
+    layer.open({
+        type: 1,
+        title: type == 1 ? '公示导出' : "公布导出",
+        area: ['800px', '300px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: "<form id=\"publicExportForm\" action=\"" + url + "\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
+            "                    <div class=\"form-group col-sm-12\">\n" +
+            "                        <div class=\"row\">\n" +
+            "                            <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
+            "                            <div class=\"col-sm-4\">\n" +
+            "                                <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
+            "                            </div>\n" +
+            "                            <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
+            "                            <div class=\"col-sm-4\">\n" +
+            "                                <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
+            "                            </div>\n" +
+            "                        </div>\n" +
+            "                    </div>\n" +
+            "                </form>",
+        btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+        btnAlign: 'c',
+        success: function (index, layero) {
+            $("#publicExportForm")[0].reset();
+            $("input[time='time']").each(function () {
+                laydate.render({
+                    elem: "#" + $(this).attr("id")
+                    , type: dateType
+                    , format: format
+                    , trigger: 'click'
+                });
+            });
+        },
+        yes: function (index) {
+            var startTime = $("#startTime").val();
+            var endTime = $("#endTime").val();
+            if (startTime == null || startTime == '') {
+                Feng.info("请选择开始时间");
+                return;
+            }
+            if (endTime == null || endTime == '') {
+                Feng.info("请选择结束时间");
+                return;
+            }
+            $("#publicExportForm")[0].submit();
+            layer.close(index)
+        }
+    });
+}
+
+/**
+ * 公示再审核
+ */
+LivingAllowanceInfo.afterCheck = function () {
+    if (this.check()) {
+        if (LivingAllowanceInfo.seItem.isPublic != 3) {
+            Feng.info("当前记录不是公示中状态,无法审核");
+            return;
+        }
+        if (LivingAllowanceInfo.seItem.creditStatus == 3) {
+            $("#zxNotice").text("当前申请人核查征信不通过,请谨慎选择审核状态!征信意见为:" + LivingAllowanceInfo.seItem.outMsg);
+        }
+        if (LivingAllowanceInfo.seItem.checkState == -1) {
+            var html = '<option value="">请选择</option>\n' +
+                '       <option value="2">驳回/恢复</option>';
+            $("#checkStateAfter").empty().append(html);
+        }
+        if (LivingAllowanceInfo.seItem.checkState == 35) {
+            var html = '<option value="">请选择</option>\n' +
+                '       <option value="-1">审核不通过</option>' +
+                '       <option value="2">驳回</option>';
+            $("#checkStateAfter").empty().append(html);
+        }
+        $("#checkForm")[0].reset();
+        $("#mainId").val(LivingAllowanceInfo.seItem.id);
+        $("#checkModal").modal("show");
+    }
+}
+/**
+ * 公示后审核提交
+ */
+LivingAllowanceInfo.afterCheckSubmit = function () {
+    var checkState = $("#checkStateAfter").val();
+    var msg = $("#msg").val();
+    if (checkState == null || checkState == '') {
+        Feng.info("请选择审核状态");
+        return;
+    }
+    if (msg == null || msg == '') {
+        Feng.info("请填写审核意见");
+        return;
+    }
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/afterCheck", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                LivingAllowanceInfo.table.refresh();
+                $("#checkModal").modal("hide");
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("审核失败!" + data.responseJSON.message + "!");
+        });
+        ajax.setData({"id": $("#mainId").val(), "checkState": $("#checkStateAfter").val(), "checkMsg": msg});
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
+}
+
+/**
+ * 批量公示通过
+ * @param type
+ */
+LivingAllowanceInfo.publicPass = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/publicPass", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                LivingAllowanceInfo.table.refresh();
+                $("#exportCommonModal").modal("hide");
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("公示通过失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("ids", ids);
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
+}
+
+/**
+ * 兑现
+ */
+LivingAllowanceInfo.issue = function () {
+    var selected = $('#dataTable').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    for (var i = 0; i < selected.length; i++) {
+        ids = ids + selected[i].id + ",";
+    }
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/issue", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                LivingAllowanceInfo.table.refresh();
+                $("#exportCommonModal").modal("hide");
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("兑现失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("ids", ids);
+        ajax.start();
+    }
+    Feng.confirm("一旦兑现无法修改,确定要兑现吗?", operation);
+}
+
+
+LivingAllowanceInfo.showExportModal = function (){
+    $("#exportForm")[0].reset();
+    $("#commonExportModal").modal("show");
+}
+LivingAllowanceInfo.export = function (process){
+    var operation = function() {
+        var names = '';
+        var fieldCodes = '';
+        $("#field_info li input").each(function(index){
+            if($(this).is(":checked")){
+                fieldCodes = fieldCodes + $(this).val() + ",";
+                names = names + $(this).next().text() + ",";
+            }
+        });
+        var param = LivingAllowanceInfo.formParams();
+        param.names = names;
+        param.values = fieldCodes;
+        param.process = process;
+        window.location.href = Feng.setUrlParam(Feng.ctxPath + "/livingAllowanceInfoExport/commonExport", param);
+        // window.location.href = Feng.ctxPath + "/api/talentInfoExport/export?names=" + names + "&fieldCodes=" + fieldCodes + "&name=" + $("#name").val() + "&idCard=" + $("#idCard").val()
+        //     + "&sex=" + $("#sex").val()+ "&nation=" + $("#nation").val()+ "&nationality=" + $("#nationality").val()+ "&talentType=" + $("#talentType").val()+ "&talentArrange=" + $("#talentArrange").val();
+    };
+    Feng.confirm("确定要导出数据吗?", operation);
+}
+
+
+
+LivingAllowanceInfo.prepareSearch = function () {
+    var sex = $("#pub_sex").val();
+    var checkState = $("#pub_checkState").val();
+    var name = $("#pub_name").val();
+    $('#dataTable').bootstrapTable("refresh", {"query": {"sex": sex, "checkState": checkState, "name": name}});
+}
+
+LivingAllowanceInfo.prepareReset = function () {
+    $("#pub_sex").val("");
+    $("#pub_checkState").val("");
+    $("#pub_name").val("");
+}
+
+/**
+ * 是否发送短信
+ */
+LivingAllowanceInfo.toggleMessage = function () {
+    var isMessage = $("input[name='isSend']:checked").val();
+    if (isMessage == 1) {
+        $("#messageEdit").css("display", "block");
+    } else if (isMessage == 2) {
+        $("#messageEdit").css("display", "none");
+    }
+}
+
+//回调
+LivingAllowanceInfo.callBack = function (data) {
+    Feng.info(data.msg);
+    if (data.code == 200) {
+        $("#hczxModal").modal("hide");
+        LivingAllowanceInfo.table.refresh();
+    }
+}
+
+LivingAllowanceInfo.checkAll = function(){
+    $("#field_info input").each(function () {
+        this.checked = true;
+    })
+}
+/**
+ * 反选
+ */
+LivingAllowanceInfo.unCheckAll = function(){
+    $("#field_info input").each(function () {
+        if(this.checked){
+            this.checked = false;
+        }else{
+            this.checked = true;
+        }
+    })
+}
+
+
+LivingAllowanceInfo.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_master_living_allowance,
+                "mainId": id,
+                "typeFileId": "",
+                "active": 1
+            })
+        }
+    });
+
+}
+
+
+/**
+ * 查询表单提交参数对象
+ * @returns {{}}
+ */
+LivingAllowanceInfo.formParams = function () {
+    var queryData = {};
+    queryData['name'] = $("#name").val();
+    queryData['idCard'] = $("#idCard").val();
+    queryData['sex'] = $("#sex").val();
+    queryData['nation'] = $("#nation").val();
+    queryData['nationality'] = $("#nationality").val();
+    queryData['provinceCode'] = $("#provinceCode").val();
+    queryData['politics'] = $("#politics").val();
+    queryData['enterpriseId'] = $("#enterpriseId").val();
+    queryData['industryField'] = $("#industryField").val();
+    queryData['introductionMode'] = $("#introductionMode").val();
+    queryData['highEducation'] = $("#highEducation").val();
+    queryData['major'] = $("#major").val();
+    queryData['title'] = $("#title").val();
+    queryData['studyAbroad'] = $("#studyAbroad").val();
+    queryData['phone'] = $("#phone").val();
+    queryData['email'] = $("#email").val();
+    queryData['address'] = $("#address").val();
+    queryData['checkState'] = $("#checkState").val();
+    queryData['isPublic'] = $("#isPublic").val();
+    queryData['year'] = $("#year").val();
+    queryData['declareType'] = $("#declareType").val();
+    queryData['introductionMethod'] = $("#introductionMethod").val();
+    return queryData;
+}
 
 
 /**
  * 查询硕博人才生活补贴申报列表
  */
 LivingAllowanceInfo.search = function () {
-    var queryData = {};
-    queryData['condition'] = $("#condition").val();
-    LivingAllowanceInfo.table.refresh({query: queryData});
+    LivingAllowanceInfo.table.refresh({query: LivingAllowanceInfo.formParams()});
 };
 
+/**
+ * 重置查询参数
+ */
+LivingAllowanceInfo.reset = function () {
+    $("#name").val("");
+    $("#idCard").val("");
+    $("#sex").val("");
+    $("#nation").val("");
+    $("#nationality").val("");
+    $("#provinceCode").val("");
+    $("#politics").val("");
+    $("#enterpriseId").val("").trigger("chosen:updated");
+    $("#industryField").val("");
+    // $("#introductionMode").val("");
+    $("#highEducation").val("");
+    $("#major").val("");
+    $("#title").val("");
+    $("#studyAbroad").val("");
+    $("#phone").val("");
+    $("#email").val("");
+    $("#address").val("");
+    $("#checkState").val("");
+    $("#isPublic").val("");
+    $("#year").val("");
+    $("#declareType").val("");
+    $("#introductionMethod").val("");
+}
+
+
 $(function () {
     var defaultColunms = LivingAllowanceInfo.initColumn();
-    var table = new BSTable(LivingAllowanceInfo.id, "/livingAllowanceInfo/list", defaultColunms);
+    var table = new BSTable(LivingAllowanceInfo.id, "/livingAllowanceInfo/list?process=" + $("#process").val(), defaultColunms);
     table.setPaginationType("server");
+    table.setOnDblClickRow(function () {
+        LivingAllowanceInfo.openCheckLivingAllowanceInfo($("#process").val());
+    });
     LivingAllowanceInfo.table = table.init();
+    //批量加载字典表数据
+    var arr = [
+        {"name": "nation", "code": "un_nation"},
+        {"name": "nationality", "code": "un_nationality"},
+        {"name": "politics", "code": "un_political"},
+        {"name": "industryField", "code": "un_industryField"},
+        {"name": "introductionMode", "code": "un_introduction_mode"},
+        {"name": "highEducation", "code": "un_education"},
+        {"name": "declareType", "code": "un_master_education"},
+        {"name": "address", "code": "un_street"}];
+    Feng.findChildDictBatch(JSON.stringify(arr));
+    $("#enterpriseId").on('chosen:ready', function (e, params) {
+        $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
+    });
+    $("#enterpriseId").chosen({
+        search_contains: true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        disable_search: false,
+        width: "100%",
+        enable_split_word_search: true
+    });
+    $('#checkAll').click(function () {
+        $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
+    })
+    $('#uncheckAll').click(function () {
+        $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
+    })
 });

+ 360 - 129
public/static/modular/master/livingAllowanceInfo/livingAllowanceInfo_info.js

@@ -2,159 +2,390 @@
  * 初始化硕博人才生活补贴申报详情对话框
  */
 var LivingAllowanceInfoInfoDlg = {
-    livingAllowanceInfoInfoData : {}
+    livingAllowanceInfoInfoData: {}
 };
 
 /**
- * 清除数据
+ * 关闭此对话框
  */
-LivingAllowanceInfoInfoDlg.clearData = function() {
-    this.livingAllowanceInfoInfoData = {};
+LivingAllowanceInfoInfoDlg.close = function () {
+    parent.layer.close(window.parent.LivingAllowanceInfo.layerIndex);
 }
 
 /**
- * 设置对话框中的数据
- *
- * @param key 数据的名称
- * @param val 数据的具体值
+ * 显示审核模态框
+ * @param process
  */
-LivingAllowanceInfoInfoDlg.set = function(key, val) {
-    this.livingAllowanceInfoInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
-    return this;
+LivingAllowanceInfoInfoDlg.showCheckModal = function (process) {
+    var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/validateIsCheck", function (data) {
+        if (data.code == 200) {
+            layer.open({
+                type: 1,
+                id: "neewFieldFormModel",
+                title: '审核',
+                area: ['800px', '450px'],
+                fix: false,
+                shade: 0,
+                maxmin: true,
+                content: $("#checkTemplate").html(),
+                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.obj;
+                    var fileList = data.obj.fileList;
+                    var html = '';
+                    for (var key in fileList) {
+                        html = html + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
+                    }
+                    $("#field_file").empty().append(html);
+                    $("#firstCheckForm")[0].reset();
+                    $("#state").val(obj.checkState).trigger("change");
+                    $("#msg").val(obj.checkMsg);
+                    $("#process").val(process);
+                    if (Feng.isNotEmptyStr(obj.fields)) {
+                        $("#field_info input").each(function () {
+                            var arr = obj.fields.split(",");
+                            for (var key in arr) {
+                                if ($(this).val() == arr[key]) {
+                                    this.checked = true;
+                                }
+                            }
+                        });
+                    }
+                    if (Feng.isNotEmptyStr(obj.files)) {
+                        $("#field_file input").each(function () {
+                            if (obj.files.indexOf($(this).val()) != -1) {
+                                this.checked = true;
+                            }
+                        });
+                    }
+                },
+                yes: function (index, layero) {
+                    var checkState = $("#state").val();
+                    var checkMsg = $("#msg").val();
+                    if (Feng.isEmptyStr(checkState)) {
+                        Feng.info("请选择审核状态");
+                        return;
+                    }
+                    if (Feng.isEmptyStr(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;
+                    }
+                    var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/check", function (data) {
+                        if (data.code == 200) {
+                            layer.close(index);
+                            Feng.success(data.msg);
+                        } else {
+                            Feng.error(data.msg);
+                        }
+                    }, function (data) {
+                        Feng.error("提交失败!" + data.responseJSON.message + "!");
+                    });
+                    ajax.setData({
+                        "id": $("#id").val(),
+                        "checkState": checkState,
+                        "checkMsg": checkMsg,
+                        "process": process,
+                        "fields": fields,
+                        "files": files
+                    })
+                    ajax.start();
+                }
+            });
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("校验失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("id", $("#id").val());
+    ajax.set("process", process);
+    ajax.start();
 }
 
 /**
- * 设置对话框中的数据
- *
- * @param key 数据的名称
- * @param val 数据的具体值
+ * 提交审核
+ * @param process
  */
-LivingAllowanceInfoInfoDlg.get = function(key) {
-    return $("#" + key).val();
+LivingAllowanceInfoInfoDlg.submitCheck = function (process) {
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/submitCheck", function (data) {
+            if (data.code == 200) {
+                Feng.success(data.msg);
+                window.parent.LivingAllowanceInfo.table.refresh();
+                LivingAllowanceInfoInfoDlg.close();
+            } else {
+                Feng.error(data.msg);
+            }
+        }, function (data) {
+            Feng.error("提交审核失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("id", $("#id").val());
+        ajax.set("process", process);
+        ajax.start();
+    }
+    Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
 }
 
-/**
- * 关闭此对话框
- */
-LivingAllowanceInfoInfoDlg.close = function() {
-    parent.layer.close(window.parent.LivingAllowanceInfo.layerIndex);
+LivingAllowanceInfoInfoDlg.fieldCheckd = function (context) {
+    if ($(context).get(0).checked) {
+        $(context).parent().next().children()[0].checked = true;
+        $(context).parent().next().children().eq(0).trigger("change");
+    }
 }
 
-/**
- * 收集数据
- */
-LivingAllowanceInfoInfoDlg.collectData = function() {
-    this
-    .set('id')
-    .set('year')
-    .set('enterpriseId')
-    .set('enterpriseName')
-    .set('type')
-    .set('talentType')
-    .set('cardType')
-    .set('idCard')
-    .set('name')
-    .set('photo')
-    .set('sex')
-    .set('nation')
-    .set('nationality')
-    .set('provinceCode')
-    .set('provinceName')
-    .set('cityCode')
-    .set('cityName')
-    .set('countyCode')
-    .set('countyName')
-    .set('birthday')
-    .set('address')
-    .set('politics')
-    .set('highEducation')
-    .set('graduateSchool')
-    .set('major')
-    .set('post')
-    .set('phone')
-    .set('email')
-    .set('bank')
-    .set('bankNetwork')
-    .set('bankAccount')
-    .set('bankNumber')
-    .set('entryTime')
-    .set('quitTime')
-    .set('startTime')
-    .set('endTime')
-    .set('educationAndResume')
-    .set('mainHonours')
-    .set('firstInJJTime')
-    .set('isIntroduction')
-    .set('industryField')
-    .set('title')
-    .set('professionalQualifications')
-    .set('studyAbroad')
-    .set('studyAbroadCountry')
-    .set('studyAbroadTime')
-    .set('introductionMode')
-    .set('letterTime')
-    .set('applyCount')
-    .set('isPublic')
-    .set('amount')
-    .set('isPay')
-    .set('publicBatch')
-    .set('active')
-    .set('checkState')
-    .set('checkMsg')
-    .set('fields')
-    .set('files')
-    .set('firstSubmitTime')
-    .set('newSubmitTime')
-    .set('outMsg')
-    .set('highProcess')
-    .set('isEffect')
-    .set('description')
-    .set('createTime')
-    .set('createUser')
-    .set('updateTime')
-    .set('updateUser');
+LivingAllowanceInfoInfoDlg.checkAll = function () {
+    $("#field input").each(function () {
+        this.checked = true;
+    })
 }
-
 /**
- * 提交添加
+ * 反选
  */
-LivingAllowanceInfoInfoDlg.addSubmit = function() {
-
-    this.clearData();
-    this.collectData();
-
-    //提交信息
-    var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/add", function(data){
-        Feng.success("添加成功!");
-        window.parent.LivingAllowanceInfo.table.refresh();
-        LivingAllowanceInfoInfoDlg.close();
-    },function(data){
-        Feng.error("添加失败!" + data.responseJSON.message + "!");
-    });
-    ajax.set(this.livingAllowanceInfoInfoData);
-    ajax.start();
+LivingAllowanceInfoInfoDlg.unCheckAll = function () {
+    $("#field input").each(function () {
+        if (this.checked) {
+            this.checked = false;
+        } else {
+            this.checked = true;
+        }
+    })
 }
 
 /**
- * 提交修改
+ * 显示字段或者隐藏字段选择
  */
-LivingAllowanceInfoInfoDlg.editSubmit = function() {
-
-    this.clearData();
-    this.collectData();
-
-    //提交信息
-    var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/update", function(data){
-        Feng.success("修改成功!");
-        window.parent.LivingAllowanceInfo.table.refresh();
-        LivingAllowanceInfoInfoDlg.close();
-    },function(data){
-        Feng.error("修改失败!" + data.responseJSON.message + "!");
-    });
-    ajax.set(this.livingAllowanceInfoInfoData);
-    ajax.start();
+LivingAllowanceInfoInfoDlg.toggleField = function () {
+    var checkState = $("#state").val();
+    var process = $("#process").val();
+    var checkMsg = $("#msg").val();
+    if (checkState == 2) {
+        $("#field").show();
+        $("#msg").val("");
+    } else if (checkState == 3) {
+        $("#field").hide();
+        $("#field").find("input[type=checkbox]").removeAttr("checked");
+        if (Feng.isEmptyStr(checkMsg)) {
+            if(process == 1){
+                $("#msg").val("初审通过,待部门审核!");
+            }
+            if(process == 2){
+                $("#msg").val("部门审核通过,待复核!");
+            }
+            if(process == 3){
+                $("#msg").val("复核通过,待公示!");
+            }
+        }
+    } else if (checkState == -1) {
+        $("#field").hide();
+        if(process == 1){
+            $("#msg").val("初审不通过!");
+        }
+        if(process == 2){
+            $("#msg").val("部门审核不通过!");
+        }
+        if(process == 3){
+            $("#msg").val("复核不通过!");
+        }
+    }
 }
 
-$(function() {
+LivingAllowanceInfoInfoDlg.showMiniFileModal = function (){
+    Feng.showMiniFileModal(CONFIG.project_master_living_allowance, $("#type").val(), $("#id").val());
+}
 
+$(function () {
+    Feng.getCheckLog("logTable", {
+        "type": CONFIG.project_master_living_allowance,
+        "mainId": $("#id").val(),
+        "typeFileId": "",
+        "active": 1
+    });
+    $('#identifyTable').bootstrapTable({
+        url: Feng.ctxPath + "/talentInfo/getTalentInfoByIdCard",
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false,				// 是否显示刷新按钮
+        clickToSelect: true,			// 是否启用点击选中行
+        singleSelect: true,				// 设置True 将禁止多选
+        striped: true,  				// 是否显示行间隔色
+        pagination: false,   			// 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "server",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        showColumns: false,
+        queryParams: function (params) {
+            return {"idCard":$("#idCard").val()};
+        },
+        rowStyle : function(row,index){
+            return {css: {"word-break": "break-word", "white-space": "inherit"}}
+        },
+        columns:
+            [
+                {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:'80px'},
+                {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:"120px",
+                    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: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px"},
+                {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
+                {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",
+                    formatter : function (value,row,index) {
+                        if(value==-1){
+                            return "<span class='label label-danger'>审核不通过</span>"
+                        }else if(value==1){
+                            return "<span class='label'>待提交</span>"
+                        }else if(value==10){
+                            return "<span class='label label-danger'>已驳回</span>"
+                        }else if(value==35){
+                            return "<span class='label label-primary'>已通过</span>"
+                        }else{
+                            return "<span class='label label-success'>审核中</span>"
+                        }
+                    }
+                },
+                {title: '公示状态', field: 'isPublic', visible: true, align: 'center', valign: 'middle',width:'120px',
+                    formatter : function (value,row,index) {
+                        if(value == 1){
+                            return "<span class='label label-info'>待核查征信</span>"
+                        }if(value == 2){
+                            return "<span class='label label-success'>待公示</span>"
+                        }if(value == 3){
+                            return "<span class='label label-danger'>公示中</span>"
+                        }if(value == 4){
+                            return "<span class='label label-warning'>待公布</span>"
+                        }if(value == 5){
+                            if(row.checkState == -1){
+                                return "<span class='label label-danger'>审核不通过</span>"
+                            }
+                            return "<span class='label label-primary'>待发证</span>"
+                        }if(value == 6){
+                            return "<span class='label label-primary'>已发证</span>"
+                        }
+                    }
+                },
+            ]
+        ,
+        onPostBody: function () {
+            $('#identifyTable'+"td.uitd_showTip").bind("mouseover", function () {
+                var htm = $(this).html();
+                $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+            });
+        }
+    });
+    $('#allowanceTable').bootstrapTable({
+        url: Feng.ctxPath + "/talentAllowanceInfo/getTalentAllowanceByIdCard",
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false,				// 是否显示刷新按钮
+        clickToSelect: true,			// 是否启用点击选中行
+        singleSelect: true,				// 设置True 将禁止多选
+        striped: true,  				// 是否显示行间隔色
+        pagination: false,   			// 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "server",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        showColumns: false,
+        queryParams: function (params) {
+            return {"idCard":$("#idCard").val()};
+        },
+        rowStyle : function(row,index){
+            return {css: {"word-break": "break-word", "white-space": "inherit"}}
+        },
+        columns:
+            [
+                {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"60px"},
+                {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:"80px"},
+                {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
+                {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
+                {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
+                {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
+                    formatter(value,row,index){
+                        if(value==-1){
+                            return "<span class='label label-warning-light'>审核不通过</span>";
+                        }else if(value==1){
+                            return "<span class='label'>待提交</span>"
+                        }
+                        else if(value==10){
+                            return "<span class='label label-danger'>已驳回</span>";
+                        }else if( value==30){
+                            return "<span class='label label-primary'>已通过</span>"
+                        }else {
+                            return "<span class='label label-success'>审核中</span>";
+                        }
+                    }
+                },
+                {title: '兑现状态', field: 'publicState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
+                    formatter(value,row,index){
+                        if(value==1)return "<span style='color: #9d8189'>待核查征信</span>";
+                        if(value==2)return "<span style='color: #00d3ee'>待公示</span>";
+                        if(value==3)return "<span style='color: #af2cc5'>公示中</span>";
+                        if(value==4){
+                            return (row.allowanceType == 3)?"<span style='color: #f55a4e'>不予兑现</span>":"<span style='color: #ca9fab'>待兑现</span>";
+                        }
+                        if(value==5)return "<span style='color: #5cb860'>已兑现</span>";
+                    }
+                },
+                {title: '推荐津补贴类型', field: 'recommendAllowanceType', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
+                    formatter(value,row,index){
+                        if(value==null || value=="")return "<span style='color: black'>未判定</span>";
+                        if(value==1)return "<span style='color: green'>人才津贴</span>";
+                        if(value==2)return "<span style='color: blue'>一次性交通补贴</span>";
+                        if(value==3)return "<span style='color: red'>不予兑现</span>";
+                    }
+                },
+                {title: '推荐兑现月份', field: 'recommendMonths', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '推荐兑现金额', field: 'recommendMoney', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '推荐金额说明', field: 'recommendMoneyDesc', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
+                    formatter(value,row,index){
+                        if(value==null || value=="")return "<span style='color: black'>未判定</span>";
+                        if(value==1)return "<span style='color: green'>人才津贴</span>";
+                        if(value==2)return "<span style='color: blue'>一次性交通补贴</span>";
+                        if(value==3)return "<span style='color: red'>不予兑现</span>";
+                    }
+                },
+                {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
+                {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
+                {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
+            ]
+        ,
+        onPostBody: function () {
+            $('#allowanceTable'+"td.uitd_showTip").bind("mouseover", function () {
+                var htm = $(this).html();
+                $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+            });
+        }
+    });
+    LivingAllowanceInfoInfoDlg.showMiniFileModal();
 });