فهرست منبع

撤销初审失败

sugangqiang 1 سال پیش
والد
کامیت
a857428fa1

+ 52 - 8
app/admin/controller/Talent.php

@@ -296,14 +296,6 @@ class Talent extends AdminController {
         return view($tpl, $assigns);
     }
 
-    /**
-     * 复审-撤销复核
-     * @auth {{/talentInfo/cancleThirdCheck}}
-     */
-    public function cancel_check() {
-        
-    }
-
     /**
      * 预备人才库
      * @auth {{/talentInfo/gotoIndex/4}}
@@ -1574,6 +1566,58 @@ class Talent extends AdminController {
         }
     }
 
+    /**
+     * 撤销初审失败
+     * @auth {{/talentInfo/cancleFirstCheck}}
+     */
+    public function cancleFirstCheck() {
+        $returnObj = new \stdClass();
+        $returnObj->code = 500;
+        $id = \StrUtil::getRequestDecodeParam($this->request, "id");
+        $msg = \StrUtil::getRequestDecodeParam($this->request, "checkMsg");
+        $old = VerifyApi::getOne($id);
+        if (!$old) {
+            $returnObj->msg = "请选择需要撤销的对象";
+            return json($returnObj);
+        }
+        if ($old["checkState"] != TalentState::FST_VERIFY_FAIL) {
+            $returnObj->msg = "当前对象不是\"初审不通过\"状态,无法撤销";
+            return json($returnObj);
+        }
+        $where = [];
+        $lastLog = TalentLogApi::getLastLogEx($id, ProjectState::TALENT);
+        if ($lastLog["state"] != TalentState::FST_VERIFY_FAIL || $lastLog["active"] != 1) {
+            $returnObj->msg = "当前对象不是\"初审不通过\"状态,无法撤销";
+            return json($returnObj);
+        }
+        if ($old["isPublic"] != 1) {
+            $returnObj->msg = "当前对象已核查征信,无法撤销";
+            return json($returnObj);
+        }
+        try {
+            if (in_array($lastLog["last_state"], [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT])) {
+                $checkState = TalentState::SCND_SUBMIT;
+            } else if (in_array($lastLog["last_state"], [TalentState::SCND_SAVE, TalentState::FST_VERIFY_REJECT])) {
+                $checkState = TalentState::SCND_SAVE;
+            } else {
+                $returnObj->msg = "当前对象日志异常,无法撤销";
+                return json($returnObj);
+            }
+
+            $upd["id"] = $id;
+            $upd["checkState"] = $checkState;
+            if (TalentModel::update($upd)) {
+                TalentLogApi::write(ProjectState::TALENT, $id, [$lastLog["last_state"], $checkState], "撤销原因:" . $msg, 1);
+            }
+            $returnObj->msg = "撤销成功";
+            $returnObj->code = 200;
+            return json($returnObj);
+        } catch (\think\db\exception\DbException $e) {
+            $responseObj->msg = $e->getMessage();
+            return json($responseObj);
+        }
+    }
+
     /**
      * 撤销复核
      * @auth {{/talentInfo/cancleThirdCheck}}

+ 5 - 0
app/admin/view/talent/fst_verify.html

@@ -340,6 +340,11 @@
                                 <i class="fa fa-check"></i>&nbsp;审核
                             </button>
                             {/if}
+                            {if condition="chkCommission('/admin/talent/cancelFirstCheck','/talentInfo/cancelFirstCheck')"}
+                                <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.cancleFirstCheck()" id="">
+                                    <i class="fa fa-file-excel-o"></i>&nbsp;撤销初审失败
+                                </button>
+                            {/if}
                             {if condition="chkCommission('/admin/talent/fstVerifyListExport','/talentInfo/firstExport')"}
                             <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.showExportModal(1)" id="">
                                 <i class="fa fa-file-excel-o"></i>&nbsp;导出

+ 1 - 0
app/common/api/TalentState.php

@@ -35,6 +35,7 @@ class TalentState {
     public const CERTIFICATED = 28; //已发放人才码
     public const BASE_VERIFY_FAIL = -1; //条件验证失败
     public const FST_VERIFY_FAIL = -2; //初审失败
+    public const FST_VERIFY_CANCEL = -13; //初审不通过撤销
     public const REVERIFY_CANCEL = -14; //复审撤销
     public const RCRD_BASIC_SAVE = -2;
     public const RCRD_BASIC_NOTPASS = -1;

+ 45 - 0
public/static/modular/talentIdentify/talentInfo/talentInfo_base.js

@@ -266,6 +266,51 @@ TalentInfo.openTalentInfoDetail = function () {
     }
 };
 
+
+TalentInfo.cancleFirstCheck = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 1,
+            title: '撤销初审失败',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: '<form >\n' +
+                    '                    <div class="form-group" style="margin: 10px;">\n' +
+                    '                        <label for="checkMsg" class="control-label">撤销原因</label>\n' +
+                    '                        <textarea class="form-control" id="msg" rows="6"></textarea>\n' +
+                    '                    </div>\n' +
+                    '                </form>',
+            btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+            yes: function (index, layero) {
+                var cancleMsg = $("#msg").val();
+                if (Feng.isEmptyStr(cancleMsg)) {
+                    Feng.error("撤销原因不能为空");
+                    return;
+                }
+                var operation = function () {
+                    var ajax = new $ax(Feng.ctxPath + "/admin/talent/cancleFirstCheck", function (data) {
+                        if (data.code == 200) {
+                            Feng.success(data.msg);
+                            TalentInfo.table.refresh();
+                            layer.close(index);
+                        } else {
+                            Feng.error(data.msg);
+                        }
+                        locked = false;
+                    }, function (data) {
+                        Feng.error("撤销失败!" + data.responseJSON.message + "!");
+                        locked = false;
+                    });
+                    ajax.setData({"id": TalentInfo.seItem.id, "checkMsg": cancleMsg})
+                    ajax.start();
+                };
+                Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
+            }
+        });
+    }
+}
+
 TalentInfo.cancleThirdCheck = function () {
     if (this.check()) {
         var index = layer.open({