Browse Source

先上传一部分

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

+ 20 - 7
app/admin/controller/Talent.php

@@ -8,6 +8,7 @@ use app\common\api\TalentLogApi;
 use app\common\api\TalentState;
 use app\enterprise\model\Talent as TalentModel;
 use app\common\api\TalentConditionApi;
+use app\common\api\DictApi;
 
 /**
  * Description of Talent
@@ -322,7 +323,9 @@ class Talent extends AdminController {
         TalentLogApi::setActive($log["id"], 1);
         $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
         $companyIds = array_filter(explode(",", $condition["companyIds"]));
-        TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
+        if ($log["new_state"] == TalentState::FST_VERIFY_PASS) {
+            TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
+        }
         return json(["code" => 200, "msg" => "审核成功"]);
     }
 
@@ -541,7 +544,7 @@ class Talent extends AdminController {
                 switch ($checkState) {
                     case 2:
                         $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
-                        $fields = \app\common\api\DictApi::getTalentFields(1);
+                        $fields = DictApi::getTalentFields(1);
                         $field_tmp = [];
                         foreach ($fields as $key => $field) {
                             $field_tmp[] = ["key" => $key, "value" => $field];
@@ -558,27 +561,37 @@ class Talent extends AdminController {
                         $process = 2;
                         break;
                     case 7:
-                        $fields = \app\common\api\DictApi::getTalentFields(3);
+                        $fields = DictApi::getTalentFields(3);
                         $process = 3;
                         break;
                     case 9:
-                        $fields = \app\common\api\DictApi::getTalentFields(3);
+                        $fields = DictApi::getTalentFields(3);
                         $process = 4;
                         break;
                 }
                 if ($checkState != 2) {
                     $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
-                    $fields = \app\common\api\DictApi::getTalentFields(3);
+                    $fields = DictApi::getTalentFields(2);
                     $field_tmp = [];
                     foreach ($fields as $key => $field) {
                         $field_tmp[] = ["key" => $key, "value" => $field];
                     }
+                    $where = [];
+                    $whr = [];
+                    $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
                     $where[] = ["project", "=", 1];
+                    $where[] = ["step", "=", 2];
                     $where[] = ["active", "=", 1];
                     $where[] = ["type", "=", $enterprise["type"]];
-
-                    $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
+                    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();
+                    }
                 }
+                $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]]);
             } else {
                 return json(["msg" => "该申报不在审核范围内,无法审核"]);

+ 2 - 2
app/admin/view/talent/base_verify.html

@@ -20,7 +20,7 @@
     <div class="col-sm-12">
         <div class="ibox float-e-margins">
             <div class="ibox-title">
-                <h5>人才认定申报 - 基本条件判定</h5>
+                <h5>人才认定申报 - 基础信息审核</h5>
             </div>
             <div class="ibox-content">
                 <div class="row row-lg">
@@ -174,7 +174,7 @@
                         <div class="hidden-xs" id="TalentInfoTableToolbar" role="group">
                             <if condition="chkCommission('/admin/talent/base_verify','')">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.openCheckTalentInfo()" id="">
-                                    <i class="fa fa-check"></i>&nbsp;人才认定基本条件判定
+                                    <i class="fa fa-check"></i>&nbsp;审核
                                 </button>
                             </if>
                             <if condition="chkCommission('/admin/talent/base_export','')">

+ 18 - 2
app/enterprise/controller/Base.php

@@ -32,9 +32,13 @@ class Base extends EnterpriseController {
         $param = $request->param();
         $id = isset($param["id"]) ? $param["id"] : 0;
         $info = self::chkIsOwner($id, $this->user["uid"]);
+        if ($info) {
+            $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
+        }
         if ($info && in_array($info["checkState"], [TalentState::BASE_VERIFY_PASS, TalentState::SCND_SAVE])) {
-            return $this->second($request);
-            exit();
+            $res = ["msg" => "错误的访问方式"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+            exit;
         }
         if ($info && in_array($info["checkState"], [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::REVERIFY_PASS, TalentState::REVERIFY_FAIL])) {
             return $this->view($request);
@@ -162,6 +166,18 @@ class Base extends EnterpriseController {
             $data["county"] = $param["county"];
             $data["nation"] = $param["nation"];
             $data["politics"] = $param["politics"];
+            if ($info["real_state"] == 4) {
+                //真实状态4是驳回,需要判断什么字段可以提交                
+                $modify_fields = array_filter(explode(",", $info["modify_fields"]));
+                $tmp_data = $data;
+                $data = [];
+                if ($tmp_data["id"]) {
+                    $data["id"] = $tmp_data["id"];
+                }
+                foreach ($modify_fields as $field) {
+                    $data[$field] = $tmp_data[$field];
+                }
+            }
             if ($id > 0) {
                 TalentModel::update($data);
             } else {

+ 16 - 1
app/enterprise/controller/Talent.php

@@ -30,6 +30,13 @@ class Talent extends EnterpriseController {
     public function second(\think\Request $request) {
         $params = $request->param();
         $id = $params["id"];
+        $info = self::chkIsOwner($id, $this->user["uid"]);
+        if (!$info) {
+            $res = ["msg" => "错误的访问方式"];
+            echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
+            exit;
+        }
+        $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
         if ($request->isPost()) {
             $batch = \app\common\api\BatchApi::getValidBatch(1, $this->user["type"]);
             if (!$batch) {
@@ -135,6 +142,15 @@ class Talent extends EnterpriseController {
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
                 exit;
             }
+            if ($info["real_state"] == 8) {
+                //真实状态8是驳回,需要判断什么字段可以提交                
+                $modify_fields = array_filter(explode(",", $info["modify_fields"]));
+                $tmp_data = $data;
+                $data = [];
+                foreach ($modify_fields as $field) {
+                    $data[$field] = $tmp_data[$field];
+                }
+            }
             $data["apply_year"] = $batch["batch"];
             $data["id"] = $id;
             $data["checkState"] = TalentState::SCND_SAVE;
@@ -146,7 +162,6 @@ class Talent extends EnterpriseController {
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
             }
         }
-        $info = \app\common\api\VerifyApi::getTalentInfoById($id);
         $enterprise_info = \app\common\model\Enterprise::find($this->user["uid"]);
         $info["enterprise"] = $enterprise_info;
         $batch = \app\common\api\BatchApi::getValidBatch(1, $enterprise_info["type"]);

+ 1 - 0
app/enterprise/view/base/first.html

@@ -59,6 +59,7 @@
                                                 <input type="hidden" name="source_city_name" id="source_city_name" value="">
                                                 <input type="hidden" name="source_county_name" id="source_county_name" value="">
                                                 <input type="hidden" name="checkState" id="checkState" value="{$checkState}">
+                                                <input type="hidden" name="realState" id="realState" value="{$row.real_state}">
                                                 <input type="hidden" name="step" id="step" value="1">                                                
                                                 <input type="hidden" name="files" id="files" value="{$row.modify_files}">
                                                 <input type="hidden" name="fields" id="fields" value="{$row.modify_fields}">

+ 1 - 0
app/enterprise/view/talent/second.html

@@ -53,6 +53,7 @@
                                                 <input type="hidden" name="enterprise_id" id="enterpriseId" value="{$row.enterprise.id}">
                                                 <input type="hidden" name="enterprise_type" id="type" value="{$row.enterprise.type}">
                                                 <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
+                                                <input type="hidden" name="realState" id="realState" value="{$row.realState}">
                                                 <div class="col-sm-10">
                                                     <div class="rowGroup col-sm-3">
                                                         <label class=" control-label spacing"><span style="color: red">*</span>姓名</label>

+ 5 - 3
public/static/modular/gate/talentBase/talentInfo_info.js

@@ -521,7 +521,7 @@ TalentInfoInfoDlg.initFile = function () {
                 data["rows"][k].tableIndex = tableIndex;
                 data["rows"][k].trIndex = datas[tableIndex].length;
                 datas[tableIndex].push(data["rows"][k]);
-            } else {                
+            } else {
                 if (data["rows"][k].isConditionFile) {
                     var tableIndex = $("#talent_condition").parents(".row").next(".row").find("table.fileTable").index(".fileTable");
                     data["rows"][k].tableIndex = tableIndex;
@@ -713,7 +713,8 @@ TalentInfoInfoDlg.validateIsEdit = function () {
 TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex) {
     var files = $("#files").val();
     var checkState = $("#checkState").val();
-    if (Feng.isEmptyStr(checkState) || checkState == 0 || checkState == 1 || checkState == 3 || checkState == 5) {
+    var realState = $("#realState").val();
+    if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && realState != 4) || checkState == 3 || checkState == 5 || (realState == 4 && files.indexOf(fileTypeId) != -1)) {
         if ((checkState == 3 || checkState == 5))
             return "";
         if (type == 1) {          //上传
@@ -778,7 +779,8 @@ TalentInfoInfoDlg.downloadFile = function (id, type) {
 TalentInfoInfoDlg.setNoChangeField = function () {
     var checkState = $("#checkState").val();
     var fields = $("#fields").val();
-    if (checkState == 8) {
+    var realState = $("#realState").val();
+    if (realState == 4) {
         $("input,textarea").each(function () {
             $(this).attr("readonly", "readonly");
         });

+ 4 - 2
public/static/modular/gate/talentInfo/talentInfo_info.js

@@ -691,7 +691,8 @@ TalentInfoInfoDlg.validateIsEdit = function () {
 TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex) {
     var files = $("#files").val();
     var checkState = $("#checkState").val();
-    if (Feng.isEmptyStr(checkState) || checkState == 0 || checkState == 1 || checkState == 3 || checkState == 5) {
+    var realState = $("#realState").val();
+    if (Feng.isEmptyStr(checkState) || checkState == 0 || checkState == 1 || checkState == 3 || (checkState == 5 && realState != 8) || (realState == 8 && files.indexOf(fileTypeId) != -1)) {
         if (type == 1) {          //上传
             return "<button type='button' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + null + "," + tableIndex + "," + trIndex + ")\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
                     "<i class=\"fa fa-upload\"></i>上传" +
@@ -752,7 +753,8 @@ TalentInfoInfoDlg.downloadFile = function (id, type) {
 TalentInfoInfoDlg.setNoChangeField = function () {
     var checkState = $("#checkState").val();
     var fields = $("#fields").val();
-    if (checkState == 8) {
+    var realState = $("#realState").val();
+    if (realState == 8) {
         $("input,textarea").each(function () {
             $(this).attr("readonly", "readonly");
         });

+ 2 - 3
public/static/modular/talentIdentify/talentInfo/talentInfo_common_check.js

@@ -288,9 +288,8 @@ TalentInfoInfoDlg.showFirstCheckModal = function () {
                     $("#checkMsgFirst").val(obj.checkMsg);
                     if (obj.fields != null && obj.fields != '') {
                         $("#field_info input").each(function () {
-                            var arr = obj.fields.split(",");
-                            for (var key in arr) {
-                                if ($(this).val() == arr[key]) {
+                            for (var key in obj.fields) {
+                                if ($(this).val() == obj.fields[key]) {
                                     this.checked = true;
                                 }
                             }