sugangqiang 2 年之前
父節點
當前提交
6e342600d8

+ 17 - 2
app/admin/controller/TalentCondition.php

@@ -71,6 +71,8 @@ class TalentCondition extends AdminController {
             return json(["msg" => "请选择人才类别"]);
         if (!$params["talentLevel"] || !in_array($params["talentLevel"], [1, 2, 3, 4, 5, 6, 7]))
             return json(["msg" => "请选择人才层次"]);
+        if (!$params["talentLevelCat"])
+            return json(["msg" => "请选择层次分级"]);
         if (!$params["name"])
             return json(["msg" => "请填写名称"]);
         if (!$params["companyIds"]) {
@@ -79,6 +81,11 @@ class TalentCondition extends AdminController {
         if (!$params["bindFileTypes"]) {
             return json(["msg" => "没有设置审核附件"]);
         }
+
+        $companyIds = array_filter(explode(",", $params["companyIds"]));
+        $_total = count($companyIds);
+        $_tmp = [];
+
         $bindFileTypes = array_filter(explode(",", $params["bindFileTypes"]));
         $total = count($bindFileTypes);
         $tmp = [];
@@ -88,9 +95,17 @@ class TalentCondition extends AdminController {
                 if (in_array($_relations[$i], $bindFileTypes))
                     $tmp[] = $_relations[$i];
             }
+            if (in_array($_companyId, $companyIds))
+                $_tmp[] = $_companyId;
+        }
+        $_valid_count = count(array_unique($_tmp));
+        if ($_valid_count != $_total) {
+            return json(["msg" => "存在审核单位没有成功关联附件"]);
         }
-        $_valid_count = count(array_unique($tmp));
-        if ($_valid_count != $total) {
+
+
+        $valid_count = count(array_unique($tmp));
+        if ($valid_count != $total) {
             return json(["msg" => "选择了审核单位及审核附件后,每个附件必须与其中一个审核单位关联"]);
         }
         return true;

+ 15 - 0
app/admin/view/talent_condition/add.html

@@ -32,10 +32,25 @@
                             </div>
                         </div>
                         <div class="rowGroup">
+                            <label class="col-sm-2 control-label spacing">层次分级</label>
+                            <div class="col-sm-4 spacing">
+                                <select class="form-control" id="talentLevelCat" name="talentLevelCat">
+                                </select>
+                            </div>
                             <label class="col-sm-2 control-label spacing">名称</label>
                             <div class="col-sm-4 spacing">
                                 <input class="form-control" id="name" name="name">
                             </div>
+                        </div>
+                        <div class="rowGroup">
+                            <label class="col-sm-2 control-label spacing">年薪</label>
+                            <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>
+                                </select>
+                            </div>
                             <label class="col-sm-2 control-label spacing">启用状态</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="active" name="active">

+ 17 - 2
app/admin/view/talent_condition/edit.html

@@ -16,7 +16,7 @@
                         <input id="id" name="id" value="{$info.id}" type="hidden"/>
                         <input id="companyWithFileType" value="{$info.companyWithFileType}" type="hidden"/>
                         <div class="rowGroup">
-                            <label class="col-sm-2 control-label spacing" onchange="IdentifyConditionInfoDlg.onTypeChange();">人才类别</label>
+                            <label class="col-sm-2 control-label spacing">人才类别</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="type" name="type" selectVal="{$info.type}" onchange="IdentifyConditionInfoDlg.onTypeChange();">
                                     <option value="">请选择</option>
@@ -26,15 +26,30 @@
                             </div>
                             <label class="col-sm-2 control-label spacing">人才层次</label>
                             <div class="col-sm-4 spacing">
-                                <select class="form-control" id="talentLevel" name="talentLevel" selectVal="{$info.talentLevel}">
+                                <select class="form-control" id="talentLevel" name="talentLevel" selectVal="{$info.talentLevel}" onchange="IdentifyConditionInfoDlg.onLayerChange();">
                                 </select>
                             </div>
                         </div>
                         <div class="rowGroup">
+                            <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>
+                            </div>
                             <label class="col-sm-2 control-label spacing">名称</label>
                             <div class="col-sm-4 spacing">
                                 <input class="form-control" id="name" name="name" value="{$info.name}">
                             </div>
+                        </div>                        
+                        <div class="rowGroup">
+                            <label class="col-sm-2 control-label spacing">年薪</label>
+                            <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>
+                                </select>
+                            </div>
                             <label class="col-sm-2 control-label spacing">启用状态</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="active" name="active" selectVal="{$info.active}">

+ 16 - 2
app/common/api/DictApi.php

@@ -41,7 +41,7 @@ class DictApi {
         if (self::isExistByCode($data["code"], $params["dictId"]))
             return ["msg" => sprintf("编码[%s]已经存在", $data["code"])];
         $items = array_filter(explode(";", $values));
-        $id = Dict::table('sys_dict')->save($data);
+        Dict::update($data);
         //删除原来的子项
         Dict::where(["pid" => $params["dictId"]])->delete();
         $childs = [];
@@ -155,9 +155,9 @@ class DictApi {
             "county" => "籍贯县",
             "nation" => "民族",
             "politics" => "政治面貌",
+            "fst_work_time" => "来晋工作时间",
             "experience" => "工作简历",
             "education" => "教育背景",
-            "fst_work_time" => "首次来晋工作时间",
         ];
         $dict2 = [
             "talent_arrange" => "人才层次",
@@ -373,4 +373,18 @@ class DictApi {
         return false;
     }
 
+    public static function getLayerCatsByLayer($lv) {
+        $kv = [1 => "A", 2 => "B", 3 => "C", 4 => "D", 5 => "E", 6 => "F", 7 => "G"];
+        $chr = $kv[$lv];
+        if ($chr) {
+            $parent_info = Dict::where('code', "talent_condition_cats")->findOrEmpty();
+            $where[] = ["pid", "=", $parent_info["id"]];
+            if ($parent_info) {
+                $where[] = ["code", "like", $chr . "%"];
+                return Dict::where($where)->select()->toArray();
+            }
+        }
+        return false;
+    }
+
 }

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

@@ -11,7 +11,8 @@ use app\common\model\TalentCondition;
  */
 class TalentConditionApi {
 
-    public static function getList($lv, $type) {
+    public static function getList($lv, $type, $cat) {
+        $where[] = ["talentLevelCat", "=", $cat];
         $where[] = ["talentLevel", "=", $lv];
         $where[] = ["type", "=", $type];
         $where[] = ["active", "=", 1];
@@ -26,10 +27,12 @@ class TalentConditionApi {
     public static function edit($params) {
         $data["type"] = $params["type"];
         $data["talentLevel"] = $params["talentLevel"];
+        $data["talentLevelCat"] = $params["talentLevelCat"];
         $data["companyIds"] = $params["companyIds"];
         $data["bindFileTypes"] = $params["bindFileTypes"];
         $data["name"] = $params["name"];
         $data["active"] = $params["active"];
+        $data["isSalary"] = $params["isSalary"];
         $relation = [];
         foreach ($params["relation"] as $_companyId => $_relation) {
             $relation[] = $_companyId . ":" . $_relation;

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

@@ -45,7 +45,7 @@ class Api extends BaseController {
             $enterprise = \app\common\model\Enterprise::findOrEmpty($talentInfo["enterprise_id"]);
             $type = $enterprise["type"];
         }
-        $list = TalentConditionApi::getList($params["level"], $type);
+        $list = TalentConditionApi::getList($params["level"], $type, $params["cat"]);
         return json($list, 200);
     }
 
@@ -407,6 +407,11 @@ class Api extends BaseController {
         return json($companys);
     }
 
+    public function getLayerCatsByLayer() {
+        $lv = $this->request->param("level");
+        return json(DictApi::getLayerCatsByLayer($lv));
+    }
+
     /**
      * 通过人才类别查找人才认定第二步骤支持的所有文件类型
      * 默认人才认定第二步骤,当前只有人才认定分了两步,所以此方法目前默认参数高度匹配人才认定第二阶段附件的查找

+ 4 - 4
app/enterprise/view/base/first.html

@@ -99,7 +99,7 @@
                                                         请上传近期免冠半身彩照(两寸)
                                                     </p>
                                                     <img id="photoImg" {if condition="$row['headimgurl']"} src="/storage/{$row.headimgurl}" {else/} src="/static/img/photo.png" {/if} onclick="$('#photo').click();" style="height:147px;width:105px;margin:0 auto;display:block;">
-                                                    <hr />
+                                                         <hr />
                                                     附件:
                                                     <table class="fileTable"></table>
                                                 </td>
@@ -266,7 +266,7 @@
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>{if condition="$row['talent_type'] eq 1"}近三年{else/}首次{/if}来晋工作时间</label>
-                                                        <input type="text" class="form-control date" id="fst_work_time" value="{$row.fst_work_time}"/>
+                                                        <input type="text" class="form-control date" id="fst_work_time" name="fst_work_time" value="{$row.fst_work_time}"/>
                                                     </div>
                                                 </td>
                                             </tr>
@@ -283,13 +283,13 @@
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>工作简历</label>
-                                                        <textarea class="form-control" style="border: none" placeholder="填写工作简历">{$row.experience}</textarea>
+                                                        <textarea class="form-control" id="experience" name="experience" style="border: none" placeholder="填写工作简历">{$row.experience}</textarea>
                                                     </div>
                                                 </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>教育背景</label>
-                                                        <textarea class="form-control" style="border: none" placeholder="填写教育背景">{$row.education}</textarea>
+                                                        <textarea class="form-control" id="education" name="education" style="border: none" placeholder="填写教育背景">{$row.education}</textarea>
                                                     </div>
                                                 </td>
                                             </tr>

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

@@ -300,7 +300,7 @@
                                         </td>
                                     </tr>
                                 </table>
-                                <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">                                    
+                                <table style="width: 100%;border-collapse: collapse;border:1px solid #ddd;border-left:none;border-right:none;" class="table table-bordered">                                    
                                     <tr>
                                         <td>
                                             <div class="rowGroup">
@@ -408,7 +408,11 @@
                                     </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" name="talent_arrange" onchange="TalentInfoInfoDlg.getIdentifyCondition()" value="{$row.talent_arrange}"></select>
+                                        <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>
+                                        <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>

+ 18 - 4
public/static/modular/gate/talentInfo/talentInfo_info.js

@@ -246,7 +246,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if (row.must == 2) {
                     str = str + '<i class="fa fa-paste"></i>' + value;
                 }
-                str = str + '<br /><span id="desc_'+row.rel+'">' + row.description + '</span></div>'
+                str = str + '<br /><span id="desc_' + row.rel + '">' + row.description + '</span></div>'
                 return str;
             }
         },
@@ -280,9 +280,9 @@ TalentInfoInfoDlg.initFileTable = function () {
         for (var k in data["rows"]) {
             var rel = data["rows"][k].rel;
             if ($("#" + rel).length > 0) {
-                if($("#" + rel).parents(".table").length > 0){
+                if ($("#" + rel).parents(".table").length > 0) {
                     var tableIndex = $("#" + rel).parents(".table").find("table.fileTable").index(".fileTable");
-                }else{
+                } else {
                     var tableIndex = $("#" + rel).parents(".row").next(".row").find("table.fileTable").index(".fileTable");
                 }
                 data["rows"][k].tableIndex = tableIndex;
@@ -424,19 +424,32 @@ TalentInfoInfoDlg.infoCallback = function (data) {
     }
 }
 
+TalentInfoInfoDlg.getLayerCatdByLayer = function () {
+    var level = $("#talent_arrange").val();
+    Feng.addAjaxSelect({
+        "id": "talent_arrange_category",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/api/getLayerCatsByLayer/level/" + level
+    });
+    $("#talent_condition").html("<option>---请选择---</option>");
+    $("#talent_condition").trigger("chosen:updated");
+}
 
 /**
  * 获取人才认定
  */
 TalentInfoInfoDlg.getIdentifyCondition = function () {
     var level = $("#talent_arrange").val();
+    var cat = $("#talent_arrange_category").val();
     var id = $('#id').val();
     Feng.addAjaxSelect({
         "id": "talent_condition",
         "displayCode": "id",
         "displayName": "name",
         "type": "GET",
-        "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level + "/id/" + id
+        "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level + "/cat/" + cat + "/id/" + id
     });
     $("#talent_condition").trigger('chosen:updated');
 }
@@ -971,6 +984,7 @@ $(function () {
     $("#city").val($("#city").attr("value"));
     $("#county").val($("#county").attr("value"));
     $("#talent_arrange").val($("#talent_arrange").attr("value"));
+    //TalentInfoInfoDlg.getLayerCatdByLayer();
     TalentInfoInfoDlg.getIdentifyCondition();
     $("#politics").val($("#politics").attr("value"));
     TalentInfoInfoDlg.validId();

+ 49 - 13
public/static/modular/talentIdentify/identifyCondition/identifyCondition_info.js

@@ -78,9 +78,11 @@ IdentifyConditionInfoDlg.collectData = function () {
             .set('id')
             .set('type')
             .set('talentLevel')
+            .set('talentLevelCat')
             .set('name')
             .set('active')
-            .set('description');
+            .set('description')
+            .set('isSalary');
     var companys = $("#companyIds").val();
     var bindFileTypes = $("#bindFileTypes").val();
     var company_ids = "", bind_fts_ids = "";
@@ -117,18 +119,37 @@ IdentifyConditionInfoDlg.collectData = function () {
 }
 
 IdentifyConditionInfoDlg.otherValid = function () {
-    if (this.identifyConditionInfoData.companyIds != '' && this.identifyConditionInfoData.bindFileTypes != '') {
-        var fileTypes = this.identifyConditionInfoData.bindFileTypes.split(",");
-        var total = fileTypes.length;
-        var _goal = 0;
-        for (var i = 0; i < total; i++) {
-            var typeId = fileTypes[i];
-            _goal += $("input[type=checkbox][value='" + typeId + "']:checked").length > 0 ? 1 : 0;
-        }
-        if (_goal != total) {
-            Feng.error("选择了审核单位及审核附件后,每个附件必须与其中一个审核单位关联");
-            return false;
-        }
+    if (this.identifyConditionInfoData.companyIds == '') {
+        Feng.error("请选择审核单位");
+        return false;
+    }
+    if (this.identifyConditionInfoData.bindFileTypes == '') {
+        Feng.error("请选择审核附件");
+        return false;
+    }
+
+    var companyIds = this.identifyConditionInfoData.companyIds.split(",");
+    var total = companyIds.length;
+    var _goal = 0;
+    for (var i = 0; i < total; i++) {
+        var companyId = companyIds[i];
+        _goal += $("input[type=checkbox][data-company-id='" + companyId + "']:checked").length > 0 ? 1 : 0;
+    }
+    if (_goal != total) {
+        Feng.error("存在审核单位没有成功关联附件");
+        return false;
+    }
+
+    var fileTypes = this.identifyConditionInfoData.bindFileTypes.split(",");
+    total = fileTypes.length;
+    _goal = 0;
+    for (var i = 0; i < total; i++) {
+        var typeId = fileTypes[i];
+        _goal += $("input[type=checkbox][value='" + typeId + "']:checked").length > 0 ? 1 : 0;
+    }
+    if (_goal != total) {
+        Feng.error("选择了审核单位及审核附件后,每个附件必须与其中一个审核单位关联");
+        return false;
     }
     return true;
 }
@@ -192,6 +213,16 @@ IdentifyConditionInfoDlg.onTypeChange = function () {
     });
     $("#bindFileTypes").trigger("chosen:updated");
 }
+IdentifyConditionInfoDlg.onLayerChange = function () {
+    var lv = $("#talentLevel").val();
+    Feng.addAjaxSelect({
+        "id": "talentLevelCat",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/api/getLayerCatsByLayer/level/" + lv
+    });
+}
 
 IdentifyConditionInfoDlg.onCompanyOrTypeChange = function () {
     var companyIds = $("#companyIds").val();
@@ -309,6 +340,11 @@ $(function () {
     $("select").each(function () {
         $(this).val($(this).attr("selectVal"));
     });
+    var lv = $("#talentLevel").val();
+    if (lv > 0) {
+        IdentifyConditionInfoDlg.onLayerChange();
+        $("#talentLevelCat").val($("#talentLevelCat").attr("selectVal"));
+    }
     var companyIds = $("#companyIds").attr("selectVal");
     if (Feng.isNotEmptyStr(companyIds)) {
         $("#companyIds").val(companyIds.split(",")).trigger("chosen:updated");