Jelajahi Sumber

积分申报初审复审

sugangqiang 2 tahun lalu
induk
melakukan
b7aa809e46

+ 99 - 303
app/admin/controller/IntegralVerify.php

@@ -14,6 +14,9 @@ use app\common\api\MenuApi;
 use app\admin\model\SysRelation;
 use app\common\api\CompanyApi;
 use app\common\api\IntegralRecordApi;
+use app\common\state\ProjectState;
+use app\common\state\IntegralState;
+use app\common\model\IntegralRecord;
 
 /**
  * Description of Talent
@@ -62,16 +65,16 @@ class IntegralVerify extends AdminController {
         $ids_arr = array_filter(explode(",", $ids));
         $counts = 0;
         foreach ($ids_arr as $id) {
-            $ti = VerifyApi::getOne($id);
+            $record = IntegralRecord::getOne($id);
             $data["id"] = $id;
-            if ($ti["checkState"] == TalentState::FST_SUBMIT) {
-                $data["checkState"] = TalentState::BASE_VERIFY_FAIL;
-                TalentLogApi::write(1, $id, TalentState::BASE_VERIFY_FAIL, $msg, 1);
+            if ($record["checkState"] == IntegralState::SUBMIT) {
+                $data["checkState"] = IntegralState::VERIFY_FAIL;
+                TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::VERIFY_FAIL, $msg, 1);
                 TalentModel::update($data);
                 $counts++;
-            } else if ($ti["checkState"] == TalentState::SCND_SAVE) {
-                $data["checkState"] = TalentState::FST_VERIFY_FAIL;
-                TalentLogApi::write(1, $id, TalentState::FST_VERIFY_FAIL, $msg, 1);
+            } else if ($record["checkState"] == IntegralState::VERIFY_PASS) {
+                $data["checkState"] = IntegralState::FST_VERIFY_FAIL;
+                TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::REVERIFY_FAIL, $msg, 1);
                 TalentModel::update($data);
                 $counts++;
             } else {
@@ -607,55 +610,30 @@ class IntegralVerify extends AdminController {
      * @param type $talent_info
      * @return type json
      */
