sugangqiang 1 éve
szülő
commit
f1126e3589

+ 15 - 0
app/common/controller/Api.php

@@ -344,6 +344,7 @@ class Api extends BaseController {
         $where[] = ["type", "=", $type];
         switch ($project) {
             case 1:
+            case 8:
                 //if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, 0, TalentState::FST_SAVE, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS]) && $isMix != 1) {
                 //$where[] = ["step", "=", 1]; //只查找人才第一步所需文件
                 //} else {
@@ -608,6 +609,7 @@ class Api extends BaseController {
         $url = "";
         switch ($type) {
             case 1:
+            case 8:
             case 19:
                 $fileinfo = Db::table("new_talent_file")->where($where)->findOrEmpty();
                 $filename = $fileinfo["orignName"];
@@ -686,6 +688,11 @@ class Api extends BaseController {
                 $enterprise_info = \app\common\model\Enterprise::findOrEmpty($info["enterpriseId"]);
                 $zip_filename = sprintf("%s(%s)工作单位变更材料.zip", $info["talentName"], $enterprise_info["name"]);
                 break;
+            case ProjectState::LEVELCHANGE:
+                $info = \app\enterprise\model\TalentTypeChange::findOrEmpty($id);
+                $enterprise_info = \app\common\model\Enterprise::findOrEmpty($info["enterpriseId"]);
+                $zip_filename = sprintf("%s(%s)人才层次变更材料.zip", $info["talentName"], $enterprise_info["name"]);
+                break;
             case ProjectState::INTEGRAL:
                 $where[] = ["type", "=", $type];
                 $record = \app\common\api\IntegralRecordApi::getOne($id);
@@ -759,6 +766,14 @@ class Api extends BaseController {
                         return true;
                 }
                 break;
+            case ProjectState::LEVELCHANGE:
+                if ($this->user["usertype"] == 2) {
+                    $user_id = $this->user["uid"];
+                    $talent_info = \app\enterprise\model\TalentTypeChange::findOrEmpty($mainId);
+                    if ($user_id == $talent_info["enterpriseId"])
+                        return true;
+                }
+                break;
             case ProjectState::LIVINGALLOWANCE:
                 if ($this->user["usertype"] == 2) {
                     $user_id = $this->user["uid"];

+ 14 - 2
app/enterprise/controller/TalentTypeChange.php

@@ -106,11 +106,23 @@ class TalentTypeChange extends EnterpriseController {
             $response->msg = "不能重复提交审核";
             return $response;
         }
+        $condition_info = Db::table("new_talent_condition")->findOrEmpty($info["newIdentifyCondition"]);
+        if ($condition_info["bindFileTypes"]) {
+            $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
+            $whr[] = ["must", "=", 1];
+        }
+
         $where = [];
         $where[] = ["type", "=", $info["type"]];
         $where[] = ["project", "=", ProjectState::LEVELCHANGE];
         $where[] = ["active", "=", 1];
-        $filetypes = Db::table("new_common_filetype")->where($where)->order("sn asc")->select()->toArray();
+        $where[] = ["delete", "=", 0];
+
+        if ($whr) {
+            $filetypes = Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select()->toArray();
+        } else {
+            $filetypes = Db::table("new_common_filetype")->where($where)->order("sn asc")->select()->toArray();
+        }
         $sb = [];
         $sb[] = "以下为必传附件:";
         foreach ($filetypes as $filetype) {
@@ -118,7 +130,7 @@ class TalentTypeChange extends EnterpriseController {
                 $where = [];
                 $where[] = ["mainId", "=", $id];
                 $where[] = ["typeId", "=", $filetype["id"]];
-                $count = Db::table("new_talent_common_file")->where($where)->count();
+                $count = Db::table("new_talent_file")->where($where)->count();
                 if ($count == 0) {
                     $sb[] = $filetype["name"] . ";";
                 }

+ 9 - 7
app/enterprise/view/talent_type_change/apply.html

@@ -243,13 +243,15 @@
                                 </thead>
                             </table>
                             <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>
-                            <form id="uploadForm" action="/common/api/addTalentCommonFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">                          
-                                <input type="hidden" name="backName" value="TalentTypeChangeInfoDlg.callBack">
-                                <input type='hidden' id="fileId" name="fileId" >
-                                <input type='file' id="upload_file" name="fileUrl" style='display: none'>
-                                <input type='hidden' id="mainId" name="mainId" >
-                                <input type='hidden' id="typeId" name="typeId" >
-                                <input type='hidden' id="index" name="index" >
+                            <form id="uploadForm" action="/common/api/addTalentFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
+                                <input type='hidden' id="fileId" name="fileId" />
+                                <input type='file' id="upload_file" name="fileUrl" style='display: none'/>
+                                <input type='hidden' id="mainId" name="mainId" />
+                                <input type='hidden' id="fileTypeId" name="fileTypeId" />
+                                <input type='hidden' id="index" name="index" />
+                                <input type='hidden' id="tableIndex" name="tableIndex" />
+                                <input type='hidden' id="trIndex" name="trIndex" />
+                                <input type="hidden" name="backName" value="TalentTypeChangeInfoDlg.callBack"/>
                                 <input type="type" name="type" value="8">
                             </form>
                         </div>

+ 8 - 4
public/static/modular/gate/talentLibrary/talentTypeChange/talentTypeChange_info.js

@@ -509,6 +509,10 @@ TalentTypeChangeInfoDlg.initFileTable = function () {
     var queryData = {};
     queryData['type'] = $("#type").val();
     queryData['project'] = CONFIG.project_levelchange;
+    queryData["source"] = $("#newSource").val();
+    queryData["talent_condition"] = $("#newIdentifyCondition option:selected").val();
+    queryData['checkState'] = $("#checkState").val();
+    queryData['isMix'] = 1;
     $("#fileTable").bootstrapTable({
         url: "/common/api/findCommonFileType",
         method: 'POST',
@@ -543,7 +547,7 @@ TalentTypeChangeInfoDlg.initFileTable = function () {
             $("#fileTable").bootstrapTable('expandAllRows');
         },
         onExpandRow: function (index, row, $detail) {
-            var ajax = new $ax("/common/api/listTalentCommonFile", function (data) {
+            var ajax = new $ax("/common/api/listTalentFile", function (data) {
                 if (data == null || data.length == 0) {
                     return;
                 }
@@ -587,7 +591,7 @@ TalentTypeChangeInfoDlg.initFileTable = function () {
             });
             var queryData = {};
             queryData["mainId"] = $("#id").val();
-            queryData["typeId"] = row.id;
+            queryData["fileTypeId"] = row.id;
             ajax.set(queryData);
             ajax.start();
         }
@@ -630,7 +634,7 @@ TalentTypeChangeInfoDlg.upload = function (fileTypeId, fileId) {
         $("#fileId").val("");
     }
     $("#mainId").val(id);
-    $("#typeId").val(fileTypeId);
+    $("#fileTypeId").val(fileTypeId);
     var index = layer.load(0, {shade: false, time: 0});
     $("#index").val(index);
     $("#uploadForm").submit();
@@ -644,7 +648,7 @@ TalentTypeChangeInfoDlg.deleteFile = function (id, state) {
         return;
     }
     var operation = function () {
-        var ajax = new $ax("/common/api/deleteTalentCommonFile", function (data) {
+        var ajax = new $ax("/common/api/deleteFile", function (data) {
             if (data.code = 200) {
                 Feng.success(data.msg);
                 $("#fileTable").bootstrapTable("refresh", {});