浏览代码

来源联动人才条款

sugangqiang 2 年之前
父节点
当前提交
d73305b245
共有 1 个文件被更改,包括 41 次插入5 次删除
  1. 41 5
      public/static/modular/gate/talentInfo/new_talentInfo_info.js

+ 41 - 5
public/static/modular/gate/talentInfo/new_talentInfo_info.js

@@ -448,6 +448,12 @@ TalentInfoInfoDlg.infoCallback = function (data) {
 }
 TalentInfoInfoDlg.isSalary = false;
 TalentInfoInfoDlg.getLayerCatdByLayer = function () {
+    var source = $("#source").val();
+    if (source == "" || typeof source == "undefined") {
+        layer.alert("请先选择申报来源");
+        $("#talent_arrange").val("");
+        return;
+    }
     $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
     $("#talent_condition").html("<option>---请选择---</option>");
 
@@ -461,6 +467,27 @@ TalentInfoInfoDlg.getLayerCatdByLayer = function () {
         "type": "GET",
         "url": Feng.ctxPath + "/common/api/getLayerCatsByLayer/level/" + level
     });
+    var layerFilter = function () {
+        let allowedCats = [];
+        switch (source) {
+            case "1":
+            case "3":
+                allowedCats = ["A+", "A", "B", "C"];
+                break;
+            case "2":
+            case "4":
+                allowedCats = ["A1", "B1", "C1", "D1", "E1"];
+                break;
+            case "5":
+                allowedCats = ["A2", "B2", "C2", "D2", "E2", "F", "G"];
+                break;
+        }
+        for (var i = 0; i < $("#talent_arrange_category option").length; i++) {
+            if (allowedCats.indexOf($("#talent_arrange_category option").eq(i).val()) == -1) {
+                $("#talent_arrange_category option").eq(i).css("display", "none");
+            }
+        }
+    }();
     $("#talent_condition").trigger("chosen:updated");
 
     TalentInfoInfoDlg.displaySalary();
@@ -853,11 +880,20 @@ TalentInfoInfoDlg.sourceChange = function () {
         });
         $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
     }
-    if (source != 5) {
-        $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
-    } else {
-        TalentInfoInfoDlg.ajaxGetConditionFile(source);
-    }
+
+    $("#talent_arrange").val("");
+    $("#talent_arrange_category").html("<option>---请选择---</option>");
+    $("#talent_condition").html("<option>---请选择---</option>");
+    $("#talent_condition").trigger('chosen:updated');
+    $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
+    TalentInfoInfoDlg.isSalary = false;
+    $("#annual_salary").parents("td").css("display", "none");
+
+    /*if (source != 5) {
+     $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
+     } else {
+     TalentInfoInfoDlg.ajaxGetConditionFile(source);
+     }*/
     //$("#source").parents("td").attr("colspan", columns);
     //$("#talent_arrange").parents("td").attr("colspan", columns);
     //$("#talent_condition").parents("td").attr("colspan", columns - 1);