瀏覽代碼

修复驳回直认条件附件不能修改

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

+ 10 - 4
public/static/modular/gate/talentInfo/new_talentInfo_info.js

@@ -586,7 +586,7 @@ TalentInfoInfoDlg.ajaxGetConditionFile = function (source) {
                 if (filetype.must == 2) {
                     name = '<i class="fa fa-paste"></i>' + filetype.name;
                 }
-                var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key);
+                var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key, true);
                 var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",5)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
 <i class=\"fa fa-download\"></i>下载""</button>"';
                 html += '<tr data-index="' + key + '">\n\
@@ -598,7 +598,7 @@ TalentInfoInfoDlg.ajaxGetConditionFile = function (source) {
 
                 for (var k in filetype.files) {
                     var file = filetype.files[k];
-                    var btn = TalentInfoInfoDlg.validUploadButton(2, filetype.id, file.id, tableIndex, key);
+                    var btn = TalentInfoInfoDlg.validUploadButton(2, filetype.id, file.id, tableIndex, key, true);
                     var sn = file.url.lastIndexOf(".");
                     var suffix = file.ext;//file.url.substring(sn + 1, file.url.length);
                     var imgStr = "";
@@ -1091,13 +1091,19 @@ TalentInfoInfoDlg.validateIsEdit = function () {
  * @param row
  * @returns {string}
  */
-TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex) {
+TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex, isConditionFile) {
     var files = $("#files").val();
+    var fields = $("#fields").val();
     files = files.split(",");
+    fields = fields.split(",");
     var checkState = $("#checkState").val();
     var realState = $("#realState").val();
     //console.log(checkState, realState);
-    if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 8 && realState == "") || (checkState == 8 && realState == 8) || (checkState == 11 && realState != 14) || (realState == 11 && files.indexOf(fileTypeId.toString()) != -1)) {
+    var isConditionEditable = false;
+    if (isConditionFile && (fields.indexOf("isMatchZhiren") != -1 || fields.indexOf("source") != -1 || fields.indexOf("talent_arrange") != -1 || fields.indexOf("talent_arrange_category") != -1 || fields.indexOf("talent_condition") != -1)) {
+        isConditionEditable = true;
+    }
+    if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 8 && realState == "") || (checkState == 8 && realState == 8) || (checkState == 11 && realState != 14) || (realState == 11 && (files.indexOf(fileTypeId.toString()) != -1 || isConditionEditable))) {
         if (type == 1) {          //上传
             return "<button type='button' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + null + "," + tableIndex + "," + trIndex + ")\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
                     "<i class=\"fa fa-upload\"></i>上传" +