Bläddra i källkod

人才层次变更

sugangqiang 1 år sedan
förälder
incheckning
fe53962d5c

+ 18 - 0
app/common/state/MainState.php

@@ -26,6 +26,24 @@ class MainState {
     public const THIRD_REJECT = 30;
 //审核通过-待公示
     public const PASS = 35;
+    //已公示
+    public const PUBLIC = 40;
+    //审核不通过
+    public const OBJECTION = 45;
+    //公布-待发证
+    public const PUBLISH = 50;
+    //公布-已发证
+    public const CARD = 55;
+    //待提交
+    public const BASIC_SAVE = -1;
+    //未审核
+    public const BASIC_NEED = 1;
+    //驳回
+    public const BASIC_REJECT = 2;
+    //通过
+    public const BASIC_PASS = 3;
+    //重新提交
+    public const BASIC_RESUBMIT = 9;
 
     public static function getStateDesc($checkState) {
         switch ($checkState) {

+ 25 - 18
app/enterprise/controller/TalentTypeChange.php

@@ -44,12 +44,12 @@ class TalentTypeChange extends EnterpriseController {
 
     public function add() {
         $res = $this->dataCheck($this->request);
-        if (!$res) {
-            return json(["msg" => "添加失败,该证件号码已申报", "code" => 500]);
+        if ($res !== true) {
+            return $res;
         }
         $data = $this->request->param();
-        $data['checkState'] = TalentState::BASIC_SAVE;
-        $data['basicState'] = TalentState::BASIC_NEED;
+        $data['checkState'] = MainState::SAVE;
+        $data['basicState'] = MainState::BASIC_NEED;
         $data['isPublic'] = 1;
         $data['createUser'] = $this->user["uid"];
         $data['createTime'] = date("Y-m-d H:i:s");
@@ -69,10 +69,10 @@ class TalentTypeChange extends EnterpriseController {
             'active' => 1,
             'state' => null,
             'step' => 0,
-            'stateChange' => TalentState::stateEnum(-2),
+            'stateChange' => "<span class='label label-primary'>添加</span> ->" . MainState::getStateDesc($data['checkState']),
             'description' => '添加人才层次变更',
             'createTime' => date("Y-m-d H:i:s", time()),
-            'createUser' => session('user')['name'] . "({$companyName})"
+            'createUser' => session('user')['account'] . "({$companyName})"
         ]);
 
         return json(["msg" => "添加成功", "code" => 200]);
@@ -87,7 +87,7 @@ class TalentTypeChange extends EnterpriseController {
             $response->msg = "提交审核失败,请先填写基础信息";
             return $response;
         }
-        if ($info["checkState"] != -1 && $info["checkState"] != 10 && $info["checkState"] != 5) {
+        if ($info["checkState"] != MainState::SAVE && $info["checkState"] != MainState::FIRST_REJECT && $info["checkState"] != MainState::BEFORE_REJECT) {
             $response->msg = "不能重复提交审核";
             return $response;
         }
@@ -96,9 +96,9 @@ class TalentTypeChange extends EnterpriseController {
         $where[] = ["project", "=", ProjectState::LEVELCHANGE];
         $where[] = ["active", "=", 1];
         $filetypes = Db::table("new_common_filetype")->where($where)->order("sn asc")->select()->toArray();
+        $sb = [];
+        $sb[] = "以下为必传附件:";
         foreach ($filetypes as $filetype) {
-            $sb = [];
-            $sb[] = "以下为必传附件:";
             if ($filetype["must"] == 1) {
                 $where = [];
                 $where[] = ["mainId", "=", $id];
@@ -114,15 +114,15 @@ class TalentTypeChange extends EnterpriseController {
             return $response;
         }
         $data["id"] = $id;
-        $data["checkState"] = $info["checkState"] == 2 ? 9 : 1;
-        TqModel::update($data);
+        $data["checkState"] = MainState::NEED_FIRST_CHECK;
+        TalentTypeChangeModel::update($data);
         $user = $this->user;
         $log["id"] = getStringId();
         $log["active"] = 1;
         $log["state"] = 1;
         $log["step"] = 0;
-        $log["stateChange"] = "<span class='label'>待提交</span>-><span class='label label-success'>待审核</span>";
-        $log["type"] = ProjectState::QUIT;
+        $log["stateChange"] = MainState::getStateDesc($info['checkState']) . "->" . MainState::getStateDesc($data['checkState']);
+        $log["type"] = ProjectState::LEVELCHANGE;
         $log["mainId"] = $id;
         $log["description"] = "确认提交审核";
         $log["createUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
@@ -130,7 +130,7 @@ class TalentTypeChange extends EnterpriseController {
         TalentLog::create($log);
         $response->code = 200;
         $response->msg = "提交审核成功";
-        $response->obj = 1;
+        $response->obj = 3;
         return $response;
     }
 
@@ -160,14 +160,21 @@ class TalentTypeChange extends EnterpriseController {
             return json(["msg" => "新人才层次不能为空", "code" => 500]);
         }
         if (\StrUtil::isEmpOrNull($data->param('newIdentifyCondition'))) {
-            return json(["msg" => "新人才层次不能为空", "code" => 500]);
+            return json(["msg" => "新认定条件不能为空", "code" => 500]);
+        }
+        if ($type == 2) {
+            if (\StrUtil::isEmpOrNull($data->param('newIdentifyGetTime'))) {
+                return json(["msg" => "新认定条件名称不能为空", "code" => 500]);
+            }
+            if (\StrUtil::isEmpOrNull($data->param('newIdentifyGetTime'))) {
+                return json(["msg" => "新获取时间不能为空", "code" => 500]);
+            }
         }
         $res = TalentTypeChangeModel::where('idCard', $data->param('idCard'))->where('id', '<>', $data->param('id'))->whereRaw('isPublic <> 6 and (isPublic <> 5 or checkState <> -1)')->findOrEmpty();
         if ($res) {
-            return true;
-        } else {
-            return false;
+            return json(["msg" => "添加失败,该证件号码已申报", "code" => 500]);
         }
+        return true;
     }
 
 }

+ 23 - 13
app/enterprise/view/talent_type_change/apply.html

@@ -97,9 +97,16 @@
                                         <div class="rowGroup">
                                             <label class="col-sm-2 control-label spacing">原人才层次</label>
                                             <div class="col-sm-4 spacing">
-                                                <input class="form-control" id="talentArrangeName" readonly="readonly" name="talentArrangeName" />
+                                                <input class="form-control" id="oldTalentArrangeName" readonly="readonly" name="oldTalentArrangeName" />
                                             </div>
                                         </div>
+                                        <div class="rowGroup">
+                                            <label class="col-sm-2 control-label spacing">原认定条件</label>
+                                            <div class="col-sm-4 spacing">
+                                                <input class="form-control" id="oldIdentifyCondition" readonly="readonly" name="oldIdentifyCondition" />
+                                            </div>
+                                        </div>
+                                        {if condition="$enterprise['type'] eq 2"}
                                         <div class="rowGroup">
                                             <label class="col-sm-2 control-label spacing">原认定条件名称</label>
                                             <div class="col-sm-4 spacing">
@@ -112,6 +119,7 @@
                                                 <input class="form-control" id="oldIdentifyGetTime" readonly="readonly" name="oldIdentifyGetTime" />
                                             </div>
                                         </div>
+                                        {/if}
                                         <div class="rowGroup">
                                             <label class="col-sm-2 control-label spacing">原公布入选月份</label>
                                             <div class="col-sm-4 spacing">
@@ -190,18 +198,20 @@
                                                 <select class="form-control" id="newIdentifyCondition" name="newIdentifyCondition" ></select>
                                             </div>
                                         </div>
-<!--                                        <div class="rowGroup">-->
-<!--                                            <label class="col-sm-2 control-label spacing">新认定条件名称</label>-->
-<!--                                            <div class="col-sm-4 spacing">-->
-<!--                                                <input class="form-control" id="newIdentifyConditionName" name="newIdentifyConditionName" placeholder="例:获得国家一级职业资格(汽车维修工)"/>-->
-<!--                                            </div>-->
-<!--                                        </div>-->
-<!--                                        <div class="rowGroup">-->
-<!--                                            <label class="col-sm-2 control-label spacing">新认定条件证书取得时间</label>-->
-<!--                                            <div class="col-sm-4 spacing">-->
-<!--                                                <input class="form-control date" id="newIdentifyGetTime" name="newIdentifyGetTime" />-->
-<!--                                            </div>-->
-<!--                                        </div>-->
+                                        {if condition="$enterprise['type'] eq 2"}
+                                        <div class="rowGroup">
+                                            <label class="col-sm-2 control-label spacing">新认定条件名称</label>
+                                            <div class="col-sm-4 spacing">
+                                                <input class="form-control" id="newIdentifyConditionName" name="newIdentifyConditionName" placeholder="例:获得国家一级职业资格(汽车维修工)"/>
+                                            </div>
+                                        </div>
+                                        <div class="rowGroup">
+                                            <label class="col-sm-2 control-label spacing">新认定条件证书取得时间</label>
+                                            <div class="col-sm-4 spacing">
+                                                <input class="form-control date" id="newIdentifyGetTime" name="newIdentifyGetTime" />
+                                            </div>
+                                        </div>
+                                        {/if}
                                         {if condition="$enterprise['type'] == 1"}
                                         <div class="rowGroup" style="display: none">
                                             <label class="col-sm-2 control-label spacing">新泉州高层次人才证书发证日期</label>