sugangqiang 2 年之前
父節點
當前提交
ab609b5ffd
共有 1 個文件被更改,包括 78 次插入75 次删除
  1. 78 75
      public/static/modular/gate/talentInfo/talentInfo_info.js

+ 78 - 75
public/static/modular/gate/talentInfo/talentInfo_info.js

@@ -462,83 +462,86 @@ 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;
+    var condition = $("#talent_condition option:selected").val();
+    if (condition != "") {
+        var ajax = new $ax("/common/api/getTalentCondtionUploadFile", function (data) {
+            if (data == null || data.length == 0) {
+                return;
+            }
+            if (typeof data.info != "undefined" && 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;
                             }
-                            return false;
                         }
                     }
-                }
-            });
-        }
-        if (data == null || data.length == 0) {
-            return;
-        }
-        var conditionFileTable = $("#talent_condition").parents(".row").next(".row").find(".fileTable");
-        var tableIndex = conditionFileTable.index(".fileTable");
-        var tbody = conditionFileTable.find("tbody");
-        var html = "";
-        for (var key in data.rows) {
-            var filetype = data.rows[key];
-            var name = "";
-            if (filetype.must == 1) {
-                name = '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + filetype.name;
+                });
             }
-            if (filetype.must == 2) {
-                name = '<i class="fa fa-paste"></i>' + filetype.name;
-            }
-            var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key);
-            var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",3)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
+            var conditionFileTable = $("#talent_condition").parents(".table").find(".fileTable");
+            var tableIndex = conditionFileTable.index(".fileTable");
+            var tbody = conditionFileTable.find("tbody");
+            var html = "";
+            for (var key in data.rows) {
+                var filetype = data.rows[key];
+                var name = "";
+                if (filetype.must == 1) {
+                    name = '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + filetype.name;
+                }
+                if (filetype.must == 2) {
+                    name = '<i class="fa fa-paste"></i>' + filetype.name;
+                }
+                var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key);
+                var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",3)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
 <i class=\"fa fa-download\"></i>下载""</button>"';
-            html += '<tr data-index="' + key + '">\n\
+                html += '<tr data-index="' + key + '">\n\
                                 <td class="uitd_showTip" style="text-align: center; vertical-align: middle; width: 30%; ">' + name + '</td> \n\
                                 <td style="text-align: center; vertical-align: middle; width: 8%; ">' + (filetype.templateUrl ? templateUrl : "无") + '</td> \n\
                                 <td class="uitd_showTip" style="text-align: center; vertical-align: middle; width: 52%; ">' + filetype.description + '</td> \n\
                                 <td style="text-align: center; vertical-align: middle; width: 10%; ">' + uploadbtn + '</td> </tr></tr>';
-            html += '<tr class="detail-view"><td colspan="5"><ul class="imgs"><li style="width: 70%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 20%;font-weight: bold;padding-top: 5px;">操作</li>';
+                html += '<tr class="detail-view"><td colspan="5"><ul class="imgs"><li style="width: 70%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 20%;font-weight: bold;padding-top: 5px;">操作</li>';
 
-            for (var k in filetype.files) {
-                var file = filetype.files[k];
-                var btn = TalentInfoInfoDlg.validUploadButton(2, filetype.id, file.id, tableIndex, key);
-                var sn = file.url.lastIndexOf(".");
-                var suffix = file.url.substring(sn + 1, file.url.length);
-                var imgStr = "";
-                if (suffix == "pdf" || suffix == "PDF") {
-                    imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + file.url + "','" + file.id + "','" + file.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
-                } 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\"  onclick=\"Feng.showImg(this)\" src=\"' + file.url + '\" style=\"width:25px;height:25px;\">';
-                }
+                for (var k in filetype.files) {
+                    var file = filetype.files[k];
+                    var btn = TalentInfoInfoDlg.validUploadButton(2, filetype.id, file.id, tableIndex, key);
+                    var sn = file.url.lastIndexOf(".");
+                    var suffix = file.url.substring(sn + 1, file.url.length);
+                    var imgStr = "";
+                    if (suffix == "pdf" || suffix == "PDF") {
+                        imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + file.url + "','" + file.id + "','" + file.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
+                    } 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\"  onclick=\"Feng.showImg(this)\" src=\"' + file.url + '\" style=\"width:25px;height:25px;\">';
+                    }
 
-                html += '<li data-id="' + file.id + '">\n\
+                    html += '<li data-id="' + file.id + '">\n\
                                     <div>' + (filetype.step != 1 ? '<input type="hidden" name="uploadFiles[]" value="' + file.id + '">' : "") + '</div>\n' +
-                        '<div style="width: 80%;">' + file.orignName + '</div>\n' +
-                        '<div style="width: 10%;">' + imgStr + '</div>\n' +
-                        '<div style="width: 10%;">' + btn + '</div>\n\
+                            '<div style="width: 80%;">' + file.orignName + '</div>\n' +
+                            '<div style="width: 10%;">' + imgStr + '</div>\n' +
+                            '<div style="width: 10%;">' + btn + '</div>\n\
                                     </li>';
+                }
+                html += '</ul></td></tr>';
             }
-            html += '</ul></td></tr>';
-        }
-        tbody.html(html);
-    }, function (data) {
-        Feng.error("查询失败!" + data.responseJSON.message + "!");
-    });
-    var queryData = {};
-    queryData["mainId"] = $("#id").val();
-    queryData['project'] = CONFIG.project_rcrd;
-    queryData['type'] = $("#type").val();
-    queryData["talent_condition"] = $("#talent_condition option:selected").val();
-    ajax.set(queryData);
-    ajax.start();
+            tbody.html(html);
+        }, function (data) {
+            Feng.error("查询失败!" + data.responseJSON.message + "!");
+        });
+        var queryData = {};
+        queryData["mainId"] = $("#id").val();
+        queryData['project'] = CONFIG.project_rcrd;
+        queryData['type'] = $("#type").val();
+        queryData["talent_condition"] = condition;
+        ajax.set(queryData);
+        ajax.start();
+    }
 }
 
 TalentInfoInfoDlg.bankChange = function () {
@@ -1037,21 +1040,21 @@ $(function () {
         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;
+        $("#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();
 });