Kaynağa Gözat

增加合同到期的导出

sandm 1 yıl önce
ebeveyn
işleme
d42ed5ca45

+ 10 - 1
app/common/api/VerifyApi.php

@@ -1036,7 +1036,15 @@ class VerifyApi {
                             ->select()->toArray();
         }
         $un_common_location = Db::table("un_common_location")->column('name', 'code');
-        foreach ($list as &$item) {
+        foreach ($list as $kkk => &$item) {
+            if($params['select_contract'] == '1'){
+                $temp_contract = explode(' - ',$item['labor_contract_rangetime']);
+                //dump($temp_contract);die;
+                if(strtotime($temp_contract[1]) > time()){
+                    unset($list[$kkk]);
+                    continue;
+                }
+            }
             $item["card_type"] = $cardTypes[$item["card_type"]];
             $item["industryFieldNew"] = $industry_fields[$item["industryFieldNew"]];
             $item["enterpriseTag"] = $enterpriseTags[$item["enterpriseTag"]];
@@ -1195,6 +1203,7 @@ class VerifyApi {
                 }
             }
         }unset($item);
+
         return $list;
     }
 

+ 9 - 5
app/enterprise/controller/TalentLibrary.php

@@ -54,12 +54,16 @@ class TalentLibrary extends EnterpriseController {
         }
         $datas = [];
         for ($i = 0; $i < count($list); $i++) {
-            $data = [];
-            for ($n = 0; $n < count($fields); $n++) {
-                $cellValue = $list[$i][$fields[$n]];
-                $data[] = $cellValue;
+
+            if(count((array)$list[$i]) > 0){
+                $data = [];
+                for ($n = 0; $n < count($fields); $n++) {
+                    $cellValue = $list[$i][$fields[$n]];
+                    $data[] = $cellValue;
+                }
+                $datas[] = $data;
             }
-            $datas[] = $data;
+
         }
         $setting["freeze"] = "A2";
         $setting["filter"] = sprintf("A1:%s1", getExcelColumnByIndex(count($columns) - 1));

+ 4 - 0
app/enterprise/view/talent_library/index.html

@@ -129,6 +129,9 @@
                             <button type="button" class="btn btn-sm btn-primary" onclick="TalentInfo.openTalentInfoDetail()">
                                 <i class="fa fa-book"></i>&nbsp;查看
                             </button>
+                            <button type="button" class="btn btn-sm btn-primary" onclick="TalentInfo.showExportModal()">
+                                <i class="fa fa-file-excel-o"></i>&nbsp;导出合同到期名单
+                            </button>
                         </div>
                         <table id="TalentInfoTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
                             <thead>
@@ -188,6 +191,7 @@
             </div>
             <div class="modal-body">
                 <form id="exportForm"  target="hiddenIframe" class="form-horizontal">
+                    <input type="hidden" name="select_contract" id="select_contract" value="0">
                     <div class="form-group" id="field">
                         <div id="field_info">
                             <ul>

+ 6 - 0
public/static/modular/gate/talentInfo/talentInfo_library.js

@@ -251,9 +251,15 @@ TalentInfo.callback = function (data) {
 //显示导出模态框
 TalentInfo.showExportModal = function () {
     $("#exportForm")[0].reset();
+    $("#select_contract").val(0);
     $("#exportModal").modal("show");
 }
 
+TalentInfo.showExportModal = function () {
+    $("#exportForm")[0].reset();
+    $("#select_contract").val(1);
+    $("#exportModal").modal("show");
+}
 
 //导出
 TalentInfo.export = function () {