Browse Source

删除功能修复

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

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

@@ -379,6 +379,7 @@ class VerifyApi {
                         case -1://保存未提交
                             //$where[] = ["ti.checkState", "=", TalentState::SCND_SAVE];
                             $where[] = ["tl.new_state", "=", TalentState::SCND_SAVE];
+                            $where[] = ["ti.delete", "=", 0];
                             break;
                         case 1://待审核
                             $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];

+ 1 - 1
app/enterprise/api/TalentApi.php

@@ -22,7 +22,7 @@ class TalentApi {
      */
     public static function checkIsEditable($id) {
         $info = Talent::findOrEmpty($id);
-        if (!$info || !in_array($info["checkState"], [0, TalentState::FST_SAVE, TalentState::BASE_REVERIFY_PASS, TalentState::SCND_SAVE]))
+        if (!$info || $info["delete"] == 1 || !in_array($info["checkState"], [0, TalentState::FST_SAVE, TalentState::BASE_REVERIFY_PASS, TalentState::SCND_SAVE]))
             return false;
         return true;
     }

+ 6 - 10
app/enterprise/controller/Talent.php

@@ -1027,22 +1027,18 @@ class Talent extends EnterpriseController {
 
     public function mixDelete() {
         $id = $this->request->param("talentInfoId");
-        $info = Talent::chkIsOwner($id, $this->user["uid"]);
+        $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
         if (!$info) {
             return json(["msg" => "操作失败"]);
         }
         $checkState = $info["checkState"];
         if (in_array($checkState, [0, TalentState::SCND_SAVE])) {
-            $log = TalentLogApi::getLastLog($id, 1);
-            if ($log["state"] > 1) {
-                //有提交审核记录
-                return json(["msg" => "该申报已提交审核,无法删除"]);
-            }
+            $data["id"] = $id;
+            $data["delete"] = 1;
+            TalentModel::update($data);
+            return json(["msg" => "删除成功"]);
         }
-        $data["id"] = $id;
-        $data["delete"] = 1;
-        TalentModel::update($data);
-        return json(["msg" => "删除成功"]);
+        return json(["msg" => "该申报已提交审核,无法删除"]);
     }
 
 }

+ 2 - 2
public/static/modular/gate/talentInfo/new_talentInfo.js

@@ -17,7 +17,7 @@ TalentInfo.initColumn = function () {
         isShow = false;
     }
     return [
-        {field: 'selectItem', radio: true,formatter: function (value, row, index) {
+        {field: 'selectItem', radio: true, formatter: function (value, row, index) {
                 if (row.isImport == 1) {
                     return '<span style="color:#ff0000">人才直认</span>';
                 }
@@ -323,7 +323,7 @@ TalentInfo.viewTalentInfo = function () {
  */
 TalentInfo.delete = function () {
     if (this.check()) {
-        if (TalentInfo.seItem.checkState > 1) {
+        if (TalentInfo.seItem.checkState != 0 && TalentInfo.seItem.checkState != 8) {
             Feng.error("该申报已提交审核,无法删除");
             return;
         }