Kaynağa Gözat

所有变更模块如果有旧附件就显示出来(审核端)

sugangqiang 8 ay önce
ebeveyn
işleme
5a957bab5e

+ 8 - 3
app/admin/controller/TalentBankChange.php

@@ -47,7 +47,14 @@ class TalentBankChange extends AdminController {
         if (\StrUtil::isNotEmpAndNull($info["talentType"])) {
             $info["talentTypeName"] = DictApi::selectByParentCode("enterprise_tag")[$info["talentType"]];
         }
-        return view("check", ["type" => $this->user["type"], "row" => $info]);
+        //查看是否有上传旧附件
+        $_where = [["mainId", "=", $id]];
+        $old_list = Db::table("un_talent_common_file")->where($_where)->find();
+        $showOldFile = 0;
+        if ($old_list) {
+            $showOldFile = 1;
+        }
+        return view("check", ["type" => $this->user["type"], "row" => $info, "showOldFile" => $showOldFile]);
     }
 
     public function submitToCheck() {
@@ -167,7 +174,6 @@ class TalentBankChange extends AdminController {
         $list = TbcModel::where($where)->select()->toArray();
         $levelMap = DictApi::selectByParentCode("talent_arrange");
 
-
         $title = ["姓名", "证件号码", "工作单位", "人才层次", "原开户银行", "原开户银行网点", "原银行账号", "原银行行号",
             "现开户银行", "现开户银行网点", "现银行账号", "现银行行号", "审核状态", "审核意见", "审核通过时间"];
         $keys = ["talentName", "idCard", "enterpriseName", "talentArrangeName", "oldBankName", "oldBankNerPoint", "oldBankAccount", "oldBankNumber",
@@ -231,5 +237,4 @@ class TalentBankChange extends AdminController {
         }
         return $where;
     }
-
 }

+ 8 - 2
app/admin/controller/TalentBasicChange.php

@@ -69,7 +69,14 @@ class TalentBasicChange extends AdminController {
     public function check() {
         $id = $this->request["id"];
         $info = TbcModel::where("id", $id)->find();
-        return view("check", ["type" => $this->user["type"], "row" => $info]);
+        //查看是否有上传旧附件
+        $_where = [["mainId", "=", $id]];
+        $old_list = Db::table("un_talent_common_file")->where($_where)->find();
+        $showOldFile = 0;
+        if ($old_list) {
+            $showOldFile = 1;
+        }
+        return view("check", ["type" => $this->user["type"], "row" => $info, "showOldFile" => $showOldFile]);
     }
 
     public function submitToCheck() {
@@ -256,5 +263,4 @@ class TalentBasicChange extends AdminController {
         }
         return $where;
     }
-
 }

+ 8 - 2
app/admin/controller/TalentQuit.php

@@ -49,7 +49,14 @@ class TalentQuit extends AdminController {
         if (\StrUtil::isNotEmpAndNull($info["talentType"])) {
             $info["talentTypeName"] = DictApi::selectByParentCode("enterprise_tag")[$info["talentType"]];
         }
-        return view("check", ["type" => $this->user["type"], "row" => $info]);
+        //查看是否有上传旧附件
+        $_where = [["mainId", "=", $id]];
+        $old_list = Db::table("un_talent_common_file")->where($_where)->find();
+        $showOldFile = 0;
+        if ($old_list) {
+            $showOldFile = 1;
+        }
+        return view("check", ["type" => $this->user["type"], "row" => $info, "showOldFile" => $showOldFile]);
     }
 
     public function submitToCheck() {
@@ -209,5 +216,4 @@ class TalentQuit extends AdminController {
         }
         return $where;
     }
-
 }

+ 8 - 2
app/admin/controller/TalentWorkUnitChange.php

@@ -70,7 +70,14 @@ class TalentWorkUnitChange extends AdminController {
         $epNew = EnterpriseApi::getOne($info["newEnterpriseId"]);
         $info["oldEnterpriseName"] = $epOld["name"];
         $info["newEnterpriseName"] = $epNew["name"];
-        return view("check", ["type" => $this->user["type"], "row" => $info]);
+        //查看是否有上传旧附件
+        $_where = [["mainId", "=", $id]];
+        $old_list = Db::table("un_talent_common_file")->where($_where)->find();
+        $showOldFile = 0;
+        if ($old_list) {
+            $showOldFile = 1;
+        }
+        return view("check", ["type" => $this->user["type"], "row" => $info, "showOldFile" => $showOldFile]);
     }
 
     public function submitToCheck() {
@@ -244,5 +251,4 @@ class TalentWorkUnitChange extends AdminController {
         }
         return $where;
     }
-
 }

+ 1 - 0
app/admin/view/talent_bank_change/check.html

