浏览代码

如果人才层次变更有旧附件则显示(审核端)

sugangqiang 8 月之前
父节点
当前提交
f8a3726518

+ 9 - 2
app/admin/controller/TalentTypeChange.php

@@ -207,7 +207,15 @@ class TalentTypeChange extends AdminController {
             }
             $info["newIdentifyConditionCH"] = $newCondition["name"];
         }
-        return view("", ["info" => $info]);
+        //查看是否有上传旧附件
+        $_where = [["mainId", "=", $id]];
+        $old_list = Db::table("un_talent_file")->where($_where)->find();
+        $showOldFile = 0;
+        if ($old_list) {
+            $showOldFile = 1;
+        }
+
+        return view("", ["info" => $info, "showOldFile" => $showOldFile]);
     }
 
     public function toDepCheck($id, $companyId) {
@@ -1984,5 +1992,4 @@ class TalentTypeChange extends AdminController {
         }unset($talentTypeChange);
         return $list;
     }
-
 }

+ 4 - 1
app/admin/view/talent/filesShow.html

@@ -38,7 +38,7 @@
     </thead>
 </table>
 <script>
-    function getFile(project, type, id, source, talent_condition, checkState) {
+    function getFile(project, type, id, source, talent_condition, checkState, showOldFile) {
         var queryData = {};
         queryData['project'] = project;
         queryData['type'] = type;
@@ -47,6 +47,9 @@
             queryData['talent_condition'] = talent_condition;
             queryData['checkState'] = checkState;
         }
+        if (typeof showOldFile != "undefined") {
+            queryData['showOldFile'] = showOldFile;
+        }
         var listUrl = "/common/api/listTalentFile";
         var field = "fileTypeId";
         $("#fileTable2").bootstrapTable({

+ 12 - 0
app/admin/view/talent_type_change/to_common_check.html

@@ -77,6 +77,7 @@
                                                 <input type="hidden" id="companyId" name="companyId" value="{$companyId}"/>
                                                 <input type="hidden" id="newSource" name="newSource" value="{$info.newSource}"/>
                                                 <input type="hidden" id="newIdentifyCondition" name="newIdentifyCondition" value="{$info.newIdentifyCondition}"/>
+                                                <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">
@@ -313,6 +314,17 @@
                                 </thead>
                             </table>
                         </div>
+                        {if condition="$showOldFile eq 1"}
+                        <div id="tab-2" class="tab-pane ">                            
+                            <table id="oldFileTable" class="table-condensed" style="table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                                <thead>
+                                    <tr>
+                                        <th data-field="selectItem" data-checkbox="true"></th>
+                                    </tr>
+                                </thead>
+                            </table>
+                        </div>
+                        {/if}
                     </div>
                 </div>
             </div>

+ 3 - 3
app/common/controller/Api.php

@@ -389,6 +389,7 @@ class Api extends BaseController {
         $talent_condition = $param["talent_condition"];
         $token = $param["pageToken"];
         $year = $param["year"];
+        $showOldFile = $param["showOldFile"];
         $where[] = ["project", "=", $project];
         $where[] = ["active", "=", 1];
         $where[] = ["delete", "=", 0];
@@ -515,12 +516,12 @@ class Api extends BaseController {
             }
         }
         $old_types = [];
-        if ($project == ProjectState::LEVELCHANGE) {
+        if ($project == ProjectState::LEVELCHANGE && $showOldFile == 1) {
             $where = [];
             $where[] = ["type", "=", $type];
             $where[] = ["project", "=", $project];
             $where[] = ["active", "=", 1];
-            //$old_types = Db::table("un_common_filetype")->where($where)->order("must")->order("sn")->select()->toArray();
+            $old_types = Db::table("un_common_filetype")->where($where)->order("must")->order("sn")->select()->toArray();
         }
         if ($old_types) {
             $rows = array_merge($rows, $old_types);
@@ -1242,5 +1243,4 @@ class Api extends BaseController {
     public function getEnterpriseData() {
         
     }
-
 }

+ 2 - 2
public/static/js/common/Feng.js

@@ -614,7 +614,7 @@ var Feng = {
             }
         })
     },
-    showMiniFileModal: function (project, type, id, source, talent_condition, checkState) {
+    showMiniFileModal: function (project, type, id, source, talent_condition, checkState, showOldFile) {
         layer.open({
             type: 2,
             title: "附件",
@@ -632,7 +632,7 @@ var Feng = {
                 layer.setTop(layero);
                 //按钮【按钮一】的回调
                 var iframeWin = window[layero.find('iframe')[0]['name']];
-                iframeWin.getFile(project, type, id, source, talent_condition, checkState);
+                iframeWin.getFile(project, type, id, source, talent_condition, checkState, showOldFile);
             }
         });
     },

+ 2 - 1
public/static/modular/talentLibrary/talentTypeChange/talentTypeChange_common_check.js

@@ -16,7 +16,7 @@ TalentTypeChangeInfoDlg.close = function () {
 
 //初始化附件类别表单
 TalentTypeChangeInfoDlg.initFileTable = function () {
-    Feng.showMiniFileModal(CONFIG.project_levelchange, $("#type").val(), $("#id").val(), $("#newSource").val(), $("#newIdentifyCondition").val(), $("#checkState").val());
+    Feng.showMiniFileModal(CONFIG.project_levelchange, $("#type").val(), $("#id").val(), $("#newSource").val(), $("#newIdentifyCondition").val(), $("#checkState").val(), $("#showOldFile").val());
     var queryData = {};
     queryData['type'] = $("#type").val();
     queryData['project'] = CONFIG.project_levelchange;
@@ -24,6 +24,7 @@ TalentTypeChangeInfoDlg.initFileTable = function () {
     queryData["talent_condition"] = $("#newIdentifyCondition").val();
     queryData['checkState'] = $("#checkState").val();
     queryData['isMix'] = 1;
+    queryData["showOldFile"] = $("#showOldFile").val();
     $("#fileTable").bootstrapTable({
         url: Feng.ctxPath + "/common/api/findCommonFileType",
         method: 'POST',