-    private function fstCheck(\think\Request $request, $talent_info) {
+    private function fstCheck(\think\Request $request, $record) {
         $params = $request->param();
-        if ($params["checkState"] == 3) {
+        if ($params["checkState"] == 1) {
 //审核成功,并取消设置越过部门并审
-            $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
-            $data["pass_dept_check"] = 0;
-            if ($talent_info["isImport"] && $talent_info["isMatchZhiren"]) {
-                $data["pass_dept_check"] = 1;
-            }
-        } else if ($params["checkState"] == 4) {
-            if ($talent_info["highProcess"] < 4)
-                return json(["msg" => "只有曾经通过部门并审,初审时才可以选择直接跳过部门并审阶段"]);
-//审核成功,并设置越过部门并审。附加条件:最高进度曾经通过部门并审4(包含部门并审)
-            $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
-            $data["pass_dept_check"] = $talent_info["highProcess"] >= 4 ? 1 : 0;
-        } else if ($params["checkState"] == 5) {
-            //选择重审部门
-            if ($talent_info["highProcess"] < 4)
-                return json(["msg" => "只有曾经通过部门并审,初审时才可以选择再次审核的部门"]);
-            if (!$params["companys"])
-                return json(["msg" => "请选择需要再次审核的部门"]);
-            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-            $companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位
-            $re_check_companys = array_filter(explode(",", $talent_info["re_check_companys"]));
-            foreach ($re_check_companys as $reCompanyId) {
-                if (!in_array($reCompanyId, $companyIds)) {
-                    return json(["msg" => "错误的部门"]);
-                }
-            }
-            $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
-            $data["pass_dept_check"] = 0;
-        } else {
+            $log_checkState = $checkState = IntegralState::VERIFY_PASS; //初审成功
+        } else if ($params["checkState"] == 2) {
 //审核驳回并记录需要修改的字段和上传文件
-            $checkState = TalentState::SCND_SAVE; //退回材料编辑状态
-            $log_checkState = TalentState::FST_VERIFY_REJECT; //日志记录拒绝状态
+            $checkState = IntegralState::SAVE; //退回材料编辑状态
+            $log_checkState = IntegralState::VERIFY_REJECT; //日志记录拒绝状态
+        } else {
+            $checkState = IntegralState::VERIFY_FAIL;
         }
-        $log = TalentLogApi::getLastLog($talent_info["id"], 1);
+        $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
         if (!$log)
             return json(["msg" => "日志数据异常,保存失败"]);
         if ($log["active"] == 0) {
             TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
         } else {
-            TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
+            TalentLogApi::write(ProjectState::INTEGRAL, $record["id"], [$log_checkState, $checkState], $params["checkMsg"]);
         }
-        $data["id"] = $talent_info["id"];
+        $data["id"] = $record["id"];
         $data["modify_files"] = $params["files"];
         $data["modify_fields"] = $params["fields"];
-        $data["re_check_companys"] = $params["companys"];
-        TalentModel::update($data);
+        IntegralRecord::update($data);
         return json(["code" => 200, "msg" => "保存成功"]);
     }
 
@@ -664,51 +642,34 @@ class IntegralVerify extends AdminController {
      * @param type $talent_info
      * @return type json
      */
-    private function fstSubmitCheck($talent_info) {
-        $nowProcess = 3;
-        $log = TalentLogApi::getLastLog($talent_info["id"], 1);
+    private function fstSubmitCheck($record) {
+        $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
         if (!$log || $log["active"] == 1)
             return json(["msg" => "请先保存审核状态,再提交审核"]);
-        if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
-            $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
-        }
-        $userIds = [];
-        if ($log["new_state"] == TalentState::FST_VERIFY_PASS && $talent_info["pass_dept_check"] == 0) {
-            $data["first_dept_check_time"] = date("Y-m-d H:i:s");
-            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-            $companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位
-            if ($talent_info["re_check_companys"]) {
-                $unpass_companyIds = array_filter(explode(",", $talent_info["re_check_companys"]));
-            } else {
-//这边去除已经审核通过的单位,主要通过日志是否存在记录。
-                $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
-                $unpass_companyIds = array_diff($companyIds, (array) $pass_companyIds); //排除已经通过的单位
-                if (!$unpass_companyIds) {
-                    $data["pass_dept_check"] = 1; //部门已经全部审核过了,跳过部门审核
-                }
-            }
-            if ($unpass_companyIds) {
-                sort($unpass_companyIds);
-                TalentLogApi::writeDeptLogs($talent_info["id"], $unpass_companyIds, TalentState::FST_VERIFY_PASS);
-
-                //初审通过发送短信通知并审部门
-                $privs = ["/admin/talent/dept_check"];
-                $menuIds = MenuApi::getMenuIdsByNewUrls($privs);
-                $where[] = ["menuid", "in", $menuIds];
-                $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid");
-                $where = [];
-                $where[] = ["status", "=", 1];
-                $where[] = ["companyId", "in", $unpass_companyIds];
-                $where[] = ["roleid", "in", $roleIds];
-                $where[] = ["roleid", "<>", 1];
-                $userIds = User::where($where)->column("id");
-            }
+        if ($log["new_state"] == IntegralState::VERIFY_PASS) {
+            $data["modify_files"] = null;
+            $data["modify_fields"] = null;
         }
-        $data["id"] = $talent_info["id"];
+        $data["id"] = $record["id"];
         $data["checkState"] = $log["new_state"];
-        TalentModel::update($data);
+        IntegralRecord::update($data);
         TalentLogApi::setActive($log["id"], 1);
-        $this->sendMsgByState($talent_info, $log["new_state"], $userIds);
+        $userIds = [];
+        if (in_array($data["checkState"], [IntegralState::VERIFY_PASS])) {
+            //初审成功需要发送短信给复核部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户
+            //从复核权限,逆推复核人员
+            $privs = ["/admin/integralVerify/re_verify"];
+            $menuIds = MenuApi::getMenuIdsByNewUrls($privs);
+            $where = [];
+            $where[] = ["menuid", "in", $menuIds];
+            $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid");
+            $where = [];
+            $where[] = ["status", "=", 1];
+            $where[] = ["roleid", "in", $roleIds];
+            $where[] = ["roleid", "<>", 1];
+            $userIds = User::where($where)->column("id");
+        }
+        $this->sendMsgByState($record, $log["new_state"], $userIds);
         return json(["code" => 200, "msg" => "审核成功"]);
     }
 
@@ -718,29 +679,31 @@ class IntegralVerify extends AdminController {
      * @param type $talent_info
      * @param type json
      */
-    private function reCheck(\think\Request $request, $talent_info) {
+    private function reCheck(\think\Request $request, $record) {
         $params = $request->param();
-        if ($params["checkState"] == 3) {
-//审核成功
-            $log_checkState = $checkState = TalentState::REVERIFY_PASS; //复核成功
+        $data["modify_files"] = null;
+        $data["modify_fields"] = null;
+        if ($params["checkState"] == 1) {
+            //审核成功
+            $log_checkState = $checkState = IntegralState::REVERIFY_PASS; //复核成功
         } else if ($params["checkState"] == 2) {
-//审核驳回并记录需要修改的字段和上传文件
-            $checkState = TalentState::SCND_SUBMIT; //退回待初审
-            $log_checkState = TalentState::REVERIFY_REJECT; //日志记录拒绝状态
+            //审核驳回并记录需要修改的字段和上传文件
+            $checkState = IntegralState::SUBMIT; //退回待初审
+            $log_checkState = IntegralState::REVERIFY_REJECT; //日志记录拒绝状态
+            $data["modify_files"] = $params["files"];
+            $data["modify_fields"] = $params["fields"];
         } else {
-            $log_checkState = $checkState = TalentState::REVERIFY_FAIL; //审核失败
+            $log_checkState = $checkState = IntegralState::REVERIFY_FAIL; //审核失败
         }
-        $log = TalentLogApi::getLastLog($talent_info["id"], 1);
+        $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
         if (!$log)
             return json(["msg" => "日志数据异常,保存失败"]);
         if ($log["active"] == 0) {
             TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
         } else {
-            TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
+            TalentLogApi::write(ProjectState::INTEGRAL, $record["id"], [$log_checkState, $checkState], $params["checkMsg"]);
         }
-        $data["id"] = $talent_info["id"];
-        $data["modify_files"] = $params["files"];
-        $data["modify_fields"] = $params["fields"];
+        $data["id"] = $record["id"];
         TalentModel::update($data);
         return json(["code" => 200, "msg" => "保存成功"]);
     }
@@ -750,30 +713,22 @@ class IntegralVerify extends AdminController {
      * @param type $talent_info
      * @return type json
      */
-    private function reSubmitCheck($talent_info) {
-        return $this->commonSubmitCheck($talent_info, 5);
-    }
-
-    private function commonSubmitCheck($talent_info, $nowProcess) {
-        $log = TalentLogApi::getLastLog($talent_info["id"], 1);
+    private function reSubmitCheck($record) {
+        $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
         if (!$log || $log["active"] == 1)
             return json(["msg" => "请先保存审核状态,再提交审核"]);
-        if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
-            $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
-        }
-
-        $data["id"] = $talent_info["id"];
+        $data["id"] = $record["id"];
         $data["checkState"] = $log["new_state"];
-        TalentModel::update($data);
+        IntegralRecord::update($data);
         TalentLogApi::setActive($log["id"], 1);
         $userIds = [];
-        if (in_array($data["checkState"], [TalentState::REVERIFY_PASS, TalentState::REVERIFY_REJECT])) {
+        if (in_array($data["checkState"], [IntegralState::REVERIFY_PASS, IntegralState::REVERIFY_REJECT])) {
             //复核成功需要发送短信给征信部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户
             //从征信审核权限,逆推征信部门
-            if ($data["checkState"] == TalentState::REVERIFY_PASS) {
-                $privs = ["/admin/talent/hczxReject", "/admin/talent/hczxPass"];
+            if ($data["checkState"] == IntegralState::REVERIFY_PASS) {
+                $privs = ["/admin/integralVerify/hczxReject", "/admin/integralVerify/hczxPass"];
             } else {
-                $privs = ["admin/talent/fst_check"];
+                $privs = ["admin/integralVerify/fst_check"];
             }
             $menuIds = MenuApi::getMenuIdsByNewUrls($privs);
             $where = [];
@@ -785,7 +740,7 @@ class IntegralVerify extends AdminController {
             $where[] = ["roleid", "<>", 1];
             $userIds = User::where($where)->column("id");
         }
-        $this->sendMsgByState($talent_info, $data["checkState"], $userIds);
+        $this->sendMsgByState($record, $data["checkState"], $userIds);
         return json(["code" => 200, "msg" => "审核成功"]);
     }
 
@@ -891,9 +846,9 @@ class IntegralVerify extends AdminController {
         $files = $params["files"];
         $fields = $params["fields"];
         $id = $params["id"];
-        $talent_info = VerifyApi::getOne($id);
-        $checkState = $talent_info["checkState"];
-        if (!$talent_info) {
+        $record = IntegralRecordApi::getOne($id);
+        $checkState = $record["checkState"];
+        if (!$record) {
             return json(["msg" => "数据错误"]);
         }
         if (!$check) {
@@ -902,24 +857,13 @@ class IntegralVerify extends AdminController {
         if (!$check_msg) {
             return json(["msg" => "请填写审核说明"]);
         }
-        if ($checkState == TalentState::FST_SUBMIT) {
-            return $this->baseCheck($request, $talent_info);
-        } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
-            return $this->baseReCheck($request, $talent_info);
-        } else if ($checkState == TalentState::SCND_SUBMIT) {
-            return $this->fstCheck($request, $talent_info);
-        } else if ($checkState == TalentState::FST_VERIFY_PASS) {
-            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-            $companys = array_filter(explode(",", $condition["companyIds"]));
-            if ($companys && $talent_info["pass_dept_check"] != 1) {
-                if (!in_array($this->user["companyId"], $companys))
-                    return json(["msg" => "你的部门不在并审部门列表"]);
-                return $this->deptCheck($request, $talent_info, $companys);
-            } else {
-                return $this->reCheck($request, $talent_info);
-            }
-        } else if ($checkState == TalentState::DEPT_VERIFY_PASS) {
-            return $this->reCheck($request, $talent_info);
+        if ($check == 2 && !$files && $fields) {
+            return json(["msg" => "请选择可修改的字段或项目"]);
+        }
+        if ($checkState == IntegralState::SUBMIT) {
+            return $this->fstCheck($request, $record);
+        } else if ($checkState == IntegralState::VERIFY_PASS) {
+            return $this->reCheck($request, $record);
         } else {
             return json(["msg" => "不在审核范围内,保存失败"]);
         }
@@ -928,29 +872,15 @@ class IntegralVerify extends AdminController {
     public function submitCheck() {
 //公共调度方法
         $id = $this->request->param("id");
-        $talent_info = VerifyApi::getOne($id);
-        $checkState = $talent_info["checkState"];
-        if (!$talent_info) {
+        $record = IntegralRecordApi::getOne($id);
+        $checkState = $record["checkState"];
+        if (!$record) {
             return json(["msg" => "数据错误"]);
         }
-        if ($checkState == TalentState::FST_SUBMIT) {
-            return $this->baseSubmitCheck($talent_info);
-        } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
-            return $this->baseReSubmitCheck($talent_info);
-        } else if ($checkState == TalentState::SCND_SUBMIT) {
-            return $this->fstSubmitCheck($talent_info);
-        } else if ($checkState == TalentState::FST_VERIFY_PASS) {
-            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-            $companys = array_filter(explode(",", $condition["companyIds"]));
-            if ($companys && $talent_info["pass_dept_check"] != 1) {
-                if (!in_array($this->user["companyId"], $companys))
-                    return json(["msg" => "你的部门不在并审部门列表"]);
-                return $this->deptSubmitCheck($talent_info, $companys);
-            } else {
-                return $this->reSubmitCheck($talent_info);
-            }
-        } else if ($checkState == TalentState::DEPT_VERIFY_PASS) {
-            return $this->reSubmitCheck($talent_info);
+        if ($checkState == IntegralState::SUBMIT) {
+            return $this->fstSubmitCheck($record);
+        } else if ($checkState == IntegralState::VERIFY_PASS) {
+            return $this->reSubmitCheck($record);
         } else {
             return json(["msg" => "不在审核范围内,审核失败"]);
         }
@@ -959,154 +889,20 @@ class IntegralVerify extends AdminController {
     public function validateIsCheck() {
         $params = $this->request->param();
         $id = $params["id"];
-        $talent_info = VerifyApi::getOne($id);
-        $fstLog = TalentLogApi::getFstLog($id, 1);
-        $isMix = false;
-        if (in_array($fstLog["state"], [TalentState::SCND_SAVE, TalentState::SCND_SUBMIT])) {
-            //初次提交是待初审状态,则为新的混合基础信息和人才认证信息的申报
-            $isMix = true;
-        }
-        $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
-        if ($talent_info) {
-            $checkState = $talent_info["checkState"];
-// 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5基审复核通过 6基审复核驳回 7基审复核失败 8保存补充材料未提交 9提交补充材料进入初审 10初审通过 11初审驳回 12部门审核通过 13部门审核驳回 14复核通过 15复核驳回 16复核失败
-            $process = 0;
-            if (in_array($checkState, [TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS])) {
-                switch ($checkState) {
-                    case TalentState::FST_SUBMIT:
-                        $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
-                        $field_tmp = [];
-                        foreach ($fields as $key => $field) {
-                            $field_tmp[] = ["key" => $key, "value" => $field];
-                        }
-                        $where[] = ["project", "=", 1];
-                        $where[] = ["step", "=", 1];
-                        $where[] = ["active", "=", 1];
-                        $where[] = ["type", "=", $enterprise["type"]];
-
-                        $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
-                        /* foreach ($files as $key => $file) {
-                          $options = array_filter(explode(",", $file["option"]));
-                          if ($options) {
-                          switch ($file["rel"]) {
-                          case "talent_type":
-                          $allow_tags = array_filter(explode(",", $file["enterprise_tag"]));
-                          if ($allow_tags && !in_array($enterprise["enterpriseTag"], $allow_tags)) {
-                          unset($files[$key]);
-                          break;
-                          }
-                          if (!in_array($talent_info["talent_type"], $options)) {
-                          unset($files[$key]);
-                          break;
-                          }
-                          break;
-                          case "birthday":
-                          $birthYear = substr($talent_info["birthday"], 0, 4);
-                          $currentYear = date("Y");
-                          $age = $currentYear - $birthYear;
-                          if ($age < $options[0]) {
-                          unset($files[$key]);
-                          break;
-                          }
-                          break;
-                          }
-                          }
-                          } */
-                        $process = 1;
-                        break;
-                    case TalentState::BASE_VERIFY_PASS:
-                        $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
-                        $field_tmp = [];
-                        foreach ($fields as $key => $field) {
-                            $field_tmp[] = ["key" => $key, "value" => $field];
-                        }
-                        $where[] = ["project", "=", 1];
-                        $where[] = ["step", "=", 1];
-                        $where[] = ["active", "=", 1];
-                        $where[] = ["type", "=", $enterprise["type"]];
-
-                        $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
-                        $process = 2;
-                        break;
-                    case TalentState::SCND_SUBMIT:
-                        $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
-                        $process = 3;
-                        break;
-                    case TalentState::FST_VERIFY_PASS:
-                        $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
-                        if ($tc["companyIds"] && $talent_info["pass_dept_check"] != 1) {
-                            $process = 4;
-                            $fields = DictApi::getTalentFields(3, $talent_info["isImport"]);
-                        } else {
-                            $process = 5;
-                            $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
-                        }
-                        break;
-                    case TalentState::DEPT_VERIFY_PASS:
-                        $process = 5;
-                        $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
-                        break;
-                }
-                if ($isMix && $process != 4) {
-                    if ($enterprise["type"] == 2) {
-                        $fields = DictApi::getTalentFields_IC();
-                    } else {
-                        $fields = DictApi::getTalentFields(4, $talent_info["isImport"]);
-                    }
-                }
-                if ($checkState != TalentState::FST_SUBMIT) {
-                    //$fields = DictApi::getTalentFields(2);
-                    $field_tmp = [];
-                    if ($fields) {
-                        foreach ($fields as $key => $field) {
-                            $field_tmp[] = ["key" => $key, "value" => $field];
-                        }
-                    }
-                    $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-                    $companys = array_filter(explode(",", $condition["companyIds"]));
-                    $_companys = [];
-                    foreach ($companys as $companyId) {
-                        $company = CompanyApi::getOne($companyId);
-                        $_companys[] = $company;
-                    }
-                    if ($process == 4 && $enterprise["type"] == 1) {
-                        $where = [];
-                        $where[] = ["delete", "=", 0];
-                        $cwfts = explode(";", $condition["companyWithFileType"]);
-                        foreach ($cwfts as $cwft) {
-                            $_company_setting = explode(":", $cwft);
-                            if ($_company_setting[0] == $this->user["companyId"]) {
-                                $where[] = ["id", "in", explode(",", $_company_setting[1])];
-                                break;
-                            }
-                        }
-                        if ($where) {
-                            $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
-                        } else {
-                            $files = [];
-                        }
-                    } else {
-                        $where = [];
-                        $whr = [];
-                        if (!$isMix) {
-                            $where[] = ["step", "=", 2];
-                        }
-                        $where[] = ["project", "=", 1];
-                        $where[] = ["active", "=", 1];
-                        $where[] = ["type", "=", $enterprise["type"]];
-                        $where[] = ["isConditionFile", "<>", 1];
-                        $where[] = ["delete", "=", 0];
-                        if ($condition && $condition["bindFileTypes"]) {
-                            $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
-                            $files = \think\facade\Db::table("new_common_filetype")->whereOr([$where, $whr])->select();
-                        } else {
-                            $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
-                        }
-                    }
+        $record = IntegralRecordApi::getOne($id);
+        $enterprise = \app\common\model\Enterprise::findOrEmpty($record["enterprise_id"]);
+        if ($record) {
+            $items = $record["detail"]->toArray(); //项目明细
+            $checkState = $record["checkState"];
+            if (in_array($checkState, [IntegralState::SUBMIT, IntegralState::VERIFY_PASS])) {
+                $fields = DictApi::getIntegralFields();
+                $field_tmp = [];
+                foreach ($fields as $key => $field) {
+                    $field_tmp[] = ["key" => $key, "value" => $field];
                 }
-                $talent_info["files"] = array_filter(explode(",", $talent_info["modify_files"]));
-                $talent_info["fields"] = array_filter(explode(",", $talent_info["modify_fields"]));
-                return json(["code" => 200, "obj" => ["process" => $process, "talentInfo" => $talent_info, "fieldList" => $field_tmp, "fileList" => $files, "companys" => $_companys]]);
+                $record["files"] = $record["modify_files"];
+                $record["fields"] = array_filter(explode(",", $record["modify_fields"]));
+                return json(["code" => 200, "obj" => ["record" => $record, "fieldList" => $field_tmp]]);
             } else {
                 return json(["msg" => "该申报不在审核范围内,无法审核"]);
             }

+ 10 - 0
app/common/api/DictApi.php

@@ -138,6 +138,16 @@ class DictApi {
         return $dict;
     }
 
+    public static function getIntegralFields() {
+        return [
+            "name" => "姓名",
+            "card_type" => "证件类型",
+            "card_number" => "证件号码",
+            "phone" => "手机号码",
+            "email" => "电子邮箱"
+        ];
+    }
+
     public static function getTalentFields($step, $isImport = 0) {
         $dict1 = [
             "talent_type" => "人才类型",

+ 1 - 1
public/static/modular/gate/integral/integralInfo.js

@@ -563,7 +563,7 @@ IntegralInfoDlg.setNoChangeField = function () {
     var checkState = $("#checkState").val();
     var fields = $("#fields").val();
     var realState = $("#realState").val();
-    if (realState == 4) {
+    if (realState == 4 || checkState == 2) {
         $("input,textarea").each(function () {
             $(this).attr("readonly", "readonly");
         });

+ 12 - 1
public/static/modular/talentIdentify/integralMgr/IntegralVerify.js

@@ -156,7 +156,18 @@ IntegralVerify.check = function () {
 
 
 IntegralVerify.openCheckIntegralVerify = function () {
-    var title = $("#title").val();
+    var process = $("#process").val();
+    var title = "";
+    switch (process) {
+        case "1":
+            title = "初审";
+            break;
+        case "2":
+            title = "复审";
+            break;
+        default:
+            break;
+    }
     if (this.check()) {
         var index = layer.open({
             type: 2,

+ 20 - 61
public/static/modular/talentIdentify/integralMgr/IntegralVerify_info.js

@@ -119,7 +119,7 @@ IntegralVerifyInfoDlg.changeAndLoadFile = function () {
  * 关闭此对话框
  */
 IntegralVerifyInfoDlg.close = function () {
-    parent.layer.close(window.parent.TalentInfo.layerIndex);
+    parent.layer.close(window.parent.IntegralVerify.layerIndex);
 }
 
 IntegralVerifyInfoDlg.callback = function (data) {
@@ -203,10 +203,7 @@ IntegralVerifyInfoDlg.showFirstCheckModal = function () {
                 zIndex: layer.zIndex,
                 success: function (layero, index) {
                     layer.setTop(layero);
-                    var obj = data.obj.talentInfo;
-                    var companyList = data.obj.companys;
-                    var fileList = data.obj.fileList;
-                    var process = data.obj.process;
+                    var obj = data.obj.record;
                     if (typeof data.obj.fieldList != "undefined" && data.obj.fieldList.length > 0) {
                         var fieldList = data.obj.fieldList;
                         var html1 = '';
@@ -215,29 +212,15 @@ IntegralVerifyInfoDlg.showFirstCheckModal = function () {
                         }
                     }
                     var html2 = '';
-                    for (var key in fileList) {
-                        html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
-                    }
-                    var html3 = '';
-                    for (var key in companyList) {
-                        html3 += '<li style="width: 100%"><input type="checkbox" value="' + companyList[key].id + '"><span>' + companyList[key].name + '</span></li>';
-                    }
+                    html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="1"><span>允许修改</span></li></ul>';
+
                     $("#field_info ul").css("overflow", "hidden").empty().append(html1);
                     $("#field_file").css("overflow", "hidden").empty().append(html2);
-                    $("#company_list ul").css("overflow", "hidden").empty().append(html3);
                     var optionHtml = "";
-                    if (process <= 4 && process != 2) {
-                        optionHtml = '<option value="">请选择</option>\n' +
-                                (obj.highProcess == 4 && process == 3 ? '<option value="5">审核通过(需要再次部门并审)</option>\n' : '<option value="3">审核通过</option>') +
-                                (obj.highProcess == 4 && process == 3 ? '<option value="4">审核通过(跳过部门并审)</option>\n' : "") +
-                                '                            <option value="2">审核驳回</option>\n';
-                    }
-                    if (process == 5 || process == 2) {
-                        optionHtml = '<option value="">请选择</option>\n' +
-                                '                            <option value="3">审核通过</option>\n' +
-                                '                            <option value="2">审核驳回</option>\n' +
-                                '                            <option value="-1">审核不通过</option>';
-                    }
+                    optionHtml = '<option value="">请选择</option>\n' +
+                            '                            <option value="1">审核通过</option>\n' +
+                            '                            <option value="2">审核驳回</option>\n' +
+                            '                            <option value="3">审核不通过</option>';
                     $("#checkStateFirstModal").empty().append(optionHtml);
                     $("#firstCheckForm")[0].reset();
                     //$("#checkStateFirstModal").val(obj.checkState);
@@ -252,16 +235,9 @@ IntegralVerifyInfoDlg.showFirstCheckModal = function () {
                             }
                         });
                     }
-                    if (obj.files != null && obj.files != '') {
+                    if (obj.files == 1) {
                         $("#field_file input").each(function () {
-                            for (var key in obj.files) {
-                                if ($(this).val() == obj.files[key]) {
-                                    this.checked = true;
-                                }
-                            }
-                            //if (obj.files.indexOf($(this).val()) != -1) {
-                            //this.checked = true;
-                            //}
+                            this.checked = true;
                         });
                     }
                 },
@@ -302,16 +278,13 @@ IntegralVerifyInfoDlg.toggleField = function () {
     if (checkState == 2) {
         $("#field").show();
         $("#checkMsgFirst").val("");
-    } else if (checkState == 3 || checkState == 4 || checkState == 5) {
+    } else if (checkState == 1) {
         $("#field").hide();
         $("#field").find("input[type=checkbox]").removeAttr("checked");
         if (checkMsgFirst == null || checkMsgFirst == '') {
             $("#checkMsgFirst").val("审核通过");
         }
-        if (checkState == 5) {
-            $("#company_list").show();
-        }
-    } else if (checkState == -1) {
+    } else {
         $("#field").hide();
         $("#checkMsgFirst").val("审核不通过");
     }
@@ -389,28 +362,14 @@ IntegralVerifyInfoDlg.firstCheck = function (i) {
     }
     var fields = '';
     var files = '';
-    var companys = '';
     $("#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() + ",";
-        }
-    });
-    $("#company_list li input").each(function (index) {
-        if ($(this).is(":checked")) {
-            companys += $(this).val() + ",";
-        }
-    });
-    if (checkState == 2 && fields == '' && files == '') {
-        Feng.info("请选择可修改的字段或附件!");
-        return;
-    }
-    if (checkState == 5 && companys == "") {
-        Feng.info("请选择需要再次审核的部门!");
+    var fileChk = $("#field_file li").find("input").is(":checked");
+    if (checkState == 2 && fields == '' && !fileChk) {
+        Feng.info("请选择可修改的字段或项目!");
         return;
     }
     if (locked)
@@ -430,7 +389,7 @@ IntegralVerifyInfoDlg.firstCheck = function (i) {
         locked = false;
     });
     ajax.setData({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg,
-        "process": $("#process").val(), "fields": fields, "files": files, "companys": companys})
+        "process": $("#process").val(), "fields": fields, "files": fileChk ? 1 : 0})
     ajax.start();
 }
 
@@ -440,7 +399,7 @@ IntegralVerifyInfoDlg.submitCheck = function () {
         var ajax = new $ax(Feng.ctxPath + "/admin/integralVerify/submitCheck", function (data) {
             if (data.code == 200) {
                 Feng.success(data.msg);
-                window.parent.TalentInfo.table.refresh();
+                window.parent.IntegralVerify.table.refresh();
                 IntegralVerifyInfoDlg.close();
             } else {
                 Feng.error(data.msg);
@@ -448,7 +407,7 @@ IntegralVerifyInfoDlg.submitCheck = function () {
         }, function (data) {
             Feng.error("提交审核失败!" + data.responseJSON.message + "!");
         });
-        ajax.setData({"id": $("#id").val(), "process": $("#process").val(), "companyId": $("#companyId").val()});
+        ajax.setData({"id": $("#id").val(), "process": $("#process").val()});
         ajax.start();
     }
     Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
@@ -501,7 +460,7 @@ IntegralVerifyInfoDlg.creatFieldCheckModal = function () {
                 '                                <ul style="overflow:hidden;list-style:none;">\n' +
                 '                                </ul>\n' +
                 '                            </div>\n' +
-                '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+                '                            <label for="checkMsg" class="control-label">是否允许修改项目</label>\n' +
                 '                            <div id="field_file">\n' +
                 '                            </div>\n' +
                 '                            <div class="form-group" style="text-align: center">\n' +
@@ -538,7 +497,7 @@ IntegralVerifyInfoDlg.creatFieldCheckModal = function () {
                 '                                <ul style="overflow:hidden;list-style:none;">\n' +
                 '                            </ul>\n' +
                 '                            </div>\n' +
-                '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+                '                            <label for="checkMsg" class="control-label">是否允许修改项目</label>\n' +
                 '                            <div id="field_file">\n' +
                 '                            </div>\n' +
                 '                            <div class="form-group" style="text-align: center">\n' +