@@ -24,6 +24,7 @@
                         <input id="enterpriseId" name="enterpriseId" type="hidden" value="{$row.enterpriseId}"/>
                         <input id="talentName" name="talentName" type="hidden" value="{$row.talentName}"/>
                         <input id="talentArrange" name="talentArrange" type="hidden" value="{$row.talentArrange}"/>
+                        <input type="hidden" id="showOldFile" value="{$showOldFile}"/>
                         <div class="rowGroup">
                             <label class="col-sm-2 control-label spacing">申报对象</label>
                             <div class="col-sm-4 spacing">

+ 1 - 0
app/admin/view/talent_basic_change/check.html

@@ -50,6 +50,7 @@
                                                 <input type="hidden" name="type" id="type" value="{$row.type}">
                                                 <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
                                                 <input type="hidden" name="talentId" id="talentId" value="{$row.talentId}">
+                                                <input type="hidden" id="showOldFile" value="{$showOldFile}"/>
                                                 <div class="row">
                                                     <div class="col-sm-12">
                                                         <div class="rowGroup col-sm-3">

+ 1 - 0
app/admin/view/talent_quit/check.html

@@ -52,6 +52,7 @@
                                                 <input type="hidden" id="enterpriseId" name="enterpriseId" value="{$row.enterpriseId}"/>
                                                 <input type="hidden" id="talentId" name="talentId" value="{$row.talentId}"/>
                                                 <input type="hidden" id="year" name="year" value="{$row.year}">
+                                                <input type="hidden" id="showOldFile" value="{$showOldFile}"/>
                                                 <div class="rowGroup">
                                                     <label class="col-sm-2 control-label spacing">离职对象</label>
                                                     <div class="col-sm-4 spacing">

+ 1 - 0
app/admin/view/talent_work_unit_change/check.html

@@ -46,6 +46,7 @@
                                                 <input id="checkState" name="checkState" type="hidden" value="{$row.checkState}"/>
                                                 <input id="oldTalentType" name="oldTalentType" type="hidden" value="{$row.oldTalentType}"/>
                                                 <input id="newTalentType" name="newTalentType" type="hidden" value="{$row.newTalentType}"/>
+                                                <input type="hidden" id="showOldFile" value="{$showOldFile}"/>
                                                 <div class="rowGroup">
                                                     <label class="col-sm-2 control-label spacing">证件号码</label>
                                                     <div class="col-sm-4 spacing">

+ 9 - 2
app/common/controller/Api.php

@@ -516,7 +516,7 @@ class Api extends BaseController {
             }
         }
         $old_types = [];
-        if ($project == ProjectState::LEVELCHANGE && $showOldFile == 1) {
+        if ($showOldFile == 1) {
             $where = [];
             $where[] = ["type", "=", $type];
             $where[] = ["project", "=", $project];
@@ -1042,7 +1042,14 @@ class Api extends BaseController {
         if (\StrUtil::isNotEmpAndNull($this->request['typeId'])) {
             $where[] = ['typeId', '=', $this->request['typeId']];
         }
-        $res = TalentCommonFile::where($where)->order('sn')->select();
+        $res = TalentCommonFile::where($where)->order('sn')->select()->toArray();
+        if (\StrUtil::isNotEmpAndNull($this->request['mainId']) && \StrUtil::isNotEmpAndNull($this->request['typeId'])) {
+            $_where = [["mainId", "=", $this->request['mainId']], ["typeId", "=", $this->request['typeId']]];
+            $old_list = Db::table("un_talent_common_file")->where($_where)->select()->toArray();
+        }
+        if ($old_list) {
+            $res = array_merge($res, $old_list);
+        }
         if ($res) {
             foreach ($res as $k => &$v) {
                 $v["ext"] = pathinfo($v["url"])["extension"];

+ 1 - 0
public/static/modular/talentLibrary/talentQuit/talentQuit_info.js

@@ -18,6 +18,7 @@ TalentQuitInfoDlg.initFileTable = function () {
     var queryData = {};
     queryData['project'] = CONFIG.project_quit;
     queryData['type'] = $("#type").val();
+    queryData['showOldFile'] = $("#showOldFile").val();
     $("#fileTable").bootstrapTable({
         url: Feng.ctxPath + "/common/api/findCommonFileType",
         method: 'POST',

+ 1 - 0
public/static/modular/talentLibrary/talentWorkunitChange/talentWorkunitChange_info.js

@@ -20,6 +20,7 @@ TalentWorkunitChangeInfoDlg.initFileTable = function () {
     var queryData = {};
     queryData['type'] = $("#type").val();
     queryData['project'] = CONFIG.project_workchange;
+    queryData['showOldFile'] = $("#showOldFile").val();
     $("#fileTable").bootstrapTable({
         url: Feng.ctxPath + "/common/api/findCommonFileType",
         method: 'POST',