talentInfo_common_check.js 51 KB

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