Browse Source

直认企业端js及样式修改

sugangqiang 2 years ago
parent
commit
41bff1fafd

+ 9 - 2
app/enterprise/view/talent/apply.html

@@ -46,6 +46,11 @@
         word-wrap:break-word;
         word-break:break-all;
     }
+    .word-wrap-no-width{
+        white-space:normal;
+        word-wrap:break-word;
+        word-break:break-all;
+    }
     ul{
         padding: 0;
     }
@@ -63,6 +68,7 @@
         border-left:1px solid #ddd;
     }
     #annual_salary{padding-right:32px;}
+    .zhiren{background-image:linear-gradient(#1f0077,#af68ea);color:#fff;}
 </style>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
@@ -493,8 +499,9 @@
                                             <tr>
                                                 <td colspan="4">
                                                     {if condition="$row['isImport']"}
-                                                    <div class="rowGroup col-sm-3">
-                                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>是否符合直认条件</label>                                                        
+                                                    <div class="rowGroup col-sm-3 zhiren word-wrap-no-width">
+                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>是否符合直认条件</label>
+                                                        人才直认选项
                                                         <input type="radio" name="isMatchZhiren" value="1" {eq name="row.isMatchZhiren" value="1"}checked{/eq} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>是&nbsp;&nbsp;
                                                         <input type="radio" name="isMatchZhiren" value="0" {if condition="!$row['isMatchZhiren']"}checked{/if} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>否
                                                     </div>

+ 46 - 23
public/static/modular/gate/talentInfo/new_talentInfo_info.js

@@ -304,9 +304,7 @@ TalentInfoInfoDlg.initFileTable = function () {
                 }
             } else {
                 if (data["rows"][k].isConditionFile) {
-                    var isMatchZhiren = $("input[name=isMatchZhiren]").length > 0 ? parseInt($("input[name=isMatchZhiren]:checked").val()) : false;
-                    var isImport = parseInt($("#import").val());
-                    if (isImport == 1 && isMatchZhiren)
+                    if (TalentInfoInfoDlg.isImport() && TalentInfoInfoDlg.isZhiRen())
                         continue;
                     var tableIndex = 0;
                     if ($("#talent_condition").parents(".table").length > 0) {
@@ -471,9 +469,7 @@ TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
     $("#annual_salary").parents("td").css("display", "none");
     $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
 
-    var isMatchZhiren = $("input[name=isMatchZhiren]").length > 0 ? parseInt($("input[name=isMatchZhiren]:checked").val()) : false;
-    var isImport = parseInt($("#import").val());
-    if (isImport > 0 && isMatchZhiren === false) {
+    if (TalentInfoInfoDlg.isImport() && $("input[name=isMatchZhiren]:checked").length == 0) {
         layer.alert("请先选择是否符合直认条件");
         $("#talent_condition").val("");
         $("#talent_condition").trigger('chosen:updated');
@@ -788,22 +784,12 @@ TalentInfoInfoDlg.sourceChange = function () {
     //var columns = 3;
     switch (source) {
         case "1":
-        case "3":
-            //columns = source == 3 ? 3 : 4;
-            //$("#source_batch").parents("td").css("display", "table-cell");
-            //$(".fujian_highcert").parents("td").css("display", "table-cell");
-            //$('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
-            //$('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_pubtime", {validators: {notEmpty: {message: '福建省高层次人才证书发证日期不能为空'}}});
-            //$('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_exptime", {validators: {notEmpty: {message: '福建省高层次人才证书有效期不能为空'}}});
             break;
         case "2":
+            break;
+        case "3":
+            break;
         case "4":
-            //columns = source == 4 ? 3 : 4;
-            //$("#source_batch").parents("td").css("display", "table-cell");
-            //$(".quanzhou_highcert").parents("td").css("display", "table-cell");
-            //$('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
-            //$('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_pubtime", {validators: {notEmpty: {message: '泉州高层次人才证书发证日期不能为空'}}});
-            //$('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_exptime", {validators: {notEmpty: {message: '泉州高层次人才证书有效期不能为空'}}});
             break;
     }
     if (source == 3) {
@@ -840,14 +826,23 @@ TalentInfoInfoDlg.sourceChange = function () {
     //$("#talent_condition").parents("td").attr("colspan", columns - 1);
 }
 TalentInfoInfoDlg.isMatchZhirenChange = function () {
-    var isMatchZhiren = $("input[name=isMatchZhiren]").length > 0 ? parseInt($("input[name=isMatchZhiren]:checked").val()) : false;
-    var isImport = parseInt($("#import").val());
-    if (isImport > 0 && isMatchZhiren == 1) {
+    $("#source option[value!='']").css("display", "none");
+    var show = [1, 2];
+    var curSource = parseInt($("#source").val());
+    if (TalentInfoInfoDlg.isImport() && TalentInfoInfoDlg.isZhiRen()) {
         $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
     } else {
+        show = [3, 4, 5];
         var source = $("#source").val();
         TalentInfoInfoDlg.ajaxGetConditionFile(source);
     }
+    for (var i in show) {
+        $("#source option[value=" + show[i] + "]").css("display", "block");
+    }
+    if (show.indexOf(curSource) == -1) {
+        $("#source").val("");
+        TalentInfoInfoDlg.sourceChange();
+    }
 }
 
 //校验是否保存基础信息
@@ -1107,6 +1102,24 @@ TalentInfoInfoDlg.setNoChangeField = function () {
         }
     }
 }
+
+/**
+ * 是否导入
+ * @returns {Boolean}
+ */
+TalentInfoInfoDlg.isImport = function () {
+    var isImport = parseInt($("#import").val());
+    return isImport > 0 ? true : false;
+}
+/**
+ * 是否直认
+ * @returns {Boolean}
+ */
+TalentInfoInfoDlg.isZhiRen = function () {
+    var isMatchZhiren = $("input[name=isMatchZhiren]").length > 0 && $("input[name=isMatchZhiren]:checked").val() == 1 ? true : false;
+    return isMatchZhiren;
+}
+
 $("#card_type").change(function () {
     async_padding($("#card_number").val().trim(), $(this).val());
 })
@@ -1143,7 +1156,17 @@ $(function () {
         {"name": "highest_degree", "code": "highest_degree"},
         {"name": "source", "code": "source"},
         {"name": "import_way", "code": "import_way"}];
-    Feng.findChildDictBatch(JSON.stringify(arr))
+    Feng.findChildDictBatch(JSON.stringify(arr));
+
+    if (!TalentInfoInfoDlg.isImport() || !TalentInfoInfoDlg.isZhiRen()) {
+        $("#source option[value=1]").css("display", "none");
+        $("#source option[value=2]").css("display", "none");
+    }
+    if (TalentInfoInfoDlg.isImport() && TalentInfoInfoDlg.isZhiRen()) {
+        $("#source option[value=3]").css("display", "none");
+        $("#source option[value=4]").css("display", "none");
+        $("#source option[value=5]").css("display", "none");
+    }
     //加载省份
     Feng.addAjaxSelect({
         "id": "province",