Browse Source

卫健津补贴增加总院审核,基本完成

sugangqiang 11 months ago
parent
commit
962a2d1a44

+ 4 - 1
app/admin/controller/TalentAllowance.php

@@ -218,6 +218,9 @@ class TalentAllowance extends AdminController {
                     case 2:
                         $updCheck["checkState"] = AllowanceStateEnum::FIRST_REJECT;
                         break;
+                    case -2:
+                        $updCheck["checkState"] = AllowanceStateEnum::FIRST_REJECT_BRANCH;
+                        break;
                     case -1:
                         $updCheck["checkState"] = AllowanceStateEnum::NOTPASS;
                         $updCheck["recommendAllowanceType"] = 3;
@@ -1674,7 +1677,7 @@ class TalentAllowance extends AdminController {
                             AllowanceProjectEnum::PROJECT_SB_MEDICA,
                                 //AllowanceProjectEnum::PROJECT_WORKDAY
                         ]) ? 1 : 2;
-            } else if ($info["checkState"] == 10) {
+            } else if ($info["checkState"] == 10 || $info["checkState"] == 8) {
                 $projects = explode(",", $info["projects"]);
                 if (in_array($project["id"], $projects)) {
                     $project["isEdit"] = 1;

+ 2 - 0
app/common/state/LivingAllowanceState.php

@@ -89,6 +89,8 @@ class LivingAllowanceState {
 
     public static function getStepName($step) {
         switch ($step) {
+            case -2:
+                return "<span class='label label-primary'>总院审核</span>";
             case -1:
                 return "<span class='label label-primary'>部门初审</span>";
             case 0:

+ 61 - 33
app/enterprise/controller/TalentAllowance.php

@@ -620,7 +620,7 @@ class TalentAllowance extends EnterpriseController {
                             AllowanceProjectEnum::PROJECT_SB_MEDICA,
                                 //AllowanceProjectEnum::PROJECT_WORKDAY
                         ]) ? 1 : 2;
-            } else if ($info["checkState"] == 10) {
+            } else if ($info["checkState"] == 10 || $info["checkState"] == 8) {
                 $projects = explode(",", $info["projects"]);
                 if (in_array($project["id"], $projects)) {
                     $project["isEdit"] = 1;
@@ -769,7 +769,7 @@ class TalentAllowance extends EnterpriseController {
             $response->msg = $batch["msg"];
             return $response;
         }
-        if ($old["checkState"] != 1 && $old["checkState"] != 10) {
+        if ($old["checkState"] != 1 && $old["checkState"] != 10 && $old["checkState"] != 8) {
             $response->msg = "不能重复提交审核";
             return $response;
         }
@@ -866,8 +866,10 @@ class TalentAllowance extends EnterpriseController {
         $data["checkMsg"] = "";
         $data["checkState"] = AllowanceStateEnum::NEED_CHECK;
         $ep = \app\common\api\EnterpriseApi::getOne($this->user["uid"]);
+        $afterState = 7; //待初审
         if ($ep->isGeneral == 2 && \app\common\api\Nhc::hasGeneralHospital($ep->medicalCommunityId)) {
             $data["checkState"] = AllowanceStateEnum::NEED_GENERAL_CHECK; //分院并且有总院
+            $afterState = 3; //待审核
         }
         $data["files"] = "";
         $data["projects"] = "";
@@ -889,7 +891,7 @@ class TalentAllowance extends EnterpriseController {
             'active' => 1,
             'state' => 1,
             'step' => 0,
-            'stateChange' => sprintf("%s->%s", MainState::getStateDesc(1), MainState::getStateDesc(7)),
+            'stateChange' => sprintf("%s->%s", MainState::getStateDesc(1), MainState::getStateDesc($afterState)),
             'description' => "确认提交审核",
             'createTime' => date("Y-m-d H:i:s", time()),
             'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
@@ -1255,29 +1257,29 @@ class TalentAllowance extends EnterpriseController {
         if (!$oldObj) {
             return new Response(Response::ERROR, "审核对象不存在");
         }
+        $ep = \app\common\api\EnterpriseApi::getOne($oldObj["enterpriseId"]);
+        if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
+        if ($oldObj["checkState"] != AllowanceStateEnum::NEED_GENERAL_CHECK && $oldObj["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
 
         $newObj = [];
         $newObj["id"] = $obj["id"];
         $projectList = [];
         $fileList = [];
-        if ($obj["process"] == 1) {
-            if (\StrUtil::isNotEmpAndNull($obj["projects"])) {
-                $projectList = array_filter(explode(",", $obj["projects"]));
-                $newObj["projects"] = implode(",", $projectList);
-            }
-            if (\StrUtil::isNotEmpAndNull($obj["files"])) {
-                $fileList = array_filter(explode(",", $obj["files"]));
-                $newObj["files"] = implode(",", $fileList);
-            }
-            //if (Const.RSJ.equals(checkCompany.getCode())) {
-            $newObj["concats"] = $obj["concats"];
-            $newObj["fields"] = $obj["fields"];
-            //}
+        if (\StrUtil::isNotEmpAndNull($obj["projects"])) {
+            $projectList = array_filter(explode(",", $obj["projects"]));
+            $newObj["projects"] = implode(",", $projectList);
         }
-        if ($obj["process"] == 3) {
-            $newObj["toProcess"] = $obj["toProcess"];
-            $newObj["toDep"] = $obj["toDep"];
+        if (\StrUtil::isNotEmpAndNull($obj["files"])) {
+            $fileList = array_filter(explode(",", $obj["files"]));
+            $newObj["files"] = implode(",", $fileList);
         }
+        $newObj["concats"] = $obj["concats"];
+        $newObj["fields"] = $obj["fields"];
+        //}
         TaModel::update($newObj);
         //添加日志
         TalentChecklog::create([
@@ -1287,7 +1289,7 @@ class TalentAllowance extends EnterpriseController {
             'typeFileId' => null,
             'active' => 2,
             'state' => $obj["checkState"],
-            'step' => $obj["process"],
+            'step' => -2,
             'stateChange' => null,
             'description' => $obj["checkMsg"],
             'createTime' => date("Y-m-d H:i:s", time()),
@@ -1302,16 +1304,23 @@ class TalentAllowance extends EnterpriseController {
      */
     public function submitCheck() {
         $id = $this->request["id"];
-        $process = $this->request["process"];
+        $process = -2;
         $old = TalentAllowanceApi::getInfoById($id);
         if (!$old) {
             return new Response(Response::ERROR, "审核对象不存在");
         }
+        $ep = \app\common\api\EnterpriseApi::getOne($old["enterpriseId"]);
+        if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
+        if ($old["checkState"] != AllowanceStateEnum::NEED_GENERAL_CHECK && $old["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
         $updCheck = [];
         $updCheck["id"] = $id;
         $updCheck["type"] = $old["type"];
         /*         * 查询审核日志 */
-        $log = TalentLogApi::getLastLogByStep($id, ProjectState::JBT, $process);
+        $log = \app\common\api\TalentLogApi::getLastLogByStep($id, ProjectState::JBT, $process);
         if (!$log) {
             return new Response(Response::ERROR, "请先审核后再提交");
         }
@@ -1321,18 +1330,15 @@ class TalentAllowance extends EnterpriseController {
 
         switch ($log["state"]) {
             case 3:
-                $updCheck["firstPassTime"] = $old["firstPassTime"];
-                if (!$old["firstPassTime"]) {
-                    $updCheck["firstPassTime"] = date("Y-m-d H:i:s");
-                }
-                if (!$old["visitPassTime"]) {
-                    $updCheck["visitPassTime"] = date("Y-m-d H:i:s");
+                $updCheck["precheckPassTime"] = $old["precheckPassTime"];
+                if (!$old["precheckPassTime"]) {
+                    $updCheck["precheckPassTime"] = date("Y-m-d H:i:s");
                 }
                 $updCheck["submitTime"] = date("Y-m-d H:i:s");
-                $updCheck["checkState"] = AllowanceStateEnum::NEED_REVIEW;
+                $updCheck["checkState"] = AllowanceStateEnum::NEED_CHECK;
                 break;
             case 2:
-                $updCheck["checkState"] = AllowanceStateEnum::FIRST_REJECT;
+                $updCheck["checkState"] = AllowanceStateEnum::GENERAL_REJECT;
                 break;
             case -1:
                 $updCheck["checkState"] = AllowanceStateEnum::NOTPASS;
@@ -1385,9 +1391,13 @@ class TalentAllowance extends EnterpriseController {
         if (!$info) {
             return new Response(Response::ERROR, "校验不通过,无法操作");
         }
+        $ep = \app\common\api\EnterpriseApi::getOne($info["enterpriseId"]);
+        if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
         $where = [];
         $where[] = ["mainId", "=", $info["id"]];
-        $where[] = ["step", "=", 1];
+        $where[] = ["step", "=", -2];
         $where[] = ["active", "=", 2];
 
         $log = null;
@@ -1448,8 +1458,8 @@ class TalentAllowance extends EnterpriseController {
         if (!$info) {
             return new Response(Response::ERROR, "系统错误,请联系管理员");
         }
-        if ($info["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
-            return new Response(Response::ERROR, "只能修改初审驳回的数据");
+        if ($info["checkState"] != AllowanceStateEnum::GENERAL_REJECT) {
+            return new Response(Response::ERROR, "只能修改总院驳回的数据");
         }
         $res = [];
         $enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
@@ -1488,10 +1498,28 @@ class TalentAllowance extends EnterpriseController {
         if (!$data["id"]) {
             return new Response(Response::ERROR, "系统错误,请联系管理员");
         }
+        $old = TalentAllowanceApi::getInfoById($data["id"]);
+        if (!$old) {
+            return new Response(Response::ERROR, "审核对象不存在");
+        }
+        $ep = \app\common\api\EnterpriseApi::getOne($old["enterpriseId"]);
+        if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
+        if ($old["checkState"] != AllowanceStateEnum::GENERAL_REJECT) {
+            return new Response(Response::ERROR, "只能修改总院驳回的数据");
+        }
         TaModel::update($data);
         return new Response(Response::SUCCESS, "修改成功");
     }
 
+    private function checkExaminePriv($isGeneral, $medicalCommunityId) {
+        if ($this->user["medicalCommunityId"] == $medicalCommunityId && $this->user["isGeneral"] == 1 && $isGeneral == 2) {
+            return true;
+        }
+        return false;
+    }
+
     private function getCheckStateName($checkState, $publicState, $allowanceType) {
         switch ($checkState) {
             case 1:

+ 2 - 2
app/enterprise/view/talent_allowance/examine_center.html

@@ -140,9 +140,9 @@
                             <button type="button" class="btn btn-sm btn-primary " onclick="TalentAllowanceInfo.updateFieldsAndFiles()" id="">
                                 <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                             </button>
-                            <button type="button" class="btn btn-sm btn-primary " onclick="TalentAllowanceInfo.exportBasicInfo()" id="">
+                            <!--<button type="button" class="btn btn-sm btn-primary " onclick="TalentAllowanceInfo.exportBasicInfo()" id="">
                                 <i class="fa fa-file-excel-o"></i>&nbsp;导出基础信息
-                            </button>
+                            </button>-->
                             <button type="button" class="btn btn-sm btn-primary " onclick="TalentAllowanceInfo.select()" id="">
                                 <i class="fa fa-eye"></i>&nbsp;查看
                             </button>

+ 1 - 1
public/static/modular/gate/enterprise/talentAllowance/talentAllowanceInfo.js

@@ -79,8 +79,8 @@ TalentAllowanceInfo.select = function () {
 TalentAllowanceInfo.updateFieldsAndFiles = function () {
     if (this.check()) {
         var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/findFieldsAndFiles?id=" + TalentAllowanceInfo.seItem.id, function (data) {
-            var obj = data.obj.obj;
             if (data.code == 200) {
+                var obj = data.obj.obj;
                 layer.open({
                     type: 1,
                     id: "neewFieldFormModel",

+ 25 - 48
public/static/modular/gate/talentAllowance/check/talentAllowanceInfo_info.js

@@ -530,6 +530,7 @@ TalentAllowanceInfoDlg.showCheckModal = function () {
                     var fields = data.obj.info.fields;
                     var info = data.obj.info;
                     //初始化附件、核查项目、合同
+                    console.log(data.obj);
                     if (projectList != null && projectList.length != 0) {
                         var html = '<ul>';
                         for (var key in projectList) {
@@ -691,7 +692,7 @@ TalentAllowanceInfoDlg.toggleField = function () {
         $("#field").show();
     } else {
         if (checkState == 3) {
-            $("#checkMsg").val(process == 3 ? "复核通过,待核查征信" : "审通过");
+            $("#checkMsg").val(process == 3 ? "复核通过,待核查征信" : "审通过");
         }
         $("#field").hide();
         $("#field").find("input[type=checkbox]").each(function () {
@@ -720,53 +721,29 @@ TalentAllowanceInfoDlg.checkSubmit = function (index) {
         Feng.info("请填写审核意见");
         return;
     }
-    /*if (process == 3 && checkState == 2) {
-     var toProcess = $("#toProcess").val();
-     if (Feng.isEmptyStr(toProcess)) {
-     Feng.info("请选择驳回至流程");
-     return;
-     }
-     if (toProcess == 1) {
-     var toDep = $("#toDep").val();
-     for (var key in toDep) {
-     companyCodes = companyCodes + toDep[key] + ",";
-     }
-     if (Feng.isEmptyStr(companyCodes)) {
-     Feng.info("请选择驳回单位");
-     return;
-     }
-     }
-     }*/
     var projects = '', files = '', concats = '', fields = "";
-    if (process == 1) {
-        $("#field_project li input").each(function (index) {
-            if ($(this).is(":checked")) {
-                projects = projects + $(this).val() + ",";
-            }
-        });
-        $("#field_file li input").each(function (index) {
-            if ($(this).is(":checked")) {
-                files = files + $(this).val() + ",";
-            }
-        });
-        //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
-        $("#field_concat li input").each(function (index) {
-            if ($(this).is(":checked")) {
-                concats = concats + $(this).val() + ",";
-            }
-        });
-        $("#field_field li input").each(function (index) {
-            if ($(this).is(":checked")) {
-                fields = fields + $(this).val() + ",";
-            }
-        });
-        fields = fields.substring(0, fields.length - 1);
-        //}
-    }
-    // if(process ==1 && checkState==2 && projects=='' && files==''){
-    //     Feng.info("请选择可修改的项目或附件!");
-    //     return ;
-    // }
+    $("#field_project li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            projects = projects + $(this).val() + ",";
+        }
+    });
+    $("#field_file li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            files = files + $(this).val() + ",";
+        }
+    });
+    //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
+    $("#field_concat li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            concats = concats + $(this).val() + ",";
+        }
+    });
+    $("#field_field li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            fields = fields + $(this).val() + ",";
+        }
+    });
+    fields = fields.substring(0, fields.length - 1);
     if (Feng.isNotEmptyStr(companyCodes)) {
         companyCodes = companyCodes.substring(0, companyCodes.length - 1);
     }
@@ -778,7 +755,7 @@ TalentAllowanceInfoDlg.checkSubmit = function (index) {
             Feng.error(data.msg);
         }
     }, function (data) {
-        Feng.error("提交审核失败!" + data.responseJSON.message + "!");
+        Feng.error("提交审核失败!");
     });
     ajax.setData({"id": id, "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(), "projects": projects, "files": files, "concats": concats, "fields": fields, "companyId": $("#companyId").val(), "toProcess": $("#toProcess").val(), "toDep": companyCodes});
     ajax.start();

+ 7 - 4
public/static/modular/gate/talentAllowance/common/talentAllowance_info.js

@@ -640,9 +640,10 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                 var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
                 var files = $("#files").val();
                 var checkState = $("#checkState").val();
+                var type = $("#type").val();
                 for (var key in data) {
                     var btn = "";
-                    if (checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) {
+                    if (checkState == 1 || (type != 5 && checkState == 10 && files.indexOf(row.id) != -1) || (type == 5 && checkState == 8 && files.indexOf(row.id) != -1)) {
                         btn = "<button type=\'button\' onclick=\"TalentAllowanceInfoDlg.checkFile(this,'" + row.id + "','" + data[key].id + "')\" style=\'margin-left: 5px\' class=\"btn btn-xs btn-success\">" +
                                 "<i class=\"fa fa-paste\"></i>修改" +
                                 "</button>" +
@@ -868,7 +869,8 @@ TalentAllowanceInfoDlg.validateIsEdit = function () {
         return false;
     }
     var checkState = $("#checkState").val();
-    if (checkState != 1 && checkState != 10) {
+    var type = $("#type").val();
+    if (checkState != 1 && !(type != 5 && checkState == 10) && !(type == 5 && checkState == 8)) {
         if (checkState == -1) {
             Feng.error("您的申报审核不通过,无法再修改");
             return false;
@@ -911,7 +913,8 @@ $(function () {
         "url": Feng.ctxPath + "/enterprise/talent/findTalentByEnterpriseInLibrary?type=1&year=" + $("#year").val()
     });
     TalentAllowanceInfoDlg.validId();
-    if ($("#type").val() == 2) {
+    var type = $("#type").val();
+    if (type == 2) {
         $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style", "display:none");
     }
     //批量加载时间控件
@@ -930,7 +933,7 @@ $(function () {
         $("#allowanceType").attr("style", "pointer-events: none;background-color: #eee;");
         $("#wage").prop("readonly", true);
     }
-    if (checkState == 10) {
+    if ((type != 5 && checkState == 10) || (type == 5 && checkState == 8)) {
         var fields = $("#fields").val().split(",");
         if (fields.indexOf("wage") > -1) {
             $("#wage").removeAttr("readonly");

+ 2 - 1
public/static/modular/gate/talentAllowance/common/talentAllowance_info_supple.js

@@ -197,7 +197,8 @@ TalentAllowanceInfoDlg.initFileTypeColumn = function () {
             formatter: function (value, row, index) {
                 var files = $("#files").val();
                 var checkState = $("#checkState").val();
-                if (checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) {
+                var type = $("#type").val();
+                if (checkState == 1 || (type != 5 && checkState == 10 && files.indexOf(row.id) != -1) || (type == 5 && checkState == 8 && files.indexOf(row.id) != -1)) {
                     return "<button type='button' onclick=\"TalentAllowanceInfoDlg.checkFile(this,'" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
                             "<i class=\"fa fa-upload\"></i>添加" +
                             "</button>";

+ 8 - 1
public/static/modular/gate/talentAllowance/ic/talentAllowanceInfoIC.js

@@ -12,6 +12,7 @@ var TalentAllowanceInfo = {
  * 初始化表格的列
  */
 TalentAllowanceInfo.initColumn = function () {
+    var type = $("#type").val();
     return [
         {field: 'selectItem', radio: true},
         {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px"},
@@ -70,9 +71,15 @@ TalentAllowanceInfo.initColumn = function () {
                         html = "<span class='label label-danger'>总院驳回</span>"
                         break;
                     case 9:
-                    case 10:
                         html = "<span class='label label-danger'>已驳回</span>"
                         break;
+                    case 10:
+                        if (type == 5) {
+                            html = "<span class='label label-success'>待总院审核</span>"
+                        } else {
+                            html = "<span class='label label-danger'>已驳回</span>"
+                        }
+                        break;
                     case - 1:
                         if (row.publicState >= 3) {
                             html = "<span class='label label-danger'>审核不通过</span>";

+ 1 - 1
public/static/modular/talentAllowance/talentAllowanceInfo_info.js

@@ -686,7 +686,7 @@ TalentAllowanceInfoDlg.saveReviewCheck = function () {
 TalentAllowanceInfoDlg.toggleField = function () {
     var checkState = $("#checkStateModal").val();
     var process = $("#process").val();
-    if (checkState == 2) {
+    if (checkState == 2 || checkState == -2) {
         $("#toProcessDiv").css("display", process == 3 ? "block" : "none");
         $("#field").show();
     } else {

+ 2 - 0
public/static/modular/talentAllowance/talentAllowanceInfo_info_supple.js

@@ -449,6 +449,7 @@ TalentAllowanceInfoDlg.initCommonFileTable = function () {
  * 
  */
 TalentAllowanceInfoDlg.createCheckHtml = function () {
+    var type = $("#type").val();
     var process = $("#process").val();
     var companyCode = $("#companyCode").val();
     var html = "";
@@ -462,6 +463,7 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
                     '<option value=""></option>\n' +
                     '<option value="3">审核通过</option>\n' +
                     '<option value="2">审核驳回</option>\n' +
+                    (type == 5 ? '<option value="-2">驳回到分院</option>\n' : '') +
                     '<option value="-1">审核不通过</option>\n' +
                     '</select>\n' +
                     '</div>\n' +