talentInfo_prepare.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. /**
  2. * 人才认定申报管理初始化
  3. */
  4. var TalentInfo = {
  5. id: "TalentInfoTable", //表格id
  6. checkAll: false,
  7. seItem: null, //选中的条目
  8. table: null,
  9. layerIndex: -1
  10. };
  11. /**
  12. * 初始化表格的列
  13. */
  14. TalentInfo.initColumn = function () {
  15. var type = $("#type").val();
  16. var isShow = true;
  17. if (type == 2) {
  18. isShow = false;
  19. }
  20. ;
  21. return [
  22. {field: 'selectItem', checkbox: true},
  23. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  24. {title: '离职状态', field: 'active', visible: true, align: 'center', valign: 'middle', width: '80px',
  25. formatter: function (value, row, index) {
  26. if (value == 1) {
  27. return '<span style="color:#6495ED">在职</span>';
  28. }
  29. if (value == 2) {
  30. return '<span style="color:#FF82AB">离职</span>';
  31. }
  32. }
  33. },
  34. {title: '企业名称', field: 'enterprise_name', visible: true, align: 'center', valign: 'middle', width: '150px'},
  35. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: '120px',
  36. formatter: function (value, row, index) {
  37. if (row.sex == 1) {
  38. return value + '<span style="color:#6495ED">【男】</span>';
  39. }
  40. if (row.sex == 2) {
  41. return value + '<span style="color:#FF82AB">【女】</span>';
  42. }
  43. }
  44. },
  45. // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:'120px',
  46. // formatter : function (value,row,index){
  47. // if(value==1){
  48. // return '晋江市现代产业体系人才';
  49. // }if(value==2){
  50. // return '集成电路优秀人才';
  51. // }
  52. // }
  53. // },
  54. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: '100px'},
  55. {title: '单位标签', field: 'enterprise_tag', visible: isShow, align: 'center', valign: 'middle', width: '100px'},
  56. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: '150px', 'class': 'uitd_showTip'},
  57. {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px'},
  58. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  59. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  60. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
  61. formatter: function (value, row, index) {
  62. switch (value) {
  63. case 14:
  64. return "<span class='label label-success'>待核查征信</span>";
  65. break;
  66. case 16:
  67. return "<span class='label label-danger'>复审失败</span>";
  68. break;
  69. case 21:
  70. return "<span class='label label-success'>待公示</span>";
  71. break;
  72. case 23:
  73. return "<span class='label label-success'>待公示审核</span>";
  74. break;
  75. case 24:
  76. return "<span class='label label-success'>待公布</span>";
  77. break;
  78. case 26:
  79. return "<span class='label label-success'>待发放人才码</span>";
  80. break;
  81. case 28:
  82. return "<span class='label label-primary'>已发放人才码</span>";
  83. break;
  84. case 13:
  85. return "<span class='label label-danger'>复核失败</span>";
  86. break;
  87. case 22:
  88. return "<span class='label label-danger'>征信不通过</span>";
  89. break;
  90. case 25:
  91. return "<span class='label label-danger'>公示审核不通过</span>";
  92. break;
  93. case 27:
  94. return "<span class='label label-danger'>公布不通过</span>";
  95. break;
  96. }
  97. }
  98. },
  99. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
  100. formatter: function (value, row, index) {
  101. return "<span class='label label-success' onclick=\"TalentInfo.showLog('" + value + "')\" >" +
  102. "<i class=\"fa fa-book\"></i>日志" +
  103. "</span>";
  104. }
  105. }
  106. ];
  107. };
  108. /**
  109. * 检查是否选中
  110. */
  111. TalentInfo.check = function () {
  112. var selected = $('#' + this.id).bootstrapTable('getSelections');
  113. if (selected.length == 0) {
  114. Feng.info("请先选中表格中的某一记录!");
  115. return false;
  116. } else {
  117. TalentInfo.seItem = selected[0];
  118. return true;
  119. }
  120. };
  121. /**
  122. * 打开查看人才认定-初级审核详情
  123. */
  124. TalentInfo.openTalentInfoDetail = function () {
  125. if (this.check()) {
  126. var index = layer.open({
  127. type: 2,
  128. title: '人才认定审核详情',
  129. area: ['800px', '420px'], //宽高
  130. fix: false, //不固定
  131. maxmin: true,
  132. content: Feng.ctxPath + '/admin/talent/common_check/id/' + TalentInfo.seItem.id
  133. });
  134. layer.full(index);
  135. TalentInfo.layerIndex = index;
  136. }
  137. };
  138. TalentInfo.prepareSearch = function () {
  139. var sex = $("#pub_sex").val();
  140. var checkState = $("#pub_checkState").val();
  141. var name = $("#pub_name").val();
  142. $('#dataTable').bootstrapTable("refresh", {"query": {"sex": sex, "checkState": checkState, "name": name}});
  143. }
  144. TalentInfo.prepareReset = function () {
  145. $("#pub_sex").val("");
  146. $("#pub_checkState").val("");
  147. $("#pub_name").val("");
  148. }
  149. /**
  150. * 查询需要处理的数据
  151. * @param type
  152. */
  153. TalentInfo.showDataCheckModal = function (type) {
  154. $("#hczxForm").css("display", "none");
  155. switch (type) {
  156. case 1: //待核查征信名单-导出
  157. $("#hczxButton").attr("onclick", "TalentInfo.checkExport()").text("导出");
  158. $("#exportCommonModalLabel").text("待核查征信名单");
  159. break;
  160. case 2: //待核查征信名单-核查征信通过
  161. $("#hczxButton").attr("onclick", "TalentInfo.hczxPass()").text("提交");
  162. $("#exportCommonModalLabel").text("待核查征信名单");
  163. break;
  164. case 3: //公示(批量)
  165. $("#hczxButton").attr("onclick", "TalentInfo.public()").text("公示");
  166. $("#exportCommonModalLabel").text("待公示名单");
  167. $("#hczxForm").css("display", "block");
  168. $(".time").each(function () {
  169. laydate.render({
  170. elem: "#" + $(this).attr("id")
  171. , type: 'date'
  172. , format: 'yyyy年MM月dd日'
  173. });
  174. });
  175. break;
  176. case 4: //公示通过(批量)
  177. $("#hczxButton").attr("onclick", "TalentInfo.publicPass()").text("提交");
  178. $("#exportCommonModalLabel").text("公示通过名单");
  179. break;
  180. case 5: //待公布名单
  181. $("#hczxButton").attr("onclick", "TalentInfo.publish()").text("公布");
  182. $("#exportCommonModalLabel").text("待公布名单");
  183. break;
  184. case 6: //待发放人才码名单
  185. $("#hczxButton").attr("onclick", "TalentInfo.sendCard()").text("提交");
  186. $("#exportCommonModalLabel").text("待发放人才码名单");
  187. break;
  188. case 7: //公示名单预览
  189. $("#hczxButton").attr("onclick", "TalentInfo.needPublicExport()").text("导出");
  190. $("#exportCommonModalLabel").text("待公示名单");
  191. break;
  192. case 8: //公布预览
  193. $("#hczxButton").attr("onclick", "TalentInfo.publishExportBefore()").text("导出");
  194. $("#exportCommonModalLabel").text("待公布名单");
  195. break;
  196. }
  197. $('#dataTable').bootstrapTable('destroy');
  198. $('#dataTable').bootstrapTable({
  199. url: "/admin/talent/selectNeedCheckData?type=" + type,
  200. method: 'POST',
  201. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  202. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  203. showRefresh: false, // 是否显示刷新按钮
  204. clickToSelect: true, // 是否启用点击选中行
  205. singleSelect: false, // 设置True 将禁止多选
  206. striped: true, // 是否显示行间隔色
  207. pagination: true, // 设置为 true 会在表格底部显示分页条
  208. paginationHAlign: "left",
  209. paginationDetailHAlign: "right",
  210. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  211. pageNumber: 1, //初始化加载第一页,默认第一页
  212. pageSize: 10, //每页的记录行数(*)
  213. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  214. maintainSelected: true, //全表全选需要开启
  215. showColumns: false,
  216. responseHandler: function (res) {
  217. $("#exportCommonModal").modal("show");
  218. return res.rows;
  219. },
  220. columns:
  221. [
  222. {field: "selectItem", checkbox: true},
  223. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%"},
  224. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: "30%"},
  225. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "40%"},
  226. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%",
  227. formatter: function (value, row, index) {
  228. if (value == 16) {
  229. return "<span style='color: #ed5565;'>审核不通过</span>";
  230. }
  231. if (value == 14) {
  232. return "<span style='color: #1ab394;'>审核通过</span>";
  233. }
  234. }
  235. },
  236. ]
  237. });
  238. }
  239. /**
  240. * 选择导出提交
  241. */
  242. TalentInfo.checkExport = function () {
  243. var selected = $('#dataTable').bootstrapTable('getSelections');
  244. if (!selected || selected.length < 1) {
  245. Feng.info("请至少选择一行数据!");
  246. return;
  247. }
  248. var ids = "";
  249. for (var i = 0; i < selected.length; i++) {
  250. ids = ids + selected[i].id + ",";
  251. }
  252. window.location.href = Feng.ctxPath + "/admin/talent/prepareHczx?ids=" + ids;
  253. }
  254. /**
  255. * 核查征信批量通过提交
  256. */
  257. TalentInfo.hczxPass = function () {
  258. var selected = $('#dataTable').bootstrapTable('getSelections');
  259. if (!selected || selected.length < 1) {
  260. Feng.info("请至少选择一行数据!");
  261. return;
  262. }
  263. var ids = "";
  264. for (var i = 0; i < selected.length; i++) {
  265. ids = ids + selected[i].id + ",";
  266. }
  267. var operation = function () {
  268. var ajax = new $ax("/admin/talent/hczxPass", function (data) {
  269. if (data.code == 200) {
  270. Feng.success(data.msg);
  271. TalentInfo.table.refresh();
  272. $("#exportCommonModal").modal("hide");
  273. } else {
  274. Feng.error(data.msg);
  275. }
  276. }, function (data) {
  277. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  278. });
  279. ajax.set("ids", ids);
  280. ajax.start();
  281. }
  282. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  283. }
  284. /**
  285. * 显示核查征信驳回模态框
  286. */
  287. TalentInfo.showHczxRejectModal = function () {
  288. if (this.check()) {
  289. if (TalentInfo.seItem.checkState != 14) {
  290. Feng.info("当前记录不是待核查征信状态,无法核查");
  291. return;
  292. }
  293. $("#hczxId").val(TalentInfo.seItem.id);
  294. $("#hczxMsg").val("");
  295. $("#hczxRejectModal").modal("show");
  296. }
  297. }
  298. /**
  299. * 核查征信驳回提交
  300. */
  301. TalentInfo.hczxReject = function () {
  302. var id = $("#hczxId").val();
  303. var msg = $("#hczxMsg").val();
  304. if (msg == null || msg == '') {
  305. Feng.info("请填写失信原因");
  306. return;
  307. }
  308. var operation = function () {
  309. var ajax = new $ax("/admin/talent/hczxReject", function (data) {
  310. if (data.code == 200) {
  311. Feng.success(data.msg);
  312. TalentInfo.table.refresh();
  313. $("#hczxRejectModal").modal("hide");
  314. } else {
  315. Feng.error(data.msg);
  316. }
  317. }, function (data) {
  318. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  319. });
  320. ajax.setData({"id": id, "outMsg": msg});
  321. ajax.start();
  322. }
  323. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  324. }
  325. // /**
  326. // * 导入核查征信名单
  327. // * @param type
  328. // */
  329. // TalentInfo.importHczx = function(){
  330. // $("#importHczx-form")[0].reset();
  331. // $("#hczxModal").modal("show");
  332. // }
  333. // /**
  334. // * 导入提交
  335. // */
  336. // TalentInfo.importHczxSubmit = function(){
  337. // $("#importHczx-form")[0].submit();
  338. // }
  339. /**
  340. * 是否发送短信
  341. */
  342. TalentInfo.toggleMessage = function () {
  343. var isMessage = $("input[name='isSend']:checked").val();
  344. if (isMessage == 1) {
  345. $("#messageEdit").css("display", "block");
  346. } else if (isMessage == 2) {
  347. $("#messageEdit").css("display", "none");
  348. }
  349. }
  350. /**
  351. * 公示预览
  352. */
  353. TalentInfo.needPublicExport = function () {
  354. var selected = $('#dataTable').bootstrapTable('getSelections');
  355. if (!selected || selected.length < 1) {
  356. Feng.info("请至少选择一行数据!");
  357. return;
  358. }
  359. var ids = "";
  360. for (var i = 0; i < selected.length; i++) {
  361. ids = ids + selected[i].id + ",";
  362. }
  363. var operation = function () {
  364. $("#exportCommonModal").modal("hide");
  365. window.location.href = encodeURI(encodeURI("/admin/talent/publicExportBefore?ids=" + ids));
  366. }
  367. Feng.confirm("确定要公示预览吗?", operation);
  368. }
  369. /**
  370. * 公示
  371. */
  372. TalentInfo.public = function () {
  373. var selected = $('#dataTable').bootstrapTable('getSelections');
  374. if (!selected || selected.length < 1) {
  375. Feng.info("请至少选择一行数据!");
  376. return;
  377. }
  378. var ids = "";
  379. for (var i = 0; i < selected.length; i++) {
  380. ids = ids + selected[i].id + ",";
  381. }
  382. var isMessage = $("input[name='isSend']:checked").val();
  383. var typeName = $("#typeName").val();
  384. var address = $("#web").val();
  385. var publicStartTime = $("#publicStartTime").val();
  386. var publicEndTime = $("#publicEndTime").val();
  387. var dep = $("#dep").val();
  388. var phone = $("#fyphone").val();
  389. var email = $("#fyemail").val();
  390. if (isMessage == 1) {
  391. if (typeName == null || typeName == '') {
  392. Feng.info("请填写公示类型");
  393. return;
  394. }
  395. if (address == null || address == '') {
  396. Feng.info("请填写公示平台");
  397. return;
  398. }
  399. if (publicStartTime == null || publicStartTime == '') {
  400. Feng.info("请填写公示开始时间");
  401. return;
  402. }
  403. if (publicEndTime == null || publicEndTime == '') {
  404. Feng.info("请填写公示截止时间");
  405. return;
  406. }
  407. if (dep == null || dep == '') {
  408. Feng.info("请填写反映单位");
  409. return;
  410. }
  411. if (phone == null || phone == '') {
  412. Feng.info("请填写联系电话");
  413. return;
  414. }
  415. if (email == null || email == '') {
  416. Feng.info("请填写联系邮箱");
  417. return;
  418. }
  419. }
  420. var operation = function () {
  421. var index = layer.open({
  422. type: 1,
  423. title: '公示',
  424. area: ['300px', '220px'], //宽高
  425. fix: false, //不固定
  426. maxmin: true,
  427. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
  428. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  429. btnAlign: 'c',
  430. success: function () {
  431. laydate.render({elem: "#publicBatchId", type: 'month', trigger: 'click', format: "yyyyMM"});
  432. },
  433. yes: function (index, layero) {
  434. var month = $("#publicBatchId").val();
  435. if (Feng.isEmptyStr(month)) {
  436. Feng.info("请填写公示批次");
  437. return;
  438. }
  439. layer.close(index);
  440. var ajax = new $ax("/admin/talent/preparePublic", function (data) {
  441. if (data.code == 200) {
  442. Feng.success(data.msg);
  443. TalentInfo.table.refresh();
  444. $("#exportCommonModal").modal("hide");
  445. } else {
  446. Feng.error(data.msg);
  447. }
  448. }, function (data) {
  449. Feng.error("公示失败!" + data.responseJSON.message + "!");
  450. });
  451. ajax.set("ids", ids);
  452. ajax.set("typeName", typeName);
  453. ajax.set("address", address);
  454. ajax.set("publicStartTime", publicStartTime);
  455. ajax.set("publicEndTime", publicEndTime);
  456. ajax.set("dep", dep);
  457. ajax.set("phone", phone);
  458. ajax.set("email", email);
  459. ajax.set("isMessage", isMessage);
  460. ajax.set("batch", month);
  461. ajax.start();
  462. }
  463. });
  464. }
  465. Feng.confirm("确定要公示吗?", operation);
  466. }
  467. //已公示的数据根据公示批次公示导出
  468. TalentInfo.publicExport = function (type) {
  469. var url = "", dateType = '', format = '';
  470. if (type == 1) { //公示导出
  471. url = "/admin/talent/publicExport";
  472. dateType = 'month';
  473. format = "yyyyMM";
  474. } else if (type == 2) { //公布导出
  475. url = Feng.ctxPath + "/admin/talent/publishExport";
  476. dateType = 'date';
  477. format = "yyyy-MM-dd";
  478. }
  479. layer.open({
  480. type: 1,
  481. title: type == 1 ? '公示导出' : "公布导出",
  482. area: ['800px', '300px'], //宽高
  483. fix: false, //不固定
  484. maxmin: true,
  485. content: "<form id=\"publicExportForm\" action=\"" + url + "\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
  486. " <div class=\"form-group col-sm-12\">\n" +
  487. " <div class=\"row\">\n" +
  488. " <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
  489. " <div class=\"col-sm-4\">\n" +
  490. " <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  491. " </div>\n" +
  492. " <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
  493. " <div class=\"col-sm-4\">\n" +
  494. " <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  495. " </div>\n" +
  496. " </div>\n" +
  497. " </div>\n" +
  498. " </form>",
  499. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  500. btnAlign: 'c',
  501. success: function (index, layero) {
  502. $("#publicExportForm")[0].reset();
  503. $("input[time='time']").each(function () {
  504. laydate.render({
  505. elem: "#" + $(this).attr("id")
  506. , type: dateType
  507. , format: format
  508. , trigger: 'click'
  509. });
  510. });
  511. },
  512. yes: function (index) {
  513. var startTime = $("#startTime").val();
  514. var endTime = $("#endTime").val();
  515. if (startTime == null || startTime == '') {
  516. Feng.info("请选择开始时间");
  517. return;
  518. }
  519. if (endTime == null || endTime == '') {
  520. Feng.info("请选择结束时间");
  521. return;
  522. }
  523. $("#publicExportForm")[0].submit();
  524. layer.close(index)
  525. }
  526. });
  527. }
  528. /**
  529. * 公示再审核
  530. */
  531. TalentInfo.afterCheck = function () {
  532. if (this.check()) {
  533. if (TalentInfo.seItem.checkState != 23) {
  534. Feng.info("当前记录不是公示中状态,无法审核");
  535. return;
  536. }
  537. if (TalentInfo.seItem.outMsg != null && TalentInfo.seItem.outMsg != '') {
  538. Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
  539. }
  540. if (TalentInfo.seItem.checkState == 16) {
  541. var html = '<option value="">请选择</option>\n' +
  542. ' <option value="2">驳回/恢复</option>';
  543. $("#checkStateAfter").empty().append(html);
  544. }
  545. if (TalentInfo.seItem.checkState == 14) {
  546. var html = '<option value="">请选择</option>\n' +
  547. ' <option value="-1">审核不通过</option>' +
  548. ' <option value="2">驳回</option>';
  549. $("#checkStateAfter").empty().append(html);
  550. }
  551. $("#checkForm")[0].reset();
  552. $("#mainId").val(TalentInfo.seItem.id);
  553. $("#checkModal").modal("show");
  554. }
  555. }
  556. /**
  557. * 公示后审核提交
  558. */
  559. TalentInfo.afterCheckSubmit = function () {
  560. var checkState = $("#checkStateAfter").val();
  561. var msg = $("#msg").val();
  562. if (checkState == null || checkState == '') {
  563. Feng.info("请选择审核状态");
  564. return;
  565. }
  566. if (msg == null || msg == '') {
  567. Feng.info("请填写审核意见");
  568. return;
  569. }
  570. var operation = function () {
  571. var ajax = new $ax(Feng.ctxPath + "/admin/talent/prepareCheck", function (data) {
  572. if (data.code == 200) {
  573. Feng.success(data.msg);
  574. TalentInfo.table.refresh();
  575. $("#checkModal").modal("hide");
  576. } else {
  577. Feng.error(data.msg);
  578. }
  579. }, function (data) {
  580. Feng.error("审核失败!" + data.responseJSON.message + "!");
  581. });
  582. ajax.setData({"id": $("#mainId").val(), "checkState": $("#checkStateAfter").val(), "checkMsg": msg});
  583. ajax.start();
  584. }
  585. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  586. }
  587. /**
  588. * 批量公示通过
  589. * @param type
  590. */
  591. TalentInfo.publicPass = function () {
  592. var selected = $('#dataTable').bootstrapTable('getSelections');
  593. if (!selected || selected.length < 1) {
  594. Feng.info("请至少选择一行数据!");
  595. return;
  596. }
  597. var ids = "";
  598. for (var i = 0; i < selected.length; i++) {
  599. ids = ids + selected[i].id + ",";
  600. }
  601. var operation = function () {
  602. var ajax = new $ax("/admin/talent/publicPass", function (data) {
  603. if (data.code == 200) {
  604. Feng.success(data.msg);
  605. TalentInfo.table.refresh();
  606. $("#exportCommonModal").modal("hide");
  607. } else {
  608. Feng.error(data.msg);
  609. }
  610. }, function (data) {
  611. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  612. });
  613. ajax.set("ids", ids);
  614. ajax.start();
  615. }
  616. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  617. }
  618. /**
  619. * 公布预览
  620. */
  621. TalentInfo.publishExportBefore = function () {
  622. var selected = $('#dataTable').bootstrapTable('getSelections');
  623. if (!selected || selected.length < 1) {
  624. Feng.info("请至少选择一行数据!");
  625. return;
  626. }
  627. var ids = "";
  628. for (var i = 0; i < selected.length; i++) {
  629. ids = ids + selected[i].id + ",";
  630. }
  631. var operation = function () {
  632. $("#exportCommonModal").modal("hide");
  633. window.location.href = "/admin/talent/publishExportBefore?ids=" + ids;
  634. }
  635. Feng.confirm("确定要导出吗?", operation);
  636. }
  637. /**
  638. * 公布审核
  639. */
  640. TalentInfo.singlePublish = function () {
  641. if (this.check()) {
  642. if (TalentInfo.seItem.checkState != 24) {
  643. Feng.info("当前记录不是公示再审核通过状态,无法审核");
  644. return;
  645. }
  646. /*if (TalentInfo.seItem.checkState == 13) {
  647. var html = '<option value="">请选择</option>\n' +
  648. ' <option value="2">驳回/恢复</option>';
  649. $("#checkStateAfter").empty().append(html);
  650. }
  651. if (TalentInfo.seItem.checkState == 11) {
  652. var html = '<option value="">请选择</option>\n' +
  653. ' <option value="-1">审核不通过</option>' +
  654. ' <option value="2">驳回</option>';
  655. $("#checkStateAfter").empty().append(html);
  656. }*/
  657. $("#checkForm")[0].reset();
  658. $("#mainId").val(TalentInfo.seItem.id);
  659. $("#publishModal").modal("show");
  660. laydate.render({elem: "#publishBatch", type: 'date', trigger: 'click', format: "yyyy-MM-dd"});
  661. }
  662. }
  663. TalentInfo.publishStateChange = function () {
  664. var state = $("#checkStatePublish").val();
  665. if (state == 1) {
  666. $("#checkStatePublish").parents(".row").next(".row").css("display", "block");
  667. } else {
  668. $("#checkStatePublish").parents(".row").next(".row").css("display", "none");
  669. }
  670. }
  671. /**
  672. * 公示后审核提交
  673. */
  674. TalentInfo.singlePublishSubmit = function () {
  675. var checkState = $("#checkStatePublish").val();
  676. var msg = $("#publishMsg").val();
  677. var month = $("#publishBatch").val();
  678. if (checkState == null || checkState == '') {
  679. Feng.info("请选择审核状态");
  680. return;
  681. }
  682. if (Feng.isEmptyStr(month)) {
  683. Feng.info("请填写公布批次");
  684. return;
  685. }
  686. if (msg == null || msg == '') {
  687. Feng.info("请填写审核意见");
  688. return;
  689. }
  690. var operation = function () {
  691. var ajax = new $ax("/admin/talent/publish", function (data) {
  692. if (data.code == 200) {
  693. Feng.success(data.msg);
  694. TalentInfo.table.refresh();
  695. $("#publishModal").modal("hide");
  696. } else {
  697. Feng.error(data.msg);
  698. }
  699. }, function (data) {
  700. Feng.error("审核失败!" + data.responseJSON.message + "!");
  701. });
  702. ajax.setData({"id": $("#mainId").val(), "checkState": checkState, "checkMsg": msg, batch: month});
  703. ajax.start();
  704. }
  705. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  706. }
  707. /**
  708. * 批量公布
  709. */
  710. TalentInfo.publish = function () {
  711. var selected = $('#dataTable').bootstrapTable('getSelections');
  712. if (!selected || selected.length < 1) {
  713. Feng.info("请至少选择一行数据!");
  714. return;
  715. }
  716. var ids = "";
  717. for (var i = 0; i < selected.length; i++) {
  718. ids = ids + selected[i].id + ",";
  719. }
  720. var operation = function () {
  721. var index = layer.open({
  722. type: 1,
  723. title: '公布',
  724. area: ['300px', '220px'], //宽高
  725. fix: false, //不固定
  726. maxmin: true,
  727. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公布日期(公布入选月份)'>",
  728. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  729. btnAlign: 'c',
  730. success: function () {
  731. laydate.render({elem: "#publicBatchId", type: 'date', trigger: 'click', format: "yyyy-MM-dd"});
  732. },
  733. yes: function (index, layero) {
  734. var month = $("#publicBatchId").val();
  735. if (Feng.isEmptyStr(month)) {
  736. Feng.info("请填写公布批次");
  737. return;
  738. }
  739. layer.close(index);
  740. var ajax = new $ax(Feng.ctxPath + "/admin/talent/preparePublish", function (data) {
  741. if (data.code == 200) {
  742. Feng.success(data.msg);
  743. TalentInfo.table.refresh();
  744. $("#exportCommonModal").modal("hide");
  745. } else {
  746. Feng.error(data.msg);
  747. }
  748. }, function (data) {
  749. Feng.error("公布失败!" + data.responseJSON.message + "!");
  750. });
  751. ajax.set("ids", ids);
  752. ajax.set("batch", month);
  753. ajax.start();
  754. }
  755. });
  756. }
  757. Feng.confirm("一旦确认无法修改,确定要公布吗?", operation);
  758. }
  759. /**
  760. * 撤销公布
  761. */
  762. TalentInfo.canclePublish = function () {
  763. if (this.check()) {
  764. var operation = function () {
  765. var ajax = new $ax(Feng.ctxPath + "/talentInfo/canclePublish", function (data) {
  766. if (data.code == 200) {
  767. Feng.success(data.msg);
  768. TalentInfo.table.refresh();
  769. } else {
  770. Feng.error(data.msg);
  771. }
  772. }, function (data) {
  773. Feng.error("撤销公布失败!" + data.responseJSON.message + "!");
  774. });
  775. ajax.set("id", TalentInfo.seItem.id);
  776. ajax.start();
  777. }
  778. Feng.confirm("一旦撤销无法修改,确定要撤销公布吗?", operation);
  779. }
  780. }
  781. //发放人才码
  782. TalentInfo.sendCard = function () {
  783. var selected = $('#dataTable').bootstrapTable('getSelections');
  784. if (!selected || selected.length < 1) {
  785. Feng.info("请至少选择一行数据!");
  786. return;
  787. }
  788. var ids = "";
  789. for (var i = 0; i < selected.length; i++) {
  790. ids = ids + selected[i].id + ",";
  791. }
  792. var operation = function () {
  793. var ajax = new $ax("/admin/talent/prepareCertification", function (data) {
  794. if (data.code == 200) {
  795. Feng.success(data.msg);
  796. TalentInfo.table.refresh();
  797. $("#exportCommonModal").modal("hide");
  798. } else {
  799. Feng.error(data.msg);
  800. }
  801. }, function (data) {
  802. Feng.error("发放人才码失败!" + data.responseJSON.message + "!");
  803. });
  804. ajax.set("ids", ids);
  805. ajax.start();
  806. }
  807. Feng.confirm("一旦发放人才码无法修改,确定要发放人才码吗?", operation);
  808. }
  809. //回调
  810. TalentInfo.callBack = function (data) {
  811. Feng.info(data.msg);
  812. if (data.code == 200) {
  813. $("#hczxModal").modal("hide");
  814. TalentInfo.table.refresh();
  815. }
  816. }
  817. $(function () {
  818. var defaultColunms = TalentInfo.initColumn();
  819. var table = new BSTable(TalentInfo.id, "/admin/talent/base_verify_list/process/6", defaultColunms);
  820. table.setPaginationType("server");
  821. table.setSingleSelect(false);
  822. table.setOnDblClickRow(function () {
  823. TalentInfo.openTalentInfoDetail();
  824. });
  825. var t = TalentInfo.table = table.init();
  826. TalentInfo.init();
  827. $('#checkAll').click(function () {
  828. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  829. })
  830. $('#uncheckAll').click(function () {
  831. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  832. })
  833. });