sugangqiang 2 年之前
父節點
當前提交
39557be936

+ 1 - 1
app/admin/controller/TalentCondition.php

@@ -72,7 +72,7 @@ class TalentCondition extends AdminController {
         if (!$params["talentLevel"] || !in_array($params["talentLevel"], [1, 2, 3, 4, 5, 6, 7]))
             return json(["msg" => "请选择人才层次"]);
         if (!$params["talentLevelCat"])
-            return json(["msg" => "请选择层次分级"]);
+            return json(["msg" => "请选择人才条款"]);
         if (!$params["name"])
             return json(["msg" => "请填写名称"]);
         if (!$params["companyIds"]) {

+ 10 - 0
app/admin/view/talent/talentInfo_common_check.html

@@ -440,12 +440,22 @@
                                                             <option value="">{$info.talentArrangeName}</option>
                                                         </select>
                                                     </div>
+                                                    <div class="rowGroup col-sm-3">
+                                                        <label class="control-label spacing"><span style="color: red">*</span>人才条款</label>
+                                                        <select class="form-control" id="talent_arrange_category" name="talent_arrange_category">
+                                                            <option value="">{$info.talentArrangeCatName}</option>
+                                                        </select>
+                                                    </div>
                                                     <div class="rowGroup col-sm-3">
                                                         <label class="control-label spacing"><span style="color: red">*</span>认定条件</label>
                                                         <select class="form-control" id="talent_condition">
                                                             <option value="{$info.talent_condition}">{$info.talentConditionName}</option>
                                                         </select>
                                                     </div>
+                                                    <div class="rowGroup col-sm-3" {if condition='!$info["annual_salary"]'}style="display:none;"{/if}>
+                                                        <label class="control-label spacing"><span style="color: red">*</span>年薪</label>
+                                                        <input type="text" class="form-control" id="annual_salary" value="{$info.annual_salary}"/>
+                                                    </div>
                                                 </div>
                                             </div>                    
                                             <div class="row" style="margin-top:20px;padding:10px 25px;">

+ 3 - 3
app/admin/view/talent_condition/add.html

@@ -32,7 +32,7 @@
                             </div>
                         </div>
                         <div class="rowGroup">
-                            <label class="col-sm-2 control-label spacing">层次分级</label>
+                            <label class="col-sm-2 control-label spacing">人才条款</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="talentLevelCat" name="talentLevelCat">
                                 </select>
@@ -47,8 +47,8 @@
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="isSalary" name="isSalary">
                                     <option value="">请选择</option>
-                                    <option value="1">申报中显示字段</option>
-                                    <option value="2">申报中隐藏字段</option>
+                                    <option value="1">申报中需填写年薪</option>
+                                    <option value="2">不需填写年薪</option>
                                 </select>
                             </div>
                             <label class="col-sm-2 control-label spacing">启用状态</label>

+ 3 - 3
app/admin/view/talent_condition/edit.html

@@ -31,7 +31,7 @@
                             </div>
                         </div>
                         <div class="rowGroup">
-                            <label class="col-sm-2 control-label spacing">层次分级</label>
+                            <label class="col-sm-2 control-label spacing">人才条款</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="talentLevelCat" name="talentLevelCat" selectVal="{$info.talentLevelCat}">
                                 </select>
@@ -46,8 +46,8 @@
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="isSalary" name="isSalary" selectVal="{$info.isSalary}">
                                     <option value="">请选择</option>
-                                    <option value="1">申报中显示字段</option>
-                                    <option value="2">申报中隐藏字段</option>
+                                    <option value="1">申报中需填写年薪</option>
+                                    <option value="2">不需填写年薪</option>
                                 </select>
                             </div>
                             <label class="col-sm-2 control-label spacing">启用状态</label>

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

@@ -76,7 +76,10 @@ class VerifyApi {
                 $info["highestDegreeName"] = DictApi::selectByParentCode("highest_degree")[$info["highest_degree"]];
             }
             if ($info["talent_condition"]) {
-                $info["talentConditionName"] = \app\common\model\TalentCondition::findOrEmpty($info["talent_condition"])["name"];
+                $talent_condition = \app\common\model\TalentCondition::findOrEmpty($info["talent_condition"]);
+                $info["talentConditionName"] = $talent_condition["name"];
+                $info["talent_arrange_category"] = $talent_condition["talentLevelCat"];
+                $info["talentArrangeCatName"] = DictApi::selectByParentCode("talent_condition_cats")[$talent_condition["talentLevelCat"]];
             }
         }
         return $info;

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

@@ -63,6 +63,8 @@ class Api extends BaseController {
             return json(["rows" => null]);
 
         $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
+        $whr[] = ["active", "=", 1];
+        $whr[] = ["delete", "=", 0];
         $rows = Db::table("new_common_filetype")->where($whr)->order("sn " . $order)->select()->toArray();
         if ($id) {
             foreach ($rows as $key => $row) {
@@ -76,7 +78,7 @@ class Api extends BaseController {
                 $rows[$key]["files"] = $files;
             }
         }
-        return json(["rows" => $rows]);
+        return json(["rows" => $rows, "info" => $condition_info]);
     }
 
     public function getCheckLog() {
@@ -188,6 +190,8 @@ class Api extends BaseController {
             $where[] = ["isConditionFile", "<>", 1]; //排除人才条件上传文件
         }
         $where[] = ["project", "=", $project];
+        $where[] = ["active", "=", 1];
+        $where[] = ["delete", "=", 0];
         $where[] = ["type", "=", $type];
         if ($talent_condition) {
             $condition_info = Db::table("new_talent_condition")->findOrEmpty($talent_condition);
@@ -424,6 +428,7 @@ class Api extends BaseController {
         $where[] = ["type", "=", $type];
         $where[] = ["project", "=", $declare_type];
         $where[] = ["active", "=", $active];
+        $where[] = ["delete", "=", 0];
         $where[] = ["isConditionFile", "=", 1];
         $list = Db::table("new_common_filetype")->where($where)->order("sn " . $order)->select()->toArray();
         return json($list);

+ 4 - 0
app/enterprise/controller/Base.php

@@ -165,6 +165,8 @@ class Base extends EnterpriseController {
             $where[] = ["project", "=", 1];
             $where[] = ["type", "=", $this->user["type"]];
             $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
             $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
 
 
@@ -301,6 +303,8 @@ class Base extends EnterpriseController {
             $where[] = ["project", "=", 1];
             $where[] = ["type", "=", $this->user["type"]];
             $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
             $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
 
             $ft_ids = [];

+ 51 - 3
app/enterprise/controller/Talent.php

@@ -61,6 +61,19 @@ class Talent extends EnterpriseController {
             $no_empty = ["talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "bank", "bank_number", "bank_branch_name",
                 "bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"];
 
+            $where = [];
+            $where[] = ["rel", "=", "study_abroad"];
+            $where[] = ["step", "=", 2];
+            $where[] = ["project", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["isConditionFile", "<>", 1];
+            $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
+            $abroad_file_ids = null;
+            if ($abroad_files)
+                $abroad_file_ids = array_column($abroad_files, "id");
+
             if ($data["study_abroad"] == 1) {
                 $no_empty[] = "abroad_school";
                 $no_empty[] = "abroad_major";
@@ -81,6 +94,12 @@ class Talent extends EnterpriseController {
                     $no_empty[] = "source_county";
                 }
             }
+
+            $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
+
+            if ($condition_info["isSalary"] == 1) {
+                $no_empty[] = "annual_salary";
+            }
             $no_empty = array_filter($no_empty);
             $return = [];
             foreach ($no_empty as $key) {
@@ -115,8 +134,6 @@ class Talent extends EnterpriseController {
                 exit;
             }
 
-            $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
-
             if ($condition_info["bindFileTypes"]) {
                 $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
                 $whr[] = ["must", "=", 1];
@@ -126,6 +143,8 @@ class Talent extends EnterpriseController {
             $where[] = ["project", "=", 1];
             $where[] = ["type", "=", $this->user["type"]];
             $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
             $where[] = ["isConditionFile", "<>", 1];
             if ($whr) {
                 $filetypes = Db::table("new_common_filetype")->where([$where, $whr])->select()->toArray();
@@ -133,6 +152,13 @@ class Talent extends EnterpriseController {
                 $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
             }
             $ft_ids = array_column($filetypes, "id");
+            if ($data["study_abroad"] == 1) {
+                //选中留学,如果存在留学附件变成必传
+                $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
+            } else {
+                //没选中,留学附件就算设成必传也不用验证
+                $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
+            }
             $whr = [];
             $whr[] = ["typeId", "in", $ft_ids];
             $whr[] = ["mainId", "=", $id];
@@ -140,7 +166,6 @@ class Talent extends EnterpriseController {
             $upload_type_counts = count($distinct_filetypes);
 
             if ($upload_type_counts != count($ft_ids)) {
-                $test = count($ft_ids);
                 $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
                 exit;
@@ -193,11 +218,27 @@ class Talent extends EnterpriseController {
                 $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
                 $whr[] = ["must", "=", 1];
             }
+
+            $where = [];
+            $where[] = ["rel", "=", "study_abroad"];
+            $where[] = ["step", "=", 2];
+            $where[] = ["project", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $where[] = ["type", "=", $this->user["type"]];
+            $where[] = ["isConditionFile", "<>", 1];
+            $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
+            $abroad_file_ids = null;
+            if ($abroad_files)
+                $abroad_file_ids = array_column($abroad_files, "id");
+
             $where = [];
             $where[] = ["step", "=", 2];
             $where[] = ["project", "=", 1];
             $where[] = ["type", "=", $this->user["type"]];
             $where[] = ["must", "=", 1];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
             $where[] = ["isConditionFile", "<>", 1];
             if ($whr) {
                 $filetypes = Db::table("new_common_filetype")->where([$where, $whr])->select()->toArray();
@@ -205,6 +246,13 @@ class Talent extends EnterpriseController {
                 $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
             }
             $ft_ids = array_column($filetypes, "id");
+            if ($info["study_abroad"] == 1) {
+                //选中留学,如果存在留学附件变成必传
+                $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
+            } else {
+                //没选中,留学附件就算设成必传也不用验证
+                $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
+            }
             $whr = [];
             $whr[] = ["typeId", "in", $ft_ids];
             $whr[] = ["mainId", "=", $id];

+ 12 - 6
app/enterprise/view/talent/second.html

@@ -157,13 +157,13 @@
                                         <td>
                                             <div class="rowGroup">
                                                 <label class="control-label spacing td-label"><span style="color: red">*</span>单位标签</label>
-                                                <input type="text" class="form-control" value="{$row.enterpriseTagName}"  readonly disabled id="enterprise_tag"/>
+                                                <div class="form-control" style="border: none">{$row.enterpriseTagName}</div>
                                             </div>
                                         </td>
                                         <td>
                                             <div class="rowGroup">
                                                 <label class=" control-label spacing td-label"><span style="color: red">*</span>单位名称</label>
-                                                <input type="text" class="form-control" value="{$row.enterpriseName}"  readonly disabled id="enterprise"/>
+                                                <div class="form-control" style="border: none">{$row.enterpriseName}</div>
                                             </div>
                                         </td>
                                         <td rowspan="4" style="width: 200%">
@@ -174,13 +174,13 @@
                                         <td>
                                             <div class="rowGroup">
                                                 <label class=" control-label spacing td-label"><span style="color: red">*</span>所属街道</label>
-                                                <input type="text" class="form-control" value="{$row.streetName}"  readonly disabled id="street"/>
+                                                <div class="form-control" style="border: none">{$row.streetName}</div>
                                             </div>
                                         </td>
                                         <td>
                                             <div class="rowGroup">
                                                 <label class=" control-label spacing td-label"><span style="color: red">*</span>产业领域</label>
-                                                <input type="text" class="form-control" value="{$row.industryFieldName}" readonly disabled id="industry_field">
+                                                <div class="form-control" style="border: none">{$row.industryFieldName}</div>
                                             </div>
                                         </td>
                                     </tr>
@@ -368,7 +368,8 @@
                                     </tr>
                                 </table>
                                 <div class="row">
-                                    <div class="rowGroup col-sm-6">
+                                    <div class="col-sm-10">
+                                    <div class="rowGroup col-sm-3">
                                         <label class="control-label spacing"><span style="color: red">*</span>申报来源</label>
                                         <select class="form-control" id="source" name="source" onchange="TalentInfoInfoDlg.sourceChange()" value="{$row.source}">
                                         </select>
@@ -411,13 +412,18 @@
                                         <select class="form-control" id="talent_arrange" name="talent_arrange" onchange="TalentInfoInfoDlg.getLayerCatdByLayer()" value="{$row.talent_arrange}"></select>
                                     </div>
                                     <div class="rowGroup col-sm-3">
-                                        <label class="control-label spacing"><span style="color: red">*</span>层次分级</label>
+                                        <label class="control-label spacing"><span style="color: red">*</span>人才条款</label>
                                         <select class="form-control" id="talent_arrange_category" name="talent_arrange_category" onchange="TalentInfoInfoDlg.getIdentifyCondition()" value="{$row.talent_arrange_category}"></select>
                                     </div>
                                     <div class="rowGroup col-sm-3">
                                         <label class="control-label spacing"><span style="color: red">*</span>认定条件</label>
                                         <select class="chosen" id="talent_condition" name="talent_condition" onchange="TalentInfoInfoDlg.getIdentifyNeedsFileTypes()" value="{$row.talent_condition}"></select>
                                     </div>
+                                    <div class="rowGroup col-sm-3" {if condition='!$row["annual_salary"]'}style="display:none;"{/if}>
+                                        <label class="control-label spacing"><span style="color: red">*</span>年薪</label>
+                                        <input type="text" class="form-control" id="annual_salary" name="annual_salary" value="{$row.annual_salary}"/>
+                                    </div>
+                                    </div>
                                 </div>
                                 <div class="row" style="margin-top:20px;padding:10px 25px;">
                                     上传附件:

+ 10 - 0
app/enterprise/view/talent/view.html

@@ -328,12 +328,22 @@
                                                             <option value="">{$row.talentArrangeName}</option>
                                                         </select>
                                                     </div>
+                                                    <div class="rowGroup col-sm-3">
+                                                        <label class="control-label spacing"><span style="color: red">*</span>人才条款</label>
+                                                        <select class="form-control" id="talent_arrange_category" name="talent_arrange_category">
+                                                            <option value="">{$row.talentArrangeCatName}</option>
+                                                        </select>
+                                                    </div>
                                                     <div class="rowGroup col-sm-3">
                                                         <label class="control-label spacing"><span style="color: red">*</span>认定条件</label>
                                                         <select class="form-control" >
                                                             <option value="">{$row.talentConditionName}</option>
                                                         </select>
                                                     </div>
+                                                    <div class="rowGroup col-sm-3" {if condition='!$row["annual_salary"]'}style="display:none;"{/if}>
+                                                        <label class="control-label spacing"><span style="color: red">*</span>年薪</label>
+                                                        <input type="text" class="form-control" id="annual_salary" value="{$row.annual_salary}"/>
+                                                    </div>
                                                 </div>
                                             </div>                    
                                             <div class="row" style="margin-top:20px;padding:10px 25px;">

+ 46 - 5
public/static/modular/gate/talentInfo/talentInfo_info.js

@@ -336,7 +336,7 @@ TalentInfoInfoDlg.initFileTable = function () {
                             } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                                 imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                             } else {
-                                imgStr = '<img class=\"imgUrl\"  src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
+                                imgStr = '<img class=\"imgUrl\" onclick=\"Feng.showImg(this)\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
                             }
 
                             html += '<li data-id="' + files[key].id + '">\n\
@@ -362,7 +362,6 @@ TalentInfoInfoDlg.initFileTable = function () {
                 },
             });
         }
-        //$(".ibox-content").viewer({fullscreen: false});
     }, function (data) {
         Feng.error("查询失败!" + data.responseJSON.message + "!");
     });
@@ -425,6 +424,11 @@ TalentInfoInfoDlg.infoCallback = function (data) {
 }
 
 TalentInfoInfoDlg.getLayerCatdByLayer = function () {
+    $("#talent_condition").parents(".row").next(".row").find(".fileTable").find("tbody").html("");
+    $("#talent_condition").html("<option>---请选择---</option>");
+    $("#annual_salary").parents(".rowGroup").css("display", "none");
+    $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
+
     var level = $("#talent_arrange").val();
     Feng.addAjaxSelect({
         "id": "talent_arrange_category",
@@ -433,7 +437,6 @@ TalentInfoInfoDlg.getLayerCatdByLayer = function () {
         "type": "GET",
         "url": Feng.ctxPath + "/common/api/getLayerCatsByLayer/level/" + level
     });
-    $("#talent_condition").html("<option>---请选择---</option>");
     $("#talent_condition").trigger("chosen:updated");
 }
 
@@ -441,6 +444,9 @@ TalentInfoInfoDlg.getLayerCatdByLayer = function () {
  * 获取人才认定
  */
 TalentInfoInfoDlg.getIdentifyCondition = function () {
+    $("#talent_condition").parents(".row").next(".row").find(".fileTable").find("tbody").html("");
+    $("#annual_salary").parents(".rowGroup").css("display", "none");
+    $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
     var level = $("#talent_arrange").val();
     var cat = $("#talent_arrange_category").val();
     var id = $('#id').val();
@@ -457,6 +463,22 @@ TalentInfoInfoDlg.getIdentifyCondition = function () {
 
 TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
     var ajax = new $ax("/common/api/getTalentCondtionUploadFile", function (data) {
+        if (data.info.isSalary == 1) {
+            $("#annual_salary").parents(".rowGroup").css("display", "block");
+            $('#talentInfoForm').bootstrapValidator('addField', "annual_salary", {validators: {
+                    notEmpty: {message: '年薪不能放空'},
+                    callback: {
+                        message: "年薪只能填写数字",
+                        callback: function (value, validator) {
+                            if (!isNaN(value) && isFinite(value)) {
+                                return true;
+                            }
+                            return false;
+                        }
+                    }
+                }
+            });
+        }
         if (data == null || data.length == 0) {
             return;
         }
@@ -494,7 +516,7 @@ TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
                 } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                     imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + file.url + "','" + file.id + "','" + file.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                 } else {
-                    imgStr = '<img class=\"imgUrl\"  src=\"' + file.url + '\" style=\"width:25px;height:25px;\">';
+                    imgStr = '<img class=\"imgUrl\"  onclick=\"Feng.showImg(this)\" src=\"' + file.url + '\" style=\"width:25px;height:25px;\">';
                 }
 
                 html += '<li data-id="' + file.id + '">\n\
@@ -535,11 +557,13 @@ TalentInfoInfoDlg.changeStudyAbroad = function () {
         $("#abroad_major").parent().css("display", "block");
         $('#talentInfoForm').bootstrapValidator('addField', "abroad_school", {validators: {notEmpty: {message: '留学毕业院校不能为空'}}});
         $('#talentInfoForm').bootstrapValidator('addField', "abroad_major", {validators: {notEmpty: {message: '留学专业不能为空'}}});
+        $("[data-rel='study_abroad']").find("i.fa-paste").after('<span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span>');
     } else {
         $("#abroad_school").val("").parent().css("display", "none");
         $("#abroad_major").val("").parent().css("display", "none");
         $('#talentInfoForm').bootstrapValidator('removeField', "abroad_school");
         $('#talentInfoForm').bootstrapValidator('removeField', "abroad_major");
+        $("[data-rel='study_abroad']").find("i.fa-paste").next("span").remove();
     }
 }
 
@@ -984,7 +1008,8 @@ $(function () {
     $("#city").val($("#city").attr("value"));
     $("#county").val($("#county").attr("value"));
     $("#talent_arrange").val($("#talent_arrange").attr("value"));
-    //TalentInfoInfoDlg.getLayerCatdByLayer();
+    TalentInfoInfoDlg.getLayerCatdByLayer();
+    $("#talent_arrange_category").val($("#talent_arrange_category").attr("value"));
     TalentInfoInfoDlg.getIdentifyCondition();
     $("#politics").val($("#politics").attr("value"));
     TalentInfoInfoDlg.validId();
@@ -1011,6 +1036,22 @@ $(function () {
         enable_split_word_search: true,
         rtl: true
     });
+    if ($("#annual_salary").val() != "") {
+            $("#annual_salary").parents(".rowGroup").css("display", "block");
+            $('#talentInfoForm').bootstrapValidator('addField', "annual_salary", {validators: {
+                    notEmpty: {message: '年薪不能放空'},
+                    callback: {
+                        message: "年薪只能填写数字",
+                        callback: function (value, validator) {
+                            if (!isNaN(value) && isFinite(value)) {
+                                return true;
+                            }
+                            return false;
+                        }
+                    }
+                }
+            });
+        }
     TalentInfoInfoDlg.initFileTable();
 });