Browse Source

卫健快速驳回中增加修改建议

sugangqiang 1 year ago
parent
commit
4480881f4e

+ 22 - 3
app/admin/controller/Talent.php

@@ -1852,6 +1852,7 @@ class Talent extends AdminController {
             $responseObj->id = $id;
             $responseObj->fileList = $files;
             $responseObj->fieldList = $field_tmp;
+            $responseObj->checkMsg = $lastLog["description"];
             $responseObj->select = [
                 "files" => array_filter(explode(",", $talentInfo["modify_files"])),
                 "fields" => array_filter(explode(",", $talentInfo["modify_fields"]))
@@ -1870,10 +1871,12 @@ class Talent extends AdminController {
         $id = $this->request["id"];
         $fields = array_filter(explode(",", $this->request["fields"]));
         $files = array_filter(explode(",", $this->request["files"]));
+        $checkMsg = \StrUtil::getRequestDecodeParam($this->request, "checkMsg");
 
         $talentInfo = VerifyApi::getOne($id);
         $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT);
         $responseObj = new \stdClass();
+        Db::startTrans();
         if (($talentInfo["checkState"] == TalentState::SCND_SAVE || $talentInfo["checkState"] == TalentState::FST_SAVE || $talentInfo["checkState"] == TalentState::FST_SUBMIT) && $lastLog["state"] == TalentState::FST_VERIFY_REJECT) {
             if (!$fields && !$files) {
                 $responseObj->msg = "请选择可修改的字段或附件!";
@@ -1883,11 +1886,27 @@ class Talent extends AdminController {
                 $data["id"] = $id;
                 $data["modify_fields"] = $fields ? implode(",", $fields) : null;
                 $data["modify_files"] = $files ? implode(",", $files) : null;
-                TalentModel::update($data);
-                $responseObj->code = 200;
-                $responseObj->msg = "驳回字段修改成功";
+                $res1 = Db::table("new_talent_info")->update($data);
+                if (in_array($this->user["type"], [CommonConst::ENTERPRISE_WJ])) {
+                    if (\StrUtil::isEmpOrNull($checkMsg)) {
+                        $responseObj->msg = "请填写审核意见!";
+                        return json($responseObj);
+                    }
+                    $updLog["id"] = $lastLog["id"];
+                    $updLog["description"] = $checkMsg;
+                    $res2 = Db::table("new_talent_checklog")->update($updLog);
+                }
+                if ($res1 || $res2) {
+                    Db::commit();
+                    $responseObj->code = 200;
+                    $responseObj->msg = "驳回字段修改成功";
+                } else {
+                    Db::rollback();
+                    $responseObj->msg = "没有任何修改,提交失败";
+                }
                 return json($responseObj);
             } catch (\think\db\exception\DbException $e) {
+                Db::rollback();
                 $responseObj->msg = $e->getMessage();
                 return json($responseObj);
             }

+ 10 - 2
public/static/modular/talentIdentify/talentInfo/hospital/talentInfo_base.js

@@ -88,7 +88,7 @@ TalentInfo.initColumn = function () {
                         if (row.realState == 6) {
                             return "<span class='label label-danger'>复审驳回</span>"
                         }
-                        if(row.realState == 11){
+                        if (row.realState == 11) {
                             return "<span class='label label-danger'>驳回到总院</span>"
                         }
                         return "<span class='label label-success'>待审核</span>"
@@ -349,6 +349,7 @@ TalentInfo.updateFieldsAndFiles = function () {
                         for (var key in data.fileList) {
                             html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + data.fileList[key].id + '"><span>' + data.fileList[key].name + '</span></li></ul>';
                         }
+                        $("#checkMsg").text(data.checkMsg);
                         $("#firstCheckForm #field_info ul").css("overflow", "hidden").html(html1);
                         $("#field_file").css("overflow", "hidden").empty().append(html2);
                         //$("#field_file").empty().append(html);
@@ -389,6 +390,7 @@ TalentInfo.updateFieldsAndFiles = function () {
 TalentInfo.submitFieldsAndFiles = function (index, id) {
     var fields = '';
     var files = '';
+    var checkMsg = $("#checkMsg").val();
     $("#firstCheckForm #field_info li input").each(function (index) {
         if ($(this).is(":checked")) {
             fields = fields + $(this).val() + ",";
@@ -399,6 +401,10 @@ TalentInfo.submitFieldsAndFiles = function (index, id) {
             files = files + $(this).val() + ",";
         }
     });
+    if (checkMsg.trim() == '') {
+        Feng.info("请填写审核意见!");
+        return;
+    }
     if (fields == '' && files == '') {
         Feng.info("请选择可修改的字段或附件!");
         return;
@@ -413,7 +419,7 @@ TalentInfo.submitFieldsAndFiles = function (index, id) {
     }, function (data) {
         Feng.error("修改失败!" + data.responseJSON.message + "!");
     });
-    ajax.setData({"id": id, "fields": fields, "files": files})
+    ajax.setData({"id": id, "fields": fields, "files": files, "checkMsg": checkMsg})
     ajax.start();
 }
 
@@ -482,6 +488,8 @@ TalentInfo.creatFieldCheckModal = function () {
     return '<form id="firstCheckForm">\n' +
             '                    <div class="form-group" style="margin: 10px;">\n' +
             '                        <div >\n' +
+            '                        <label for="checkMsg" class="control-label" >审核意见</label>\n' +
+            '                        <textarea class="form-control" id="checkMsg" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
             '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
             '                            <div id="field_info">\n' +
             '                                <ul>\n' +