talentInfo_common_check.js 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. /**
  2. * 初始化人才认定申报详情对话框
  3. */
  4. var locked = false;
  5. var TalentInfoInfoDlg = {
  6. talentInfoInfoData: {},
  7. };
  8. /**
  9. * 初始化表格的列
  10. */
  11. TalentInfoInfoDlg.initFileTypeColumn = function () {
  12. return [
  13. {field: 'selectItem', checkbox: false, visible: false},
  14. {title: '名称', field: 'name', visible: true, align: 'left', valign: 'middle', width: "82%", 'class': 'uitd_showTip',
  15. formatter: function (value, row, index) {
  16. let str = '<div class="word-wrap">';
  17. let highlights_by_api = ["crz"];
  18. let description = row.description;
  19. if (highlights_by_api.indexOf(row.api) > -1) {
  20. value = '<span style="font-weight:bold;color:red;">' + value + '</span>';
  21. description = '<span style="font-weight:bold;color:red;">' + description + '</span>';
  22. }
  23. if (row.must == 1) {
  24. str = str + '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  25. }
  26. if (row.must == 2) {
  27. str = str + '<i class="fa fa-paste"></i>' + value;
  28. }
  29. str = str + '<br /><span id="desc_' + row.rel + '">' + description + '</span></div>'
  30. return str;
  31. }
  32. },
  33. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  34. formatter: function (value, row, index) {
  35. if (value == null || value == '' || value == 'null') {
  36. return '';
  37. }
  38. return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  39. "<i class=\"fa fa-download\"></i>下载" +
  40. "</button>";
  41. }
  42. },
  43. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "10%",
  44. formatter: function (value, row, index) {
  45. return "";
  46. }
  47. }
  48. ]
  49. };
  50. TalentInfoInfoDlg.initFileTable = function () {
  51. var ajax = new $ax("/common/api/findCommonFileType", function (data) {
  52. if (data == null || data.length == 0) {
  53. return;
  54. }
  55. var datas = new Array();
  56. for (var i = 0; i < $(".fileTable").length; i++) {
  57. datas.push([]);//创建空的多维数组,等下用来存每个附件表的各自的列
  58. }
  59. var enterpriseTag = $("#enterprise_tag").val();
  60. for (var k in data["rows"]) {
  61. if (data["rows"][k].enterprise_tag != "" && data["rows"][k].enterprise_tag != null && data["rows"][k].enterprise_tag.indexOf(enterpriseTag) == -1) {
  62. continue;
  63. }
  64. var rel = data["rows"][k].rel;
  65. if ($("#" + rel).length > 0) {
  66. if ($("#" + rel).parents(".table").length > 0) {
  67. var tableIndex = $("#" + rel).parents(".table").find("table.fileTable").index(".fileTable");
  68. } else {
  69. var tableIndex = $("#" + rel).parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  70. }
  71. data["rows"][k].tableIndex = tableIndex;
  72. data["rows"][k].trIndex = datas[tableIndex].length;
  73. datas[tableIndex].push(data["rows"][k]);
  74. if (data["rows"][k].option) {
  75. //指定了选项
  76. if (rel == "birthday") {
  77. let birthday = parseInt($("#" + rel).val().substring(0, 4));
  78. let currentYear = parseInt(new Date().getFullYear());
  79. let age = currentYear - (isNaN(birthday) ? 0 : birthday);
  80. if (isNaN(birthday) || (!isNaN(birthday) && age < data["rows"][k].option))
  81. data["rows"][k].hidden = true;
  82. } else {
  83. let selectVal = $("#" + rel).data("value").toString();
  84. let options = data["rows"][k].option.split(",");
  85. if (options.indexOf(selectVal) == -1) {
  86. data["rows"][k].hidden = true;
  87. }
  88. }
  89. }
  90. } else {
  91. if (data["rows"][k].isConditionFile) {
  92. var isMatchZhiren = $("input[name=isMatchZhiren]").length > 0 ? parseInt($("input[name=isMatchZhiren]:checked").val()) : false;
  93. var isImport = parseInt($("#import").val());
  94. if (isImport == 1 && isMatchZhiren)
  95. continue;
  96. var tableIndex = 0;
  97. if ($("#talent_condition").parents(".table").length > 0) {
  98. tableIndex = $("#talent_condition").parents(".table").find("table.fileTable").index(".fileTable");
  99. } else {
  100. tableIndex = $("#talent_condition").parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  101. }
  102. data["rows"][k].tableIndex = tableIndex;
  103. data["rows"][k].trIndex = datas[tableIndex].length;
  104. datas[tableIndex].push(data["rows"][k]);//放入人才条件后面的附件表
  105. } else {
  106. var tableIndex = $(".fileTable").length - 1;
  107. data["rows"][k].tableIndex = tableIndex;
  108. data["rows"][k].trIndex = datas[tableIndex].length;
  109. datas[$(".fileTable").length - 1].push(data["rows"][k]);//没有归属,放入最后一个附件表
  110. }
  111. }
  112. }
  113. for (var i = 0; i < $(".fileTable").length; i++) {
  114. var that = $(".fileTable").eq(i);
  115. that.bootstrapTable({
  116. columns: TalentInfoInfoDlg.initFileTypeColumn(),
  117. data: datas[i],
  118. showHeader: false,
  119. rowStyle: function (row, index) {
  120. return {classes: ""};
  121. },
  122. onPostBody: function (data) {
  123. for (var k in data) {
  124. var files = data[k].files;
  125. var html = '<ul class="imgs"><li style="width: 60%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 15%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 25%;font-weight: bold;padding-top: 5px;">操作</li>';
  126. for (var key in files) {
  127. var sn = files[key].url.lastIndexOf(".");
  128. var suffix = files[key].ext;//files[key].url.substring(sn + 1, files[key].url.length);
  129. var imgStr = "";
  130. if (suffix == "pdf" || suffix == "PDF") {
  131. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  132. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  133. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  134. } else {
  135. imgStr = '<img class="imgUrl" onclick="Feng.showImg(this)" src="' + files[key].url + '" style="width:25px;height:25px;">';
  136. }
  137. html += '<li data-id="' + files[key].id + '">\n\
  138. <div><input type="hidden" name="uploadFiles[]" value="' + files[key].id + '"></div>\n' +
  139. '<div style="width: 60%;">' + files[key].orignName + '</div>\n' +
  140. '<div style="width: 15%;">' + imgStr + '</div>\n' +
  141. '<div style="width: 25%;"></div>\n\
  142. </li>';
  143. }
  144. html = html + '</ul>';
  145. that.find("tr[data-index='" + k + "']").attr("data-rel", data[k]["rel"]);
  146. that.find("tr[data-index='" + k + "']").attr("data-option", data[k]["option"]);
  147. that.find("tr[data-index='" + k + "']").after('<tr class="detail-view"><td colspan="5">' + html + '</td></tr>');
  148. if (typeof data[k].hidden != "undefined") {
  149. that.find("tr[data-index='" + k + "']").css("display", "none");
  150. that.find("tr[data-index='" + k + "']").next("tr.detail-view").css("display", "none");
  151. }
  152. }
  153. $("td.uitd_showTip").bind("mouseover", function () {
  154. var htm = $(this).html();
  155. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  156. });
  157. },
  158. });
  159. }
  160. }, function (data) {
  161. Feng.error("查询失败!" + data.responseJSON.message + "!");
  162. });
  163. var queryData = {};
  164. queryData["mainId"] = $("#id").val();
  165. queryData['project'] = CONFIG.project_rcrd;
  166. queryData['type'] = $("#type").val();
  167. queryData["source"] = $("#source").val();
  168. queryData["talent_condition"] = $("#talent_condition option:selected").val();
  169. queryData['checkState'] = $("#checkState").val();
  170. ajax.set(queryData);
  171. ajax.start();
  172. }
  173. TalentInfoInfoDlg.initICFileTable = function () {
  174. var queryData = {};
  175. queryData['project'] = CONFIG.project_rcrd;
  176. queryData['type'] = $("#type").val();
  177. queryData['checkState'] = $("#checkState").val();
  178. queryData['isMix'] = 1;
  179. $("#fileTable").bootstrapTable({
  180. url: Feng.ctxPath + "/common/api/findCommonFileType",
  181. method: 'POST',
  182. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  183. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  184. showRefresh: false, // 是否显示刷新按钮
  185. clickToSelect: true, // 是否启用点击选中行
  186. singleSelect: true, // 设置True 将禁止多选
  187. striped: true, // 是否显示行间隔色
  188. escape: true,
  189. pagination: false, // 设置为 true 会在表格底部显示分页条
  190. paginationHAlign: "left",
  191. paginationDetailHAlign: "right",
  192. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  193. showColumns: false,
  194. detailView: true, //是否显示父子表
  195. pageList: [10, 30, 50],
  196. queryParams: function (params) {
  197. return $.extend(queryData, params)
  198. },
  199. rowStyle: function (row, index) {
  200. return {classes: "info"};
  201. },
  202. columns: TalentInfoInfoDlg.initFileTypeColumn(),
  203. onPostBody: function () {
  204. $("td.uitd_showTip").bind("mouseover", function () {
  205. var htm = $(this).html();
  206. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  207. });
  208. },
  209. onLoadSuccess: function (data) {
  210. $("#fileTable").bootstrapTable('expandAllRows');
  211. },
  212. onExpandRow: function (index, row, $detail) {
  213. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  214. if (data == null || data.length == 0) {
  215. return;
  216. }
  217. var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li>';
  218. var files = $("#files").val();
  219. var checkState = $("#checkState").val();
  220. for (var key in data) {
  221. var sn = data[key].url.lastIndexOf(".");
  222. var suffix = data[key].ext;//files[key].url.substring(sn + 1, files[key].url.length);
  223. var imgStr = "";
  224. if (suffix == "pdf" || suffix == "PDF") {
  225. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  226. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  227. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  228. } else {
  229. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  230. }
  231. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  232. '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  233. '<li style="width: 10%;">' + imgStr + '</li>\n';
  234. }
  235. html = html + '</ul>';
  236. $detail.html(html);
  237. $(".imgs").viewer({fullscreen: false});
  238. }, function (data) {
  239. Feng.error("查询失败!" + data.responseJSON.message + "!");
  240. });
  241. var queryData = {};
  242. queryData["mainId"] = $("#id").val();
  243. queryData["fileTypeId"] = row.id;
  244. ajax.set(queryData);
  245. ajax.start();
  246. }
  247. });
  248. }
  249. /**
  250. * 关闭此对话框
  251. */
  252. TalentInfoInfoDlg.close = function () {
  253. parent.layer.close(window.parent.TalentInfo.layerIndex);
  254. }
  255. //人才标签变化
  256. TalentInfoInfoDlg.typeChange = function () {
  257. var talentType = $("#talentType").val();
  258. if (talentType == 'gbwszb' || talentType == 'zzbsh' || talentType == 'sydw') {
  259. $("#letterTime").parent().attr("style", "display:block");
  260. // }else if(talentType=='gyqyl' || talentType=="gyqyh"){
  261. // $("#letterTime").parent().attr("style","display:none");
  262. } else {
  263. $("#letterTime").parent().attr("style", "display:none");
  264. }
  265. }
  266. TalentInfoInfoDlg.sourceChange = function () {
  267. var source = $("#source").val();
  268. if (source == 1) {
  269. $("#fromCityName").parent().attr("style", "display:none");
  270. $("#qzBatch").parent().attr("style", "display:block");
  271. $("#qzgccrcActiveTime").parent().attr("style", "display:block");
  272. $("#certificateStartTime").parent().attr("style", "display:block");
  273. $("#ourCitySource").parent().attr("style", "display:block");
  274. }
  275. if (source == 2) {
  276. $("#certificateStartTime").parent().attr("style", "display:block");
  277. $("#qzgccrcActiveTime").parent().attr("style", "display:block");
  278. $("#fromCityName").parent().attr("style", "display:block");
  279. $("#qzBatch").parent().attr("style", "display:block");
  280. $("#ourCitySource").parent().attr("style", "display:none");
  281. }
  282. if (source == 3 || source == null || source == '') {
  283. $("#certificateStartTime").parent().attr("style", "display:none");
  284. $("#qzgccrcActiveTime").parent().attr("style", "display:none");
  285. $("#fromCityName").parent().attr("style", "display:none");
  286. $("#qzBatch").parent().attr("style", "display:none");
  287. $("#ourCitySource").parent().attr("style", "display:none");
  288. }
  289. }
  290. TalentInfoInfoDlg.callback = function (data) {
  291. Feng.info(data.msg);
  292. }
  293. /**
  294. * 下载附件
  295. * @param value
  296. */
  297. TalentInfoInfoDlg.downloadFile = function (id, type) {
  298. window.location.href = "/common/api/downloadFile?id=" + id + "&type=" + type;
  299. }
  300. TalentInfoInfoDlg.expandRows = function () {
  301. $(".fileTable").bootstrapTable('expandAllRows')
  302. }
  303. /**
  304. * 显示审核模态框
  305. */
  306. TalentInfoInfoDlg.showCommonCheckModal = function () {
  307. var ajax = new $ax("/admin/talent/validateIsCheck", function (data) {
  308. if (data.code == 200) {
  309. layer.open({
  310. type: 1,
  311. id: "neewFieldFormModel",
  312. title: '审核',
  313. area: ['800px', '350px'], //宽高
  314. fix: false, //不固定
  315. shade: 0,
  316. maxmin: true,
  317. content: TalentInfoInfoDlg.createNoFieldCheckModal(),
  318. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  319. btnAlign: 'c',
  320. zIndex: layer.zIndex,
  321. success: function (layero, index) {
  322. layer.setTop(layero);
  323. $("#commonCheckForm")[0].reset();
  324. var process = $("#process").val();
  325. if (process == 3) {
  326. var html = '<option value=""></option>\n' +
  327. ' <option value="3">审核通过</option>\n' +
  328. ' <option value="2">审核驳回</option>';
  329. $("#checkStateModal").empty().append(html);
  330. }
  331. $("#checkStateModal").val(data.obj.checkState);
  332. $("#checkMsg").val(data.obj.checkMsg);
  333. },
  334. yes: function (index, layero) {
  335. TalentInfoInfoDlg.commonCheck(index);
  336. }
  337. });
  338. } else {
  339. Feng.error(data.msg);
  340. }
  341. }, function (data) {
  342. Feng.error("校验失败!" + data.responseJSON.message + "!");
  343. });
  344. ajax.setData({"id": $("#id").val(), "process": $("#process").val(), "companyId": $("#companyId").val()})
  345. ajax.start();
  346. }
  347. /**
  348. * 显示初审审核模态框
  349. */
  350. TalentInfoInfoDlg.showFirstCheckModal = function () {
  351. var ajax = new $ax("/admin/talent/validateIsCheck", function (data) {
  352. if (data.code == 200) {
  353. layer.open({
  354. type: 1,
  355. id: "neewFieldFormModel",
  356. title: '审核',
  357. area: ['800px', '450px'], //宽高
  358. fix: false, //不固定
  359. shade: 0,
  360. maxmin: true,
  361. content: TalentInfoInfoDlg.creatFieldCheckModal(),
  362. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  363. btnAlign: 'c',
  364. zIndex: layer.zIndex,
  365. success: function (layero, index) {
  366. layer.setTop(layero);
  367. var obj = data.obj.talentInfo;
  368. var companyList = data.obj.companys;
  369. var fileList = data.obj.fileList;
  370. var process = data.obj.process;
  371. if (typeof data.obj.fieldList != "undefined" && data.obj.fieldList.length > 0) {
  372. var fieldList = data.obj.fieldList;
  373. var html1 = '';
  374. for (var key in fieldList) {
  375. html1 = html1 + '<li style="float:left;margin:0 10px 10px 0;"><input type="checkbox" value="' + fieldList[key]["key"] + '"><span>' + fieldList[key]["value"] + '</span></li>';
  376. }
  377. }
  378. var html2 = '';
  379. for (var key in fileList) {
  380. html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
  381. }
  382. var html3 = '';
  383. for (var key in companyList) {
  384. html3 += '<li style="width: 100%"><input type="checkbox" value="' + companyList[key].id + '"><span>' + companyList[key].name + '</span></li>';
  385. }
  386. $("#field_info ul").css("overflow", "hidden").empty().append(html1);
  387. $("#field_file").css("overflow", "hidden").empty().append(html2);
  388. $("#company_list ul").css("overflow", "hidden").empty().append(html3);
  389. var optionHtml = "";
  390. if (process <= 4 && process != 2) {
  391. optionHtml = '<option value="">请选择</option>\n' +
  392. (obj.highProcess == 4 && process == 3 ? '<option value="5">审核通过(需要再次部门并审)</option>\n' : '<option value="3">审核通过</option>') +
  393. (obj.highProcess == 4 && process == 3 ? '<option value="4">审核通过(跳过部门并审)</option>\n' : "") +
  394. ' <option value="2">审核驳回</option>\n';
  395. }
  396. if (process == 5 || process == 2) {
  397. optionHtml = '<option value="">请选择</option>\n' +
  398. ' <option value="3">审核通过</option>\n' +
  399. ' <option value="2">审核驳回</option>\n' +
  400. ' <option value="-1">审核不通过</option>';
  401. }
  402. $("#checkStateFirstModal").empty().append(optionHtml);
  403. $("#firstCheckForm")[0].reset();
  404. //$("#checkStateFirstModal").val(obj.checkState);
  405. $("#checkStateFirstModal").trigger("change");
  406. $("#checkMsgFirst").val(obj.checkMsg);
  407. if (obj.fields != null && obj.fields != '') {
  408. $("#field_info input").each(function () {
  409. for (var key in obj.fields) {
  410. if ($(this).val() == obj.fields[key]) {
  411. this.checked = true;
  412. }
  413. }
  414. });
  415. }
  416. if (obj.files != null && obj.files != '') {
  417. $("#field_file input").each(function () {
  418. for (var key in obj.files) {
  419. if ($(this).val() == obj.files[key]) {
  420. this.checked = true;
  421. }
  422. }
  423. //if (obj.files.indexOf($(this).val()) != -1) {
  424. //this.checked = true;
  425. //}
  426. });
  427. }
  428. },
  429. yes: function (index, layero) {
  430. TalentInfoInfoDlg.firstCheck(index);
  431. }
  432. });
  433. } else {
  434. Feng.error(data.msg);
  435. }
  436. }, function (data) {
  437. Feng.error("校验失败!" + data.responseJSON.message + "!");
  438. });
  439. ajax.setData({"id": $("#id").val(), "companyId": $("#companyId").val()})
  440. ajax.start();
  441. }
  442. TalentInfoInfoDlg.toggledepField = function () {
  443. var checkState = $("#checkStateModal").val();
  444. var checkMsg = $("#checkMsg").val();
  445. if (checkState == 3) {
  446. if (checkMsg == null || checkMsg == '') {
  447. $("#checkMsg").val("部门审核通过,待复核");
  448. }
  449. } else {
  450. $("#checkMsg").val("");
  451. }
  452. }
  453. /**
  454. * 显示字段或者隐藏字段选择
  455. */
  456. TalentInfoInfoDlg.toggleField = function () {
  457. var checkState = $("#checkStateFirstModal").val();
  458. var checkMsgFirst = $("#checkMsgFirst").val();
  459. $("#company_list").hide();
  460. if (checkState == 2) {
  461. $("#field").show();
  462. $("#checkMsgFirst").val("");
  463. } else if (checkState == 3 || checkState == 4 || checkState == 5) {
  464. $("#field").hide();
  465. $("#field").find("input[type=checkbox]").removeAttr("checked");
  466. if (checkMsgFirst == null || checkMsgFirst == '') {
  467. $("#checkMsgFirst").val("审核通过");
  468. }
  469. if (checkState == 5) {
  470. $("#company_list").show();
  471. }
  472. } else if (checkState == -1) {
  473. $("#field").hide();
  474. $("#checkMsgFirst").val("审核不通过");
  475. }
  476. }
  477. /**
  478. * 全选
  479. */
  480. TalentInfoInfoDlg.checkAll = function () {
  481. $("#field input").each(function () {
  482. this.checked = true;
  483. })
  484. }
  485. /**
  486. * 反选
  487. */
  488. TalentInfoInfoDlg.unCheckAll = function () {
  489. $("#field input").each(function () {
  490. if (this.checked) {
  491. this.checked = false;
  492. } else {
  493. this.checked = true;
  494. }
  495. })
  496. }
  497. /**
  498. * 审核提交
  499. */
  500. TalentInfoInfoDlg.commonCheck = function (i) {
  501. var checkState = $("#checkStateModal").val();
  502. var checkMsg = $("#checkMsg").val();
  503. if (checkState == null || checkState == '') {
  504. Feng.info("请选择审核状态");
  505. return;
  506. }
  507. if (checkMsg == null || checkMsg == '') {
  508. Feng.info("请填写审核意见");
  509. return;
  510. }
  511. if (locked)
  512. return;
  513. locked = true;
  514. var ajax = new $ax(Feng.ctxPath + "/admin/talent/check", function (data) {
  515. if (data.code == 200) {
  516. Feng.success(data.msg);
  517. // $("#commonModal").modal("hide");
  518. layer.close(i);
  519. } else {
  520. Feng.error(data.msg);
  521. }
  522. locked = false;
  523. }, function (data) {
  524. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  525. locked = false;
  526. });
  527. ajax.setData({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(), "companyId": $("#companyId").val()})
  528. ajax.start();
  529. }
  530. /**
  531. * 初审提交
  532. */
  533. TalentInfoInfoDlg.firstCheck = function (i) {
  534. var checkState = $("#checkStateFirstModal").val();
  535. var checkMsg = $("#checkMsgFirst").val();
  536. if (checkState == null || checkState == '') {
  537. Feng.info("请选择审核状态");
  538. return;
  539. }
  540. if (checkMsg == null || checkMsg == '') {
  541. Feng.info("请填写审核意见");
  542. return;
  543. }
  544. var fields = '';
  545. var files = '';
  546. var companys = '';
  547. $("#field_info li input").each(function (index) {
  548. if ($(this).is(":checked")) {
  549. fields = fields + $(this).val() + ",";
  550. }
  551. });
  552. $("#field_file li input").each(function (index) {
  553. if ($(this).is(":checked")) {
  554. files = files + $(this).val() + ",";
  555. }
  556. });
  557. $("#company_list li input").each(function (index) {
  558. if ($(this).is(":checked")) {
  559. companys += $(this).val() + ",";
  560. }
  561. });
  562. if (checkState == 2 && fields == '' && files == '') {
  563. Feng.info("请选择可修改的字段或附件!");
  564. return;
  565. }
  566. if (checkState == 5 && companys == "") {
  567. Feng.info("请选择需要再次审核的部门!");
  568. return;
  569. }
  570. if (locked)
  571. return;
  572. locked = true;
  573. var ajax = new $ax("/admin/talent/check", function (data) {
  574. if (data.code == 200) {
  575. // $("#firstModal").modal("hide");
  576. layer.close(i);
  577. Feng.success(data.msg);
  578. } else {
  579. Feng.error(data.msg);
  580. }
  581. locked = false;
  582. }, function (data) {
  583. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  584. locked = false;
  585. });
  586. ajax.setData({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg,
  587. "process": $("#process").val(), "fields": fields, "files": files, "companys": companys})
  588. ajax.start();
  589. }
  590. TalentInfoInfoDlg.submitCheck = function () {
  591. var operation = function () {
  592. var ajax = new $ax(Feng.ctxPath + "/admin/talent/submitCheck", function (data) {
  593. if (data.code == 200) {
  594. Feng.success(data.msg);
  595. window.parent.TalentInfo.table.refresh();
  596. TalentInfoInfoDlg.close();
  597. } else {
  598. Feng.error(data.msg);
  599. }
  600. }, function (data) {
  601. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  602. });
  603. ajax.setData({"id": $("#id").val(), "process": $("#process").val(), "companyId": $("#companyId").val()});
  604. ajax.start();
  605. }
  606. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  607. }
  608. TalentInfoInfoDlg.fieldCheckd = function (context) {
  609. if ($(context).get(0).checked) {
  610. $(context).parent().next().children()[0].checked = true;
  611. $(context).parent().next().children().eq(0).trigger("change");
  612. }
  613. }
  614. TalentInfoInfoDlg.sourceCheckd = function (context) {
  615. if ($(context).get(0).checked) {
  616. $("#talentArrangeCheckBox").attr("checked", true);
  617. $("#talentArrangeCheckBox").trigger("change");
  618. }
  619. }
  620. TalentInfoInfoDlg.download = function () {
  621. window.location.href = encodeURI(encodeURI("/common/api/downloadZip?type=1&id=" + $("#id").val()));
  622. }
  623. TalentInfoInfoDlg.creatFieldCheckModal = function () {
  624. var type = $("#type").val();
  625. if (type == 1) {
  626. return '<form id="firstCheckForm">\n' +
  627. ' <div class="form-group" style="margin: 10px;">\n' +
  628. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  629. ' <select class="form-control" id="checkStateFirstModal" onchange="TalentInfoInfoDlg.toggleField()">\n' +
  630. ' <option value="">请选择</option>\n' +
  631. ' <option value="3">审核通过</option>\n' +
  632. ' <option value="2">审核驳回</option>\n' +
  633. ' <option value="-1">审核不通过</option>\n' +
  634. ' </select>\n' +
  635. ' </div>\n' +
  636. ' <div class="form-group" style="margin: 10px;">\n' +
  637. ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
  638. ' <textarea class="form-control" id="checkMsgFirst" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
  639. ' <div id="company_list" style="padding-top:5px;display:none;">\n' +
  640. ' <label for="checkMsg" class="control-label">选择需要再次审核的部门</label>\n' +
  641. ' <div id="companys">' +
  642. ' <ul style="overflow:hidden;list-style:none;"></ul>' +
  643. ' </div>' +
  644. ' </div>\n' +
  645. ' <div id="field" style="padding-top: 5px;display: none">\n' +
  646. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  647. ' <div id="field_info">\n' +
  648. ' <ul style="overflow:hidden;list-style:none;">\n' +
  649. ' <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
  650. ' <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
  651. ' <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
  652. ' <li style="width:10%"><input type="checkbox" value="industryField"><span>行业领域</span></li>\n' +
  653. ' <li style="width:10%"><input type="checkbox" value="address"><span>所属镇街</span></li>\n' +
  654. ' <li style="width:20.5%"><input type="checkbox" value="nationality"><span>国籍/地区</span></li>\n' +
  655. ' <li style="width:10%"><input type="checkbox" value="provinceCode"><span>籍贯省</span></li>\n' +
  656. ' <li style="width:10%"><input type="checkbox" value="cityCode"><span>籍贯市</span></li>\n' +
  657. ' <li style="width:10%"><input type="checkbox" value="countyCode"><span>籍贯县</span></li>\n' +
  658. ' <li style="width:10%"><input type="checkbox" value="cardType"><span>证件类型</span></li>\n' +
  659. ' <li style="width:10%"><input type="checkbox" value="idCard"><span>证件号码</span></li>\n' +
  660. ' <li style="width:10%"><input type="checkbox" value="nation"><span>民族</span></li>\n' +
  661. ' <li style="width:10%"><input type="checkbox" value="politics"><span>政治面貌</span></li>\n' +
  662. ' <li style="width:20.5%"><input type="checkbox" value="entryTime"><span>本单位入职时间</span></li>\n' +
  663. ' <li style="width:10%"><input type="checkbox" value="post"><span>职务</span></li>\n' +
  664. ' <li style="width:20.5%"><input type="checkbox" value="startTime"><span>工作合同开始时间</span></li>\n' +
  665. ' <li style="width:20.5%"><input type="checkbox" value="endTime"><span>工作合同结束时间</span></li>\n' +
  666. ' <li style="width:10%"><input type="checkbox" value="highEducation"><span>最高学历</span></li>\n' +
  667. ' <li style="width:10%"><input type="checkbox" value="graduateSchool"><span>毕业院校</span></li>\n' +
  668. ' <li style="width:10%"><input type="checkbox" value="major"><span>专业</span></li>\n' +
  669. ' <li style="width:10%"><input type="checkbox" value="title"><span>职称</span></li>\n' +
  670. ' <li style="width:20.5%"><input type="checkbox" value="professionalQualifications"><span>国家职业资格</span></li>\n' +
  671. ' <li style="width:20.5%"><input type="checkbox" value="studyAbroad"><span>是否有留学经历</span></li>\n' +
  672. ' <li style="width:10%"><input type="checkbox" value="phone"><span>手机号码</span></li>\n' +
  673. ' <li style="width:10%"><input type="checkbox" value="email"><span>电子邮箱</span></li>\n' +
  674. ' <li style="width:10%"><input type="checkbox" value="bank"><span>开户银行</span></li>\n' +
  675. ' <li style="width:20.5%"><input type="checkbox" value="bankNetwork"><span>开户银行网点</span></li>\n' +
  676. ' <li style="width:10%"><input type="checkbox" value="bankNumber"><span>银行行号</span></li>\n' +
  677. ' <li style="width:10%"><input type="checkbox" value="bankAccount"><span>银行账号</span></li>\n' +
  678. ' <li style="width:31%"><input type="checkbox" value="breakFaith"><span>曾被相关主管部门列为失信个人</span></li>\n' +
  679. ' <li style="width:10%"><input type="checkbox" value="talentArrange"><span>人才层次</span></li>\n' +
  680. ' <li style="width:10%"><input type="checkbox" value="identifyCondition"><span>认定条件</span></li>\n' +
  681. ' <li style="width:20.5%"><input type="checkbox" value="identifyConditionName"><span>认定条件名称</span></li>\n' +
  682. ' <li style="width:20.5%"><input type="checkbox" value="identifyGetTime"><span>认定条件证书取得时间</span></li>\n' +
  683. ' <li style="width:20.5%"><input type="checkbox" value="educationAndResume"><span>教育背景及工作简历</span></li>\n' +
  684. ' <li style="width:20.5%"><input type="checkbox" value="mainHonours"><span>主要业绩及取得的荣誉</span></li>\n' +
  685. ' <li style="width:10%"><input type="checkbox" value="description"><span>备注</span></li>\n' +
  686. ' </ul>\n' +
  687. ' </div>\n' +
  688. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  689. ' <div id="field_file">\n' +
  690. ' </div>\n' +
  691. ' <div class="form-group" style="text-align: center">\n' +
  692. ' <button type="button" class="btn btn-primary" onclick="TalentInfoInfoDlg.checkAll()">全选</button>\n' +
  693. ' <button type="button" class="btn btn-success" onclick="TalentInfoInfoDlg.unCheckAll()">反选</button>\n' +
  694. ' </div>\n' +
  695. ' </div>\n' +
  696. ' </div>\n' +
  697. ' </form>';
  698. } else if (type == 2) {
  699. return '<form id="firstCheckForm">\n' +
  700. ' <div class="form-group" style="margin: 10px;">\n' +
  701. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  702. ' <select class="form-control" id="checkStateFirstModal" onchange="TalentInfoInfoDlg.toggleField()">\n' +
  703. ' <option value="">请选择</option>\n' +
  704. ' <option value="3">审核通过</option>\n' +
  705. ' <option value="2">审核驳回</option>\n' +
  706. ' <option value="-1">审核不通过</option>\n' +
  707. ' </select>\n' +
  708. ' </div>\n' +
  709. ' <div class="form-group" style="margin: 10px;">\n' +
  710. ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
  711. ' <textarea class="form-control" id="checkMsgFirst" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
  712. ' <div id="company_list" style="padding-top:5px;display:none;">\n' +
  713. ' <label for="checkMsg" class="control-label">选择需要再次审核的部门</label>\n' +
  714. ' <div id="companys">' +
  715. ' <ul style="overflow:hidden;list-style:none;"></ul>' +
  716. ' </div>' +
  717. ' </div>\n' +
  718. ' <div id="field" style="padding-top: 5px;display: none">\n' +
  719. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  720. ' <div id="field_info">\n' +
  721. ' <ul style="overflow:hidden;list-style:none;">\n' +
  722. ' <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
  723. ' <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
  724. ' <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
  725. ' <li style="width:10%"><input type="checkbox" value="industryField"><span>行业领域</span></li>\n' +
  726. ' <li style="width:10%"><input type="checkbox" value="address"><span>所属镇街</span></li>\n' +
  727. ' <li style="width:20.5%"><input type="checkbox" value="nationality"><span>国籍/地区</span></li>\n' +
  728. ' <li style="width:10%"><input type="checkbox" value="provinceCode"><span>籍贯省</span></li>\n' +
  729. ' <li style="width:10%"><input type="checkbox" value="cityCode"><span>籍贯市</span></li>\n' +
  730. ' <li style="width:10%"><input type="checkbox" value="countyCode"><span>籍贯县</span></li>\n' +
  731. ' <li style="width:10%"><input type="checkbox" value="cardType"><span>证件类型</span></li>\n' +
  732. ' <li style="width:10%"><input type="checkbox" value="idCard"><span>证件号码</span></li>\n' +
  733. ' <li style="width:10%"><input type="checkbox" value="nation"><span>民族</span></li>\n' +
  734. ' <li style="width:10%"><input type="checkbox" value="politics"><span>政治面貌</span></li>\n' +
  735. ' <li style="width:20.5%"><input type="checkbox" value="entryTime"><span>本单位入职时间</span></li>\n' +
  736. ' <li style="width:10%"><input type="checkbox" value="post"><span>职务</span></li>\n' +
  737. ' <li style="width:20.5%"><input type="checkbox" value="startTime"><span>工作合同开始时间</span></li>\n' +
  738. ' <li style="width:20.5%"><input type="checkbox" value="endTime"><span>工作合同结束时间</span></li>\n' +
  739. ' <li style="width:10%"><input type="checkbox" value="highEducation"><span>最高学历</span></li>\n' +
  740. ' <li style="width:10%"><input type="checkbox" value="graduateSchool"><span>毕业院校</span></li>\n' +
  741. ' <li style="width:10%"><input type="checkbox" value="major"><span>专业</span></li>\n' +
  742. ' <li style="width:10%"><input type="checkbox" value="title"><span>职称</span></li>\n' +
  743. ' <li style="width:20.5%"><input type="checkbox" value="professionalQualifications"><span>国家职业资格</span></li>\n' +
  744. ' <li style="width:20.5%"><input type="checkbox" value="studyAbroad"><span>是否有留学经历</span></li>\n' +
  745. ' <li style="width:10%"><input type="checkbox" value="phone"><span>手机号码</span></li>\n' +
  746. ' <li style="width:10%"><input type="checkbox" value="email"><span>电子邮箱</span></li>\n' +
  747. ' <li style="width:10%"><input type="checkbox" value="bank"><span>开户银行</span></li>\n' +
  748. ' <li style="width:20.5%"><input type="checkbox" value="bankNetwork"><span>开户银行网点</span></li>\n' +
  749. ' <li style="width:10%"><input type="checkbox" value="bankNumber"><span>银行行号</span></li>\n' +
  750. ' <li style="width:10%"><input type="checkbox" value="bankAccount"><span>银行账号</span></li>\n' +
  751. ' <li style="width:31%"><input type="checkbox" value="breakFaith"><span>曾被相关主管部门列为失信个人</span></li>\n' +
  752. ' <li style="width:10%"><input type="checkbox" value="talentArrange"><span>人才层次</span></li>\n' +
  753. ' <li style="width:10%"><input type="checkbox" value="identifyCondition"><span>认定条件</span></li>\n' +
  754. ' <li style="width:20.5%"><input type="checkbox" value="identifyConditionName"><span>认定条件名称</span></li>\n' +
  755. ' <li style="width:20.5%"><input type="checkbox" value="identifyGetTime"><span>认定条件证书取得时间</span></li>\n' +
  756. ' <li style="width:20.5%"><input type="checkbox" value="educationAndResume"><span>教育背景及工作简历</span></li>\n' +
  757. ' <li style="width:20.5%"><input type="checkbox" value="mainHonours"><span>主要业绩及取得的荣誉</span></li>\n' +
  758. ' <li style="width:10%"><input type="checkbox" value="description"><span>备注</span></li>\n' +
  759. ' </ul>\n' +
  760. ' </div>\n' +
  761. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  762. ' <div id="field_file">\n' +
  763. ' </div>\n' +
  764. ' <div class="form-group" style="text-align: center">\n' +
  765. ' <button type="button" class="btn btn-primary" onclick="TalentInfoInfoDlg.checkAll()">全选</button>\n' +
  766. ' <button type="button" class="btn btn-success" onclick="TalentInfoInfoDlg.unCheckAll()">反选</button>\n' +
  767. ' </div>\n' +
  768. ' </div>\n' +
  769. ' </div>\n' +
  770. ' </form>';
  771. }
  772. }
  773. TalentInfoInfoDlg.createNoFieldCheckModal = function () {
  774. return '<form id="commonCheckForm" >\n' +
  775. ' <div class="form-group" style="margin: 10px;">\n' +
  776. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  777. ' <select class="form-control" id="checkStateModal" >\n' +
  778. ' <option value=""></option>\n' +
  779. ' <option value="3">审核通过</option>\n' +
  780. ' <option value="2">审核驳回</option>\n' +
  781. ' </select>\n' +
  782. ' </div>\n' +
  783. ' <div class="form-group" style="margin: 10px;">\n' +
  784. ' <label for="checkMsg" class="control-label">审核意见</label>\n' +
  785. ' <textarea class="form-control" id="checkMsg" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
  786. ' </div>\n' +
  787. ' </form>';
  788. }
  789. $(function () {
  790. $("select:not(#checkStateModal,#checkStateFirstModal)").each(function () {
  791. //$(this).attr("disabled", "disabled");
  792. });
  793. $("input,textarea").not("#checkMsg,#checkMsgFirst").each(function () {
  794. $(this).attr("readonly", "readonly");
  795. });
  796. TalentInfoInfoDlg.typeChange();
  797. TalentInfoInfoDlg.sourceChange();
  798. $('[data-toggle="tooltip"]').tooltip();
  799. var type = $("#type").val();
  800. if (type == 1) {
  801. TalentInfoInfoDlg.initFileTable();
  802. }
  803. /*var source = $("#source").val();
  804. var columns = 3;
  805. if (source == 1 || source == 2) {
  806. columns = 3;
  807. } else if (source == 3 || source == 4) {
  808. columns = 4;
  809. }
  810. $("#source").parents("td").attr("colspan", columns);
  811. $("#talent_arrange").parents("td").attr("colspan", columns);
  812. $("#talent_condition").parents("td").attr("colspan", columns - 1);*/
  813. //$(".ibox-content").viewer({fullscreen: false});
  814. Feng.getCheckLog("logTable", {"type": CONFIG.project_rcrd, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
  815. });