talentInfo_prepare.js 32 KB

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