talentInfo_common_check.js 47 KB

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