瀏覽代碼

修正津补贴审核中获取合同时判断读取的是人才申报中的mainId|单位变更mainId|基础信息变更mainId时,读取错了mainId导致无法读到附件列表

sugangqiang 7 月之前
父節點
當前提交
3fbc273145
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 7 1
      app/common/controller/Api.php
  2. 4 2
      app/common/view/api/contract_view.html

+ 7 - 1
app/common/controller/Api.php

@@ -1244,6 +1244,7 @@ class Api extends BaseController {
         $talentId = $this->request["talentId"];
         $talentInfo = \app\common\api\VerifyApi::getTalentInfoById($talentId);
         $project = ProjectState::TALENT;
+        $mainId = $talentId;
         //检查是否有工作单位变更记录
         $_where = [];
         $_where[] = ["checkState", "=", 3];
@@ -1261,12 +1262,15 @@ class Api extends BaseController {
 
         if ($workChange && !$baseChange) {
             $project = ProjectState::WORKCHANGE;
+            $mainId = $workChange["id"];
         }
         if (!$workChange && $baseChange) {
             $project = ProjectState::BASICCHANGE;
+            $mainId = $baseChange["id"];
         }
         if ($workChange && $baseChange) {
             $project = strtotime($workChange["passTime"]) > strtotime($baseChange["newSubmitTime"]) ? ProjectState::WORKCHANGE : ProjectState::BASICCHANGE;
+            $mainId = strtotime($workChange["passTime"]) > strtotime($baseChange["newSubmitTime"]) ? $workChange["id"] : $baseChange["id"];
         }
 
         $type = $this->request["type"];
@@ -1279,6 +1283,9 @@ class Api extends BaseController {
         $where[] = ["delete", "=", 0];
         $where[] = ["type", "=", $type];
         $rows = Db::table("new_common_filetype")->where($where)->order("must asc")->order("sn asc")->select()->toArray();
+        foreach ($rows as &$row) {
+            $row["mainId"] = $mainId;
+        }unset($row);
         return json(["rows" => $rows]);
     }
 
@@ -1299,5 +1306,4 @@ class Api extends BaseController {
     public function getEnterpriseData() {
         
     }
-
 }

+ 4 - 2
app/common/view/api/contract_view.html

@@ -117,8 +117,10 @@
                 },
                 onExpandRow: function (index, row, $detail) {
                     var url = "/common/api/listTalentFile";
+                    fileTypeField = "fileTypeId";
                     if (row.project == 4) {
                         url = "/common/api/listTalentCommonFile";
+                        fileTypeField = "typeId";
                     }
                     var ajax = new $ax(Feng.ctxPath + url, function (data) {
                         if (data == null || data.length == 0) {
@@ -151,8 +153,8 @@
                         Feng.error("查询失败!" + data.responseJSON.message + "!");
                     });
                     var queryData = {};
-                    queryData["mainId"] = $("#id").val();
-                    queryData["fileTypeId"] = row.id;
+                    queryData["mainId"] = row.mainId;
+                    queryData[fileTypeField] = row.id;
                     ajax.set(queryData);
                     ajax.start();
                 }